Spring 2014 CSCI 599: Digital Geometry Processing

3.1 Classic

Hao Li http://cs599.hao-li.com 1 Spring 2014 CSCI 599: Digital Geometry Processing

3.1 Classic Differential Geometry

With a Twist!

Hao Li http://cs599.hao-li.com 2 Administrative

• Exercise handouts: 11:59 PM every 2nd Wednesday

• My first office hours later from 2pm to 4pm

• This week only lecture.

3 Some Updates: run.usc.edu/vega

Another awesome free library with half-edge data-structure By Prof. Jernej Barbic

4 FYI

MeshLab Popular Mesh Processing Software (meshlab.sourceforge.net)

5 FYI

BeNTO3D Mesh Processing Framework for Mac (www.bento3d.com)

6 Last Time

Discrete Representations • Explicit (parametric, polygonal meshes) Geometry

• Implicit Surfaces (SDF, grid representation) Topology • Conversions • E→I: Closest Point, SDF, Fast Marching • I→E: Marching Cubes Algorithm

7 Differential Geometry

Why do we care?

• Geometry of surfaces

• Mothertongue of physical theories

• Computation: processing / simulation

8 Motivation

We need differential geometry to compute • • paramaterization distortion • deformation energies

9 Applications: 3D Reconstruction

10 Applications: Head Modeling

11 Applications: Facial Animation

12 Motivation

Geometry is the key • studied for centuries (Cartan, Poincaré, Lie, Hodge, de Rham, Gauss, Noether…) • mostly differential geometry • differential and integral calculus • invariants and symmetries

13 Getting Started

How to apply DiffGeo ideas? • surfaces as a collecition of samples • and topology (connectivity) • apply continuous ideas • BUT: setting is discrete • what is the right way? • discrete vs. discretized

Let’s look at that first

14 Getting Started

What characterizes structure(s)? • What is shape? • Euclidean Invariance

• What is physics? • Conservation/Balance Laws

• What can we measure? • area, curvature, mass, flux, circulation

15 Getting Started

Invariant descriptors • quantities invariant under a set of transformations

Intrinsic descriptor • quantities which do notd depend on a coordinate frame

16 Outline

• Parametric

• Parametric Surfaces

Formalism & Intuition

17 Differential Geometry

Leonard Euler (1707-1783) Carl Friedrich Gauss (1777-1855)

18 Parametric Curves

x :[a, b] IR IR 3 ⇥ x(b) x(t) a t b xt(t)

x(a)

x(t) dx(t) /dt dx(t) x(t)= y(t) x (t) := = dy(t) /dt t dt z(t) ⇥ dz(t) /dt ⇥ ⇤ ⌅ ⇤ ⌅

19 Recall: Mappings

Injective Surjective Bijective NO SELF-INTERSECTIONS SELF-INTERSECTIONS AMBIGUOUS PARAMETERIZATION

20 Parametric Curves

A parametric x ( t ) is • simple: x ( t ) is injective (no self-intersections) • differentiable: x ( t ) is defined for all t [a, b] t 2 • regular: x ( t ) =0 for all t [a, b] t 6 2

x(b) x(t)

xt(t)

x(a)

21 Length of a Curve

Let t i = a + i t and xi = x(ti)

xi

x(a) x(b)

a t ti b

22 Length of a Curve

Polyline chord length

x S = x = i t, x := x x ⇥ i⇥ t i ⇥ i+1 i⇥ i i norm change ⇥ ⇥

Curve ( t 0 ) x ! i t s = s(t)= xt dt a x(a) x(b) length = integration of infinitesimal change a t ti b × norm of speed

23 Re-Parameterization

Mapping of parameter domain

u :[a, b] [c, d] Re-parameterization w.r.t. u(t)

[c, d] IR 3 ,t x(u(t)) ⇥ Derivative (chain rule)

dx(u(t)) dx du = = x (u(t)) u (t) dt du dt u t

24 Re-Parameterization

Example

