diff --git a/src/ApplicationController.cpp b/src/ApplicationController.cpp index 786e0d5..8724eef 100644 --- a/src/ApplicationController.cpp +++ b/src/ApplicationController.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -155,14 +156,14 @@ void ApplicationController::addRectangle(const gp_Pnt& corner1, const gp_Pnt& co const auto& plane = m_activeSketch->plane(); - gp_Pnt2d p1_2d = ElCLib::Value(corner1, plane); - gp_Pnt2d p3_2d = ElCLib::Value(corner2, plane); + gp_Pnt2d p1_2d(gp_Vec(plane.Location(), corner1).Dot(plane.XDirection()), gp_Vec(plane.Location(), corner1).Dot(plane.YDirection())); + gp_Pnt2d p3_2d(gp_Vec(plane.Location(), corner2).Dot(plane.XDirection()), gp_Vec(plane.Location(), corner2).Dot(plane.YDirection())); gp_Pnt2d p2_2d(p3_2d.X(), p1_2d.Y()); gp_Pnt2d p4_2d(p1_2d.X(), p3_2d.Y()); - gp_Pnt p2_3d = ElCLib::Value(p2_2d, plane); - gp_Pnt p4_3d = ElCLib::Value(p4_2d, plane); + gp_Pnt p2_3d = ElCLib::To3d(plane, p2_2d); + gp_Pnt p4_3d = ElCLib::To3d(plane, p4_2d); TopoDS_Edge e1 = BRepBuilderAPI_MakeEdge(corner1, p2_3d); TopoDS_Edge e2 = BRepBuilderAPI_MakeEdge(p2_3d, corner2);