0024697: Exception is raised during projection of the curve on the surface
authorazv <azv@opencascade.com>
Fri, 21 Nov 2014 10:34:42 +0000 (13:34 +0300)
committerbugmaster <bugmaster@opencascade.com>
Fri, 21 Nov 2014 10:35:20 +0000 (13:35 +0300)
The curve is trimmed since now in the boundaries of surface

Test case for issue CR24697

Behavior for trimming periodic curves was changed

src/GeomProjLib/GeomProjLib.cxx
tests/bugs/moddata_3/bug24697 [new file with mode: 0644]

index 40c4730..0abccaf 100644 (file)
@@ -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 (file)
index 0000000..5aa98f7
--- /dev/null
@@ -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