0025254: Protection on null pcurves in tgtfaces BRepLib
authorpdn <pdn@opencascade.com>
Mon, 22 Sep 2014 13:36:31 +0000 (17:36 +0400)
committerbugmaster <bugmaster@opencascade.com>
Thu, 25 Sep 2014 11:58:25 +0000 (15:58 +0400)
Check is pcurves are present is implemented.

src/BRepLib/BRepLib.cxx

index f339ab5..1ff393d 100644 (file)
@@ -1484,6 +1484,16 @@ static Standard_Boolean tgtfaces(const TopoDS_Edge& Ed,
   const Standard_Real ta,
   const Standard_Boolean couture)
 {
+  // Check if pcurves exist on both faces of edge
+  Standard_Real aFirst,aLast;
+  Handle(Geom2d_Curve) aCurve;
+  aCurve = BRep_Tool::CurveOnSurface(Ed,F1,aFirst,aLast);
+  if(aCurve.IsNull())
+    return Standard_False;
+  aCurve = BRep_Tool::CurveOnSurface(Ed,F2,aFirst,aLast);
+  if(aCurve.IsNull())
+    return Standard_False;
+
   Standard_Real u;
   TopoDS_Edge E = Ed;
   BRepAdaptor_Surface aBAS1(F1,Standard_False);