Computation of The Minimum Distance Between Bezier Curves

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

Computers & Graphics 35 (2011) 677684

Contents lists available at ScienceDirect

Computers & Graphics


journal homepage: www.elsevier.com/locate/cag

Short Communication to SMI 2011

Computation of the minimum distance between two Bezier curves/surfaces$


Jung-Woo Chang a, Yi-King Choi a, Myung-Soo Kim b, Wenping Wang a,
a
b

Department of Computer Science, The University of Hong Kong, Hong Kong


School of Computer Science and Engineering, Seoul National University, Republic of Korea

a r t i c l e i n f o

abstract

Article history:
Received 10 December 2010
Received in revised form
13 March 2011
Accepted 14 March 2011
Available online 6 April 2011

We present an efcient and robust method based on the culling approach for computing the minimum
distance between two Bezier curves or Bezier surfaces. Our contribution is a novel dynamic subdivision
scheme that enables our method to converge faster than previous methods based on binary subdivision.
& 2011 Elsevier Ltd. All rights reserved.

Keywords:
Minimum distance computation
Bezier curve and surface
Bounding volume hierarchy

1. Introduction
The computation of minimum distance between two models is an
important geometric query which is used in various areas including
robotics, computer graphics, computer games, simulation, virtual
reality and haptic prototyping [7]. In this paper, we propose a
minimum distance computation algorithm for two Bezier curves/
surfaces.
Existing approaches that compute the minimum distance
between two free-form curves/surfaces fall in two groups: rootnding-based methods and culling-based methods. The rootnding-based methods compute the solution of geometric queries
by solving a set of non-linear equations. Root-nding-based
methods, when used alone, tend to suffer from inefciency, since
it needs to compute all local minima between two curves/surfaces
and most of them are redundant.
The general framework of the culling-based approach for distance computation of two curves or surfaces [7] uses a hierarchical
structure of subdivision and invokes three operations: estimation of
the lower bound of minimum distance between nodes, estimation
of the upper bound of minimum distance between nodes, and
subdivision of nodes where a node represents a curve segment or a
surface patch as a result of subdivision.
During the subdivision process, a global upper bound of the
minimum distance is always maintained, which is dened as the
smallest of the upper bounds for the minimum distance for all pairs
$
The work of W. Wang was partially supported by the Research Grant Council
of Hong Kong (718209 and 718010), and the State Key Program of NSFC project
(60933008). This work was also supported in part by NRF Research Grant
(2010-0014351).
 Corresponding author. Tel.: 852 28597074; fax: 852 25598447.
E-mail addresses: jungwoochang@gmail.com (J.-W. Chang),
wenping@cs.hku.hk (W. Wang).

0097-8493/$ - see front matter & 2011 Elsevier Ltd. All rights reserved.
doi:10.1016/j.cag.2011.03.025

of nodes. If the lower bound of the minimum distance for a pair of


nodes is greater than the global upper bound, then the pair is
pruned and it is excluded from further consideration in minimum
distance computation. Otherwise the pair is kept and its upper
bound is found and used to improve the global upper bound. The
difference between the global upper bound and the lower bound of
each node pair is used to guide the subdivision procedureif the
difference is smaller than a pre-specied threshold, the computation for the pair is terminated; otherwise the nodes of the pair are
subdivided. The whole procedure is terminated when the differences of all the existing pairs are smaller than the threshold. The
convergence of such an algorithm is measured by how fast this
difference between the global upper bound and the lower bound for
a pair of nodes converges to zero as the subdivision level increases.
In this paper, we propose an algorithm based on the culling
approach for computing the minimum distance between Bezier
curves or Bezier surfaces. Our contribution is a new scheme of node
subdivision that makes use of the closest pair of points on the convex
hulls of control points. We shall show that this new subdivision
scheme provides a much faster convergence than binary subdivision.
The rest of this paper is organized as follows. We review the
previous work on minimum distance computation in Section 2.
Section 3 describes our algorithm. In Section 4 we show the
efciency of our algorithm by giving several experimental results.
Finally, we conclude this paper in Section 5.

