DLA - Diffusion Limited Aggregation

Written By Paul Bourke
Original: June 1991, Updated: January 2004, Updated: Sept 2014

Sample source code (brute force): dla2D.zip


Many attractive images and life-like structures can be generated using models of physical processes from areas of chemistry and physics. One such example is diffusion limited aggregation or DLA which describes, among other things, the diffusion and aggregation of zinc ions in an electrolytic solution onto electrodes. "Diffusion" because the particles forming the structure wander around randomly before attaching themselves ("Aggregating") to the structure. "Diffusion-limited" because the particles are considered to be in low concentrations so they don't come in contact with each other and the structure grows one particle at a time rather then by chunks of particles. Other examples can be found in coral growth, the path taken by lightning, coalescing of dust or smoke particles, and the growth of some crystals. Perhaps the first serious study of such processes was made by Witten, T.A. and Sander, L. M. and published by them in 1981, titled: "Diffusion limited aggregation, a kinetic critical phenomena" in Physical Review Letters. number 47.

Another more colourful description involves a city square surrounded by taverns. Drunks leave the taverns and stagger randomly around the square until they finally trip over one their insensate companions at which time, lulled by the sounds of peaceful snoring, they lie down and fall asleep. The tendril like structure is an aerial view of the sleeping crowd in the morning.

There are a number of ways of simulating this process by computer, perhaps the most common is to start with a white image except for a single black pixel in the center. New points are introduced at the borders and randomly (approximation of Brownian motion) walk until they are close enough to stick to an existing black pixel. A typical example of this is shown below in figure 1. If a point, during its random walk, approaches an edge of the image there are two strategies. The point either bounces off the edge or the image is toroidally bound (a point moving off the left edge enters on the right, a point moving off the right edge enters on the left, similarly for top and bottom). In general new points can be seeded anywhere in the image area, not just around the border without any significant visual difference.


Figure 1. Point attractor

Another attractor geometry is a line, see figure 2. In this case the bottom row of pixels are initially black and new points enter from the top. The image is normally horizontally circular, that is, points move off the left appear on the right and visa-versa.


Figure 2. Line attractor

Figure 3 shows a box attractor, new points enter in the interior (the center of the image say). The source code supplied here generates the forms by a rather brute force method which is hardly the most efficient. A common efficiency measure is to start the new particles within a certain range of the current structure and abandon them if they move outside some other range.


Figure 3. Rectangle attractor

There are a number of ways of adding colour, figure 4 has a circular seed region (toroidal bounds) and the particles are coloured by the order in which they were introduced.


Figure 4. Circular attractor


Figure 5. Internal circular attractor

Another variation is to vary the so called "stickiness". In all the above example if the wandering particle struck part of the existing structure it always stuck (stickiness = 1). This can be modified by introducing a probability of sticking, the general result is to make the form more hairy and solid.


Figure 6. Stickines = 0.2


Figure 7. Stickines = 0.05


Figure 8. Stickines = 0.01

Using spheres of decreasing radius



Diffusion Limited Aggregation
(DLA) in 3D

Written by Paul Bourke
January 2004


See also: Constrained Diffusion Limited Aggregation in 3 Dimensions
Computers and Graphics, Volume 30, Issue 4 , August 2006, Pages 646-649


Buy software for Mac OSX


The following are examples of growth in three dimensions based upon the same principles as diffusion limited aggregation, normally performed in two dimensions. The basic principle involves a particle that moves around randomly until it gets close to part of the existing structure, at which point it sticks and becomes part of the structure. The process is started with a seeding structure, normally a single point, and continues until the structure reaches a desired size.

Click on the images here for higher resolution versions

   

Exhibited at Museum of Design, Zurich. einfach komplex – Bildbäume und Baumbilder in der Wissenschaft. Simply Complex -- Picture-Trees and Tree Pictures in Science. 30 April 2005 -- 4 September 2005

 


 

The renderings here are created using POV-Ray, each particle is actually represented as a cone and a piecewise Bezier curve is used to smooth continuous chains of particles. As particles are added the thickness of the branch leading to that particle in thickened.

 

A further extension is to constrain the DLA growth to some "vessel". In the following the constraint takes the form a box (left) or cylinder (right) with one end open.

 

