Skip to content

erdemu/svg2gcode

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

svg2gcode

svg2gcode codecov

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

TODO

  • Support all path variants
  • Support group and path transforms
  • Biarc interpolation (G2/G3 instead of many G1)
  • Px, pc, in to mm
  • Configurable DPI for px/pc to mm
  • Sort paths by distance to reduce G0 distances
  • Configurable start/end sequence
  • Comments in GCode input
  • Rustdocs
  • End-to-end tests

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

About

Minimal SVG to GCode converter written in Rust

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 99.3%
  • G-code 0.7%