1/57 CS148: Introduction to Computer Graphics and Imaging Geometric Modeling CS148 Lecture 6.

Slides:



Advertisements
Similar presentations
COMP 175 | COMPUTER GRAPHICS Remco Chang1/6103b – Shapes Lecture 03b: Shapes COMP 175: Computer Graphics February 3, 2015.
Advertisements

CSE554Cell ComplexesSlide 1 CSE 554 Lecture 3: Shape Analysis (Part II) Fall 2014.
Efficient access to TIN Regular square grid TIN Efficient access to TIN Let q := (x, y) be a point. We want to estimate an elevation at a point q: 1. should.
Surface Reconstruction From Unorganized Point Sets
Extended Gaussian Images
Advanced Computer Graphics CSE 190 [Spring 2015], Lecture 10 Ravi Ramamoorthi
Hierarchical Voronoi diagrams for spatial data indexing and paging Christopher Gold Dept. Computing & Mathematics, University of Glamorgan, Pontypridd.
Ruslana Mys Delaunay Triangulation Delaunay Triangulation (DT)  Introduction  Delaunay-Voronoi based method  Algorithms to compute the convex hull 
By Groysman Maxim. Let S be a set of sites in the plane. Each point in the plane is influenced by each point of S. We would like to decompose the plane.
Discrete Geometry Tutorial 2 1
Mesh Representation, part II based on: Data Structures for Graphics, chapter 12 in Fundamentals of Computer Graphics, 3 rd ed. (Shirley & Marschner) Slides.
Atomic Volumes for Mesh Completion Joshua Podolak Szymon Rusinkiewicz Princeton University.
Dual Marching Cubes: An Overview
CSE554ContouringSlide 1 CSE 554 Lecture 4: Contouring Fall 2013.
Spatial Information Systems (SIS)
CS447/ Realistic Rendering -- Solids Modeling -- Introduction to 2D and 3D Computer Graphics.
2. Voronoi Diagram 2.1 Definiton Given a finite set S of points in the plane , each point X of  defines a subset S X of S consisting of the points of.
1cs542g-term Notes. 2 Meshing goals  Robust: doesn’t fail on reasonable geometry  Efficient: as few triangles as possible Easy to refine later.
Mesh Simplification Global and Local Methods:
Asst. Prof. Yusuf Sahillioğlu
Surface Reconstruction from 3D Volume Data. Problem Definition Construct polyhedral surfaces from regularly-sampled 3D digital volumes.
2003 by Jim X. Chen: Introduction to Modeling Jim X. Chen George Mason University.
Lecture 10 : Delaunay Triangulation Computational Geometry Prof. Dr. Th. Ottmann 1 Overview Motivation. Triangulation of Planar Point Sets. Definition.
Implicit Surfaces Tom Ouyang January 29, Outline Properties of Implicit Surfaces Polygonization Ways of generating implicit surfaces Applications.
Content Subdivision First some basics (control point polygon, mesh)
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.
Visualization and graphics research group CIPIC January 21, 2003Multiresolution (ECS 289L) - Winter Surface Simplification Using Quadric Error Metrics.
Modeling and representation 1 – comparative review and polygon mesh models 2.1 Introduction 2.2 Polygonal representation of three-dimensional objects 2.3.
Delaunay Triangulations Presented by Glenn Eguchi Computational Geometry October 11, 2001.
11/30/04© University of Wisconsin, CS559 Fall 2004 Last Time More modeling: –Hierarchical modeling –Instancing and Parametric Instancing –Constructive.
A Navigation Mesh for Dynamic Environments Wouter G. van Toll, Atlas F. Cook IV, Roland Geraerts CASA 2012.
In the name of God Computer Graphics Modeling1. Today Introduction Modeling Polygon.
Mesh Representation, part I
Surface Simplification Using Quadric Error Metrics Michael Garland Paul S. Heckbert.
Dobrina Boltcheva, Mariette Yvinec, Jean-Daniel Boissonnat INRIA – Sophia Antipolis, France 1. Initialization Use the.
A D V A N C E D C O M P U T E R G R A P H I C S CMSC 635 January 15, 2013 Quadric Error Metrics 1/20 Quadric Error Metrics.
Voronoi diagrams and applications Prof. Ramin Zabih
4/15/04© University of Wisconsin, CS559 Spring 2004 Last Time More modeling: –Hierarchical modeling –Instancing and Parametric Instancing –Constructive.
Algorithms for Triangulations of a 3D Point Set Géza Kós Computer and Automation Research Institute Hungarian Academy of Sciences Budapest, Kende u
Mesh Generation 58:110 Computer-Aided Engineering Reference: Lecture Notes on Delaunay Mesh Generation, J. Shewchuk (1999)
2D/3D Shape Manipulation, 3D Printing Shape Representations Slides from Olga Sorkine February 20, 2013 CS 6501.
Geometry Images Xiang Gu Harvard University Steven J. Gortler Harvard university Hugues Hoppe Microsoft Research Some slides taken from Hugues Hoppe.
Subdivision Schemes Basic idea: Start with something coarse, and refine it into smaller pieces for rendering –We have seen how subdivision may be used.
Mesh Coarsening zhenyu shu Mesh Coarsening Large meshes are commonly used in numerous application area Modern range scanning devices are used.
CSE554ContouringSlide 1 CSE 554 Lecture 4: Contouring Fall 2015.
A New Voronoi-based Reconstruction Algorithm
Lee Byung-Gook Dongseo Univ.
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.
CDS 301 Fall, 2008 Domain-Modeling Techniques Chap. 8 November 04, 2008 Jie Zhang Copyright ©
Solid Modeling Dr. Scott Schaefer.
3D Object Representations 2009, Fall. Introduction What is CG?  Imaging : Representing 2D images  Modeling : Representing 3D objects  Rendering : Constructing.
Subdivision Schemes. Center for Graphics and Geometric Computing, Technion What is Subdivision?  Subdivision is a process in which a poly-line/mesh is.
CMPS 3130/6130 Computational Geometry Spring 2017
Constructing Objects in Computer Graphics
Advanced Computer Graphics
Constructing Objects in Computer Graphics By Andries van Dam©
3D Object Representations
Localizing the Delaunay Triangulation and its Parallel Implementation
Domain-Modeling Techniques
Craig Schroeder October 26, 2004
Lecture 3 : Isosurface Extraction
Chapter III Modeling.
Volume Graphics (lecture 4 : Isosurface Extraction)
CSE 554 Lecture 3: Shape Analysis (Part II)
Iso-Surface extraction from red and green samples on a regular lattice
Subdivision Surfaces 고려대학교 컴퓨터 그래픽스 연구실 cgvr.korea.ac.kr.
Last Time B-splines Project 3 was made available
Presentation transcript:

