You are on page 1of 7

# Types of Spline Curves

## • Splines covered in last lecture

Hermite
Bezier
More Curves Catmull-Rom
and Surfaces B-Spline

Thomas Funkhouser
Princeton University
COS 426, Spring 2004 Each
Eachhas
hasdifferent
differentblending
blendingfunctions
functions
resulting
resultingin
indifferent
differentproperties
properties

## Uniform Cubic B-Splines B-Spline Blending Functions

• Properties: V0 • Properties imply blending functions: V0
Local control Cubic polynomials
C2 continuity V1 Four control vertices affect each point V1
Approximating C2 continuity

V3 V2 1
V3 V2

V4 V4
0

V0 V1 V2 V3 V4 V5 u
V5 V5

## B-Spline Blending Functions B-Spline Blending Functions

• How derive blending functions? V0 • Four cubic polynomials for four vertices V0
Cubic polynomials 16 variables (degrees of freedom)
Local control V1 Variables are ai, bi, ci, di for V1
C2 continuity four blending functions

V3 V2 V3 V2
1
b− 0 (u ) = a0u 3 + b0 u 2 + c0 u1 + d 0
b-1 b-2
b−1 (u ) = a1u 3 + b1u 2 + c1u1 + d1
b-0 V4 V4
b-3
b− 2 (u ) = a2 u 3 + b2 u 2 + c2u 1 + d 2
0

## V0 V1 V2 V3 V4 V5 u b−3 (u ) = a3u + b3u + c3u + d 3

3 2 1

V5 V5

1
B-Spline Blending Functions B-Spline Blending Functions
• C2 continuity implies 15 constraints V0
Position of two curves same
Derivative of two curves same V1
Second derivatives same

V3 V2

V4

V5

## B-Spline Blending Functions B-Spline Blending Functions

• Solving the system of equations yields: • In matrix form:

−1 3 − 3 1 V0
1 3 −6 3
Q ( u ) = (u u 1)
3 2
0 V1
u
6 −3 0 3 0 V2
1 4 1 0 V3

## B-Spline Blending Functionss B-Spline Blending Functions

In plot form: V0 • Blending functions imply properties: V0
m Local control
Bi (u ) = a ju j
V1 Approximating V1
j =0
C2 continuity
b-0 b-1 Convex hull
1 1
V3 V2 1
V3 V2
0 0
0 1 0 1
b-2 b-3
1 1
V4 V4
0

V0 V1 V2 V3 V4 V5 u
0
0
0
0
V5 V5
1 1

2
Curved Surfaces Curved Surfaces
• Motivation • What makes a good surface representation?
Exact boundary representation for some objects Accurate
More concise representation than polygonal mesh Concise
Intuitive specification
Local support
Affine invariant
Arbitrary topology
Guaranteed continuity
Natural parameterization
Efficient display
Efficient intersections

## Curved Surface Representations Parametric Surfaces

• Polygonal meshes • Boundary defined by parametric functions:
x = fx(u,v)
• Subdivision surfaces
y = fy(u,v)
• Parametric surfaces z = fz(u,v)

• Implicit surfaces
• Example: ellipsoid
x = rx cos φ cos θ
y = ry cos φ sin θ
z = rz sin φ

## Parametric Surfaces Piecewise Parametric Surfaces

• Advantages: • Surface is partitioned into parametric patches:
Easy to enumerate points on surface

u
• Problem:
Need piecewise-parametrics surfaces to describe
complex shapes Same ideas as parametric splines!
FvDFH Figure 11.42 Watt Figure 6.25

3
Parametric Patches Parametric Patches
• Each patch is defined by blending control points • Point Q(u,v) on the patch is the tensor product of
parametric curves defined by the control points

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

Q(0,0)

Q(1,0)

## Same ideas as parametric curves!

FvDFH Figure 11.44 Watt Figure 6.21

## Parametric Bicubic Patches B-Spline Patches

