L-System generator implemented in Python3
.
-
Clone the repo and go to
src
directorygit clone https://github.com/DatSudo/dat-lsys.git cd dat-lsys/src
-
Run
dat-lsys.py
# Show usage python dat-lsys.py -h # Generate l-system python dat-lsys.py -l kc -n 6
-
Args:
-l, --lsystem [l-system name initials]
kc
: Koch curvedc
: Dragon curvest
: Sierpinski trianglefp
: Fractal plant
-n --numgen [number of generations]
: Must be between 0 and 7 only. You might want to change that if you have a beefy PC.
You need to have these three:
- Alphabet/symbols. Each symbol corresponds to some graphics movement such as "forward", "turn right", etc.
- Axiom. The initial state.
- Rules. Rules on how symbols will transform in each generation.
Example (Koch curve):
-
Symbols:
$F$ ,$+$ ,$-$ -
Axiom:
$F$ -
Rules:
$F \rightarrow F+F-F-F+F$
If we try to draw this with
At
Dragon Curve | Sierpinski Triangle | Fractal Plant |
---|---|---|
- README
- GUI
- Documentation
- LICENSE