1/57 CS148: Introduction to Computer Graphics and Imaging Geometric Modeling CS148 Lecture 6

2/57 Data Structures for Triangle Mesh CS148 Lecture 6

3/57 CS148 Lecture 6 Data Structure: Separate Triangles Treat each triangle separately with its own vertices typedef float Point[3]; struct Face { Point v[3]; }; mesh = Face[nFaces]; Storage: 72 bytes per vertex No notion of “neighbor triangles”: Individual triangles might not overlap with their vertices or edges f f.v 0 f.v 2 f.v 1 f’.v 0 f’.v 1 f’.v 2 f’

4/57 CS148 Lecture 6 Data Structure: Indexed Triangle Set Store each vertex only once; each face contains indices to its three vertices typedef float Point[3]; struct Face { int vIndex[3]; }; mesh.verts=Point[nVerts]; mesh.faces=Face[nFaces]; Storage: 12 (verts) + 24 (faces) = 36 bytes per vertex (approximate using #f = 2 #v) By removing vertex redundancy we have a notion of neighbor. However, finding a specific neighbor requires a global search. f v0v0 v2v2 v1v1 v3v3 f’

5/57 CS148 Lecture 6 Comparison Separate Triangles (Vertex Buffer only) + Simple – Redundant information Indexed Triangle Set (Vertex Buffer + Index Buffer) + Sharing vertices reduces memory usage + Ensure integrity of the mesh (moving a vertex causes that vertex in all the polygons to be moved) + Both formats are compact and directly accepted by GPUs + Both can represent non-manifold meshes – Neither is good at neighborhood access/modification

6/57 CS148 Lecture 6 Recall: Calculating Normals at Vertices for f in mesh.faces(): (v1, v2, v3) = f.ccwVertices() f.N = cross(v2-v1,v3-v1) if !areaWeighted: f.N.normalize() for v in mesh.verts(): v.N = 0 for f in v.faces(): v.N += f.N v.N.normalize() For Indexed Triangle Set, this takes O(|F|) time!

7/57 Starting from the Indexed Triangle Set, for each triangle we now store pointers to the three adjacent triangles, and for each vertex store a pointer to any one of its incident triangles struct Vertex { Point pt; Face *f; } struct Face { Vertex *v[3]; Face *adjF[3]; } mesh.verts=Point[nVerts]; mesh.faces=Face[nFaces]; How to find all the faces adjacent to a vertex efficiently? CS148 Lecture 6 Triangle Neighbor Representation v0v0 v1v1 v2v2 f0f0 f1f1 f2f2 F v 2.f v 1.f v 0.f

8/57 Finding Next Face using Triangle Neighbor CS148 Lecture 6 Find the next face clockwise around a vertex v from a face f Face *fcwvf(Vert *v, Face *f) { if( v == f->v[0] ) return adjF [1]; if( v == f->v[1] ) return adjF [2]; if( v == f->v[2] ) return adjF [0]; } Storage: 36 (indexed triangles) + 24 (face.adjF) + 4 (vert.f) = 64 bytes per vertex (still less than separate triangles) Efficiently iterate through all triangles adjacent to a vertex v0v0 v1v1 v2v2 f0f0 f1f1 f2f2 f *Edge-based representations are more general and comprehensive, such as the winged-edge, half-edge, and quad-edge data structures.

9/57 Subdivision CS148 Lecture 6

10/57 Recall: Smooth Shading The faceted silhouette cannot be smoothed by shading. CS148 Lecture 6

11/57 Subdivision Curves CS148 Lecture 6

12/57 CS148 Lecture 6 Subdivision Surfaces There exists smooth limit surfaces associated with a given input mesh ■ The exact smooth limit surface depends on the subdivision algorithm used We define a refinement operation, that takes a coarse input mesh and generates a finer output mesh that is closer to the limit surface ■ If we apply this refinement process infinitely, we will exactly achieve the target limit surface ■ However, after just a few levels of refinement, any additional changes will be visually indistinguishable

13/57 Refine a triangular mesh CS148 Lecture 6 Loop Subdivision Surface

14/57 Properties: Modifies existing vertices Applied to all triangulated surfaces Maintains higher order of continuity Loop Subdivision CS148 Lecture 6

15/57 CS148 Lecture 6 Subdivide Each Triangle into 4 Triangles

16/57 CS148 Lecture 6 Subdivide Each Triangle into 4 Triangles

17/57 CS148 Lecture 6 Second step: Modify the vertices Original/Even (Gray) Additional/Odd (Black) Where should the additional vertices be located? How should the original vertices be moved?

18/57 CS148 Lecture 6 New Vertex Locations Compute positions of added vertices from the adjacent four original vertices using mask: Without overwriting, update the original vertex positions from the six adjacent original vertices using mask: Repeat until converged

19/57 CS148 Lecture 6 Semi-Regular Meshes Most of the mesh has vertices with degree 6 (Regular point). If the mesh is topologically equivalent to a sphere, then not all the vertices can have degree 6 Must have a few extraordinary points (degree != 6) Extraordinary point

20/57 Weights at an Extraordinary Point CS148 Lecture 6 Challenge: find weights that generate a smooth surface (tangent plane continuous) Want the surface normal to be continuous This is a hard math problem! Warren weights

21/57 Example mesh Example CS148 Lecture 6

22/57 Example Add vertices CS148 Lecture 6

23/57 Odd vertex refinement Example CS148 Lecture 6

24/57 Example Odd vertex refinement CS148 Lecture 6

25/57 Example Even vertex refinement CS148 Lecture 6

26/57 Example Even vertex refinement CS148 Lecture 6

27/57 Example Extraordinary vertex CS148 Lecture 6

28/57 Example Extraordinary vertex CS148 Lecture 6

29/57 Example Subdivided Surface CS148 Lecture 6

30/57 Example Level 2 CS148 Lecture 6

31/57 Example Level 3 CS148 Lecture 6

32/57 Example Level 4 CS148 Lecture 6

33/57 Example Limit Surface at ordinary points, at extraordinary points CS148 Lecture 6

34/57 Mesh Generation CS148 Lecture 6

35/57 Marching Cubes Polygonization ■ Convert implicit surface to polygonal mesh ■ Render the polygons as before Two steps ■ Partition space into cells ■ Fit a polygon to the surface in each cell Gives a piecewise linear approximation of the surface in each cell CS148 Lecture 6

36/57 Cell polygonization Need to find the cells that actually intersect the surface A simple method is: exhaustive enumeration ■ Divide all of space into a regular grid ■ Traverse all cells, and polygonize the cells that contain the surface CS148 Lecture 6

37/57 Surface vertices Determine where the surface intersects the cell edges ■ 1st option: Linearly interpolate function value from cell vertices to approximate (function might not be linear) ■ 2nd option: Numerically find the zero Either will work, but option 2 can be significantly more expensive CS148 Lecture 6

38/57 Surface vertices Linearly interpolate function value from cell vertices to approximate the surface CS148 Lecture 6

39/57 Surface polygons Given the vertices of our final polygonal surface, find the polygon faces of the surface Solution: There are only a finite number of options, defined by the configurations of inside/outside of the cell’s vertices CS148 Lecture 6

40/57 Surface polygons Consider 2D first: 16 different possible configurations Using cell vertex inside/outside configuration to index into this table Note some of them are duplicates of others CS148 Lecture 6

41/57 Result: Surface polygons CS148 Lecture 6

42/57 Surface polygons In 3D, there are 256 configurations, which can be reduced to 15 cases. CS148 Lecture 6

43/57 Ambiguity in Marching Cubes Some configurations are ambiguous Solution? ■ Sample more ■ Refine the cell ■ Simple solution: just sample once more in the middle of the cell or CS148 Lecture 6

44/57 Another Solution CS148 Lecture 6 Split a cube into six tetrahedra, and find surface vertices and polygons in each tetrahedron

45/57 Marching tetrahedra CS148 Lecture 6 + Unambiguous + Less cases – More elements (more edges)

46/57 Voronoi Diagram Split the space into regions consisting of the set of points closest to a particular seed point Every edge is a part of the perpendicular bisector of two points CS148 Lecture 6

47/57 Voronoi Diagram Generation A simple way to generate the Voronoi diagram 1.Incrementally add points 2.Calculate all the perpendicular bisectors between the existing points and the newly added point 3.Remove each section of the perpendicular bisector lines that trespasses other Voronoi regions CS148 Lecture 6

48/57 Voronoi Diagram & Delaunay Mesh For every Voronoi edge (red), there exists a Delaunay edge (black) between the two corresponding points They are the dual graph to each other In 2D, the Delaunay mesh is a triangle mesh CS148 Lecture 6

49/57 Delaunay Mesh CS148 Lecture 6 In a 2D Delaunay triangulation, the circumcircle of every triangle contains no other points This property leads to high-quality elements (long, thin elements are avoided as much as possible) This is also a good property for a surface mesh in 3D

50/57 Improving and Existing Mesh CS148 Lecture 6 Edge-Flipping In-Circle Test - for a pair of adjacent triangles, test whether the circumcircle of one triangle contains the fourth point Flip the edge to make it locally-Delaunay

51/57 Incremental Algorithm – Sampling CS148 Lecture 6 Sampling the boundary sampling density inversely proportional to the distance to the medial axis more samples for higher curvature regions Sampling the interior sampling density as continuous as possible, including the boundary and the interior

52/57 Incremental Algorithm CS148 Lecture 6 Consider adding sample points one at a time 1.Find the triangle which the newly added point is inside (a giant bounding triangle can be used to guarantee that you can always find a triangle that contains the point) 2.Split that triangle into three triangles 3.For each of the three new triangles. do In-Circle test for it and its outer edge adjacent triangle; flip the edge if the test fails 4.For every flipped edge, its neighbors should also be tested recursively 5.Delete triangles outside the object

53/57 Generating a surface mesh CS148 Lecture 6 In 2d, we can extract the outer edges to form a polygon In 3d, we can extract the surface faces to form an object’s surface The 3D volume needs sampling points on the interior, and meshing in 3D is generally significantly harder than in 2D. E.g. Delaunay gives poor quality elements in 3D (unlike 2D)!

54/57 3D object surface is technically 2D CS148 Lecture 6 Meshing on the surface directly requires geodesic distances Instead, flatten a 3D mesh to 2D, use 2D Delaunay Hard to flatten exactly -- but could approximately flatten, then the result is approximately Delaunay Need to sew up boundary regions to make a continuous mesh – leads to poor quality elements

55/57 3D object surface is technically 2D CS148 Lecture 6 Cut the object to flatten it, and add new sample points (blue) along the cut Generate the Delaunay with incremental algorithm connecting both original (black) and new (blue) sampling points sew up the boundary edges (reconnect blue points) Retest/remesh to improve the mesh, especially near the boundary edges

56/57 3D Sampling Evenly sampling is not efficient and cannot capture details Usually need more points to represent higher curvature regions Similar to 2D… CS148 Lecture 6

57/57 3D In-Circle Test CS148 Lecture 6 Once we get a 3D mesh, the In-Circle test can be used to improve it, especially near the boundaries where it was sewn together Need 3D version of the In-Circle test Use an ellipse to approximate the mapped circle in 2D plane Given three vertices on a curved surface, consider the infinite set of spheres through the three vertices. The centers of all the spheres lie on a single line. Choose the sphere whose center is on the surface and define In-Circle test as inside that sphere.