From: aavtamon Date: Wed, 13 Jan 2021 07:20:00 +0000 (+0300) Subject: Fixed Line creation. X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=34c8a38852a0741a52c3941254d037cefee31eed;p=occt-copy.git Fixed Line creation. --- diff --git a/src/ShapeBuild/ShapeBuild_Edge.cxx b/src/ShapeBuild/ShapeBuild_Edge.cxx index 9ea82bcc96..a0cb98c535 100644 --- a/src/ShapeBuild/ShapeBuild_Edge.cxx +++ b/src/ShapeBuild/ShapeBuild_Edge.cxx @@ -624,16 +624,15 @@ Standard_Boolean ShapeBuild_Edge::BuildCurve3d (const TopoDS_Edge& edge) const gp_Pnt2d p1 = anEdgeCurve->Value(aFirst); gp_Pnt2d p2 = anEdgeCurve->Value(aLast); if (abs(p1.X() - p2.X()) <= Precision::Confusion() && abs(p1.Y() - p2.Y()) > Precision::Confusion()) { - TopoDS_Vertex vertices[2]; - TopExp::Vertices(edge, vertices[0], vertices[1]); - gp_Pnt P1 = BRep_Tool::Pnt(vertices[0]); - gp_Pnt P2 = BRep_Tool::Pnt(vertices[1]); + gp_Pnt P1 = anEdgeSurface->Value(p1.X(), p1.Y()); + gp_Pnt P2 = anEdgeSurface->Value(p2.X(), p2.Y()); gp_Vec aVec(P1, P2); Handle(Geom_Line) aLine = new Geom_Line(gp_Ax1(P1, aVec)); + gp_Pnt P0 = aLine->Value(-aFirst); + aLine->Translate(P1, P0); Handle(Geom_TrimmedCurve) aNewCurve = new Geom_TrimmedCurve(aLine, aFirst, aLast); BRep_Builder aBuilder; Standard_Real aTol = BRep_Tool::Tolerance(edge); - aLocation = edge.Location(); aBuilder.UpdateEdge(edge, aNewCurve, aLocation, aTol); } }