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 0d6711cc01
fix long running transform bug (does not affect scaling)
4 years ago
.github GH actions: use source-based coverage 4 years ago
examples Fix incorrect smooth curve ctrl point reflection, update README.md with demo, add compensation for same closepath point, add demo in README 6 years ago
src fix long running transform bug (does not affect scaling) 4 years ago
tests fix long running transform bug (does not affect scaling) 4 years ago
.gitignore add gcode test file 5 years ago
Cargo.lock fix long running transform bug (does not affect scaling) 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 fix long running transform bug (does not affect scaling) 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
  • Comments in GCode input
  • Rustdocs

Known bugs/issues

  • Ellipse paths are dubious -- large_arc, sweep may need to be inverted
  • 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

FAQ / Interesting details

Reference Documents