Grasshopper

algorithmic modeling for Rhino

Separating information to feed through grasshopper 'box'

Hey everyone,

I'm working on a project at the moment and I have assembled a 'box' of grasshopper tools that works for one set of points.

I'm trying now to get the same 'box' to work for multiple points but as there are polylines and surfaces in it, they are conflicting as the geometries are overlapping and intersecting.

The input for the model is a centre point and four connecting points: we can call them CNT, A, B, C and D. The model works for these points - it's quite complicated with lots of polylines, vector geometry, surfaces, rotations, etc. - but it still works and has an output of two breps.

If I had a compilation of N sets of CNT, A, B, C and D's, is there a way of feeding each of these into the grasshopper in individual sets rather than just plugging in the huge set of numbers - e.g. feeding in CNT1, A1, B1, C1 and D1 and getting a result before moving on to CNT2, A2, B2, C2 and D2?

I've tried looking through tree structures, but it seems to be failing when the size of the set isn't known - e.g. how to extract all the information from trees when N isn't know using list item (i=0, i=1, i=2..., i=N).

I hope I've managed to explain the problem adequately, I can make up an easier to understand Grasshopper model later if I haven't explained well...

Thanks in advance for any comments, pointers, etc.

Views: 268

Replies to This Discussion

Maybe you can upload a 3dm and a ghx to illustrate a bit? It will be easier
You could you use the ListItem component on each of your 5 sets of data, with a slider to move through the indices. This would pass only one item from each list at a time. Once your geometry is computed, you could write a little scripted node to bake it automatically, or use the ModeTools plugin to bake it automatically.

If you hit 'animate' on the slider, it will automatically run through all your values one at a time, bake it, and move to the next one. This is the easy way.

The harder way would be to actually figure out the logic of data trees and how they are changing things in your definition and preventing them working. This might be slower, but would give you a far better hang of things. Most of the time, definitions that work for a single set of data donot work with multiple sets simply because data-structures change, but it is almost always possible to make it work just with a few tweaks, without needing to script (that's the biggest advantages of data trees!).

The components that you should watch out for are the ones that take a single input and give out multiple outputs (divide curve/srf, etc.) or vice versa (loft, interpcrv, etc) -- these are the ones that change the data structures the most. Hope it helps.
Thanks for the replies!

I didn't know about the 'animate' feature so I think that I will hopefully be able to get some result from that.

I spent a few minutes annotating my problem in a ghx script if anyone would like to take a look at it. I think the problem is quite evident after a viewing (even if the script is incredibly sloppy).

I was hoping that a tree structure might solve the problem for me but most of my outputs from elements are still on the {0} branch.
Attachments:
I just took a quick look at setting up a slider to show how the code should hopefully work.

If you slide the first slider between 0, 1 and 2, it'll show how the code should produce three different connector pieces.
Attachments:
Yep...the combination of animation and Modetools plugin did the trick. Thanks for the help everyone.

I'll probably post back in a few days just to understand the tree structure possibility as well...I'm still a bit uncertain as to how to branch elements.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service