0% found this document useful (0 votes)
59 views18 pages

Computation of Shortest Paths On Free-Form Parametric Surfaces

This document summarizes a 1996 journal article from the Journal of Mechanical Design, ASME Transactions that presents a new approach for computing the shortest path (geodesic) between two points or between a point and a curve on a free-form parametric surface. The article provides background on differential geometry properties relevant to geodesics. It then describes using a finite difference method and relaxation iterations to discretize and solve the two point boundary value problem to find shortest paths. Examples are given to illustrate the method.

Uploaded by

ritviz doshi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views18 pages

Computation of Shortest Paths On Free-Form Parametric Surfaces

This document summarizes a 1996 journal article from the Journal of Mechanical Design, ASME Transactions that presents a new approach for computing the shortest path (geodesic) between two points or between a point and a curve on a free-form parametric surface. The article provides background on differential geometry properties relevant to geodesics. It then describes using a finite difference method and relaxation iterations to discretize and solve the two point boundary value problem to find shortest paths. Examples are given to illustrate the method.

Uploaded by

ritviz doshi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

Journal of Mechanical Design, ASME Transactions, Vol. 118 No. 4, pages 499-508, 1996.

Computation of Shortest Paths on Free-Form Parametric


Surfaces
Takashi Maekawa
Massachusetts Institute of Technology
Department of Ocean Engineering
Design Laboratory, Cambridge, MA 02139-4307, USA

Abstract
Computation of shortest paths on free-form surfaces is an important problem in ship design, robot motion plan-
ning, computation of medial axis transforms of trimmed surface patches, terrain navigation and NC machining.
The objective of this paper is to provide an ecient and reliable method for computing the shortest path be-
tween two points on a free-form parametric surface and the shortest path between a point and a curve on a
free-form parametric surface. These problems can be reduced to solving a two point boundary value problem.
Our approach for solving the two point boundary value problem is based on a relaxation method relying on nite
di erence discretization. Examples illustrate our method.
Keywords: geodesics, boundary value problem, nite di erence method, relaxation method

1 Introduction
The history of geodesic lines begins with the study by Johann Bernoulli, who solved the problem of the shortest
distance between two points on a convex surface in 1697, according to [15]. He showed that the osculating plane
of the geodesic line must always be perpendicular to the tangent plane. The equation of the geodesics was rst
obtained by Euler (1732) for a surface given by F (x; y; z ) = 0. His attention to the problem was due to Johann
Bernoulli, probably through the aid of his nephew Daniel, who was at St. Petersburg with Euler [14]. Bliss [2]
obtained the geodesic lines on the anchor ring, which has a torus shape, analytically. Munchmeyer and Haw
[10] were the rst to introduce the geodesic curve to the CAGD community. They applied the geodesic curve
in ship design, namely to nd out the precise layout of the seams and butts in the ship hull. Beck et al [1]
computed both the initial-value integration and boundary-value integration of geodesic paths, using the fourth
order Runge-Kutta method on a bicubic spline surface. However their paper does not provide any details of the
shooting method for the solution of the boundary value problem. Patrikalakis and Bardis computed geodesic
o sets of curves on rational B-spline surfaces using the initial-value integration [11]. One application of such
o sets is automated construction of linkage curves for free-form procedural blending surfaces. Sneyd and Peskin
[13] investigated the computation of geodesic paths on a generalized cylinder as initial value problem using a
second order Runge-Kutta method. Their work was motivated by constructing the great vessels of the heart out
of geodesic bers. Very recently, Kimmel et al. [7] presented a new numerical method for nding the shortest
path on surfaces by calculating the propagation of an equal geodesic-distance contour from a point or a source
region on the surface. The algorithm works on a rectangular grid using the nite di erence approximation. The
shortest path problem is also very active among the robot motion planning and terrain navigation communities,

1
however they usually represent the surface as a polyhedral surface and solve the problem in the eld of linear
computational geometry [9].
In this work a new approach for nding the shortest path between two points on a free-form parametric surface
is introduced. Also a method for computing the shortest path between a point and a curve on a free-form surface
is described. The geodesic path between two points is obtained by rst discretizing the governing equations
by nite di erence on a mesh with m points. Secondly we start with an initial guess and improve the solution
iteratively or in other words relax to the true solution. The shortest path between a point and a curve is obtained
in a similar way but with nested iterations, since we do not know the point on the curve which forms the shortest
path beforehand.
This paper is structured as follows. Section 2 begins with a brief review of relevant di erential geometry properties
of geodesics on a parametric surface. Section 3 describes the nite di erence approach to the two point boundary
value problem. Section 4 explains how to obtain a good initial approximation for the two point boundary value
problem and provides a robust algorithm to nd all the geodesic paths between two points on a surface. Section 5
discusses an algorithm to obtain a geodesic path from a point to a curve on a surface. Finally, section 6 illustrates
our method with examples and concludes the paper.

