Vagrant ~

Dendritic

This page describes, very briefly, two procedural methods I played around with for generating organic-looking branched structures.

Diffusion Limited Aggregation

DLA is the clustering of particles undergoing Brownian motion. These fractal patterns frequently crop up in nature — river drainage systems, blood vessel networks, lighting scars (see Lichtenberg Figures).

Simulating DLA is fairly straightforward, although perhaps not particularly efficient. The image below was generated by connecting 1000 clustered particles.

It started off as a single stationary particle. Subsequent particles wander around randomly in a bounded region until they collide with a stationary particle. The collision causes them to stop wandering and stick to the other particle. As more particles collide (and the bounding region expands), the dendritic structure emerges.

To visualize the simulation process, the image below shows the particle positions during the random walk, along with the progressively expanding bounds.

The simulation can be extended to 3D without too much effort. The mesh below was generated from a sparse 200-particle DLA graph. The branches were smoothened using b-spline interpolation and tapered off to give them an organic look.

For a more detailed description of DLA, check out Paul Bourke's article.

Lindenmayer Systems

L-systems, a parallel string rewriting mechanism, can be used for generating intricate fractal structures.

Originally developed in 1968 for studying the growth of algae, it was soon extended for modeling plants. Below is an example of a branched tree-like structure generated using L-systems.

In L-system grammar, all that's needed to generate the structure above is this set of parameters:

F, F → FF-[-F+F+F]+[+F-F-F], δ=22.5, n=4

See the Implementations section for a Python script that can parse production rules like the one above. Here's another example.

A, A → F[+A][-A]FA, F → FF, δ=25.7, n=7

For an excellent reference (and an interesting book in general), see The Algorithm Beauty of Plants by Przemyslaw Prusinkiewicz and Aristid Lindenmayer.

Implementation

The images above were generated using the following:

  • L-system parser+renderer. Implemented in Python. View Source.

  • 2D DLA simulator. Implemented in Python. View Source.

  • 3D DLA simulator. Implemented is C++, using OpenGL and Cinder.

Both Python scripts use my PyDye graphics library.