Meshes: Faces, Vertices, Edges
Meshes: Faces, Vertices, Edges
polygonal soup
polygons specified one-by-one with no explicit information on
shared vertices
polygonal nonmanifold
connectivity information is provided (which vertices are shared)
no restrictions on connections between polygons
polygonal manifold
no edge is shared by more than two polygons; the faces
adjacent to a vertex form a single ring (incomplete ring for
boundary vertices)
triangle manifold
in addition, all faces are triangles
Mesh elements
faces, vertices, edges
1
Mesh descriptions
OBJ format
each line defines an element (vertex or face); first
character defines the type
Vertex:
v x, y z
Face with n vertices:
f i1 i2 i3 in
where i1.. in, are vertex indices; the indices are obtained by
numbering all vertices sequentially as they appear in a
file
Mesh operations
Types of mesh operations
traversals go over all elements of certain type
collect adjacent elements (e.g. all neighbors of a vertex)
refinement
edge flips
face
addition/deletion
face merge
2
Traversal operations
Iterate over all vertices, faces, edge
visit each only once
iterate over all elements (faces, vertices,
edges) adjacent to an element
0 1 2 3 3 2 4 vertex indices of
all faces
3
Traversal operations
Complexity of traversal operations w/o additional data
structures as function of the number of vertices,
assuming constant vertex/face ratio
iterate over
collect
V E F
adjacent
Traversal operations
Most operations such as collecting all adjacent faces for a
vertex are slow, because the connectivity information is
not explicit: one needs to search the whole list of faces
to find faces with a given vertex; if neighbors are
encoded explicitly this can be done in const. time
4
Face-based mesh representation
Useful primarily for triangle or quad. meshes
Triangle meshes:
struct Face {
Face* face[3]; // pointers
//to neighbors
Vertex* vertex[3];
}
struct Vertex {
Face* face; // pointer to a triangle
//adjacent to the vertex
}
(not really necessary, can refer to vertices using a handle (Face ptr,
vertex index)
fstart = v->face;
f = fstart;
do {
... // perform operations with *f
// assume that vertex i is across edge i
if (f->vertex[0]== v)
f = f->face[1]; // crossing edge #1 vert. 0 - vert. 2
else if (f->v[1] == v)
f = f->face[2]; // crossing edge #2 vert. 1 - vert. 0
else
f = f->face[0]; // crossing edge #0 vert. 2 - vert. 1
} while( f ! = fstart);
5
Half-edge data structure
General manifold polygonal meshes
Polygons have variable number of vertices
variable size;
data structures based on faces are inconvenient and
inefficient.
Solution: use edge-based structures (winged
edge, half-edge).
Half-edge is currently most common
Each edge = 2 half edges; can be interpreted either
as
directed edge or face-edge pair
6
Traversal operations
Vertices adjacent to a vertex v, mesh without
boundary
he = v->halfedge;
do {
he = he->sym->next;
... // perform operations with
// he->vertex
} while (he != v->halfedge)
No if statements.