Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga...

43
Geometric Modeling Geometric Modeling using Polygonal Meshes using Polygonal Meshes Lecture 1: Introduction Lecture 1: Introduction Hamid Laga Hamid Laga [email protected] http://www.img.cs.titech.ac.jp/~hamid/ Office: South 6- 401B-C Global Edge Institute Tokyo Institute of Technology

Transcript of Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga...

Page 1: Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga hamid@img.cs.titech.ac.jp hamid/ Office: South.

Geometric Modeling Geometric Modeling using Polygonal Meshesusing Polygonal Meshes

Lecture 1: IntroductionLecture 1: IntroductionHamid LagaHamid Laga

[email protected]://www.img.cs.titech.ac.jp/~hamid/

Office: South 6- 401B-CGlobal Edge InstituteTokyo Institute of Technology

Page 2: Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga hamid@img.cs.titech.ac.jp hamid/ Office: South.

Overview– Introduction

– 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

2

Page 3: Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga hamid@img.cs.titech.ac.jp hamid/ Office: South.

Creating CG contents– Design the scene• Create the geometry of the objects

– This defines the shape of the object:• Spherical, cylindrical, More complex shape

• Add appearance to the objects– Color, texture, transparency, material properties, etc

• Define their behavior– How a human-like character will move in the scene.

• Put the objects into the scene– Position, rotation with respect to a world coordinate system

• Add lights to the scene– After all we can’t see without light !!

• Render– Define the rendering mode,

3

Page 4: Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga hamid@img.cs.titech.ac.jp hamid/ Office: South.

Creating CG contents– Design the scene• Create the geometry of the objects

– This defines the shape of the object:• Spherical, cylindrical, More complex shape

• Add appearance to the objects– Color, texture, transparency, material properties, etc

• Define their behavior– How a human-like character will move in the scene.

• Put the objects into the scene– Position, rotation with respect to a world coordinate system

• Add lights to the scene– After all we can’t see without light !!

• Render– Define the rendering mode,

4

Page 5: Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga hamid@img.cs.titech.ac.jp hamid/ Office: South.

Geometry modeling / processing– Computerized modeling of the geometry of 3D shapes

– Representation• Simple geometric primitives (sphere, cylinder, cube, …)

– Creation• 3D scanning, modeling software,

– Manipulation • Editing, animation,

– Analysis (feature extraction, matching, decomposition, …)

5

Page 6: Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga hamid@img.cs.titech.ac.jp hamid/ Office: South.

Discrete geometry processing (DGP)– Processing of discrete

(polygonal mesh) models– Typically points and triangles

• Why discrete?– Simplicity – ease of description

& transfer– Base data for rendering

(software/hardware)– Input to most

simulation/analysis tools– Output of most acquisition

tools (CT, MRI, laser, etc.)

6

Page 7: Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga hamid@img.cs.titech.ac.jp hamid/ Office: South.

Applications

Medical Engineering Topography E-commerce

Simulation Game & movies Art history7

Page 8: Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga hamid@img.cs.titech.ac.jp hamid/ Office: South.

Geometry modeling pipeline

8

Page 9: Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga hamid@img.cs.titech.ac.jp hamid/ Office: South.

Overview– Introduction

– 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

9

Page 10: Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga hamid@img.cs.titech.ac.jp hamid/ Office: South.

Surface representations– Parametric representations

– Spline– Subdivision– Triangular meshes– Polygon soup

– Implicit representations– Regular grids– Adaptive data structures

• Others:– Volume representations– Point-based

• Each representation has its particular strengths and weaknesses.

10

Page 11: Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga hamid@img.cs.titech.ac.jp hamid/ Office: South.

General definitions• Parametric representation

– is a parameterization domain • 2D in case of surfaces (1D for curves)

– S is the surface– Example of a circle

3

