Grasshopper

algorithmic modeling for Rhino

This is a problem I've run into multiple times.  While I have a workaround for it I was wondering if there was a smarter solution.

I have 2 sets of data.  The first set is like this:

{0;1} n=1

{0;2} n=1

{0;3} n=1

{1;1} n=1

{1;2} n=1

{1;3} n=1

etc.

The second set is like this:

{0} n=2854

{1} n=5943

Essentially I want to combine this data so that all the data in second set gets matched to data in the first set that has the same branch index at the top level.

In other words so that {0} gets matched with {0;?} and {1} gets matched with {1;?}.

My work around has been to duplicate the data in the second by the number of second level branches in the first set and then re-partition so that the branch structures are the same.  This method can be painfully slow though when dealing with large sets.  Am I missing something obvious here?

Views: 303

Replies to This Discussion

That's a common method, with native gh components. If you are willing to use plugins, propagate ancestors from tree sloth plugin does the job to.

best

alex

Thanks.  Guess my method really isn't that slow.  I'm just being lazy.  Good to know about the propagate ancestor node though to aid in my slothness. 

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service