Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

Spline Curves & Surfaces

Thomas Funkhouser Princeton University C0S 526, Fall 2002

3D Object Representations
Raw data

Solids

Voxels Point cloud Range image Polygons


Octree BSP tree CSG Sweep

Surfaces

High-level structures

Mesh Subdivision Parametric Implicit

Scene graph Skeleton Application specific

Curved Surfaces
Motivation

Exact boundary representation for some objects More concise representation than polygonal mesh

H&B Figure 10.46

Curved Surfaces
What makes a good surface representation?

Accurate Concise Intuitive specification Local support Affine invariant Arbitrary topology Guaranteed continuity Natural parameterization Efficient display Efficient intersections

Curve Representations
Function

y= f(x)

Implicit

f(x, y) = 0 x = f(u) y = f(u)


Parametric

Subdivision

(x,y,z) defined by limit of recursive process

Curved Surface Representations


Function

z= f(x,y)

Implicit

f(x, y, z) = 0 x = f(u, v) y = f(u,v ) z = f(u, v)


Parametric

Subdivision

(x,y,z) defined by limit of recursive process

Function Surface Representation


Boundary defined by explicit function:

z = f (x, y)

Implicit Surfaces
Boundary defined by implicit function:

f (x, y, z) = 0

Example: linear (plane)

ax + by +cz + d = 0 N = (a,b,c) (x,y,z)

Implicit Surfaces
Example: quadric
f(x,y,z)=ax2+by2+cz2+2dxy+2eyz+2fxz+2gx+2hy+2jz+k

Common quadric surfaces:


Sphere Ellipsoid Torus Paraboloid Hyperboloid


x rx

y + ry

z + rz

1 = 0

H&B Figure 10.10

Parametric Surfaces
Boundary defined by parametric function:
x = f(u, v) y = f(u,v ) z = f(u, v)

Example (sphere):
x = cos()cos() y = sin()cos() z = sin()

Subdivision Surfaces
Coarse mesh & subdivision rule

Define smooth surface as limit of sequence of refinements

Zorin & Schroeder SIGGRAPH 99 Course Notes

Outline
Today:

Parametric curves and surfaces

Wednesday:

Subdivision surfaces Implicit surfaces

Next week:

Parametric curves
A parametric curve in the plane is expressed as:
x = x(u) y = y(u)

Example: a circle with radius r centered at origin:


x = r cos u y = r sin u

Parametric polynomial curves


A parametric polynomial curve is described:
x (u ) =

ai u i
i =0

y (u ) =

bi u i
i =0

Advantages of polynomial curves


Easy to compute Infinitely differentiable

Piecewise Param Polynomial Curves


Idea:

Use different polynomial functions on different parts of the curve

Advantage:

Flexibility Control Smoothness at joints? (continuity)

Issue:

Continuity
Continuity Ck indicates adjacent curves have the same kth derivative at their joints

C0 Continuity
Adjacent curves share

Same endpoints: Qi(1) = Qi+1(0)

C1 Continuity
Adjacent curves share

Same endpoints: Qi(1) = Qi+1(0) Same derivatives: Qi (1) = Qi+1 (0)

C2 Continuity
Adjacent curves share

Same endpoints: Qi(1) = Qi+1(0) Same derivatives: Qi (1) = Qi+1 (0) Same second derivatives: Qi (1) = Qi+1 (0)

Spline constructions
C2 interpolating splines Hermite Bezier Catmull-Rom B-splines
V0 V2 Blending functions

Q (u ) =

k i =0

Vi bi (u )

V1

V3

10

C2 Interpolating splines
Blending functions are chosen so that

Control points are interpolated Adjacent curves meet with C2 continuity

C2 Interpolating splines
Properties:

Interpolate control points C2 continuity No local control

11

Spline constructions
C2 interpolating splines Hermite Bezier Catmull-Rom B-splines

Uniform Cubic B-Splines


Choose blending functions so that

Cubic polynomials C2 continuity Local control Points not necessarily interpolated

12

Uniform Cubic B-Splines


Derivation:

Three continuity conditions for each joint Ji Position of two curves are equal at Ji Derivatives of two curves are equal at Ji Second derivatives of two curves are equal at Ji Also, local control implies Each joint is affected by small set of (4) points

Uniform Cubic B-Splines


Fifteen continuity constraints:
0 = b-0(0) b-0(1) = b-1(0) b-1(1) = b-2(0) b-2(1) = b-3(0) b-3(1) = 0 0 = b-0(0) b-0(1) = b-1(0) b-1(1) = b-2(0) b-2(1) = b-3(0) b-3(1) = 0 0 = b-0(0) b-0(1) = b-1(0) b-1(1) = b-2(0) b-2(1) = b-3(0) b-3(1) = 0

One more convenient constraint: b -0(0) + b -1(0) + b -2(0) + b -3(0) =1

13

Uniform Cubic B-Splines


Solving the system of equations:
b3 (u ) = 1 u 3 + 1 u 2 1 u + 1 6 2 2 6 b 2 (u ) = 1 u 3 u 2 + 2 2 3 3 2 b1 (u ) = 1 u + 1 u + 1 u + 1 2 2 2 6 3 b0 (u ) = 1 u 6
2/3
b2 (u ) b1 (u )

b3 (u )

b 0 (u )

Uniform Cubic B-Splines


Matrix form for uniform cubic B-spline:

6 2

Q (u ) = u 3 u 2

u 1

] 12

2 1

1 1 1 1

2 2 6

6 Vi 3 0 Vi 2

0 2 3
Vi

Vi 1

Vi

Vi-3 Vi-2 Vi-1

14

Uniform Cubic B-Splines


Properties:

C2 continuity Local control Approximating (points not interpolated) Convex hull property

Parametric Patches
Each patch is defined by blending control points

FvDFH Figure 11.44

15

Parametric Patches
Point Q(u,v) on the patch is the tensor product of parametric curves defined by the control points
Q(0,1)

Q(u,v)
Q(1,1)

Q(0,0) Q(1,0)

Watt Figure 6.21

Parametric Bicubic Patches


Point Q(u,v) on any patch is defined by combining control points with polynomial blending functions:

P 1,1 P2 ,1 Q(u , v) = UM P3,1 P4 ,1


P 1, 2 P2, 2 P3, 2 P4, 2

P 1, 3 P2 ,3 P3,3 P4 ,3

P 1, 4 P2, 4 MTV T P3, 4 P4, 4


U = u3

u2

u 1

V = v3

v2

v 1

Where M is a matrix describing the blending functions for a parametric cubic curve (e.g., Bezier, B-spline, etc.)

16

B-Spline Patches

Q(u , v) = UM B Spline

P 1,1 P2,1 P3,1 P4,1

P 1, 2 P2, 2 P3, 2 P4, 2

P 1, 3 P2 ,3 P3,3 P4 ,3

P 1, 4 P2, 4 MT B Spline V P3, 4 P4, 4


M B Spline =

2 1 2 1 6

2 1

1 1 1 1

2 2 6

6 0

0 2 3

Watt Figure 6.28

Parametric Surfaces
Advantages:

Easy to enumerate points on surface Possible to describe complex shapes

Disadvantages:

Control mesh must be quadrilaterals Continuity constraints difficult to maintain Hard to find intersections

17

You might also like