1 f : 0, IR 2 ,t (4t, 2t) 2 ⇥ ⇥ 1 : 0, [0, 1] ,t 2t 2 ⇥ ⇥ g : [0, 1] IR 2 ,t (2t, t) ⇥

g((t)) = f(t)

25 Arc Length Parameterization

Mapping of parameter domain:

t t s(t)= x dt ⇥ ⇤ t⇤ a Parameter s for x ( s ) equals length from x ( a ) to x(s)

x(s)=x(s(t)) ds = x dt t same infinitesimal change Special properties of resulting curve

x (s) =1, x (s) x (s)=0 ⇥ s ⇥ s · ss defines orthonormal frame 26 The Frenet Frame

Taylor expansion

1 1 x(t + h)=x(t)+x (t) h + x (t) h2 + x (t) h3 + ... t 2 tt 6 ttt

for convergence analysis and approximations

Define local frame ( t , n , b ) (Frenet frame)

xt xt xtt t = n = b t b = xt xt xtt ⇥ ⇥ tangent main normal binormal

27 The Frenet Frame

Orthonormalization of local frame

x ttt b xtt n

xt t

local affine frame Frenet frame

28 The Frenet Frame

Frenet-Serret: Derivatives w.r.t. arc length s

ts =+n ns = t +⇥b b = ⇥n s

Curvature (deviation from straight line) b

= x n ss t Torsion (deviation from planarity) 1 ⇥ = det([x , x , x ]) 2 s ss sss

29 Curvature and Torsion

Planes defined by x and two vectors: • osculating plane: vectors t and n • : vectors n and b • rectifying plane: vectors t and b b n Osculating • second order contact with curve t • center c = x +(1/)n • radius 1/

30 Curvature and Torsion

• Curvature: Deviation from straight line

• Torsion: Deviation from planarity

• Independent of parameterization • intrinsic properties of the curve

• Euclidean invariants • invariant under rigid motion

• Define curve uniquely up to a rigid motion

31 Curvature: Some Intuition

A line through two points on the curve (Secant)

32 Curvature: Some Intuition

A line through two points on the curve (Secant)

33 Curvature: Some Intuition

Tangent, the first approximation limiting secant as the two points come together

34 Curvature: Some Intuition

Circle of curvature Consider the circle passing through 3 pints of the curve

35 Curvature: Some Intuition

Circle of curvature The limiting circle as three points come together

36 Curvature: Some Intuition

Radius of curvature r

37 Curvature: Some Intuition

Radius of curvature r

38 Curvature: Some Intuition

Signed curvature Sense of traversal along curve

39 Curvature: Some Intuition

Gauß map Point on curve maps to point on unit circle

40 Curvature: Some Intuition

Shape operator (Weingarten map) Change in normal as we slide along curve

negative directional derivative D of Gauß map

describes directional curvature

using normals as degrees of freedom → accuracy/convergence/implementation (discretization)

41 Curvature: Some Intuition

Turning number, k Number of orbits in Gaussian image

42 Curvature: Some Intuition

Turning number theorem

For a closed curve, the integral of curvature is an integer multiple of 2π

43 Take Home Message

In the limit of a refinement sequence, discrete measure of length and curvature agree with continuous measures

44 Outline

• Parametric Curves

• Parametric Surfaces

45 Surfaces

What characterizes shape? • shape does not depend on Euclidean motions • metric and • smooth continuous notions to discrete notions

46 Metric on Surfaces

Measure Stuff • angle, length, area • requires an inner product • we have: • Euclidean inner product in domain • we want to turn this into: • inner product on surface

47 Parametric Surfaces

Continuous surface

x(u, v) x(u, v)= y(u, v) z(u, v) ⇥ n ⇤ ⌅ Normal vector xu xv p x x n = u v x x ⇥ u v⇥

Assume regular parameterization

x x = 0 normal exists u v ⇥ 48 Angles on Surface

Curve [ u ( t ) ,v ( t )] in uv-plane defines curve on the surface x(u, v)

