diff --git a/src/BRepClass/BRepClass_Intersector.cxx b/src/BRepClass/BRepClass_Intersector.cxx index 4cdebf6b10..847d877329 100644 --- a/src/BRepClass/BRepClass_Intersector.cxx +++ b/src/BRepClass/BRepClass_Intersector.cxx @@ -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 index 0000000000..53e19accd0 --- /dev/null +++ b/tests/bugs/modalg_7/bug29887_1 @@ -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 index 0000000000..c25d3d66b1 --- /dev/null +++ b/tests/bugs/modalg_7/bug29887_2 @@ -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