Skip to content

Commit

Permalink
Merge pull request #6886 from younghang/master
Browse files Browse the repository at this point in the history
Path: Fix PointProjectionFailed
  • Loading branch information
sliptonic committed Jun 10, 2022
2 parents d4c180e + 18120f8 commit 083a27d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Mod/Path/App/Area.cpp
Expand Up @@ -87,6 +87,7 @@
# include <ShapeFix_Wire.hxx>
# include <ShapeAnalysis_FreeBounds.hxx>
# include <TopTools_HSequenceOfShape.hxx>
#include <GeomAPI_ProjectPointOnCurve.hxx>
#endif

#include <Base/Exception.h>
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 083a27d

Please sign in to comment.