1993 - Shape Offsets Via Level Sets
1993 - Shape Offsets Via Level Sets
X(S,0)--Xo(S)
(4)
HISTORICAL REVIEW
The issue of generating offset curves has often been dealt
with in the CAD literature. Several approaches to the
Electrical Engineering Department, Technion, Haifa 32000, Israel problem have been proposed. In the CAD/CAM appli-
*Computer ScienceDepartment, Technion, Haifa 32000, Israel
Paper received: 9 March 1992. Revised:6 July 1992 cations that we consider, there are often shape boundaries
f Ot
~y(s,t)_
~, Ot
(x2(s, t) + y2(s, t)) u2
x,(s,t)
(x~(s,t)+ y~(s,t)) u2
Taking the discrete approximation of x~ and y~ as central
(6)
Initialization 6e,
(x,y) ~ X(s,0)
(19)
where d is the (minimal) Euclidean distance of the point
from the curve, would be a reasonable initialization, but,
on the other hand, such an initialization is, in fact,
equivalent to solving the problem of offsetting, since we
could produce X(s, d) as the locus of all the points where
(a(x, y, O)=d.
However, to provide a proper solution, we can use the
fact that ck(x,y,O) only needs to be continuous, and
initialize dp(x,y,O) on the x - y grid as follows:
4,(x, y, 0)
min[+d((x,y),X(s,O)),C] (x,y) ~ exterior of
I X(s, 0) eo,
"i
=,~max[-d((x, y),X(s, O)), - C ] (x,y) ~interiorof
X(s,O)
(x, y) ~ X(s, 0)
(20) i
I, :. " ~o ,h ,h
where C is an arbitrary constant. If we choose Figure 4. Offsetting of simple shape on 128 × 128 grid
Contour finder
Following Reference 21, a simple contour finder for
X(s,L) can be generated in the following manner: for
each grid point (i,j), use the same cell definition as in
zoo
the previous section X o. Now, if m a x [ X u ] < 0 or
min[Yu] > 0, then the contour X(s,L) does not pass
|o through the cell. Otherwise, find the entrance and exit
points of ~b=0 by linear interpolation; this provides a
line segment of X(s, L) belonging to the contour. The line
60
segments need to be neither ordered nor directed in the
same direction to display the desired contour (see Figure
qo.
8); however, using additional information such as the
knowledge of interior and exterior points, one can
produce any desired representation of the curve, such as
Jo, a planar polygon, or a curve comprising cubic or any
other polynomial arcs.
I, I, '.. J, 11, do
CONCLUDING REMARKS
We have described a new method of generating shape
offsets so that topological problems are inherently
avoided, and shocks, cusps and other singularities are
also readily dealt with in an efficient numerical scheme.
The algorithm works on an image grid with a resolution
chosen according to the desired accuracy. It is easy to
implement the algorithm in parallel using each mesh
point as a small calculating device which communicates
with its four close neighbors. In each iteration, we need
to calculate the values of c~(x,y,t) for those grid points
close to the current contour, and the rest of the grid
points serve as sign holders. This can be exploited to
reduce calculation effort.
In summary, we propose to introduce to the CAD/CAM
field some recent advances in numerical methods for fluid
~, I0 " I, d, J, dynamics. We have shown that wavefront-propagation
methods in fluid dynamics also provide a new approach
to the problem of shape offsetting.
ACKNOWLEDGEMENTS
We would like to thank Professor James Sethian for
O
providing us with his reports on numerical methods of
front evolution. We thank Professor Moshe Israeli,
Professor Ben Kimia, Professor Allen Tannenbaum and
Professor J Rubinstein for their help in introducing us
•to the world of numerical analysis and moving surfaces.
R Kimmel's work was partly supported by the
Ollendorf Fund. A Bruckstein's work was supported in
part by the Fund for the Promotion of Research at the
Technion, Haifa, Israel.
surfaces' Int. J. Comput. Geom. & Applic. Vol I No 1 Sethian, J A 'Numerical methods for propagating fronts'
(1991) pp 67-78 in Concus, P and Finn, R (Eds.) Variational Methods for
Free Surface Interfaces Springer-Verlag, USA (1987)
9 Farin, G 'Curvature continuity and offsets of
piecewise conics' A C M Trans. Graph. Vol 8 No 2
(1989) pp 89-99
10 Meek, D S and Walton, D S 'Offset curves of
clothoidal splines' Comput.-Aided Des. Vol 22 No 4 APPENDIX A
(1990) pp 199-200
11 Wang, R and Jiang, W 'An algorithm of the Normal evolution
offset shape' Comput. Graph. Vol 15 No 3 (1991) In this section, we show that, in a curve evolution
pp 435--439 described by
12 Held, M On the Computational Geometry of Pocket
Machining Springer-Verlag, Germany (1991) -- X(s, t) = N(s, t)
~t
13 Saeed, S E O, de Pennington, A and Dodsworth, J R the direction of the normal does not change in time
'Offsetting in geometric modeling' Comput.-Aided prior to shock formation (following References 17, 22
Des. Vol 20 No 1 (1988) pp 67-74 and 23).
14 Riazanoff, S, Cervelle, B and Chorowicz, J 'Para-
metrisable skeletonization of binary and multi-level Proof." Let us first define the metric along the curve and
images' Pattern Recognition Lett. No 11 (1990) the arc-length parameter 5:
pp 25-33
g(s,t)- ~, X =(x,2 +Ys)
2 1/2
15 Yao, C and Rokne, J 'Fat curves' Comput. Graph.
Forum No 10 (1991) pp 237-248
16 Vincent, L 'Exact Euclidean distance function by
chain propagation' IEEE Trans. Comput. V. Pattern
fo
Now we can define the tangent, curvature and the
Recognition (May 1991)
normal in a standard way:
17 Osher, S J and Sethian, J A 'Fronts propagating
with curvature dependent speed: algorithms based r_ a x=l__ax
on Hamilton-Jacobi formulations' J. Comput. Phys. c~ g c~s
Vol 79 (1988) pp 12-49
18 Sethian, J A 'Curvature and the evolution of fronts'
Comm. Math. Phys. Vol 101 (1985) pp 487-499
19 Sethian, J ~A'A review of recent numerical algorithms --T
for hypersurfaces moving with curvature dependent N- t~ _ 1 _~ T
speed' J. Differ. Geom. No 33 (1989) pp 131-161
f~sT kg &
20 Sod, G A Numerical Methods in Fluid Dynamics
Cambridge University Press (1985) It is easily established that the curve evolution induces
21 Sethian, J A and Strain, J 'Crystal growth and
dendritic solidification' J. Comput. Phys. Vol 98 -- T = - kgN
&
(1992)
22 Kimia, B B, Tannenbaum, A and Zucker, S W 'On -- N = kgT
the evolution of curves via a function of curvature. ~s
Part 1: The classical case' J. Math. Anal. & Applic. The evolution of g can be computed as follows:
Vol 163 (1992) pp 438-458
23 Kimia, B B 'Toward a computational theory of -g\N , x
shape' PhD Thesis Dep. Electrical Engineering,
McGill University, Canada (1990)
= /
BIBLIOGRAPHY
Mitchel, A R and Grifliths, D F The Finite Difference = 2(gT, kgT)
Method in Partial Differential Equations John Wiley,
USA (1985) =2g(kg)
Hence, APPENDIX B
Offsetting algorithm
dr
(1) Initialize O°=c~(ih,jh, O), where h = A x = A y ,
Then, the evolution of the tangent is as follows:
according to the curve representation in hand.
~b(x, y, 0) = 0 is the implicit representation of the
ot =ot initial curve. See above for ways in which to
determine O(x,y,O). Note that, if shape is
- g' ex+-l£- x defined by a dark region on a white back-
g 2 dS g ~t C3S ground, set c~(x,y,O) equal to the gray-level
image of the object at the camera resolution.
=_g'T+!~N (2) For n = 1 to L/At do
g g c~s
~.id+ 1 = ~.,j + zxt . . .
~ {(mm[(~bl,j - ~bi-, j), O] )2
_ kgT+l_kgT
g g + (max[(~bT+ x,j- ~bTj),0]) 2
=0 + (min[ (~Tj- ckT,j-~ ), 0]) 2
Thus, the normal (to the stationary tangent direction) is n 0 ]) 2 } 1/2
+(max[(d)Tj+l-~b,.j),
also stationary; in other words, there is no change in
(3) Find the level set ~b(x, y, L) = 0 by activating the
the normal direction while the curve evolves, and no
contour-finder procedure as described above on
shocks appear. Therefore, Equations ~1are equivalent to
Equations 5. []