When I start thinking about it,
I would start with the sum of dot products around a loop is zero
when there are only 4 edges, each of them facing each other.
But this is too naive, because some openings may have more than 4 edges,
that form a hexagon for example.
How do I detect all hollow openings on my static mesh, like wells.
Thanks
Jack
How to detect hollow openings/holes on a static mesh?
Build a data structure where each edge points to it's two triangles and each vertex has a list of it's edges.
Build a list containing all edges with one triangle pointer empty (open edges) an a flag per edge.
1. Start a new hole by taking an unmarked edge from the list.
2. Add the edge to the hole and mark the edge. Pick one of its vertices and loop over all its edges: Find another open edge from it, this must be the next edge at the same hole. Continue (always using the other yet unvisited vertex) until you get back to the initial edge. The hole is done.
3. Continue with step 1 until all open edges has been marked and all holes are found.
It's really simple and fast but you need meshes without bugs (double edges or whatever).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement