From e28b8c6218617f6842d598917626427be468dd45 Mon Sep 17 00:00:00 2001 From: nbv Date: Fri, 26 Oct 2018 11:37:00 +0300 Subject: [PATCH] 0029673: Exception while Face-Face intersection 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 | 9 ++++++++- tests/lowalgos/intss/bug29673 | 17 +++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 tests/lowalgos/intss/bug29673 diff --git a/src/IntTools/IntTools_FaceFace.cxx b/src/IntTools/IntTools_FaceFace.cxx index c01f4e3236..23f5eb83e6 100644 --- a/src/IntTools/IntTools_FaceFace.cxx +++ b/src/IntTools/IntTools_FaceFace.cxx @@ -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 index 0000000000..5e76e10894 --- /dev/null +++ b/tests/lowalgos/intss/bug29673 @@ -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" +}