From: azv Date: Fri, 21 Nov 2014 10:34:42 +0000 (+0300) Subject: 0024697: Exception is raised during projection of the curve on the surface X-Git-Tag: V6_9_0_beta~298 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=eb7404bf16b1da214b3d4b1a7c0a39751695efe6;p=occt-copy.git 0024697: Exception is raised during projection of the curve on the surface The curve is trimmed since now in the boundaries of surface Test case for issue CR24697 Behavior for trimming periodic curves was changed --- 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