1 / 50

Mesh Representation, part II

Mesh Representation, part II. based on: Data Structures for Graphics , chapter 12 in Fundamentals of Computer Graphics, 3 rd ed. (Shirley & Marschner ) Slides by Marc van Kreveld. 3D objects. facets. edges. vertices. 3D objects.

Download Presentation

Mesh Representation, part II

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. Mesh Representation, part II based on: Data Structures for Graphics, chapter 12 in Fundamentals of Computer Graphics, 3rd ed. (Shirley & Marschner) Slides by Marc van Kreveld

  2. 3D objects facets edges vertices

  3. 3D objects • We typically represent the boundary; the interior is implied to be the bounded subspace • We will assume linear boundaries here, so we have facets, edges, and vertices (and the interior)

  4. Triangle meshes • Many freeform shapes consist of (many) triangles

  5. Triangle meshes • How are triangles, edges, and vertices allowed to connect? • How do we represent (store) triangle meshes? • How efficient are such schemes?Separate triangle meshIndexed triangle meshTriangle neighbor structureWinged-edge structure

  6. Winged-edge structure • Stores connectivity at edges instead of vertices • For one edge, say, e1: • Two vertices are important: v4 and v6 • Two triangles are important: T5 and T6 • Four edges are important: e2, e14, e5, and e8 v6 e7 e8 v1 v7 e14 T1 T6 e3 e12 e1 T5 e10 T2 v5 e5 v2 T7 e9 e2 e4 T3 T4 e6 v8 e11 v4 e13 v3

  7. Winged-edge structure • Give e1 a direction, then • v4 is the tail and v6 is the head • T5 is to the left and T6 is to the right • e2 is previous on the left side, e14 is next on the left side, e5 is previous on the right side, and e8 is next on the right side v6 e7 e8 v1 v7 e14 T1 T6 e1 e3 e12 T5 e10 T2 v5 e5 v2 T7 e9 e2 e4 T3 T4 e6 v8 e11 v4 e13 v3

  8. Winged-edge structure • Give e1 a direction, then • v4 is the tail and v6 is the head • T5 is to the left and T6 is to the right • e2 is previous on the left side, e14 is next on the left side, e5 is previous on the right side, and e8 is next on the right side head v6 rnext e8 e14 lnext T6 right e1 T5 left e5 rprev e2 lprev v4 tail

  9. Winged-edge structure Edge { Edge lprev, lnext, rprev, rnext; Vertex head, tail; Triangle left, right } head rnext Vertex { double x, y, z; Edge e; // any incident } lnext right left rprev lprev Triangle { Edge e; // any incident } tail

  10. Winged-edge structure • Also works for meshes that do not only use triangles • There is still one head and one tail • There is still one left face and one right face • There are still previous and next edges in the left face and in the right face: e13, e7, e6, and e8 e7 e8 e3 e12 e1 Note: The triangle neighbor structure does not generalize e10 e4 e6 e11 e13

  11. Winged-edge structure • It also works for planar subdivisions like country maps

  12. Winged-edge structure Edge { Edge lprev, lnext, rprev, rnext; Vertex head, tail; Face left, right } e7 e8 Vertex { double x, y; Edge e; // any incident } e3 e12 e1 e10 e4 e6 e11 e13 Face { Edge e; // any incident }

  13. Winged-edge structure, storage • A triangular mesh with nv vertices has  3nv edges and  2nv triangles • A vertex needs 3(4) units of storage (with zcoord.) • An edge needs 8 units of storage • A triangle needs 1 unit of storage 3(4) + 38 + 21 = 29(30) nv units of storage

  14. Winged-edge structure • However, the arbitrary orientation of edges makes traversal of the boundary of a face awkward With consistent orientations, we could report the vertices of a face iteratively: while ( e estart ) { e = e.lnext; reporte.tail.coordinates; } e7 e8 e12 e3 e1 e10 F5 e4 e6 x e11 e13 e2 e5 But consistent orientations usually do not exist

  15. Winged-edge structure enew while ( e estart ) { if (forward) { reporte.tail.coordinates; enew = e.lnext; if (enew.head == e.head) forward = false; } else { reporte.head.coordinates; enew = e.rprev; if (enew.tail == e.tail) forward = true; } e = enew; } face e enew face e

  16. Half-edge structure • A.k.a. doubly-connected edge list, DCEL • Allows the purely forward traversal of the boundary of a face • Every edge is represented as two half-edges(split lengthwise!)

  17. Half-edge structure • A consistent orientation around every face now works! • Every half-edge isincident only tothe face to its left(by convention) then every facehas its half-edges oriented counterclockwise

  18. Half-edge structure head HEdge { HEdge next, pair; Vertex head; Face f; } pair next f Vertex { double x, y; HEdge h; // any incident half-edge // pointing to this vertex } Face { HEdge h; // any incident half-edge in its boundary }

  19. Half-edge structure • A half-edge h can find itstail as h.pair.head • A half-edge h can findthe other face incidentto the edge it is part ofas h.pair.f • A half-edge cannot find its prev easily (prev is the opposite of next); it is a design choice to include an extra prev in HEdge or not head pair next f

  20. Half-edge structure, storage • A triangular mesh with nv vertices has  3nv edges and  2nv triangles • A vertex needs 3(4) units of storage (with zcoord.) • A half-edge needs 4 units of storage • A triangle needs 1 unit of storage 3(4) + 324 + 21 = 29(30) nv units of storage

  21. Half-edge structure, storage • A half-edge needs 5 units of storage when prev is also stored 3(4) + 325 + 21 = 35(36) nv units of storage

  22. Half-edge structure, storage • For country maps instead of triangular meshes, a map with nv vertices has  nvedges and << nv faces 3 + 25 + 1 = 14 nv units of storage

  23. Half-chain structure • For country maps instead of triangular meshes, a map with nv vertices has  nvedges and << nv faces • In GIS, the long sequences of degree-2 vertices (chains) defining the shape of a border are stored differently, with the vertices in an array, so next and prev are not needed • We can define half-chains • The whole half-chain has the same left face • Each half-chain has a next half-chain, a prev half-chain, and a pair half-chain

  24. Half-chain structure • Chains are made by splitting the subdivision at all vertices of degree at least 3 or exactly 1 • All vertices in between two suchvertices have degree 2 • A chain always starts and ends at a vertex of degree 1 or at least 3,and has zero or more degree 2 vertices • Half-chains are the two “sides”of a chain, splitting length-wise

  25. Half-chain structure head next pair f prev Sequences of degree-2 vertices inside a chain are stored in an array, referenced by both half-chains that form a pair

  26. Half-chain structure, storage • Assume nv vertices of which nw are of degree 1 or at least 3 • If nw << nv, then we have  nvedges, < 3nw chains, and < 2nw faces • The total storage requirements are just 2nv + 29nw units (more than 11nv for the half-edge structure) • For example, a part of Europe with 20 three-country points and 100,000 vertices (for the shape of borders) requires less than 200,600 units

  27. Half-edge structure, disconnected Subdivisions have loose components like island

  28. Half-edge structure, disconnected Internal holes can also exist

  29. Half-edge structure • Planar subdivisions may have “islands/holes” in faces: faces from which pieces are excluded • In this case the graph of vertices and edges is not a connected graph f

  30. Half-edge structure • Faces with holes are common in 3D CAD/CAM models too

  31. Half-edge structure for subdivisions with holes HEdge { HEdge next, pair; Vertex head; Face f; } Vertex { double x, y, x; HEdge h; // any incident half-edge // pointing to this vertex } Face { HEdge h; // any incident half-edge in its boundary HEdge inner[k]; // for each hole, any incident half-edge; // allows up to k holes in the face }

  32. Half-edge structure for subdivisions with holes f.inner[0] f.inner[1] f f.h

  33. Half-edge structure for subdivisions with holes • Every bounded face has exactly one counterclockwise cycle of half-edges bounding it from the outside, and zero or more clockwise cycles of half-edges bounding that face from the inside (holes) • The structure also works for any planar straight-line graph (PSLG), with possibly: • dangling edges or other dangling structures • loose edges

  34. Planar versus non-planar • None of the structures allow edge-crossings, as faces would not be well-defined, and points can lie in multiple faces at once

  35. 3D meshes • So far, we can represent 2D subdivisions and boundaries of 3D solids, but not 3D subdivisions

  36. 3D tetrahedral meshes • The 3D version of a triangle is a tetrahedron • The 3D version of a triangular mesh is a tetrahedral mesh (and triangulation vs. tetrahedralization)

  37. 3D tetrahedral meshes • A 3D tetrahedral mesh has the following features: • vertices (0-dimensional) • edges (1-dimensional) • triangles (2-dimensional) • tetrahedra (3-dimensional)

  38. 3D tetrahedral meshes • In a proper 3D tetrahedral mesh: • Every vertex is endpoint of some edge • For every edge, both endpoints are vertices of the mesh • Every edge is a side of some triangle • For every triangle, its three sides are edges of the mesh • Every triangle is a facet of some tetrahedron • For every tetrahedron, its four facets are triangles of the mesh • If edges, triangles, and tetrahedra are considered to be open, then no two features of the mesh intersect

  39. 3D tetrahedral meshes • Every polygon can be converted into a triangular mesh without needing extra vertices, but polyhedra exist that cannot be converted into a tetrahedral mesh without extra edges and vertices Schönhardt polyhedron

  40. 3D tetrahedral meshes • Representation of 3D tetrahedral meshes: • Indexed tetrahedron mesh: classes for vertex and tetrahedron; a tetrahedron can access its four vertices • Tetrahedron neighbor structure: classes for vertex and tetrahedron; a tetrahedron can access its four vertices and its (up to) four neighbor tetrahedra • Simplices structure: classes for vertex, edge, triangle, and tetrahedron

  41. Simplices structure • A k-simplex is the convex hull defined by k+1 points that do not lie in any single (k-1)-dim. linear variety • Equivalent: the k+1 points p0, ..., pk are such that the vectors p0p1, p0p2, ..., p0pk are linearly independent • 0-simplex: point / vertex • 1-simplex: line segment / edge • 2-simplex: triangle • 3-simplex: tetrahedron • 4-simplex: convex hull of 5 non-co-hyperplanarpoints in 4-space

  42. Simplices structure • A vertex has access to one incident edge • An edge has access to its vertices and one incident triangle • A triangle has access to its three edges and both incident tetrahedra • A tetrahedron has access to its four triangles vertex both some edge some all 3 triangle both all 4 tetrahedron

  43. Simplices structure • Can also be used for 4D and even higher-D • 4D can be space-time for changing objects • Higher-D can be the space of location and orientation of a rigid 3D object (6D)

  44. Simplices structure • Always: k-simplices have access to (k-1)-simplices and (k+1)-simplices 0-dim both some 1-dim some all 3 some all d (d-1)-dim both all d+1 d-dim

  45. Quadrilateral meshes

  46. Quadrilateral meshes

  47. Not every subdivision with triangular faces is a triangular mesh

  48. Meshes have multi-resolution possibilities

  49. Representation of 3D models: summary • Boundary or solid model representation • Triangle mesh, quadrilateral mesh, general faces • Meshes that store incidence/adjacency of features allow traversal on the mesh  faster (local) operations • Triangle strips may be useful for transmitting meshes • Higher-dimensional mesh representations exist as well

  50. Questions • Write code to report all vertices adjacent to a given vertex v in a half-edge structure for a triangular mesh. Is your solution clockwise or counter-clockwise? Now do it the other way around • Do the same for general subdivisions, clockwise and counter-clockwise • Write code to report all vertices in the boundary of a face that may have holes and is given in a half-edge structure • How do you access the four 3-simplices adjacent to a given 3-simplex in a simplices structure in 3D? • How many units of storage are needed in the different structures for tetrahedrilization?

More Related