by londons_explore · 5y ago · 0 comments
An untested python one-liner:
'\n'.join(["G0 X"+x+" Y"+y for x,y in coords])
Grab the code for homing and stuff from the start of another gcode file that works.Then you can use something like svgpathtools (https://github.com/mathandy/svgpathtools) in Python to loop over the paths and get the coordinates.
In case it's useful, I have an example svg to gcode converter here: https://github.com/paulgb/penkit/blob/master/penkit/polargra...
It is for driving a polargraph-style plotter, so it includes a coordinate transform that GP does not need to do.
https://github.com/javierbyte/pintr/blob/master/lib/svg.js#L...
* Update to add a link to the code that generates the SVG.