1 / 52

Geometric Modeling using Polygonal Meshes Lecture 2: Mesh data structures

Geometric Modeling using Polygonal Meshes Lecture 2: Mesh data structures. Hamid Laga hamid@img.cs.titech.ac.jp http://www.img.cs.titech.ac.jp/~hamid/. Office: South 6- 401B-C Global Edge Institute Tokyo Institute of Technology. Overview. Introduction and applications

janina
Download Presentation

Geometric Modeling using Polygonal Meshes Lecture 2: Mesh data structures

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Geometric Modeling using Polygonal MeshesLecture 2: Mesh data structures Hamid Laga hamid@img.cs.titech.ac.jp http://www.img.cs.titech.ac.jp/~hamid/ Office: South 6- 401B-C Global Edge Institute Tokyo Institute of Technology

  2. Overview • Introduction and applications • Geometry processing pipeline • Surface representations • Parametric surface representations (Spline surfaces, subdivision surfaces, triangle meshes) • Implicit surface representations (Regular grids, adaptive data structures) • Summary (conversion methods) • Mesh data structures • Considerations when choosing a mesh data structure • List of faces, Adjacency matrix, Half Edge data structure. • Mesh libraries • Summary

  3. Overview • Introduction and applications • Geometry processing pipeline • Surface representations • Parametric surface representations (Spline surfaces, subdivision surfaces, triangle meshes) • Implicit surface representations (Regular grids, adaptive data structures) • Summary (conversion methods) • Mesh data structures • Considerations when choosing a mesh data structure • List of faces, Adjacency matrix, Half Edge data structure, Directed Edges. • Mesh libraries • Summary

  4. Why triangular meshes • The most popular representation in graphics • Can represent any arbitrary shape • It’s the input of the graphics pipeline V: Vertices (X, Y, Z) F: Faces (V1, V2, V3) Polygons (vertices + faces)

  5. Meshes • Formal definition • Straight-line graph embedded in R3 Boundary Singular edge Node Regular edges

  6. Meshes • Formal definition • Straight-line graph embedded in R3

  7. What can we do with a mesh ? • Use of mesh data for: • Rendering • Geometric queries • What are the vertices of face #3 ? • Are vertices i and j adjacent ? • Which faces are adjacent to face #7 ? • Geometric operations • Remove / add a vertex / face.

  8. Considerations • Topological requirements • Which kind of meshes need to be represented ? • Do we need boundaries or do we assume a closed mesh ? • Complex edges and singular vertices OR just manifold mesh ? • Triangle meshes OR arbitrary polygon meshes ? • Are the meshes regular, semi-regular, or irregular?

  9. Considerations • Algorithmic requirements • Which kind of algorithms will be operating on the mesh data structure ? • Do we want: • Simply rendering ? • Modify only the geometry of the mesh OR modify also the connectivity / topology ? • Associate additional data to the vertices, faces, edges ? • Have constant-time access to the local neighborhoods of vertices, edges, faces ? • Can we assume the mesh to be globally orientable ?

  10. How good is a mesh data structure ? • Time to reconstruct / preprocess • Time to answer a query • Time to perform an operation (update the data structure) • Space complexity • Redundancy

  11. The simplest data structure • List of faces: • A set of vertices and faces: • List of vertices (coordinates) • List of faces V: Vertices (X, Y, Z) F: Faces (V1, V2, V3) Polygons (vertices + faces)

  12. List of faces • Queries: • What are the vertices of face #3 ? • Answered in O(1) • Are vertices i and j adjacent ? • A pass over all faces is necessary  NOT GOOD

  13. List of faces example

  14. List of faces – pros and cons • Pros: • Convenient and efficient • Memory wise • Cons • Too simple • Not enough information on relations between vertices and faces

  15. Mesh data structures • Adjacency matrix • View a mesh as a connected graph • Given n vertices build n*n matrix of adjacency information • Entry (i,j) is TRUE value if vertices i and j are adjacent • Geometric information: • List of vertex coordinates • Add faces • list of triplets of vertex indices (v1,v2,v3)

  16. Adjacency matrix example

  17. Adjacency matrix – queries • What are the vertices of face #3? • O(1) • checking third triplet of faces • Are vertices i and j adjacent? • O(1) • checking adjacency matrix at location (i,j). • Which faces are adjacent to vertex j? • O(n) • Full pass on all faces is necessary

  18. Adjacency matrix– pros and cons • Pros: • Information on vertices adjacency • Stores non-manifold meshes • Cons • Connects faces to their vertices, BUT NO connection between vertex and its face

  19. Mesh data structures • DCEL: Doubly Connected Edge List • Record for each face, edge and vertex: • Geometric information • Topological information • Attribute information • Aka Half-Edge Structure

  20. Half-Edge structure (Opposite)

  21. Half-Edge structure - example Face table Vertex table

  22. Half-Edge structure - example Face table Vertex table Halfe-Edge table

  23. Half-Edge structure • Operations supported • Walk around the boundary of a given face • Visit all edges incident to a vertex v • Queries • Most queries are O(1) • Example • Enumerate all vertices that are adjacent to a given vertex •  this is called the one-ring of a vertex

  24. Half-Edge structure -Example • Example • Enumerate all vertices that are adjacent to a given vertex v • HalfEdge h = outgoing_halfedge(v) • HalfEdge hstop = h; • Do • Vertex w = h->opposite()->origine • // DO SIMETHING WITH VERTEX w • h = h->opposite()->next_halfEgde(); • While (h != hstop)

  25. Half-Edge structure • Operations supported • Walk around the boundary of a given face • Visit all edges incident to a vertex v • Queries • Most queries are O(1) • Pros • All queries in O(1) • All operations in O(1) • Cons • Represent only manifold meshes

  26. Other mesh data structures • Directed Edges • Corner tables

  27. Example: mesh smoothing Noisy 3D model

  28. Example: mesh smoothing Noisy 3D model After smoothing

  29. Example: mesh smoothing

  30. Example: mesh smoothing • Mesh smoothing • Moving mesh vertices on surface to reduce the curvature variation and remove the noise. • Similar to high frequency elimination in signal processing

  31. Basic mesh smoothing algorithm • Laplacian smoothing • Equivalent to box filter in signal processing • N(vi) is the neighboring vertices of vertex vi • Apply it to all vertices of the mesh • Typically, repeat the operation many times. vi One-ring Neighborhood of vi

  32. Laplacian smoothing algorithm • Algorithm

  33. Complexity of the Laplacian smoothing • List of faces: O(1)

  34. Complexity of the Laplacian smoothing • List of faces: O(1) O(numberOfFaces)

  35. Mesh data structures revisited • We want to perform all mesh queries in O(1) • DCEL: Doubly Connected Edge List • Record for each face, edge and vertex: • Geometric information • Coordinates of each vertex • Topological information • Connectivity • Attribute information • Color, texture, etc • Aka Half-Edge Structure

  36. Half-Edge structure • The mesh is defined as a directed graph • Connections between vertices defined by directed edges called Half-Edges: • V2V3: e3,1 V3V2: e3,2 • Each face has 3 oriented edges (counter-clockwise) • Face f1 has e3,1 e1,1 and e2,1

  37. Half-Edge structure • Half-edge record • Pointer to its origin (Vertex) • origin(e) • Pointer to its opposite half-edge • opposite(e) • Pointer to the face it bounds, • IncidentFace(e) • (face lies to the left of e when traversed from origin to destination) • Next edge on the boundary of IncidentFace(e) • Next (e) • We can add also prev(e) = next(next(e)) • Vertex record • Coordinates • Incident half-edge: • Pointer to one half-edge that has this vertex as its origin • Face record • Pointer to one half-edge on its boundary. (Opposite)

  38. Half-Edge structure (Opposite)

  39. Half-Edge structure (Opposite)

  40. Half-Edge structure - example Vertex table (lisOfVertices) Face table (listOfFaces)

  41. Half-Edge structure - example Face table Vertex table Halfe-Edge table (listOfHalfEdges)

  42. Half-Edge structure -Example • Laplacian smoothing vj vi One-ring Neighborhood of vi

  43. Half-Edge structure -Example O(1) One-ring Neighborhood of vi

  44. Half-Edge structure • Operations supported • Walk around the boundary of a given face • Visit all edges incident to a vertex v • Queries • Most queries are O(1) • Example • Enumerate all vertices that are adjacent to a given vertex •  this is called the one-ring of a vertex

  45. Half-Edge structure • Operations supported • Walk around the boundary of a given face • Visit all edges incident to a vertex v • Queries • Most queries are O(1) • Pros • All queries in O(1) • All operations in O(1) • Cons • Represent only manifold meshes • Cannot be used for polygon soup models !! • The creation of the data structure is time consuming (of order O(N2)) • But this is done only once

  46. Mesh libraries • CGAL: • Computational Geometry Algorithms Library • Generic C++ Library for geometric computing • Linux, Windows • www.cgal.org • OpenMesh • Efficient Half-Edge structures for polygonal meshes • www.openmesh.org • MeshMaker • Code: http://www.cs.ubc.ca/~sheffa/dgp/software/MeshMaker5.2.zip • Graphite: • More powerful than MeshMaker, • more efficient but Linux only • http://alice.loria.fr/software/graphite/

  47. Assignment 1 • Parametric and implicit representation • Sphere • Cylinder

  48. Assignment 2 (due on 2009/6/25) • Complexity of mesh data structures • What is the complexity (big O) of the following queries: • Collapse two adjacent vertices i and j (called edge collapse) • Split a vertex i into two vertices (vertex split) • in both cases I shouldn’t leave holes on the surface • when using • The list of faces • The Half-Edge data structure • Algorithm • Write the two algorithms (edge collapse, vertex split) when using Half-edge data structure

  49. Assignment 2 • Edge collapse (ecol) and Vertex split (vsplit)

  50. How to submit a report • Rule 1: • Don’t submit hand written report • It’s very hard for me to read it !! • Rule 2: • There are many solutions (algorithms) for solving the same problem •  the solution you propose maybe different from the one I know. •  if you don’t explain your solution it will be very hard for me to understand your algorithm •  Explain your solution before giving the algorithm •  Add comments inside your algorithm. • Submit a printed copy to me on June 25th before the class.

More Related