algorithmic modeling for Rhino
Good day GH friends,
Its already taking me days contemplating on this problem and yet still unsuccessful to come up with a solution.
I wish to combine the branches that share the same value in some of the items within a branch. Kindly refer to the snapshot below for better understanding of the goal i wish to achieve: All effort to help will be much appreciated - Homar
Looks really tricky, because as you merge sets of values you have to deal with those new intermediate sets.
Are you interested only in integers, or also floating point number or other data types?
Thank you very much David. The C# is the last piece for my work puzzle.
You can use the "set union" and "set intersection" components to achieve what you want.
1- With the "set intersection" component you can check if there is a common value between two branches of the tree.
2- If the above is true, then you can "set union" both branches (that you have already checked)
PS: this might be a repetitive process, however you can do it once and add it in a cluster and then use the cluster for the repetitions.
Check the attached image.
Thank you for your help and time in this problem of mine. For now David's solution is best for my work now.
Of course David have always the better way to do it ..
My way using regular components was not that much nice and general ..
I will look more deeply into your approach, I'm just occupied at the moment. I notice that there is a VB component in the image. What's inside that VB?