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).
Width of the smooth minimum. 0 gives a crease at each fork, 1 gives webs between near branches.
Pipe rule, r³ of a parent = sum of r³ of its kids (Murray). 0 gives one tube width.
Mesh resolution
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.
Walker
The demo cluster has 260 particles and Stickiness 0.4 or less, so a push-back can happen.
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.