From 4f93349381bc0882f14988a873683b2a23f02066 Mon Sep 17 00:00:00 2001 From: pdn Date: Mon, 22 Sep 2014 17:36:31 +0400 Subject: [PATCH] 0025254: Protection on null pcurves in tgtfaces BRepLib Check is pcurves are present is implemented. --- src/BRepLib/BRepLib.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/BRepLib/BRepLib.cxx b/src/BRepLib/BRepLib.cxx index f339ab5828..1ff393d404 100644 --- a/src/BRepLib/BRepLib.cxx +++ b/src/BRepLib/BRepLib.cxx @@ -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);