22nd March 2024

Keep your data structures in sync with the Graft Parallel Component

Hi there,

If you're anything like me and have spent a fair amount of time wrangling data in Grasshopper, you've probably felt the pain of trying to keep your tree structure from going haywire, especially when you're juggling trees from different sources.

One gem I've stumbled upon over the years that has been a game-changer for me is the graft parallel component from Elefront. It's been a lifesaver for tidying up tree structures and today I will walk you through how it works.

Imagine this: I have several trusses with me right now in Rhino.

I have referenced them in Grasshopper but found out that they don't have clean geometry. When I zoom in, I notice that the lines don't intersect.

My job now is to clean up this model and make sure all the lines intersect. My idea is to get the webs (the middle lines) to intersect with the chords (the top lines). Here is how I am imagining the process.


But how do I do this in Grasshopper? As a start, Let's say I have both chords and webs in separate trees. Each branch represents a truss.

Although both trees have the same structure, the branches don't contain the same number of items. I want to get each of my 22 web curves to intersect with both chords.

This is where the graft parallel component becomes useful. As I graft my webs, I can bring along the chords too.

Notice how when I graft my webs, the chords come along too. What this means is, that for every web in a branch, there are 2 chords for the same branch.

This setup means that if I bring in the curve | line component for the intersection, each web will intersect with both chords.

Not only that, but it retains the same data structure as before.

Thanks to this technique, we get a model where everything aligns perfectly.

Final Thoughts

Using graft parallel helps keep the number of components to a minimum. Not to mention, it often leaves you with a tree structure similar to before which minimises any future data operations.

I hope it was helpful because this is a workflow that I use all the time.

Thanks for reading,

Until the next one,

Braden Koh

    -->