2 Review of Di erential Geometry


The books by Struik [15], Kreyszig [8], doCarmo [4] o er rm theoretical basis to the di erential geometry aspects
of geodesics. In this section, we summarize the relevant de nitions employed in this work.
A general parametric surface S can be de ned as a vector-valued mapping from two-dimensional uv parameter
domain to a set of three-dimensional xyz coordinates
r(u; v) = [x(u; v); y(u; v); z(u; v)]T : (1)
Let C be an arc length parametrized regular curve on surface r(u; v) which passes through point P as shown in
Figure 1 and denote by
r(s) = r(u(s); v(s)): (2)
Let t be a unit tangent vector of C at P , n be a unit normal vector of C at P , N be a unit surface normal vector
N

P
S u
t kg
n C

kn

Figure 1: De nition of geodesic curvature


of S at P and u be a unit vector perpendicular to t in the tangent plane de ned by N  t. We can decompose
the curvature vector k of C into N component kn , which is called normal curvature vector, and u component
kg , which is called geodesic curvature vector as follows:
k = kn + kg = nN + g u (3)

2
Here n and g are the normal and geodesic curvatures, respectively and de ned as follows:
n = ;k  N (4)
g = k  u (5)
The minus sign in equation (4) ensures that if n is positive, the center of curvature lies opposite to the direction
of the surface normal. Consequently,
dt  (N  t)
g = ds (6)
The unit tangent vector of the curve C can be obtained by di erentiating equation (2) with respect to the arc
length.
t = dr(u(s); v(s)) = r du + r dv
ds u ds v ds (7)
where the chain rule is used and the subscripts u and v denote the rst partial derivatives with respect to u and
v parameter respectively. Hence
   
dt = r du 2 + 2r du dv + r dv 2 + r d2 u + r d2 v
ds uu ds uv ds ds vv ds u ds2 v ds2 (8)
so that
 3  du 2 dv  
du dv 2
g = [(ru  ruu ) du
ds + (2 r  r
u uv + r  r )
v uu ds ds + (r  r
u vv + 2 r  r )
v uv ds ds
 dv 3  du d2 v d2 u dv 
+ (rv  rvv ) ds ]  N + (ru  rv )  N ds ds2 ; ds2 ds (9)
; 3 , ; du 2 dv , du ; dv 2 , ; dv 3,  du d v ; d u dv  are all functions
We can easily notice that the coecients of du
2 2
ds ds ds ds ds ds ds ds 2 ds ds2

of the coecients of the rst fundamental form E , F and G and their derivatives, Eu , Fu , Gu , Ev , Fv , Gv . It
is interesting to note that the normal curvature n depends on both the rst and second fundamental forms,
while the geodesic curvature depends only on the rst fundamental form. Using the Christo el symbols ;ijk
(i; j; k = 1; 2) de ned as follows
;111 = GEu2(;EG 2FFu + FEv ; ;2 = 2EFu ; EEv + FEu
; F 2) 11 2(EG ; F 2 )
;112 = GE v ; FGu ;212 = EG u ; FEv
2(EG ; F 2 ) ; 2(EG ; F 2 ) (10)
;122 = 2GF2( v ; GGu + FGv ; ; 222 = EGv ; 2FFv + FGu
EG ; F ) 2 2(EG ; F 2 )
geodesic curvature can be reduced to
 du 3  du 2 dv du
 dv 2
2 2 1
g = [;11 ds + (2;12 ; ;11 ) ds ds + (;22 ; 2;12 ) ds ds 2 1
 3 du d2 v d2 u dv p
; ;122 dv ds + ds ds2 ; ds2 ds ] EG ; F
2 (11)
Geodesic paths are sometimes de ned as shortest path between points on a surface, however this is not always a
satisfactory de nition. In this paper we de ne as follows [15]:
De nition 2.1 Geodesics are curves of zero geodesic curvature.
In other words, the osculating planes of a geodesic contain the surface normal. From this de nition we can easily
see that the geodesic between two points on a sphere is a great circle. But there are two arcs of a great circle
between two of their points, and only one of them provides the shortest distance, except that the two points are

3
the end points of a diameter. This example indicates that there may exist more than one geodesic between two
points.
According to the de nition, we can determine the di erential equation that any geodesic on a surface must satisfy
by simply setting g = 0 in equation (11) and obtain
     
du d2 v ; d2 u dv = ;;2 du 3 ; (2;2 ; ;1 ) du 2 dv + (2;1 ; ;2 ) du dv 2 + ;1 dv 3 : (12)
 
ds ds2 ds2 ds 11 ds 12 11 ds ds 12 22 ds ds 22 ds
Alternatively we can derive the di erential equation for geodesics by considering that the surface normal N has
the direction of normal of the geodesic line n
n  ru = 0; n  rv = 0: (13)
dt , equation (13) can be rewritten as
Since kn = ds
dt dt
ds  ru = 0; ds  rv = 0 (14)
By substituting equation (8) into equations (14) we obtain
 du 2 du dv
 dv 2 d2u d2 v
