0% found this document useful (0 votes)
47 views31 pages

Splines: D.A. Forsyth, With Slides From John Hart

Splines are curves formed by joining together smooth pieces to meet continuity constraints. B-splines are a type of spline curve defined using basis functions that provide local control over the curve. B-splines are defined recursively using blending functions that switch on and off to blend between control points. Repeated knots reduce the continuity of B-splines at those points. B-splines have useful properties like lying within the convex hull of control points.

Uploaded by

smartsmart
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
0% found this document useful (0 votes)
47 views31 pages

Splines: D.A. Forsyth, With Slides From John Hart

Splines are curves formed by joining together smooth pieces to meet continuity constraints. B-splines are a type of spline curve defined using basis functions that provide local control over the curve. B-splines are defined recursively using blending functions that switch on and off to blend between control points. Repeated knots reduce the continuity of B-splines at those points. B-splines have useful properties like lying within the convex hull of control points.

Uploaded by

smartsmart
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
You are on page 1/ 31

Splines

D.A. Forsyth, with slides from John Hart


Core ideas: Assembly, Continuity

• We “join up” pieces of curve to meet various constraints


• result is a spline
• Continuity
• Parametric
• C^k : Curve and derivatives up to k are continuous
• as a function of parameter value
• Useful for (for example) animation
• Geometric
• G^k: a reparametrisation exists that would achieve C^k
• Useful, because we often don’t require parametric continuity
• e.g. take two Hermite curves, both parametrised by [0, 1], identify
endpoints and derivatives
Simple cases

• Join up two point Hermite curves


• endpoints the same, vectors not - G^0
• endpoints, vectors the same - G^1 (easy)
• endpoints the same, vectors same direction - G^1 (harder)
• Subdivide a Bezier curve
• result is G^infinity if we reparametrize each segment as we should
• but not necessarily if we move the control points!
• Join up Bezier curves
• endpoints join - G^0
• endpoints join, end segments collinear - G^1
Cubic interpolating splines

• n+1 points P_i


• X_i(t) is curve between P_i, P_i+1
Interpolating Cubic splines, G^1

• join a series of Hermite curves with equal derivatives.


• But where are the derivative values to come from?
• Measurements

dXi 1
(0) = (1 − t)(Pi+1 − Pi−1 )
• Cardinal splines dt 2
• average points
• t is “tension”
• specify endpoint tangents
• or use difference between first two, last two points
Tension
Interpolating Cubic splines: C^2

• One parametrization for the whole curve


• divided up into intervals, called knots

• In each segment, there is a cubic curve FOR THAT SEGMENT

Ai (t − ti )3 + Bi (t − ti )2 + Ci (t − ti ) + Di

• And we must make this lot C^2


ti ≤ t < ti+1
Continuity

• at interval endpoints, curves must be


• Continuous

Xi (ti ) = Xi−1 (ti ) Xi (ti+1 ) = Xi+1 (ti+1 )


• have continuous derivative
dXi dXi−1
(ti ) = (ti )
dt dt
• have continuous second derivative

d2 Xi d2 Xi−1
2
(ti ) = 2
(ti )
dt dt
Curves

• Assume we KNOW the derivative at each point


• write derivatives with ‘

Xi (ti ) = Pi = Di
dXi
(ti ) = X�i (ti ) = P�i = Ci
dt

Xi (ti+1 ) = Pi+1 = Ai ∆t3i + Bi ∆t2i + Ci ∆ti + Di


X�i (ti+1 ) = P�i+1 = 3Ai ∆t2i + 2Bi ∆ti + Ci
Curves

� �
(t − ti ) 3
(t − ti )
2
Xi (t) = Pi 2 −3 +1 +
(∆ti ) 3 (∆ti ) 2
� �
(t − ti )3
(t − ti )2
Pi+1 −2 +3 +
(∆ti ) 3 (∆ti ) 2
� �
(t − ti )3
(t − ti )2

Pi −2 + (t − ti ) +
(∆ti ) 2 (∆ti )
� �
� (t − ti )3
(t − ti )2
P i+1 −
(∆ti ) 2 (∆ti )
C^2 Continuity supplies derivatives

• Second derivative is continuous

X�� i−1 (ti ) = Xi (ti )


• Differentiate curves, rearrange to get

∆ti P� i−1 + 2(∆ti−1 + ∆ti )P� i + ∆ti−1 P� i+1 =


∆ti−1 ∆ti
3 (Pi+1 − Pi ) + 3 (Pi − Pi−1 )
∆ti ∆ti−1

• This is a linear system in tridiagonal form


• can see as recurrence relation - we need two tangents to solve
C^2 cubic splines

• Recurrence relations
• d(n-1) equations in d(n+1) unknowns (d is dimension)
• Options:
• give P’_0, P’_1 (easiest, unnatural)
• second derivatives vanish at each end (natural spline)
• give slopes at the boundary
• vector from first to second, second last to last
• parabola through first three, last three points
• third derivative is the same at first, last knot
More general splines

• We would like to retain continuity, local control


• but drop interpolation
• Mechanism
• get clever with blending functions
• continuity of curve=continuity of blending functions
• we will need to “switch” on or off pieces of function
• e.g. linear example
B-splines

• Knot vector
t0 < t1 < . . . < tn+k

• Curve n

X(t) = Pi Ni,d (t)
k=0
• d is order
2≤d≤n+1
Recursive definition

• Switches=base case

1 ti ≤ t ≤ ti+1
Ni,1 =
0 otherwise

• Spline
� �
t − ti
Ni,d = Ni,d−1 (t) +
ti+d−1 − ti
� �
ti+d − t
Ni+1,d−1 (t)
ti+d − ti+1
These figures show
blending functions with
a uniform knot vector,
knots at 0, 1, 2, etc.
The B
Closed B-Splines

• Periodically extend the control


points and the knots

Pn+1 = P0
tn+1 = t0

• etc
A B-spline curve, with knots at 0,1,... and order 5
Repeated knots

• Definition works for repeated knots


• (if we are understanding about 0/0)
• Repeated knot reduces continuity.
• A B-spline blending function has continuity Cd-2; if the knot is repeated m
times, continuity is now Cd-m-1
• e.g. -> quadratic B-spline (i.e. order 3) with a double knot
Most useful case

• select the first d and the last d knots to be the same


• we then get the first and last points lying on the curve
• also, the curve is tangent to the first and last segment e.g. cubic case below
• Notice that a control point influences at most d parameter
intervals - local control
top curve has order 3, bottom order 4
Bezier curve is the heavy curve
B-Spline properties

• For a B-spline curve of order d


• if m knots coincide, the curve is Cd-m-1 at the corresponding point
• if d-1 points of the control polygon are collinear, then the curve is tangent
to the polygon
• if d points of the control polygon are collinear, then the curve and the
polygon have a common segment
• if d-1 points coincide, then the curve interpolates the common point and
the two adjacent sides of the polygon are tangent to the curve
• each segment of the curve lies in the convex hull of the associated d points
Recursive definition

• Switches=base case

1 ti ≤ t ≤ ti+1
Ni,1 =
0 otherwise

• Spline
� �
t − ti
Ni,d = Ni,d−1 (t) +
ti+d−1 − ti
� �
ti+d − t
Ni+1,d−1 (t)
ti+d − ti+1

You might also like