Fork 0
mirror of https://github.com/Findus23/BrachioGraph-Utils.git synced 2024-06-28 18:18:23 +02:00
A collection of random scripts for generating plots
Go to file
2019-11-16 15:00:13 +01:00
brachiograph_utils initial commit 2019-11-04 21:16:54 +01:00
.gitignore initial commit 2019-11-04 21:16:54 +01:00
example.json initial commit 2019-11-04 21:16:54 +01:00
example.png add image 2019-11-04 21:25:05 +01:00
example.svg initial commit 2019-11-04 21:16:54 +01:00
README.md improve readme 2019-11-04 21:42:26 +01:00
requirements.txt add image 2019-11-04 21:25:05 +01:00
setup.py add setup.py 2019-11-16 15:00:13 +01:00

BrachioGraph Utils

This is a random collection of scripts that allow creating nice plots for the amazing BrachioGraph pen plotter.

It allows importing simple SVGs and G-code, minimizing travel distance and previewing the plot.


git clone https://github.com/Findus23/BrachioGraph-Utils.git
cd BrachioGraph-Utils
pip install -r requirements.txt
pip install -e .


# convert SVG
brachiograph-utils convert svg example.svg out.json

# combine two scripts by piping the stdout to the stdin
brachiograph-utils convert svg example.svg - | brachiograph-utils optimizers order - out.json

# further minimize the traveling distance
brachiograph-utils optimizers randomized-optimizer out.json out.json

# show turtle preview
brachiograph-utils display out.json -s 5 -x -200 -y 300

# every command and category has a help text
brachiograph-utils --help

SVG tips

As the importer is pretty simple, there are some limitations:

  • only paths are supported
    • so use Inkscape to convert everything else (e.g. Text, Circles, etc.) to paths
  • only straight lines between nodes are allowed (so no Bezier Curves)
    • use Extensions -> Modify Path -> Flatten Beziers to make curves cornered
  • paths inside of <defs></defs> are not ignored
    • if your plot contains squares that are not visible in the SVG, you might have them defined in the <defs></defs> section of the SVG. Simply remove them in a text editor if they are not needed.

example plot