(ruu  ru ) ds + 2(ruv  ru ) ds ds + (rvv  ru ) ds + E ds2 + F ds2 = 0 (15)
 2  
du dv + (r  r ) dv 2 + F d2 u + G d2 v = 0
(ruu  rv ) du
ds + 2( r  r )
uv v ds ds vv v ds ds2 ds2 (16)

By eliminating ddsv from equation (15) using equation (16), and eliminating ddsu from equation (16) using equation
2 2
2 2
(15) and employing the Christo el symbols, we obtain
   
d2 u + ;1 du 2 + 2;1 du dv + ;1 dv 2 = 0
ds2 11 ds 12 ds ds 22 ds (17)
   
d2 v + ;2 du 2 + 2;2 du dv + ;2 dv 2 = 0
ds2 11 ds 12 ds ds 22 ds (18)

Equations (17) and (18) are related by the rst fundamental form ds2 = Edu2 + 2Fdudv + Gdv2 and if we
eliminate ds from both equations, the equations reduce to equation (12) with u taken as parameter. These two
second order di erential equations can be rewritten as a system of four rst order di erential equations [3].
du = p (19)
ds
dv = q (20)
ds
dp = ;;111p2 ; 2;112 pq ; ;122 q2 (21)
ds
dq = ;;211p2 ; 2;212 pq ; ;222 q2 (22)
ds

3 Two Point Boundary Value Problem


We can solve a system of four rst order ordinary di erential equations (19) to (22) as an initial-value problem
(IVP), where all four boundary conditions are given at one point, or as a boundary-value problem (BVP), where
four boundary conditions are speci ed at two distinct points. Most of the problems that arise in applications of
geodesics are not IVP but BVP, which are much more dicult to solve. It is well known that the solution of an
IVP is unique, however for a BVP it is possible that the di erential equations have many solutions or even no
solution [6]. General methods for the solutions of two-point BVPs can be found in [6, 5].

4
It is convenient to write a system of di erential equations in vector form, since we can describe the equations for
systems as just for a single vector equation. If we set
y = (y1; y2; : : : ; yn)T ; g = (g1 ; g2; : : : ; gn)T (23)
= ( 1 ; 2 ; : : : ; n )T ; = ( 1 ; 2 ; : : : ; n )T (24)
s 2 [A; B ] (25)
Then the general rst order di erential equation for a boundary value problem can be written as:
dy = g(s; y); y(A) = ; y(B ) = (26)
ds
(27)
There are two commonly used approaches to the numerical solution of BVP. The idea of the rst technique is
that if all values of y(s) are known at s = A, then the problem can be reduced to an IVP. However, y(A) can
be found only by solving the problem. Therefore an iterative procedure must be used. We assume values at
s = A, which are not given as boundary conditions at s = A and compute the solution of the resulting IVP
to s = B . The computed values of y(B ) will not, in general, agree with the corresponding boundary condition
at s = B . Consequently, we need to adjust the initial values and try again. The process is repeated until the
computed values at the nal point agree with the boundary conditions and referred as shooting method. The
second method is based on a nite di erence approximation to ddsy on a mesh of points in the interval [A; B ].
This method starts with an initial guess and improves the solution iteratively and referred as, direct method,
relaxation method or nite di erence method. We have implemented both methods and found that the nite
di erence method is much more reliable than the shooting method. The shooting method is often very sensitive
to the unknown initial angles at point A and unless a good initial guess is provided, the integrated path will
never reach the other point B , while the nite di erence method starts with two end points xed and relaxes to
the true solution and hence it is much more stable. Therefore we will focus only on the nite di erence method.
Let us consider a mesh of points satisfying A = s1 < s2 < : : : < sm = B . We approximate the n rst order
di erential equations by the trapezoidal rule [5].
Yk ; Yk;1 = 1 [G + G ]; k = 2; 3; : : : ; m (28)
sk ; sk;1 2 k k;1
with boundary conditions
Y1 = ; Ym = (29)
Here the n-vectors Yk , Gk are meant to approximate y(sk ) and g(sk ). Y1 has n1 known components, while
Ym has n2 = n ; n1 known components. This discrete approximation will be accurate to the order of h2
(h = maxk fsk ; sk;1 g). Equation (28) forms a system of (m ; 1)n nonlinear algebraic equations with mn
unknowns Yk = (Y1 ; Y2 ; : : : ; Yn )Tk (k = 1; : : : ; m). The remaining n equations come from boundary conditions
(29). Let us refer to equation (28) as
Fk = (F1;k ; F2;k ; : : : ; Fn;k )T = Ysk ;; sYk;1 ; 12 [Gk + Gk;1 ] = 0; k = 2; 3; : : : ; m (30)
k k;1
and equations (29) as
F1 = (F1;1 ; F2;1; : : : ; Fn ;1)T = Y1 ; = 0; Fm+1 = (F1;m+1; F2;m+1 ; : : : ; Fn ;m+1)T = Ym ; = 0 (31)
1 2

