Looking Outwards-Simulation: tree.growth
http://blog.blprnt.com/blog/blprnt/project-tree-growth
tree.growth is a really nicely done example of simulating the growth of trees using L-systems. The artist, Jer Thorp, has a nice short explanation of the concept in the comments section of the project post on the site:
“The concept behind L-Systems is really straight-forward. You start with a string, then you successively apply a string replacement rule. So, let’s say we have a string:
A
And we apply this rule: Every time you see an ‘A’, change it to ‘AB’. Every time you see a ‘B’, change it to ‘A’. The first time through, we get:
AB
Then:
ABA
Then:
ABAAB
Then:
ABAABABA
That’s the root of it (pun intended). Once you have a long enough string, you can then run it through an engine to translate it into some result. In our easy example, maybe A draws a line forward, and B turns 90 degrees to the left. Or maybe A plays the next note up on a piano scale, and B plays the next note down.
In my system the symbol set is different. My strings look something like this:
FF-[-F+F+F-]+[+F-F-F+]
In which F moves one unit forward, – rotates to the left, + rotates to the right, and the brackets start and return to ‘branch points’. “
I liked that he designed the program using adjustable parameters that allowed him to adjust the features of the tree/plant he was creating- a useful way to create many different-looking plants from the same basic code; also referencing the biological variables that control the way actual plants vary from species to species.