Grasshopper

algorithmic modeling for Rhino

hi,
i have a problem when intersecting two sets of surface for creating ribs in two direction to be inserted into each other.
the final result (Rdiff component) should be two closed curves (regions), but instead it gives me24 curves (baked and arranged on the baked layer).
i guess its a flatten / graft issue but i cant find any solution. here is a screenshot to demonstrate the task:

i also attach the rhino / grasshopper files.

any help would be appreciated.
thanks in advance
roberto

Views: 1007

Attachments:

Replies to This Discussion

Hi there-I think it's easiest to keep your elements that you want to bool from the primary drivers of the data structure.  So you graft them, and flatten the planes you want to cut with.  Then manage your data structure by shifting paths at the appropriate times.

hi david,

thanks a lot for the quick help and the comprehensive explanation !!!

i copied your setup and it just worked fine, also on the more complex file (more sections)

to be honest: i dont really understand what you did. but i will try to get the point. think its a good opportunity to learn and understand the basics of trees, branches, etc.

can you give me a quick hint, what the shift does in this case, or are there any manuals or tutorials to learn?

thanks again   roberto

Grasshopper unfortunately has terrible documentation when it comes to trees and lists.  If you search around for tutorials on this site, you can find some...but they really need to put something out to help new people especially.

I'll try to walk you through what's happening here at least.  Basically, data structure is simply a way of managing lists of lists.  Here you have two surfaces (your list), and you want to create a series of intersections for each one (so another list for each item in your first list).  By grafting your curves that make your planar surfaces in the beginning, we are assigning them each a data "address" so that grasshopper knows we want to treat them independently.  The first one is just called {0} and the second one is {1}.  Now we want to intersect these with your transverse surfaces.  By "flattening" these, we are making sure grasshopper doesn't see them as having any data structure of importance.  This way, when we do our first intersection, your main surfaces {0} and {1} are both cross referenced against all of your transverse surfaces.  One thing that grasshopper will do is add levels of complexity to your data structure, depending on the results of each operation.  So if you look at the results of this intersection you'll see that the data structure has become a little deeper.  Now, for each base surface {0} and {1}, we capture the unique instances of intersection with your transverse elements.  Grasshopper adds a new address for each one of these intersections...the first value matches your original list, and the second value relates to the index of surface creating each unique intersection.  So {0;0} is your first main surface intersecting with your first transverse surface, and {1;0} is your second main surface intersecting with your first transverse surface.  Then when you make the pipes, that data structure is passed on down. But we really don't need this second level of information...in fact, it's going to make it harder for us to correctly match all of the {0;x} pipes back to surface {0}.  Shifting the paths allows us to retain that first important address {0} and {1} while eliminating the second part, so that when you do your second intersection, all of the pipes in list {0} match back to your main surface with the address of {0}.  The same thing happens again later...when you combine the start and end points of your second interestion to make your final rectangle, an additional level of complexity is added back in by grasshopper.  Shifting the paths here again eliminates this extra bit of data structure (which, in fact, is often very, very useful in other contexts...just not here).  Then your region's addresses of {0} match your formed rectangles in {0}, {1} matches {1}, etc.

Thinking of lists as addresses is really the easiest way.  It's often described as nesting layers of detail.  So you could think of them a bit like this:

{0} City

{0;0} City, Street Name

{0;0;0} City, Street Name, Street Number

{0;0;0;0} City, Street Name, Street Number, Apartment Number

{0;0;0;0;0} City, Street Name, Street Number, Apartment Number, Room Number

...and on and on, scaling in both directions.  I hope this helps you out.

thanks again !

just printed your explanation and take it on my way out of the office to the lakeshore :)

(first sunny day here since weeks)

cheers  roberto

read your explanation and found it very straightforward and understandable.

are you a grashopper teacher? or some other kind of trainer?

maybe its you who should offer the missing documentation on data trees ...

my definition will get more complicated, but i am sure with this information it will work

so thanks again very much and have a good time   roberto

Glad to help out!  Yes, I do teach grasshopper quite a bit, but I'm also always a student :)

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