Knot Placement for B-Spline Curve Approximation 1 - PRISM

Knot Placement for B-Spline Curve Approximation
Anshuman Razdan
Technical Director, PRISM
Mail Code 5106
Arizona State University, Tempe AZ 85287-5106
Email: [email protected]
Phone: (480) 965 5368 Fax: (480) 965 2910
December 22, 1999
Abstract
Curve approximation still remains one of the dicult problems in CAD and CAGD. One of
the key questions in this area is to pick a reasonable number of points from the original curve
which can be interpolated with a parametric curve. This paper highlights the use of arc length
and curvature characteristics of the given curve to extract the interpolation points. An algorithm
is also provided to heuristically pre-determine the minimum number of points required to get a
good approximation for a B-spline curve. Keywords: NURB, Curve, Approximation Runnning
Title: Knot Placement for NURB Curve Approximation
1 Introduction
B-spline curves are used to solve curve tting problems i.e. where a sequence (or an array) of
points is given and then one wants to nd a NURB curve that interpolates to the given data. This
is also applicable when a given curve needs a NURB representation because either the input is not
a NURB entity or is a poorly parametrized NURB representation [13]. Typically, the following
steps are performed to approximate a given curve by a rational or non rational B Spline cubic1
curve.
1. Pick appropriate points on the given curve. This set of points becomes the set that the
interpolating curve will pass through.
1 The cubic is the smallest degree needed to describe a space curve.
1
2 ASSUMPTIONS AND GOALS
2
2. Choose a parametrization.
3. Select end conditions.
4. Solve the tri-diagonal linear systems of equations [3].
This paper describes some techniques to help select the set of interpolation points based on
geometric characteristics of the given curve.
2 Assumptions and Goals
We start with the following assumptions:
1. We are given a (rational) parametric curve.
2. The given curve can be evaluated at arbitrary discrete values within the parameter range.
The following goals are to be achieved:
1. Closely approximate the given curve with a C 2 cubic B-spline2 curve.
2. Use chordlength parameterization3
3 Curve Approximation
One can compute many (a large number) points on the given curve and then ask for a curve
through them. A cubic spline interpolant is one possibility. However, it would have too many
segments. So a smaller set of data points out of the larger set could be used as an input (how this
selection may be done is described later). After computation of the interpolant to the reduced
data set we would check if the discarded set of points is within a tolerance. This is expensive,
and a better approach is one that makes sure that all data points are as close as possible to the
given curve.
Assume that we are given data points pi with i = 0; ; P . We wish to nd an approximating
B-spline curve p(u) of degree n (n = 3 here) with L domain knots, i.e., with a knot sequence
2 A NURB if the points on the given curve have weights associated with them.
3 We chose chord length parametrization since our application imposed this restriction.
4 RELATED WORK
3
u0 ; ; uL+2n,2 . Suppose the data point pi is associated with a data parameter value ti 4 . Then
we would like the distances kpi , p(ti )k2 to be small. Attempting to minimize all such distances
then gives:
minimize
P
X
jjp , p(t )jj2
i=0
i
(1)
i
This is known as least squares approximation. We can nd the suitable B-spline control vertices
dj :
minimize f (d0 ; ; dL+n,1
2
P
L+X
n,1
X
n
) = jjp ,
d N (t )jj
i=0
i
j =0
j j i
(2)
This further transforms to a linear system of L + n equations for the unknowns dj , with a
coecient matrix M whose elements mj;k are given by:
mj;k =
XP N n(t )N n(t );
i=0
j i
k i
0 j; k L + n:
(3)
These equations are usually called normal equations. The symmetric matrix M , although containing many zero entries, is often ill-conditioned { special equation solvers, such as a Cholesky
decomposition, should be employed. In general, the least squares approximation may not interpolate to any point on the given curve. However, it will be close. The other choice is to use
interpolating piecewise rational B-splines. to a reduced data set. Solving the system for least
squares is computationally more time consuming than solving the linear system for interpolating
B-splines.
4 Related Work
We look at some of the related research in the area of reparametrization and curve approximation
using piecewise polynomials.
Crampin et al. [2] give an algorithm to transmit a curve by sending discrete points from the
original curve, such that the curve can be regenerated at the other end. It is based on the notion
that to interpolate a curve eectively, few points should be placed where the radius of curvature
is large, but many where it is small. Although not using any of the results directly from this
4 ti does not have to be one of the knots.
5 FINDING INTERPOLATION POINTS
4
work, the underlying idea of using curvature information is incorporated in approximating the
given curve.
Kim [10] has attempted to come up with knot placement for NURB interpolation. He plots
the distance between the interpolation points as a monotonically increasing function f (s) over
a parametrization. The parametrization is obtained from one of the several methods. The
function can be piecewise linear, piecewise rational quadratic, or piecewise linear rational B-spline
interpolation. Knot placement is done by dividing the function space into an equal number of
segments and projecting the division on to the parametric space. This is then used for determining
the parametrization. The number of interpolation points is given or predetermined.
Other references include Schneider's [14] use of rational B-spline curves to approximate discrete data. A similar approach is taken in [11]. Pratt et. al. [12] performed rational least squares
curve approximation by orthogonal polynomials. Wolters [15] provides approximation solution
for G2 splines. Holzle [8] also presents a method for approximation of curves.
5 Finding Interpolation Points
One method of nding the interpolation points is to sample the curve at equal intervals (in the
domain or range). As we will see later, this does not always work best in some cases. However,
if we sample some key points that reect certain characteristics of the curve, such as curvature,
then it may be possible to approximate the curve using a reasonable number of points. We use
piecewise cubic B-spline as our choice for the curve approximation mechanism.
We would like to solve the problem as follows:
1. Estimate the number m interpolation points needed.
2. Find interpolation points on the given curve5 .
3. Pass a C 2 interpolating B-spline curve through these points .
At this time, however, we do not know:
1. number of points required to interpolate.
2. knot sequence or parametrization to solve the interpolation problem.
5 while keeping such points to a reasonable number.
6 ESTIMATING THE NUMBER OF INTERPOLATION POINTS
5
Figure 1: Approximating a curve with circular arc segments.
6 Estimating the Number of Interpolation Points
How to automatically determine the number of points required to interpolate with a
given tolerance?
We take the following approach:
If the curve has zero arc length6 then the curve is degenerate and therefore is not considered.
If the curve has zero curvature, i.e. , a straight line, we force the number of interpolation
points to four7 , equally spaced (in length) on the curve.
Else, if the curve c(u), has non-zero curvature we want to determine how many circular arc
segments (m) would it take to approximate c(u), given that each arc A^ may subtend a maximum
angle max . Then m + 1 is our estimated number of interpolation points needed.
Figure 1 shows an osculating circle traveling along the length of the curve. Since the radius
of curvature of the curve changes we change the radius of the circle (keeping it the same as the
radius of the curve at the point of contact) as it traverses the curve. At any given point some
portion of the circle is within tolerance of a portion of the curve. Thus, we can say that the given
curve can be approximated by a nite number of circular arc segments. We are interested in the
number of radii changes the circle has to make as it traverses the curve.
The following is quoted from [5].
Ahlberg, Nilson and Walsh [1] quote results concerning the approximation of the unit
6 See Section 7 for discussion on arc length and curvature characteristics of a curve.
7 A cubic can be uniquely determined by four points and corresponding parameter values that lie on it.
6 ESTIMATING THE NUMBER OF INTERPOLATION POINTS
6
No. of spans
jrj
4
<0.01
8
0.00112
12
0.000165
Table 1:
A
L
θ
H
O
C
R
Figure 2: Division of circle to get requisite ratio of chord length C to arc length A.
circle, using chord length parametrization of periodic cubic splines x(u) and y(u). A
periodic spline is one for which the value of the rst two derivatives are matched at
the end points, in which case no additional end conditions are needed. With data
points equidistantly spaced on the circle's periphery, the error bounds (r) on the
radius were found to be as in Table 1.
If we divide the circumference of a circle into eight segments, each segment subtends an angle
of 45 . Consider Figure 2. From basic trignometry the following relations hold:
A : Arc length of the segment. A = 2 R
C : Chord length of the segment. C = 2 R sin
O : Center of the circle.
H : Distance from center to the segment.
: Half the angle subtended by the segment. = Angle
2
L : L = R(1 , cos )
6 ESTIMATING THE NUMBER OF INTERPOLATION POINTS
7
1.03
1.025
1.02
0 1.015
1.01
1.005
1
0
0.05
0.1
0.15
0.2
0.25
(rad)
0.3
Figure 3: Plot of 0 = sin( ) vs 0.35
0.4
0.45
6 ESTIMATING THE NUMBER OF INTERPOLATION POINTS
8
The ratio of arc length to chord length is:
Arclength = A = 0 = Chordlength
C sin (4)
For radius R unity, L is a function of . It is easily observed that for
lim L() = 0
L!0
i.e. , as the approximating segment approaches the circle, the segments get smaller and smaller.
Figure 3 plots the angle vs. 0. If we were to use 0 = 1:01, the angle subtended would be 28 .
Typically, the number of interpolation points go up by a factor of 1.5 when 0 goes from 1.02 to
1.01.8 Since additional factors come into play that typically raise the number of interpolation
points, we have preferred to use 0 = 1:02.
It is better to express the angle subtended in terms of the ratio of arc length to chord length
as those gures are readily available in our implementation. Let us assume for the moment that
we have the table of arc length (discretized chord length sampled on the given curve) available
to us. The algorithm is as follows:
1. Start from one end of the curve.9 Let n be the number of interpolation points. Set n = 0.
2. Mark this as the start point. Traverse towards the other end of the curve and
(a) Compute the ratio 0 of arc length to chord length from the start point to current
point.
(b) if 0 > 1:02, mark current point as interpolation point.
Set n = n + 1.
Goto 2.
(c) else continue to next sampled point on the curve.
At the end of above process we have an estimate n. We call this algorithm the ENP (Estimating
Number of Points) algorithm.
8 In our test cases.
9 Depending on the curve it may matter which end you pick.
7 CHARACTERISTICS OF A CURVE
9
Figure 4: Example curve (Ex-1.1).
7 Characteristics of a Curve
We are interested in two characteristics of a given curve (an example is Figure 4). One is its
arc length distribution (Equation 6) and second is the curvature (Equation 7) distribution with
respect to the parametrization over its entire domain. The reason for choosing these two is
explained in 8.2. In general, let the given input space curve of degree n be dened as:
PL+n,1widiN n(u)
s(u) = Pi=0L+n,1w N ni(u) ;
i
i=0
i
di 2 IE 3 :
(5)
where di are the control points and wi are the corresponding weights and Ni is the B-spline basis,
L is the number of piecewise curve segments and u is the knot sequence. See [3] and [4] for the
notations and detail explanation.
The arc length can be estimated by summing up distances between evaluated points on the
curve. If the curve is discretized densely enough then the sum of chord length distances between
the sampled points approximately equals the arc length of the curve. An example of distribution
of arc length of the curve in Figure 4 with respect to the its parametrization ui is shown in
Figure 5. If a curve is sampled at k points, then the arc length can be approximated by:
=
X ks(u ) , s(u )k
i+1
i
k,1
i=0
(6)
7 CHARACTERISTICS OF A CURVE
10
14
12
10
Arc length
8
6
4
2
0
0
0.2
0.4
0.6
Parameter values (ui )
0.8
Figure 5: Arc length distribution plot for the curve in Figure 4.
1
7 CHARACTERISTICS OF A CURVE
11
180
160
140
120
100
Curvature
80
60
40
20
0
0
0.2
0.4
0.6
Parameter values (ti )
0.8
1
Figure 6: Curvature () plot of the curve in Figure 4. We plot the positive curvature of the space
curves.
8 KNOT SELECTION
12
Curve
Control Points
Figure 7: Example curve (Ex- 1.2) to be approximated using arc length distribution
Curvature is the signature of a curve. Given a curvature plot (if the curve is parametrized
w.r.t. its arc length), the original curve can be recovered modulo ane transformation. Therefore,
it plays an extremely important role in capturing the essence of the given curve. Curvature of a curve depends on the rst and second derivatives of the curve at a point on the curve.
Although the derivatives are dependent on the parametrization, curvature itself is independent
of the underlying parametrization. The curvature (u) of a curve is given by:
(u) = k s k(us)0 (^u)s k(3u) k :
0
00
(7)
For space curves, curvature is always a positive value. For plane curves curvature is a signed
value. Every crossover of sign in the curvature value represents an inection point in the planar
curve. Figure 6 shows the curvature plot for the curve shown in Figure 4.
8 Knot Selection
Now that we have an estimate of the number of points (given by ENP algorithm) needed for
interpolating the curve, we need to nd the interpolation points on the given curve. We will use
the arc length and curvature.
8.1 Interpolation Points Selection Based on Arc Length
Let us ignore the curvature characteristics of the curve and focus only on the arc length. We
place the knots based on the arc length distribution of the curve. To illustrate this, we use the
curve in Figure 7. Figure 8 shows its arc length distribution. We have used a simple case to
illustrate the use of arc length in nding interpolation points.
8 KNOT SELECTION
1.2
1
0.8
Arc length 0.6
0.4
0.2
0
0
13
0.2
0.4
0.6
Parameter values (ti )
0.8
1
0.8
1
Figure 8: Arc length distribution of curve in Figure 7
1.2
1
0.8
Arc length 0.6
0.4
0.2
0
0
0.2
0.4
0.6
Parameter values (ti )
Figure 9: Knot placement based on arc length of curve in Figure 7
3
3
Approximation
Original
Interpolation Points 3
3
Figure 10: Approximation of the curve in Figure 7 superimposed on the original. The approximation used knot placement based on arc length only.
3
8 KNOT SELECTION
14
Figure 11: Example curve (Ex-1.2).
We have a plot of (ti ). Although we could have plotted the discretized arc length with an
interpolating piecewise cubic or a piecewise quadratic polynomial10 the results would not have
been much dierent due to high density of points sampled. Using a piecewise linear function
suces just as well. Without any other input, the easiest way of placing the knots on this curve
would be to divide (un ) , (u0 ) in to an equal number (m , 1) of segments, where m is estimated
from Section 6. In this case m = 4. In order to do this (Refer to Figure 9) the arc length axis is
divided into three segments. Projections from the vertical axis are placed on the arc length plot
and points of intersections are computed. Further projections of intersection points are made
on the parameter axis. This gives us the parameter values ui at which the curve s(u) should be
evaluated to get the interpolation points. The s(ui ) then divide the given curve into equal arc
length segments. Points evaluated at these knots on the given curve become the interpolation
points for the approximation. The knots selected using this mechanism and the interpolation
curve through these knots (the approximation) are shown in Figure 10.
Since points on the given curve are picked solely on the basis of arc length, it is possible
that curvature information is not captured. An interpolant to these points will suer from error.
This is illustrated by approximating the curve in Figure 11. Figure 12 shows the arc length
distribution and also the interpolation point selection based on arc length only. Figure 13 shows
10 Refer to [6], and [7].
8 KNOT SELECTION
15
7
6
5
Arc length
4
3
2
1
0
0
0.2
0.4
0.6
Parameter values (ti )
0.8
1
Figure 12: Interpolation point placement based on arc length distribution for curve in Figure 11.
8 KNOT SELECTION
16
Approximation
Original
Figure 13: Curve in Figure 11 superimposed on its approximation illustrating using arc length
for selecting interpolation points can result in loss of curvature information.
8 KNOT SELECTION
17
the approximation of the curve along with the original curve. It is clear that using arc length
alone is not enough as it misses regions of high curvature.
8.2 Interpolation Points Selection Using Curvature Distribution
We state the Existence and Uniqueness theorems for curves from [9], which are fundamental in
the local theory of curves.
Theorem 1 (Existence Theorem) Given a function (s) > 0 and a continuous function ; s 2
I = [a; b]; there exists a C 3 regular curve x : I ! IE 3 such that s is arc length, (s) is the
curvature, and is the torsion of the curve x.
Theorem 2 (Uniqueness Theorem) If there is a bijection between two curves such that the
two curves have the same values of s, and at corresponding points, respectively, the bijection is
an orientation preserving isometry, and in this case the two curves are said to be congruent.
We look at the curvature distribution of the curve as an indicator for positioning the interpolation points on the curve. The points of low curvature are less critical than points of high
curvature. We want to achieve the following. (Refer to Theorem 2.) If s(u) is a parametric curve with parametrization, fu0 ; ; un g and ^s(u) is its approximation with parametrization
fu^0 : ; u^m g, then (ignoring torsion) we can say that to recapture the curve we want for every
point s(ui ) on the curve, the corresponding point s(^uj ) on the approximated curve to have the
same curvature, considering that the approximation is within the tolerance as regards to the arc
length of the curve:
s(u) = s(^u) $ (ui ) = ^(^ui)
i = 0; ; n
(8)
It is now desired to elicit information from the curvature plot to nd where the curvature is
changing the most. This is done as follows. The curvature plot itself provides valuable answers
to the human eye. Algorithmically, we look at another representation of the curvature plot, i.e.
R
the curvature vs. parametrization (ui ) plot in Figure 14. The integral of the curvature plot
represents the area under the curvature plot of the curve. The curvature axis of the curvature
R
plot , is divided equally into m segments, where m is the number of points to be interpolated
(from ENP algorithm). Horizontal lines are drawn from the y-axis to the plot and intersections
computed. These intersections are then projected down on the parameter axis to nd the parameter values at which curvature changes most radically in the curve. This tells which key points on
8 KNOT SELECTION
18
6
5
4
Curvature 3
2
1
0
0
0.2
0.4
0.6
Parameter values (ti )
0.8
1
0
0.2
0.4
0.6
Parameter values (ti )
0.8
1
120
100
80
R
60
40
20
0
R
Figure 14: and plots of curve in Figure 11. The interpolation point placement is based on
curvature distribution.
8 KNOT SELECTION
19
3
Approximation
Original
Interpolation Points 3
3
3
3
33
3
3
3
3
3
33
Figure 15: Curve in Figure 11 superimposed on its approximation. Interpolation points were
selected based on curvature distribution.
8 KNOT SELECTION
20
Figure 16: Example curve (Ex-1.3)
the boundary curve need to be interpolated to preserve curvature distribution from the original
curve. The set of interpolation points derived from this method is more representative (Figure 15)
of the curve rather than the set derived purely from the arc length distribution.
8.3 Sharp Bends in Curvature
Integration of any function is a smoothing process. If there were sharp bends in the original
R
function, the integral will absorb them and smooth them out. This is illustrated in Figure 16
R
with and plots in Figure 18. Refer to the curvature plot. At u = 0:6600, the curvature
increases sharply. This is also evident in the corresponding integral plot of the curvature. The
neighborhood around this point on the curve should have been a candidate for selection as an
interpolation point to capture this aspect of the curve. However, since the curvature jump is not
R
signicant enough, it does not qualify when the plot is divided. Again, simply increasing the
R
number of interpolation pints and therefore the number of divisions of the plot would not
guarantee that this point is included in the list of interpolation points. This poses a problem in
the method described above as is evident in Figure 19. Therefore, it is possible to leave out some
key points on the curve which should have been interpolated. We must then take into account
the sharp deviations in the curvature plot and not magnitude (of curvature) alone while selecting
interpolation points.
8 KNOT SELECTION
21
18
16
14
12
Arc length
10
8
6
4
2
0
0
0.1
0.2
0.3
0.4 0.5 0.6 0.7
Parameter values (ui )
0.8
0.9
1
Figure 17: Arc length distribution and knot placement for curve in Figure 16
8 KNOT SELECTION
22
0.6
0.5
Sharp deviation in curvature
0.4
Curvature 0.3
0.2
0.1
N
0
0
0.1
0.2
0.3
0.4 0.5 0.6 0.7
Parameter values (ui )
0.8
0.9
1
0
0.1
0.2
0.3
0.4 0.5 0.6 0.7
Parameter values (ui )
0.8
0.9
1
16
14
12
R
10
8
6
4
2
0
R
Figure 18: and plot of the curve in Figure 16. The interpolation points are picked based on
curvature distribution.
8 KNOT SELECTION
23
3
3
3
Approximation
Original
Interpolation Points 3
3
3
R
Figure 19: Illustration showing the eect of how smoothing out the plot can result in insucient points selection for interpolation.
8 KNOT SELECTION
24
R
We have focussed our attention on the plot. The sharp deviations however are more
evident in the plot. We really need to look at the derivative plot of the curvature plot. The
derivative plot in Figure 20 gives an idea of how fast the curvature changes along the curve. The
derivative plot of curvature is constructed by evaluating
u
vi = u
(9)
i
i
where:
u u +1 , u
vi (ui ; i ) = ui
ui+1 , ui
i
i
i
(10)
and u is the curvature at parameter ui . vi 's are the approximations to slopes of curvature plots.
Thechange between subsequent vectorsslopes signies the amount of change in curvature along
the curve. We are interested in the neighboring slope pairs which fulll both of the following
conditions:
i
1. kvi k or kvi+1 k > ", i.e. , at least one of the vectorslope has magnitude > ", where " is taken
in our case to be 0.01.
2. vi vi+1 > cos(=3), i.e. , the angle between the slope pair is greater than =3.
Both limits (" and =3) are heuristic in nature. The results are satisfactory in the test cases.
We ignore the vector pairs where both have small magnitudes. This qualies points on the curve
where curvature is changing sharply even though the magnitude of the curvature at that point
is small. The result of applying this strategy is shown in Figure 21. The algorithms described in
this section will here after be referred to as the KP (Kappa Parametrization) algorithms.
8 KNOT SELECTION
25
0.14
0.12
0.1
0.08
0.06
vi = ddu 0.04
ui
i
0.02
0
-0.02
-0.04
-0.06
0
0.1
0.2
0.3
0.4 0.5 0.6 0.7
Parameter values (ui )
0.8
Figure 20: First derivative plot of curvature.
0.9
1
9 ADAPTIVE KNOT SELECTION
3
3
26
3
3
3
3
Approximation
Original
Interpolation Points 3
3
3
R
Figure 21: Interpolation based on points derived from plot with sharp deviations taken into
account. The original curve and its approximation are both shown.
9 Adaptive Knot Selection
We have used the curvature characteristic of the curve in placing knots. There is a need to
include the arc length characteristic of the curve also. Figure 22 shows a hair-pin curve which
is highly curved in its middle. The arc length plot in Figure 23 and its curvature plot is shown
in Figure 24. The application of ENP algorithm (Section 6) results in ve (5) as the number of
points needed for interpolation. If we just use curvature then the ve interpolation points would
be placed on the curve as shown in Figure 26. The three points (not including end points) try to
capture where the curvature is changing the most. However, if an interpolating B-spline is used,
the result is the approximation in Figure 27. This is far from the desired approximation as is
evident from visual examination.
This leads to two arguments. One, either the ENP algorithm did not estimate enough points
or just using the curvature in placement of knots is not adequate. Even if the ENP algorithm
had given a higher estimate, using curvature information alone would still not have solved the
9 ADAPTIVE KNOT SELECTION
27
Figure 22: Hair-pin curve.
18
16
14
12
Arc length 10
8
6
4
2
0
0
0.2
0.4
0.6
Parameter values (ti )
0.8
1
0.8
1
Figure 23: Arc length () plot of curve in Figure 22.
4
3.5
3
2.5
Curvature 2
1.5
1
0.5
0
0
0.2
0.4
0.6
Parameter values (ti )
Figure 24: Curvature () plot of curve in Figure 22.
9 ADAPTIVE KNOT SELECTION
R
80
70
60
50
40
30
20
10
0
0
0.2
28
0.4
0.6
Parameter values (ti )
0.8
1
R
Figure 25: Integral of Curvature ( ) plot of curve in Figure 22.
R
80
70
60
50
40
30
20
10
0
0
0.2
0.4
0.6
Parameter values (ti )
0.8
1
Figure 26: Interpolation points to approximate curve in Figure 22, based only on curvature
distribution.
9 ADAPTIVE KNOT SELECTION
29
3
Approximation
Original
Interpolation Points 3
3
33
3
Figure 27: Resulting approximation of the curve in Figure 22.
R
80
70
60
50
40
30
20
10
0
0
0.2
0.4
0.6
Parameter values (ti )
0.8
1
Figure 28: Placement of 8 interpolation points on the curve in Figure 22. The placement is based
only on curvature distribution.
problem. Let the ENP estimate be increased to 8. The KP algorithms would have chosen the
eight points to be interpolated as shown in Figure 28. All the points are still placed in the high
curvature section of the curve. As is evident from the gure, the interpolation points are between
0:4 and 0:6 (on the parameter axis). The interpolating curve (not shown) would not be much
dierent from Figure 27. This leads to the validity of the second argument.
The problem in the above example lies in two places. The rst problem stems from nding
the tangent direction near end points. The next two closest points to the end point are far away
i.e. , in the mid section of the curve. Passing a parabola (using the Bessel end condition) gives
a incorrect tangent direction. Even if we were to impose the tangent direction from the original
9 ADAPTIVE KNOT SELECTION
30
3
Approximation
Original
Interpolation Points 3
33
3
3
Figure 29: Approximation with good tangents from the original curve.
curve, there remains a large enough discrepancy in the approximated curve. Figure 29 shows the
approximation with tangent directions measured from the gicen curve. The second problem and
the key is that the knots are not spread well enough along the arc length of the curve.
The situation is rectied by the Adaptive Knot Sequence Generation (AKSG) algorithm that
involves arc length. As a rule of thumb, if the ratio of distance between neighboring knots is
less than some constant, we see the problems as encountered in Figure 29. Therefore, we need
to make sure that a certain ratio of distance (arc length) between any two neighboring segments
lies within the prescribed limit. To attain this we must introduce auxiliary knots. Thus, more
knots are inserted adaptively based on the arc length of the neighboring segment of knots. This
means that even if two curves have the same curvature characteristics, but represent dierent arc
lengths, then the curve with greater arc length will have more knots than the one with smaller arc
length. Cases with dierent values, ranging from 3:0 to 6:0 were tested. The value 3:0 performed
well with the most curves. Overall, it proved to be a good conservative choice even though it
resulted in some extra knots. Let u0 ; ; um be the knots resulting from the KP algorithms,
corresponding to data points x0 ; ; xm . Let be the limiting ratio desired between any two
nighbors. Note the limit goes from 1 to . The AKSG works as follows:
1. for i = 1 : : : m, compute i, where i = kxi , xi,1 k
2. for i = 1; : : : ; m,
(a) if i < 1= or i > then insert a auxiliary knot in the middle of the segment that
is larger of the two (i or i + 1).
10 CONCLUSION
3
31
3
3
Approximation
Original
Interpolation Points 3
3
3
3
3
3
3
3
3
3
3
3
3
Figure 30: Approximation to curve in Figure 22 using the AKSG algorithm.
The result of applying AKSG is that additional knots are inserted and the distribution of the
knots on the curve is more even. The interpolant generated using the AKSG algorithm points is
shown in Figure 30 superimposed on the original curve.
10 Conclusion
The paper combines several methods in aiding selection of interpolation points on a curve for
approximation. Algorithms are presented to use arc length, curvature and a combination of the
two in selection of interpolation points.
11 Acknowledgement
This research was supported in part by grant MSU 93-1-014 awarded to Arizona State University
and Prof. Gerald Farin, my thesis advisor.
References
[1] J.H. Ahlberg, E.N. Nilson, and J.L. Walsh. The Theory of Splines and their Applications.
Academic Press, 1967.
REFERENCES
32
[2] M. Crampin, R. Guifo Guifo, and G.A. Read. Linear approximation of curves with
bounded curvature and a data reduction algorithm. Computer Aided Design, 17(6):257{
261, July/August 1985.
[3] G. Farin. Curves and Surfaces for CAGD. Academic Press, 1996.
[4] G. Farin. NURB Curves and Surfaces. A. K. Peters, 1999.
[5] I.D. Faux and M.J. Pratt. Computational Geometry for Design and Manufacture. Ellis
Horwood, 1979.
[6] J. A. Gregory and R. Delbourgo. Piecewise rational quadratic interpolation for monotonic
data. IMA Journal of Numerical Analysis, pages 123{130, 1982.
[7] J. A. Gregory and R. Delbourgo. C 2 rational quadratic spline interpolation for monotonic
data. IMA Journal of Numerical Analysis, 3:141{152, 1983.
[8] G.E. Holzle. Knot placement for piecewise polynomial approximation of curves. Computer
Aided Design, 15(5):295{296, 1983.
[9] Chuan-Chih Hsiung. A rst course in Dierential Geometry. John Wiley & Sons, 1981.
[10] Tae-wan Kim. Knot placement for NURB interpolation. Master's thesis, Arizona State
University, Tempe, Az., 1993.
[11] W. Ma and J.P. Kruth. Mathematical modelling of free-form curves and surfaces from
discrete points with nurbs. In P. J. Laurent, A. Le Mehaute, and L. Schumaker, editors,
Curves and Surfaces II. A. K. Peters, 1994.
[12] M. Pratt, R. Goult, and L. He. On rational parametric curve approximation. Computer
Aided Geometric Design, 10(3/4):363{377, 1993.
[13] Anshuman Razdan. Healing NURB Surfaces. PhD thesis, Arizona State University, 1995.
[14] F. J. Schneider. Interpolation, Approximation and Konverterung mit rationalen B-Splines.
PhD thesis, TH Darmstadt, Germany., 1993.
[15] Hans Wolters. Rational Geometric Curve Approximation. PhD thesis, Arizona State University., 1994.