Another day, another dog. Another month, another piece of dangerous productivity avoided. This month I am avoided furthering my life goals by starting to read Godel, Escher, Bach", which is an awesome book. It deals with a remarkable amount of things, including formal logical systems. This got me delving into string manipulation systems again and somehow got me onto L-Systems.
L-Systems were developed by this theoretical botanist (yes such a thing exists) to codify plant growth. Later they were taken up by mathematicians to visualise and generate a variety of interesting recursive geometric patterns. Lately they have been used extensively to generate artificial life in computer science, especially tree like entities.
L-Systems are a string rewriting system. basically they take a string of characters, and then create a new string by replacing each old character with a new string, according to some rules. This continues and iterates creating increasingly more complicated and intricate strings of characters. These characters can then be interpreted by drawing program to make beautiful patterns. You can read more about L-Systems at the Wikipedia Article, I don't want to get bogged down in the details, I want to look at some cool patterns.
Below is an L-System generator I built. You can explore the different possibilities of L Systems. The string grammar is as follows:
- Capital Letter: Draw a line forward
- Small Letter: Do nothing
- +: Turn right
- -: Turn left
- [:Save position to stack
- ]:load previously saved position from stack
Axiom: | |
Rule: | |
Number of Generations: | |
Starting Point: | (, ) |
Starting Angle: | |
Turn Angle: | |
Movement Size: | |
8 comments:
Very, very cool. You should consider posting it on HackerNews, I'm sure they'd love it there...
Ooh, L-systems. I did my final year project on these at university. I highly recommend the book 'The Algorithmic Beauty of Plants' particularly if you want to start drawing trees
We seem to have independently built almost the same thing:
http://www.burgerkone.com/elsy/
This is really good! You've inspired me to try to write a version for the http://js1k.com contest
cageface: your one is slicker, but I like how James's draws it live..
Yeah I agree I like that feature. We should pool our resources!
Yeah, cageface, yours is pretty cool. If you have a cool idea you'd like to collaborate on one day drop me a message.
Agreed. There are a couple things I'd like to try that would benefit from a partner.
Post a Comment