https://github.com/findus23/brachiograph-utils
A collection of random scripts for generating plots
https://github.com/findus23/brachiograph-utils
plotting python travelling-salesman-problem
Last synced: 6 months ago
JSON representation
A collection of random scripts for generating plots
- Host: GitHub
- URL: https://github.com/findus23/brachiograph-utils
- Owner: Findus23
- Created: 2019-11-04T20:16:16.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-11-16T14:01:09.000Z (almost 6 years ago)
- Last Synced: 2025-04-11T01:52:47.650Z (6 months ago)
- Topics: plotting, python, travelling-salesman-problem
- Language: Python
- Size: 37.1 KB
- Stars: 14
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# BrachioGraph Utils
This is a random collection of scripts that allow creating nice plots for the amazing [BrachioGraph](https://github.com/evildmp/BrachioGraph) pen plotter.
It allows importing simple SVGs and G-code, minimizing travel distance and previewing the plot.
## Installation
```bash
git clone https://github.com/Findus23/BrachioGraph-Utils.git
cd BrachioGraph-Utils
pip install -r requirements.txt
pip install -e .
```### Usage
```bash
# 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 `` are not ignored
- if your plot contains squares that are not visible in the SVG, you might have them defined in the `` section of the SVG. Simply remove them in a text editor if they are not needed.