Grasshopper

algorithmic modeling for Rhino

Hi all,

I have a tree with branches full of point pairs resulting from curve-curve intersections - in theory at least there should be exactly two points on each branch.  Now, I need to do stuff with the point in each pair that has the lowest Z value (then later the highest Z)...  The problem is the intersections are not returned sorted by Z, sometimes the lower point is first in the list, sometimes last.  So I need to sort those pairs of points by Z value.

I noticed the sort points component does not have any inputs for sort criteria...  RhinoScript SortPoints allows you to sort by:

blnOrder

Optional.  Number.  The component sort order, where:


Value

Component Sort Order

0 (default)

X, Y, Z

1

X, Z, Y

2

Y, X, Z

3

Y, Z, X

4

Z, X, Y

5

Z, Y, X


Will we get something like this in GH?  For now I think I can manage to analyze the Z for each and re-order the points, but a more comprehensive point sorting tool might be nice...  no?  Or did I miss something obvious?  --Thx,  --Mitch

Views: 1622

Replies to This Discussion

You can decompose the pts, use the z value Into the first input of the logic > sort component, put the points into the next input...
Hey Luis,

Thanks! I had started out in that direction, but I couldn't make it work at first - tried again and now it's working - I had to sort the list and use a dispatch component to separate the lower and upper values in each branch.

I had thought it would be easier to do... compare the Z coordinates and choose the one which was less - in any case that's how I would script it... there's only two values to compare. But, I tried that, decomposing the points and inputting the Z's into a less than (<) component, and using that T/F list to dispatch the points - but that gave me the wrong points - the < component is not liking my tree structure, I think... I'll have to investigate why... --Mitch

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service