juicy-gcode: SVG to G-Code converter

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

SVG to G-code converter that aims to support most SVG features. It provides flexible options for curve approximation and allows configurable GCode generation based on color information.


[Skip to Readme]

Properties

Versions 0.1.0.0, 0.1.0.1, 0.1.0.2, 0.1.0.3, 0.1.0.4, 0.1.0.5, 0.1.0.5.1, 0.1.0.5.2, 0.1.0.6, 0.1.0.7, 0.1.0.8, 0.1.0.9, 0.1.0.10, 0.2.0.1, 0.2.0.2, 0.2.1.0, 0.3.0.0, 1.0.0.0, 1.0.0.0
Change log ChangeLog.md
Dependencies aeson (>=1.5 && <2.2), base (>=4.8 && <5), gitrev (>=1.3.0 && <1.4), JuicyPixels (>=3.3.7 && <3.4), lens (>=4.15.4 && <5.3), linear (>=1.20 && <1.23), matrix (>=0.3.5 && <0.4), optparse-applicative (>=0.13 && <0.20), svg-tree (>=0.6 && <0.7), text (>=1.2.2 && <1.3 || >=2.0 && <2.1), unordered-containers (>=0.2.16 && <0.3), yaml (>=0.11.8 && <0.12) [details]
License BSD-3-Clause
Author dlacko
Maintainer dlacko@gmail.com
Category Graphics
Home page https://github.com/domoszlai/juicy-gcode
Bug tracker https://github.com/domoszlai/juicy-gcode/issues
Source repo head: git clone https://github.com/domoszlai/juicy-gcode
Uploaded by dlacko at 2023-05-29T09:35:39Z

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Readme for juicy-gcode-1.0.0.0

[back to package description]

Juicy-gcode: A lightweight 2.5D SVG to GCode converter for maximal curve fitting

Hackage Appveyor

Overview

Juicy-GCode is a command-line application that converts SVG files to GCode. It provides flexible options for curve approximation and allows configurable GCode generation based on color information.

Features

Installation

The easiest way is to download one of the prebuilt binaries from the releases page. Alternatively, you can build from source code as follows:

Usage

⚠️ Breaking change: Since version 1.0.0.0, the flavor file format changed to YAML. If you use a pre 1.0 version, please refer to this historical README file

⚠️ Breaking change: Since version 0.3.0.0, --generate-bezier has been removed in favor of the more generic --curve-fitting parameter and --resolution has been renamed to --tolerance

⚠️ Breaking change: Since version 0.2.0.1, default DPI is changed to 96 and the option to mirror the Y axis is removed (it is always mirrored now for correct result)

The easier way to use juicy-gcode is to simply provide an SVG file name. The generated GCode will be written to standard output. The default approximation method is the biarcs based.

$ juicy-gcode SVGFILE

Alternativly, you can provide an output file name as well.

$ juicy-gcode SVGFILE -o OUTPUT

Sometimes you want to overwrite some default settings. These are the

$ juicy-gcode SVGFILE --dpi 72 --tolerance 0.01 

Curve fitting options (default is biarc):

$ juicy-gcode SVGFILE --curve-fitting=biarc
$ juicy-gcode SVGFILE --curve-fitting=linear
$ juicy-gcode SVGFILE --curve-fitting=cubic-bezier

Configuration

The generated GCode is highly dependent on the actual device it will be executed by and one might also want to generate different GCode for different colors. In juicy-gcode these settings are called GCode flavor and consist of the following:

These settings can be provided by a YAML configuration file. The default settings are made for being able to test the generated GCode in an emulator e.g. with LaserWeb or my hanging plotter simulator.

begin: |
  G17
  G90
  G0 Z1
  G0 X0 Y0
end: |
  G0 Z1
toolon: |
  G01 Z0 F10.00
tooloff: |
  G00 Z1

By providing your own configuration file, you can also specify color dependent settings. As an example, the following configuration adds extra GCode configuration for the color codes #000000 and #FF0000.

colors:
   "000000": 
      before: |
        ; black
      passes: 1
      parameters:
        F: 1.0 
        S: 80
   "FF0000": 
      before: |
        ; red
      passes: 1
      parameters:
        F: 2.0 
        S: 25

In this example, GCode comments will be generated before any continous red or black path, the F and S GCode parameters are set different for red and black paths (and not set for any other colors) and the number of passes are set to 1 for both colors (passes is an upcoming feature, currently this option is ignored)

Use the -f option to pass the GCode flavor to juicy-gcode:

$ juicy-gcode SVGFILE -f FLAVORFILE

Limitations

SVG features that are not supported: