b-spline and subdivision surfaces - computer...

48
B-Spline and Subdivision Surfaces Slides from Mirela Ben-Chen Images from: 3drender.com & sunflow.sourceforge.net

Upload: others

Post on 19-Jun-2020

8 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

B-Spline and Subdivision Surfaces

Slides from Mirela Ben-Chen

Images from: 3drender.com & sunflow.sourceforge.net

Page 2: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

2

Surface Models

• B-Spline surfaces– NURBS surfaces

• Subdivision surfaces– Theory– Zoo

Images from: 3drender.com , sunflow.sourceforge.net , www.tsplines.com

2

Page 3: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

3

Reminder: B-Spline Curves

B-Spline Curve

Decouple number of control points from degree of curve

“Glue” a few degree p Bézier curves, with continuity conditions

Applet (Curve)

3

Page 4: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

4

Reminder: B-Spline Curves

B-Spline Curve

Building blocks:n + 1 control points PiKnot vector U = { u0 , u1 , … , um }The degree pm, n, p satisfy m = n + p - 1

Applet (Basis functions)

P0

P1

P2

P3 P4

P5

P6

P7

4

Page 5: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

5

B-Spline Surfaces

A collection of Bezier patches, with continuity conditions

Decoupling the degree and the number of control points

5

Page 6: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

6

B-Spline Surfaces

B-Spline surface - tensor product surface of B-Spline curves

Building blocks:Control net, m + 1 rows, n + 1 columns: Pij

Knot vectors U = { u0 , u1 , … , uh }, V = { v0 , v1 , … , vk }The degrees p and q for the u and v directions

6

Page 7: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

7

Cubic × Quadratic basis functions:

Basis Functions

7

Page 8: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

8

Properties

• Non negativity

• Partition of unity

• Affine invariance

8

Page 9: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

9

Properties

• If n = p, m = q, U = { 0,…,0,1,…,1} and V = {0,…,0,1,…,1} then

and S(u,v) is a Bézier surface

• S(u,v) is Cp-k continuous in the udirection at a u knot of multiplicity k, and similar for v direction

9

Page 10: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

10

Properties

• Compact support

• Local modification scheme– Moving Pij affects the surface only in

the rectangle

10

Page 11: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

11

Properties

• Local definition – In any rectangle the only non-zero

basis functions are

• Strong convex hull property– If then S(u,v) is in the convex

hull of the control points Pij and

11

Page 12: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

12

Reminder: NURBS Curves

• B-spline curves cannot represent exactly circles and ellipses

• Generalize to rational polynomialsp = 2 p = 3 p = 5 p = 10

12

Page 13: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

13

Reminder: NURBS Curves

A weight per control point allows to change the influence of a point on the curve, without moving the point

13

Page 14: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

14

NURBS Surfaces

Add a weight for every control point of a B-spline surface, and normalize

Is not a tensor product patch

14

Page 15: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

15

NURBS Surface Example

Control net NURBS Surface

wij( ) = 10, wij( ) = 115

Page 16: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

16

NURBS Surfaces

16

Page 17: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

17

Problems with NURBS

• A single NURBS patch is either a topological disk, a tube or a torus

• Must use many NURBS patches to model complex geometry

• When deforming a surface made of NURBS patches, cracks arise at the seams

17

Page 18: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

18

Subdivision “Subdivision defines a smooth curve or surface

as the limit of a sequence of successive refinements”

18

Page 19: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

19

Subdivision Rules

• How the connectivity changes

• How the geometry changes– Old points– New points

19

Page 20: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

20

Design Goals for Subd Rules• Efficiency

• Compact support

• Local definition

• Affine invariance

• Simplicity

• Smoothness

Same properties NURBS have, but will work for any topology

20

Page 21: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

21

An Example – Loop Scheme• Connectivity

• Geometry

• Analysis?– Does it converge?– Is the limit surface smooth?– Any problems at extraordinary (valence != 6) vertices?

21

1/8 β

3/8 3/8

1/8

1-kββ

β

β

β

Page 22: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

22

Parameterization of Subd Surfaces

• B-spline curves and surfaces are parameterized

• To analyze subd schemes, we need a similar parameterization

• Which domain to use? A planar rectangle cannot work

• Solution: Use initial control mesh as the domain

22

Page 23: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

23

Parameterization of Subd Surfaces

• Apply subd rules to initial mesh, without updating the geometry

• Use resulting polyhedron as the domain

23

Page 24: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

24

Smoothness of SurfacesC1 continuity

A surface f :|K|→ R3 is C1 continuous if for every point x ∈ |K| there exists a regular parameterizationπ : D → f(Ux), over a unit disk D in the plane, where Ux is the neighborhood in |K| of x.

A regular parameterization π is one that is continuously differentiable, one-to-one, and has a Jacobi matrix of maximum rank.

Page 25: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

25

Subdivision Properties

• How can we prove properties of a subdivision scheme?

• Express the subdivision as a local matrix operation

• Prove properties (convergence, continuity, affine invariance, etc.) using eigen-analysis.

Page 26: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

26

Subdivision Matrix• Look at the local neighborhood of an extraordinary

vertex v

• Let Uj be the set of vertices in the 2-ring neighborhood of v after jLoop subdivision steps

• Let pi j be the corresponding control points

• We can compute pi j+1 using only pi

j

26

Step j Step j + 1

1/8

3/8 3/8

1/8

β

1-kββ

β

β

β

Page 27: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

27

Subdivision Matrix

• An extraordinary vertex of degree k has vertices in its 2-ring neighborhood

• S depends on k

k+3

k+4

k+2

k+1

2k

3

4

2

1

k

0

2k+3

2k+2

2k+1

3k

Page 28: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

28

Subdivision Matrix

• Assume S has a full set of eigenvectors {ϕi} with corresponding real eigenvalues {λi}, arranged in non-increasing order

• We can express p0 in terms of the eigenvectors of S:

• Where:

Page 29: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

29

Subdivision Matrix

• Now we can express p j using only ai and the eigenvalues and eigenvectors of S:

• We used the fact:

Page 30: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

30

Subdivision Properties

• Convergence: We need |λi| ≤ 1 for all i (and only one eigenvalue can be exactly 1)

• Affine invariance: If for all A,B:

For affine invariance we need → λ0 = 1

Page 31: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

31

Subdivision Properties• Limit position:

Since |λi| < 1 for all i > 0, we have:

In the limit the 2-neighborhood of v is mapped to the same position: a0

We can compute the limit positions without recursively applying the subdivision

Page 32: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

32

Subdivision Properties

• Limit tangent plane:Since scheme is translation invariant, fix a0 = 0Assume λ = λ1 = λ2 > λ3

For large enough j, the 2-neighborhood of v is mapped to linear combinations of a1 and a2

a1 and a2 span the tangent plane of the limit surface at v

Page 33: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

33

Piecewise Smooth Surfaces

• So far, only considered closed smooth surfaces• Surfaces have boundaries and creases• A subdivision scheme should have rules for all

the following cases:

Interior Smooth boundary

Convex boundary

Concaveboundary

Crease

Page 34: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

34

Subdivision Zoo• Can be classified according to:

• Many more...

Primal (face split)

Triangular meshes Quad Meshes

Approximating Loop(C2) Catmull-Clark(C2)

Interpolating Mod. Butterfly (C1) Kobbelt (C1)

Dual (vertex split)

Doo-Sabin, Midedge(C1)

Biquartic (C2)

Page 35: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

35

Terminology

• Regular vertices– Tri meshes

• In the interior - degree 6• On the boundary – degree 4

– Quad meshes• In the interior - degree 4• On the boundary – degree 3

• Extraordinary vertices – all the rest

35

Page 36: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

36

Terminology

• Odd vertices – new vertices at current subdivision level

• Even vertices – vertices inherited from previous level

• Face vertices – odd vertices inserted in a face

• Edge vertices – odd vertices inserted on an edge

36

Page 37: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

37

Boundaries and Creases

• Special subdivision rules will be given for each scheme for the boundary vertices

• The boundary curve of the limit surface:– Should not depend on interior control vertices

• In case two surfaces will be merged along the boundary– Should be C1 or C2

• Use boundary rules for edges tagged as creases

37

Page 38: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

38

Odd vertices Even vertices

Loop Scheme

• Possible choices for β– Original (by Loop):

– Or (by Warren):

38

Page 39: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

39

Loop Scheme• Limits for interior vertex v

(using control points from any subd level j )– Position

– Tangents

Where vi j for i = {0,..,k – 1} are the one ring neighbors of the

vertex v at subd level j, and pi j are the corresponding control

points

39

Page 40: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

40

Modified Butterfly Scheme

• Interpolating scheme– Even vertices don’t move

40

Butterfly(not C1)

Modified Butterfly

Page 41: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

41

Catmull-Clark Quad Scheme

41Can be modified to work on general polygons

Page 42: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

42

Kobbelt SchemeMain observation - to compute a face control point:

• compute all edge control points

• compute face control points using the edge rule applied to edge control points on same level

42

Page 43: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

43

Scheme Comparison

43

• Subdividing a cube– Loop result is asymetric, because cube was triangulated

first– Both Loop and Catmull-Clark are better then Butterfly (C2

vs. C1 )– Interpolation vs. smoothness

Page 44: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

44

Scheme Comparison

• Subdividing a tetrahedron– Same insights– Severe shrinking for approximating schemes

44

Page 45: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

45

Scheme Comparison• Spot the difference?• For smooth meshes with uniform triangle size, different

schemes provide very similar results• Beware of interpolating schemes for control polygons with

sharp features

45

Page 46: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

46

So Who Wins?• Loop and Catmull-Clark best when interpolation is not

required• Loop best for triangular meshes• Catmull-Clark best for quad meshes

– Don’t triangulate and then use Catmull-Clark

46

Page 47: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

47

The Dark Side of Subd Surfaces

• Problems with curvature continuity– Requires either very large support, or forces 0

curvature at extraordinary vertices– Generates ripples near vertices of large degree

47

Page 48: B-Spline and Subdivision Surfaces - Computer Graphicsgraphics.stanford.edu/.../LJGedits_surfaces8.pdf · 2 Surface Models • B-Spline surfaces – NURBS surfaces • Subdivision

48

The Dark Side of Subd Surfaces

• Decreased smoothness with degree– For large degrees, third

eigenvalue approaches second and first eigenvalues

– Generates creases

• Can fix by modifying scheme– Creates more ripples

48