Grasshopper

algorithmic modeling for Rhino

duplicate data removal from variable lenght branches

I have a list of numbers (actually indexes but it does not matter) organized in a variable length branches. the branches can be 3 to 6 long lists.  See image.

In the branches there can duplicate numbers  in 3 different branches.

Is there a way to keep only the first occurrence of the numbers and remove all the duplicates from the different length branches.

Is there a solution for this in a way that the branch structure does not change since it represents a kind of grouping? Even if there are will  branches with no data.

Thanks for any help!

Views: 1002

Attachments:

Replies to This Discussion

Hello.

I think I found what you're looking for. I used the Tree Frog path management components in the Human plug-in (in blue).

Hi FRiou, 

It looks really nice and clean solution, however I would prefer a "native" grasshopper solution for using it on the long run. But I will defenitely use it if I can get a native one. Just in case can you share the file with me, in case if I will install Treefog in the future? Thank you very much for you work.

Ok, I finally found a way to have the same result without the Tree Frog components. But it's a little bit more complex !

See below. I also attached two files. One without the Tree Frog components, and one with (the "bis" one).

Good luck !

Attachments:

Wow, that was quick! :)

Thank you so much!

Another one...;)

I am using you solution since then. Thanks again! Can you help with a little bit of fine tuning. ?

In you solution all those branches are removed where there are no elements remained.

I need to synchronise it with other data, so it would be a great help for me if the removed branches could stay with null or nothing.

Here is another one made by C#.

Attachments:

Thank you very much!

Hi Guys, 

Can you help me please with a littel bit of finetuning of your solution ? Actually I get an error (red component, see attched image) with with my numbers. I attach a file with my numbers

The finetuned soulution would prioritize the branches which contain more items. And thus the duplicate numbers would be removed from branches which includes lower number of elements...

Is it possible?

Attachments:

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service