PadLex / SvgToGcode

MIT License
46 stars 27 forks source link

Update start vertex for absolute paths so the close_path directive works #4

Closed dacunni closed 3 years ago

dacunni commented 3 years ago

Absolute paths need to update the start vertex so subsequent "close path" (z) command will work properly.

I am including a test case to reproduce the issue, along with screenshots. I generated the test by tracing an image in Inkscape, and the GCode was visualized with multiple online visualizers, which consistently showed the problem.

bug_close_path.zip

I would guess this problem exists for some other commands, but I don't have test cases for them.

PadLex commented 3 years ago

Thank you for finding this bug. It turns out the solution is to change the starting point with every moveto command rather then in the Bezier curve command. I linked your pull request in the commit.