Here, I got the issue when I am trying to adjust the StartPoint of a wire, it raises the PointProjectionFailed exception.
As displayed in the picture below, previously I can't not set the StartPoint on the specific arc. It was OK to set one some other arcs and lines.
Through debugging, I found the reason for this issue is that when the gp_Pnt pprev(BRep_Tool::Pnt(xp.CurrentVertex()));
is called, there is a tiny difference between pprev and vertex around 0.0000001. which raise the PointProjectionFail exception in
mkEdge1.Init(curve, myBestPt, pprev);
To fix this, I have commit a pull-request here:
https://github.com/FreeCAD/FreeCAD/pull/6886
Another issue might happen when the StartPoint is set, the wire misses some edges in my project. And I solved it by
using: (I am not sure of this issue but it works fine after the alternative.)
Code: Select all
if (edge.Orientation() != myBestWire->wire.Orientation())
{
mkEdge1.Init(curve, myBestPt, pprev);
mkEdge2.Init(curve, pt, myBestPt);
}
instead of:
if(reversed) {
mkEdge1.Init(curve, myBestPt, pprev);
mkEdge2.Init(curve, pt, myBestPt);
}
git commit 18120f8bcdf0641ef93ec9efc32a9825ba7df3e8