Sign in to follow this  
rajesh_nest

Detecting a hole in a mesh

Recommended Posts

rajesh_nest    136
I have an algorithm to find the boundary edges of a triangles. As the mesh has holes (infact several holes) my algorithm return both the edges in the mesh boundary and edges adjacent to the hole region.

My question is how to differentiate between them. So that I can determine collection of those edges which forms a hole.

Share this post


Link to post
Share on other sites
haegarr    7372
Hidden
AFAIK there is no clear distinction. Topologically the boundary of a "hole" and the outside boundary of an open mesh is one and the same. The following are just ideas ...

* If you know that the mesh should be a 2-manifold, any boundary must surround a hole.

* If the mesh forms a flat surface, then you can determine the outer contour and distinguish it from any inner contour.

* If the mesh forms a nearly flat surface, then a projection and sub-sequent outer contour determination could work.


* Perhaps the surface normals at the boundary must not differ significantly (i.e. more than a threshold) from the normals of a "hole" filler to classify the boundary to be one of a hole (i.e. some kind of curvature assessment).

Share this post


Link to post
haegarr    7372
[font="arial, verdana, tahoma, sans-serif"][size="2"]AFAIK there is no clear distinction. Topologically the boundary of a "hole" and the outside boundary of an open mesh is one and the same. The following are just ideas ...

* If you know that the mesh should be a 2-manifold, any boundary must surround a hole.

* If the mesh forms a flat surface, then you can determine the outer contour and distinguish it from any inner contour.

* If the mesh forms a nearly flat surface, then a projection and sub-sequent outer contour determination could work.

* Perhaps the surface normals at the boundary must not differ significantly (i.e. more than a threshold) from the normals of a "hole" filler to classify the boundary to be one of a hole (i.e. some kind of curvature assessment).[/size][/font]
[size="3"][size=2]
[/size][/size]
[size="3"][size=2]The question is, what is the human formulated criterion to distinguish a hole from the mesh's outside?[/size][/size]

Share this post


Link to post
Share on other sites
Waterlimon    4398
Hmm..

Get the edges of the hole, and pick 2 points on the opposit sides. Then you could check if the polygons are on the inner side or the outer side...

Not propably very good and might not work on non convex holes though...

Share this post


Link to post
Share on other sites
JohnnyJimJams    100
Based on the idea that hole edges would form a line loop and so would outside edges, you could differentiate between the two by line loop length.

1) Find an edge
2) Count the edges in that loop
3) If edgecount < SOMENUMBER, edge is a hole edge.

Note you could also exit early from the count loop once you know the count is greater than SOMENUMBER

Share this post


Link to post
Share on other sites
alvaro    21246
As haegarr pointed out, there is no difference between the two. Think of a cylinder that is missing the top and bottom faces. You can continuously modified it by making one of the openings bigger and making the whole thing flat. At the end of this process, it is clear what you mean by "hole" and "boundary", but at the beginning both openings looked identical. At what point in the process do you want to label them? As you see, there is no natural answer.

What do you need this for?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this