2. Preliminaries
2.1. Minimum distance between polyhedral models
Early works about minimum distance computation often focused
on the minimum distance between rather simple primitives such as

678

J.-W. Chang et al. / Computers & Graphics 35 (2011) 677684

convex polyhedral models. Lin and Canny [11] proposed a method


that computes the distance between two convex polyhedra by using
the Voronoi regions of convex polyhedra. Gilbert et al. [4] proposed
an algorithm about minimum distance between two convex objects.
The algorithm is well known as the GJK algorithm and is widely
used due to its efciency and simplicity. There are efcient and
robust implementations of the GJK algorithm [14].
After the late 90s, algorithms on distance computation between
non-convex triangular meshes were proposed. Johnson and Cohen
[7] presented a general framework for minimum distance computation. A bounding volume hierarchy-based approach which is
widely used to solve collision detection problems [5,6,8] is used to
compute the minimum distance between meshes. For distance
computation between triangular meshes, Johnson and Cohen [7]
used oriented bounding box (OBB) as the bounding volume.
Instead of OBB, Larsen et al. [9] proposed to use rectangle swept
sphere (RSS) since computing distance between two RSSs is much
more efcient than that between two OBBs.
2.2. Minimum distance between curves/surfaces
The minimum distance between two parametric curves can be
acquired by solving the following equations [13]:
C1 uC2 v 

dC 1 u
0,
du

C1 uC2 v 

dC 2 v
0:
dv

Similarly, the minimum distance between two parametric surfaces can be acquired by solving the following equations:
S1 u,vS2 s,t 

@S1 u,v
0,
@u

S1 u,vS2 s,t 

@S1 u,v
0,
@v

@S2 s,t
S1 u,vS2 s,t 
0,
@s
S1 u,vS2 s,t 

@S2 s,t
0:
@t

The methods for solving a set of non-linear equations as given


above can be found in [3,12].
Elber and Grandine [2] presented a method for nding the
minimum and Hausdorff distance between two parametric curves
or surfaces by solving a set of non-linear equations. Lennerz and

Schomer
[10] proposed a method that can reduce a set of nonlinear equations to univariate polynomials for nding minimum
distance between two quadratic curves or surfaces.
The general framework of Johnson and Cohen [7] which is
mentioned above can also be used to compute minimum distance
between B-Spline surfaces. On the other hand, Chen et al. [1]
proposed a culling-based algorithm which computes the minimum
distance between two Bezier curves. Given two Bezier curves C1(u)
and C2(v), the bivariate function Su,v C1 u C2 v2 can be
expressed in Bernstein form. The minimum distance between C1(u)
and C2(v) is then computed by using subdivision of bivariate
Bernstein polynomial and the sphere clipping method.

and nally describe the method for dealing with two Bezier
surfaces.
3.1. General framework
We adopt the culling-based framework to compute the minimum distance between two Bezier curves/surfaces. We will
describe the following basic operations: the estimation of lower
bound of the minimum distance between two nodes, the estimation of the upper bound of the minimum distance, and node
subdivision. A pruning scheme based on these operations is
shown in Algorithm 1. Throughout the algorithm, a global upper
bound of the minimum distance is maintained which converges
to the actual minimum distance between two curves/surfaces.
Algorithm 1 (Computing the minimum distance between a given
pair of nodes).
Require: The global upper bound of minimum distance a, two
nodes N1, N2, and a tolerance e
if upperboundN1 ,N2 r a then
aupperboundN1 ,N2
end if
if lowerboundN1 ,N2 Z a1e then
return a
else
Subdivide N1 into N11 and N12
Subdivide N2 into N21 and N22
amina,Algorithm 1N11 ,N21 , a
amina,Algorithm 1N11 ,N22 , a
amina,Algorithm 1N12 ,N21 , a
amina,Algorithm 1N12 ,N22 , a
end if
return a
Given any two nodes, each representing a subdivided part of a
curve or a surface, we rst compute the upper bound of the
minimum distance between two nodes. If the computed upper
bound is less than the global upper bound of minimum distance,
the global upper bound is updated by the computed upper bound.
After that, the lower bound of minimum distance between two
nodes is computed. If the computed lower bound is greater than
the global upper bound, we can then guarantee that the minimum
distance between the two objects does not occur in the given pair
of nodes. Thus, the given pair of nodes can be culled out. This
culling is the main source of performance improvement of this
approach compared to root-nding-based methods. If the computed lower bound is not greater than the global upper bound, we
need to further subdivide the given nodes and perform the
distance computation for the subdivided nodes.
The minimum distance computation between two objects can
be solved by calling Algorithm 1 with two root nodes that
correspond to the entire curves or surfaces, and an initial a which
is larger than the minimum distance between the two objects.
3.2. Minimum distance between two Bezier curves
Let two Bezier curves be dened as follows:
n
X

