L-systems
From GenerativeArt
(Difference between revisions)
(New page: == L Systems == <em>Named after Aristid Lindenmayer.</em> A grammer based system for describing and generating branching structures which (often) exhibit self-similarity === Basic Operat...) |
(→L Systems) |
||
=== Basic Operations === | === Basic Operations === | ||
- | + | * n is number of iterations | |
- | + | * δ is angle increment | |
- | + | * d is step size (length increment) | |
- | + | * F is move forward with length d with pen down | |
- | + | * f is move forward with length d with pen up | |
- | + | * + is turn left by angle δ | |
- | + | * - is turn right by angle δ | |
- | + | * [ pushes current state down the stack (i.e. saves position and heading) | |
- | + | * ] pops the current state off the stack (i.e. gets position and heading) | |
- | + | ||
- | + | ||
- | + | ==== Example of how to interpret a string ==== | |
- | + | ||
δ = 45° | δ = 45° | ||
d = 2 | d = 2 | ||
F[+F]F[-F]F | F[+F]F[-F]F | ||
- | + | ||
+ | {| | ||
+ | |- | ||
+ | |{{SingleImage|imageURL=http://www-viz.tamu.edu/courses/viza658/wiki/lsys/lsys01.png|caption=Example showing string interpretation}} |