Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

if a Vertex looks like this:

struct vertex {
    vec3 point;
    vertex [] connected;

Can I tell if this makes a solid shape with no holes? (e.g a sphere or a cube, NOT a sphere with a side missing for example)

(if i can see the back of a face from outside of the shape then it is not solid)

share|improve this question
up vote 7 down vote accepted

This is quite a tricky question.

My idea to test if an object has no hole is to check all edges and make sure they all belong to 2 different triangles. If an edge only belong to one triangle, it means it's a border of the whole surface, meaning there's a hole.

This could be harder if you have different vertex at the same position (for example to have different texture coordinates per face).

share|improve this answer
I managed to get it working but i have to give it the triangles. I could not work out how to generate them myself. But its good enough – tm1rbrt Aug 24 '11 at 19:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.