Point Q(u,v) on any patch is defined by combining P1,1 P1, 2 P1,3 P1,4
control points with polynomial blending functions: P2,1 P2, 2 P2,3 P2,4
Q(u, v) = UM B −Spline M TB −Spline V
P3,1 P3,2 P3,3 P3, 4
P1,1 P1, 2 P1,3 P1,4 P4,1 P4, 2 P4,3 P4,4
P P2,2 P2,3 P2,4
Q(u, v) = UM 2,1 M TVT
P3,1 P3, 2 P3,3 P3,4
P4,1 P4,2 P4,3 P4,4
−1 1 −1 1
6 2 2 6
U= u[ 3
u 2
u 1 ] V= v [ 3
v 2
v 1 ] M B −Spline
1
= 2
−1
−1 1
1
2 0

2 0 2 0
1 2 1 0
6 3 6
Where M is a matrix describing the blending functions
for a parametric cubic curve (e.g., Bezier, B-spline, etc.)
Watt Figure 6.28

## Bezier Patches Bezier Patches

P1,1 P1, 2 P1,3 P1,4
• Properties:
P2,1 P2, 2 P2,3 P2,4 Interpolates four corner points
Q(u, v) = UM Bezier M TBezierV Convex hull
P3,1 P3,2 P3,3 P3, 4
P4,1 P4, 2 P4,3 P4,4 Local control

−1 3 − 3 1
M Bezier = 3 − 6 3 0
−3 3 0 0
1 0 0 0

## FvDFH Figure 11.42 Watt Figure 6.22

4
Bezier Surfaces Bezier Surfaces
• Continuity constraints are similar to the ones for • C0 continuity requires aligning boundary curves
Bezier splines

## Bezier Surfaces Drawing Bezier Surfaces

• C1continuity requires aligning boundary curves • Simple approach is to loop through
and derivatives uniformly spaced increments of u and v

DrawSurface(void)
DrawSurface(void)
{{
for
for (int
(int ii == 0;
0; ii << imax;
imax; i++)
i++) {{
float
float uu == umin
umin ++ ii ** ustep;
ustep;
for
for (int
(int jj == 0;
0; jj << jmax;
jmax; j++)
j++) {{
float
float vv == vmin
vmin ++ jj ** vstep;
vstep;
}}
}}
}}

## Drawing Bezier Surfaces Drawing Bezier Surfaces

• Better approach is to use adaptive subdivision: • One problem with adaptive subdivision is avoiding
cracks at boundaries between patches at different
DrawSurface(surface)
DrawSurface(surface) subdivision levels
{{
if
if Flat
Flat (surface,
(surface, epsilon)
epsilon) {{
Crack
}} Uniform subdivision
else
else {{
SubdivideSurface(surface,
SubdivideSurface(surface, ...);
...);
DrawSurface(surfaceLL);
DrawSurface(surfaceLL);
DrawSurface(surfaceLR);
DrawSurface(surfaceLR);
DrawSurface(surfaceRL);
DrawSurface(surfaceRL);
DrawSurface(surfaceRR);
DrawSurface(surfaceRR);
}} Avoid these cracks by adding extra vertices and triangulating
}}
Watt Figure 6.32 Watt Figure 6.33

5
Parametric Surfaces Curved Surface Representations
Easy to enumerate points on surface
• Subdivision surfaces
Possible to describe complex shapes

## • Disadvantages: • Parametric surfaces

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

## Implicit Surfaces Implicit Surfaces

• Boundary defined by implicit function: • Example: quadric
f (x, y, z) = 0 f(x,y,z)=ax2+by2 +cz2+2dxy+2eyz+2fxz+2gx+2hy+2jz+k

## • Example: linear (plane)

ax + by +cz + d = 0
Sphere 2 2 2
x y z
N = (a,b,c) Ellipsoid + + −1 = 0
Torus rx ry rz
Paraboloid
(x,y,z) Hyperboloid

## Implicit surface examples Implicit Surfaces

Easy to test if point is on surface
Easy to intersect two surfaces
Easy to compute z given x and y

Hard to describe specific complex shapes
Hard to enumerate points on surface

## MaxMan Blobby Object Skin [Markosian99]

6
Summary

Subdivision
Parametric
Polygonal

Implicit

Surface
Surface

Surface
Mesh
Feature
Accurate No Yes Yes Yes
Concise No Yes Yes Yes
Intuitive specification No No Yes No
Local support Yes No Yes Yes
Affine invariant Yes Yes Yes Yes
Arbitrary topology Yes No No Yes
Guaranteed continuity No Yes Yes Yes
Natural parameterization No No Yes No
Efficient display Yes No Yes Yes
Efficient intersections No Yes No No