7

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?

enter image description here

Moody
  • 1,297
  • 2
  • 12
  • 21
  • 1
    And what kind of output should the algorithm give for the examples you showed? – Dominik Mokriš Nov 01 '18 at 10:36
  • A topologist would say the box is the same as a flat sheet, but the cylinder is different. – AakashM Nov 01 '18 at 10:39
  • Those are pretty difficult tasks. For the handles (cylinder example), you might find interesting approaches [here](http://web.cse.ohio-state.edu/~dey.8/paper/hantun-persist/hantun.pdf) and [here](http://hhoppe.com/proj/isotoposimp/). For the openings, you need to be more specific about what an opening is. Does every concave polyhedron have openings, i.e., do you just want to find the convex hull? – Nico Schertler Nov 01 '18 at 10:40
  • @DominikMokriš A list of vertices that make up the opening/hole. So for the cube it would be the inner 4 vertices on the top, and for the cylinder it would be the inner edge loop vertices from both sides – Moody Nov 01 '18 at 10:54
  • @NicoSchertler For the case of the cube in the image, a convex hull would be sufficient, but assuming a volume with one big opening and many small ones, I would ideally be able to determine all the openings, and just fill the small ones depending on the opening surface area. I'm not sure how feasible that is though. – Moody Nov 01 '18 at 10:58
  • This brings us back to the question of what an opening is. I am imagining a very irregular model - then how do you decide what to fill and what to leave? Maybe something like convex ridge loops enclosing concave edges? – Nico Schertler Nov 01 '18 at 18:12
  • @NicoSchertler I'm not sure what you mean by irregular model, but the models in question are CAD models. What decides which openings to fill is its size. – Moody Nov 01 '18 at 18:59
  • I mean something like [this](https://i.stack.imgur.com/ZjujY.png). – Nico Schertler Nov 01 '18 at 19:33
  • @NicoSchertler No nothing like that. The models are CAD models of machines (manufacturing machinery, factory lines, cars, etc...) – Moody Nov 01 '18 at 20:01
  • @NicoSchertler: the number of holes is a well defined topological concept, also called the genus of the surface. The sinuosity of the shape doesn't matter. For example, a doughnut and a mug with handle both have a single hole. –  Nov 02 '18 at 12:47
  • @YvesDaoust I know. I am not asking about the holes. I am asking about the openings in the (closed genus-0) box or general surfaces. – Nico Schertler Nov 02 '18 at 13:58

1 Answers1

1

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.

David Eisenstat
  • 64,237
  • 7
  • 60
  • 120
  • 2
    I won't lie, I didn't understand anything you said. But I guess you've given me quite a few terms I can search and read up on. – Moody Nov 01 '18 at 20:03