Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/resetius/lsystem

L-System Fractal Generator
https://github.com/resetius/lsystem

Last synced: 17 days ago
JSON representation

L-System Fractal Generator

Awesome Lists containing this project

README

        

# lsystem
[L-System Fractal Generator](https://en.wikipedia.org/wiki/L-system)

This program was inspired by [FractInt](http://fractint.oblivion.cz) pictures and written by me in 2008. Current version (2021) was rewritten in C language and stripped of old/unused/broken code.

# build
```
$ cmake ${source-dir}
$ make
```
# run
```
$ lsystem -f ${source-dir}/fractals/snoppy.ls
....
building Snow.Flake.2
using order 4
lsystem done
turtle done
normilize done
saving done
building Snow.Flake.3
using order 5
lsystem done
turtle done
normilize done
saving done
building Snow.Flake.4
using order 12
lsystem done
turtle done
normilize done
saving done
building Twelve.Stones
using order 27
lsystem done
turtle done
normilize done
saving done
```
# syntax

```
fractal_name { fractal_description }
```
Fractal with name 'fractal_name' will be saved to 'fractal_name.png'.

Fractal description parameters:

| name | description |
| ------------- | --------------------------------------------- |
| alpha | initial angle |
| theta | angle increment in radians |
| angle | angle increment in degree |
| axiom | sets axiom |
| + or - | increment or decrement angle on theta radians |
| ! | swaps + and - |
| [ and ] | branch |
| F or D | draw forward |
| G or M. | skip forward |
| Cnumber | sets current color to number |
| >number | increases color by number |
|