then we have mn nonlinear algebraic equations


F = (FT1 ; FT2 ; : : : ; FTm+1 )T = 0 (32)
and can be computed by quadratically convergent Newton iteration, if a suciently accurate starting vector
Y(0) = (Y1T ; Y2T ; : : : ; YmT )T is provided. The Newton iteration scheme is given by
Y(i+1) = Y(i) + Y(i) (33)
[J(i) ]Y(i) = ;F(i) (34)

5
where [J(i) ] is the mn by mn Jacobian matrix of F(i) with respect to Y(i) .
If we apply this nite di erence method to the geodesics path problem, we have
y = (y1; y2; y3; y4)T = (u; v; p; q)T (35)
g = (g1; g2; g3; g4)T = (p; q; ;;111p2 ; 2;112pq ; ;122q2 ; ;;211p2 ; 2;212pq ; ;222q2)T (36)
hence
F1;k = uk ; uk;1 ; 12 (sk ; sk;1 )(pk + pk;1 ) = 0 (37)
F2;k = vk ; vk;1 ; 12 (sk ; sk;1 )(qk + qk;1 ) = 0 (38)
F3;k = pk ; pk;1 + 21 (sk ; sk;1 )(;111;k p2k + 2;112;k pk qk + ;122;k qk2
+ ;111;k;1 p2k;1 + 2;112;k;1 pk;1 qk;1 + ;122;k;1 qk2;1 ) = 0 (39)
1
F4;k = qk ; qk;1 + 2 (sk ; sk;1 )(;211;k p2k + 2;212;k pk qk + ;222;k qk2
+ ;211;k;1 p2k;1 + 2;212;k;1 pk;1 qk;1 + ;222;k;1 qk2;1 ) = 0 (40)
for k = 2; 3; : : :; m. Note that the mesh points are de ned in 3D space and not on the parameter domain. In
this paper we assume that the coordinates of the two end points A and B in the parameter domain are given as
follows:
F1;1 = u1 ; uA = 0 (41)
F2;1 = v1 ; vA = 0 (42)
F1;m+1 = um ; uB = 0 (43)
F2;m+1 = vm ; vB = 0 (44)
Now we can evaluate the Jacobian Matrix [J]. Since Fk are evaluated using information from points k and k ; 1,
we only need to evaluate
@Fi;k @Fi;k
@Yj;k;1 ; @Yj;k ; i; j = 1; 2; 3; 4 k = 2; 3; : : : ; m (45)
for non-boundary equations. For the two boundary points A and B , we evaluate
@Fi;1 ; @Fi;m+1 ; i = 1; 2 j = 1; 2; 3; 4 (46)
@Yj;1 @Yj;m
Therefore the Jacobian matrix has a banded structure or more speci cally it has the following block structure.
0 B1 1
BB A2 B2 CC
BB A3 B3 CC
BB A4 CC
BB  CC (47)
BB  CC
BB  CC
B@ Bm;1 CA
Am Bm
Am+1
where Ak , Bk (k = 2; : : : ; m) are 44 submatrices obtained by evaluating equations (45) and B1 , Am+1 are
24 submatrices obtained by evaluating equations (46). The columns correspond to mesh points, while the rows
correspond to equations. If we set
hk = sk ; sk;1 (48)
!kj ;1 = ;j11;k;1 pk;1 + ;j12;k;1 qk;1 ; j = 1; 2 (49)

6
!kj = ;j11;k pk + ;j12;k qk ; j = 1; 2 (50)
kj ;1 = ;j12;k;1 pk;1 + ;j22;k;1 qk;1 ; j = 1; 2 (51)
kj = ;j12;k pk + ;j22;k qk ; j = 1; 2 (52)
(53)
then Ak , Bk , B1 and Am+1 can be written as follows:
0 ;1 0 [; h2k ] 0
1
Ak = B
B 0 ;1 0 [; h2k ] CC
@ 0 0 hk !k1;1 ; 1 hk k1;1 A ; k = 2; : : : ; m (54)
0 10 00 hk !k2;1 hk k2;1 ;11
;2 h k 0
Bk = B
B 0 1 0 ; hk
2
CC
@ [0] 0 hk !k1 + 1 hk k1 A ; k = 2; : : : ; m (55)
 [1]0 [0] hk !k2  hk k2 + 1
B1 = 0 0 0 (56)
0 [1] 0 0
 1 0 [0] 0 
