0029887: Wrong result of CUT operation due to incorrect point-face classification
authornbv <nbv@opencascade.com>
Wed, 20 Jun 2018 14:30:00 +0000 (17:30 +0300)
committerkgv <kgv@opencascade.com>
Sat, 23 Jun 2018 10:34:38 +0000 (13:34 +0300)
Use of input tolerance has been eliminated in Geom2dInt_GInter algorithm called from BRepClass_Intersector::Perform(...) method.
Now the input tolerance is used only for checking ON-status of classification.

src/BRepClass/BRepClass_Intersector.cxx
tests/bugs/modalg_7/bug29887_1 [new file with mode: 0644]
tests/bugs/modalg_7/bug29887_2 [new file with mode: 0644]

index 4cdebf6..847d877 100644 (file)
@@ -135,10 +135,10 @@ void  BRepClass_Intersector::Perform(const gp_Lin2d& L,
   IntRes2d_Domain DL;
   //
   if(P!=RealLast()) {
-    DL.SetValues(L.Location(),0.,aTolZ,ElCLib::Value(P,L),P,aTolZ);
+    DL.SetValues(L.Location(),0.,Precision::PConfusion(),ElCLib::Value(P,L),P,Precision::PConfusion());
   }
   else { 
-    DL.SetValues(L.Location(),0.,aTolZ,Standard_True);
+    DL.SetValues(L.Location(),0.,Precision::PConfusion(),Standard_True);
   }
 
   IntRes2d_Domain DE(pdeb,deb,toldeb,pfin,fin,tolfin);
diff --git a/tests/bugs/modalg_7/bug29887_1 b/tests/bugs/modalg_7/bug29887_1
new file mode 100644 (file)
index 0000000..53e19ac
--- /dev/null
@@ -0,0 +1,24 @@
+puts "========"
+puts "OCC29887: Wrong result of CUT operation due to incorrect point-face classification"
+puts "========"
+puts ""
+
+brestore [locate_data_file bug29887_ar_shape_to_cuts.brep] s1
+brestore [locate_data_file bug29887_ar_cutting_shapes.brep] s2
+
+bcut result s1 s2
+checknbshapes result -face 2 -wire 2
+
+checkshape result
+
+if {[regexp "Faulties" [bopargcheck result]]} {
+  puts "Error: bopargcheck has found some faulties in result"
+}
+
+checkprops result -s 319.71
+
+smallview 
+don result
+fit
+
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/bugs/modalg_7/bug29887_2 b/tests/bugs/modalg_7/bug29887_2
new file mode 100644 (file)
index 0000000..c25d3d6
--- /dev/null
@@ -0,0 +1,28 @@
+puts "========"
+puts "OCC29887: Wrong result of CUT operation due to incorrect point-face classification"
+puts "========"
+puts ""
+
+brestore [locate_data_file bug29887_ar_shape_to_cuts.brep] s1
+
+point p 11.633693861603586 -0.88940231049090079
+
+if { ![regexp {IN} [ b2dclassifx s1 p ] ] } {
+    puts "Error : Wrong result of 2d classifier algorithm"
+} else {
+    puts "OK : Good result of 2d classifier algorithm"
+}
+
+if { ![regexp {IN} [ b2dclassify s1 p ] ] } {
+    puts "Error : Wrong result of 2d classifier algorithm"
+} else {
+    puts "OK : Good result of 2d classifier algorithm"
+}
+
+smallview -2D-
+2dclear
+display p
+pcurve s1
+2dfit
+
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png