How to group points based on other point branches

Hi, I have a list of points, that was flattened. Another component is a list that stores points in a tree structure, that represents my target points. What I am searching for is how to group all points to my target point groups by identical x and z value. At the end I want to receive a list with four branches, where “all pts” are sorted to the four point groups of my target points.

You can see in the rhino preview visualized the groups that I am trying to achieve, but the ordner or “all pts” is not the same yet.

Thanks for your help! (11.3 KB) ABQuestion

Here is your (unchanged) GrassHopper file :slight_smile: - your link became corrupted somehow.

Thank you for helping with the post. I changed the link one more time.

When a question on this forum uses the word “simple”, it almost always means the person has no idea what they are talking about. I certainly have no idea what your question means?

how to group all points of “Points” along my attractor groups

For others reading this, here is the whole GH file; it doesn’t contain the curve shown in the image above:


Yes, there is the possibility of talking with people that has not the same knowledge like you in a forum. But I am sorry for my inaccurate way of expression and changed the topic description one more time for you. The next time you can not understand me, just ask me friendly again.

Just for me? Well, I still haven’t got a clue what you’re trying to do. Good luck.

The red circled columns are my target groups. All four target groups (red) are stored at “Target pts”. My list “All pts.” contain of all points that you can see without the red circled ones. All items in “All pts.” should be grouped to my target groups based on identical x and z coordinates.

The blue groups are visualizing what I am trying to receive.

There are probably more efficient ways, but something like this? (19.0 KB)

Thanks for your answer. Do you know a way where to test all points for equality based on x and z coordinate with my target groups?

If I understand you correctly (and I am almost certain I don’t), then yes. But maybe you can give it a go first, if what I gave you is even part way to what you are looking for. If not…I’m at a complete loss.

Interesting. PGroups does a wonderful job of defining the four groups! Here’s where I was going with the original spec, which is flawed:

should be grouped to my target groups based on identical x and z coordinates

GHQuestion_2019Jun28a (21.3 KB)

However, your idea of using PGroups and BBox suggests other possibilities…

GHQuestion_2019Jun28b (24.1 KB)


Nice approach. I thought about doing something similar originally, but then the grouping is not as per the original target points tree structure…although I’m unsure if this is important or not.

Really? How so? It looks to me like a tree with four branches that correspond to the ‘Target pts’. OH! I see what you mean, the groups (tree branches) are in a different sequence. Hmmm, yeah, will give it some thought. Good eye.

Here is a simplified version of your InCurve approach that yields the same result as mine: (20.2 KB)

1 Like

Same number of branches, but the branches are in a different order. The target points at {0} (if the branches were simplified…which I should have done in my screenshot), don’t match the sorted points in branch {0} (again…if the branches were simplified).

Edit: updated screenshot with branches simplified:

Edit Edit…Oooops. Just reread your post. I see that you got my meaning…I blame the hour of the evening.

How about this? The yellow group re-establishes the sequence of BBox results to match the original tree of ‘Target pts’. Like the man said, “simple”! :sunglasses: (31.7 KB)

Another possible approach for grouping and sorting points order. (24.1 KB)


When you break down your points into x, y, and z coordinates, do you think you can simply group them into four?
How can you distinguish the many identical x or z coordinates overlay between the four groups?
If the premise is invalid, shouldn’t we find another way?

1 Like

You are right, sorry!
Do you know a way without using the Kangaroo component “removeDublicateLines” at the beginning. I am looking for a way with native components.

Kangaroo2 was shiped in rhino 6 .

1 Like

Thanks for the information!