# Intro: L-Systems

An LSystem is a parallel string rewriting system. A string rewriting system consists of an initial string, called the seed, and a set of rules for specifying how the symbols in a string are rewritten as (replaced by) strings. Let’s have a look at a simple LSystem:

seed:A

rules:

Rule #1: A = AB

Rule #2: B = BA

The LSystem starts with the seed ‘A’ and iteratively rewrites that string using the production rules. On each iteration a new string/word is derived.

n is the derivation length = the number of iterations

n=0: A

n=1: AB (AbecomesABaccording toRule #1)

n=2: ABBA (AbecomesABaccording toRule #1, whileBbecomesBAaccording toRule #2. In result we getABBA)

n=3: ABBABAAB

n=4: ABBABAABBAABABBA

…

Each string represents a **word**. All words form the **language of the LSystem**.

There are different types of LSystems: deterministic, stochastic, context-free, context-sensitive, parametric, timed-depending on the rules and the way they are applied by the LSystem.

Currently RABBIT supports context-free deterministic L-Systems.

### We suggest the following resources:

- The Algorithmic Beauty of Plants & other papers
- Designing with L-Systems Series by Griswold, Ralph E. – Part 1
- Design by Evolution: Advances in Evolutionary Design (Natural Computing Series)
- LSystems in architecture by Michael Hansmayer
- Wikipedia LSystems

# Intro: Turtle Graphics(Interpretative Part)

Turtle Graphics are often used for L-System interpretation:

The derivation strings of developing L-systems can be interpreted as a linear sequence of instructions (with real-valued parameters in the case of parametric L-systems) to a ‘turtle’, which interprets the instructions as movement and geometry building actions. The historical term turtle interpretation comes from the early days of computer graphics, where a mechanical robot turtle (either real or simulated), capable of simple movement and carrying a pen, would respond to instructions such as ‘move forward’, ‘turn left’, ‘pen up’ and ‘pen down’. Each command modifies the turtle’s current position, orientation and pen position on the drawing surface. The cumulative product of commands creates the drawing.

**The following symbols drive the Turtle:**

Fmove forward at distanceL(Step Length) and draw a line

fmove forward at distanceL(Step Length) without drawing a line

+turn leftA(Default Angle) degrees

–turn rightA(Default Angle) degrees

\ roll leftA(Default Angle) degrees

/roll rightA(Default Angle) degrees

^pitch upA(Default Angle) degrees

&pitch downA(Default Angle) degrees

|turn around 180 degrees

Jinsert point at this position

“multiply current length bydL(Length Scale)

!multiply current thickness bydT(Thickness Scale)

[start a branch(push turtle state)

]end a branch(pop turtle state)

A/B/C/D..placeholders, used to nest other symbols

### Application of LSystems

Since their original formulation, L-systems have been adapted to modelling a wide range of phenomena including:

- herbaceous plants
- neural networks
- the procedural design of cities
- generative art
- generative music

Thank you so much for these tutorials and resources. I’m learning a lot of useful stuff here and I appreciate the clarity of presentation.

Happy to hear you like our tutorials.

We plan to extend the Edu section of the site with some more video tutorials and online courses. Hopefully, it will be pretty soon, so stay tuned!

Regards

Thanks!

thanks alot !!!

Same here, thanks for the educational aspect of the site. Just started using Rabbit, would like to get better at it. Looking for more tutorials in the future. Cheers

Thanks for the support.

We have just announced our new project Morphocode Academy: an online training platform for architects and designers.

Have a look here: http://morphocode.com/academy/

Cheers

Hi there,

Is there a symbol command for Angle scale which can be used in the production rules? There is a port to insert a slider to set the “Angle scale” in the turtle but there aren’t any symbols listed above which allow you to implement changes to the default angle in the production rules.

Thanks

Hi,

In the current version, there is no way to control the angle scale. We plan to add this feature to the next version.

Regards,

Morphocode

Thank you for the tutorial.

By the way, what rolls left A(Default Angle) degrees? I can see / rolls right A(Default Angle) degree though.

Cheers

Sorry for the late reply!

The “Roll left” symbol is \

It seems that we’ve missed that in the tutorial.

Thanks for pointing that out!

Regards,

Morphocode

Hi

Can you please elaborate what is A=!””[B]////[B]////B ?

Is it any equation?How you derive it?

Can You explain it in detail?

Thanks