2

)(

:

RfS

R

Sf

11

)sin(

)cos(

]2,0[: 2

t

tt

Rf

Page 12: Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga hamid@img.cs.titech.ac.jp hamid/ Office: South.

General definitions• Implicit representation

– The zero set of a scalar valued function F:

– F called Kernel.

• Implicit representationof a circle

0)(

:3

3

xFRxS

RRF

12

1),(

:

22

2

yxyx

RRF

Page 13: Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga hamid@img.cs.titech.ac.jp hamid/ Office: South.

Examples in 2D• Circle

– Parametric representation

– Implicit representation

1),(

:

22

2

yxyx

RRF

)sin(

)cos(

]2,0[: 2

t

tt

Rf

13

Page 14: Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga hamid@img.cs.titech.ac.jp hamid/ Office: South.

Examples in 2D – arbitrary shape

14

Page 15: Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga hamid@img.cs.titech.ac.jp hamid/ Office: South.

Examples in 2D – arbitrary shape

15

Page 16: Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga hamid@img.cs.titech.ac.jp hamid/ Office: South.

Examples in 3D Assignment 1• Sphere

– Parametric representation– Implicit representation

• Cylinder– Parametric representation– Implicit representation

16

Page 17: Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga hamid@img.cs.titech.ac.jp hamid/ Office: South.

Parametric and implicit representations

• Main task– Choosing f (respectively F) for complex objects ?

3

2

)(

:

RfS

R

Sf

0)(

:3

3

xFRxS

RRF

17

Page 18: Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga hamid@img.cs.titech.ac.jp hamid/ Office: South.

Parametric representations• Challenge

– Complex shapes cannot be represented with a single function with sufficient accuracy

18

Page 19: Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga hamid@img.cs.titech.ac.jp hamid/ Office: South.

Parametric representations• Challenge

– Complex shapes cannot be represented with a single function with sufficient accuracy

• Piecewise representation

19

f1f2

f3

Page 20: Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga hamid@img.cs.titech.ac.jp hamid/ Office: South.

Parametric representations• Challenge

– Complex shapes cannot be represented with a single function with sufficient accuracy

• Piecewise representation

20

f1f2

f3

Page 21: Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga hamid@img.cs.titech.ac.jp hamid/ Office: South.

Parametric representation• B-Spline - a 1D case (curves)

– Define a knot vector• ti a value between 0 and 1• ti <= t(i+1)• (m+1) values

– Define control points {P0, …., Pn}• (n + 1) control points• Degree p = m-n-1

21

Page 22: Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga hamid@img.cs.titech.ac.jp hamid/ Office: South.

B-spline (1D case) – continued – Define basis functions as:

• j =1, 2, …, p (recall p is the degree)

– The B-spline is the curve defined:

22

Page 23: Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga hamid@img.cs.titech.ac.jp hamid/ Office: South.

B-spline: the 2D case• B-Spline:

– Standard representation for CAD systems– Used for surface representation and deformation

– Nin(.): B-spline basis functions

– n: the degree of f.– Pij R3 are control points

• We need (m + 1) x (n + 1) points,• they define the control grid.

m

i

n

j

nj

miij vNuNPvu

Rf

0 0

3

)()(),(

]1,0[:

23

Page 24: Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga hamid@img.cs.titech.ac.jp hamid/ Office: South.

Parametric representations• Spline:

– Nin(.): B-spline basis functions

• Nin(u)>=0 and SUMi(Ni

n(u)) = 1

• Each surface point f(u, v) is a convex combination of the control points

– The surface lies within the convex hull of the control grid.• Each control point has local influence only

– spline surfaces closely follow the control grid.– modeling surfaces by adjusting its control points.

– More complicated topological structures• Several patches• CAD models consist of a huge collection of surface patches.

24

m

i

n

j

nj

miij vNuNPvu

Rf

0 0

3

)()(),(

]1,0[:

Page 25: Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga hamid@img.cs.titech.ac.jp hamid/ Office: South.

Parametric representations• Subdivision surfaces

– Generalization of spline surfaces.– They can represent surfaces of arbitrary topology– Generated by repeated refinement of the control

mesh

Subdivision surfaces are generated by an iterative refinement of a coarse control mesh

25

Page 26: Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga hamid@img.cs.titech.ac.jp hamid/ Office: South.

Parametric representations• Subdivision surfaces

– Generalization of spline surfaces.– Generated by repeated refinement of the control

mesh– They can represent surfaces of arbitrary topology

• They are not restricted by topological or geometric constraints.

– Inherent hierarchical structure allows for highly efficient algorithms

– Restrictions:• Surfaces so-called semi-regular subdivision connectivity• Preprocess

26

Page 27: Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga hamid@img.cs.titech.ac.jp hamid/ Office: South.

Parametric representations• Triangular meshes

– A set of vertices V.– A set of triangular faces F

connecting them.– Can be seen as a graph:

• Vertices graph nodes• Faces connections between

nodes (edges)

Polygons (vertices + faces)

27

Page 28: Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga hamid@img.cs.titech.ac.jp hamid/ Office: South.

Parametric representations• Triangular meshes

– A set of vertices V.– A set of triangular faces F

connecting them.– Can be seen as a graph:

• Vertices graph nodes• Faces connections between

nodes (edges)

Polygons (vertices + faces)

V: Vertices (X, Y, Z)

F: Faces (V1, V2, V3)

28

Page 29: Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga hamid@img.cs.titech.ac.jp hamid/ Office: South.

Parametric representations• Triangular meshes

– This is a type of piecewise parametric (linear) surface representation because:

– Each triangle defines, via barycentric parameterization, a linear segment of a piecewise linear surface representation:

– Given a triangle [a, b, c] a point p inside the triangle can be defined by:

29

Page 30: Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga hamid@img.cs.titech.ac.jp hamid/ Office: South.

Others• Fourier & wavelets

– There are works based on Fourier OR wavelet representation of 3D shapes

• Suitable for filtering, smoothing, .. operations

– [NOT covered in this lecture]

30

Page 31: Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga hamid@img.cs.titech.ac.jp hamid/ Office: South.

Implicit representations• Definition

– The surface is the zero-level of a scalar valued function F.

– Different levels definedifferent surfacesF(x) = 0.5F(x) = 0F(x) = -1, …

– These are called level-sets– F(x) = 0 is the zero-level called also iso-surface

0)(

:3

3

xFRxS

RRF

31

Page 32: Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga hamid@img.cs.titech.ac.jp hamid/ Office: South.

Implicit representations• Examples of implicit functions

– Inside-outside function• F(x) = 0 if x is exactly on the surface

F(x) = +1 if x is outside the surfaceF(x) = -1 if x is inside the surface

-1

+10

32

Page 33: Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga hamid@img.cs.titech.ac.jp hamid/ Office: South.

Implicit representations• Examples of implicit functions

– Distance function• Maps each 3D point to its

minimal distance to thesurface

– Signed distance function• Same as distance function• Positive outside the surface• Negative inside

p2

p1

33

Page 34: Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga hamid@img.cs.titech.ac.jp hamid/ Office: South.

Advantages of implicit representations

• Constructive Solid Geometry (CSG) operations– Complex objects constructed with Boolean

operations of simple ones.– Can be computed with min and max combinations

of the objects’ implicit functions.

+ - - =

34

Page 35: Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga hamid@img.cs.titech.ac.jp hamid/ Office: South.

Implicit representations

• Issues– Enumerating points on an implicit surface

• Given a surface S represented by a function F:– Does a point x belong to S ?

• Given a surface S represented by a function F:– List all the 3D points that belong to S

35

Page 36: Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga hamid@img.cs.titech.ac.jp hamid/ Office: South.

Implicit representations• Regular grids

– Discretize the scalar field F with a sufficiently dense grid

• uniform scalar grid of sampled values

– Problem of memory consumption when we want to represent the surface with very high details

36

Page 37: Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga hamid@img.cs.titech.ac.jp hamid/ Office: South.

Implicit representations• Adaptive data structures

37

Page 38: Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga hamid@img.cs.titech.ac.jp hamid/ Office: South.

Others• Volume representations

– Implicit representations are also called volumetric methods

38

Page 39: Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga hamid@img.cs.titech.ac.jp hamid/ Office: South.

Others• Point-based

– Another type of a parameterized representation

39

Page 40: Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga hamid@img.cs.titech.ac.jp hamid/ Office: South.

Summary - Choosing a representation• Splines and Subdivision surfaces

– Suitable for CAD systems– Splines:

• Topological constraints• Large number of patches to represent complex shapes

– Subdivision surfaces• Can represent surfaces of arbitrary topology

• Triangular meshes– The most flexible representation since they can represent any type of

surface• Implicit / volumetric representations

– Suitable for CSG operations– Used in medical applications (CT scans), fluid simulation, …

• There are many efficient algorithms for converting from one transformation to another

40

Page 41: Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga hamid@img.cs.titech.ac.jp hamid/ Office: South.

Summary - Choosing a representation• Splines and Subdivision surfaces

– Suitable for CAD systems– Splines:

• Topological constraints• Large number of patches to represent complex shapes

– Subdivision surfaces• Can represent surfaces of arbitrary topology

• Triangular / polygon meshes– The most flexible representation since they can represent any type of

surface• Implicit / volumetric representations

– Suitable for CSG operations– Used in medical applications (CT scans), fluid simulation, …

• There are many efficient algorithms for converting from one transformation to another

41

Page 42: Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga hamid@img.cs.titech.ac.jp hamid/ Office: South.

Online resources– This course website:

• http://www.img.cs.titech.ac.jp/~hamid/courses/cg2009/cg_2009.php

• Other resources:– Courses on Geometry Processing using polygonal meshes

• Siggraph 2007 and Eurographics 2006 :• http://www.agg.ethz.ch/publications/course_notes

– Alla Sheffer’s course on Digital Geometry Processing• http://www.cs.ubc.ca/~sheffa/dgp/

42

Page 43: Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga hamid@img.cs.titech.ac.jp hamid/ Office: South.

B-splines– Source Wikipedia

43