c(t)=x(u(t) ,v(t))

Two curves c 1 and c 2 intersecting atp • angle of intersection? n • two tangents t and t 1 2 xu xv p ! ti = ixu + ⇥ixv c2 • compute inner product c1 tT t = cos t t 1 2 1 2 49 Angles on Surface

Curve [ u ( t ) ,v ( t )] in uv-plane defines curve on the surface x(u, v)

c(t)=x(u(t) ,v(t))

Two curves c 1 and c 2 intersecting at p

T T t1 t2 =(1xu + ⇥1xv) (2xu + ⇥2xv)

T T T = 12xu xu +(1⇥2 + 2⇥1) xu xv + ⇥1⇥2xv xv

T T xu xu xu xv 2 =(1, ⇥1) T T xu xv xv xv ⇥2 ⇥ ⇥ 50

First fundamental form

EF xT x xT x I = := u u u v FG xT x xT x ⇥ u v v v⇥

Defines inner product on tangent space

T 1 , 2 := 1 I 2 ⇥ ⇥ ⇥ ⇥ ⇤ 1⇥ 2⇥⌅ 1⇥ 2⇥

51 First Fundamental Form

First fundamental form I allows to measure (w.r.t. surface metric)

Angles t>t = (↵ , ), (↵ , ) 1 2 h 1 1 2 2 i

Length ds2 = (du, dv), (du, dv) squared ⇥ infinitesimal = Edu2 +2F dudv + Gdv2 length

Area dA = x x du dv ⌅ u ⇤ v⌅ T T T 2 = x xu x xv (x xv) du dv infinitesimal u · v u Area ⇥ = EG F 2du dv cross product → determinant with unit vectors → area 52 Sphere Example

Spherical parameterization cos u sin v x(u, v)= sin u sin v , (u, v) [0, 2) [0, ) cos v ⇥ ⇥ Tangent vectors⇤ ⌅ sin u sin v cos u cos v x (u, v)= cos u sin v x (u, v)= sin u cos v u v ⇥ 0 ⇥ sin v ⇤ ⌅ ⇤ ⌅ First fundamental Form

sin2 v 0 I = 01 ⇥ 53 Sphere Example

Length of equator x(t, ⇡/2)

2 2 2 2 1ds = E (ut) +2Futvt + G (vt) dt 0 0 ⇥ 2 = sin v dt 0

=2 sin v =2

54 Sphere Example

Area of a sphere

2 2 1dA = EG F 2 du dv 0 0 0 0 ⇥ 2 = sin v du dv 0 0 =4

55 Normal Curvature

Tangent vector t …

n

xu xv p t

xu xv t = cos φ + sin φ ∥xu∥ ∥xv∥

unit vector

56 Normal Curvature

… defines intersection plane, yielding curve c(t) normal curve

n

t c(t) p

xu xv t = cos φ + sin φ ∥xu∥ ∥xv∥

57 Geometry of the Normal

Gauss map

• normal at point

!

!

!

• consider curve in surface again

• study its curvature at p

• normal “tilts” along curve

58 Normal Curvature

Normal curvature  n ( t ) is defined as curvature of the normal curve c ( t ) at point p(t)=x(u, v)

With ef xT nxT n II = := uu uv fg xT nxT n ⇥ ⇤ uv vv ⌅ normal curvature can be computed as T 2 2 ¯t II¯t ea +2fab + gb t = axu + bxv (¯t)= = n ¯tT I ¯t Ea2 +2F ab + Gb2 ¯t =(a, b)

59 Surface Curvature(s)

Principal curvatures

• Maximum curvature κ1 = max κn(φ) φ • Minimum curvature κ2 = min κn(φ) φ 2 2 • Euler theorem n(⇥)=1 cos ⇥ + 2 sin ⇥

• Corresponding principal directions e 1 , e 2 are orthogonal

60 Surface Curvature(s)

Principal curvatures

