New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Path] Fix open edge zero value start point #5343
Conversation
The code looks fine. I haven't tested the functionality |
idx = len(verts) - 1 | ||
x = verts[idx].X | ||
y = verts[idx].Y | ||
# Zero start value adjustments for Path.fromShapes() bug |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might be mistaken but I'm not sure this is a bug in Path.fromShapes().
If you do a Path.show(pp, "pp")
after line 290. You can see that fromShapes() return same shaped paths irregardless of the value of x.
If the bug was in fromShapes i would expect fromShapes to return different-shaped paths when x=0 and x=1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I grabbed a recent weekly build:
OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.27428 (Git)
Build type: Release
Branch: master
Hash: 2746035
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.3
Locale: English/United States (en_US)
... and this is the result with what appears to be the same test file as you present above in the image.
Applying the proposed fix in this PR corrects the path generated, as seen in the following image, and is applied in the following FreeCAD version:
OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.27496 +2 (Git)
Build type: Release
Branch: fix/3D_pocket_overcut
Hash: f1a223e
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.3
Locale: English/United States (en_US)
I have not looked at code for Path.fromShapes()
to determine if a bug exists there. As presented in the original test file by Lupin in the forum, the zero passed in the pathParams["start"]
vector parameter are causing, or related to, the problem. This PR intervenes within the python to make those zeros a very small non-zero number, which seems to correct the issue within the gcode output.
Thanks for reviewing and collaborating on this bug.
Russell
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I could have been clearer. I was not doubting your fix, it works. I was only doubting that the bug is in fromShapes. But I'm not so sure anymore.
Looking closer at the output generated by fromShapes does indeed show that the x feed is omitted when the X=0 in the start param.
Rapids between layers with model x=0:
Command G0 [ Z:5 ],
Command G0 [ Y:13 ],
Command G0 [ Z:3 ]
Rapids between layers with model x=1:
Command G0 [ Z:5 ],
Command G0 [ X:1 Y:13 ],
Command G0 [ Z:3 ]
So long story short. Ignore what I said :)
forum mention at https://forum.freecadweb.org/viewtopic.php?f=15&t=64882 This fix applies a small value to start points for open edges when either the x or y start point value is roughly zero.
9c83410
to
9227b4a
Compare
[Path] Fix open edge zero value start point
forum mention at https://forum.freecadweb.org/viewtopic.php?f=15&t=64882
This fix applies a small value to start points for open edges when either the x or y start point value is roughly zero.
Thank you for creating a pull request to contribute to FreeCAD! To ease integration, we ask you to conform to the following items. Pull requests which don't satisfy all the items below might be rejected. If you are in doubt with any of the items below, don't hesitate to ask for help in the FreeCAD forum!
App
,Base
,Gui
or one of theMod
subfolders. If you need to make changes in several locations, make several pull requests and wait for the first one to be merged before submitting the next onesgit pull --rebase upstream master
./bin/FreeCAD --run-test 0
Fixes typo in Draft Move command text
Draft: Fixed typos
issue #<id>
orfixes #<id>
where<id>
is the FreeCAD bug tracker issue number in case a particular commit solves or is related to an existing issue on the tracker. Ex:Draft: fix typos - fixes #0004805
And please remember to update the Wiki with the features added or changed once this PR is merged.
Note: If you don't have wiki access, then please mention your contribution on the 0.20 Changelog Forum Thread.