Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hawkw/l-systems
L-Systems fun in Scala and Processing
https://github.com/hawkw/l-systems
Last synced: 7 days ago
JSON representation
L-Systems fun in Scala and Processing
- Host: GitHub
- URL: https://github.com/hawkw/l-systems
- Owner: hawkw
- License: mit
- Created: 2015-02-14T19:42:47.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-02-15T20:31:05.000Z (over 9 years ago)
- Last Synced: 2024-10-09T07:09:20.197Z (28 days ago)
- Language: Scala
- Homepage: http://hawkweisman.me/notebook/programming,computer/science,scala/2015/02/15/l-systems/
- Size: 1.51 MB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# L-Systems in Scala and Processing
![acacia](https://github.com/hawkw/l-systems/blob/master/doc/acacia.png)
`sbt ~run` makes it happen.
Clicking goes to the next iteration of the L-system. I advise you not iterate too deep into an L-system as it will probably make your computer melt.
I've included a number of L-system grammars, including some axial trees, a Pythagoras tree, a Sierpinski triangle, et cetera. Right now, which grammar it displays is hardcoded in `main.scala`. Eventually there will be a nicer way to select which grammar to draw, but for now you can modify that file. There's a comment explaining which line to modify.
Do note that while any grammar can theoretically be iterated infinitely, some of them (the ones that involve pushing or popping on the matrix stack) will eventually break Procelling. Part of me wants to move to a better graphics library eventually, especially since this would probably allow us to go deeper into many of the grammars.
![sierpinski](https://github.com/hawkw/l-systems/blob/master/doc/sierpinski-1.png)
![also sierpinski](https://github.com/hawkw/l-systems/blob/master/doc/sierpinski-2.png)
![still sierpinski](https://github.com/hawkw/l-systems/blob/master/doc/sierpinski-3.png)
![axial-tree-a](https://github.com/hawkw/l-systems/blob/master/doc/axial-a.png)
![axial-tree-b](https://github.com/hawkw/l-systems/blob/master/doc/axial-b.png)
![axial-tree-b](https://github.com/hawkw/l-systems/blob/master/doc/axial-b-2.png)