Mesh Representation, part II based on: Data Structures for Graphics, chapter 12 in Fundamentals of Computer Graphics, 3 rd ed. (Shirley & Marschner) Slides.

Slides:



Advertisements
Similar presentations
Planar Subdivision Induced by planar embedding of a graph. Connected if the underlying graph is. edge vertex hole in f face f disconnected subdivision.
Advertisements

UNC Chapel Hill Lin/Foskey/Manocha Steps in DP: Step 1 Think what decision is the “last piece in the puzzle” –Where to place the outermost parentheses.
COMP 175 | COMPUTER GRAPHICS Remco Chang1/6103b – Shapes Lecture 03b: Shapes COMP 175: Computer Graphics February 3, 2015.
CMPE 466 COMPUTER GRAPHICS
Planar straight line graph A planar straight line graph (PSLG) is a planar embedding of a planar graph G = (V, E) with: 1.each vertex v  V mapped to a.
Planar Orientations Chapter 4 ( ) in the book Written By: Tomer Heber.
Map Overlay Algorithm. Birch forest Wolves Map 1: Vegetation Map 2: Animals.
Convex drawing chapter 5 Ingeborg Groeneweg. Summery What is convex drawing What is convex drawing Some definitions Some definitions Testing convexity.
2/14/13CMPS 3120 Computational Geometry1 CMPS 3120: Computational Geometry Spring 2013 Planar Subdivisions and Point Location Carola Wenk Based on: Computational.
Convex hulls Gift wrapping, d > 2 Problem definition CONVEX HULL, D > 2 INSTANCE. Set S = { p 1, p 2, … p N } of points in d-space (E d ). QUESTION. Construct.
Brute-Force Triangulation
I. The Problem of Molding Does a given object have a mold from which it can be removed? object not removable mold 1 object removable Assumptions The object.
Overlay of Two Subdivisions
Classes of Polygons Planar polygons Non-planar polygons Simple
Informationsteknologi Wednesday, November 7, 2007Computer Graphics - Class 51 Today’s class Geometric objects and transformations.
CHAPTER 5: CONVEX POLYTOPES Anastasiya Yeremenko 1.
Rüdiger Westermann Lehrstuhl für Computer Graphik und Visualisierung
Steps in DP: Step 1 Think what decision is the “last piece in the puzzle” –Where to place the outermost parentheses in a matrix chain multiplication (A.
3. Delaunay triangulation
The Half-Edge Data Structure Computational Geometry, WS 2007/08 Lecture 3, Part III Prof. Dr. Thomas Ottmann Khaireel A. Mohamed Algorithmen & Datenstrukturen,
The Half-Edge Data Structure
Polygonal Mesh – Data Structure and Smoothing
Polygonal Meshes 3D Object Representation -Tyler Abrams.
Computing the Delaunay Triangulation By Nacha Chavez Math 870 Computational Geometry; Ch.9; de Berg, van Kreveld, Overmars, Schwarzkopf By Nacha Chavez.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2004 Chapter 4: 3D Convex Hulls Monday, 2/23/04.
1 University of Denver Department of Mathematics Department of Computer Science.
The Art Gallery Problem
Brute-Force Triangulation
The Art Gallery Problem
Splines III – Bézier Curves
1 Computer Graphics Assistant Professor Dr. Sana’a Wafa Al-Sayegh 2 nd Semester ITGD3107 University of Palestine.
CS 450: Computer Graphics REVIEW: OVERVIEW OF POLYGONS
Subdivision of Edge In a graph G, subdivision of an edge uv is the operation of replacing uv with a path u,w,v through a new vertex w.
Mesh Representation, part I
Part 6: Graphics Output Primitives (4) 1.  Another useful construct,besides points, straight line segments, and curves for describing components of a.
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.
Planar Subdivision Induced by planar embedding of a graph. Connected if the underlying graph is. edge vertex disconnected subdivision Complexity = #vertices.
CENG 789 – Digital Geometry Processing 02- Polygons and Triangulations Asst. Prof. Yusuf Sahillioğlu Computer Eng. Dept,, Turkey.
Computer Graphics Basic 3D Geometry CO2409 Computer Graphics Week 5-1.
Splines IV – B-spline Curves based on: Michael Gleicher: Curves, chapter 15 in Fundamentals of Computer Graphics, 3 rd ed. (Shirley & Marschner) Slides.
1 Polygonal Techniques 이영건. 2 Introduction This chapter –Discuss a variety of problems that are encountered within polygonal data sets The.
Solid Modeling Ref. Mantyla. Introduction Aim of modeling: The search of a media of communication.
Many of the figures from this book may be reproduced free of charge in scholarly articles, proceedings, and presentations, provided only that the following.
1 / 41 Convex Hulls in 3-space Jason C. Yang. 2 / 41 Problem Statement Given P: set of n points in 3-space Return: –Convex hull of P: CH (P) –Smallest.
Robert Pless, CS 546: Computational Geometry Lecture #3 Last Time: Plane Sweep Algorithms, Segment Intersection, + (Element Uniqueness)
12.1 Exploring Solids.
In the name of God Computer Graphics Bastanfard. Curve Function(2) Other method is approximate it using a poly-line. Just locate a set of points along.
Graphs A graphs is an abstract representation of a set of objects, called vertices or nodes, where some pairs of the objects are connected by links, called.
Greg Humphreys CS445: Intro Graphics University of Virginia, Fall 2003 Subdivision Surfaces Greg Humphreys University of Virginia CS 445, Fall 2003.
UNC Chapel Hill M. C. Lin Delaunay Triangulations Reading: Chapter 9 of the Textbook Driving Applications –Height Interpolation –Constrained Triangulation.
1/57 CS148: Introduction to Computer Graphics and Imaging Geometric Modeling CS148 Lecture 6.
Geometry Vocabulary. Triangle Triangle: a polygon with three sides. 180⁰ Sum of the interior angles of a triangle = 180⁰.
1 Overview (Part 1) Background notions A reference framework for multiresolution meshes Classification of multiresolution meshes An introduction to LOD.
Section 12-1 Exploring Solids. Polyhedron Three dimensional closed figure formed by joining three or more polygons at their side. Plural: polyhedra.
1 Planes, Polygons and Objects ©Anthony Steed
COMPUTER GRAPHICS CS 482 – FALL 2015 SEPTEMBER 10, 2015 TRIANGLE MESHES 3D MESHES MESH OPERATIONS.
A Fast Algorithm for Incremental Distance Calculation Ming C. Lin & John Canny University of California, Berkeley 1991 Presentation by Adit Koolwal.
Solid Modeling Dr. Scott Schaefer.
3D Object Representations. Introduction Line and circle and polygon algorithms- represented simple and smooth object. Some Natural object are neither.
Polygon Triangulation
Creating a cell complex = CW complex Building block: n-cells = { x in R n : || x || ≤ 1 } 2-cell = open disk = { x in R 2 : ||x || < 1 } Examples: 0-cell.

Constructing Objects in Computer Graphics By Andries van Dam©
Boundary Representations and Topology
The Art Gallery Problem
Computational Geometry 2
The Art Gallery Problem
I. The Problem of Molding
Subdivision Surfaces 고려대학교 컴퓨터 그래픽스 연구실 cgvr.korea.ac.kr.
Presentation transcript:

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 1

3D objects facets edges vertices 2

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) 3

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

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 mesh Indexed triangle mesh Triangle neighbor structure Winged-edge structure 5