Pi Bni u,

m
X

Qj Bm
j v,

3. Algorithm

C1 u

In this section, we will present the details of our method. We


will rst introduce the general framework for computing the
minimum distance. Then we will proceed to describe the method
that computes the minimum distance between two Bezier curves,

where u,v A 0,1 and Bni u and Bm


j v are the nth and mth degree
Bezier basis functions. In this paper, we assume C1(u) and C2(v)
are two space curves in R3 . Thus, the control points Pi and Qj are
points in 3D space.

i0

C2 v

j0

J.-W. Chang et al. / Computers & Graphics 35 (2011) 677684

3.2.1. Upper bound of the minimum distance between


zier curves
two Be
Given two sample points p A C1 u and q A C2 v, it is guaranteed that the distance between p and q is greater than or equal to
the minimum distance between C1(u) and C2(v). Thus, the upper
bound of minimum distance between C1(u) and C2(v) can be
acquired by sampling two points. We make use of the end point
interpolation property to reduce the sampling cost. Since the four
equations P0 C1 0, Pn C1 1, Q0 C2 0, Qm C2 1 hold, the
upper bound of the minimum distance can be any one of jP0 Q0 j,
jP0 Qm j, jPn Q0 j and jPn Qm j. Hence, we select the minimum
among these four values as the upper bound.
3.2.2. Lower bound of the minimum distance between
zier curves
two Be
The method proposed by Johnson and Cohen [7] uses the
distance between two bounding volumes as the lower bound of
the minimum distance. The convex hull of the control points is
taken as the bounding volume of a B-Spline surface and the
distance between two convex hulls is computed by using the GJK
algorithm [4].
We take similar approach to compute the lower bound of the
minimum distance between two Bezier curves. We consider the
convex hull of the control points as the bounding volume of a
Bezier curve and we compute the distance between two convex
hulls by using van den Bergens efcient implementation [14] of
the GJK algorithm [4]. Since the GJK algorithm only needs the
support operation which computes the supporting vertex for a
given directional vector, we do not even need to explicitly
construct the convex hull.
3.2.3. Subdivision of nodes
In this section, we will discuss in detail the main contribution
of our algorithm, namely, the dynamic scheme for node
subdivision.
Our basic idea is that, since the closest points of two convex
hulls bounding the curves provide, in general, useful information
for the closest points of the two underlying curves, we should use
these closest pair to nd cutting points in subdivision that can
yield faster convergence than the straightforward binary subdivision. Since the cutting points are to be used for computing the
upper bound of the minimum distance, it follows that the closer
the cutting points are to the closest pair of points, the faster is the
convergence.
As is well known, the GJK algorithm used for computing the
distance between two convex hulls nds each point of the closest
pair of points as a convex combination of some of the vertices of
its belonging convex hull. The weights (i.e. coefcients) are
dened by two vectors fx0 ,x1 , . . . ,xn g and fy0 ,y1 , . . . ,ym g, where
Pn
Pm
i 0 xi 1 and
j 0 yj 1. We then choose the two parameters
for further subdivision as follows:
u

