DLA
Diffusion Limited Aggregation
Diffusion Limited Aggregation uses the mechanics of a random walk causing particles to stop moving when they come within a certain distance of an already anchored point. Connecting points to their anchors creates a branching organization with a density and connections that resemble many natural growing patterns. This version includes the possibility of setting multiple boundary curves in the input geometry.
Though the DLA algorithm itself is quite simple, one of the computational challenges is that as the number of particles increases, the amount of time spent testing the proximity of the particle to the anchored points slows down the algorithm. Some of our students addressed this problem by restricting the position of the particle to a grid of points equal in dimension to the connection threshold. At the same time, when a particle was added to the anchor list, it was saved in a twodimensional array at a point which corresponded to its position in the grid. This meant that only 8 positions needed to be tested, but it costs the algorithm a great deal of flexibility.
Illustration of datatree
The solution here is similar in using the data structure to mirror the spatial array, but does so without the grid restriction. Rather, using Grasshopper’s Datatree structure, the total bounded area is divided into a grid (the size a the random walk step) and anchor points are added to Branches whose Path corresponds to the grid cell which contains it (actually an index number which points to the correct anchor point, the tree is ndxReg in the script). As opposed to an array, which can only have one value for each space, a Datatree holds a list in each Branch, so we are able to hold more than one point in each grid cell, but we maintain the advantage of only having to search through the most proximate points. In the example above, only 13 distances need to be measured rather than 750. Even better, most of the rejected positions require no measurement at all because the paths for the surrounding grid cells are empty.
Grasshopper definition canvas
The Grasshopper sketch also exports the connectivity diagram in both directions: FromNdx, which lists the point index from which the current point anchored to, and ToNdx, the indices of all the points which link to the current point. The connectivity diagram should allow modification of the point locations without losing the DLA structure as in the Ztranslation in the top image.
NB: the boundary curve must be a closed Polyline.
Comments
6 Responses to “DLA”Trackbacks
Check out what others are saying...
[…] the work shown were some studies developed and shared here at CodeQuotidien. The videos from every school can be found at the link above, here is the […]

[…] almost completely rewritten this HalfEdge Mesh definition to use a similar strategy as in the DLA definition to partition the space into a grid of rectangles (these are the new inputs: X Bounds, Y Bounds, and […]
would like to explore DLA. may i ask your Gh component to work with.I am anable to download your link.
Rightclick, Save Link As from the ‘(ghx download)’ at the end of the post.
how did you give the points/lines a z translation?
This was done using standard Grasshopper components after the DLA algorithm to illustrate the order that the points were added. Each point is translated upward by a zvector with a magnitude that is proportionate to the point’s order in the list.
To recreate this use: List Length component from the
Node
output of the DLA, into theC
input of a Series; the Series into a UnitZ component which is theT
input for a Move component where the geometry,G
, is again theNode
output.