Winged-edge structure Stores connectivity at edges instead of vertices For one edge, say, e 1 : – Two vertices are important: v 4 and v 6 – Two triangles are important: T 5 and T 6 – Four edges are important: e 2, e 14, e 5, and e 8 T6T6 T5T5 T4T4 T3T3 T2T2 T1T1 T7T7 v7v7 v6v6 v5v5 v4v4 v3v3 v2v2 v1v1 v8v8 e7e7 e6e6 e5e5 e4e4 e3e3 e2e2 e1e1 e8e8 e 12 e 11 e 10 e9e9 e 13 e 14 6

Winged-edge structure Give e 1 a direction, then – v 4 is the tail and v 6 is the head – T 5 is to the left and T 6 is to the right – e 2 is previous on the left side, e 14 is next on the left side, e 5 is previous on the right side, and e 8 is next on the right side T6T6 T5T5 T4T4 T3T3 T2T2 T1T1 T7T7 v7v7 v6v6 v5v5 v4v4 v3v3 v2v2 v1v1 v8v8 e7e7 e6e6 e5e5 e4e4 e3e3 e2e2 e1e1 e8e8 e 12 e 11 e 10 e9e9 e 13 e 14 7

Winged-edge structure Give e 1 a direction, then – v 4 is the tail and v 6 is the head – T 5 is to the left and T 6 is to the right – e 2 is previous on the left side, e 14 is next on the left side, e 5 is previous on the right side, and e 8 is next on the right side T6T6 T5T5 v6v6 v4v4 e5e5 e2e2 e1e1 e8e8 e 14 lnext left head tail right lprev rnext rprev 8

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

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: e 13, e 7, e 6, and e 8 e7e7 e6e6 e4e4 e3e3 e1e1 e8e8 e 12 e 11 e 10 e 13 Note: The triangle neighbor structure does not generalize 10

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

