heckj/lindenmayer
The package provides a library you can expand upon to develop your own [Lindenmayer systems](https://en.wikipedia.org/wiki/L-system), directly in the Swift programming language.
Inspiration
A combination of influences led to this development, initial as an experiment and general exploration. One part was the lindenmayer swift playground by @henrinormak, which implements a great single-character representation which is perfect for exploring fractal systems. That, in turn, was built on the work of Aristid Lindenmayer in the book The Algorithmic Beauty of Plants. The research that Aristid Lindenmayer started continues to be expanded by Professor Przemyslaw Prusinkiewicz with generous publications of research papers on the site Algorithmic Botany.
A couple of the papers expand on the tooling to create and evaluate L-systems, and their advances allow for interesting new capabilities to be expressed in the L-systems:
- The Design and Implementation of the L+C Modeling Language (R Karwowski 2003)
- Parametric L-systems and Their Application to the Modelling and Visualization of Plants (J Hanan 1992)
The features that I was most interested in leveraging:
- Parameters within an L-system's modules and exposing them to grammar evaluation and production choices (parametric L-systems).
- The introduction of random values with those parameters (stochastic grammars).
While this project can be implemented using an interpreter, I wanted to see how far I could leverage the Swift language. This project attempts to follow in the conceptual footsteps of the L+C language to create a mechanism to create L-systems that compile down to machine code for efficiency of execution.
Package Metadata
Repository: heckj/lindenmayer
Default branch: main
README: README.md