1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-08 14:17:06 +03:00

Fixed Line creation.

This commit is contained in:
aavtamon
2021-01-13 10:20:00 +03:00
parent ab17299a28
commit 34c8a38852

View File

@@ -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);
}
}