Grasshopper

algorithmic modeling for Rhino

Is there an easy way to filter out duplicate numbers in a list?

So there is "1,1,0,2,4,4,4,3,4,2,0" and output would be only "0,1,2,3,4".

What would be even better is if there is a way to also remove duplicate objects in a list, or objects with the same geometry, is that possible?

Much appreciated.

Theunis

Views: 36978

Replies to This Discussion

There is in the tab sets>sets the delete consecutive component. Also, there is find similar member component there, which will let you search a list for specific values. Also if you are trying to remove duplicate lines or points, kangaroo has two very handy components that specifically do that.

Ok, good to know. However in my case its necessary to know which indexes that are effected. Im working with parallel lists, one for the geometry and another including additional data for that specific geometry item. Thanks though

oh, yes this was useful for me, still need the vb but this saves some space.

Were you ever successful a making this component?  It would really come in handy.

 

I tried shifting a list of points and using the distance component to check to see if it is the same point.  There is a strange thing happening. points with the exact same coordinates are returning a distance albeit it very small 4e-13.  Any thoughts on why this is happening.

 

Stan

Stan,

 

Kangaroo has a remove duplicate points component.  You may want to try that.

Great! Thanks Taz,
I will give that a try.
Stan

I've also "cheated" by using the kangaroo RemoveDuplicate Points component, to remove duplicate values from a list.

That just came up again too...  Other ways to get unique values:

 

http://www.grasshopper3d.com/forum/topics/specific-data-in-lists

Heres yet another way to find unique values...in a dumb but simple way using values to create a line to split.....in the image..its the lower portion

the upper portion is dividing a list of surfaces into two lists based on the number of sides it has

Attachments:

Taz,

 

I'd like to separate the coordinates in list B from the coordinates in list A.

Is there a way to remove the elements that fall in the intersection from the list so that there are no duplicated circles in the inner zone?

Attachments:
It would be great if you could replace the index of specific points by another one with a similar VB component (i.e. I would like 0 to become 99 in this case)...Any ideas?
Many thanks,
Arthur

Is there any way to do this with a list of non-numeric items? And with a list that is continually expanding?

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