n
X
i0

xi 

i
,
n

v

m
X
j0

yj 

j
:
m

Fig. 1 shows two examples of the subdivision of nodes. Two


cubic Bezier curves and their control polygons are drawn in thick
lines, the convex hulls of control points are drawn in thin lines,
and the minimum distance between two convex hulls is indicated
in dotted line. The two weight vectors for Fig. 1(a) are {0.72, 0.28,
0, 0} and {0, 1, 0, 0} and for Fig. 1(b) are {0.72, 0, 0.28, 0} and {0, 1,
0, 0}. In Fig. 1(a), the two given curves are subdivided at the
parameter values u 0:72  30 0:28  13 0  23 0  33 0:093 and
v 0  30 1  13 0  23 0  33 13. Similarly, the two given curves
are subdivided at the parameter values u 0:72  30 0  13 0:28 
2
3

0
1
2
3
1
3 0  3 0:187 and v 0  3 1  3 0  3 0  3 3 in Fig. 1(b).

679

P3

P3

P2

P1

P1

P0

P2

P0
Q1

Q0

Q1

Q2

Q3

Q0

Q2

Q3

Fig. 1. Subdivision of nodes.

Fig. 2. Dynamic subdivision of two Bezier curves. The minimum distance between
two convex hulls is shown in dotted line. (a) shows two initial Bezier curves. The
dots on the curves are where subdivision takes place. (b) shows the two
subdivided curves (which are enclosed by the dotted box in (a)) containing the
pair of points realizing the minimum distance between the two curves after the
rst subdivision. (c) shows further subdivision of the two subdivided curves
(which are enclosed by the dotted box in (b)).

The points on the curves that correspond to the two parameter


values un and vn are also shown in Fig. 1 as dots on the curves.
We show an example illustrating why our subdivision scheme
efciently converges to the global minimum. Fig. 2(a) shows a
pair of two Bezier curves. The precise minimum distance between
two curves is realized at the parameter values u 0.0268 and
v 0.2074. By using our subdivision scheme, the two curves are
subdivided at the parameter values un 0.1569 and vn 0.3333.
The precise parameters that correspond to the global minimum is
contained by two intervals [0, 0.1569] and [0, 0.3333] and we
show the curves that correspond to the intervals in Fig. 2(b). In
the next iteration step, our subdivision scheme subdivides two
curves in Fig. 2(b) at unn 0.3333 and vnn 0.6667 and the interval
that contains the parameters that correspond to the global
minimum is reduced to [0, 0.0523] and [0, 0.2222]. The curves
that correspond to the intervals are shown in Fig. 2(c). The
curves in Fig. 2(c) are further subdivided at unnn 0.3333 and
vnnn 0.825. Then, the parameters that correspond to the global
minimum is contained by two intervals [0.0174, 0.0523] and
[0.1833, 0.2222]. The sizes of both interval is 0.0348 and 0.0389,
which is much smaller than 0.125the size of interval after
applying three binary subdivisions.
For some congurations of the control points, our algorithm
may not converge as fast as the preceding case. Fig. 3 shows such
an example. In this example, the two curves are subdivided at the
parameter values un 0.667 and vn 0.667. However, the minimum distance between two curves is realized by the point pair P0
and Q0 whose parameter values are un 0 and vn 0, respectively.

680

J.-W. Chang et al. / Computers & Graphics 35 (2011) 677684

Due to these geometric congurations, it is difcult to provide


a rigorous proof about the improved convergence in all cases.
Instead we provide some insights using experimental data in
Appendix A.
3.3. Minimum distance between two Bezier surfaces
Let two Bezier surfaces be dened as follows:
S1 u,v

m X
n
X

n
Pij Bm
i uBj v,

