What Are L-Systems?

Lindenmayer Systems (L-systems) are formal grammars originally developed to model plant growth. Through parallel rewriting rules and recursive expansion, simple symbolic rules generate highly complex fractal structures.

This project implements:

  • Parallel string rewriting

  • Stack-based turtle graphics

  • Recursive branching

  • Fractal curve generation

✨ Features

🌱 8 Preset Systems

Includes:

  • Plant A–F (branching botanical systems)

  • Dragon Curve

  • Koch Snowflake

Each preset is implemented using ScriptableObject configurations for modularity.

🎛 Runtime Parameter Controls

  • Iteration Slider

  • Angle Slider

  • Step Length Slider

  • Preset thumbnail buttons

  • Keyboard shortcuts

All parameters update in real-time.

📷 Automatic Camera Framing

The orthographic camera dynamically resizes to fit any generated structure using combined LineRenderer bounds calculations. (Might have to click on preset twice to frame correctly)

This ensures:

  • No clipping

  • No manual zooming

  • Clean framing at all iteration levels

🍃 Leaf Instancing System

Leaves are automatically spawned only at branch endpoints using lookahead logic. This prevents clutter and enhances realism while maintaining algorithmic correctness.

🧩 Modular Architecture

The project is structured using:

  • ScriptableObject grammar definitions

  • Dedicated generator class

  • Separate renderer system

  • UI controller layer

  • Stack-based turtle state tracking

This makes the system extensible for future procedural modelling experiments.

🛠 Technical Overview

Engine: Unity
Language: C#
Rendering: LineRenderer-based turtle graphics
Camera: Orthographic auto-scaling
UI: Unity Canvas + runtime slider binding

Key systems implemented:

  • StringBuilder-based parallel rewriting

  • Stack-based push/pop branching

  • Runtime bounds calculation

  • Dynamic UI binding

  • ScriptableObject-based grammar presets

Leave a comment

Log in with itch.io to leave a comment.