I want to detect (and close) openings and holes/hollowed out parts of a closed mesh. I know that for an open mesh, this can be done by finding the boundary edges (edges belonging to only one triangle) as described here.
But what about a closed mesh, where such boundary edges don't exist? Below is an example image. The box has an opening at the top, while the cylinder has a complete hole. Is there an algorithm to detect these things?
This sort of problem is studied in a field called computational topology. To distinguish the torus (or multi-torus) from the sphere, it suffices to determine whether (in the language of homology) there exists a 1-cycle that is not a boundary. Assuming you have an orientable manifold, this can be done by comparing the rank/nullity of the matrices corresponding to the relevant boundary operators.
To repair the hole, my intuition would be that finding the shortest cycle that's not a boundary, filling it in, and repeating would give reasonable results, but I don't know off the top of my head how to do that algorithmically.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With