# Lindenmayer Systems

NOTEThis project is currently undergoing significant rework

An L-System or Lindenmayer system is a parallel rewriting system, namely a

variant of a formal grammar, most famously used to model the growth

processes of plant development, but also able to model the morphology of

a variety of organisms.

This project is written using Clojure, demonstrating L-System

re-writing, deployed to Heroku:

Pre-defined examples can be generated using these links:

#### Sierpinski Curve

#### Sierpinski Triangle

#### Sierpinski Median Curve

#### Koch Curve

#### Koch Snowflake

#### Koch Ring

#### Koch Blocks

#### Koch Islands

#### Koch Crystal

#### Quadratic Koch Island

#### Cesaro-Koch Fractal

#### Joined-Cross Curve

#### Penrose Tiling

#### Peano-Gosper Curve

#### Hilbert's Space-filling Curve

#### FASS Curve

#### Heighway's Dragon

#### Shrub

#### Fractal Plant

#### Tree

## Pre-requisites

You will need Leiningen 2.6.1 or above installed.

## Building

To build and start the service locally, run:

```
$ cd lindenmayer-systems
$ lein deps
$ lein ring server-headless
```

To build and run a standalone jar:

```
$ lein ring uberjar
$ java -jar target/lindenmayer-systems-0.2.0-SNAPSHOT-standalone.jar
```

In both instances, the webapp starts on http://localhost:3000.

### Docker image

A docker image is available as richardhull/lindenmayer-systems,

and can be downloaded and started with:

```
$ docker pull richardhull/lindenmayer-systems
$ docker run --name lindenmayer-systems -d -p 3000:3000 richardhull/lindenmayer-systems
```

## TODO

- UI improvements to allow editing and a last-created list

## Implementation Notes

TODO

## References

- The Algorithmic Beauty of Plants [PDF]
- Project Euler #220: Heighway Dragon
- Project Euler #226: A Scoop of Blancmange
- Project Euler #230: Fibonacci Words
- https://en.wikipedia.org/wiki/Dragon_curve
- https://en.wikipedia.org/wiki/L-system
- http://www.kevs3d.co.uk/dev/lsystems/
- http://teethgrinder.co.uk/canvas/l-system-1.html
- http://paulbourke.net/fractals/lsys/
- http://canonical.org/~kragen/named-msgs/reptile-lsystems

## License

### The MIT License (MIT)

Copyright (c) 2016 Richard Hull

Permission is hereby granted, free of charge, to any person obtaining a copy of

this software and associated documentation files (the "Software"), to deal in

the Software without restriction, including without limitation the rights to

use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of

the Software, and to permit persons to whom the Software is furnished to do so,

subject to the following conditions:

The above copyright notice and this permission notice shall be included in all

copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR

IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS

FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR

COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER

IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN

CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.