]> OCCT Git - occt.git/commitdiff
0029673: Exception while Face-Face intersection
authornbv <nbv@opencascade.com>
Fri, 26 Oct 2018 08:37:00 +0000 (11:37 +0300)
committerbugmaster <bugmaster@opencascade.com>
Tue, 30 Oct 2018 13:04:25 +0000 (16:04 +0300)
If 2D-curves are requested in intersection result but they cannot be created (by some reason) then the full set of curves (3D and two 2D) is rejected from the intersection result.

src/IntTools/IntTools_FaceFace.cxx
tests/lowalgos/intss/bug29673 [new file with mode: 0644]

index c01f4e323660d68bbf9da2c7d7ac45812aef1de3..23f5eb83e675a73575d7d61090e27f9319b1a02f 100644 (file)
@@ -819,11 +819,14 @@ void IntTools_FaceFace::MakeCurve(const Standard_Integer Index,
           aCurve.SetTolerance(aTolC);
         }
         //
-        aCurve.SetCurve(new Geom_TrimmedCurve(newc, fprm, lprm));
         if(myApprox1) { 
           Handle (Geom2d_Curve) C2d;
           GeomInt_IntSS::BuildPCurves(fprm, lprm, Tolpc,
                 myHS1->ChangeSurface().Surface(), newc, C2d);
+
+          if (C2d.IsNull())
+            continue;
+
           aCurve.SetFirstCurve2d(new Geom2d_TrimmedCurve(C2d, fprm, lprm));
         }
         //
@@ -831,6 +834,10 @@ void IntTools_FaceFace::MakeCurve(const Standard_Integer Index,
           Handle (Geom2d_Curve) C2d;
           GeomInt_IntSS::BuildPCurves(fprm, lprm, Tolpc,
                     myHS2->ChangeSurface().Surface(), newc, C2d);
+
+          if (C2d.IsNull())
+            continue;
+
           aCurve.SetSecondCurve2d(new Geom2d_TrimmedCurve(C2d, fprm, lprm));
         }
         //
diff --git a/tests/lowalgos/intss/bug29673 b/tests/lowalgos/intss/bug29673
new file mode 100644 (file)
index 0000000..5e76e10
--- /dev/null
@@ -0,0 +1,17 @@
+puts "========"
+puts "0029673: Ex-ception while Face-Face intersection"
+puts "========"
+puts ""
+
+restore [locate_data_file bug29673_f1.brep] f1
+restore [locate_data_file bug29673_f2.brep] f2
+
+regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} [bopcurves f1 f2 -2d] full Toler NbCurv
+
+if {$Toler > 1.0e-7} {
+  puts "Error: too big tolerance"
+}
+
+if {$NbCurv != 1} {
+  puts "Error: Please check NbCurves for intersector"
+}