0% found this document useful (0 votes)
22 views21 pages

BSplines

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views21 pages

BSplines

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 21

B-Splines

November 2002 – Céline Loscos


B-Splines

• Polynomial curves
• Ck-1 continuity
• Cubic B-spline: C2 continuity

November 2002 – Céline Loscos


Knots
• A sequence of scalar values t1, …, t2k with titj if
ij, and ti < tj for i<j
• If ti chosen at uniform interval (such as 1,2,3, …),
than it is a uniform knot sequence

November 2002 – Céline Loscos


Control points, for k =3

• We can define a unique k-degree polynomial F(t)


with blossom f, such that
vi = f(ti+1, ti+2, …,ti+k)
• The sequence of vi for i [0,k] are the control points
of a B-spline
• Evaluation of a point on a curve with f(t,t,t)
• Remark: no control points will lie on the curve!

November 2002 – Céline Loscos


Case k=2

• Knots: t1,t2,t3,t4
• Control points
v0 = f(t1,t2) = a0 + a1 (t1+t2)/2+ a2 t1t2
v1 = f(t2,t3) = a0 + a1 (t2+t3)/2+ a2 t2t3
v2 = f(t3,t4) = a0 + a1 (t3+t4)/2+ a2 t3t4

November 2002 – Céline Loscos


Case k=3

• Knots: t1,t2,t3,t4 ,t5,t6


• Control points
v0 = f(t1,t2, t3)
v1 = f(t2,t3, t4)
v2 = f(t3,t4,t5)
v3 = f(t4,t5,t6)

November 2002 – Céline Loscos


Example

• For the knot sequence 1,2,3,4,5,6


• Control points
v0 = (0,0) = f(1,2,3)
v1 = (1,0) = f(2,3,4)
v2 = (1,1) = f(3,4,5)
v3 = (0,1) = f(4,5,6)
• Find the point on the curve for t = 3.5

November 2002 – Céline Loscos


Example
• For t = 3.5
(0,0) (1,0) (1,1) (0,1)
f(1,2,3) f(2,3,4) f(3,4,5) f(4,5,6)

(5/6,0) (1,1/2) (5/6,1)


f(3.5,2,3) f(3,4,3.5) f(4,5,3.5)

(23/24, 3/8) (23/24, 5/8)


f(3.5,3.5,3) f(3.5,3.5,4)

(23/24, 1/2)
f(3.5,3.5,3.5)
November 2002 – Céline Loscos
Definition

• Given a sequence of knots, t1,…,t2k


• For each interval [ti, ti+1], there is a kth-degree
parametric curve F(t) defined with corresponding
B-spline control points
vi-k,vi-k+1, … , vi

November 2002 – Céline Loscos


Definition
• If f() is the k-parameter blossom associated to the
curve F(t) on [ti,ti+1], then
– The control points are defined by
vj=f(tj+1, …, tj+k), j=i-k, i-k+1, …, i
– The k-th degree Bézier curve corresponding to this curve
has the control points:
pj=f(ti, ti, …, ti,ti+1,ti+1,…, ti+1) , j = 0, 1, …, k
k-j j
– The evaluation of the point on the curve at
t [ti,ti+1] is given by F(t) = f(t,t,…,t)

November 2002 – Céline Loscos


Relation between quadratic B-spline and B ézier curve

• k=2, limit on the ith interval, t [ti,ti+1]


• For the quadratic Bézier curve corresponding:
P0 = f(ti , ti) P1=f(ti , ti+1 ) P2=f(ti+1 , ti+1 )
• For the B-Spline:
vi-2 = f(ti-1 , ti) vi-1 = f(ti, ti+1 ) vi = f(ti+1 , ti+2 )
• And the interpolation:

ti+1 - ti ti – ti-1
f (ti , ti ) = vi-2 + vi-1
ti+1 – ti-1 ti+1 – ti-1
ti+2 – ti+1 ti+1 – ti
f (ti+1 , ti+1 ) = vi-1 + vi
ti+2 – ti ti+2 – ti
November 2002 – Céline Loscos
B-splines or Bézier curves?

• Bézier curves are B-splines!


