algorithmic modeling for Rhino
Hi guys,
i would like to get rid of overlapping lines in a list of lines:
I know there is a "delete duplicate lines" in Kangaroo but it only deletes one of the duplicate not both lines that overlap.
I want to delete both overlapping lines....
Hope that makes sense.
thanks a lot,
arthur
Tags:
Thanks Taz,
not sure I got it...
Could you please say a bit more about how this script works?
Dim i As Integer
Dim j As Integer = 1
Dim count As New List(Of Double)
Dim valCount As New List(Of Double)
data.Sort()
data.Add(0)
For i = 1 To data.Count() - 1
If data(i) - data(i - 1) = 0 Then
j = j + 1
Else
count.Add(data(i - 1))
valCount.Add(j) j = 1
End If
Next
vals = count numVals = valCount
Many thanks,
Arthur
I hope you haven't been pondering for 8 months... It's been so long I couldn't do this from scratch again if I tried.
Basically the routine is just a counter that works on sorted integers. If the following value matches the current value the counter is incremented by 1.
If this is not the case the current count value is add to a list and reset to 1 (the counter starting value). There's a separate list for the unique integers.
The code is pretty sparse with a single For loop and an If statement so I'm not sure if I can add much else...
Hope that helps a bit.
Hey Taz!
Thanks a lot, it does help.
Being a bit short on time I think I ended up using the "delete overlapping lines" in Kangaroo.
I was still wondering how to check for duplicate data in a list and use the resulting pattern in a dispatch component.
Would you know how to make a script which would output a true for unique values and a false for any repeating values?
Cheers,
Arthur
That's the exact application shown in the April 11 image above.
I couldn't script all that with the grafting and stuff, but I'm sure it wouldn't be too hard (for someone else...) to wrap it all up in a script.
Are you trying to make a user module?
maybe this helps: http://www.food4rhino.com/project/yktools?etx
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by