From 7630ee024be793496e0333e7d415022a027358bf 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 3c7fee6eb2aa..edd890ba932c 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 07d7ced8eca6c8715e2eb1d9bdf94b25b784f9fc 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 edd890ba932c..d5f427a7376e 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 a21a5a20324dc9f3f477ef7289ab4ea23c9b0eb9 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 d5f427a7376e..1f8d0b73ac2a 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();