points. The minimum distance between the two convex hulls will
then be used as the lower bound of the minimum distance.
3.3.3. Subdivision of nodes
Let the two closest points computed by the GJK algorithm be
dened by the two weight vectors fx00 ,x01 , . . . x0n ,x10 , . . . xmn g and
Pm Pn
Pg
fy00 ,y01 , . . . y0h ,y10 , . . . ygh g, where
i0
j 0 xij 1 and
k0
Ph
y

1.
The
four
parameters
for
subdivision
are
given
as
l 0 kl
follows:

i0j0

u
S2 s,t

g
X

h
X

m X
n
X

i
,
m

v

k
ykl  ,
g
k0l0

t

i0j0

Qkl Bgk sBhl t,

k0l0
g
n
h
where u,v,s,t A 0,1 and Bm
i u, Bj v, Bk s, and Bl t are m th, n th,
g th, and hth degree Bezier basis functions. Similar to the curve
case, the control points Pij and Qkl are points in 3D space.

zier
3.3.1. Upper bound of the minimum distance between two Be
surfaces
Given two Bezier surfaces S1 and S2, the eight equations P00
S1 0,0, P0n S1 0,1, Pm0 S1 1,0, Pmn S1 1,1, Q00 S2 0,0,
Q0h S2 0,1, Qg0 S2 1,0, and Qgh S2 1,1 hold. There are 16
possible upper bound values from the Cartesian product of
{P00, P0n, Pm0, Pmn} and fQ00 ,Q0h ,Qg0 ,Qgh g. We select the minimum
of the 16 values as the upper bound of the minimum distance.
3.3.2. Lower bound of the minimum distance between
two Bezier surfaces
The approach used to compute the lower bound of the
minimum distance between two Bezier curves can also be applied
to the surface case here. We pass the control points of the two
Bezier surfaces and provide the support function to the GJK
algorithm. Then the GJK algorithm will determine the minimum
distance between the two convex hulls of the control points and a
pair of closest points as the weighted sum of the given control

s

g X
h
X

xij 

m X
n
X

j
xij  ,
n
i0j0
g X
h
X

l
ykl  :
h
k0l0

To deal with surfaces, we also need to decide the subdivision


direction. Let the parameter domain of a given surface patch
S(u,v) be umin ,umax   vmin ,vmax . We then subdivide S(u,v) with
respect to the parameter whose domain is of a larger interval.
For example, if umax umin Zvmax vmin , the patch S(u,v) is subdivided at un and two resulting subdivided surfaces have the
parameter domains umin ,umin u umax umin   vmin ,vmax  and
umin u umax umin ,umax   vmin ,vmax .

4. Experimental results
We implemented our algorithm in C and tested our algorithm on a PC with an Intel X5460 3.16 GHz processor and 8 GB
main memory. For each of minimum distance computation
between two Bezier curves and between two Bezier surfaces,
eight examples are tested. In addition to this, a set of randomly
sampled examples are also tested for two Bezier curves case. The
tolerance e is set to 10  8 for every example.
4.1. Minimum distance between two Bezier curves

P1

P0

P3

P2
Q2

Q0

Q1

Q3

Fig. 3. The examples that our subdivision scheme poorly works.

We have tested our algorithm for two Bezier curves in eight


examples as shown in Fig. 4. Our examples include four bulging
examples (in which all edges of the control polygon are edges of
the convex hull of the control points) and four dented examples
(in which at least one edge of the control polygon is not an edge of
the convex hull of the control points).
In Fig. 4(a)(d) are the bulging examples and (e)(h) are the
dented examples. For each set of the bulging and dented examples, we have two cases in which the curves are of low order
(degree 4) and two cases in which the curves are of high order
(degree 8). In Fig. 4(a), (b), (e), and (f) are for the low order curves
while (c), (d), (g), and (h) are for the high order curves. Furthermore, for each of the high and low order cases, we tested a close
example in which the convex hulls of two Bezier curves cannot be
separated by a plane and a far example in which the convex

Fig. 4. The eight examples for minimum distance computation between two 3D Bezier curves. The shortest distances are indicated by the blue lines. (Note that two curves
in subgures (b) and (d) do not intersect in 3D space.) (For interpretation of the references to color in this gure legend, the reader is referred to the web version of this
article.)

