]> OCCT Git - occt.git/commitdiff
0033648: Modeling Algorithms - Bad partition result
authorastromko <astromko@opencascade.com>
Wed, 7 Aug 2024 14:15:43 +0000 (15:15 +0100)
committerjfa <jfa@opencascade.com>
Wed, 4 Sep 2024 14:58:18 +0000 (15:58 +0100)
Removed unnecessary tolerance increase for Line\Line intersection.
Tolerance increasing logic for some specific curve types
  was added with #26619.
Original fix had no test for Line/Line case and
  theoretically was added as a possible issue.
After research Line/Line case doesn't need a special tolerance case.

src/BOPAlgo/BOPAlgo_PaveFiller_3.cxx
tests/bugs/modalg_8/bug33648 [new file with mode: 0644]

index 7dd8b3ee418090e2963a1727541626d60c38ac97..7515035ddaa7a1a835b98fca049f1ae099a04969 100644 (file)
@@ -341,12 +341,8 @@ void BOPAlgo_PaveFiller::PerformEE(const Message_ProgressRange& theRange)
       GeomAbs_CurveType aType1 = aBAC1.GetType();
       GeomAbs_CurveType aType2 = aBAC2.GetType();
       //
-      bAnalytical = (((aType1 == GeomAbs_Line) &&
-                      (aType2 == GeomAbs_Line ||
-                       aType2 == GeomAbs_Circle)) ||
-                     ((aType2 == GeomAbs_Line) &&
-                      (aType1 == GeomAbs_Line ||
-                       aType1 == GeomAbs_Circle)));
+      bAnalytical = (aType1 == GeomAbs_Line && aType2 == GeomAbs_Circle) ||
+                    (aType1 == GeomAbs_Circle && aType2 == GeomAbs_Line);
     }
     //
     for (i=1; i<=aNbCPrts; ++i) {
@@ -443,7 +439,7 @@ void BOPAlgo_PaveFiller::PerformEE(const Message_ProgressRange& theRange)
 
           Standard_Real aTolVnew = BRep_Tool::Tolerance(aVnew);
           if (bAnalytical) {
-            // increase tolerance for Line/Line intersection, but do not update 
+            // increase tolerance for Line/Circle intersection, but do not update 
             // the vertex till its intersection with some other shape
             Standard_Real aTolMin = (BRepAdaptor_Curve(aE1).GetType() == GeomAbs_Line) ?
               (aCR1.Last() - aCR1.First()) / 2. : (aCR2.Last() - aCR2.First()) / 2.;
diff --git a/tests/bugs/modalg_8/bug33648 b/tests/bugs/modalg_8/bug33648
new file mode 100644 (file)
index 0000000..c73ea15
--- /dev/null
@@ -0,0 +1,26 @@
+puts "==================================================="
+puts "0033648: Modeling Algorithms - Bad partition result"
+puts "==================================================="
+puts ""
+
+pload MODELING
+restore [locate_data_file bug33648_1.brep] s1
+restore [locate_data_file bug33648_2.brep] s2
+
+baddobjects s1 s2
+bfillds
+bbuild result
+
+checkprops result -s 87.2813
+checknbshapes result -vertex 58 -edge 97 -wire 44 -face 44 -shell 4 -solid 4 -compsolid 0 -compound 2 -shape 253
+
+set expected_MaxTolerance 0.05
+regexp {Tolerance +MAX=([-0-9.+eE]+)} [tolerance result] full MaxTolerance
+if { $MaxTolerance > $expected_MaxTolerance } {
+       puts "Error : too big tolerance for the shape (should be less than $expected_MaxTolerance, now $MaxTolerance)"
+}
+
+vinit
+vdisplay result
+vfit
+checkview -screenshot -3d -path ${imagedir}/${test_image}.png