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:
@@ -624,16 +624,15 @@ Standard_Boolean ShapeBuild_Edge::BuildCurve3d (const TopoDS_Edge& edge) const
|
|||||||
gp_Pnt2d p1 = anEdgeCurve->Value(aFirst);
|
gp_Pnt2d p1 = anEdgeCurve->Value(aFirst);
|
||||||
gp_Pnt2d p2 = anEdgeCurve->Value(aLast);
|
gp_Pnt2d p2 = anEdgeCurve->Value(aLast);
|
||||||
if (abs(p1.X() - p2.X()) <= Precision::Confusion() && abs(p1.Y() - p2.Y()) > Precision::Confusion()) {
|
if (abs(p1.X() - p2.X()) <= Precision::Confusion() && abs(p1.Y() - p2.Y()) > Precision::Confusion()) {
|
||||||
TopoDS_Vertex vertices[2];
|
gp_Pnt P1 = anEdgeSurface->Value(p1.X(), p1.Y());
|
||||||
TopExp::Vertices(edge, vertices[0], vertices[1]);
|
gp_Pnt P2 = anEdgeSurface->Value(p2.X(), p2.Y());
|
||||||
gp_Pnt P1 = BRep_Tool::Pnt(vertices[0]);
|
|
||||||
gp_Pnt P2 = BRep_Tool::Pnt(vertices[1]);
|
|
||||||
gp_Vec aVec(P1, P2);
|
gp_Vec aVec(P1, P2);
|
||||||
Handle(Geom_Line) aLine = new Geom_Line(gp_Ax1(P1, aVec));
|
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);
|
Handle(Geom_TrimmedCurve) aNewCurve = new Geom_TrimmedCurve(aLine, aFirst, aLast);
|
||||||
BRep_Builder aBuilder;
|
BRep_Builder aBuilder;
|
||||||
Standard_Real aTol = BRep_Tool::Tolerance(edge);
|
Standard_Real aTol = BRep_Tool::Tolerance(edge);
|
||||||
aLocation = edge.Location();
|
|
||||||
aBuilder.UpdateEdge(edge, aNewCurve, aLocation, aTol);
|
aBuilder.UpdateEdge(edge, aNewCurve, aLocation, aTol);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user