A fast svg to gcode compiler forked from vishpat/svg2gcode.
This library takes an svg file location/my_file.svg
and outputs the gcode conversion to a folder in the same directory location/gcode_output/my_file.gcode
.
The file config.py
contains the configurations for the conversion (printer bed size etc).
Simply clone this repo.
git clone https://github.com/pjpscriv/py-svg2gcode.git
To import it into your existing python project:
import py-svg2gcode
or
import generate_gcode from py-scvg2gcode
python svg2gcode.py
You can also use the RUNME
script to convert files.
This method is useful for debugging as it gives you extra information.
./RUNME my_svg_file.svg
The compiler is based on the eggbot project and it basically converts all of the SVG shapes into bezier curves. The bezier curves are then recursively sub divided until desired smoothness is achieved. The sub curves are then approximated as lines which are then converted into g-code.