Am+1 = 0 1 0 [0] (57)
Here the arc length hk is approximated by the chord length. The elements surrounded by the brackets [ ] in
the submatricies correspond to diagonal elements in the global matrix. The linear system (34) can be solved by
a special form of Gaussian elimination technique to minimize the total number of operations [12]. Since there
are zero pivot elements in the submatrices Bk and Am+1 , we need to interchange columns so that there will be
only nonzero elements on the diagonal to ensure numerical stability. The columns which include the zero pivot
elements are columns (4k ; 3), (4k ; 2) (k = 2; : : : ; m), (4m ; 1) and 4m. If we interchange the columns (4k ; 3)
by (4k ; 1) and (4k ; 2) by (4k) for (k = 2; : : : ; m), we obtain
0 ; h2k 0 [;1] 0
1
Ak = B
B 0 ; h2k 0 [;1] C C
@ hk !k1;1 ; 1 1
hk k;1 0 0 A ; k = 3; : : : ; m (58)
2 hk k2;1 ; 1
0 h;k !hkk;1 0 1
0
0
10
2
B
B
Bk = @ [h !1 + 1] 0 ; h2k 0 1 C C
k k h 
k k 1 0 0 A ; k = 2; : : : ; m (59)
2 2
 0 hk !0k [1] [hk 0k + 1] 0 0
Am+1 = 0 0 0 [1] : (60)
Consequently the correction vector Y becomes as follows:
Y = (u1 ; v1 ; p1 ; q1 ; p2 ; q2 ; u2; v2 ; : : : ; pm ; qm ; um; vm )T (61)
Since the corrections are based on a rst-order Taylor approximation, a regular Newton method may not be
sucient for a very complex nonlinear surface unless a good initial approximation is provided. If the vector norm
of the correction vector is large, then it is an indication that the problem is highly nonlinear and may produce a
divergent iteration. We shall say that the iteration is converging if k Y(i+1) k1 < k Y(i) k1 , where k Y k1
is a scaled vector norm and de ned as
Xm  ju j jv j jp j jq j 
k Y k 1 = i + i + i + i (62)
i=1 M u M v M p M q
where Mu , Mv , Mp and Mq are the scale factors for each variable. In this work we set Mu = Mv = 1 and
Mp = Mq = 10, since we nd that the magnitude of pi and qi are roughly ten times larger than that of ui
and vi through the numerical experiments. To achieve more stability our method employs a step correction
procedure
Y(i+1) = Y(i) + Y(i) (63)

7
where 0 <   1. If  = 1 the equation reduces to a regular Newton's method, while if  < 1 the rate of
convergence will be less than quadratic. When the problem is not highly nonlinear, we set
 = 0:2 if 0:05 < k 4Y m
k1

 = 0:4 if 0:005 < k 4Y m


k1  0:05
k  Y k 1
 = 0:6 if 4m  0:005 (64)
to accelerate the convergence when the solution vector is close to the true solution, otherwise we use
 = 0:2 (65)
through out the iteration. The Newton's method terminates when k4Ymk is smaller than the pre-speci ed
1

tolerance N . The order of N should be proportional to h2 , since we are using the trapezoidal rule (see equation
(28)).

4 Initial Approximation
4.1 Straight Line Approximation
Straight line approximation is the simplest and most often provides a good initial approximation, since it is a
solution to equations (19) to (22) when we neglect all the nonlinear terms in the right hand sides. We connect the
two end points in the parameter space by straight line and de ne a uniform mesh or grid by a set of k = 1; 2; : : :; m
points as shown in Figure 2 (a). Therefore we have
uk = uA + umB ; uA (k ; 1) (66)
;1
v B ;
vk = vA + m ; v1A (k ; 1): (67)
If we assume that uA 6= uB then
v (uB,vB)B v B
(uD,vD)
k=m k=m
D (uB,vB)

C
k=1 (uC,vC)
A
A (uA,vA)
u u
k=1
(uA,vA)
(a) (b)

Figure 2: Initial approximations, (a) straight line approximation, (b) circular arc approximation

dv vB ; vA
du = uB ; uA   (68)

8
hence
dv =  du (69)
ds ds
If we substitute this relation into the rst fundamental form we obtain
 du 2  du 2  du 2
E ds + 2F ds + G ds = 1 2 (70)
Thus
pk = du 1
ds =  pEk + 2Fk  + Gk 2 (71)

qk = dv
ds =  p  (72)
Ek + 2Fk  + Gk 2
When uA = uB , it is easy to nd that pk = 0 and qk = pG1 k . It is well known that conjugate points do not exist
on regions of a surface where Gaussian curvature is negative [15]. Therefore the straight line approximation will
provide good initial approximation to the geodesic path in those regions.

4.2 Circular Arc Approximation


The problem of the straight line approximation is that when there are more than one path, it cannot capture
the other paths. To make the algorithm more reliable, we have developed the following algorithm. First we
pick two points C and D in the parameter domain, which are on the bisector of the two end points A and B ,
such that AC = AD or BC = BD as illustrated in Figure 2. Then we determine two circular arcs which pass
through the three points A; C; B and A; D; B . If C and D are taken large enough, all the geodesic paths in the
parameter domain between points A and B may lie within or close to the region surrounded by the two circular
arcs. Notice that the algorithm fails once the circular arcs go outside the domain. The uv coordinates in the
parameter domain i.e. (uk ; vk ), k = 1; : : : ; m can be obtained by equally distributing the points along the circular
arc in the parameter domain. Once we have a set of points in the parameter domain, we can easily evaluate
pk ; qk by using the central di erence formula for k = 2; : : : ; m ; 1, the forward di erence formula for k = 1 and
the backward di erence formula for k = m ; 1. The di erence formulae for non-uniform mesh points are listed in
the Appendix. Note that the step length hk is evaluated by computing the chord length between the successive
points on the surface. Even if the mesh points are equally distributed along the circular arc in the parameter
domain, hk is not in general constant.
We give the ow chart of Algorithm A for computing the geodesic path between given two points in Figure 3.

5 Shortest Path between a Point and a Curve


In this section we solve a problem of nding a shortest path between a point and a curve on a free-form parametric
surface, which utilizes the method we have developed in sections 3 and 4. This concept is important in robot
motion planning and constructing a medial axis on a free-form surface. Suppose we have a curve C on a parametric
surface r(u; v) de ned as rc (t) = r(u(t); v(t)), we want to compute the shortest path between point A and curve
C as shown in Figure 4. Let us denote the intersection point with curve C and the shortest path by B . Wolter
[16] proved that the shortest path from point A to curve C is given by the geodesic path from A to B where the
tangent vectors of the geodesic curve and C are orthogonal to each other. If point B were known, the problem
could be reduced to IVP, since at point B u, v, p and q are all known. However, point B can be found only by
solving the problem. We guess a parameter value t = tB for point B and solve the BVP. In general the unit
tangent vector of the curve rc (t) and the unit tangent vector of the geodesic curve at the guessing point will not
be orthogonal to each other. Consequently, we need to adjust the parameter value tB and iterate until those two
unit tangent vectors become orthogonal. Therefore for each iteration, we need to solve a two point boundary
value problem, which also requires iterations (i.e., nested iteration). If we denote these two unit tangent vectors

9
Start with two circular arc approximations (YL, YR) as initial vectors

Solve the BVP and denote the solution vectors by (L, R)

Yes
|L − R|<ε
Add L to the solution list End
No
Add L and R to the solution list and push (L,R) into stack S

Pop (L,R) from stack S

Yes
|L − R|<ε
Add L to the solution list
No
Compute a new approximation vector YM by taking the mid points
of L and R, i.e. YM=(L+R)/2

Solve the BVP with YM as input and denote the output by M

|L − M|<ε Yes
or M moves further left to L

Push (YM,R) to stack S


No

|R − M|<ε Yes
or M moves further right to R

Push (L,YM) to stack S


No
We add M to the solution list and push (L,M) and (M,R) to stack S

No
Stack S is empty

Yes
Find the shortest path from the list of solution vectors

End

Figure 3: Flow chart of Algorithm A for computing the geodesic path between given two points.

10
as tc and tg , then they can be expressed as follows:
drc (t) ru dudt + rv dvdt
t = drdtc(t) = q du
c (73)
dt ( dt xu + dvdt xv )2 + ( dudt yu + dvdt yv )2
tg = drds(s) = ru du
g dv
ds + rv ds (74)
Therefore the orthogonality condition can be written as

A rg(s)
.
tc
.
B
C

S
tg

rc(t)

Figure 4: Shortest path between point A and curve C

!(t) = tc  tg
du du E + ( dv du + dv du )F + dv dv G
= qds dt ds dt dt ds ds dt
du dv 2
( dt xu + dt xv ) + ( dt yu + dv
du
dt yv )
2
= 0 (75)
Consequently we need to nd a parameter value tB such that !(tB ) = 0. Since the relationship described above is
implicit, we use the secant method instead of Newton's nmethod to obtain tB . The secant method can be derived
from Newton's method by replacing the derivative d!dt by the quotient (!(n) ; !(n;1) )=(t(n) ; t(n;1) ). This
( )

leads to the following scheme.


(n) t(n;1) (n)
t(n+1) = t(n) + t(n) ; t(n) = ; !t(n) ; (n)
; !(n;1) ! ; ! 6= !
(n;1) (76)
Notice that the secantp method requires two initial approximations. Since the secant method has an order of
convergence of 21 (1 + 5) ' 1:618, it converges within a reasonable number of iterations. If the correction t(n)
is large, it is again an indication that problem is highly nonlinear. In such case we also employ a step correction
procedure
t(n+1) = t(n) +  t(n) (77)
where  is a correction factor. Since we do not know how many solutions are there and the corresponding
parameter values of the curve beforehand, we can use a similar algorithm to Algorithm A. Notice that unlike the
geodesic path between two points, there is only a unique solution between A and B since at the solution it is a
IVP. If the range of the parameter value of the curve is 0  t  1, we start from both ends of the curve (i.e.,
t1 =0, t2 =0.02 and t1 = 1, t2 =0.98). Then we recursively nd the solutions.

