342 Chapter 9 Geometric Primitives in 3D
}
}
}
// check if any face has not been visited
for (each face f in mesh) {
if (f.visited == false)
return false;
}
// all faces were visited, the mesh is connected
return true;
}
9.3.3 Manifold Meshes
A connected mesh is said to be a manifold mesh if each edge in the mesh is shared
by at most two faces. The topology of manifold face meshes is potentially more com-
plicated than for meshes in the plane. The problem is one of orientability. Although
there is a formal mathematical definition for orientable surfaces, we will use a defini-
tion for manifold meshes that hints at a test itself for orientability. A manifold mesh
is orientable if the vertex orderings for the faces can be chosen so that adjacent faces
have consistent orderings.LetF
0
and F
1
be adjacent faces sharing the edge V
0
, V
1
.If
V
0
and V
1
occur in this order for F
0
, then they must occur in F
1
in the order V
1
fol-
lowed by V
0
. The prototypical case is for a mesh of two triangles that share an edge.
Figure 9.15 shows the four possible configurations.
AM
¨
obius strip is an example of a nonorientable surface. Figure 9.16 shows this.
Two parallel edges of a rectangle in 3D can be joined together to form a cylindrical
strip that is orientable. However, if the rectangle is twisted so that the edges join in
reversed order, a M
¨
obius strip is obtained, a nonorientable surface.
In nearly all graphics applications, meshes are required to be orientable. Observe
that the definition for manifold mesh is topological in the sense that only vertex or-
derings and connectivity information are mentioned in the definition, not vertex,
edge, or face locations. The definition does not rule out self-intersections, a geomet-
rical property. Usually applications also require a mesh to be non-self-intersecting.
9.3.4 Closed Meshes
A connected mesh is said to be a closed mesh if it is manifold with each edge shared by
exactly two faces and is non-self-intersecting. The typical example of a closed mesh
is a triangle mesh that tessellates a sphere. If a mesh is not closed, it is said to be an
open mesh. For example, a triangle mesh that tessellates a hemisphere is open.