Grasshopper

algorithmic modeling for Rhino

Hi,

 

I am fairly new to Grasshopper but have been getting along fairly well from some of my previous coding experiences (they were minor). My biggest problem is not the generation of data, but more so the management of data in grasshopper.

I am having problems practically creating data trees. I am trying to build the data represented below, but I do not now how to add all of this data together. Basically, as I generate the geometry starting with room data it becomes one room, which are lumped together to create one floor, which are lumped together to create the building.Also, the only thing that is defined is the data within the room, everything else will be parametric based on sliders and use input.

 

My questions, is how can I build a data tree like this? I can see all the tools for cleaning, flatten, trim, reducing trees etc, but how do I simply build the tree in the first place?

 

Thanks in advance

Views: 4897

Attachments:

Replies to This Discussion

Hi Ryan,

 

"previous coding experiences" Does this mean you're looking for ways to create such data trees programmatically (I.e. VB.NET, C# or Python)?

 

Assuming not, then it's hard to answer this fairly generic question. It should be possible to create the data in such a fashion that this automatically works. If this is difficult or not possible to achieve in your particular case, there's ways to modify data trees, the [Path Mapper] and [Replace Branches] being the most flexible components short of writing VB/C# code.

 

It seems you need to create a layout that looks like this:

 

{A;B;C;D}(i)

 

where A is always zero, B indicates which building, C indicates which floor, D indicates which room and i indicates which piece of roomdata. Or maybe I'm reading your image wrong and you're actually looking to even separate the roomdata into individual branches. Of course you don't need the leading zero, but that's the only way you'll get the image you posted.

 

If I were to very naively create a definition that

  1. defined some buildings
  2. section the buildings to create floors
  3. divide the floors to create rooms

 

I'd end up with something like this:

 

With the strategic placement of Graft components and tags I'm able to recreate your data tree with fairly minimum fuss. This is relatively easy because this is exactly how Grasshopper is supposed to handle data. The whole point of the {A;B;C;...;X} thing is to keep a history record of where data came from. 

 

Now if you don't have the option to (re)structure your file, then you'll have to resort to changing your data trees to match expectations. This can be much (really much) harder. But for this I'll need to see what you do actually have to work with. Are all your rooms in a single honking list? Do you have one list of rooms per building and only need to divide them into separate floors? Or....?

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

David,

This is right on the money, I think the think I am struggle with I grasshopper may be more of the logical order used when creating data and storing it. The programming note was of frustration because I felt that I should be able to simple create and organize data rhino with grasshoppers batteries.

My thought process was create the data as follows, roomdata>>room>>floor>>building

I. Can see now from your example that this is a little backwards. It makes so much more sense to create and organize you data in the same order as you tree "grow" (building>>floor>>room>>room data). This will allows create a much more flexible tree I think also.

Thanks so much!

Hi David,

 

Could you explain how you would do this programmatically in C# as you mentioned? I am having trouble with how to initialize and work with the "GH_Path" part of the tree structure.

 

Thanks!

the declaration of david is very interesting,
but if you want a detailed and picturesque explanation,
look at this: http://www.designalyze.com/?p=307
There are a number of different strategies...so it looks to me like you have a data structure that follows: {a;b;c;d}, where a represents the building data, b for the floors, c for rooms, and d for room data.  A lot will depend on how you develop your definition...but the way it works, the trees in some ways build themselves according the operations you perform on the geometry.  See the attached file to see how different moves create different data structures, and then how to use the path mapper to organize the data structure into the format you want.  Definitely explore using "flatten" and "graft"...with flatten, you can assign a new data path as you flatten, which can be really useful when adding new elements to your tree down the line.  And graft will create a new branch for each element in your tree, which also is useful.  Check out the discussion on path mapper to see how it operates...it's essential.
Attachments:
ah...David has made one much simpler.  Naturally!

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service