Grown over a sphere (planetarium), left: looking from inside the planetarium, right: from the outside of the dome.

 

DLA grown within a 3D scanned model of the human head (plus antlers), described by a STL file. Part of modelling exercise for Philippe Vranjes.

 

Software

The software presented here is made available for Mac OS-X, for Mac OS-X X-Windows must be installed and running. DLA structures can be grown in 3D, constraint surfaces applied, and resulting structures saved in PovRay format for high quality rendering.


Screen dump from dla3dviewer
 

Resulting render from PovRay (Unmodified from export)

The following downloads are fully functional except saving of the geometry is disabled and size of growth is limited is limited to 4000 branches. The software is provided for a number of versions of Mac OSX, please contact the author if you experience problems. This allows you to check the software, the unrestricted version is available for a modest shareware fee.

Demo versions

dla3dmac_snowleopard.zip
dla3dmac_lion.zip
dla3dmac_mountainlion.zip
dla3dmac_yosemite.zip

dla3dmac_sierra.zip

Buy full version

 
> dla3dviewer -h
Usage: dla3dviewer [command line options]
Command line options
       -h    this text
       -f    full screen
       -s    active (quad buffer) stereo
      -ss    dual screen stereo
Mouse controls
     left    rotate camera
   middle    roll camera
    right    menus
Function keys: see menus
Keyboard commands
        q    quit
        h    reset camera
      [,]    roll camera
      <,>    more camera forward, backward
      +,-    zoom camera in, out
        w    window dump to TGA file


Screen dump from dla3dviewer
 

Resulting render from PovRay

Software Notes

  • You need to install XQuartz from here: https://www.xquartz.org/

  • The software expects a three button mouse, note that under Mac OS-X the middle and left button can be activated by using the option and control keys. The left mouse button rotates the camera about the model, the middle button rolls the camera, and the right button brings up a menu system.

  • Useful keys include the '<' and '>' keys for moving the camera towards to away from the model. The camera is always pointing towards the origin which is where the initial seed particle is placed.

  • Using the menus the distribution of the introduced particles can be varied, the default is to introduce new particles on the surface of a sphere. When "extras" are turned on the last few thousand positions of introduced particles are shown. Particles are introduced just past the maximum range of the current model.

Settings dialog

  • Random seed: Each seed creates a unique structure, alternatively the same structure will result from the same seed (all other conditions being equal).

  • Bias towards origin: On each time-step the current particle moves in a random direction, the bias moves the particle towards the origin, generally by a very small amount.

  • Branch length: This sets the scale of the model and is the length of an added branch as well as defining how close a particle needs to get to the existing DLA structure in order to "stick" to it.

  • Stickiness: This is the probability of a particle sticking to the existing DLA structure once it is close enough. In general this control determines the density and fuzziness of the final structure. More information.

  • Particle rotation: On each time step this rotates the current particle about the z axis by (usually) a very small angle. Adds a swirling effect to the DLA and can vary the fractal dimension.

  • Branch thickness: This is used when the DLA structure is drawn with solid branches, instead of lines and points. This is also used in most of the export formats. The minimum value will be the thickness of the end of the branches.

  • Intersection range is used to avoid self intersections.

  • Multiple roots can be created, the range is used by the built in root seed distributions distribution.

    The constraint surface can be scaled, translated, and rotated.
 


Growth inside a cup
 

 


Physical realisations of various growth stages by David Sutton.


Multiple independent seeds
 

Each growth acts as a constraint on others


 


Further examples by David Sutton


Project by Michael Eden, building DLA structure within Architectural elements.




Constrained Diffusion Limited Aggregation in 3 Dimensions

Paul Bourke
Poster: Graphite (ACM Siggraph), Dunedin November/December 2005


Abstract

Diffusion Limited Aggregation (DLA) has usually been studied in 2 dimensions as a model of fractal growth processes such as branching, lightning, snowflakes, mineral deposits, and coral. Here, the basic principles are extended into 3 dimensions and used to create believable models of root systems. A straightforward approach is introduced for constraining the growth of the 3 dimensional DLA by a surface or containing it within a vessel.

PDF version: dla3d.pdf



Miscellaneous images

Credits: William Ewing