You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Sameer Puri 6d2fe6308a
remove warning about skewx + skewy, they are correct as far as euclid
4 years ago
.github GH actions: use source-based coverage 4 years ago
examples update svg examples taken from sameer/lsys 4 years ago
src remove warning about skewx + skewy, they are correct as far as euclid 4 years ago
tests update arc draw tests after fix 4 years ago
.gitignore add gcode test file 5 years ago
Cargo.lock update dependencies 4 years ago
Cargo.toml use g-code v0.1.2 to fix program end bug 4 years ago
LICENSE Bump sierpinski size 6 years ago
README.md Update README.md 4 years ago

README.md

svg2gcode

svg2gcode codecov

Convert any SVG 1.1 path to gcode for a pen plotter, laser engraver, etc.

TODO

  • Biarc interpolation (G2/G3 instead of many G1)
  • Sort paths by distance to reduce G0 distances (traveling salesman problem
  • Comments in GCode input

Known bugs/issues

  • Smooth curves should not use the control point when the previous curve is not of the same type (quadratic -> smooth cubic, cubic -> smooth quadratic)
    • This is just a nit, it shouldn't matter if the SVG is correct

Demonstration

Input

cargo run --release -- examples/Vanderbilt_Commodores_logo.svg --off 'M4' --on 'M5' -o out.gcode

Vanderbilt Commodores Logo

Output, rendered at https://ncviewer.com

cat out.gcode

Vanderbilt Commodores Logo Gcode

Real-world use on a Prusa Mini+

A Prusa Mini+ was set up with a pen plotter attachment. The Vanderbilt_Commodores_logo.svg and moore.svg examples were plotted on the same page.

cargo run --release -- --begin 'G0 Z10 G28 M201 X1250 Y1250 Z400 M203 X400 Y400 Z24 M205 X8.00 Y8.00 Z2.00 M107 G0 Z10 G0 X0 Y0 G0 Z1' --end 'G0 Z10' --on 'G0 Z1' --off 'G0 Z3' --origin 0,34 examples/Vanderbilt_Commodores_logo.svg -o out.gcode --feedrate 3000

Pen plotter attachment on the 3D printer

Resulting plotted image

FAQ / Interesting details

Reference Documents