Grasshopper

algorithmic modeling for Rhino

So I've been playing with adjusting mesh topologies quite a bit, and wanted to better understand how edge splitting, collapsing and flipping worked.  To pursue this I thought it might be fun to try to modify meshes using a 3D approximation of Diffusion Limited Aggregation, whereby random-walking particles will strike the mesh and cause it to grow from the face that it has struck. 

The process itself is actually pretty simple: you start with a closed, triangulated mesh.  Then you set a bounding box around your geometry to define the parameters within which each particle forms.  Then, one by one, you generate particles and have them move around randomly.  If they walk outside of the box, they die and new one forms.  If, however, they strike the mesh by falling within a certain proximity, they "feed" it, and the mesh face they hit expands a little bit.  In this case, the face expands by a combination of its face normal, and the direction vector between the particle's last location and the center of the face it's hitting.

The trick in the mesh's growth lies in how the edges split after the face is pulled out.  After each particle strike is calculated, the mesh edges are tested for their length.  Any edge that exceeds the maximum length (which is determined by the maximum edge length of the input mesh) is split.  I've also added in an option to collapse any edges that get too small.  I've also added in a variable for forcing the pulled faces to expand such that their edge lengths achieve more even sizing.  The script also maintains a list of each mesh iteration generated, which is helpful when you want to make simple animations of it.

The meshes that get generated directly from this process are pretty spiky...they get much more interesting when they're smoothed out, which Weaverbird does an amazing job of.  So for the attached definition to work, you're going to need Weaverbird, as well as Kangaroo (for removing duplicate lines for one of the base mesh's creation) and [UTO]'s MeshEdit components (if you want to play with meshes at all, you really should all three of these fantastic component groups anyway!).  When I'm running the script I disable the smoothing components, because they can make it run very heavy.

The component is also timer-based, and any extensive accretion will take a pretty fair amount of time.  This is due almost entirely to the "random walking" process, as a significant number of the starting particles walk out of the bounding box, or take a little while to finally strike the mesh.

To run it, just set "reset" to false and enable the timer.  Whenever you want to pause it, either block or disable the timer.  Then to start again, just set "reset" to true.

Some last notes...the script isn't bulletproof, for sure, and occasionally the mesh loses its clean edges (non-manifold and open edges sometimes emerge).  Also, it's possible that some input meshes may create infinite loops (I haven't tested it too extensively, pretty much just on the two base meshes in the definition) but if it does you'll have to close out Rhino.

In any event, here's the definition for you to have a play with if you're at all interested.  I'd love to hear some feedback, see any transformations to the script, or see images of anything you create with it.

dla_130527_growth.gh

UDPATE: Here's an image of the definition if you want to try to rebuild it in an earlier version of GH.  Also attached following is the text of the script for the vb component.

dla.txt

Views: 6771

Comment

You need to be a member of Grasshopper to add comments!

Comment by brendan OCAD on November 14, 2021 at 9:36am

Thanks for sharing!

I'm trying to re-work this for a study that I'm currently working on, but am running into an issue with the Mesh DLA command. I keep getting the error notice of the 'rnd' not being declared. Any ideas about what might be causing this? 

Image of error attached.

Best

Comment by Harry Ramos on September 4, 2019 at 6:04am

Life’s many responsibilities can eat away a large chunk of a student’s time; this forces students to turn in subpar quality work due to lack of proofreading and editing. Don’t make that mistake, let the experts at UKEssayTigers, an assignment writing service, handle editing and proofreading for you.

Comment by click on August 20, 2019 at 12:18pm

Getting the online here all update of windows for sync settings windows 10 batter way to seen the all setting of device here easily.

Comment by shila on September 1, 2015 at 12:53pm

so great stuff! Thanks

Comment by Pedro de Azambuja Varela on August 23, 2013 at 9:01am

Looks like ungravity stalagmites

Comment by bea franko on May 28, 2013 at 5:08am

thnak you:)))))

Comment by bea franko on May 28, 2013 at 4:03am

i dont have the newest version of grasshopper, so some components are missing...could you maybe post a picture of this definition?

thank you!

Comment by Erick Vásquez on May 27, 2013 at 5:10pm

Great stuff! Thanks!

Comment by Andrew Kudless on May 27, 2013 at 11:24am

Great work! Thanks

Comment by djordje on May 27, 2013 at 6:31am

Thanks!

About

Translate

Search

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service