Grouping points / edges with same x & z positions?

   3056   7   1
User Avatar
Member
26 posts
Joined: June 2016
Offline
I'm trying to group points (and then transform them to edges) based on their x and z positions.
There are two things that would help me:

1. Have one group that contains all aligned EDGES
2. Have multiple groups of all aligned POINTS

Both are fine, however I'm interested in how to do both.
Edited by 8BitBeard - April 21, 2017 04:27:57

Attachments:
edges.png (203.9 KB)

User Avatar
Member
670 posts
Joined: Sept. 2013
Offline
2) Put
vert_`@P.x`_`@P.z`
in the Partition SOP.
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
User Avatar
Member
26 posts
Joined: June 2016
Offline
Thank you!
How about 1? Anyone has a solution for one large group with all edges?
Edited by 8BitBeard - April 21, 2017 09:30:35
User Avatar
Member
670 posts
Joined: Sept. 2013
Offline
1)
Set a grouppromote node from points to edges and put vert* in group.
Then take a groupcombine node: group all equals vert*.
You can additionally use a groupdelete node on vert* to tidy up.
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
User Avatar
Member
26 posts
Joined: June 2016
Offline
Konstantin Magnus
1)
Set a grouppromote node from points to edges and put vert* in group.
Then take a groupcombine node: group all equals vert*.
You can additionally use a groupdelete node on vert* to tidy up.

Thanks again. However, this does not work.
Am I supposed to do this on it's own or following method 2 with the partition?

No matter how, it does not seem to work. If I create a grouppromote from points to edges and put vert* in “Group” I get the error “No groups match pattern vert*”.

Also, your solution with the partition is interesting (vert_`@P.x`_`@P.z`). Can you explain briefly, or point me to a resource, how this is working? I don't understand it.
User Avatar
Member
670 posts
Joined: Sept. 2013
Offline
Hi 8bitbeard.

seems I forgot to mention “Include only elements entirely contained in original group” needs to be ticked on. You can watch the whole procedure in the attachment.

Regarding the partition SOP: it puts all points in individual groups that share the same values in a specific attribute.
While vert_ _ is just a prefix name for all to be created groups,`@P.x` and `@P.z` are those attributes. Only if both of their values match a common group will be created.

Attachments:
vert_edges.hipnc (54.4 KB)

https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
User Avatar
Member
26 posts
Joined: June 2016
Offline
Konstantin Magnus

Thanks a lot! This is exactly what I wanted to achieve. I figured that vert_ _ is just the prefix, but what I still don't understand is why vert_`@P.x`_`@P.z` will only create a group if the values match. I mean, it seems you are just entering the x and z positional values of each point, where does it state that they should be identical?
User Avatar
Member
670 posts
Joined: Sept. 2013
Offline
8BitBeard
you are just entering the x and z positional values of each point, where does it state that they should be identical?

It's the purpose of the partition SOP to group points or primitives that give the same result to any suitable Hscript expression.

Well, my solution for case 2) does not quite work. It also fetches the points with identical X and Z positions on the middle top and bottom side of the box. I would still have to figure out a way to remove groups that only contain 2 points. But usually when I have to filter out something, it's the evaluation that should be improved instead.
Edited by Konstantin Magnus - April 23, 2017 17:32:00
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
  • Quick Links