Evaluate & Sort by common angle

Hello GH Community,

I have three groups of rotated surfaces, and I have evaluated the rotation angle of each surface in each group.

I would like to learn how to sort the initial surfaces into subgroups by the common angle so I can select them by grouped common angle.

Any help would be greatly appreciated.

sort by angle.gh (40.0 KB)

I’m not entirely sure what you are asking for? No sorting required for this:


sort by angle_2024Aug6a.gh (46.6 KB)

Eight angles found, grouped and colored by branch:

            {0}
0. -7.5
1. -3
2. 1.5
3. 6
4. 10.5
5. 15
6. 19.5
7. 24

P.S. How to use Member Index. Useful for many things!

1 Like

I wasn’t sure I grasped the question either, or what ‘common’ implied here: uniqueness, domain, etc - at first I sorted by angle ‘domains’, in case it helps:


sort by angle.gh (86.7 KB)

Thank you!
I think I see how it’s working. I will for sure take a look at member index.
May I ask if I am correct in assuming that there are:
55 at -7.5
14 at -3
etc

Thank you Joseph for your time, it is greatly appreciated.

You want the length of each branch, like this:


sort by angle_2024Aug6b.gh (46.6 KB)

WAIT! Too hasty, standby,

P.S. Still hasty but maybe more correct? Sorting



sort by angle_2024Aug6bb.gh (46.1 KB)

Same thing formatted differently:


sort by angle_2024Aug6bbb.gh (46.6 KB)

Thank you :slight_smile:

Perfect! apologies for not being clearer.
I believe I can take it from here :slight_smile: if i explode the list item, I will have those surfaces in those groups?

I’m being hasty now :slight_smile:

Take the first group of internalized surfaces (68 in total).
I see repeating angles (what I called “common angle”, probably the wrong word to use).

Of those 68 surfaces, I want to group all the surfaces that are 10.5 degrees, all the 15 degrees, all the 6 etc.

The same for the other initial groups

Sorry, I hope i am being clearer.

Me too because I’m done! Sorry. (thought you said “clever”, my eyes are failing)

Thank you for all your help Joseph, I think I can get everything I need from what you have shown me. Much appreciated!

I thought I was being clever by replacing Merge with Entwine, and do think it’s the right approach, but the colors tell me something is wrong. Some surfaces have no color :interrobang:

I suspect the purple group, and this will haunt me, but I’m done for now.


sort by angle_2024Aug6c.gh (50.0 KB)

P.S. I found something
 ColorBa needed Match Tree internally, but that had no effect. :thinking:

I got something that shows all the colors (and all the surfaces colored) but I barely understand it and don’t know why it’s necessary since the summary numbers didn’t change.


sort by angle_2024Aug6d.gh (57.7 KB)

1 Like

I can’t thank you enough. Its truly very much appreciated and a huge help!

I have studied it but I am still struggling with the final part.
May I push my luck and ask for one last assistance.

The purpose for the regrouping is to visualize them but more importantly I plan to modify other geometry specific for each angle.

“By the way
” is mission creep, AKA moving the goal posts. Exhausting. I’m still puzzled by the mystery in that purple group and still don’t know why there are three groups of surfaces? It looks like you don’t understand data trees and how to work with branches.

This was always my goal from the original request. Thanks for all your help so far.

My first reply did that, except for the three initial groups that are still a mystery to me.

Images like this make me cringe, it’s not “The Grasshopper Way”.

thank you

Actually, my last reply (version ‘Aug6d’) did what I think you want. I added my ‘Tree/List Viewer’ tool and disabled the hasty sorting to make it more obvious. The ‘path idx’ slider selects the branch and the ‘list idx’ slider selects a surface to be displayed in yellow, while all others in that branch are blue. So this image shows branch {0;0;3} (14 at 6°) and item 13 (zero-based numbering 0
13 = 14 in branch).

Ideally, the sort should reorganize the data tree instead of only the results.


sort by angle_2024Aug6dd.gh (66.5 KB)

1 Like

thank you! this helps a lot.

In this version (‘Aug7a’), sorting reorganizes the data tree - not hasty! ‘Tree/List Viewer’ is disabled as it conflicts with ColorBa.


sort by angle_2024Aug7a.gh (71.2 KB)

This version (‘Aug7aa’) is the same except ‘Tree/List Viewer’ is enabled and preview of ColorBa is hidden.


sort by angle_2024Aug7aa.gh (71.2 KB)

PShift and Partition in the purple group make this more difficult to understand. They were added to get around a mystery that remains unexplained


With preview enabled on the original three Srf params:


sort by angle_2024Aug7aaa.gh (70.9 KB)