Custom Houdini tool that takes geometry input, finds edge points, and sorts them into flat, convex, and concave groups for easy use. Additionally, it sorts the primitives and points along the border to be continuous numbers.
When working in Houdini I often want to sort along the border for various reasons but the default sort isn't capable of doing this so I decided to put together a small tool to streamline the process. Below is an overview of what happens in the node:
- Input geometry receives point normals with the y-component zeroed out.
- All points along the lowest edge loop are found and put into an array.
- Each primitive receives an attribute with its two points in the edge loop array.
- A starting point is selected and then all points are looped over to find the next primitive containing said point (more details below code snippet).
- Points and prims are sorted based on the order in which they were found to achieve a continuous border increasing by 1 as it moves to the neighbor.
- A vector that points to the neighbor point is created.
- Exterior angle of each corner is found by taking the arccosine of the dot product of the normal vector and point vector and dividing it by the magnitudes multiplied.
- These results then sort the corners into the appropriate categories for use.
Video demonstration that takes multiple meshes and sorts them into appropriate corner types.