DLA

aggregation with z-translation

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 two-dimensional 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.

grasshopper definition

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

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 Z-translation in the top image.

NB: the boundary curve must be a closed Polyline.

(ghx download)

Advertisements
Comments
6 Responses to “DLA”
  1. dk says:

    would like to explore DLA. may i ask your Gh component to work with.I am anable to download your link.

  2. archstudent says:

    how did you give the points/lines a z translation?

    • trevor.patt says:

      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 z-vector 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 the C input of a Series; the Series into a Unit-Z component which is the T input for a Move component where the geometry, G, is again the Node output.

Trackbacks
Check out what others are saying...
  1. […] 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 […]

  2. […] almost completely rewritten this Half-Edge 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 […]



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: