Computer Graphics 17 - Curves and Surfaces 2: Tom Thorne
Computer Graphics 17 - Curves and Surfaces 2: Tom Thorne
Tom Thorne
• de Casteljau’s algorithm
• de Boor’s algorithm
• Knot insertion
• NURBS
• Subdivision surfaces
De Casteljau’s
de Casteljau’s algorithm Algorithm
• A method totoevaluate
• A method (sample
evaluate (sample pointspoints in)aor
in) or draw draw
Bézier
the Bezier
curve curve
• The Bezier curve of any degree
• Works with Bézier curves of any degree
can be handled
• A precise way to evaluate the curves
• A precise method to evaluate the curve
de Casteljau’s algorithm
de Casteljau’s Algorithm
• • Given the control points P1 , . . . , Pn and the parameter value
0t1
• Repeat the following procedure:
Pir (t) = (1 t)Pir 1 r 1
(t) + tPi+1 (t)
Pi0 (t) = Pi
n
• Then P0 (t) is the point with parameter value t on the
Bézier curve
Why does this work?
1
P0 (t) = (1 t)P0 + tP1
1
P1 (t) = (1 t)P1 + tP2
2 1 1
P0 (t) = (1 t)P0 + tP1
• de Casteljau’s algorithm
• de Boor’s algorithm
• Knot insertion
• NURBS
• Subdivision surfaces
B-Splines: general form
0 t
10/10/2008
3
Lecture 5 m+1
Knots
0 1 2 3 4 5 6 7 8 9 10 11 12 13
knots
Knots
Knots
• Non-uniform knots:
Here is an example of non-uniform knots
http://i33www.ira.uka.de/applets/mocca/html/noplugin/BSplineBasis/AppBSplineBasis/index.html
B-spline terms
0 t
3 m+1
Clamped B-splines
• The first and last knot values are repeated with multiplicity
equal to the order (degree + 1)
• de Casteljau’s algorithm
• de Boor’s algorithm
• Knot insertion
• NURBS
• Subdivision surfaces
de Boor’s algorithm
De Boor’s Algorithm
• B-spline version of de Casteljau’s algorithm
•
• A precise method to evaluate the curve
•
Example
Assume we have a cubic B-spline with knot vector:
• Assume we have a cubic
[0, 0, 0, 0, 0.25, 0.5, 0.75, 1, 1, 1, 1] B-spline whose knot
•
vector is {0, 0,
Computing the point at t = 0.4 0, 0, 0.25, 0.5, 0.75, 1, 1, 1, 1}
• Let’s compute a point at t = 0.4
• Then t4 •Then,
t t5t4 and
< t <the
t5, control
and the control
points points
that affectthat
the final
affect the final position are P4, P3, P2, P1
position are P4 , P3 , P2 , P1
Example
Example
• Assume we have a cubic B-spline whose knot
vector is {0, 0, 0, 0, 0.25, 0.5, 0.75, 1, 1, 1, 1}
• Let’s compute a point at t = 0.4
• Then, t4 < t < t5, and the control points that
affect the final position are P4, P3, P2, P1
Example
Example
• Assume we have a cubic B-spline whose knot
vector is {0, 0, 0, 0, 0.25, 0.5, 0.75, 1, 1, 1, 1}
• Let’s compute a point at t = 0.4
• Then, t4 < t < t5, and the control points that
affect the final position are P4, P3, P2, P1
Example
Example
• Assume we have a cubic B-spline whose knot
vector is {0, 0, 0, 0, 0.25, 0.5, 0.75, 1, 1, 1, 1}
• Let’s compute a point at t = 0.4
• Then, t4 < t < t5, and the control points that
affect the final position are P4, P3, P2, P1
What if you want to edit some details?
What if you want to edit some
details?
• You •might want to
You might addto
want some
addhigh
some resolution details indetails
high resolution a
at aarea
particular particular
whilst area while
leaving the keeping thecurve
rest of the rest unchanged
the same
Knot insertion
• A bspline curve of
degree 3 (k=4) having t0 to t3 t4 t5 t6 t7 t8 to t11
the following knots
0 0.2 0.4 0.6 0.8 1
• t=0.5 inserted
t0 to t3 t4 t5 t6 t7 t8 t9 to t12
• A bspline curve of
degree 3 (k=4) having Example
t to t 0t 3 t 4 5 t6 t7 t8 to t11
the following knots
• A bspline curve of 0
t to t t
0.2
t
0.4
t
0.6
t7
0.8
t8 to t11
1
• t=0.5degree
inserted
3 (k=4) having
0 3 4 5 6
• t=0.5 inserted t to t 0
t t 3
t 4
t 5 6 7
t8 t9 to t12
00 0.2 0.40.40.5 0.5
0.2 0.6 0.6
0.8 0.8
1 1
Example
• A bspline curve of
degree 3 (k=4) having
t0 to t3 t4 t5 t6 t7 t8 to t11
the following knots
0 0.2 0.4 0.6 0.8 1
• t=0.5 inserted
t0 to t3 t4 t5 t6 t7 t8 t9 to t12
http://i33www.ira.uka.de/applets/mocca/html/
noplugin/curves.html
Summary of B-splines
• de Casteljau’s algorithm
• de Boor’s algorithm
• Knot insertion
• NURBS
• Subdivision surfaces
NURBS (Non-uniform rational B-spline)
∑B
i =0
i ,k (t ) wi Pi
C (t ) = n
∑B
i =0
i ,k (t ) wi
Pi : control points
Bi,k : Bspline basis of order k
wi : weights
Benefits of using NURBS
m n
p (u , v) = ∑∑ Bi , p (u ) B j ,q (v)Pi , j : non − rational B - spline
i =0 j =0
m n
∑∑ w
i =0 j =0
i, j Bi , p (u ) B j ,q (v)Pi , j
p (u , v) = m n
: NURBS
∑∑ w
i =0 j =0
i, j Bi , p (u ) B j ,q (v)
Clamped, Closed and Open B-spline Surfaces
• Since a B-spline curve can be clamped, closed or open, a B-spline surface can also have
three types in each direction.
• That is, we could ask to have a B-spline surface clamped in the u-direction and closed in
the v-direction.
• If a B-spline is clamped in both directions, then this surface passes though control points
p0,0, pm,0, p0,n and pm,n
• If a B-spline surface is closed in one direction, then the surface becomes a tube.
• de Casteljau’s algorithm
• de Boor’s algorithm
• Knot insertion
• NURBS
• Subdivision surfaces
Subdivision Surfaces
• Shape modeling
– Topological restrictions of NURBS
surfaces
• Plane, Cylinder, and Torus
• It is difficult to maintain smoothness at
seams of patchwork.
– Example: hiding seams in Woody (Toy Story)
[DeRose98]
– NURBS also require the control nets
consist of a regular rectangular grid of
control points
• LOD in a scene
– A coarse shape when far away, a smooth
dense surface when closer to the camera
Subdivision surface
• Can handle arbitrary topology
Different Schemes
• Doo-Sabin ‘78
• Catmull-Clark ‘78
• Etc (Loop, Butterfly, and many others)
A Primer: Chaiken’s Algorithm
P2 3 1
Q2 Q3 Q0 = P0 + P1
P1 4 4
Q4
Q1 1 3
Q1 = P0 + P1
Q5 4 4
Q0
P3 3 1
P0 Q2 = P1 + P2
4 4
1 3
Apply Iterated Q3 = P1 + P2
Function System 3 1 4 4
Q2i = Pi + Pi +1
4 4
1 3 3 1
Q2i +1 = Pi + Pi +1 Q4 = P2 + P3
4 4 4 4
1 3
Q5 = P2 + P3
4 4
http://www.multires.caltech.edu/teaching/demos/
Limit Curve Surface
java/chaikin.htm
Doo-Sabin Subdivision
• An edge point is formed from the midpoint of each edge
• A face point is formed as the centroid of each polygon of the
mesh.
• Finally, each vertex in the new mesh is formed as the average
of
– a vertex in the old mesh,
– a face point for a polygon that touches that old vertex, and
– the edge points for the two edges that belong to that polygon
and touch that old vertex.
Doo-Sabin Subdivision
FACE
1 n
f = ∑ vi
n 1
EDGE
v1 + v2 + f1 + f 2
e=
4
VERTEX
n−2 1 1
vi +1 = vi + 2 ∑j e j + n 2 ∑f j
n n j
Modelling with Catmull-Clark
FACE (unchanged)
1 n
f = ∑ vi
n 1
EDGE
v1 + v2
e=
2
VERTEX
# adj. Sharp edges
corner >2
vi +1 = vi
crease 2 e1 + 6vi + e2
vi +1 =
8
Another example of creases
Non-Integer Sharpness
• Advantages
– Simple method for describing complex surfaces
– Relatively easy to implement
– Arbitrary topology
– Local support
– Guaranteed continuity
– Multi-resolution
• Difficulties
– Intuitive specification
– Parameterization
– Intersections
References
• http://www.ibiblio.org/e-notes/Splines/basis.html
• http://i33www.ira.uka.de/applets/mocca/html/noplugin/BSplineBasis/
AppBSplineBasis/index.html
• http://geom.ibds.kit.edu/applets/mocca/html/noplugin/IntBSpline/
AppInsertion/index.html
• http://www.multires.caltech.edu/teaching/demos/java/chaikin.htm
• http://i33www.ira.uka.de/applets/mocca/html/noplugin/curves.html
• http://www.rose-hulman.edu/~finn/CCLI/Applets/DooSabinApplet.html