diff --git a/src/Mod/Path/App/Area.cpp b/src/Mod/Path/App/Area.cpp index 3c7fee6eb2aa..1f8d0b73ac2a 100644 --- a/src/Mod/Path/App/Area.cpp +++ b/src/Mod/Path/App/Area.cpp @@ -87,6 +87,7 @@ # include # include # include +#include #endif #include @@ -2610,6 +2611,18 @@ struct ShapeInfo{ if(mySupportEdge) { //if best point is on some edge, split the edge in half if(edge.IsEqual(mySupport)) { + //to fix PointProjectionFailed. + GeomAPI_ProjectPointOnCurve gpp; + gpp.Init(myBestPt, curve); + gpp.Perform(myBestPt); + myBestPt = gpp.NearestPoint(); + + gpp.Perform(pprev); + pprev = gpp.NearestPoint(); + + gpp.Perform(pt); + pt = gpp.NearestPoint(); + double d1 = pprev.SquareDistance(myBestPt); double d2 = pt.SquareDistance(myBestPt);