0030903: Bug in IntCurvesFace_ShapeIntersector
authoremv <emv@opencascade.com>
Tue, 27 Aug 2019 07:02:26 +0000 (10:02 +0300)
committerapn <apn@opencascade.com>
Thu, 29 Aug 2019 16:03:48 +0000 (19:03 +0300)
When classifying the intersection point check the ON status in 3D - compare the 3D distances with 3D tolerance.

src/IntCurvesFace/IntCurvesFace_Intersector.cxx
tests/bugs/modalg_7/bug30903 [new file with mode: 0644]

index 6c6d3ce..f2c974b 100644 (file)
@@ -42,7 +42,7 @@
 #include <TopoDS_Face.hxx>
 #include <BRep_Tool.hxx>
 #include <TopoDS.hxx>
-#include <Geom2dAPI_ProjectPointOnCurve.hxx>
+#include <GeomAPI_ProjectPointOnCurve.hxx>
 //
 static void ComputeSamplePars(const Handle(Adaptor3d_HSurface)& Hsurface, 
                               const Standard_Integer nbsu,
@@ -259,16 +259,12 @@ void IntCurvesFace_Intersector::InternalCall(const IntCurveSurface_HInter &HICS,
           for(; anExp.More(); anExp.Next())
           {
             TopoDS_Edge anE = TopoDS::Edge(anExp.Current());
-            Standard_Real curtol = BRep_Tool::Tolerance(anE);
-            Standard_Real tol2d = Max(Hsurface->UResolution(curtol), Hsurface->VResolution(curtol));
-            tol2d = Max(tol2d, Tol);
             Standard_Real f, l;
-            Handle(Geom2d_Curve) aPC = BRep_Tool::CurveOnSurface(anE, face, f, l);
-            Geom2dAPI_ProjectPointOnCurve aProj(Puv, aPC, f, l);
-            if(aProj.NbPoints() > 0)
+            Handle(Geom_Curve) aPC = BRep_Tool::Curve (anE, f, l);
+            GeomAPI_ProjectPointOnCurve aProj (HICSPointindex.Pnt(), aPC, f, l);
+            if (aProj.NbPoints() > 0)
             {
-              Standard_Real d = aProj.LowerDistance();
-              if(d <= tol2d)
+              if (aProj.LowerDistance() <= maxtol3d)
               {
                 //Nearest edge is found, state is really ON
                 currentstate = TopAbs_ON;
diff --git a/tests/bugs/modalg_7/bug30903 b/tests/bugs/modalg_7/bug30903
new file mode 100644 (file)
index 0000000..df4d5a7
--- /dev/null
@@ -0,0 +1,12 @@
+puts "======================================================="
+puts "0030903: Bug in IntCurvesFace_ShapeIntersector"
+puts "======================================================="
+puts ""
+
+pload QAcommands
+
+restore [locate_data_file bug30903_shell.brep] s
+
+if {![regexp "status = -1" [OCC17424 s 132.319855705359 32.8066746022481 -61.4897311243957 0 -0.634115797726033 -0.77323809727294 -1]]} {
+  puts "Error: there must be no intersection point"
+}