Lecture 3 Mesh Dr. Shuang LIANG School of Software Engineering Tongji University Spring 2013
Today s Topics Overview Mesh Acquisition Mesh Data Structures Subdivision Surfaces
Today s Topics Overview Mesh Acquisition Mesh Data Structures Subdivision Surfaces
Overview 3D polygonal mesh Representing a 2D surface embedded in 3D by using a set of polygons Why are they of interest? Simple, common representation Rendering with hardware support Output of many acquisition tools Input to many simulation/analysis tools
Overview 3D polygonal mesh
Overview 3D polygonal mesh Geometry & topology
Today s Topics Overview Mesh Acquisition Mesh Data Structures Subdivision Surfaces
Mesh Acquisition Interactive modeling Polygon editors Interactive software Scanners SketchUp Blender
Mesh Acquisition Interactive modeling Polygon editors Interactive software Scanners Laser range scanners
Mesh Acquisition Interactive modeling Polygon editors Interactive software Scanners Laser range scanners CT, MRI, etc.
Today s Topics Overview Mesh Acquisition Mesh Data Structures Desired characteristics Main data structures Subdivision Surfaces
Desired Characteristics Performance requirements Efficient traversal of topology Given a face, find its vertices Given a face, find neighboring faces Given a vertex, find faces touching it Given a vertex, find neighboring vertices Given an edge, find vertices and faces it touches Efficient usage of memory Efficient updates We need to consider Algorithms Operations
Mesh Data Structures Independent faces Vertex and face tables Adjacency lists Winged edge Half edge Simple triangle mesh
Independent Faces Each face lists vertex coordinates Redundant vertices (x 4,y 4,z 4 ) (x 3,y 3,z 3 ) f 2 f 3 f 1 (x 5,y 5,z 5 ) (x 1,y 1,z 1 ) (x 2,y 2,z 2 ) FACE TABLE f 1 f 2 f 3 (x 1,y 1,z 1 ), (x 2,y 2,z 2 ), (x 3,y 3,z 3 ) (x 2,y 2,z 2 ), (x 4,y 4,z 4 ), (x 3,y 3,z 3 ) (x 2,y 2,z 2 ), (x 5,y 5,z 5 ), (x 4,y 4,z 4 )
Vertex and Face Tables Each face lists vertex references Shared vertices No adjacency information (x 3,y 3,z 3 ) (x 4,y 4,z 4 ) f 2 f 3 f 1 (x 5,y 5,z 5 ) (x 1,y 1,z 1 ) (x 2,y 2,z 2 ) VERTEX TABLE FACE TABLE v 1 v 2 v 3 v 4 (x 1,y 1,z 1 ) (x 2,y 2,z 2 ) (x 3,y 3,z 3 ) (x 4,y 4,z 4 ) v 5 (x 5,y 5,z 5 ) f 1 f 2 f 3 (v 1,v 2,v 3 ) (v 2,v 4,v 3 ) (v 2,v 5,v 4 )
Adjacency Lists Store all vertex, edges and face adjacencies Efficient adjacency traversal Extra storage v 3 e 4 e 5 e 3 v 4 f 2 f 3 e 7 v 5 e 1 v 1 f 1 e 2 v2 e 6 v2,v3 e1,e4,e2,e5,e6 f1,f2 v5,v4,v3,v1 e6,e5,e3,e2 f3,f2,f1 v2,v4,v3 e5,e4,e3 f3,f1
Partial Adjacency Lists Can we store only some adjacency relationships and derive others? {E i } {E i } {V i } {F i } {V i } {F i }
Winged Edge ( 翼边 ) Adjacency encoded in edges All adjacencies in O(1) time A bit extra storage popular e22 e21 v2 e F2 F1 v1 e11 e12
Winged Edge ( 翼边 ) v 4 Example v 3 e 4 e 5 f 2 f 3 e 7 e 3 v 5 e 1 v 1 f 1 e 2 v2 e 6 VERTEX TABLE EDGE TABLE v 1 v 2 v 3 v 4 v 5 (x 1,y 1,z 1 ) e1 (x 2,y 2,z 2 ) e6 (x 3,y 3,z 3 ) e3 (x 4,y 4,z 4 ) e5 (x 5,y 5,z 5 ) e6 e 1 e 2 e 3 e 4 e 5 e 6 e 7 (v 1,v 3 ) (v 1,v 2 ) (v 2,v 3 ) (v 3,v 4 ) (v 2,v 4 ) (v 2,v 5 ) f 1 f 1 f 1 f 2 f 2 f 2 f 3 f 3 11 12 21 22 (v 4,v 5 ) f 3 e 2 e 1 e 2 e 1 e 3 e 5 e 4 e 2 e 1 e 5 e 3 e 6 e 2 e 5 e 4 e 3 e 1 e 7 e 4 e 7 e 6 e 3 e 6 e 4 e 5 e 7 e 7 e 6 FACE TABLE f 1 f 2 f 3 e1 e3 e5
Half-edge Instead of a single edge, 2 directed half edges For each half-edge, we store a reference to The vertex it points to Its adjacent face (a zero pointer, if it is a boundary halfedge) The next half-edge of the face or boundary (in counterclockwise direction) Its inverse (the opposite) half-edge For each face, we store a reference to One of its half-edges For each vertex, we store a reference to One of its outgoing half-edges
Half-edge
Half-edge A basic half-edge structure can be realized using the following classes struct Halfedge { HalfedgeRef next_halfedge; HalfedgeRef opposite_halfedge; FaceRef face; VertexRef to_vertex; }; struct Face { HalfedgeRef halfedge; }; struct Vertex { HalfedgeRef outgoing_halfedge; };
Half-edge Example: The following procedure enumerates all vertices that are adjacent to a given center vertex Enumerate_1_ring(VertexRef center) { HalfedgeRef h = center.outgoing_halfedge; HalfedgeRef hstop = h; do { VertexRef v = h.to_vertex; // do something with v h = h. opposite_halfedge.next_halfedge; } while ( h!= hstop ); } confused?
Simple Triangle Mesh Do not store edges at all Store adjacency in vertices and faces For each face: 3 vertices and 3 faces For each vertex: N faces v 3 NULL v 4 f 2 f 3 v 5 f 1 v2 v 1
Comparison Data structure Face Vertex Edge Adjacency Storage List of independent faces Yes - - - High Vertex and face tables Yes Yes - - Shared vertexes Adjacency lists Yes Yes Yes V-E-F High Winged/Half edge - - Yes E Edge-centered Simple triangle mesh Yes Yes - F-V High F stands for face, V stands for vertex, and E stands for edge. - indicates the adjacency is encoded in the data structure.
Summary Mesh acquisition Interactive tool scanner Mesh representation Data structure is determined by algorithms. which adjacency relationships to store depend on which operations must be efficient
Today s Topics Overview Mesh Acquisition Mesh Data Structures Subdivision Surfaces Introduction Linear subdivision an example Different subdivision schemes overview
Subdivision surfaces Coarse mesh + subdivision rule Smooth surface = limit of sequence of refinements Advantages Simple (only need subdivision rule) Local (only look at nearby vertices) Arbitrary topology (since only local)
Subdivision surfaces How do you make a surface with guaranteed continuity?
Subdivision surfaces Repeated application of Topology refinement (splitting faces) Geometry refinement (weighted averaging)
Subdivision surfaces an example Base mesh
Subdivision surfaces an example Topology refinement
Subdivision surfaces an example Geometry refinement
Subdivision surfaces an example Topology refinement
Subdivision surfaces an example Geometry refinement
Subdivision surfaces an example Limit surface
Subdivision surfaces an example Base mesh + limit surface
Today s Topics Overview Mesh Acquisition Mesh Data Structures Subdivision Surfaces Introduction Linear subdivision an example Different subdivision schemes overview
Design of subdivision rules What types of input? Quad meshes, triangle meshes, etc. How to refine topology? Simple implementations How to refine geometry? Smoothness guarantees in limit surface C, C, C... 0 1 2 ( )
An example linear subdivision Types of input Quad mesh four-sided polygon Any number of quads may touch each vertex How to refine topology? Split every quad into four at midpoints How to refine geometry? Average vertex positions This is a simple example to demonstrate how subdivision schemes work
An example linear subdivision
An example linear subdivision Topology refinement
An example linear subdivision Geometry refinement
An example linear subdivision
An example linear subdivision
An example linear subdivision What is its physical meaning?
An example linear subdivision Example Input mesh
An example linear subdivision Example Topology refinement
An example linear subdivision Example Geometry refinement
An example linear subdivision Example Topology refinement
An example linear subdivision Example Geometry refinement
An example linear subdivision Example Topology refinement
An example linear subdivision Example Geometry refinement
An example linear subdivision Example Final result
Today s Topics Overview Mesh Acquisition Mesh Data Structures Subdivision Surfaces Introduction Linear subdivision an example Different subdivision schemes overview
Subdivision schemes comparison Common subdivision schemes Loop [1] Catmull-Clark [2] Differ in: Input topology How to refine topology How to refine geometry [1] C. Loop, Smooth Subdivision Surfaces Based on Triangles, M.S. Mathematics thesis, University of Utah, 1987 [2] E. Catmull and J. Clark, Recursively generated B-spline surfaces on arbitrary topological meshes, Computer-Aided Design 10(6):350-355, 1978
Subdivision schemes comparison Loop Catmull-Clark Loop Catmull-Clark
Thanks everybody!