0031655: Modeling Algorithms - Invalid result of General Fuse operation
authoremv <emv@opencascade.com>
Fri, 10 Jul 2020 06:02:26 +0000 (09:02 +0300)
committerbugmaster <bugmaster@opencascade.com>
Sat, 11 Jul 2020 08:26:31 +0000 (11:26 +0300)
IntTools_BeanFaceIntersector: Perform exact intersection range search in case there are few intersection points.

src/IntTools/IntTools_BeanFaceIntersector.cxx
tests/bugs/modalg_7/bug31655 [new file with mode: 0644]
tests/bugs/moddata_2/pro19422_1

index 5796905a3cf85ca3521cf8121b63c4e4ff78c7ed..323e249f88f631257ce9a6ee1b7956fa27153b62 100644 (file)
@@ -582,10 +582,19 @@ void IntTools_BeanFaceIntersector::ComputeAroundExactIntersection()
   Handle(BRepAdaptor_HSurface) aSurface = new BRepAdaptor_HSurface(mySurface);
   
   anExactIntersector.Perform(aCurve, aSurface);
-  
-  if(anExactIntersector.IsDone()) {
+
+  if (anExactIntersector.IsDone()) {
     Standard_Integer i = 0;
-    
+
+    if (anExactIntersector.NbPoints() > 1)
+    {
+      // To avoid unification of the intersection points in a single intersection
+      // range, perform exact range search considering the lowest possible tolerance
+      // for edge and face.
+      myCriteria = 3 * Precision::Confusion();
+      myCurveResolution = myCurve.Resolution (myCriteria);
+    }
+
     for(i = 1; i <= anExactIntersector.NbPoints(); i++) {
       const IntCurveSurface_IntersectionPoint& aPoint = anExactIntersector.Point(i);
       
diff --git a/tests/bugs/modalg_7/bug31655 b/tests/bugs/modalg_7/bug31655
new file mode 100644 (file)
index 0000000..61146b5
--- /dev/null
@@ -0,0 +1,46 @@
+puts "============================================================================================="
+puts "0031655: Modeling Algorithms - Invalid result of General Fuse operation"
+puts "============================================================================================="
+puts ""
+
+restore [locate_data_file bug31604_a.brep] a
+restore [locate_data_file bug31604_b.brep] b
+
+bclearobjects
+bcleartools
+baddobjects a
+baddtools b
+bfillds
+
+bbop r0 0
+bbop r1 1
+bbop r2 2
+bbop r3 3
+bbop r4 4
+bbuild r5
+
+checkshape r0
+checknbshapes r0 -wire 63 -face 63 -shell 1 -solid 1
+checkprops r0 -s 3567.57 -v 3621.95
+
+checkshape r1
+checknbshapes r1 -wire 61 -face 51 -shell 1 -solid 1
+checkprops r1 -s 13208 -v 28488.4
+
+checkshape r2
+checknbshapes r2 -wire 55 -face 51 -shell 2 -solid 2
+checkprops r2 -s 10997.5 -v 21661.1
+
+checkshape r3
+checknbshapes r3 -wire 69 -face 63 -shell 1 -solid 1
+checkprops r3 -s  5782.58 -v 3224.25
+
+checkshape r4
+checksection r4 -r 4
+checkprops r4 -l 470.345
+
+checkshape r5
+checknbshapes r5 -wire 124 -face 114 -shell 4 -solid 4
+checkprops r5 -s 20343.2 -v 28488.6
+
+checkview -display r3 -2d -path ${imagedir}/${test_image}.png
index 9873abb4687b8c0499106f87894d5a0cc7f6450b..244676147d23e1a3bbee4870ebf337fb0933045c 100755 (executable)
@@ -16,5 +16,6 @@ checkshape tool
 bcut result shape tool
 
 checkprops result -s 3166.93
+checknbshapes result -wire 8 -face 8 -shell 1 -solid 1
 checkview -display result -2d -path ${imagedir}/${test_image}.png