4. B-Splines¶
Bases Spline
See also
4.1. Normalized B-spline base function¶
Let consider the values \(u_i \in \mathbb{R}, i \in \mathbb{Z}\), which fulfils \(u_i \leq u_{i+1}\)! We can define the B-spline base function in the following form:
The \(\{u_i\}_{i \in \mathbb{Z}}\) values are the knot values.
Its components results the knot vector.
We define the result of zero division as 0 when it can occur.
\(\rhd\) Let write the second and third order B-spline base functions!
For the determination of the values \(u_i\) we can use uniform parametrization, for example \(u_i = i\).
The curve with the same degree can be derived from each others by translation:
Note
The B-spline base function of order \(k\) contains (at most) \((k-1)\) degree polynomials.
The base function \(N_i^k\) can be non-zero only on the interval \((u_i, u_{i+k})\).
Let consider the interval \([u_i, u_{i+1})\)! It has effect to the base functions \(N_j^k\), where \((i - k + 1) \leq j \leq i\).
4.1.1. Theorem of local support¶
Proof (induction)
In the case of \(k = 1\) the statement is true by definition.
Let substitute the value \((k-1)\) and let consider that
When \(u \notin [u_i, u_{i+k})\) we have to calculate the linear combination of them (in the function of \(u\)), which guarantees that its value must be 0. \(\square\)
4.1.2. Theory of non-negativity¶
The normalized B-spline base functions are non-negate, in other words
4.1.3. Theorem of partition of unity¶
The sum of the normalized B-spline base functions are 1 at any point in the defined domain:
4.1.4. Multiple knot values¶
The definition makes possible to use the same \(u_i\) knot values multiple times. Let consider its effect in the case of degree 3 B-spline base function!
We can write the normalized B-spline base function of degree 3 as
For instance, let assume that \(u_{i+1} = u_{i+2}\)! We get the following:
We can imagine this operation as a translation of \(u_{i+1}\) to the point \(u_{i+2}\). The base function remains continuous at that point, however it will not remain differentiable at that point.
We can define the coincide of consecutive knot values as the multiplicity of the knots.
The multiplicity of a knot value is \(m\), when there are \(m\) same consecutive knot values.
4.1.5. Relation with the Bernstein polynomials¶
In the case of
then
4.1.7. Derivative¶
The derivative of the normalized B-spline base function \(N_i^k(u)\):
where \([u_i, u_{i+k})\).
4.1.8. Linear independence¶
Normalized B-spline functions \(\{N_j^k\}_{j=i-k+1}^i\) are linearly independent on the interval \([u_i, u_{i+1})\), if \(u_i < u_{i+1}\).
4.2. B-spline curve¶
Let given the control points \(\textbf{d}_0, \textbf{d}_1, \ldots, \textbf{d}_n\) and the \(\{u_j\}_{j=0}^{n+k}\) knot values! We call the curve
the order of \(k\) (in other words the degree \((k-1)\)) B-spline curve.
The points \(\textbf{d}_i\) are the control points (or de Boor points).
The \(N_i^k\) denotes the normalized B-spline polynomial of degree \((k-1)\).
The B-spline curve is an approximative curve in general. There can be for example the following cases:
When \(k = 2\), it results the control polygon.
It passes the control points when the control points are colinear.
When the multiplicity at the endpoints is \(k\), then it interpolates at the given point.
Note
It is easy to see the last one. Let assume, that \(u_1 = u_2 = \cdots = u_{k-1}\)! We can call the point of the curve at the parameter \(u_{k-1}\) as
We know that \(N_i^k(u_{k-1}) = 0\), when \(i \in [1, k-2]\). By using the theorem \(N_0^k(u_{k-1}) = 1\), we obtain that
Similarly, we can conclude that the curve also will interpolate at the point \(\textbf{d}_n\) for the proper multiplicity.
4.2.1. Properties of the curve¶
Local modification: The B-spline curve is locally modifiable. It means that, the modification of the control points only affects a well defined part of the curve.
Convex hull property: Any arc of the B-spline curve of degree \((k - 1)\) is within the convex hull of \(k\) number of consecutive control points.
4.2.2. de Boor algorithm¶
The de Boor algorithm is based on a recursive method similarly to the de Casteljau algorithm, which makes possible to calculate the point of the curve at parameter \(u\). It is a numerically stable algorithm.
Let introduce the following notations:
where
The value \(l\) at the top right corner denotes the iteration number. We calculate the subdivision points based on \(\alpha\) ratios.
In the steps \(l < (k - 1)\):
when \(l = (k - 1)\):
because
The algorithm is similar to the de Casteljau algorithm, however there are some key differences.
We do not apply subdivision in the ratio \(u:(1-u)\).
The calculation of a point does not make necessary to use all of the control points. (It is the reason of the locally modifiable property.)
We cannot use the algorithm for splitting the curve.
4.2.3. Derivative of the curve¶
The derivative of the B-spline curve when \(u \in [u_i, u_{i+1})\):
It means that, the hodograph of a B-spline curve of degree \((k - 1)\) is also a B-spline curve of degree \((k - 2)\).
We can express the derivative based on the subdivision points of the de Boor algorithm:
4.3. Theoretical questions¶
How can we define the normalized B-spline base function?
Let write the theorem of local support in the case of normalized B-spline base function!
Let write the theorem of non-negativity in the case of normalized B-spline base function!
Let write the theorem of partition of unity in the case of normalized B-spline base function!
Let define the B-spline curve!
What are the properties of the B-spline curves?
4.4. Programming exercises¶
4.4.1. Visualization and analysis of the curve¶
Let implement an application which is able to visualize a B-spline curve for 8 control points!
Let make possible to set the degree of the curve!
Let highlight the modifiable part of the curve while the user move a control point!
Let make possible to set the multiplicity of the points!
Let highlight the corresponding curve segments and their theoretical convex hulls (for example by toggling the segments of the curve)!
Let implement the de Boor algorithm!
Let calculate and visualize the tangent and normal vector at the given point of the curve!
4.4.2. Available implementations¶
Let check the available implementations of the B-spline curves, for instance:
4.5. Further exercises¶
Let implement the interpolation by using B-spline curves!
Let approximate the set of points by using B-spline curve of degree \(k\)! (We assume a large number of sample points, which means that we cannot use them as control points.)
Let examine and compare the algorithms (in the assumption of the same graphic quality) from the aspect of the number of required line segments!
Let determine the self-intersection points of a B-spline curve!
Let approximate the area of a closed B-spline curve!
Let develope an algorithm which able to approximate a larger degree B-spline curve with a lower degree one! Let examine the accuracy!