11
Points Tolerance Correction Factor Iterations Geodesic Distance
m N  L M R L M R
101 1.0E-3 eqn. (64) 10 1 10 1.661 1.865 1.661
eqn. (65) 22 1 22

Table 1: Numerical conditions and results for the computation of the geodesic path between corner points of the
wave-like surface.

6 Numerical Applications and Conclusions


6.1 Geodesic Path between Two Points
The rst example is a wave-like bicubic B-spline surface, whose control polyhedron is a lattice of 77 vertices
with uniform knot vectors in both directions and spans 0  x  1, 0  y  1.
We have computed the geodesic path between two corner points, (uA , vA )= (0,0) and (uB , vB )=(1,1). We choose
(uC ; vC ) to be (0.7, 0.3) and (uD ; vD ) to be (0.3, 0.7). Algorithm A nds three geodesic paths, as shown in Figure
5 (solid thick lines). The computational conditions such as number of mesh points, tolerance and correction factor
for the Newton's method N , , as well as computational results such as number of iterations for convergence and
the geodesic distances are listed in Table 1. Characters L, M , N refer to left, middle and right geodesic paths in
Figure 5. The middle geodesic path is not a minimal path (s=1.865), while the other two paths are the shortest
path (s = 1:661) due to symmetry. Since the surface is relatively simple, the Newton's scheme converges with
both correction factors. We can observe from Table 1 that the three step correction factor is two times faster
than the constant correction factor. Figure 6 shows how the initial approximation path (the most right thick
solid line) converges gradually to the nal solution (wavy thick solid line). The intermediate paths are illustrated
by the thin solid lines.

x
z

Figure 5: Geodesic paths on the wave-like bicubic B-spline surface between points of two corners.
The second example is a biquadratic rational B-spline surface, whose control polyhedron is a lattice of 69
vertices in u, v. This surface was constructed by sweeping a circle of radius 0.5, the generatrix, along a helix

12
y

x
z

Figure 6: Convergence of the right geodesic path in Figure 4.

Correction Factor Points Tolerance Iterations Geodesic Distance


 m N L M R L M R
eqn. (65) 501 1.0E-2 8 10 8 5.860 6.983 5.860
1001 5.0E-3 10 10 10 5.843 6.956 5.843

Table 2: Numerical conditions and results for the computation of the geodesic path between points on generalized
cylinder

(x = cos t, y = ; sin t, z = t , 0  t  2), the spine, and is approximated by rational B-spline interpolating a
number of generatricies. When we keep u constant, we obtain a curve on the surface which depends only on v.
This curve coincides with the generatrix. Similarly v = constant represents another isoparametric curve which
is parallel to the spine. Two end points are chosen to be (uA; vA )=(0, 0.4) and (uB ; vB )=(1, 0.6) as shown in
Figure 7. In Figure 7 three initial approximations are illustrated by the thin solid lines, while the nal solutions
are illustrated by the thick solid lines. Two circular arcs are determined by setting (uC ; vC ) = (0.578, 0.108),
(uD ; vD ) = (0.422, 0.892). Algorithm A starts with these two circular arcs and converges to the two minimal
geodesic paths which are shown as thick solid lines close to the initial circular arcs. Then the algorithm computes
the mid-points of these solutions, which is shown as a thin straight line connecting the two end points. This
initial approximation converges to a sine wave-like solution. This solution is a geodesic path but it does not
provide the shortest distance. Table 2 shows the list of computational conditions and results as in Table 1. Since
the surface is relatively complex, the constant step correction equation (65) is used.

13
v

Figure 7: Geodesic paths in the parameter domain of the generalized cylinder.

Figure 8: Minimal geodesic paths on the generalized cylinder between points of two circular edges.

14
y

z x

Figure 9: Top view of the minimal geodesic paths on the generalized cylinder between points of two circular
edges.

Figure 10: Geodesic path on the generalized cylinder which is not the shortest path.

15
t1 t2 tB m   N S Iteration Geodesic Distance
0 0.02 0.2663 101 0.2 0.05 1.0E-3 1.0E-6 16 0.2754
1 0.98 0.7266 101 0.2 0.05 1.0E-3 1.0E-6 14 0.3712
0.4964 0.5164 0.5788 101 0.2 0.05 1.0E-3 1.0E-6 8 0.3874

Table 3: Numerical conditions and results for the computation of the geodesic path between a point and a curve
on wave-like surface

6.2 Geodesic Path between a Point and a Curve


