diff --git a/src/GeomProjLib/GeomProjLib.cxx b/src/GeomProjLib/GeomProjLib.cxx index 40c4730971..0abccafea2 100644 --- a/src/GeomProjLib/GeomProjLib.cxx +++ b/src/GeomProjLib/GeomProjLib.cxx @@ -150,6 +150,11 @@ Handle(Geom2d_Curve) GeomProjLib::Curve2d(const Handle(Geom_Curve)& C, Handle(Geom_TrimmedCurve) CTrim = Handle(Geom_TrimmedCurve)::DownCast(C); Standard_Real U1 = CTrim->FirstParameter(); Standard_Real U2 = CTrim->LastParameter(); + if (!G2dC->IsPeriodic()) + { + U1 = Max(U1, G2dC->FirstParameter()); + U2 = Min(U2, G2dC->LastParameter()); + } G2dC = new Geom2d_TrimmedCurve( G2dC, U1, U2); } diff --git a/tests/bugs/moddata_3/bug24697 b/tests/bugs/moddata_3/bug24697 new file mode 100644 index 0000000000..5aa98f7964 --- /dev/null +++ b/tests/bugs/moddata_3/bug24697 @@ -0,0 +1,16 @@ +puts "================" +puts "OCC24697" +puts "================" +puts "" +####################################################################### +# Exception is raised during projection of the curve on the surface +####################################################################### + +restore [locate_data_file bug24697_curve.draw] c +restore [locate_data_file bug24697_surf.draw] s + +project c2d c s + +smallview +fit +set only_screen_axo 1