Grasshopper

algorithmic modeling for Rhino

Sorting points/curves according to their location into tree branches

I got a bunch of planner closed curves, they are all parallel in space, having different height (Z position).

Is there a not VB way that can analyze those z positions, and sort the curves into a tree structure.

So that I got a tree, with multiple branches, each branch contain one or more planer curves which have the same z value.

Thanks

Views: 7111

Replies to This Discussion

this ought to work..
Attachments:
Tks a lot, this works very well.

Despite there in your upload, there is a mis-connect, the B input of the final compare should be fed by the plane component output instead of the sorted output.

But its a very nice tweak, a sort, shift, compare, cull sequence, I've never thought of that.
glad it worked. cheers. help others when you can
Hi Andrei,
I used your def. to help with a problem I'm having sorting points based on their z value, it does divide the list the way i need it, however it doesn't reorganize the list based on the z values, it keeps the same order just divides the list. I need what the sort points component does but for z values that i can then input into your def. to achieve the list division. Thank you for any help.
-Boris

it's the weirdest thing! the equality compare component doesn't give the right answer unless i pass the data through a panel first. maybe it's a bug or something...
anyway, this should work (attachment):
Attachments:

thank you so much for the script, great help!

Andrei is it possible once the curves are sorted to create a cull pattern where for example you want to select every other line in lets say in the x,y or z-direction. I've basically got a grid of straight lines and I want to select every other line in a certain direction, I understand I would need a cull pattern that reads (true, false, true, false) but ive got no luck so far, your help would be deeply appreciated.

 

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