Winged-edge structure Edge { Edge lprev, lnext, rprev, rnext; Vertex head, tail; Face left, right } Vertex { double x, y; Edge e; // any incident } Face { Edge e; // any incident } e7e7 e6e6 e4e4 e3e3 e1e1 e8e8 e 12 e 11 e 10 e 13 12

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 z coord.) An edge needs 8 units of storage A triangle needs 1 unit of storage  3(4) + 3   1 = 29(30) nv units of storage 13

Winged-edge structure However, the arbitrary orientation of edges makes traversal of the boundary of a face awkward e7e7 e6e6 e4e4 e3e3 e1e1 e8e8 e 12 e 11 e 10 e 13 e2e2 e5e5 F5F5 With consistent orientations, we could report the vertices of a face iteratively: while ( e  e start ) { e = e.lnext; report e.tail.coordinates; } But consistent orientations usually do not exist x 14

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

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!) 16

Half-edge structure A consistent orientation around every face now works! Every half-edge is incident only to the face to its left (by convention)  then every face has its half-edges oriented counterclockwise 17

Half-edge structure HEdge { HEdge next, pair; Vertex head; Face 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 } next f head pair 18

Half-edge structure A half-edge h can find its tail as h.pair.head A half-edge h can find the other face incident to the edge it is part of as 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 next f head pair 19

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 z coord.) A half-edge needs 4 units of storage A triangle needs 1 unit of storage  3(4) + 3  2   1 = 29(30) nv units of storage 20

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

Half-edge structure, storage For country maps instead of triangular meshes, a map with nv vertices has  nv edges and << nv faces   4 = 11 nv units of storage 22

Half-chain structure For country maps instead of triangular meshes, a map with nv vertices has  nv edges 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 23

24 Half-chain structure Chains are made by splitting the subdivision at all vertices of degree at least 3 or exactly 1; only these vertices are objects in the half-chain structure All vertices in between two such vertices 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

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

Half-chain structure, storage Assume nv vertices of which nw are of degree 1 or at least 3 (so only nw vertex objects) If nw << nv, then we have  nv edges, < 3nw chains, and < 2nw faces The total storage requirements are just 2nv + 29nw units (much better than the 11nv units 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 26

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

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

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 29

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

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 } 31

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

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 33

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 34

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

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) 36

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

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 38

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 39

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 (described next; for any dimension): classes for vertex, edge, triangle, and tetrahedron 40

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 p 0,..., p k are such that the vectors p 0 p 1, p 0 p 2,..., p 0 p k 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-hyperplanar points in 4-space 41

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 edge triangle tetrahedron some bothall 4 all 3 both 42

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) 43

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

Quadrilateral meshes 45

Quadrilateral meshes 46

Not every subdivision with triangular faces is a triangular mesh 47

Meshes have multi-resolution possibilities 48

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

Questions 1.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 2.Do the same for general subdivisions, clockwise and counter- clockwise 3.Write code to report all vertices in the boundary of a face that may have holes and is given in a half-edge structure 4.How do you access the four 3-simplices adjacent to a given 3-simplex in a simplices structure in 3D? 5.How many units of storage are needed in the different structures for representing tetrahedrilizations? 50