13.07.2015 Views

analytic definition of a b-spline curve - IDAV: Institute for Data ...

analytic definition of a b-spline curve - IDAV: Institute for Data ...

analytic definition of a b-spline curve - IDAV: Institute for Data ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Geometric Modeling NotesANALYTIC DEFINITION OF A B-SPLINE CURVEKenneth I. Joy<strong>Institute</strong> <strong>for</strong> <strong>Data</strong> Analysis and VisualizationDepartment <strong>of</strong> Computer ScienceUniversity <strong>of</strong> Cali<strong>for</strong>nia, DavisOverviewSo, what will the <strong>analytic</strong> <strong>definition</strong> <strong>of</strong> the B-<strong>spline</strong> <strong>curve</strong> look like? The real question is whatwill the blending functions look like? Whereas the Bézier blending functions were the BernsteinPolynomials, which are extremely elegant and well-known, the B-<strong>spline</strong> blending functions are alittle messy. Here, we define the normalized B-<strong>spline</strong> blending functions N i,k (t), which enable usto write down an <strong>analytic</strong> <strong>definition</strong> <strong>of</strong> the B-<strong>spline</strong> <strong>curve</strong>.The B-Spline Curve – Analytical DefinitionA B-<strong>spline</strong> <strong>curve</strong> P(t), is defined bywhereP(t) =n∑P i N i,k (t) (1)i=0• the {P 0 , P 1 , ..., P n } are the control points,• k is the order <strong>of</strong> the polynomial segments <strong>of</strong> the B-<strong>spline</strong> <strong>curve</strong>. Order k means that the<strong>curve</strong> is made up <strong>of</strong> piecewise polynomial segments <strong>of</strong> degree k − 1 – e.g., order 3 meansquadratic polynomial segments, and order 4 means cubic polynomial segments.• the N i,k (t) are the “normalized B-<strong>spline</strong> blending functions”. They are described by the orderk and by the knot sequence{t 0 , t 1 , t 2 , ..., t n+k } .


The N i,k (t) functions are described as follows⎧⎨1 if t ∈ [t i , t i+1 ),N i,1 (t) =⎩0 otherwise.(2)and if k > 1,N i,k (t) =t − t iN i,k−1 (t) +t i+k − tN i+1,k−1 (t) (3)t i+k−1 − t i t i+k − t i+1• and t ∈ [t k−1 , t n+1 ).This looks pretty complex, and it is “subscript-wise,” especially with Equation (3). It turns outthat the <strong>analytic</strong> <strong>definition</strong> <strong>of</strong> the B-<strong>spline</strong> <strong>curve</strong> is somewhat more complex than the geometric<strong>definition</strong>. However the <strong>analytic</strong> <strong>definition</strong> came first (<strong>for</strong> me, in a paper from 1949), and the geometric<strong>definition</strong> came later, from two researchers Carl DeBoor and Cox, working independently,in 1972. The DeBoor-Cox calculation started from the <strong>analytic</strong> <strong>definition</strong>, and derived the geometric<strong>definition</strong>, and we will use this method to show the equivalency <strong>of</strong> the geometric and <strong>analytic</strong><strong>definition</strong>s.First, some bookkeeping...• There is some ambiguity in the <strong>definition</strong>s <strong>of</strong> the N .,. (t) blending functions. By defining themin a “recursive” manner. We must insure that in Equation (3), that if either <strong>of</strong> the N .,. termson the right hand side <strong>of</strong> the equation are zero, or the subscripts are out <strong>of</strong> the range <strong>of</strong> thesummation limits, then the associated fraction is not evaluated and the term becomes zero.This is to avoid a zero-over-zero evaluation problem.• We also note the “closed-open” interval [t k−1 , t n+1 ), which avoids some ambibuity whent = t n+1 .• The order k is independent <strong>of</strong> the number <strong>of</strong> control points (n + 1). With the Bézier <strong>curve</strong>,k = n, but in the B-Spline <strong>curve</strong> we have the flexibility <strong>of</strong> using many control points, andrestricting the degree <strong>of</strong> the polynomial segments that we piece together to make the final<strong>curve</strong>.2


It is also worthwhile to examine the blending functions carefully. Since they blend the control pointstogether, and B-<strong>spline</strong>s are piecewise <strong>curve</strong>s, we can conclude that the blending functions N i,k (t)must be non-zero only <strong>for</strong> a few values <strong>of</strong> i. This is easiest to see by “drawing” a few pyramids –math pyramids.If we draw the following dependency pyramid using Equation 3, [where various N .,. (t) functionsin the pyramid are a weighted sum <strong>of</strong> the two N .,. (t) functions immediately to its right]:N i,k (t)N i,k−1 (t)N i+1,k−1 (t)N i,1 (t)N i,2 (t). N i+1,1 (t). .. .N i,k−2 (t) .N i+1,k−2 (t)N i+2,k−2 (t) .. .. .. N i+k−2,1 (t)N i+k−1,2 (t)N i+k−1,1 (t)We can see that N i,k (t) (at the far left) eventually depends on N i,1 (t), N i+1,1 (t), ..., andN i+k−1,1 (t) (at the far right), and so we can conclude that N i,k (t) ≠ 0 only if t ∈ [t i , t i+k ). [Becauseif t ∉ [t i , t i+k ), then N i,1 (t), N i+1,1 (t), ..., and N i+k−1,1 (t) would all be zero).For each value <strong>of</strong> t, only a limited number <strong>of</strong> the N i,k (t) are non-zero.This can be seen by3


organizing a different pyramid. If t ∈ [t l , t k+1 ) then we can arrange the following pyramid.N l,1 (t)N l,2 (t)N l−1,2 (t)N l,k (t)N l−1,k−1 (t). N l−1,k (t). .. .N l,3 (t) .N l−1,3 (t)N l−2,3 (t) .. .. .. N l−k+2,k (t)N l−k+1,k−1 (t)N l−k+1,k (t)Here, the fact that N l,1 (t) ≠ 0 implies that N l,2 (t) ≠ 0 and N l−1,2 (t) ≠ 0 (the two blending functionsimmediately to its right in the pyramid) are also non-zero immediately to its right. And, in general,if N i,j (t) ≠ 0 implies that N i,j−1 (t) ≠ 0 and N i−1,j−1 (t) ≠ 0 in the pyramid. From this, we canconclude that if t ∈ [t l , t l+1 ), then only N l−k+1,k , N l−k+2,k , ..., and N l,k are non-zero. For example,N l−1,k (t) = N l−k,k (t) = 0.So, if t ∈ [t l , t l+1 ), only k <strong>of</strong> the N .,. functions are non-zero, and so only k <strong>of</strong> the control pointsP l−k+1 , P l−k+2 , ..., and P l affect the point P(t) on the <strong>curve</strong>. This makes sense, as a B-<strong>spline</strong><strong>curve</strong> is a piecewise polynomial <strong>curve</strong>, and only a few control points should affect eachpolynomial piece.So, if t ∈ [t l , t l+1 ), then we can rewrite Equation (1) to bel∑P(t) = P i N i,k (t) (4)i=l−k+1limiting the number <strong>of</strong> elements that must be considered in the sum – only k elements need to beconsidered.4


All contents copyright (c) 1997-2013Computer Science Department, University <strong>of</strong> Cali<strong>for</strong>nia, DavisAll rights reserved.5

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!