GeomAbs_CurveType aType;
Geom2dAdaptor_Curve aGAC2D(aC2D);
aType=aGAC2D.GetType();
- if (aType==GeomAbs_BSplineCurve || aType==GeomAbs_BezierCurve) {
+ if (aType==GeomAbs_BSplineCurve ||
+ aType==GeomAbs_BezierCurve) {
dt=1.1*dt;
}
if (fabs (aTV-aFirst) < fabs(aTV - aLast)) {
aTV1=aTV - dt;
}
//
- aGAC2D.D0 (aTV1, aPV1);
- aGAC2D.D0 (aTV, aPV);
- //
- aV2D = bIsIN ? gp_Vec2d(aPV1, aPV) : gp_Vec2d(aPV, aPV1);
+ if (aType==GeomAbs_Circle) {
+ Standard_Real aTM;
+ TopAbs_Orientation aOrE;
+ gp_Pnt2d aPM;
+ //
+ aTM=0.5*(aTV1+aTV);
+ //
+ aGAC2D.D1(aTM, aPM, aV2D);
+ aOrE=anEdge.Orientation();
+ if (aOrE==TopAbs_REVERSED) {
+ aV2D.Reverse();
+ }
+ }
+ else {
+ aGAC2D.D0 (aTV1, aPV1);
+ aGAC2D.D0 (aTV, aPV);
+ //
+ aV2D = bIsIN ? gp_Vec2d(aPV1, aPV) : gp_Vec2d(aPV, aPV1);
+ }
//
gp_Dir2d aDir2D(aV2D);
anAngle=Angle(aDir2D);
--- /dev/null
+puts "============"
+puts "OCC26582"
+puts "============"
+puts ""
+###############################
+## Wrong result obtained by Common operator.
+###############################
+
+restore [locate_data_file bug26582_bx.brep] bx
+
+explode bx
+copy bx_1 b1
+copy bx_2 b2
+
+bclearobjects
+bcleartools
+baddobjects b1
+baddtools b2
+
+bfillds
+bbop result 0
+
+set square 39.1778
+
+set nbshapes_expected "
+Number of shapes in shape
+ VERTEX : 5
+ EDGE : 7
+ WIRE : 3
+ FACE : 3
+ SHELL : 1
+ SOLID : 0
+ COMPSOLID : 0
+ COMPOUND : 1
+ SHAPE : 20
+"
+checknbshapes result -ref ${nbshapes_expected} -t -m "result obtained by Common operator"
+
+set 3dviewer 1