# How to detect hollow openings/holes on a static mesh?

This topic is 686 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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

##### Share on other sites

Can you present an example?

##### Share on other sites

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).

1. 1
2. 2
3. 3
Rutin
15
4. 4
khawk
13
5. 5
frob
12

• 9
• 11
• 11
• 23
• 12
• ### Forum Statistics

• Total Topics
633662
• Total Posts
3013231
×