Grouping opposite edges with random rotation

   1529   2   1
User Avatar
Member
20 posts
Joined: March 2018
Offline
Hi all,

I am trying to create a group of two opposite edges on a rectangle, singular primitive which may have an incoming rotation (its for a HDA). What I am basically trying to achieve is a way to orient the bounding box on a group node "group by bounding box" so that I can avoid the below issue.

Attachments:
Screenshot 2022-06-11 065847.png (397.1 KB)
Screenshot 2022-06-11 065858.png (388.3 KB)

User Avatar
Member
5100 posts
Joined: Feb. 2012
Offline
Hi,

If it's a quad, you can pick a random point, i.e. point 0, get it's edges, only pick the first edge. Then get its points and then the edges of all these points, and convert them to points. Excluding the first edge's that you picked before should leave you with the points of the opposite edge. You can easily find that edge that uses those 2 points.

You can also create a transformation matrix in a similar manner to reset the xform, group the edges, and then revert the transformation back.
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com] https://lnk.bio/animatrix [lnk.bio]
User Avatar
Member
20 posts
Joined: March 2018
Offline
Thanks animatrix!

That first option worked a treat and solved another issue I was having which was grouping non-regular primtive shapes. Thanks mate!
  • Quick Links