From 201bb07cac342a2e787aa1b28c5c75aa608caa84 Mon Sep 17 00:00:00 2001 From: younghang <1179536490@qq.com> Date: Mon, 16 May 2022 00:04:44 +0800 Subject: [PATCH] fix PointProjectionFailed --- src/Mod/Path/App/Area.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Mod/Path/App/Area.cpp b/src/Mod/Path/App/Area.cpp index 3c7fee6eb2..edd890ba93 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=c.NearestPoint(); + + gpp.Perform(pprev); + pprev = gpp.NearestPoint(); + + gpp.Perform(pt); + pt = gpp.NearestPoint(); + double d1 = pprev.SquareDistance(myBestPt); double d2 = pt.SquareDistance(myBestPt);