• Maximum curvature κ1 = max κn(φ) φ • Minimum curvature κ2 = min κn(φ) φ 2 2 • Euler theorem n(⇥)=1 cos ⇥ + 2 sin ⇥

• Corresponding principal directions e 1 , e 2 are orthogonal

Special curvatures 1 + 2 • H = extrinsic 2 • K = κ1 · κ2 intrinsic (only first FF)

61 Invariants

Gaussian and mean curvature • determinant and trace only

!

!

! • eigenvalues and orthovectors

62 Mean Curvature

Integral representations

63 Curvature of Surfaces

+ Mean curvature H = 1 2 2 • H =0 everywhere minimal surface !

soap film 64 Curvature of Surfaces

+ Mean curvature H = 1 2 2 • H =0 everywhere minimal surface !

Green Void, Sydney Architects: Lava 65 Curvature of Surfaces

Gaussian curvature K = κ1 · κ2

• K =0 everywhere developable surface ! surface that can be flattened to a plane without distortion (stretching or compression)

Disney, Concert Hall, L.A. Timber Fabric Architects: Gehry Partners IBOIS, EPFL

66 Shape Operator

Derivative of Gauss map • second fundamental form

!

!

! • local coordinates

67 Intrinsic Geometry

Properties of the surface that only depend on the

first fundamental form

• length

• angles

• Gaussian curvature (Theorema Egregium) remarkable theorem (Gauss)

6πr − 3C(r) K = lim r→0 πr3

Gaussian curvature of a surface is invariant under local isometry

68 Classification

Point x on the surface is called

• elliptic, if K>0

• hyperbolic, if K<0 Gaussian curvature K • parabolic, if K =0

• umbilic, if κ1 = κ2 or isotropic

69 Classification

Point x on the surface is called

70 Gauss-Bonnet Theorem

For any closed manifold surface with Euler characteristic =2 2g

K =2⇥ Z

K()=K()=K()=4 Z Z Z

71 Gauss-Bonnet Theorem

Sphere

1 = 2 =1/r

2 K = 12 =1/r

1 K =4r2 =4 · r2 Z

when sphere is deformed, new positive and negative curvature cancel out

72 Differential Operators

Gradient @f @f ! f := ,..., r @x @x ✓ 1 n ◆ !

• points in the direction of the steepest ascend

73 Differential Operators

Divergence

! @F @F divF = F := 1 + ...+ n ! r· @x1 @xn

• volume density of outward flux of vector field

• magnitude of source or sink at given point

• Example: incompressible fluid • velocity field is divergence-free

74 Differential Operators

Divergence

@F @F divF = F := 1 + ...+ n r· @x1 @xn

high divergence low divergence 75 Laplace Operator

gradient 2nd partial Laplace operator derivatives operator

∂2f ∆ = div∇ = f f ! 2 i ∂xi Cartesian coordinates function in divergence Euclidean space operator

76 Laplace-Beltrami Operator

Extension of Laplace fo functions on manifolds

Laplace- gradient Beltrami operator

…of the surface ∆S f = divS ∇S f

function on divergence manifold S operator Laplace on the surface

77 Laplace-Beltrami Operator

Laplace- gradient Beltrami operator mean curvature

∆S x = divS ∇S x = −2Hn

surface function on divergence normal manifold S operator

78 Literature

• M. Do Carmo: Differential Geometry of Curves and Surfaces, Prentice Hall, 1976

• A. Pressley: Elementary Differential Geometry, Springer, 2010

• G. Farin: Curves and Surfaces for CAGD, Morgan Kaufmann, 2001

• W. Boehm, H. Prautzsch: Geometric Concepts for Geometric Design, AK Peters 1994

• H. Prautzsch, W. Boehm, M. Paluszny: Bézier and B-Spline Techniques, Springer 2002

• ddg.cs.columbia.edu

• http://graphics.stanford.edu/courses/cs468-13-spring/schedule.html

79 Next Time

Discrete Differential Geometry

80 http://cs599.hao-li.com

Thanks!

81