Lindenmayer systems are substitution models and subsitute symbols in words to generate other words. These words can be interpreted graphically. The original intention was to draw organic structures like trees or flowers. (See specialist literature for more information or ask the Wikipedia)
The generator is written in Coco ("Unfancy CoffeeScript") a dialect of CoffeeScript ("It's just JavaScript") and compiles to JavaScript.
First get this:
And then do this:
coco -c scalable
node scalable lsystem output.svg
or this:
make run
There is an example system given in the file ./lsystem
.
axiom
: The startrules
: Rules for generating new wordsiterations
: Number of iterations to doinitial_heading
: The initial heading of the turtle (in degrees)theta
: The angle to rotate at+
or-
style
: The style of the lineimage_width
: The with of the outputimage (in pixels)image_height
: The height of the outputimage (in pixels)