Professional Documents
Culture Documents
Computation of The Minimum Distance Between Bezier Curves
Computation of The Minimum Distance Between Bezier Curves
Computation of The Minimum Distance Between Bezier Curves
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
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
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
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
i0
C2 v
j0
n
X
i0
xi
i
,
n
v
m
X
j0
yj
j
:
m
679
P3
P3
P2
P1
P1
P0
P2
P0
Q1
Q0
Q1
Q2
Q3
Q0
Q2
Q3
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)).
680
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
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
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. 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.)
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
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
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
dynamic
binary
chen
0.3
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.
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
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
[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.