Stella Nova
Diffusion-limited aggregation · after fogleman/dlaf
drag to pan · pinch or scroll to zoom · double-tap to fit
Colour by age
oldnew
Diffusion-limited aggregation
After fogleman/dlaf by Michael Fogleman · MIT
View
Surface
Each particle becomes a round cone to its parent. A smooth minimum joins the cones into one signed distance field, and surface nets meshes it brick by brick while the cluster grows (lib/dla-sdf.js).
Hook presets


  
Parameters
Colour by
Replay
Particles join in id order, so the first k ids are the cluster at the time it had k particles.
dlaf output (CSV stream)
dlaf writes one line per particle to stdout. The parent_id is −1 for a seed. In 2D, z is 0.

  
Credit

dlaf is a fast C++ program for diffusion-limited aggregation in 2D or 3D, by Michael Fogleman (2019). Its README gives 35 seconds for one million points on one core. It uses the boost R-tree as its spatial index. Source: github.com/fogleman/dlaf, MIT licence (see CREDITS.txt in this folder).

Each new particle starts on a circle around the cluster and walks at random until it comes within AttractionDistance of a particle. Then it joins that particle, ParticleSpacing away. The trick: far from the cluster the walker jumps d − AttractionDistance at once, because no particle can be in that circle.

Our port, lib/dla-engine.js, keeps the walk, the join test, the push-back and the five parameters. Two parts are different. The spatial index is a sparse grid with a pyramid of coarse grids, not an R-tree, so a far walker gets a lower bound of d and jumps a bit less far. The five hooks are functions in an options object, not methods of a class, so each preset here replaces one hook.

Source extracts: dlaf.cpp and lib/dla-engine.js

AddParticle in dlaf.cpp (extract)


      

The same walk in lib/dla-engine.js (extract)