19 releases
0.3.3 | Sep 8, 2024 |
---|---|
0.2.3 | Apr 8, 2024 |
0.2.0 | Mar 15, 2024 |
0.1.4 | Nov 19, 2023 |
0.0.7 | Nov 21, 2021 |
#227 in Images
Used in 2 crates
180KB
2K
SLoC
svg2gcode
Convert vector graphics to g-code for pen plotters, laser engravers, and other CNC machines
Usage
Web interface
Check it out at https://sameer.github.io/svg2gcode. Just select an SVG and click generate!
Command line interface (CLI)
Input
cargo run --release -- examples/Vanderbilt_Commodores_logo.svg --off 'M4' --on 'M5' -o out.gcode
To convert curves to G02/G03 Gcode commands, use flag --circular-interpolation true
.
Output, rendered at https://ncviewer.com
cat out.gcode
Library
The core functionality of this tool is available as the svg2gcode crate.
Blog Posts
These go into greater detail on the tool's origins, implementation details, and planned features.
FAQ / Interesting details
-
Use a 3D printer for plotting: (thanks @jeevank for sharing this) https://medium.com/@urish/how-to-turn-your-3d-printer-into-a-plotter-in-one-hour-d6fe14559f1a
-
Convert a PDF to GCode: follow this guide using Inkscape to convert a PDF to an SVG, then use it with svg2gcode
-
Are shapes, fill patterns supported? No, but you can convert them to paths in Inkscape with
Object to Path
. See #15 for more discussion. -
Are stroke patterns supported? No, but you can convert them into paths in Inkscape with
Stroke to Path
.
Reference Documents
Dependencies
~4.5MB
~94K SLoC