L-systems
From GenerativeArt
(Difference between revisions)
(→More Examples) |
(→Introduction: Edit to make format conform and content tuning) |
||
- | == | + | == Rendering L-system expressions == |
- | " | + | <SPAN STYLE="font-size: larger;">Introductory example </SPAN> |
- | |||
- | = | + | The "L" in "L-system" refers to its inventor <em>Aristid Lindenmayer.</em> |
+ | |||
+ | An L-system is a grammar based system for describing and generating branching structures which (often) exhibit self-similarity. | ||
+ | |||
+ | Such systems produce a string expression which can be rendered into graphics. The string is essentially a series of commands for moving a virtual pen. The commands are executed from left to right. | ||
+ | |||
+ | |||
+ | <SPAN STYLE="font-size: larger;"><u>Basic Commands</u></SPAN> | ||
+ | |||
* n is number of iterations | * n is number of iterations | ||
* δ is angle increment | * δ is angle increment | ||
* ] pops the current state off the stack (i.e. gets position and heading) | * ] pops the current state off the stack (i.e. gets position and heading) | ||
- | = | + | |
+ | <SPAN STYLE="font-size: larger;"><u>Example of how to interpret a strings</u></SPAN> | ||
+ | |||
δ = 45° | δ = 45° | ||
d = 2 | d = 2 |