Jump to content

Group perpendicular Primitives of Same Color


Recommended Posts

I have a sphere (Polygon Mesh) with random color on each primitive. Some primitives receive the same color and I would like to select primitives that are perpendicular to each other if they have the same color.

I tried separating all primitives with the same color, then using a primneighbours() function in a for loop to select primitives that have 2 or more points shared with another primitive? That doesn't work. Can anyone provide an example of how to use the primneighbours() function to select perpendicular primitives with shared edges? (Or provide an alternative method?)

Link to comment
Share on other sites

I have a sphere (Polygon Mesh) with random color on each primitive. Some primitives receive the same color and I would like to select primitives that are perpendicular to each other if they have the same color.

I tried separating all primitives with the same color, then using a primneighbours() function in a for loop to select primitives that have 2 or more points shared with another primitive? That doesn't work. Can anyone provide an example of how to use the primneighbours() function to select perpendicular primitives with shared edges? (Or provide an alternative method?)

Off the top of my head you could get the prim neighboour's normal and test it against the current prim's normal. You can test if they are perpendicular using the dot product. If the dot product of the two normals equals 0, then they are perfectly perpendicular to each other. Probably easiest to do this in a Vop Sop.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...