Grasshopper

algorithmic modeling for Rhino

Is there a simple way to encapsulate a data tree before passing it through a component, so that the following components act on the 'envelope' rather than the data within?

As a simple example, shown in the attached definition, supposed there's a couple data structures that I like, and I want to create a toggle to choose between the two trees.

Currently the toggle messes up the structure.

How might one preserve the structures so that the toggle produces one or the other?

 

Views: 346

Attachments:

Replies to This Discussion

I am not sure how such an "encapsulation" procedure would work, but the specific task you're trying to accomplish (if I understand your intent correctly) can be achieved with the "stream filter" component, which allows for the selection of one set of data or another based on an index (which can be substituted with a toggle if you only have 2 streams to pick from.)

I can imagine it could work by a type of simple encryption or compression that combines all the data into one string, then later reverses the combination to the original data structure. Similar to combining a bunch of documents into a .zip file in order to email just one attachment.

But, maybe it's not necessary. The stream filter works great, thank you. I haven't come up with any other uses for data encapsulation in GH in this short time.

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