From dc05c4c0a76e25fdfb7f951ef162e7d4e6bbe5c1 Mon Sep 17 00:00:00 2001 From: aavtamon Date: Tue, 22 Dec 2020 13:25:07 +0300 Subject: [PATCH] A check of curve existence was added --- src/ShapeBuild/ShapeBuild_Edge.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ShapeBuild/ShapeBuild_Edge.cxx b/src/ShapeBuild/ShapeBuild_Edge.cxx index a3665fd112..12487073d9 100644 --- a/src/ShapeBuild/ShapeBuild_Edge.cxx +++ b/src/ShapeBuild/ShapeBuild_Edge.cxx @@ -612,6 +612,9 @@ Standard_Boolean ShapeBuild_Edge::BuildCurve3d (const TopoDS_Edge& edge) const Handle(Geom_Surface) anEdgeSurface; TopLoc_Location aLocation; Standard_Real aFirst, aLast; + Handle(Geom_Curve) aCurve = BRep_Tool::Curve(edge, aLocation, aFirst, aLast); + if (!aCurve.IsNull()) + return Standard_True; BRep_Tool::CurveOnSurface(edge, anEdgeCurve, anEdgeSurface, aLocation, aFirst, aLast); if (anEdgeCurve.IsNull() || anEdgeSurface.IsNull()) return Standard_False; @@ -631,9 +634,9 @@ Standard_Boolean ShapeBuild_Edge::BuildCurve3d (const TopoDS_Edge& edge) const gp_Vec aVec(P1, P2); Handle(Geom_Line) aLine = new Geom_Line(gp_Ax1(P1, aVec)); Standard_Real aDistance = P1.Distance(P2); - Handle(Geom_TrimmedCurve) aCurve = new Geom_TrimmedCurve(aLine, 0.0, aDistance); + Handle(Geom_TrimmedCurve) aNewCurve = new Geom_TrimmedCurve(aLine, 0.0, aDistance); BRep_Builder aBuilder; - aBuilder.UpdateEdge(edge, aCurve, Precision::Confusion()); + aBuilder.UpdateEdge(edge, aNewCurve, Precision::Confusion()); } } //End of the new code -- 2.39.5