J.-W. Chang et al. / Computers & Graphics 35 (2011) 677684

hulls can be separated with a plane. In Fig. 4(a), (c), (e), and (g) are
the far examples and (b), (d), (f), and (h) are the close examples.
To compare the performance of our algorithm with previous
approach, we implemented the algorithm as suggested by Chen
et al. [1]. We also tested against a variant of our algorithm by
replacing the dynamic subdivision scheme with the plain binary
subdivision to examine the benet brought about by the new subdivision scheme.
The corresponding results are shown in Table 1. Our algorithm
is faster than Chen et al. [1] by about 2193% for the given
Table 1
The execution time for the curve examples (in millisecond).

Bulging
Low
Far
Close
High
Far
Close
Dented
Low
Far
Close
High
Far
Close

Chen et al.

Binary

Dynamic

0.4276
0.2777

0.2809
0.6292

0.0552
0.2177

0.7621
0.4346

0.3563
0.7695

0.0523
0.2404

0.2038
0.4945

0.1512
0.4815

0.1184
0.1545

0.3786
0.7011

0.5568
0.4813

0.1609
0.0985

Table 2
The average execution time for the randomly sampled curve examples (in
millisecond).

Low
High

Chen et al.

Binary

Dynamic

0.18716
0.57230

0.33665
0.81164

0.13353
0.27996

Table 3
The number of subdivisions for the curve examples.

Bulging
Low
Far
Close
High
Far
Close
Dented
Low
Far
Close
High
Far
Close

Chen et al.

Binary

Dynamic

222
182

345
793

57
261

167
99

341
793

37
221

132
281

209
621

157
185

57
174

625
461

165
73

681

examples. It is also faster than the binary subdivision variation by


about 2185%. Chen et al. [1] is faster than the binary subdivision
variation for three examples, while the binary subdivision variation is faster than Chen et al. [1] for ve examples.
In addition, we also tested the computation of distance between
two randomly sampled Bezier curves. The control points of each
Bezier curve are randomly sampled points in the unit cube [0,1]3. We
sampled 100 pairs of Bezier curves for each of low order (degree 4)
and high order (degree 8) cases. Table 2 shows the average execution
time for all 100 sampled pairs of Bezier curves. Our algorithm is
faster than Chen et al. [1] by 29% for low order case and 51% for high
order case. It is faster than the binary subdivision variation by 60%
for low order case and 66% for high order case. The implementation
of Chen et al. [1] is faster than the binary subdivision variation for
both of the low order and high order cases.
Table 3 clearly shows that the signicant performance
improvement of our algorithm due to our subdivision scheme
by comparing against the binary subdivision variation. Our algorithm needs 2489% fewer subdivisions than the binary subdivision variation. For each example, the ratio of reduction in the
number of subdivision is similar to the ratio of performance
improvement over the binary subdivision variation.
On the other hand, our algorithm needs fewer subdivisions
than Chen et al. [1] in four examples and needs more subdivisions
in the other four examples. Thus, the performance improvement of
our algorithm over Chen et al. [1] is attributed to our faster
processing for a pair of nodes. Our algorithm is slower than Chen
et al. [1] for the two operations in estimating the upper bound and
the lower bound of the minimum distance since Chen et al. [1]
only needs to compare the values of the Bernstein coefcients. The
performance improvement of our algorithm over [1] therefore
mainly relies on the faster node subdivision operation.
The subdivision of an nth order Bezier curve by using de
Casteljaus algorithm needs n(n  1) multiplications between
control points, and 12 nn1 additions between control points.
Since the control points of Bezier curve are 3D points, we need
3nn1 multiplications and 32 nn1 additions between scalar
values. Thus, we need a total of 3mm1 3nn1 multiplications and 32 mm1 nn1 additions to subdivide two given
Bezier curves of order m and n into four Bezier curves.
On the other hand, given two curves of degrees m and n, Chen
et al. [1] construct a bivariate Bernstein polynomial whose degree
is (2m, 2n). The operations needed for subdivision are 4mn2m1
multiplications and 2mn2m1 additions when the bivariate
Bernstein polynomial is subdivided at un and 4mn2n1 multiplications and 2mn2n1 additions when the polynomial is
subdivided at vn. Thus, it is clear that the implementation of Chen
et al. [1] needs much more operations than our algorithm especially for the high order cases, which is shown in Tables 1 and 2.
4.2. Minimum distance between two Bezier surfaces
We tested our algorithm for two Bezier surfaces with eight
examples including bulging and dented examples, low order and
high order examples, and far and close examples similar to the
curve case. For low order examples, we consider two biquartic

