]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
try to use ALWAYS fuzzy parameter on BOOLEAN CUT mbs/40272_cutting_problem
authormbs <martin.bernhard@opencascade.com>
Mon, 15 Jan 2024 10:13:12 +0000 (10:13 +0000)
committermbs <martin.bernhard@opencascade.com>
Mon, 15 Jan 2024 10:13:12 +0000 (10:13 +0000)
src/GEOMImpl/GEOMImpl_BooleanDriver.cxx

index 765880b0e36fac89c52004b80f246400d992798c..b9add8e452f02dae2c042864936c08ceab8d811a 100644 (file)
@@ -471,6 +471,35 @@ TopoDS_Shape GEOMImpl_BooleanDriver::performOperation
     TopTools_ListIteratorOfListOfShape itSub1 (listShapes);
     for (; itSub1.More(); itSub1.Next()) {
       TopoDS_Shape aCut = itSub1.Value();
+#if 0 /*USE_FUZZY*/
+      TopTools_ListOfShape lstArgs;
+      lstArgs.Append(aCut);
+      // tools
+      // TopTools_ListIteratorOfListOfShape itSub2 (listTools);
+      // TopTools_ListOfShape lstTools;
+      // for (; itSub2.More(); itSub2.Next()) {
+      //   TopoDS_Shape aTool = itSub2.Value();
+      //   lstTools.Append(aTool);
+      //   // // BRepAlgoAPI_Cut BO;
+      //   // // BO.SetArguments(lstArgs);
+      //   // // BO.SetTools(lstTools);
+      //   // // BO.SetFuzzyValue(1.e-5);
+      //   // // BO.Build();
+      //   // if (!BO.IsDone()) {
+      //   //   StdFail_NotDone::Raise("Cut operation can not be performed on the given shapes");
+      //   // }
+      //   // aCut = BO.Shape();
+      // }
+      BRepAlgoAPI_Cut BO;
+      BO.SetArguments(lstArgs);
+      BO.SetTools(listTools);// (lstTools);
+      BO.SetFuzzyValue(1.e-5);
+      BO.Build();
+      if (!BO.IsDone()) {
+        StdFail_NotDone::Raise("Cut operation can not be performed on the given shapes");
+      }
+      aCut = BO.Shape();
+#else /*ORIGINAL*/
       // tools
       TopTools_ListIteratorOfListOfShape itSub2 (listTools);
       for (; itSub2.More(); itSub2.Next()) {
@@ -481,6 +510,7 @@ TopoDS_Shape GEOMImpl_BooleanDriver::performOperation
         }
         aCut = BO.Shape();
       }
+#endif
       if (isCompound) {
         // check result of this step: if it is a compound (boolean operations
         // always return a compound), we add all sub-shapes of it.