Figure 11 shows a planar cubic Bezier curve and point A (0.3, 0.2) in the uv parameter domain, which will be
mapped onto the wave-like B-spline surface as shown in Figure 12. The algorithm nds three geodesic paths
AB , AB 0 and AB 00 , whose tangent vectors at B , B 0 and B 00 are orthogonal to the tangent vectors at the curve.
Table 3 shows the list of computational conditions and results. The entries t1 , t2 and tB are the parameter values
of the curve corresponding to the rst two initial approximations for the secant method and the solution value.
The following entries, m,  and  are the number of mesh points, correction factors for the Newton and secant
methods. Tolerances for the convergence of Newton and secant methods are given by  , N .

v
A

Figure 11: Cubic Bezier curve in the parameter domain.

6.3 Conclusions and Recommendations


The method developed in this work allows ecient and reliable computation of the shortest path between two
points and a point to a curve on a free-form parametric surfaces. A basic element of our method is to solve
the two point boundary value problem by the relaxation method based on a nite di erence discretization. Step
controlled correction procedure in the Newton's method makes it possible to start with initial vectors which are

16
B B’
B"

y
A

Figure 12: Geodesic paths from point A to Bezier curve on the wave-like bicubic B-spline surface.

not necessarily close to the solution vector, which helps to nd all the geodesic paths between two points and a
point to a curve.
Finally, the following topics are recommended for further study.
 Adaptive step size: We can achieve greater eciency if we could provide more mesh points where the
variables are changing rapidly to achieve accuracy, while less mesh points should be provided in regions
where the variables are changing slowly. Therefore it is recommended to allocate mesh points during the
relaxation process.
 Our algorithms fail once the intermediate path goes outside of the parameter domain. This can be xed
by gluing the surface patches to all the four boundaries.

Acknowledgements
I would like to thank Prof. Patrikalakis for productive discussions. Funding was provided by the Oce of Naval
Research (under grant number N00014-94-1-1001).

Appendix: Di erence Formulas for Non-Uniform Grids


Forward Di erence
 hi+1
  
; hhi i fi+1 + hi
hi+1 + hi + 2 ; 2 + hhi i fi;1
+1

f 0 (xi ) = +1

hi + hi+1 (78)
Central Di erence
hi (fi+1 ; fi ) ; hi (fi;1 ; fi )
+1

f 0 (xi ) = hi
+1

h +h
hi (79)
i i+1

17
Backward Di erence
  
hi+1 f ; hi + hi+1 + 2 + 2 + hi

i+1 fi;1
f (xi ) = hi
0 hi+1 hi
hi + hi+1
hi+1
(80)

References
[1] J. M. Beck, R. T. Farouki, and J. K. Hinds. Surface analysis methods. IEEE Computer Graphics and
Applications, 6(12):18{36, December 1986.
[2] G. A. Bliss. The geodesic lines on the anchor ring. Annals of Mathematics, 4:1{21, October 1902.
[3] G. Dahlquist and A. Bjorck. Numerical Methods. Prentice-Hall, Inc., Englewood Cli s, NJ, 1974.
[4] P. M. do Carmo. Di erential Geometry of Curves and Surfaces. Prentice-Hall, Inc., Englewood Cli s, New
Jersey, 1976.
[5] J. H. Ferziger. Numerical Methods for Engineering Applications. Wiley, 1981.
[6] H. B. Keller. Numerical Methods for Two-Point Boundary Value Problems. Blaisdell, 1968.
[7] R. Kimmel, A. Amir, and A. M. Bruckstein. Finding shortest paths on surfaces using level sets propagation.
IEEE Transactions on Pattern Analysis and Machine Intelligence, 17(6):635{640, June 1995.
[8] E. Kreyszig. Di erential Geometry. University of Toronto Press, Toronto, 1959.
[9] J. S. B. Mitchell. An algorithmic approach to some problems in terrain navigation. Arti cial Intelligence,
37:171{201, 1988.
[10] F. C. Munchmeyer and R. Haw. Applications of di erential geometry to ship design. In D. F. Rogers,
B. C. Nehring, and C. Kuo, editors, Proceedings of Computer Applications in the Automation of Shipyard
Operation and Ship Design IV, volume 9, pages 183{196, Annapolis, Maryland, USA, June 1982.
[11] N. M. Patrikalakis and L. Bardis. O sets of curves on rational B-spline surfaces. Engineering with Computers,
5:39{46, 1989.
[12] W. H. Press et al. Numerical Recipes in C. Cambridge University Press, 1988.
[13] J. Sneyd and C. S. Peskin. Computation of geodesic trajectories on tubular surfaces. SAIM Journal of
Scienti c Statistical Computing, 11(2):230{241, March 1990.
[14] D. J. Struik. Outline of a history of di erential geometry. Isis, 19:92{120, 1933.
[15] D. J. Struik. Lectures on Classical Di erential Geometry. Addison-Wesley, Cambridge Mass., 1950.
[16] F.-E. Wolter. Cut Loci in Bordered and Unbordered Riemannian Manifolds. PhD thesis, Technical University
of Berlin, Department of Mathematics, December 1985.

18

You might also like