Fig. 5. The eight examples for minimum distance computation between two Bezier surfaces. The shortest distances are indicated by the blue lines. (For interpretation of
the references to color in this gure legend, the reader is referred to the web version of this article.)

682

J.-W. Chang et al. / Computers & Graphics 35 (2011) 677684

Bezier surfaces, while for high order examples, two Bezier


surfaces whose degrees are (8, 8) are considered. Fig. 5 illustrates
these eight examples.
Since Chen et al. [1] can only deal with two Bezier curves but
not surfaces, we compare the performance of our algorithm with
its binary subdivision variation. Table 4 shows the corresponding
results. Our algorithm is faster than the implementation based on
binary subdivision by about 1873%.

Table 4
The execution time for the surface examples (in millisecond).
Binary
Bulging
Low
Far
Close
High
Far
Close
Dented
Low
Far
Close
High
Far
Close

Dynamic

7.2493
17.3391

5.6794
6.0338

19.2301
38.5739

6.5749
10.1035

6.6035
8.5094

4.4393
4.1878

12.6394
37.3857

5.4727
30.3778

In this section, we show the relationship between the number


of subdivisions and the subdivision scheme using experimental
data. We show that our subdivision scheme needs less number of
subdivisions compared with binary subdivision due to the fast
convergence of our subdivision scheme.
Figs. A.1 and A.2 show the experimental data about the number of
subdivisions and convergence for two examples we used previously

dynamic
binary
chen

0.3

We have presented an efcient algorithm for minimum distance


computation between two Bezier curves or surfaces. We adopt the
general framework of Johnson and Cohen [7]. To improve the
performance of general framework, we propose a subdivision
scheme for node subdivision. Our scheme is based on the heuristic
that the closest point pair of the convex hulls of the control points
can approximate the closest point pair of underlying curves or
surfaces. The experimental results show that our approach achieves
a remarkable speed up as compared to conventional algorithms.
Although the end point interpolation property generally does
not hold for B-Spline and NURBS curves and surfaces, we can still
apply the general framework and our subdivision scheme for
minimum distance computation between B-Spline and NURBS
curves and surfaces. Therefore, our algorithm can easily be
extended to deal with B-Spline and NURBS curves/surfaces.

Appendix A. Approximation of closest points

0.4
0.35

5. Conclusion

dynamic
binary
chen

0.01

0.25

0.0001

0.2
0.15

1e-006

0.1

1e-008

0.05

1e-010

0
0

10

12

14

16

10

12

14

16

Fig. A.1. Experimental data about the convergence of our algorithm for the bulging, low order, and far example.

J.-W. Chang et al. / Computers & Graphics 35 (2011) 677684

0.4
0.35
0.3
0.25
0.2
0.15
0.1
0.05
0

dynamic
binary
chen

683

dynamic
binary
chen

0.01
0.0001
1e-006
1e-008
1e-010

10 12 14 16

10 12 14 16

Fig. A.2. Experimental data about the convergence of our algorithm for the dented, high order, and close example.

