• Skip to primary navigation
  • Skip to main content

Horst Sondermann

Parametric BIM School

Facebook
Instagram
LinkedIn
Twitter
YouTube
  • Rhino/Grasshoppper
  • Archicad
  • Cinema4D
  • Adobe
  • Youtube
  • Print/EBook
  • About
  • Datenschutzerklärung
  • Impressum
Startseite » Rhino/Grasshoppper » Rhino3D Grasshopper: Retrieve Data Tree Branch
Rhino3D Grasshopper: Retrieve Data Tree Branch

Rhino3D Grasshopper: Retrieve Data Tree Branch

In Grasshopper you can retrieve branches from data trees with Tree Branch. This works with a single branch and also with a set of branches.

For a good introduction on Grasshopper’s Data Trees read this page from TU Delft.

New to Grasshopper? I suggest you read this article in the first place.

Need more learning resources? Check this out.

Disclaimer

As you will see in my screenshots most components carry a title above them displaying their name. This is because I use a plugin called Bifocals.

Also you’ll see my Grasshopper tab titles abbreviated because there’s not enough horizontal space. I will mention the titles in full in my script though.

Branch and Path mean the same thing. That’s Grasshopper data tree jargon. Put in other words, branch equals path.

Create a Triangular Grid

Let’s take a Triangular grid pattern as an example:

grasshopper,datatree,data,tree,branch,treebranch,retrievebranch,listitem,list,index,path,item,data management

List Item

Let’s assume you want to retrieve one of the triangles. When you connect a List Item to TriGrid’s output you’ll see that it provides a whole set of triangles instead:

grasshopper,datatree,data,tree,branch,treebranch,retrievebranch,listitem,list,index,path,item,data management

grasshopper,datatree,data,tree,branch,treebranch,retrievebranch,listitem,list,index,path,item,data management

A Panel reveals that indeed List Item extracts not 1 element (= 1 triangle) but 1 out of each branch of our TriGrid data tree:

grasshopper,datatree,data,tree,branch,treebranch,retrievebranch,listitem,list,index,path,item,data management

(The number of items in each branch differs according to TriGrid’s input.)

As you see, List Item by itself doesn’t work here.

Tree Branch

We want to single out 1 branch of our tree. To do this, we choose Tree Branch:

grasshopper,datatree,data,tree,branch,treebranch,retrievebranch,listitem,list,index,path,item,data management

Connected to TriGrid’s output is demands for a P (ath) input:

grasshopper,datatree,data,tree,branch,treebranch,retrievebranch,listitem,list,index,path,item,data management

Double-click on the canvas, write “0;0;0” and hit Return:

grasshopper,datatree,data,tree,branch,treebranch,retrievebranch,listitem,list,index,path,item,data management

Feed this panel into Tree Branch’s P input:

grasshopper,datatree,data,tree,branch,treebranch,retrievebranch,listitem,list,index,path,item,data management

As you see Tree Branch retrieves 1 branch (in my example the first of them).

When you connect your List item to  B output you will have extracted exactly 1 triangle:

grasshopper,datatree,data,tree,branch,treebranch,retrievebranch,listitem,list,index,path,item,data management

grasshopper,datatree,data,tree,branch,treebranch,retrievebranch,listitem,list,index,path,item,data management

Extract Set of Branches

To retrieve more than one branch, double-click your text panel feeding Tree Branch’s P input and simply add more paths:

grasshopper,datatree,data,tree,branch,treebranch,retrievebranch,listitem,list,index,path,item,data management

Don’t forget to turn your panel in Multiline Data mode your panel should look like this:

grasshopper,datatree,data,tree,branch,treebranch,retrievebranch,listitem,list,index,path,item,data management

grasshopper,datatree,data,tree,branch,treebranch,retrievebranch,listitem,list,index,path,item,data management

For a good introduction on Grasshopper’s Data Trees read this page from TU Delft.

New to Grasshopper? I suggest you read this article in the first place.

Need more learning resources? Check this out.

 

© Horst Sondermann 2019 // All Rights reserved

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Copyright © 2023 · Genesis Sample on Genesis Framework · WordPress · Log in