• But the control points are different
• You can find the Bézier control points from the B-
spline control points
• In the case of a quadratic B-spline:
P0 is an interpolation between vi-2 and vi-1,
P1 = vi-1
P2 is an interpolation between vi-1 and vi
November 2002 – Céline Loscos
Relation between
3rd-degree Bézier curves and B-splines

• Constructing Bézier points from B-spline points


vj-3 vj-2 vj-1 vj
f(tj-2, tj-1, tj) f(tj-1, tj, tj+1) f(tj, tj+1, tj+2) f(tj+1, tj+2, tj+3)

P1 P2
f(tj-1, tj, tj) f(tj, tj, tj+1) f(tj, tj+1, tj+1) f(tj+1, tj+1, tj+2)

P0 P3
f(tj, tj, tj) f(tj+1, tj+1, tj+1)

November 2002 – Céline Loscos


Computation – De Boor algorithm

• Problem: computing a point on the B-spline for t [ti, ti+1]


P0i-3 (t) = vi-3 P0i-2 (t) = vi-2 P0i-1 (t) = vi-1 P0i (t) = vi
f(ti-2, ti-1, ti) f(ti-1, ti, ti+1) f(ti, ti+1, ti+2) f(ti+1, ti+2, ti+3)

P1i-3 (t) P1i-2(t) P1i-1 (t)


f(ti-1, ti, t) f(ti, ti+1, t) f(ti+1, ti+2, t)

P2i-3 (t) P2i-2 (t)


f(ti, t, t) f(ti+1, tj+1, tj+1)

P3i-3 (t)
f(t, t, t)
November 2002 – Céline Loscos
De Boor algorithm

• Recursion formula:
Pj0 (t ) v j , j i  k , i  k  1,..., i
 t k 1 j  t  r  1  t  tr  j  r  1
Pjr (t )   Pj (t )    Pj 1 (t ), r 1,2,..., k , j i  k , i  k  1,..., i  r
t  t 
 k 1 j  t r  j   k 1 j  t r  j 

• The required point on the curves is k


P (t )
i k

November 2002 – Céline Loscos


Remarks for cubic B-splines
• For control points v0, v1, …, vn, the required knot
sequence is t1, t2, …, tn+3
• The curve is defined over the range t [t3, tn+1]
• There will be n-2 curve segments altogether,
since each interval [ti, ti+1], i=3, 4, …, n defines a
curve segment

November 2002 – Céline Loscos


Knot insertion

• Inserting new knots in the sequence while


maintaining the B-spline curves can be used for
– Rendering
– Adding greater flexibility to the curve shape

November 2002 – Céline Loscos


B-spline basis

• For a kth degree B-spline


n
F (t )  N k ,i (t )vi
i 0

• Where the basis functions are


1 if t  [t i , t i 1 ]
N 0,i (t ) 
0 otherwise
 t  ti   ti r 1  ti 

N r ,i (t )  
 N r  1,i (t )    N r  1,i 1 (t ) , t  [t i , t i r 1 ]
 ti  r  ti   ti r 1  ti 1 
November 2002 – Céline Loscos
B-spline basis

• For k =1, vi = f(ti+1), vi-1 = f(ti), and the segment


t[ti,ti+1]
ti+1 - t t – ti
F(t) = f (t) = vi-1 + vi
ti+1 – ti ti+1 – ti

• For k =1, vi = f(ti+1), vi+1 = f(ti+2), and the segment


t[ti+1,ti+2]
ti+2 – t t– ti+1
F(t) = f (t) = vi + vi+1
ti+2 – ti+1 ti+2 – ti+1

November 2002 – Céline Loscos


B-spline basis

• Then

 t  ti   ti  2  ti 
N1,i (t )   N 0,i (t )    N 0,i 1 (t ) , t  [t i , t i 2 ]
 ti 1  ti   ti 2  ti 1 

November 2002 – Céline Loscos


Advantages of B-splines over Bézier curves

• The convex hull based on m control points is


smaller than for Bézier curve
• There is a better local control
• The control points give a better idea of the shape
of the curve

November 2002 – Céline Loscos

You might also like