in Section 4.1 including the case of bulging, low order, and far curves
(which is shown in Fig. 4(a)) and the case of dented, high order, and
close curves (which is shown in Fig. 4(h)). In subgure (a) of each
gure, we show all the subdivisions that are required by the binary
subdivision method in the uv-plane. We also show all subdivisions
that are needed by Chen et al. [1] in subgure (b) of each gure, and
that are needed by our subdivision scheme in subgure (c). Subgures (d)(f) also show the subdivisions performed by each algorithm. However, they only show the subdivisions which converges
to the global minimum. By comparing between (a) and (c), and
between (d) and (f), it is clear that our subdivision scheme subdivide
a given domain at a point which is closer to the global minimum
than the binary subdivision method. Due to this approximation using
the closest points of the convex hulls, our subdivision scheme needs
fewer number of subdivisions to nd the global minimum.
The subgures (g) and (h) of Figs. A.1 and A.2 show the faster
convergence of our algorithm in some graphs. For each given pair
of nodes, we need to compute the upper bound of the minimum
distance and global upper bound is updated if computed upper
bound is smaller than the global upper bound. Since this global
upper bound converges to actual minimum distance, we show the
convergence of methods by plotting global upper boundactual
minimum distance in (g). In (h), we plot the values in (g) by using
log scale. These graphs clearly show that our subdivision scheme
provides faster convergence to the actual minimum distance than
binary subdivision. These graphs also show that our subdivision
scheme provides faster convergence than the subdivision scheme

of Chen et al. [1], though we should note that the subdivision


scheme of Chen et al. [1] subdivides a given parameter domain
into two, while our scheme subdivides the domain into four.

References
[1] Chen X-D, Chen L, Wang Y, Xu G, Yong J-H, Paul J-C. Computing the minimum
distance between two Bezier curves. Journal of Computational and Applied
Mathematics 2009;229(1):294301.
[2] Elber G, Grandine T. Hausdorff and minimal distances between parametric
freeforms in R2 and R3. In: Proceedings of the geometric modeling and
processing; 2008. p. 191204.
[3] Elber G, Kim M-S. Geometric constraint solver using multivariate rational
spline functions. In: Proceedings of the sixth ACM symposium on solid
modeling and applications; 2001. p. 110.
[4] Gilbert EG, Johnson DW, Keerthi SS. A fast procedure for computing the
distance between complex objects in three-dimensional space. IEEE Journal
of Robotics and Automation 1988;4(2):193203.
[5] Gottschalk S, Lin M, Manocha D. OBB-Tree: a hierarchical structure for rapid
interference detection. In: Proceedings of SIGGRAPH, vol. 96; 1996. p. 17180.
[6] Hubbard P. Collision detection for interactive graphics applications. IEEE
Transactions on Visualization and Computer Graphics 1995;1(3):21830.
[7] Johnson DE, Cohen E. A framework for efcient minimum distance computations. In: Proceedings of IEEE international conference on robotics & automation; 1998. p. 367884.
[8] Klosowski J, Held M, Mitchell J, Sowizral H, Zikan K. Efcient collision
detection using bounding volume hierarchies of k-DOPs. IEEE Transactions
on Visualization and Computer Graphics 1998;4(1):2137.
[9] Larsen E, Gottschalk S, Lin MC, Manocha D. Fast proximity queries with swept
sphere volumes. In: Proceedings of international conference on robotics and
automation; 2000. p. 371926.

684

J.-W. Chang et al. / Computers & Graphics 35 (2011) 677684

[10] Lennerz C, Schomer


E. Efcient distance computation for quadratic curves
and surfaces. In: Proceedings of the geometric modeling and processing;
2002. p. 609.
[11] Lin MC, Canny JF. A fast algorithm for incremental distance calculation. In:
Proceedings of IEEE international conference on robotics and automation;
1991. p. 100814.

[12] Patrikalakis NM, Maekawa T. Shape interrogation for computer aided design
and manufacturing. Springer; 2001.
[13] Piegl L, Tiller W. The NURBS book. Springer; 1995.
[14] van den Bergen G. A fast and robust GJK implementation for collision
detection of convex objects. Journal of Graphics Tools 1999;4(2):725.

You might also like