Document 11365777

advertisement
NOTICE: This is the author’s version of a work that was accepted for publication in Computer Aided Geometric Design.
Changes resulting from the publishing process, such as peer review, editing, corrections, structural formatting, and other
quality control mechanisms may not be reflected in this document. Changes may have been made to this work since it was
submitted for publication. A definitive version was subsequently published in Computer Aided Geometric Design, Volume
26, Issue 3, March 2009, Pages 351-366, doi: 10.1016/j.cagd.2008.07.005.
Computing Intersections of Planar Spline Curves using Knot
Insertion
pre-print
Knut Mørken
Martin Reimers
Christian Schulz
CMA / IFI, University of Oslo
Abstract
We present a new method for computing intersections of two parametric B-Spline curves. We
use an intersection of the control polygons as an approximation for an intersection of the curves
in combination with knot insertion. The resulting algorithm is asymptotically Newton-like, but
without the need of a starting value. Like Newton’s method, it converges quadratically at transversal
intersections, the analogue to simple roots. It is a generalization of an algorithm developed by two
of the authors for computing zeros of spline functions.
Keywords: curve intersection, spline, B-Spline, knot insertion, control polygon
1
Introduction
The problem of finding the intersections between two parametric curves is fundamental in Geometric
Modeling. The curves are commonly represented in terms of B-Splines which means that a rich theoretical
and practical toolbox is available, and a good algorithm would exploit the B-spline properties in the design
of the intersection algorithm. Perhaps the most important of these properties is that the coefficients of a
curve represented in terms of B-splines converge to the curve when the width of the polynomial pieces goes
to zero. A particularly simple way to view this property in action is to successively divide the parameter
intervals of all polynomial pieces in two parts of equal width; we will refer to this as uniform subdivision.
By performing uniform subdivision sufficiently many times, the coefficients will come arbitrarily close to
the spline curve. A consequence of this is that the piecewise linear interpolant to neighbouring coefficients
(usually referred to as the control polygon) will converge to the curve.
B-splines are nonnegative and sum to one which means that linear combinations of B-splines have
the convex hull property, i.e., any point on a spline curve lies within the convex hull of the B-spline
coefficients. There is also a local convex hull property: If we restrict our attention to one polynomial
piece of a spline curve of degree d, then only d + 1 B-splines are nonzero so the associated curve segment
lies within the convex hull of the corresponding coefficients. This can be exploited when computing
intersections since if the local convex hulls of the coefficients of two polynomial segments do not overlap,
then it is not possible for the curve segments to intersect either.
If the two curves are f and g (typically curves in the plane), parameterized by s and t, the problem
is to solve the vector equation
f (s) = g(t).
(1)
The most obvious approach is to apply one of the classical methods for computing roots of equations,
e.g. Newton’s method. The disadvantage is that these methods will only converge if one or more starting
values close to the intersection are supplied. Finding those starting values can itself be a difficult task.
An alternative algorithm is to perform uniform subdivision until the control polygons come sufficiently
close to the spline curves and then use the intersections between the control polygons as approximations
1
K. Mørken, M. Reimers, Chr. Schulz; Intersections of Planar Spline Curves; pre-print
2
to the intersections between the curves. This strategy can be improved by excluding the curve segments
where the local convex hull property implies that no intersections can occur. In essence, this is the
intersection algorithm suggested in [4]. The disadvantage of this approach is that the convergence to
the actual intersections is slow since the subdivision step is based on a simple bisection of the parameter
intervals. This therefore suggests an alternative method which uses subdivision to home in on the
intersections and then switches to the quadratically convergent Newton’s method to compute more
accurate intersections, see [14]. However, this still leaves the problem of determining exactly when it is
safe to switch to Newton’s method.
Bézier clipping [13] is a variation on the subdivision approach that clips away the regions of the curves
where no intersections can take place in a clever way which leads to a quadratically convergent method,
see [11].
The paper [8] describes a general family of methods for solving systems of polynomial equations in
several variables, of which equation (1) is a special case. The methods are reminiscent of the classical
subdivision methods for polynomials on Bernstein form, but include a preconditioning step.
An interesting paper is [15] which is concerned with developing an algorithm which can guarantee
that all intersections (including tangential ones) between two polynomial curves on Bernstein form can
be found. The algorithm makes use of so-called separation bounds which say something about how close
two curves described in terms of floating point numbers with a given number of bits can be without
having an intersection. The basic algorithm is essentially a subdivision algorithm like the one in [4],
but the tests for intersections are much more sophisticated. The emphasis is on guaranteeing that all
intersections and their type are found; speed and convergence rate is not discussed much.
Yet another family of methods for solving intersection problems is discussed in [2] where one of the
curves is rewritten (approximately) in implicit form.
The algorithm that we describe and analyze in this paper is a generalization of the method presented in
[6] for finding roots of spline functions. The new algorithm supplements and improves on the algorithms
mentioned above in different ways: It works directly with splines expressed in terms of B-splines; it
focuses on finding intersections rather than removing parts where no intersections can occur; it is based
on subdivision, but is adaptive in that the points at which to subdivide are determined by a very simple
strategy that leads to quadratic convergence at transversal intersections; and it requires no starting
values even though it converges as quickly as Newton’s method. The algorithm may be used on its own,
but it should also fit into some of the hybrid strategies mentioned above.
It should be noted that the new algorithm is dependent upon the control polygons of the two curves
having an intersection. In the case of non-intersecting control polygons (see Figure 5b) a subdivision
preprocessing step will necessarily lead to intersecting control polygons near transversal intersections.
After an introduction of basic notation in Section 2, we describe the new algorithm in Section 3. The
properties of the algorithm are analyzed in Section 4, succeeded by some numerical examples in Section
5. A discussion of open questions is given in Section 6.
2
Basic Notation
Pn
A spline curve in Rm is a vector function on the form f (t) = i=1 ci Bi,d,t (t), where each control point
ci lies in Rm , and {Bi,d,t }ni=1 is the collection of B-splines of degree d associated with the knot vector
. We denote the set of all such curves by Sm
t = (ti )n+d+1
i=1
d,t . Throughout the paper we always assume
that ti < ti+d for i = 2, . . . , n (all knots except the first and the last having at most multiplicity d such
that the splines are continuous and the B-splines are linearly independent) and that the first and last
d + 1 knots are identical (t1 = td+1 , tn+1 = tn+d+1 ). The latter condition causes no loss of generality
as every spline curve can be converted to this form. We are only interested in the part of the spline
curve defined on the interval [td+1 , tn+1 ] — the rest is identically zero. In this paper we limit ourselves
to spline curves in the plane, hence m = 2.
The control polygon of the spline is the piecewise linear interpolant to consecutive control points.
For our purposes we need a one-to-one mapping from the parameter interval [td+1 , tn+1 ] to the control
polygon. We therefore associate the knot average or Greville abscissa t̄i = (ti+1 + · · · + ti+d )/d with the
K. Mørken, M. Reimers, Chr. Schulz; Intersections of Planar Spline Curves; pre-print
3
control point ci and define the control polygon Γf ,t of the spline curve f as
Γf ,t (t) =
t̄i+1 − t
t − t̄i
ci +
ci+1
t̄i+1 − t̄i
t̄i+1 − t̄i
for t in the interval [t̄i , t̄i+1 ). Since t̄1 = td+1 and t̄n = tn+1 , this defines the control polygon on all of
[td+1 , tn+1 ). We know from classical spline theory [5, 12] that the control polygon converges quadratically
to the spline as the maximal distance between two neighbouring knots tends to zero.
Another classical result which will be useful is the observation that inserting a knot into the knot
vector does not change the spline itself, only its control polygon. Let τ be the knot to be inserted with
τ ∈ [tµ , tµ+1 ) and let (bi )n+1
i=1 be the new control points. Then we have bi = ci for i = 1, . . . , µ − d,
bi =
ti+d − τ
τ − ti
ci +
ci−1
ti+d − ti
ti+d − ti
for i = µ − d + 1, . . . , µ,
and bi = ci−1 for i = µ + 1, . . . , n + 1, see [1].
As we mentioned above, splines represented in terms of B-splines have a local convex hull property.
More precisely, for any t ∈ [tj , tj+1 ) the point f (t) is contained in the convex hull of the local control
points cj−d , . . . , cj (the smallest convex set that contains all of these points). Obviously, if the unions
of all local convex hulls of two spline curves are disjunct, so are the curves.
3
The Intersection Algorithm
In [6] the close relationship between a spline and its control polygon is exploited to find the first zero of a
spline function by taking the first zero of the control polygon as an approximation to the first zero of the
spline. This zero is then inserted into the knot vector of the spline and the first zero of the new control
polygon is used as an improved approximation. By repeating this, an iterative algorithm is obtained
which turns out to converge quadratically to simple zeros. The method can be generalized in a natural
way to the computation of an intersection of two parametric spline curves. We use the first intersection
of the two control polygons as an approximation to an intersection of the two curves. First here means
first according to some order, e.g. a lexicographical order on the parameter values. From this intersection
we get a pair of parameter values, one for each curve, which are then inserted as new knots into the
knot vectors of the corresponding curves. This process can be repeated with the new control polygon as
illustrated in Figure 1, the result being a simple iterative method.
The algorithm outlined above, together with a detailed analysis of convergence, is the main contribution of this paper. In itself, this is not a foolproof algorithm for computing intersections since two
curves may intersect even when the control polygons do not intersect, see Figure 5b. In this situation we
need to do some preprocessing before our algorithm will work. For this we exploit the local convex hull
property. More specifically, if the curves intersect, there must be at least one pair of overlapping local
convex hulls. We focus on the first such pair and insert the midpoints of the corresponding parameter
intervals as new knots in the curves. By possibly repeating this procedure, we know from Theorem 11
that we will eventually end up with intersecting control polygons, at least in the case of a transversal
intersection. The resulting Algorithm 1 is shown in Figure 2. Obvious variations on the preprocessing
step may home in on other intersections than the first one, or even all intersections.
Any iterative algorithm needs a stopping criterion; we will discuss this together with some examples
in Section 5.
For transversal intersections the intersecting control polygons determine the limiting behaviour of
Algorithm 1. If the algorithm is not stopped, it will generate an infinite sequence of parameter pairs
which we will analyze in Section 4. There we show that all accumulation points of the sequence must
correspond to intersections between the two spline curves. In addition, if we limit ourselves to curves
with only transversal intersections, and if we always insert the first intersection between the two control
polygons, we will show that the sequence converges with a quadratic convergence rate.
The computation of the parameter
(σ, τ ) corresponding to the intersection
of the two control
Pnpair
Png
f
cl Bl,e,t (t) the second
polygons is quite simple. Let f (s) = l=1
bl Bl,d,s (s) be the first and g(t) = l=1
K. Mørken, M. Reimers, Chr. Schulz; Intersections of Planar Spline Curves; pre-print
a) Step 0
b) Step 1
c) Step 2
d) Step 3
4
Figure 1: By repeatedly inserting the intersection of the control polygons as new knots in the splines,
we obtain a sequence of control polygons whose intersection converges to the intersection of the curves.
In this example both curves have degree three.
Start
Control polygons
intersect?
No
Insert first intersection
of control polygons
Found
intersection?
No
Yes
Yes
No
Two
local convex hulls
intersect?
Insert first
midpoint pair
Curves do not
intersect
Yes
Stop
Figure 2: Algorithm 1. Intersection finding algorithm.
K. Mørken, M. Reimers, Chr. Schulz; Intersections of Planar Spline Curves; pre-print
5
curve. Let the control polygon segments bi−1 , bi and cj−1 , cj contain the chosen intersection between
the control polygons, given by the equation
s̄i − σ
σ − s̄i−1
t̄j − τ
τ − t̄j−1
bi−1 +
bi =
cj−1 +
cj .
s̄i − s̄i−1
s̄i − s̄i−1
t̄j − t̄j−1
t̄j − t̄j−1
The left-hand side of this equation can be written as
bi + (s̄i − σ) (bi−1 − bi ) /(s̄i − s̄i−1 ) = bi + (σ − s̄i ) ∆bi ,
where ∆bi = (bi − bi−1 ) / (s̄i − s̄i−1 ). We reformulate the right-hand side in a similar way and end up
with the equation
bi − cj = − ((σ − s̄i ) ∆bi − (τ − t̄j ) ∆cj ) .
(2)
− ∆cj is nonsingular, the solution of (2) is
If the 2 × 2 matrix M = ∆bi
σ
s̄i
(3)
− M −1 bi − cj .
=
τ
t̄j
Note that the non-singularity of the matrix M is equivalent to the two segments of the two control
polygons not being parallel and of nonzero length.
4
Analysis
If the two control polygons intersect in every iteration, Algorithm 1 will yield an infinite sequence of
parameter pairs (if not stopped). We will
analyze the properties of this sequence. Let f (s) =
P
Pnnow
nf
g
k
k
c
B
b
B
(s)
be
the
first
and
g(t)
=
i=1 i i,e,t (t) the second curve. Let s and t be the knot
i=1 i i,d,s
vectors and (σ k , τ k ) the parameter values of the chosen intersection of the control polygons in iteration k.
Note that if σ k already has multiplicity d in the knot vector sk , it will not be inserted into sk . Inserting
this value would not change the control polygon, it would just duplicate an existing control point. We
treat τ k similarly.
Before starting the analysis we introduce needed background material in subsection 4.1, followed by
some basic results in 4.2. The analysis itself starts with showing that the algorithm actually finds an
intersection in subsection 4.3. The Convergence analysis can be found in 4.4 and a discussion of the
convergence rate in 4.5.
4.1
Background Material
In the literature there are a number of bounds on splines in the functional case. Most of these carry over
to spline curves quite easily and we will state the ones we need below. The proofs are straightforward
and are left to the reader.
The results in this subsection can be applied to spline curves in any dimension, hence we consider
curves in Rm for a general m.
We start by defining two norms for vector valued functions. Recall that the uniform norm of a
continuous function defined on an interval [a, b] is defined by
kf k∞ = kf k∞,[a,b] = max f (x).
x∈[a,b]
Analogously we define the 2, ∞-norm of a vector valued function f : [a, b] 7→ Rm as
kf k2,∞ := max kf (s)k2 .
s∈[a,b]
If f (s) =
Pn
i=1
ci Bi,d,s (s) is a spline curve in Rm then we denote the 2, ∞-norm of the control points by
kck2,∞ := max kci k2 .
i=1,...,n
These norms enable us to derive a generalization of a standard stability result for spline functions.
6
K. Mørken, M. Reimers, Chr. Schulz; Intersections of Planar Spline Curves; pre-print
Lemma 1 Every spline curve f in Sm
d,s can be bounded by
Kd−1 kck2,∞ ≤ kf k2,∞ ≤ kck2,∞
with the constant Kd depending only on the degree d of f .
The next lemma gives an estimate of the distance between a spline and a control point. The operator
D denotes differentiation from the right.
P
Lemma 2 Let f (s) = ni=1 ci Bi,d,s (s) be a spline in Sm
d,s . Then
kci − f (s̄i )k2 ≤ Qd,m (si+d − si+1 )2 kD2 f k2,∞,[si+1 ,si+d ] ,
where the constant Qd,m depends only on d and m.
Scalar versions with proofs of the Lemmas 1 and 2 can be found in Theorem 9.17 and Lemma 4.1 in
[5].
The control points of the spline curve can be described by a multivariate function of the knots,
ci = F (si+1 , . . . , si+d ).
(4)
The function F is affine and symmetric in each of its arguments, satisfies the diagonal property f (s) =
F (s, . . . , s) and is often referred to as the blossom of f . Blossoming is discussed in [9] and standard
spline literature [3, 5] so we only treat the parts we will need later on (see also [6]).1
For the blossom of the derivative f ′ we will use the notation
∆ci = F ′ (si+1 , . . . , si+d−1 )
where ∆ci denotes a control point of f ′ . Moreover, observe that the derivative of the blossom and the
blossom of the derivative are related by
dDi F (x1 , . . . , xd ) = F ′ (x1 , . . . , xi−1 , xi+1 , . . . , xd ),
(5)
where Di F denotes the derivative with respect to xi . In other words, we have ∆ci = dDd F (si+1 , . . . , si+d ).
We will also need a multivariate Taylor expansion of the blossom F . For an affine function φ(x) we
have the simple Taylor expansion
φ(x) = φ(z) + (x − z)φ′ (z).
(6)
As F is an affine function in each of its arguments, repeated application of (6) leads to
F (x1 , . . . , xd ) = F (z1 , . . . , zd ) +
d
X
l=1
(xl − zl ) Dl F (z1 , . . . , zd )
+
d
l−1
X
X
l=2
r=1
(xl − zl ) (xr − zr ) Dl,r F (z1 , . . . , zl , xl+1 , . . . , xd ) ,
where Dl,r F denotes the second derivative with respect to xl and xr .
Finally we will need a bound for the second derivative of the blossom.
Lemma 3 For all x1 , . . . , xd ∈ [a, b] and integers r and l with 1 ≤ r < l ≤ d the inequality
kDl,r F (x1 , . . . , xd )k2 ≤
KF ′′
.
d(d − 1)
holds, where the constant KF ′′ depends on a, b and f but not on a specific knot vector s.
1 Note that the blossom is only defined for polynomials. However, the blossoms of two polynomials that are linked with
a certain continuity will agree when they are evaluated at the knots used for the construction of the B-splines, as in (4).
K. Mørken, M. Reimers, Chr. Schulz; Intersections of Planar Spline Curves; pre-print
7
Proof. Two applications of (5) yield
Dl,r F (x1 , . . . , xd ) =
1
F ′′ ((x1 , . . . , xd ) \ (xl , xr )).
d(d − 1)
The blossom F ′′i of the ith polynomial piece of the second derivative is continuous and hence its norm
kF ′′i ((x1 , . . . , xd ) \ (xl , xr ))k2 is also continuous. By the extreme value theorem the norm therefore
achieves its maximum and minimum over the interval [a, b]. Thus kF ′′i k2 can be bounded by some
constant kF ′′i (x1 , . . . , xd )k2 ≤ KF ′′ for all i and xj ∈ [a, b] with j = 1, . . . , d.
4.2
Basic Results
After stating the background material we will now cover some basic results which can be applied more
generally. Some of the results are well known and just restated for convenience whereas others extend
existing ones to provide more appropriate tools for the analysis. Again the results can be applied to
spline curves in any space dimension.
we will need some simple properties of the control polygon. Consider the derivative Df (s) =
PnFirst,
f
∆b
i Bi,d−1,t (s) of f whose B-spline coefficients are given by ∆bi = (bi − bi−1 ) / (s̄i − s̄i−1 ).
i=2
Lemma 4 The norm of the derivative of the control polygon Γf ,s can be bounded by
kDΓf ,s k2,∞ = k∆bk2,∞ ≤ Kd−1 kDf k2,∞ ,
where Kd−1 is a constant depending only on d and ∆b is the vector of control points of Df .
Proof. For s ∈ [s̄i , s̄i+1 ) we have DΓf ,s (s) = (bi+1 − bi ) / (s̄i+1 − s̄i ) = ∆bi+1 . But this means that
kDΓf ,s (s)k2 = k∆bi+1 k2 and kDΓf ,s k2,∞ = k∆bk2,∞ . The inequality then follows from Lemma 1. The next lemma shows that the control polygon is Lipschitz continuous.
Lemma 5 The distance between two points on the control polygon can be bounded by
kΓf ,s (x) − Γf ,s (y)k2 ≤ Kd−1 kDf k2,∞ |y − x|.
Proof. As the spline f is continuous, so is its control polygon, which leads to
Zy
kΓf ,s (x) − Γf ,s (y)k2 ≤ kDΓf ,s (s)k2 ds ≤ Kd−1 kDf k2,∞ |y − x|.
x
We will need a generalization of Lemma 2 to a situation where the parameter interval is arbitrary.
We first consider the function case.
Pnf
Lemma 6 Let f (s) = i=1
bi Bi,d,s (s) be a spline function, let [α, β] be a parameter interval that contains at least d knots from s and set δ = β − α. Then the distance between the control polygon and the
spline in the interval [α, β] can be bounded by
kf − Γf,s k∞,[α,β] ≤ R2 δ 2 kD2 f k∞
(7)
where the constant R2 only depends on d.
Proof. Let the d knots sζ+1 , . . . , sζ+d be in [α, β]. Initially we let s be any value in [s1 , snf ]. In [10] the
general bound
|f (s) − Γf,s (s)| ≤ |ϕ(s) − Γϕ,s (s)| k∆2 bk∞ ,
(8)
with ϕ(s) = s2 /2 was established where ∆2 bi are the coefficients of the second derivative D2 f (s) and
k∆2 bk∞ = maxi |∆2 bi |. Hence it follows from Lemma 1 that
k∆2 bk∞ ≤ Kd−2 kD2 f k∞ .
(9)
8
K. Mørken, M. Reimers, Chr. Schulz; Intersections of Planar Spline Curves; pre-print
To complete the proof we only need to bound the distance between the spline ϕ(s) =
s2 /2 and its control polygon, where
qi =
i+d
i+d
X
X
1
̺2
̺2
s̄2
sj sk = i − i = ϕ(s̄i ) − i
d(d − 1) j=i+1
2
2d
2d
Pnf
i=1 qi Bi,d,s (s)
=
(10)
k=j+1
Pd
2
′′
2
and ̺2i =
j=1 (si+j − s̄i ) /(d − 1). Observe that ϕ (s) = 1 and ∆ qi = 1 for all i which means that
ϕ(s) and Γf,s (s) are convex. Moreover, we see from the right-most expression in (10) that qi ≤ ϕ(s̄i ).
Combining this with the fact that ϕ(s) (locally) is contained in the convex hull of the control points
leads to Γϕ,s (s) ≤ ϕ(s).
Let us now consider the line h(s) through qζ and qζ+1 ,
h(s) = qζ + (s − s̄ζ )
qζ+1 − qζ
= qζ + (s − s̄ζ )∆qζ+1 ,
s̄ζ+1 − s̄ζ
Pζ+d
where ∆qζ+1 = k=ζ+2 sk /(d − 1) is a coefficient of the derivative ϕ′ (s) = s. We clearly have h(s̄ζ ) = qζ
and h(s̄ζ+1 ) = qζ+1 . Since ϕ(s) is a convex spline function, it cannot interpolate two consecutive control
points. In other words, either h(s̄ζ ) = qζ < ϕ(s̄ζ ) or h(s̄ζ+1 ) = qζ+1 < ϕ(s̄ζ+1 ) or both inequalities are
true. In addition it follows from the convexity of the control polygon that either h ≤ Γϕ,s or h ≥ Γϕ,s .
Hence both ϕ and Γϕ,s lie in the area above h(s), from which we conclude that
h(s) ≤ Γϕ,s (s) ≤ ϕ(s)
and
|ϕ(s) − Γϕ,s (s)| ≤ ϕ(s) − h(s).
(11)
The quadratic function ϕ(s) = s2 /2 can be described completely by its second order Taylor expansion
around s̄ζ given by ϕ(s) = ϕ(s̄ζ ) + (s − s̄ζ )s̄ζ + (s − s̄ζ )2 /2. Together with the fact that both s̄ζ and
∆qζ+1 lie in the interval [α, β], this yields
ϕ(s) − h(s) = |ϕ(s) − h(s)|
≤ |ϕ(s̄ζ ) − qζ | + |(s − s̄ζ ) (s̄ζ − ∆qζ+1 )| +
≤ R3 δ 2 + |s − s̄ζ | δ +
(s − s̄ζ )2
2
(s − s̄ζ )2
2
where the constant R3 depends only on d and comes from the scalar version of Lemma 2. By restricting
s to the interval [α, β] we end up with |ϕ(s) − h(s)| ≤ R̃2 δ 2 . Combining this with (8), (9) and (11), we
are led to the required inequality.
Lemma 6 has a natural generalization to parametric curves.
Corollary 7 Let f ∈ Sm
d,s be a spline curve, let [α, β] be a parameter interval for f that contains at least
d knots from s and set δ = β − α. On the interval [α, β] the distance between the control polygon and
the spline is bounded by
kf − Γf ,s k2,∞,[α,β] ≤ R4 δ 2 kD2 f k2,∞ ,
(12)
where the constant R4 depends only on d and m.
Our main tool in the proof of convergence is an estimate of the distance between the control polygon
and a tangent to a spline curve. This estimate is a simple consequence of Corollary 7. A tangent is
well defined at a regular point of f , a point where the derivative is continuous and nonzero, i.e., where
D− f (s) = D+ f (s) 6= 0. Here D− denotes one-sided differentiation from the left and D+ = D one-sided
differentiation from the right. Let f (ρ) be a regular point. Then the tangent line T ρ is given by
T ρ (s) := f (ρ) + (s − ρ)Df (ρ).
2
Lemma 8 Let f (ρ) be a regular point on f ∈ Sm
d,s , let also δ be a positive number such that f is C
in [ρ − δ, ρ) ∪ (ρ, ρ + δ], and suppose that the interval [ρ − δ, ρ + δ] contains at least d knots. Then for
u ∈ [−δ, δ]
kΓf ,s (ρ + u) − T ρ (ρ + u)k2 ≤ δ 2 R5,f ,
where R5,f is a constant that depends on f but not on s.
K. Mørken, M. Reimers, Chr. Schulz; Intersections of Planar Spline Curves; pre-print
9
Proof. From a Taylor expansion of fl around ρ we obtain
2
2
fl (ρ + u) − fl (ρ) − uDfl (ρ) ≤ u |D2 fl |∞ ≤ u kD2 f k2,∞
2
2
for any u ∈ [−δ, δ]. This is easily extended to the inequality
2√
f (ρ + u) − T ρ (ρ + u) ≤ u mkD2 f k2,∞ ,
2
2
which can be combined with Corollary 7 to give the required result
Γf ,s (ρ + u) − T ρ (ρ + u) ≤ Γf ,s (ρ + u) − f (ρ + u) +
2
2
2√ f (ρ + u) − T ρ (ρ + u) ≤ R4 4δ 2 + u m kD2 f k2,∞ ≤ δ 2 R5,f ,
2
2
2
√
with R5,f = 4R4 + ( m/2) kD f k2,∞ .
4.3
Accumulation Points
We are now ready to start the analysis of the infinite sequence of parameter values {σ k , τ k } generated
by Algorithm 1, i.e., the parameter pairs of successive intersections of control polygons. By the BolzanoWeierstrass theorem this sequence must necessarily have at least one accumulation point since it is
bounded. With the aid of Lemma 5 we can show that an accumulation point is an intersection point
between the two curves.
Theorem 9 If the pair (σ, τ ) is an accumulation point of the infinite sequence {σ k , τ k }, then f (σ) =
g(τ ).
Proof.
Let ǫ be any positive, real number. As (σ, τ ) is an accumulation point, there must be
positive integers k, i and j such that ski+1 , . . . , ski+d and σ k lie in the open interval (σ − 21 ǫ, σ + 12 ǫ) and
tkj+1 , . . . , tkj+e and τ k lie in the open interval (τ − 21 ǫ, τ + 12 ǫ). Since (σ k , τ k ) is defined by the relation
Γf ,sk (σ k ) = Γg,tk (τ k ), we can bound the distance between f (σ) and g(τ ) by
kf (σ) − g(τ )k ≤ Γf ,sk (σ k ) − f (σ) + Γg,tk (τ k ) − g(τ ) .
2
2
2
The distance between f (σ) and Γf ,sk (σ k ) can be bounded using Lemma 2, Lemma 5 and the mean value
theorem for f ;
Γf ,sk (σ k ) − f (σ) ≤ Γf ,sk (σ k ) − Γf ,sk (s̄ki ) + Γf ,sk (s̄ki ) − f (s̄ki )
2
2
2
k
+ f (s̄i ) − f (σ) 2
≤ (Kd−1 + 1)kDfk2,∞ ǫ + Qd,m D2 f 2,∞ ǫ2 ,
where the constants Qd,m and Kd−1 depend only on d and m, but not on sk . In the same way we obtain
the inequality
Γg,tk (τ k ) − g(τ ) ≤ (Ke−1 + 1)kDgk2,∞ ǫ + Qe,m D2 g ǫ2 .
2,∞
2
Combining these two bounds leads to kf (σ) − g(τ )k2 ≤ R6 ǫ + R7 ǫ2 where R6 and R7 are constants.
Since this bound holds for any positive value of ǫ we must have f (σ) = g(τ ).
4.4
Convergence
At transversal intersections one or both of the curves may have discontinuous tangents at the intersection
which may complicate the situation. We will consider this later, for now we only consider transversal
intersections at regular points.
K. Mørken, M. Reimers, Chr. Schulz; Intersections of Planar Spline Curves; pre-print
10
g
T f ,sa
Γg
Uf
Ug
f
θ
θ
distg − ,f
distf + ,g
Of (ǫ1 )
T g,ta
Og (−ǫ1 )
Γf
Figure 3: The situation around a transversal intersection.
Definition 10 An intersection between two parametric curves f and g at the regular points f (σ) = g(τ )
is said to be a transversal intersection if
det Df (σ) Dg(τ ) 6= 0.
The variation diminishing property of splines guarantees that the control polygon of a spline must
always have a zero near a zero of a spline function. We need an analogous result for intersections which
guarantees that the control polygons of two spline curves intersect near an intersection of the two curves.
Lemma 8 will help us establish this kind of result.
Theorem 11 Suppose that the two spline curves f ∈ S2d,s and g ∈ S2e,t have a transversal intersection
at (σ, τ ). Then the two control polygons will intersect at least once in the intervals (σ − ǫ1 , σ + ǫ1 ) and
(τ − ǫ1 , τ + ǫ1 ) provided the positive number ǫ1 satisfies the two conditions:
1. The curve f has at least d knots in the interval [σ − ǫ1 , σ + ǫ1 ] and g has at least e knots in
[τ − ǫ1 , τ + ǫ1 ].
2. The number ǫ1 is smaller than a number ǫ2 that only depends on f and g.
The two conditions provide lower and upper bounds on ǫ1 . The first condition which requires that
we have enough knots in the intervals [σ − ǫ1 , σ + ǫ1 ] and [τ − ǫ1 , τ + ǫ1 ], gives a lower bound λ on ǫ1 ,
while the second condition gives the upper bound ǫ2 . It may well happen that λ > ǫ2 in which case the
control polygons may not intersect even though the two curves intersect. On the other hand, the lower
bound depends on the knots while the upper bound is independent of the knots. This means that by
inserting knots sufficiently near the intersection, we can always decrease λ so that it becomes smaller
than ǫ2 .
Proof. The idea behind the proof is illustrated in Figure 3. Since f and g are piecewise polynomials,
there exists a δ > 0 such that f is C 2 in [σ − δ, σ) ∪ (σ, σ + δ] and g is C 2 in [τ − δ, τ ) ∪ (τ, τ + δ]. Initially,
we assume that we can satisfy both conditions by letting ǫ1 satisfy 0 < ǫ1 < δ, and we let i and j be
such that si+1 , . . . , si+d ∈ [σ − ǫ1 , σ + ǫ1 ] and tj+1 , . . . , tj+e ∈ [τ − ǫ1 , τ + ǫ1 ]. According to Lemma 8 this
means that for all u ∈ [−ǫ1 , ǫ1 ] we have
Γf (σ + u) − T f ,σ (σ + u) ≤ ǫ2 R5,f ≤ ǫ2 R8 ,
(13)
1
1
2
2
2
Γg (τ + u) − T g,τ (τ + u) ≤ ǫ1 R5,g ≤ ǫ1 R8 ,
(14)
2
where R8 := max(R5,f , R5,g ). For each u ∈ [−ǫ1 , ǫ1 ] we let Of (u) denote the circle with center at
T f ,σ (σ + u) and radius ǫ21 R8 , and we let U f denote the union of these circles as u varies in the interval
[−ǫ1 , ǫ1 ],
U f = ∪u∈[−ǫ1 ,ǫ1 ] Of (u).
K. Mørken, M. Reimers, Chr. Schulz; Intersections of Planar Spline Curves; pre-print
11
The set U g is generated by similar circles centered at T g,τ (τ + u).
To reach the desired conclusion, we assume that ǫ1 is so small that the two circles Of (−ǫ1 ) and
Of (ǫ1 ) do not intersect U g and the two circles Og (−ǫ1 ) and Og (ǫ1 ) do not intersect U f . We will later
deduce conditions that ensure that such an ǫ1 exists. We know from (13) and (14) that Γf (σ + u) ∈ U f
and that Γg (τ + u) ∈ U g for all u ∈ [−ǫ1 , ǫ1 ], and that U f and U g intersect since they share the circle
centered at the intersection point. Because we have a transversal intersection, the two circles Of (±ǫ1 )
lie on opposite sides of U g and therefore the points Γf (σ ± ǫ1 ) do not lie in U g , but on opposite sides of
it. Similarly the two points Γg (τ ± ǫ1 ) do not lie in the set U f , but on opposite sides of it. Hence the
control polygons must intersect at least once in the intersection of U f and U g .
We are now left with the task to determine an upper bound ǫ2 on ǫ1 which ensures that the two
circles Of (±ǫ1 ) do not intersect U g and the two circles Og (±ǫ1 ) do not intersect U f . Let 0 < θ ≤ 90◦
be the positive angle between T f ,σ and T g,τ . Let us consider distf + ,g , the distance of T f ,σ (σ + ǫ1 ) to
T g,τ , and distg+ ,f , the distance of T g,τ (τ + ǫ1 ) to T f ,σ . We then have
sin θ =
distf + ,g
ǫ1 kDf (σ)k2
and
sin θ =
distg+ ,f
ǫ1 kDg(τ )k2
which leads to
distf + ,g = ǫ1 kDf (σ)k2 sin θ,
distg+ ,f = ǫ1 kDg(τ )k2 sin θ.
If we define the constant R9 := min (kDf (σ)k2 , kDg(τ )k2 ) sin θ, we have distf + ,g ≥ ǫ1 R9 and distg+ ,f ≥
ǫ1 R9 . Similarly we get the same bound for the other distances distf − ,g and distg− ,f . We therefore need
to make sure that ǫ1 is so small that the radius of the circles is less than half the minimum distance
R9
, δ) where R8 , R9 and δ all depend on f and g,
(ǫ21 R8 < 12 ǫ1 R9 ). This gives the bound 0 < ǫ1 < min( 2R
8
R9
, δ) which completes the proof. but not on the knot vectors s or t. We can therefore set ǫ2 := min( 2R
8
Corollary 12 Suppose that the two spline curves f ∈ S2d,s and g ∈ S2e,t have a transversal intersection at
(σ, τ ), and suppose that this is also an accumulation point of the sequence {σ k , τ k }. Given a sufficiently
small ǫ1 > 0 there exists an N > 0 such that the control polygons intersect for all k > N somewhere in
the intervals [σ − ǫ1 , σ + ǫ1 ] and [τ − ǫ1 , τ + ǫ1 ].
Proof. Since (σ, τ ) is an accumulation point there exists an N > 0 such that for all k > N the curve f
has at least d knots in [σ − ǫ1 , σ + ǫ1 ] and g at least e knots in [τ − ǫ1 , τ + ǫ1 ]. According to Theorem
11 there is an ǫ2 > 0 with the property that the control polygons will intersect in the given intervals for
all k > N provided 0 < ǫ1 < ǫ2 .
Up to now the derivative at a regular point was assumed to be continuous. This was merely for
convenience, and in the case of splines it is straightforward to generalize the concept of regular points
to the situation where the derivative is discontinuous. We call a point f (s) a generalized regular point if
kD− f (s)k2 6= 0 and kD+ f (s)k2 6= 0.
At a generalized regular point of f we then denote the left tangent by T −
ρ and the right tangent by
+
Tρ ,
−
T−
ρ (s) := f (ρ) + (s − ρ)D f (ρ),
+
T+
ρ (s) := f (ρ) + (s − ρ)D f (ρ).
A generalized transversal intersection is a transversal intersection at a generalized regular point.
Formally it can be defined as follows. Let the two spline curves f ∈ S2d,s and g ∈ S2e,t intersect at (σ, τ )
and let f (σ) and g(τ ) be generalized regular points. Let also θf− be the counter clockwise angle between
−
+
+
±
±
T+
f ,σ and T f ,σ starting at T f ,σ and let θg be the counter clockwise angles between T f ,σ and T g,τ again
+ −
+ −
starting at T +
f ,σ , see Figure 4. Now let θ̄g := max(θg , θg ) and θ g := min(θg , θg ). The intersection
between the two spline curves f and g at (σ, τ ) is called a generalized transversal intersection if
0◦ < θg < θf− < θ̄g < 360◦,
K. Mørken, M. Reimers, Chr. Schulz; Intersections of Planar Spline Curves; pre-print
T+
g,ta
θf−
T−
f ,sa
12
θg+
θg−
T−
g,ta
T+
f ,sa
Figure 4: A generalized transversal intersection
i.e. when turning counter clockwise around the intersection starting at T +
f ,σ one first encounters one of
the tangents to g(τ ), then T −
and
finally
the
other
tangent
to
g(τ
).
f ,σ
Lemma 8 can be applied as it is to the left and right tangents of each curve. The proof of Theorem
11 will essentially still be valid. The only difference is in the estimate of the upper bound on ǫ1 . Here
±
the distances of the points T ±
f ,σ (σ ± ǫ1 ) and T g,τ (τ ± ǫ1 ) to both tangents of the other curve have
to be considered. This yields the analogous bounds distf ± ,g± ≥ ǫ1 R10 and distg± ,f ± ≥ ǫ1 R10 where
R10 := min (kD± f (σ)k2 , kD± g(τ )k2 ) sin(θ), with θ is the smallest angle between the four tangent lines.
With this we can restate Corollary 12 for generalized transversal intersections.
Corollary 13 Suppose that the two spline curves f ∈ S2d,s and g ∈ S2e,t have a generalized transversal
intersection at (σ, τ ) and suppose that this is also an accumulation point of the sequence {σ k , τ k }. Given
a sufficiently small ǫ > 0 there exists an N > 0 such that the control polygons intersect for all k > N
somewhere in the intervals [σ − ǫ, σ + ǫ] and [τ − ǫ, τ + ǫ].
Corollary 13 enables us to show that if the curves only have generalized transversal intersections, the
sequence {σ k , τ k } will have only one accumulation point and thus will converge.
Lemma 14 Let the curves f ∈ S2d,s and g ∈ S2e,t have only generalized transversal intersections. Then
the infinite sequence {σ k , τ k } converges.
Proof. Suppose that there is more than one accumulation point. Let (σa , τa ) and (σb , τb ) be two neighbouring accumulation points and let ǫ < min(|σb − σa |, |τb − τa |)/2 be small enough for the conclusion
of Corollary 13 to hold. Then there exists an N > 0 such the control polygons intersect in the ǫ interval
around (σa , τa ) and in the ǫ interval around (σb , τb ) for all k > N . The lexicographical order now ensures
that one intersection is always smaller than the other and therefore for all k > N an intersection of the
control polygons corresponding to the same curve intersection is inserted. But then the sequence cannot
have more than one accumulation point, i.e. the sequence converges.
4.5
Convergence Rate
We now know that our intersection algorithm converges; it remains to examine the convergence rate. Let
(σ, τ ) be an accumulation point of the sequence {σ k , τ k } and let the control polygon segments bkik −1 , bkik
and ckjk −1 , ckjk contain the chosen intersection between the control polygons at iteration k. In this setting
Equation (3) becomes
k k s̄ik
σ
=
− Mk−1 F ik − Gjk , Mk = dDd F ik −eDe Gjk ,
(15)
t̄kjk
τk
where F and G are the blossoms of f and g and F ik = F (skik +1 , . . . , skik +d ), Dd F ik = Dd F (skik +1 , . . . , skik +d )
with Gjk and De Gjk defined similarly. It is apparent that Algorithm 1 resembles a discrete version of
Newton’s method, so we should expect a quadratic convergence rate. We will confirm that the algorithm
converges quadratically at transversal intersections. This is done with the help of two lemmas, the first
of which reformulates (15) and the second shows convergence of the inner knots skik +1 , . . . , skik +d−1 and
tkjk +1 , . . . , tkjk +e−1 to the respective parameter values at the intersection.
K. Mørken, M. Reimers, Chr. Schulz; Intersections of Planar Spline Curves; pre-print
13
Lemma 15 The error vector (σ k , τ k )T − (σ, τ )T satisfies the equation
k
σ −σ
= Mk−1 v k
τk − τ
where
vk =
d−1
X
l=2
l−1
X
r=1
e−1 X
l−1
X
l=1
Proof.
τ − tkjk +l
r=1
l=2
d−1
X
(σ −
σ − skik +r Dl,r F skik +1 , . . . , skik +l , σ, . . . , σ −
τ − tkjk +r Dl,r G tkjk +1 , . . . , tkjk +l , τ, . . . , τ +
σ − skik +l
skik +l )2 Dl,d F ik
−
e−1
X
l=1
(τ − tkjk +l )2 Dl,e Gjk .
T
We start by subtracting (σ, τ ) from both sides of (15),



d
1 P k
k
(s
−
σ)
ik +l
 d


σ −σ
l=1
−
= Mk−1 
Mk 
k
e



P
τ −τ
1
k
(t
−
τ
)
jk +l
e
l=1
{z
|
F ik − Gjk
vk
We then add and subtract
Since
d
P
l=1
Pd
l=1


.

(16)
}
Pe σ − skik +l Dl F ik − l=1 τ − tkjk +l Dl Gjk from the vector v k in (16).
d−1
d
P
P
(σ − skik +l )(skik +d − skik +l )Dl,d F ik ,
σ − skik +l Dl F ik − (σ − skik +l )Dd F ik =
l=1
l=1
the vector v k may be written as
v k = −F ik −
d
X
l=1
d−1
X
σ − skik +l Dl F ik +
(σ − skik +l )(skik +d − skik +l )Dl,d F ik +
l=1
Gjk +
e
X
l=1
e−1
X
τ − tkjk +l Dl Gjk −
(τ − tkjk +l )(tkjk +d − tkjk +l )Dl,e Gjk . (17)
l=1
We next make use of the fact that f (σ) − g(τ ) = 0 and perform Taylor expansions of the blossoms F
and G,
0 = f (σ) − g(τ ) = F (σ, . . . , σ) − G (τ, . . . , τ )
= F ik − Gjk +
d
X
l=1
e
X
τ − tkjk +l Dl Gjk
σ − skik +l Dl F ik −
l=1
+
d
X
l−1
X
σ − skik +l
−
e
l−1
X
X
τ − tkjk +l
l=2
l=2
r=1
r=1
σ − skik +r Dl,r F skik +1 , . . . , skik +l , σ, . . . , σ
τ − tkjk +r Dl,r G tkjk +1 , . . . , tkjk +l , τ, . . . , τ .
Using this we can replace the first, second, fourth and fifth term in (17) by the quadratic error term,
which yields the required form of v k .
The second lemma shows that the inner knots converge.
K. Mørken, M. Reimers, Chr. Schulz; Intersections of Planar Spline Curves; pre-print
14
Lemma 16 For any ǫ > 0 there exists an N > 0 such that for all k > N
|skik +l − σ| < ǫ, l = 1, . . . , d − 1,
|tkjk +r − τ | < ǫ, r = 1, . . . , e − 1.
Proof. Let λ = ǫ/2d. Since the sequence σ k , τ k converges to (σ, τ ), there exists an Nf > 0 such that for
all k > Nf there is an integer ξ such that skξ+1 , . . . , skξ+d and σ k lie in the interval J = [σ − λ, σ + λ]. The
number s̄kξ must clearly also lie in this interval. There are two possibilities: either ξ ≤ ik −1 or ξ ≥ ik . Let
us consider the first situation. Then we have s̄kξ ≤ s̄kik −1 ≤ σ k , hence s̄kik −1 ∈ J and skξ+1 ≤ skik ≤ s̄kik −1 .
But then skik ∈ J which provides an upper bound for skik +d−1 . From σ − λ ≤ skik ≤ . . . ≤ skik +d−2 and
s̄kik −1 ≤ σ+λ we get skik +d−1 ≤ σ+(2d−1)λ < σ+ǫ and therefore we have skik , . . . , skik +d−1 ∈ [σ−λ, σ+ǫ).
Consider next the second case ξ ≥ ik . As in the first case this leads to σ k ≤ s̄kik ≤ s̄kξ and s̄kik ≤
k
sik +d ≤ skξ+d . But then we have s̄kik , skik +d ∈ J and skik +1 ≥ σ − (2d − 1)λ > σ − ǫ, so we must have
skik +1 , . . . , skik +d ∈ (σ − ǫ, σ + λ]. If we combine both cases we obtain skik +1 , . . . , skik +d−1 ∈ (σ − ǫ, σ + ǫ)
for all k > Nf .
The proof that tkjk +1 , . . . , tkjk +e−1 ∈ (τ − ǫ, τ + ǫ) for all k > Ng is similar. Defining N = max(Nf , Ng )
finishes the proof.
We now have the tools required to establish the quadratic convergence rate of the intersection algorithm.
Theorem 17 Suppose that the two curves f and g have a transversal intersection at (σ, τ ). Then there
is a constant R11 that depends on f and g but not on sk and tk so that for sufficiently large k

2
k
max |σ − skik +l | σ −σ l=1,...,d−1
≤ R11 
 .
(18)
k
τ k − τ 2
|
max
|τ
−
t
jk +l
l=1,...,e−1
′
2
′
Proof. At a transversal intersection f (σ) and g (τ ) are linearly independent. Since the two sets of inner
knots converge to σ and τ respectively, there must be an N such that the matrix Mk defined in (15) is
nonsingular for all k > N and 0 < kMk−1 k2 ≤ R12 for some positive constant R12 independent of sk and
tk . Let k be an integer greater than N and set
ςk =
max
l=1,...,d−1
|σ − skik +l |,
δk =
max
l=1,...,e−1
|τ − tkjk +l |.
(19)
We know from Lemma 15 that k(σ k − σ, τ k − τ )T k2 = kMk−1 v k k2 ≤ R12 kv k k2 . Using (19) and Lemma
3 we obtain
ςk 2
2
2
2
2
kv k k2 ≤ ςk KF ′′ + δk KG′′ ≤ R13 (ςk + δk ) = R13 δk 2
with R13 = max(KF ′′ , KG′′ ). Defining R11 = R12 R13 yields (18).
According to Lemma 16 the inner knots converge to the intersection (σ, τ ). Theorem 17 therefore
shows that {σ k , τ k } converges quadratically to the intersection. Our practical experience is that the
sequence converges quadratically in every max(d − 1, e − 1)-step.
5
Examples
In the last section we showed convergence and a quadratic convergence rate for Algorithm 1. We will now
consider some examples that illustrate the behaviour of the algorithm and compare it to Bézier clipping
[13] and the uniform subdivision approach. We have chosen to compare with Bézier clipping as this
method also has quadratic convergence as recently proved in [11], and we compare with the subdivision
strategy as it is widely known.
Let us first give a quick review of Bézier clipping. This method only works for Bézier curves, hence the
spline curves need to be converted to composite Bézier representation first. In short, Bézier clipping cuts
away regions where one Bézier curve is guaranteed to not intersect the other. To do this it alternately
K. Mørken, M. Reimers, Chr. Schulz; Intersections of Planar Spline Curves; pre-print
15
clips one curve against a ’fat line’ of the other. Let L denote the line determined by the end control
points b0 , bd of f and let distL (x) be the signed distance of x to L. Then the fat line along L is defined
by {x | dmin ≤ distL (x) ≤ dmax } where dmin = min0≤i≤d (distL (bi )) and dmax = max0≤i≤d (distL (bi )).
To clip g against the fat line along L, the distance function distL (g) is computed. Observe that this
distance function can naturally be represented as a Bézier function. Finally the convex hull property of
Bézier functions is used to cut away regions where the distance function is guaranteed to be smaller than
dmin or greater than dmax . If the resulting interval is not small enough according to some heuristic, the
curve with the larger parameter interval is subdivided and Bézier clipping is continued with both halves.
For more information see [11, 13].
For the subdivision algorithm we simply maintain a stack of curve pairs which may intersect, similarly
to the generic algorithm described in [15]. As long as the stack is not empty and no intersection is found,
the first pair of curves is removed from the stack and is processed. If the convex hulls of the two curves
overlap and the parameter intervals of the curves are small enough, an intersection is assumed at the
center of both intervals. If one parameter interval is not small enough, the curve with the larger interval
is subdivided in the middle and both combinations are put back on the stack.
In Algorithm 1 we use the density of the knots to determine convergence. Using the notation of
Lemma 16, it is shown in [7] that for σ k ∈ [s̄ki−1 , s̄ki ) the distance between a spline and its control
polygon can be bounded by
kf (σ k ) − Γf ,s (σ k )k2 = O(h2 ),
with
h := max(σ k , ski+d−1 ) − min(σ k , ski+1 )
for small enough h. From Lemma 16 we know that the knots ski+1 , . . . , ski+d−1 as well as σ k converge to
an accumulation point, hence h goes to zero. If now h < ǫ for both curves, where ǫ is a given tolerance,
an intersection at the current parameter pair is assumed.
The effect of inserting the intersection of the control polygons into the spline curves is demonstrated in
Figure 1. It is clearly visible how the intersections of the new control polygons approach the intersection
of the spline curves. To compare the actual errors k(σ k , τ k )T − (σ, τ )T k2 in each iteration between
the different methods, we first have to define what we consider to be an iteration. Bézier clipping
and Algorithm 1 are both quadratically convergent when a suitable number of low-level operations are
combined into one. We therefore define one iteration to be this number of low-level operations. Hence
for Algorithm 1 one iteration consists of max(d − 1, e − 1) knot insertions in each curve, whether the knot
pairs come from intersecting control polygons or overlapping local convex hulls as in the limit we will
only have intersecting control polygons. Similarly, in [11] it is shown that in the limit Bézier clipping
will lead to pure clipping steps applied alternately to both curves. Hence, we consider two steps as one
iteration, where one step is either a clipping or a subdivision step. The uniform subdivision method
only exhibits linear convergence, so it is not possible to obtain a quadratically convergent method by
combining a fixed number of low-level operations into one iteration. In the limit Bézier clipping will
split each curve two times in each iteration, leading to four splitting operations in one iteration. As one
splitting is similar to one subdivision step in the subdivision algorithm, we consider four such steps to
be one iteration for this third method. Note that the last iteration in each method may consist of fewer
steps, as the intersection can be located before another complete iteration is finished.
We will now compare the behaviour of the three methods for the Examples 1 to 6 shown in Figure
5. The examples with an odd number have intersecting control polygons, the ones with an even number
do not. The first two examples show two simple polynomial curves with one intersection. The errors
k(σ k , τ k )T − (σ, τ )T k2 after each iteration for those two examples are listed in Table 1. In Example 1,
Algorithm 1 can make direct use of the intersecting control polygons and therefore reaches the intersection
more quickly than Bézier clipping, which first has to make sure that no intersections are missed. At this
point it should be noted that Algorithm 1 does not exclude any parameter interval as non-intersecting
when using control polygon intersections. If the aim is to find all intersections, a final local convex hull
check is necessary in order to make sure that no intersections have been missed. This is in contrast to
Bézier clipping which is based on excluding parameter intervals where no intersections can occur. This
means that Bézier clipping automatically looks for all intersections, which may, at least partly, explain
why it needs more iterations than Algorithm 1. Example 2 illustrates that the local convex hull approach
will lead relatively quickly to intersecting control polygons and from this point onwards a quadratic
convergence rate is observable. It is also clearly visible that both Algorithm 1 and Bézier clipping as
K. Mørken, M. Reimers, Chr. Schulz; Intersections of Planar Spline Curves; pre-print
a) Example 1, d = 3, e = 3
b) Example 2, d = 3, e = 3
c) Example 3, d = 4, e = 5
d) Example 4, d = 8, e = 5
e) Example 5, d = 5, e = 7
f) Example 6, d = 3, e = 3
16
Figure 5: Examples.
Iteration
0
1
2
3
4
5
6
7
34
35
36
37
38
39
EICP
1.2e-02
3.7e-05
3.4e-10
6.2e-17
Example 1
EBC
3.1e-01
2.4e-01
3.5e-01
7.5e-02
7.6e-04
4.0e-08
1.4e-15
ESUB
3.4e-01
2.0e-01
8.7e-02
1.7e-02
1.1e-02
3.5e-03
2.7e-03
1.1e-03
3.3e-13
5.9e-14
5.4e-14
1.6e-14
6.8e-15
3.2e-15
EICP
2.4e-01
2.6e-02
9.5e-04
3.7e-07
1.7e-13
4.7e-16
Example 2
EBC
2.5e-01
8.5e-02
1.2e-03
1.5e-04
1.9e-08
5.0e-16
ESUB
2.6e-01
1.9e-01
1.2e-01
7.8e-02
2.6e-02
1.7e-02
6.3e-03
1.0e-03
2.6e-14
4.9e-15
8.0e-16
Table 1: Error k(σ k , τ k )T − (σ, τ )T k2 in iteration k for Algorithm 1 (EICP ), Bézier Clipping (EBC ) and
recursive subdivision (ESUB ) for Examples 1 and 2.
K. Mørken, M. Reimers, Chr. Schulz; Intersections of Planar Spline Curves; pre-print
Example 3
EBC
6.4e-00
6.2e-00
6.2e-00
5.0e-00
4.3e-00
4.6e-00
5.5e-00
ESUB
4.9e-00
6.4e-00
5.7e-00
4.0e-00
3.1e-00
1.7e-00
1.4e-00
16
17
18
19
20
2.4e-00
3.4e-00
4.7e-00
2.8e-00
1.4e-00
8.3e-04
4.6e-04
1.2e-04
5.8e-05
1.2e-05
28
29
30
31
32
2.5e-02
5.7e-05
2.6e-10
0.0e-17
2.3e-08
6.4e-09
1.4e-09
4.0e-10
1.6e-10
1.2e-11
6.5e-11
1.2e-11
5.3e-12
1.7e-12
6.8e-12
3.8e-12
1.4e-12
3.2e-13
1.1e-13
3.0e-14
6.4e-15
3.8e-15
1.8e-15
1.9e-14
2.4e-15
4.3e-15
2.0e-15
Iteration
0
1
2
3
4
5
6
36
37
38
39
40
41
42
43
44
EICP
6.4e-00
2.3e-01
2.3e-03
8.8e-07
9.8e-14
0.0e-17
EICP
1.3e-00
6.1e-01
3.7e-02
1.6e-05
1.5e-11
8.9e-16
Example 4
EBC
2.1e-00
1.6e-00
1.1e-00
2.0e-00
1.5e-00
8.3e-01
1.6e-00
2.2e-04
5.7e-08
5.7e-15
1.5e-15
17
ESUB
1.9e-00
1.8e-00
6.2e-01
5.0e-01
1.6e-02
5.6e-02
3.0e-02
8.8e-06
1.5e-06
8.3e-07
1.9e-07
8.9e-08
Table 2: Error k(σ k , τ k )T − (σ, τ )T k2 in iteration k for Algorithm 1 (EICP ), Bézier Clipping (EBC ) and
recursive subdivision (ESUB ) for Examples 3 and 4.
K. Mørken, M. Reimers, Chr. Schulz; Intersections of Planar Spline Curves; pre-print
Iteration
0
1
2
3
4
5
6
7
8
9
10
11
12
EICP
3.3e-03
1.9e-06
5.2e-13
5.7e-16
Example 5
EBC
4.5e-01
2.0e-01
9.8e-02
2.6e-02
4.6e-04
2.6e-08
1.0e-16
34
35
36
37
ESUB
5.5e-01
2.1e-01
8.9e-02
3.3e-02
9.1e-03
2.2e-03
1.7e-03
1.4e-03
6.1e-04
2.1e-04
9.2e-05
1.8e-05
1.0e-05
EICP
3.5e-02
2.5e-04
1.2e-07
9.8e-15
3.6e-16
Example 6
EBC
1.9e-01
1.2e-01
8.3e-02
2.9e-02
1.5e-01
1.5e-01
6.4e-03
2.9e-03
7.8e-05
5.0e-08
2.0e-14
5.6e-17
1.5e-14
4.5e-15
4.0e-15
18
ESUB
4.4e-01
3.4e-01
4.6e-01
3.5e-01
3.5e-01
3.6e-01
3.6e-01
3.9e-01
3.6e-01
3.6e-01
3.6e-01
3.6e-01
3.6e-01
3.6e-01
3.6e-01
3.6e-01
3.6e-01
85
86
87
2.0e-14
7.5e-16
3.0e-15
Table 3: Error k(σ k , τ k )T − (σ, τ )T k2 in iteration k for Algorithm 1 (EICP ), Bézier Clipping (EBC ) and
recursive subdivision (ESUB ) for Examples 5 and 6.
Example
Algorithm 1, comp.
Algorithm 1, ins.
Bézier clipping, comp.
Bézier clipping, ins.
Subdivision, comp.
Subdivision, ins.
1
14
14
23(0)
69(0)
94
282
2
21
21
22(0)
66(0)
97
291
3
42
42
56(14)
240(50)
114
513
4
76
76
43(7)
271(37)
104
672
5
38
38
32(6)
188(26)
99
591
6
18
18
41(4)
119(8)
194
582
Table 4: Comparison of number of knots computed(comp.) and inserted(ins.) for the different methods.
For Bézier clipping the conversion costs are included and in addition shown in parentheses.
K. Mørken, M. Reimers, Chr. Schulz; Intersections of Planar Spline Curves; pre-print
19
quadratic methods are superior to the subdivision strategy, which only gives linear convergence.
Examples 3 and 4 are designed to be more difficult for Algorithm 1, and the errors are shown in
Table 2. In Example 3 the control polygons have a lot of false intersections and in Example 4 many local
convex hulls need to be checked before a situation with intersecting control polygons arises. Nevertheless,
Algorithm 1 needs considerably fewer iterations to find the intersection than Bézier clipping.
In the last two Examples we consider situations with several intersections. All three methods find
the same intersection first, hence the errors listed in Table 3 are comparable. For Example 5 the
performance is similar to Example 1. In the last example, Algorithm 1 again locates the intersection
with fewer iterations than Bézier clipping.
The performance of a method is not only determined by the number of iterations, but also by the
amount of work done in each iteration. In order to make a valid efficiency comparison, well tuned and
specialized implementations for each method are necessary. Unfortunately, we currently do not have such
implementations. We compare the number of knots inserted into the curves instead. Here it is important
to note that for Bézier clipping and the subdivision method each knot will be inserted several times
in order to split the curve. Hence we have to differentiate between the number of knots (or parameter
values) computed and the number of knots inserted. For Algorithm 1 those will be identical. For Bézier
clipping we also need to include the knots needed for converting the spline representation into composite
Bézier form. The resulting comparison is shown in Table 4, with conversion costs for Bézier clipping
included and also shown in parentheses. Clearly, the number of knots inserted into the curves is minimal
for Algorithm 1. For the number of computed knots the minimum varies between Bézier clipping and
Algorithm 1 for the different examples. The subdivision method clearly uses both most computed and
inserted knots of all three methods.
6
Conclusion and Future Work
In this paper we have presented a new method for finding intersections of two parametric spline curves.
From the analysis and examples it is clear that the resulting algorithm is a Newton-like method that
achieves a quadratic convergence rate for transversal intersections without the need for a starting point.
For non-transversal intersections, however, the convergence is linear. An area for future research is to
develop a more efficient algorithm with higher order convergence for non-transversal intersections.
When considering overlapping local convex hulls in Algorithm 1 the midpoints of the corresponding
intervals are inserted. This is done for convenience as it is simple and guaranteed to lead to nonintersecting local convex hulls for non-intersecting curves. However, it is probably not the best possible
choice of knots to insert. With more research one might be able to determine a better knot pair in this
situation that leads to non-intersecting local convex hulls more quickly.
References
[1] Wolfgang Böhm. Inserting new knots into B-spline curves. Computer-Aided Design, 12(4):199–201,
July 1980.
[2] Tor Dokken. Aspects of Intersection Algorithms and Approximations. PhD-thesis, University of
Oslo, 1997, revised 2000.
[3] Gerald Farin. Curves and surfaces for CAGD: a practical guide. Morgan Kaufmann Publishers Inc.,
San Francisco, CA, USA, 5th edition, 2002.
[4] Jeffrey M. Lane and Richard F. Riesenfeld. A Theoretical Development for the Computer Generation
and Display of Piecewise Polynomial Surfaces. IEEE Transactions on Pattern Analysis and Machine
Intelligence, 2(1):35–46, 1980.
[5] Tom Lyche and Knut Mørken. Spline Methods, draft. Department of Informatics, University of
Oslo, URL=http://heim.ifi.uio.no/knutm/komp04.pdf, 2004.
20
K. Mørken, M. Reimers, Chr. Schulz; Intersections of Planar Spline Curves; pre-print
[6] Knut Mørken and Martin Reimers. An unconditionally convergent method for computing zeros of
splines and polynomials. Mathematics of Computation, 76(258):845–865, 2007.
[7] Knut Mørken and Martin Reimers. Second order multiple root finding. In progress, 2008.
[8] Bernard Mourrain and Jean-Pascal Pavone. Subdivision methods for solving polynomial equations.
Research report, INRIA Sophia Antipolis, 2005.
[9] Lyle Ramshaw. Blossoming: A connect-the-dots approach to splines. Research Report 19, Compaq
Systems Research Center, Palo Alto, CA, June 1987.
[10] Ulrich Reif. Best bounds on the approximation of polynomials and splines by their control structure.
Computer Aided Geometric Design, 17(6):579–589, 2000.
[11] Christian Schulz. Bézier clipping is quadratically convergent. Computer Aided Geometric Design,
26(1):61–74, January 2009.
[12] Larry L. Schumaker. Spline Functions: Basic Theory. John Wiley & Sons, Inc., New York, 1981.
[13] T. W. Sederberg and T. Nishita. Curve intersection using Bézier clipping. Computer Aided Design,
22(9):538–549, 1990.
[14] SISL - The SINTEF Spline Library. URL = http://www.sintef.no/content/page1
12043.aspx.
[15] Chee K. Yap. Complete Subdivision Algorithms, I: Intersection of Bezier Curves. In SCG ’06:
Proceedings of the twenty-second annual symposium on Computational geometry, pages 217–226,
New York, NY, USA, 2006. ACM.
Download