]> OCCT Git - occt.git/commitdiff
0025838: Wrong result obtained by General Fuse operator.
authorpkv <pkv@opencascade.com>
Thu, 19 Feb 2015 12:02:32 +0000 (15:02 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 19 Feb 2015 12:03:26 +0000 (15:03 +0300)
Changes:
class BOPTools_AlgoTools
method:
   Standard_Boolean BOPTools_AlgoTools::GetFaceOff
  (const TopoDS_Edge& theE1,
   const TopoDS_Face& theF1,
   BOPTools_ListOfCoupleOfShape& theLCSOff,
   TopoDS_Face& theFOff,
   Handle(IntTools_Context)& theContext)
   has been changed.
   The comparison of the angles done with the angular tolerance value

Test case for issue CR25838

src/BOPTools/BOPTools_AlgoTools.cxx
tests/bugs/modalg_5/bug25838 [new file with mode: 0644]

index 8a5e9dc9cf9e224e83706fa4d401ed060ebd64f6..5a61d5386929e838ae0003a50ea2f5a4830ba20b 100644 (file)
@@ -813,7 +813,7 @@ Standard_Boolean BOPTools_AlgoTools::GetFaceOff
 {
   Standard_Boolean bRet;
   Standard_Real aT, aT1, aT2, aAngle, aTwoPI, aAngleMin, aDt3D;
-  Standard_Real aUmin, aUsup, aVmin, aVsup;
+  Standard_Real aUmin, aUsup, aVmin, aVsup, aPA;
   gp_Pnt aPn1, aPn2, aPx;
   gp_Dir aDN1, aDN2, aDBF, aDBF2, aDTF;
   gp_Vec aVTgt;
@@ -823,6 +823,7 @@ Standard_Boolean BOPTools_AlgoTools::GetFaceOff
   BOPTools_ListIteratorOfListOfCoupleOfShape aIt;
   GeomAPI_ProjectPointOnSurf aProjPL;
   //
+  aPA=Precision::Angular();
   aAngleMin=100.;
   aTwoPI=M_PI+M_PI;
   aC3D =BRep_Tool::Curve(theE1, aT1, aT2);
@@ -860,7 +861,7 @@ Standard_Boolean BOPTools_AlgoTools::GetFaceOff
       aAngle=aTwoPI+aAngle;
     }
     //
-    if (aAngle<Precision::Angular()) {
+    if (aAngle<aPA) {
       if (aF2==theF1) {
         aAngle=M_PI;
       }
@@ -869,6 +870,11 @@ Standard_Boolean BOPTools_AlgoTools::GetFaceOff
       }
     }
     //
+    if (fabs(aAngle-aAngleMin)<aPA) {
+      // the minimal angle can not be found
+      bRet=Standard_False; 
+    }
+    //
     if (aAngle<aAngleMin){
       aAngleMin=aAngle;
       theFOff=aF2;
diff --git a/tests/bugs/modalg_5/bug25838 b/tests/bugs/modalg_5/bug25838
new file mode 100644 (file)
index 0000000..3ff3690
--- /dev/null
@@ -0,0 +1,36 @@
+puts "========="
+puts "OCC25838"
+puts "========="
+puts ""
+###############################################
+# Wrong result obtained by General Fuse operator.
+###############################################
+
+restore [locate_data_file bug25715_p02c3s1.brep] b1
+restore [locate_data_file bug25838_p02c3s2.brep] b2
+restore [locate_data_file bug25715_p02c3s3.brep] b3
+
+bclearobjects
+bcleartools
+baddobjects b1 b2 b3
+
+bfillds
+bbuild result
+
+set square 3107.42
+
+set nbshapes_expected "
+Number of shapes in shape
+ VERTEX    : 26
+ EDGE      : 45
+ WIRE      : 23
+ FACE      : 23
+ SHELL     : 5
+ SOLID     : 5
+ COMPSOLID : 0
+ COMPOUND  : 1
+ SHAPE     : 128
+"
+checknbshapes result ${nbshapes_expected} 1 "Result done by General Fuse operator"
+
+set 2dviewer 1