Skip to content
A command-line tool for making G-code from SVG files.
Python Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
svgpathtools @ 3b7bed0
test
.gitignore
.gitmodules
.travis.yml
COPYING
Makefile
README.md
TODO.adoc
cut-part.jpg
example-toolpath-0.png
example-toolpath-1.png
gcoder.py
show-svg
svg2gcode
svg2gcode.adoc
test-svg

README.md

Build Status

svg2gcode

svg2gcode reads an SVG file and produces g-code machining operations from the paths in it.

Supported operations are:

  • engraving (follow the path from the SVG)

  • offset (follow a path offset inwards or outwards from the SVG path)

  • pocket (clear the interior of the path from the SVG)

  • drill (in the center of circular paths)

Features:

  • ramp or plunge entry moves

  • optionally add work-holding tabs

  • primitive nesting via duplication on an XY grid

Example generated tool path

Example generated tool path

Cut part

Installation

Clone the svg2gcode repo:

git clone https://github.com/SebKuzminsky/svg2gcode.git
git submodule init
git submodule update

Install dependencies:

sudo apt-get install python python-svgwrite python-numpy python-jsonschema asciidoc docbook-xml docbook-xsl xsltproc

The test suite runs the LinuxCNC Standalone Interpreter to validate the emitted g-code, this is available in the linuxcnc-uspace package from the linuxcnc.org deb archive.

Add the GPG key that validates the linuxcnc.org deb archive:

sudo apt-key adv --keyserver hkp://keys.gnupg.net --recv-key 3cb9fd148f374fef

Add the apt source for the linuxcnc.org deb archive:

deb http://linuxcnc.org stretch base 2.7-uspace

Install the linuxcnc-uspace package:

sudo apt-get install linuxcnc-uspace

Build the manpage:

make

Run the test suite:

cd test; ./runtests

G-Coder Python module

This repo also contains a python module named gcoder that writes g-code.

It is intended to be called from a program that has an idea of some cuts it wants to make. Gcoder functions write g-code to an output file. Some Gcoder functions correspond directly to specific g-codes, and some to more complex operations consisting of longer sequences of g-codes.

You can’t perform that action at this time.