Presentation is loading. Please wait.

Presentation is loading. Please wait.

Mesh Data Structure. Meshes Boundary edge: adjacent to 1 face Regular edge: adjacent to 2 faces Singular edge: adjacent to >2 faces Mesh: straight-line.

Similar presentations


Presentation on theme: "Mesh Data Structure. Meshes Boundary edge: adjacent to 1 face Regular edge: adjacent to 2 faces Singular edge: adjacent to >2 faces Mesh: straight-line."— Presentation transcript:

1 Mesh Data Structure

2 Meshes Boundary edge: adjacent to 1 face Regular edge: adjacent to 2 faces Singular edge: adjacent to >2 faces Mesh: straight-line graph embedded in R 3 Closed mesh: mesh with no boundary edges Manifold mesh: mesh with no singular edges Corners ⊆ V x F Half-edges ⊆ E x F

3 What should be stored? – Geometry: 3D coordinates – Connectivity Adjacency relationships – Attributes e.g. normal, color, texture coordinate Per vertex, per face, per edge, per corner Data Structures

4 What should it support? – Rendering – Geometry queries What are the vertices of face #2? Is vertex A adjacent to vertex H ? Which faces are adjacent to face #1? – Modifications Remove/add a vertex/face Vertex split, edge collapse

5 Data Structures How good is a data structure? – Time to construct (preprocessing) – Time to answer a query – Time to perform an operation – Space complexity – Redundancy

6 Mesh Data Structures Adjacency-blind schemes – Independent faces – Shared vertex Adjacency-aware schemes – Adjacency lists Face based connectivity Edge based connectivity Half edge – Adjacency matrix – Corner table

7 Independent Faces Pros – Simple – STL file Cons – No connectivity  not for topological queries – Redundancy

8 Shared Vertex Pros – Convenient and efficient (memory wise) – Can represent non-manifold meshes Cons – Too simple - not enough information on relations between vertices & faces

9 Shared Vertex What are the vertices of face f 1 ? – O(1) – first triplet from face list

10 Shared Vertex What are the one-ring neighbors of v 3 ? – Requires a full pass over all faces

11 Shared Vertex Are vertices v 1 and v 5 adjacent? – Requires a full pass over all faces

12 Complete Adjacency Lists Store all vertex, edge, and face adjacencies – Efficient topology traversal – Extra storage

13 Partial Adjacency Lists Can we store only some adjacency relationships and derive others?

14 Face Based Connectivity Manifold triangular meshes Vertex – Position – 1 adjacent face index Face – 3 vertex indices – 3 neighboring face indices Pros – most adjacency queries in O(1) time Cons – No (explicit) edge information

15 Edge Based Connectivity(Winged Edge) Vertex – Position – 1 adjacent edge index Edge – 2 vertex indices – 2 neighboring face indices – 4 edges Face – 1 edge index

16 Edge Based Connectivity(Winged Edge) Example

17 Edge Based Connectivity(Winged Edge) Pros – Most adjacencies in O(1) time – Arbitrary polygons Cons – No edge orientation information

18 Half Edge Vertex record: – Coordinates – Pointer to one half-edge that has v as its origin Face record: – Pointer to one half-edge on its boundary Half-edge record: – Pointer to its origin, origin(e) – Pointer to its twin half-edge, twin(e) – Pointer to the face it bounds, IncidentFace(e) (face lies to left of e when traversed from origin to destination) – Next and previous edge on boundary of IncidentFace(e)

19 Half Edge Operations supported – Walk around boundary of given face – Visit all edges incident to vertex v Queries – Most queries are O(1)

20 Half Edge Example

21 Half Edge Example (cont.)

22 Half Edge Pros – Most adjacency queries in O(1) time – Local operations are O(1) (usually) Cons – Represents only manifold meshes

23 Adjacency Matrix View mesh as connected graph Given n vertices build n*n matrix of adjacency information – Entry (i,j) is TRUE if vertices i and j are adjacent Geometric info – list of vertex coordinates Add faces - list of triplets of vertex indices(v1,v2,v3)

24 Adjacency Matrix Example

25 Adjacency Matrix Symmetric for undirected simple graphs (A n ) ij = # paths of length n from v i to v j Pros – Information on vertices adjacency – Stores non-manifold meshes Cons – Connects faces to their vertices, BUT NO connection between vertex and its face How to find the 1-ring neighboring faces for a vertex?

26 Corner Table Corner c contains – Triangle – c.t – Vertex – c.v – Next corner in c.t (ccw) – c.n – Previous corner – c.p (==c.n.n) – Corner opposite c – c.o E edge opposite c – not incident on c.v c.o couples triangle T adjacent to c.t across E with vertex of T not incident on E – Right corner – c.r – corner opposite c.n (==c.n.o) – Left corner – c.l (== c.p.o == c.n.n.o) Corner: Coupling of vertex with one of its incident triangles

27 Corner Table Store – Corner table – For each vertex – a list of all its corners Corner number j*3-2, j*3-1 and j*3 match face number j ( j = 1, 2, … ) – No need for explicit face storage

28 Corner Table Example

29 Corner Table Pros – Topological queries in O(1) time – Most operations are O(1) – Convenient for rendering (triangle fans) Cons – Only triangular, manifold meshes – Redundancy (but not too high)

30 Quiz For each of the above data structure – What are the vertices of face f i ? – What is the 1-ring neighbors (vertices/edges/faces) of vertex v i ? – Are vertices v i and v j adjacent? 1-ring neighbor loop traversal as shown on the right, if half edge is used.


Download ppt "Mesh Data Structure. Meshes Boundary edge: adjacent to 1 face Regular edge: adjacent to 2 faces Singular edge: adjacent to >2 faces Mesh: straight-line."

Similar presentations


Ads by Google