Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/rh12503/triangula-cli


https://github.com/rh12503/triangula-cli

triangula

Last synced: 3 months ago
JSON representation

Awesome Lists containing this project

README

        

# Triangula CLI

A CLI app which uses [Triangula](https://github.com/RH12503/Triangula) to generate triangulated images. For a simpler interface consider using [the GUI](https://github.com/RH12503/Triangula-GUI).

### Explanation of the algorithm
Running the algorithm saves a _.json_ file every specified number of repetitions. This file contains data with the best set of the points from the algorithm. This file can then be rendered to a PNG or SVG.

### Running
Run the algorithm using the command:
```
triangula run -img -out
```
For almost all cases, only changing the number of points and the shape type and leaving all other options with their default values will generate an optimal result.

To change the shape type use the flag:
```
-shape [triangles|polygons]
```

For a list of available options, run:
```
triangula run -help
```

### Rendering

There are 2 image formats which the _.json_ file can be rendered to: SVG and PNG. PNG is currently the only format that supports effects.

To change the shape type use the flag:
```
-shape [triangles|polygons]
```

#### SVG
Renders the _.json_ file to a SVG.

Usage:
```
triangula render -in path/to/json -out path/to/save/svg
```

Options:
```
triangula render -help
```

#### PNG
Renders a _.json_ file generated by the algorithm to a PNG. There are also multiple effects that can be applied to the output.

Usage:
```
triangula render -in path/to/json -out path/to/save/svg -img
```

To add an effect, add the flag:
```
-effect [none|gradient|split]
```

Options:
```
triangula render -i . -o . -img . png -help
```