An open API service indexing awesome lists of open source software.

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

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.

![example plot](example.png)