Documentos de Académico
Documentos de Profesional
Documentos de Cultura
P(1) = a + b + c + d du
u H 2 (u) = (2u 3 + 3u 2 )
P (0) = c
H 3 (u) = (u 3 2u 2 + u) H3
P u (1) = 3a + 2b + c pu(0) pu(1)
H 4 (u) = (u 3 u 2 )
n
d = p(0)
D. Fussell UT, Austin D. Fussell UT, Austin
1
Blending Functions Hermite Curves - Matrix Form
3 2 3 2 3 2 u 3 2 u
P(u) = (2u 3u +1)p(0) + (2u + 3u )p(1) + (u 2u + u)p (0) + (u u )p (1) Putting this in matrix form H = [H1 (u) H 2 (u) H 3 (u) H 4 (u)]
# 2 2 1 1 &
% (
H2(u) H4(u) 3 3 2 1(
H1(u) H3(u) = [u 3 u2 u 1] %
%0 0 1 0(
% (
$1 0 0 0'
= UM H
10
D. Fussell UT, Austin
11 12
2
Parametric Continuity Continuity
Continuity (recall from the calculus): What are the conditions for C0 and C1
Two curves are Ci continuous at a point p iff the continuity at the joint of curves xl and xr?
i-th derivatives of the curves are equal at p tangent vectors at end points equal
end points equal
dQ l dQ r
Q l (1) = Q r (0), (1) = (0)
dt dt
13 Ql Qr 14
Pics/Math courtesy of Dave Mount @ UMD-CP 1994 Foley/VanDam/Finer/Huges/Phillips ICG
Continuity Continuity
In 3D, compute this for each component of
The derivative of is the parametric the parametric function
tangent vector of the curve: For the x component:
15 xl xr 16
1994 Foley/VanDam/Finer/Huges/Phillips ICG 1994 Foley/VanDam/Finer/Huges/Phillips ICG
3
B-splines: Basic Ideas B-spline: Benefits
Similar to Bzier curves User defines degree
Smooth blending function times control points Independent of the number of control points
But: Produces a single piecewise curve of a
Blending functions are non-zero over only a particular degree
small part of the parameter range
No need to stitch together separate curves
(giving us local support)
at junction points
When nonzero, they are the concatenation
of smooth polynomials. (They are piecewise!) Continuity comes for free!
19 20
B-splines B-splines:
Defined similarly to Bzier curves
Cox-deBoor Recursion
pi are the control points Cox-deBoor Algorithm: defines the blending
Computed with basis functions (Basis-splines) functions for spline curves (not limited to deg 3)
B-spline basis functions are blending functions curves are weighted avgs of lower degree curves
Each point on the curve is defined by the Let Bi ,d (t ) denote the i-th blending function for a
blending of the control points B-spline of degree d, then:
(Bi is the i-th B-spline blending function)
m $1, if t k t < t k +1
Bk , 0 (t ) = #
p (t ) = Bi ,d (t ) pi "0, otherwise
i =0 t tk t t
Bk ,d (t ) = Bk ,d 1 (t ) + k + d +1 Bk +1,d 1 (t )
Bi is zero for most values of t! 21
tk +d tk t k + d +1 t k +1 22
4
B-spline Blending Functions:
Example for 3rd Degree Splines B-splines: Knot Selection
m
p (t ) = Bi ,d (t ) pi Observe: Instead of working with the parameter
i =0 in t=0 to t=1 range space 0 t 1, use t min t0 t1 t 2 ... t m 1 t max
just four of the
functions are non- The knot points
zero joint points between
all are >=0 and sum curve segments, Qi
to 1, hence the
convex hull property Each has a
holds for each curve knot value
segment of a m-1 knots for
B-spline m+1 points
25 26
1994 Foley/VanDam/Finer/Huges/Phillips ICG
1994 Foley/VanDam/Finer/Huges/Phillips ICG
Uniform B-splines:
Setting the Options Example: Creating a B-spline
m
Specified by
m 3
p (t ) = Bi ,d (t ) pi m=9
10 control points
i =0
m+1 control points, P0 Pm 8 knot points
m-2 cubic polynomial curve segments, Q3Qm 7 segments
m-1 knot points, t3 tm+1
segments Qi of the B-spline curve are
defined over a knot interval [ti , ti +1 ]
defined by 4 of the control points, Pi-3 Pi
segments Qi of the B-spline curve are blended
together into smooth transitions via
(the new & improved) blending functions
28 29
1994 Foley/VanDam/Finer/Huges/Phillips ICG
B-splines:
B-spline: Knot Sequences
Cox-deBoor Recursion
Even distribution of knots Cox-deBoor Algorithm: defines the blending functions for
uniform B-splines spline curves (not limited to deg 3)
Curve does not interpolate end points curves are weighted avgs of lower degree curves
first blending function not equal to 1 at t=0 Let Bi,d (t) denote the i-th blending function for a B-spline
Uneven distribution of knots of degree d, then:
non-uniform B-splines
Allows us to tie down the endpoints by repeating knot values
(in Cox-deBoor, 0/0=0!) $1, if t k t < t k +1
If a knot value is repeated, it increases the effect (weight) of the
Bk , 0 (t ) = #
blending function at that point
"0, otherwise
If knot is repeated d times, blending function converges to 1 and t tk t t
the curve interpolates the control point
Bk ,d (t ) = Bk ,d 1 (t ) + k + d +1 Bk +1,d 1 (t )
30
tk +d tk t k + d +1 t k +1 31
5
Creating a Non-Uniform
B-splines: Multiple Knots
B-spline: Knot Selection
Given curve of degree d=3, with m+1 control Knot Vector
points {0.0, 0.0, 0.0, 3.0, 4.0, 5.0, 6.0, 7.0}
32 33
Pics/Math courtesy of G. Farin @ ASU From http://devworld.apple.com/dev/techsupport/develop/issue25/schneider.html
m
p (t ) = Bi ,d (t ) pi
i =0
B-spline Summary Watching Effects 00123456789
of Knot Selection
$1, if t k t < t k +1
Bk , 0 (t ) = # 9 knot points (initially)
"0, otherwise
t tk t t Note: knots are distributed
Bk ,d (t ) = Bk ,d 1 (t ) + k + d +1 Bk +1,d 1 (t )
tk +d tk t k + d +1 t k +1 parametrically based on t,
hence why they move
10 control points
Curves have as many
segments as they have
non-zero intervals in u degree of
curve
34 35
Pics/Math courtesy of G. Farin @ ASU
36 37
1994 Foley/VanDam/Finer/Huges/Phillips ICG
Recorded from: http://heim.ifi.uio.no/~trondbre/OsloAlgApp.html
6
B-splines: Convex Hull Property B-splines: Continuity
The effect of multiple control points on a Derivatives are easy for cubics
uniform B-spline curve 3
p (u ) = u k ck
k =0
Derivative:
p!(u ) = c1 + 2c2u + 3c3u 2
Easy to show C0 , C1 , C2
39 40
1994 Foley/VanDam/Finer/Huges/Phillips ICG
Benefits of
NURBS
Rational Spline Curves
Invariant under rotation, scale, translation, Non-uniform Rational B-splines: NURBS
perspective transformations
transform just the control points, Basic idea: four dimensional non-uniform B-splines,
then regenerate the curve followed by normalization via homogeneous coordinates
(non-rationals only invariant under rotation, scale If Pi is [x, y, z, 1], results are invariant wrt perspective projection
and translation) Also, recall in Cox-deBoor, knot spacing is arbitrary
Can precisely define the conic sections and knots are close together,
influence of some control points increases
other analytic functions Duplicate knots can cause points to interpolate
conics require quadratic polynomials e.g. Knots = {0, 0, 0, 0, 1, 1, 1, 1} create a Bzier curve
conics only approximate with non-rationals
43 44
7
Rational Functions Rational Functions: Example
Cubic curve segments Example:
X (t ) Y (t ) Z (t ) rational function: a ratio of polynomials
x(t ) = , y (t ) = , z (t ) =
W (t ) W (t ) W (t ) a rational parameterization
where X (t ), Y (t ), Z (t ), W (t ) in u of a unit circle in xy-plane:
are all cubic polynomials with control
points specified in homogenous a unit circle in 3D homogeneous
coordinates, [x,y,z,w] coordinates:
Note: for 2D case, Z (t ) = 0
45 46
i =0
wi Bi ,d (u ) n 1
Where Allows us to write: C (u ) = Ri ,d (u ) Pi
i =0
control points,
d-th degree B-spline blending functions, Bi ,d (u ) Where Ri,d (u ) are rational basis functions
the weight, wi, for control point Pi piecewise rational basis functions on u [0,1]
(when all wi=1, we have a B-spline curve) 49 weights are incorporated into the basis fctns
50
8
Geometric Interpretation of
NURBS: Examples
NURBS
With Homogeneous coordinates, a rational n- Unif. Knot Vector Non-Unif. Knot Vector
D curve is represented by polynomial curve in
(n+1)-D
Homogeneous 3D control points are written
as:
in 4D where {0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0} {0.0, 1.0, 2.0, 3.75, 4.0, 4.25, 6.0, 7.0}
To get , divide by wi
a perspective transform with center at the origin
Note: weights can allow final curve shape to
go outside the convex hull (i.e. negative w) 51 52
From http://devworld.apple.com/dev/techsupport/develop/issue25/schneider.html
55 56
From http://devworld.apple.com/dev/techsupport/develop/issue25/schneider.html
9
Programming Assignment 1
Process command-line arguments
Read in 3D control points
Iterate through parameter space by du
At each u value evaluate Bezier curve
formula to produce a sequence of 3D
points
Output points by printing them to the
console as a polyline and control points
as spheres in Open Inventor format
57
10