Utilities to preprocess and plot SVG/GCode files.
Process
=======
* Create SVG, e.g. using Processing
* run `./optimize-svg.py input.svg -m 1` to optimize the pen path
* run `./svg2gcode.py input-optimized.svg` to make Gcode.
* run `caffeinate` if needed to prevent OS X machine from sleeping.
Upload the Gcode to CNCJS and plot.
Setup
=====
Set up and activate a venv, then:
```
brew install spatialindex
pip install -r requirements.txt
```
Files
=====
optimize-svg.py
---------------
Use greedy optimisation to reduce the travel path for the plotter.
e.g.:
```
./optimize-svg.py input.svg -m 1 -v opt-vis.svg
````
Adapted from penkit-optimize which is installed via pip.
svg2gcode.py
------------
Convert SVG to GCode. Scales and centres svg to plotter surface.
Adapted from https://github.com/davepwsmith/svg2gcode.git to suit plotter rather than
3D printer.
TODO:
=====
* print command in gcode comment
* optimise_svg: bring across width, height and transformations from the source SVG
* output gcode for right orientation on rotated plotter
* allow rotate/scale/offset to go off the edge of the plot area
Plotter-land
------------
* how to centre plot area on page?
* Get more track and belt for whole of A3 x A3 coverage
* Get M5+M6 tap-and-die for redoing pen hole
* How to add pen tilt to eleksmaker?