Skip to content

LeaPHI

Math Chaos

LeaPHI is a procedural generation project that explores the emergence of natural growth patterns in plants, specifically focusing on how the golden ratio (phi) governs the arrangement and development of leaves and stems.

The project aims to replicate the “natural and organic” look of plants by simulating several key biological and mathematical rules:

New leaves and branches typically emerge at an angle related to the golden ratio (~137.5 degrees), which allows for optimal space filling and exposure to sunlight without overlap.

Leaf contours are procedurally generated using Bézier curves. The shape is controlled by a growth-stage factor and a random seed, ensuring each leaf is unique while maintaining a characteristic species look.

To mimic real plant development, the growth rate is adjusted using a decadic logarithm. This ensures that leaves grow rapidly in their early stages and slow down as they mature and increase in size.

Delaunay Triangulation

Uses Shewchuk’s Triangle library to generate high-quality 2D meshes for the leaf surfaces.

OpenGL Rendering

Hardware-accelerated rendering using OpenGL 3.3+ for smooth growth animations.

Parametric Modeling

Every aspect of the plant—from stem curvature to leaf size—is driven by mathematical parameters.

Interactive Animation

Real-time timeline control for growth rate and leaf spawn frequency.

LeaPHI requires a C++ compiler and several graphics libraries.

  1. Prerequisites Install CMake, OpenGL, GLEW, GLM, and GLFW3.

  2. Configure and Build The project includes a run.sh script to simplify the build process:

    Terminal window
    ./run.sh cmake
    ./run.sh make
  3. Execution

    Terminal window
    ./run.sh