Grasshopper

algorithmic modeling for Rhino

hey
i m playing with voronoi, is there an possibility to delete double lines? when you explode the voronoi
markus

Views: 4196

Replies to This Discussion

Hi Markus,

deleting duplicate objects is not a ready function in Grasshopper. Normally it involves:

1) sorting all data
2) comparing each item in the sorted list with the next item, if they are the same, the item is a duplicate.
3) unsort the list of duplicate flags, so it can be matched with the original data.
4) cull the original data with the unsorted duplicate flag list.

--
David Rutten
david@mcneel.com
Poprad, Slovakia

hey

i get it... if u know it its quite easy ;) works well with one voronoi but i have multiple...
when i explode the lines the tree is broken... can i delete the last brunch on the tree that the lines are in the old brunch order?

i uploadet the files
Attachments:
Hey. Did you ever figure out how to do the deletion with multiple lines? I have a 3d construction with a lot of lines. Some of the are the same even 3 of the same. So i cannot get the def to work.

Rasmus
hi,
no i have no solution... sorting the lines makes it only possible to delete lines with the same lengh... maybe its possible to compare the start and endpoints of the lines with XYZ values. and delet the lines with the same start and endpotins...
here is something i can up with while in studio today. ive been looking for the same thing and nothing ive found has worked. i have tested this one with up to about 20 lines and it still works.

let me know if anyone else has luck with it or if there are issues.
Attachments:
Not sure if Kangroo has been updated for GH 0.7, but it contains a delete duplicate routine:

http://www.grasshopper3d.com/forum/topics/management-of-lists?comme...

I would try to find the latest version from the group page:

http://groups.google.co.uk/group/kangaroophysics
Another easy method is to write a quick VB script like this ...

Private Sub RunScript(ByVal A As Object, ByVal B As Object, ByRef Eq As Object, ByRef Ne As Object)
If A.ToString = B.ToString Then
Eq = True
Ne = False
Else
Eq = False
Ne = True
End If
End Sub

It basically converts the input streams to string representations and compares them. Identical geometry of any kind will produce exactly the same string and can be culled from your list. Just make certain that the input types are the same.

I use this as an absolute (==) "Comparison Operator." Attached is also a sample with the definition in a .ghx file.
Attachments:

hey guys!

how to use this definition? where is the list of the dublicates? or how to use the cull list?

please help!

max

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