PadLex / SvgToGcode

MIT License
46 stars 27 forks source link

Gcode contains extraneous spaces causing parse errors #1

Closed dacunni closed 3 years ago

dacunni commented 3 years ago

I'm trying to use svg-to-gcode to generate Gcode for a 3D printer that doubles as a plotter. The resulting Gcode does not work when previewed in Cura (the print head doesn't move). The problem appears to be the space between the axis and the position in the G1 commands.

G1 X 62.978162 Y 79.032154;

If the space is removed from all G1 lines so they look like this, everything works as expected:

G1 X62.978162 Y79.032154;

The Marlin firmware Gcode reference does not show spaces. I think Gcode.linear_move() should not include the spaces in G1 command or provide an option to leave them out if they are needed by other types of machines.

gcode_issue.zip

Thanks

PadLex commented 3 years ago

I'm sorry it took me so long to notice your issue. Thank you for pointing that out. I'll correct it real quick.

dacunni commented 3 years ago

It's no problem. I have a fix that seems to work in my fork here if you want to take a look: https://github.com/dacunni/SvgToGcode/tree/fix-marlin-gcode. I haven't fixed the tests yet, though, because there seemed to be some other differences that I couldn't account for in my change.

I also ran into some issues running the tests on macos and sent you a pull request to make those work.