Grasshopper

algorithmic modeling for Rhino

Hi, 

I have a list of 2310 points, sorted by their 'Z' coordinate which are at every 0.5 interval between 0-10. (Ie I have 'n' number of X,Y,0 coordinates, X,Y,0.5 coordinates, X,Y,1 coordinates and so on)

I want to sort this list into Trees with branches defined by 'Z' coordinate. So that tree {0;0;0} will contain points that satisfy (X,Y,0), tree {0;0;1} to contain points that satisfy (X,Y,0.5) etc.

However these trees will have an unequal number of points in each branch as the number of points for each 'Z' criteria is different. Is there a way to define this in grasshopper?

Thanks,

Tom

Views: 725

Attachments:

Replies to This Discussion

Hi Tom

In a python component then this would be fairly easy. (I think:))

If you share your definition or at least the points then I could have a fast look for you?

Henrik

Hi Henrik, 

Thanks for the response. I've attached my Grasshopper file. The points which need sorting are grouped and are attached to the sort list component. The rest of the definition is superfluous for now! 

Thanks, 

Tom

Attachments:

The number 2 in the expression CInt(P.z*2) is one over z-accuracy.

Attachments:

Hi David, 

Thanks very much for the reply! I can follow the definition for the most part but I'm still a little confused by the Evaluate expression component. I opened up your definition and noticed that in this component your variable is set to 'P: Point or vector' whereas when I create this component it lists 'Variable X: Point or Vector' which is returning an error message on the component. 

Tom

I renamed it P because it deals with points. If you create a new Expression the default name is x, but I find that confusing in this case because x.z isn't as clear as P.z

Ah perfect, I follow you now. That's done the job, thank you again for your help!

Hi David, 

[edit] - I'm not sure my original points were in 0.5 'Z' intervals. Your definition is doing exactly what I wanted, I just hadn't sorted my original points correctly. 

Thanks, 

Tom

Hi

Well David had another solution (probably simpler). I would go for that. :)

Okay, thanks for looking into it!

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service