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 1/3] 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); From 143d24f681bfb6b8e97819637c88d45a596adc20 Mon Sep 17 00:00:00 2001 From: younghang <1179536490@qq.com> Date: Mon, 16 May 2022 10:08:35 +0800 Subject: [PATCH 2/3] Path: Fix PointProjectionFailed in rebaseWire() --- src/Mod/Path/App/Area.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Mod/Path/App/Area.cpp b/src/Mod/Path/App/Area.cpp index edd890ba93..d5f427a737 100644 --- a/src/Mod/Path/App/Area.cpp +++ b/src/Mod/Path/App/Area.cpp @@ -2615,7 +2615,7 @@ struct ShapeInfo{ GeomAPI_ProjectPointOnCurve gpp; gpp.Init( myBestPt,curve); gpp.Perform(myBestPt); - myBestPt=c.NearestPoint(); + myBestPt= gpp.NearestPoint(); gpp.Perform(pprev); pprev = gpp.NearestPoint(); From 5ebf236732e31226b98652720cfd16da54a449cf Mon Sep 17 00:00:00 2001 From: younghang <1179536490@qq.com> Date: Wed, 18 May 2022 09:36:16 +0800 Subject: [PATCH 3/3] Fix whitespace --- src/Mod/Path/App/Area.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Mod/Path/App/Area.cpp b/src/Mod/Path/App/Area.cpp index d5f427a737..1f8d0b73ac 100644 --- a/src/Mod/Path/App/Area.cpp +++ b/src/Mod/Path/App/Area.cpp @@ -2613,9 +2613,9 @@ struct ShapeInfo{ if(edge.IsEqual(mySupport)) { //to fix PointProjectionFailed. GeomAPI_ProjectPointOnCurve gpp; - gpp.Init( myBestPt,curve); + gpp.Init(myBestPt, curve); gpp.Perform(myBestPt); - myBestPt= gpp.NearestPoint(); + myBestPt = gpp.NearestPoint(); gpp.Perform(pprev); pprev = gpp.NearestPoint();