]> OCCT Git - occt.git/commitdiff
0029144: Modeling Algorithms - BOP PaveFiller hangs in some case CR29144_6
authorakaftasev <akaftasev@opencascade.com>
Fri, 24 May 2024 10:40:51 +0000 (11:40 +0100)
committerakaftasev <akaftasev@opencascade.com>
Mon, 27 May 2024 15:47:00 +0000 (16:47 +0100)
Changed decreasing aDeltaRestrictor to division by 2 instead of value assignment to aDelta if point does not found.
Changed wrong comparison of two Standard_Real values.

src/IntTools/IntTools_BeanFaceIntersector.cxx
tests/bugs/modalg_7/bug26563
tests/perf/modalg/bug29144 [new file with mode: 0644]

index aa0318de9943c2cefa1c866e3cc07bb2b80301ad..d00108bded8af47df3838bfa17badc1d0229a820 100644 (file)
@@ -1166,7 +1166,7 @@ void IntTools_BeanFaceIntersector::ComputeRangeFromStartPoint(const Standard_Boo
     if(anExtrema.IsDone()) {
       if(anExtrema.SquareDistance() < myCriteria * myCriteria) {
         Extrema_POnSurf aPOnSurf = anExtrema.Point();
-       aPOnSurf.Parameter(U, V);
+        aPOnSurf.Parameter(U, V);
         pointfound = Standard_True;
       }
     }
@@ -1182,13 +1182,13 @@ void IntTools_BeanFaceIntersector::ComputeRangeFromStartPoint(const Standard_Boo
         break;
     }
     else {
-      aDeltaRestrictor = aDelta;
+      aDeltaRestrictor *= 0.5;
     }
     
     // if point found decide to increase aDelta using derivative of distance function
     //
     
-    aDelta = (pointfound) ? (aDelta * 2.) : (aDelta * 0.5);
+    aDelta *= (pointfound) ? 2.0 : 0.5;
     aDelta = (aDelta < aDeltaRestrictor) ? aDelta : aDeltaRestrictor;
 
     aCurPar = (ToIncreaseParameter) ? (aPrevPar + aDelta) : (aPrevPar - aDelta);
@@ -1197,8 +1197,10 @@ void IntTools_BeanFaceIntersector::ComputeRangeFromStartPoint(const Standard_Boo
     // prevent infinite loop when (aPrevPar +/- aDelta) == aPrevPar == 0.
     //
     
-    if( aCurPar == aPrevPar )
+    if (Abs(aCurPar - aPrevPar) < myCurveResolution)
+    {
       break;
+    }
     
     BoundaryCondition  = (ToIncreaseParameter) ? (aCurPar > aCurrentRange.Last()) : (aCurPar < aCurrentRange.First());
     
index 34557fec8d0e597ebf16b746a2a5b1dcedafe368..d3de2d231914c38b37e2524336667c854510b1fe 100644 (file)
@@ -18,6 +18,6 @@ bapibop result 2
 
 checkshape result
 checkprops result -v 1.52043e+7
-checknbshapes result -vertex 234 -edge 354 -wire 122 -face 121 -shell 1 -solid 1 -compsolid 0 -compound 1 -shape 834
+checknbshapes result -vertex 235 -edge 355 -wire 122 -face 121 -shell 1 -solid 1 -compsolid 0 -compound 1 -shape 836
 
 checkview -display result -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/perf/modalg/bug29144 b/tests/perf/modalg/bug29144
new file mode 100644 (file)
index 0000000..72dc0f7
--- /dev/null
@@ -0,0 +1,27 @@
+puts "========"
+puts "0029144: Modeling Algorithms - BOP PaveFiller hangs in some case"
+puts "========"
+puts ""
+
+puts "TODO OCC29145 ALL : Faulty shapes in variables faulty_1 to faulty_"
+
+bclearobjects;
+bcleartools;
+
+restore [locate_data_file bug29093_hung3.brep] a
+explode a So
+baddobjects a_7
+baddtools a_11
+
+dchrono cr restart
+
+bfillds
+bbuild result
+
+dchrono cr stop counter bbuild
+
+checkshape result
+checkprops result -s 1313890 -v 46778600
+checknbshapes result -vertex 9 -edge 20 -wire 12 -face 12 -shell 3 -solid 3 
+
+checkview -display result -2d -path ${imagedir}/${test_image}.png