PadLex / SvgToGcode

MIT License
46 stars 27 forks source link

Fixed non-standard scientific notation, wrapped pass step-down in relative positioning mode #6

Closed 4cello closed 3 years ago

4cello commented 3 years ago

Python prints long floating point numbers in scientific notation (e.g. 1.234e-12). This results in a crash in GRBL (and probably other GCode parsers). I added a parameter to control the precision (defaults to 8 decimal places, probably still a little much) and adjusted the GCode output accordingly.

When using multiple passes, the expectation is that the Z axis moves down by pass_depth between passes. However, in the current implementation, the Z axis moves to this position every time. I wrapped the G1 Z-{pass_depth} command in G91 ... G90 to switch to relative positioning mode for this command.

PadLex commented 3 years ago

Looks great. Thank you for contributing! I added two commits. If you approve of my changes I'll go ahead and merge your pull request.

btw, how did you find yourself in terms of code-readability? Do you think the project is well structured or do you have any ideas on how to improve it?

4cello commented 3 years ago

Seems reasonable to link precision to the tolerance, and I'm happy to see that you fixed the laser-off thing. I looked into that one as well but wasn't really sure why it happened so I tabled that one.

As far as code readability goes, I didn't really have to dive deep into it, but I found what I was looking for without much trouble.

PadLex commented 3 years ago

Awesome!