1 introduction - seoul national university3map.snu.ac.kr/mskim/ftp/2dsweep.pdf · a moving...

33
1 Introduction Polygonal boundary approximation for a 2D general sweep based on envelope and boolean operations Joo-Haeng Lee 1 , Sung Je Hong 2 , Myung-Soo Kim 3 1 Computer Software Technology Lab., ETRI, Taejon 305-350, South Korea 2 Dept. of Computer Science, POSTECH, Pohang 790-784, South Korea 3 Dept. of Computer Eng., Seoul National Univ., Seoul 151-742, South Korea e-mail: [email protected], [email protected], [email protected] This paper presents an algorithm that approximates (using polygons) the boundary of a general sweep for an arbitrary 2D curved object (possibly with holes). Based on set-theoretic properties of the general sweep, our algorithm generates the polygonal sweep boundary incrementally, where envelope approxima- tions and union operations are repeatedly applied to intermediate boundaries of the sweep and consecutive instances of the moving object at sampled locations of the motion. For approximation, each instance of the object is polygonized along the motion, where the object may experience dynamic shape transformation with topological changes such as creating and/or de- stroying internal holes. The incremental nature of the proposed algorithm makes the boundary construction of a general sweep useful for applications in inter- active shape design, collision detection, and mechan- ical part design. Our algorithm generates a precise approximation of the boundary of a general sweep with real-time performance in computing unsweeps, Minkowski sums and differences, and constant radius offsets. Some experimental results are also given in this paper. Key words: General sweep – Unsweep – Minkowski sum and difference – Offset – Interactive shape design Correspondence to: J.-H. Lee The sweep operation is useful for the generation of a complex object by sweeping a simple object along a trajectory curve. The simplest form of sweep is linear extrusion where a 2D object moves along its normal direction to generate a volume. Another sim- ple sweep is the rotational sweep where a 2D object rotates about a fixed axis. A rotational sweep gen- erates a volume bounded by a surface of revolution. A general sweep is the most general form of sweep where the generator (i.e., the moving object) changes its size, orientation, and shape [9]. Figure 1 shows an example of a general sweep where a 2D object moves along a path in the plane while changing its size and orientation. A simple form of the general sweep is generalized cylinder, which has been ac- tively used for applications in computer vision [2]. Early generalized cylinders assume that a 2D cross- sectional curve moves in space while its containing plane is kept orthogonal to the tangent direction of the trajectory curve. Recently, some authors allow generalized cylinders defined by more general spa- tial motions [7]. General sweeps of solids are use- ful in modeling the swept region of a numerically controlled (NC) machining tool or that of a robot following a path. However, it is non-trivial to con- struct the boundary of a general sweep. Two of the main reasons for this difficulty can be summarized as follows: (a) there may be complex self-intersections in the sweep boundary; and (b) the sweep surfaces are usually algebraic surfaces of high degree that are difficult to deal with (efficiently and robustly) in con- temporary CAD systems. In this paper, based on a re- peated application of boolean operations on simple polygons, we suggest an efficient and robust algo- rithm that precisely approximates (using polygons) the boundary of a general sweep for an arbitrary 2D curved moving object (possibly with holes). The general sweep of a 3D solid has attracted con- siderable research attention in various fields of en- gineering. Wang and Wang [25] generate a scan- rendered image of a 3D swept volume. Weld and Leu [26] represent the sweep boundary of a poly- hedron with ruled and developable surface patches. Based on the B-spline motion of polyhedra, Jüttler and Wagner [14] represent these boundary surfaces as rational B-spline surfaces. Martin and Stephen- son [19] suggest envelope theory as a theoretical basis for computing swept volumes. Blackmore et al. [5, 6] present a sweep-envelope differential equa- tion that characterizes the boundary of a swept vol- ume. Abdel-Malek and Yeh [1] use rank-deficiency The Visual Computer (2000) 16:208–240 c Springer-Verlag 2000

Upload: others

Post on 10-Jul-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 Introduction - Seoul National University3map.snu.ac.kr/mskim/ftp/2dsweep.pdf · a moving mechanicalpart with its surrounding pack-age. Figure 3 illustrates the design steps that

1 Introduction

Polygonal boundaryapproximation for a 2Dgeneral sweep based onenvelope and booleanoperations

Joo-Haeng Lee1, Sung Je Hong2,Myung-Soo Kim3

1Computer Software Technology Lab., ETRI, Taejon305-350, South Korea2Dept. of Computer Science, POSTECH, Pohang790-784, South Korea3Dept. of Computer Eng., Seoul National Univ.,Seoul 151-742, South Koreae-mail: [email protected], [email protected],[email protected]

This paper presents an algorithm that approximates(using polygons) the boundary of a general sweepfor an arbitrary 2D curved object (possibly withholes). Based on set-theoretic properties of the generalsweep, our algorithm generates the polygonal sweepboundary incrementally, where envelope approxima-tions and union operations are repeatedly applied tointermediate boundaries of the sweep and consecutiveinstances of the moving object at sampled locationsof the motion. For approximation, each instance ofthe object is polygonized along the motion, where theobject may experience dynamic shape transformationwith topological changes such as creating and/or de-stroying internal holes. The incremental nature of theproposed algorithm makes the boundary constructionof a general sweep useful for applications in inter-active shape design, collision detection, and mechan-ical part design. Our algorithm generates a preciseapproximation of the boundary of a general sweepwith real-time performance in computing unsweeps,Minkowski sums and differences, and constant radiusoffsets. Some experimental results are also given inthis paper.

Key words: General sweep – Unsweep – Minkowskisum and difference – Offset – Interactive shape design

Correspondence to: J.-H. Lee

The sweepoperation is useful for the generation ofa complex object by sweeping a simple object alonga trajectory curve. The simplest form of sweep islinear extrusionwhere a 2D object moves along itsnormal direction to generate a volume. Another sim-ple sweep is therotational sweepwhere a 2D objectrotates about a fixed axis. A rotational sweep gen-erates a volume bounded by a surface of revolution.A general sweepis the most general form of sweepwhere the generator (i.e., the moving object) changesits size, orientation, and shape [9]. Figure 1 showsan example of a general sweep where a 2D objectmoves along a path in the plane while changing itssize and orientation. A simple form of the generalsweep isgeneralized cylinder, which has been ac-tively used for applications in computer vision [2].Early generalized cylinders assume that a 2D cross-sectional curve moves in space while its containingplane is kept orthogonal to the tangent direction ofthe trajectory curve. Recently, some authors allowgeneralized cylinders defined by more general spa-tial motions [7]. General sweeps of solids are use-ful in modeling the swept region of a numericallycontrolled (NC) machining tool or that of a robotfollowing a path. However, it is non-trivial to con-struct the boundary of a general sweep. Two of themain reasons for this difficulty can be summarized asfollows: (a) there may be complex self-intersectionsin the sweep boundary; and (b) the sweep surfacesare usually algebraic surfaces of high degree that aredifficult to deal with (efficiently and robustly) in con-temporary CAD systems. In this paper, based on a re-peated application of boolean operations on simplepolygons, we suggest an efficient and robust algo-rithm that precisely approximates (using polygons)the boundary of a general sweep for an arbitrary 2Dcurved moving object (possibly with holes).The general sweep of a 3D solid has attracted con-siderable research attention in various fields of en-gineering. Wang and Wang [25] generate a scan-rendered image of a 3D swept volume. Weld andLeu [26] represent the sweep boundary of a poly-hedron with ruled and developable surface patches.Based on the B-spline motion of polyhedra, Jüttlerand Wagner [14] represent these boundary surfacesas rational B-spline surfaces. Martin and Stephen-son [19] suggest envelope theory as a theoreticalbasis for computing swept volumes. Blackmore etal. [5, 6] present a sweep-envelope differential equa-tion that characterizes the boundary of a swept vol-ume. Abdel-Malek and Yeh [1] use rank-deficiency

The Visual Computer (2000) 16:208–240c© Springer-Verlag 2000

Page 2: 1 Introduction - Seoul National University3map.snu.ac.kr/mskim/ftp/2dsweep.pdf · a moving mechanicalpart with its surrounding pack-age. Figure 3 illustrates the design steps that

J.-H. Lee et al.: Polygonal boundary approximation for a 2D general sweep 209

Fig. 1a–c.A general sweep and its boundary curve:a anobject, changing its shape dynamically, moves alonga trajectory curve;b sampled instances of the moving ob-ject: c the boundary curve of a general sweep

conditions to determine the interior and exteriorof a swept volume. Recently, Pottmann [21] inves-tigates various important geometric properties ofgeneral offset surfaces. Ilies and Shapiro [13] sug-gest the unsweep as an effective tool for designingmechanical parts that are collision-free from theirsurrounding packages. In these previous approaches,the sweep boundary is computed as a union ofenvelope surface patches. Since the envelope sur-faces usually have a very high degree and quiteoften they have complex shapes (possibly with self-intersections), it is nontrivial to deal with thesesurfaces in constructing the boundary of a swept

volume. Thus previous algorithms restrict movingobjects to those having simple shapes and motionsonly.The general sweep of a 2D curved object providesa handy design tool for modeling complex shapessuch as oriental characters. Ahn et al. [3] develop analgorithm that approximates the boundary of a 2Dgeneral sweep for a planar curved object. Their al-gorithm is efficient and robust; however, redundantedges are eliminated in the last step of the sweepconstruction, which is inconvenient for an interactiveshape design. Figure 2 illustrates the major steps ofAhn et al. [3] for constructing the boundary of a gen-eral sweep. Figure 2a shows polygons approximat-ing the moving object at sampled locations; Fig. 2bshows the sweeps of polygon edges; Fig. 2c showsedges remaining after the elimination of some re-dundant edges; Fig. 2d shows the intersection pointsamong these remaining edges; Fig. 2e is an interme-diate result of eliminating redundant edges based onlocal conditions; Fig. 2f is the final result of eliminat-ing all redundant edges based on global conditions;and finally Fig. 2g shows the result of fitting cubicBézier curve segments to the polygonal approxima-tion of the sweep boundary.Kim et al. [15] represent the bristles of a brush strokeusing variable-radius offset curves. The variable-radius offset is closely related to the general sweepwhere a line segment (of variable length) movesalong a trajectory curve. Parida and Mudur [20]sweep a line segment along a 2D spine curve anddesign the outlines of Indian fonts and calligraphy.Blackmore et al. [5] propose sweep differential equa-tions and a boundary-flow method for computing theboundary of a 2D general sweep. They consider sim-ple polygons moving under linear deformation.In this paper, we present an incremental algorithmthat computes the boundary of a general sweep foran arbitrary 2D curved moving object (with holes).Based on set-theoretic properties of the generalsweep, our algorithm generates the sweep bound-ary incrementally as the motion proceeds; that is, werepeatedly apply a union operation to an intermedi-ate sweep boundary and a neighboring instance ofthe object at each sampled location of the motiontrajectory. For approximation, we polygonize eachinstance of the moving object with dynamic shapechange. Our algorithm is based on boolean opera-tions on simple polygons, which can be implementedrobustly using line/line intersections and inclusiontests for line segments with respect to simple poly-

Page 3: 1 Introduction - Seoul National University3map.snu.ac.kr/mskim/ftp/2dsweep.pdf · a moving mechanicalpart with its surrounding pack-age. Figure 3 illustrates the design steps that

210 J.-H. Lee et al.: Polygonal boundary approximation for a 2D general sweep

Fig. 2a–g.Major construction steps – Ahn et al. [3]

gons [11, 18, 22, 27]. The algorithms of Ahn et al. [3]and Blackmore et al. [5] generate complex polygonsin intermediate steps; thus it is nontrivial to elimi-nate redundant edges robustly. (In particular, whenthe envelope curves have tangential and/or multipleintersections clustered together, a correct arrange-ment of envelope curves is very difficult to computerobustly.) It is clear that our approach is simpleand leads to a robust implementation; nevertheless,previous work has not taken this approach due toefficiency considerations. In this paper, we proposevarious computational shortcuts that greatly improvethe efficiency of our algorithm. The implementedresult gives real-time performance. Moreover, theincremental nature of our algorithm makes the gen-eral sweep very useful for applications in interactiveshape design, collision detection, and mechanicalpart design.Our algorithm solves some important problems ingeometric and solid modeling; e.g., we compute

unsweeps, Minkowski sums/differences, and con-stant radius offsets using the general sweep. Whenunions are replaced by intersections, we can con-struct a dual of a sweep, called an unsweep. Iliesand Shapiro [13] propose the unsweep as an effec-tive computational tool for detecting the collision ofa moving mechanical part with its surrounding pack-age. Figure 3 illustrates the design steps that removecolliding parts from the original shape and redesigna collision-free final shape. After designing an ini-tial object and its surrounding package as shown inFig. 3a, we can test the object to see if it collides withits surrounding package during the motion in Fig. 3b;the swept area can be computed and tested to see ifthere is an overlap with the package (see Fig. 3c).However, the sweep test is not an effective way ofredesigning a collision-free object. Instead of sweep-ing an object, the package can be unswept as shownin Fig. 3d and e. After that, the unswept area is in-tersected with the initial object so as to construct

Page 4: 1 Introduction - Seoul National University3map.snu.ac.kr/mskim/ftp/2dsweep.pdf · a moving mechanicalpart with its surrounding pack-age. Figure 3 illustrates the design steps that

J.-H. Lee et al.: Polygonal boundary approximation for a 2D general sweep 211

Fig. 3a–i. Application of the unsweep operation in the design of mechanical parts:a an initial shapeO1 and its sur-rounding packageP; b rotational sweep ofO1 about a fixed axis;c the swept areaS1 overlaps the package;d unsweepof the package;e unswept areaU; f collision-free parts:O1∩U; g a collision-free new shape;h the sweep of the newshape;i the package contains a new sweep areaS2. (See Ilies and Shapiro [13].)

Page 5: 1 Introduction - Seoul National University3map.snu.ac.kr/mskim/ftp/2dsweep.pdf · a moving mechanicalpart with its surrounding pack-age. Figure 3 illustrates the design steps that

212 J.-H. Lee et al.: Polygonal boundary approximation for a 2D general sweep

a collision-free object (see Fig. 3f). To connect thetwo separate components of Fig. 3f, new parts areadded within the unswept area of Fig. 3e. The fi-nal shape shown in Fig. 3g is then guaranteed to becollision-free with its package (see Fig. 3h and i).Minkowski sums and differences (or decomposition)are morphological operations for shape transforma-tion such as dilation and erosion [10, 24]. They areimportant in computing collision free paths/areas inrobot motion planning and swept areas/volumes inmechanical part design [4, 10, 12, 13, 17, 24]. TheMinkowski sum of two planar objects is closely re-lated to theconvolution curveof the boundary curvesof two input objects. (Given two planar curves,their convolution curve is defined as the set of allvector sums generated by all pairs of curve pointsthat have the same curve normal direction [4].) Theconvolution curve is a superset of the boundary ofa Minkowski sum [4]. Lee et al. [16] compute theboundary of a Minkowski sum based on convolu-tion curve approximation, where redundant convo-lution curves are later eliminated and the remainingcurves generate the boundary of a Minkowski sum.(An illustrative example of Lee et al. [16] is givenin Fig. 24 of Sect. 5.) It is also possible to computethe boundary of a Minkowski difference by reversingthe orientation of an operand curve in the convolu-tion operation.The boundaries of the Minkowski sum and differ-ence are closely related to the translational sweepand unsweep of a moving object with a fixed shapeand orientation. Our general sweep algorithm can beapplied to the computation of the Minkowski sumand difference. We present algorithms for approxi-mating the Minkowski operations. When construct-ing the boundaries of Minkowski sums and differ-ences, our method does not introduce any redundan-cies in the intermediate steps of computation (seeSect. 5).Constant radius offset, an important special case ofthe translational sweep, has been extensively used inshape design and NC tool path generation [23]. Ingeneral, when a circular disk moves along a givenpath, its sweep generates two offset curves of thepath, one on each side of the path.The rest of this paper is organized as follows. Sec-tion 2 presents some preliminary material. In Sect. 3,we show how to approximate the sweep-envelopeboundary of a moving object between two consec-utive locations. In Sect. 4, we construct the bound-ary of a general sweep using a sequence of unions

coupled with envelope approximation. Section 5presents algorithms that solve some problems re-lated to the general sweep: unsweeps, Minkowskisums/differences, and constant radius offsets. Fi-nally, Sect. 6 concludes this paper.

2 Preliminaries

In this section, we introduce basic notations and ter-minology that are used in the rest of the paper. A2D objectis defined as a closed set that includes itsboundary as well as interior points. Let∂A denotethe boundary of an objectA. We allow any num-ber of holes in the objectA, thus∂A may consistof many components: an exterior boundary and theboundaries of holes. For notational convenience, theexterior boundary and thei th hole boundary are rep-resented as∂0A and∂i A, respectively:

∂A= {∂0A}∪ {∂i A}, 1≤ i ≤ the number of holes.

For the sake of simplicity, we exclude the follow-ing types of moving objects from consideration: (1)points, (2) open/closed curves, and (3) open sets.That is, we consider regular objects only.Special types of regular sets includenull objectsand infinite objects: the null objectOφ representsan empty set of points; and an infinite objectO∞contains points at infinity. These two special typesof regular objects are used for defining regularizedboolean operations. When regular polygonal objectshave boundary representation, the null object has novertex or edge, and an infinite object has a system-defined special polygon as its exterior boundary.Given two objectsA and B, boolean set opera-tions are applied to both the interior and boundarypoints of A andB. In many conventional CAD sys-tems, simple objects are usually represented by theirboundaries [8]. To extract the boundary from the re-sult of boolean set operations, we definebooleanboundary operations:

(∂A)c≡ ∂(Ac) (1)

A∂∪ B≡ ∂(A∪ B)

A∂∩ B≡ ∂(A∩ B)

A∂− B≡ ∂(A− B),

whereAc is the complement ofA, and(∂·)c, ∪∂, ∩∂ ,and−∂ denote the boolean boundary operations. An

Page 6: 1 Introduction - Seoul National University3map.snu.ac.kr/mskim/ftp/2dsweep.pdf · a moving mechanicalpart with its surrounding pack-age. Figure 3 illustrates the design steps that

J.-H. Lee et al.: Polygonal boundary approximation for a 2D general sweep 213

important procedure for implementing each booleanboundary operation is the elimination of redundantboundary segments (of the input objects) that belongto the interior of the resulting object. Boolean bound-ary operations need to be regularized to ensure thatthe results are also regular. Moreover, we need todeal with some special cases; e.g., (a) the intersectionof two disjoint objectsA and B must be a null ob-ject: A∩ B= Oφ; (b) the complement of a boundednonempty objectA with holes is a set of regular ob-jects, where one component must be an infinite ob-ject; and (c) the difference of an infinite objectO∞and a bounded regular objectA is another infinite ob-ject,O∞− A= O∞.The result of a set operation may result in irregularobjects. For example, when two objects have contactalong their boundaries, their intersection containssome disconnected curves. In this case, each curvemust be reduced to a null object by regularization.Compared with sweep operations, these boolean op-erations are relatively easy to implement in a robustway [11, 18, 22, 27]. Based on the robustness of theseboolean operations, we propose a robust algorithmthat constructs the boundary of a general sweep.Regardless of representation schemes for input andoutput objects, boolean operations are useful for con-structing a new object from existing ones [9]. Selec-tively combining some operations, a piece of an ob-ject can be added to or subtracted from other objects,and a hole can be created or destroyed. Some well-defined sequences of boolean operations generateeven more complex and interesting shapes. The gen-eral sweep is one of these operations based on unionoperations sequentially applied to each instance ofa moving object.

3 Envelope approximation

In this section, we consider how to approximatethe sweep-envelope boundary of a moving object.For a simple approximation of the swept volume,a sequence of unions may be applied to densely sam-pled instances of a moving object along its motiontrajectory. This approach generates a rough sweepboundary. As shown in Figs. 4b and 5b, such a sweepboundary has many jagged edges and redundantholes depending on the sampling density. To gen-erate a smooth boundary curve, a large number ofunions are required, which would make the algo-rithm inefficient. Moreover, when a moving object is

a

b

c

Fig. 4a–c.Sweeping a convex object:a the moving objectis a pentagon;b a sweep boundary construction withoutenvelope approximation;c a sweep boundary construc-tion with envelope approximation

Page 7: 1 Introduction - Seoul National University3map.snu.ac.kr/mskim/ftp/2dsweep.pdf · a moving mechanicalpart with its surrounding pack-age. Figure 3 illustrates the design steps that

214 J.-H. Lee et al.: Polygonal boundary approximation for a 2D general sweep

Fig. 5a–c.Sweeping a star-shaped object:a the movingobject is a 30-star;b a sweep boundary construction with-out envelope approximation;c a sweep boundary con-struction with envelope approximation

nonconvex or star-shaped, a jagged sweep boundaryis unavoidable (see Fig. 5b). To improve the pre-cision of approximation and the efficiency of algo-rithm, we propose an envelope-based technique thatapproximates the sweep between two consecutiveinstances of a moving object by polygons. Our enve-lope approximation is based on line sweeps. That is,after polygonizing a moving object, we approximateits envelope boundary using the union of the sweepsof polygon edges. This simple approach provides anefficient construction of a smoother boundary of thegeneral sweep. The boundaries of Figs. 4c and 5care constructed with envelope approximation. Notethat they are much less jagged than those of Figs. 4band 5b.Given an objectA, its boundary∂A can be repre-sented as a union of closed boundary curves∂0A=CA,0(u) and∂i A= CA,i (u) (each parameterized byu, for 0≤ u≤ 1):

∂A= {CA,0(u)}∪ {CA,i (u)}, (2)

wherei enumerates the number of holes ofA. Notethat the boundary of an object is oriented in sucha way that the object interior is to the left of theadvancing direction of the boundary curve; i.e., theexterior boundary is oriented counterclockwise, andeach hole boundary is oriented clockwise. By sam-pling points{pk} along the boundary curve∂A, theobject A is approximated by a polygonAp. Whenthe boundary curve is polygonized, it is representedby a list of oriented line segments{lk}, wherelk =(pk, pk+1).Let Aj and Aj+1 be two consecutive instances ofa moving objectA, and l j,k = (pj,k, pj,k+1) andl j+1,k= (pj+1,k, pj+1,k+1) be the correspondingkthline segments ofAp

j andApj+1, respectively. For ap-

proximation, we define an area that is swept froml j,kto l j+1,k (see the first and third columns of Fig. 6): (a)if l j,k andl j+1,k do not intersect, they define a trian-gle or a quadrangle (which is not necessarily convex)(see Fig. 6a–d); (b) if they intersect, they defineone or two triangles (see Fig. 6e–g); and (c) if theyare collinear, their sweep generates a line segmentthat has no contribution to the envelope computationsince a line segment is not a regular object. Con-sequently, each line sweep is approximated by oneor two simple polygons. Figure 6 shows some ex-amples of line sweeps, where intermediate lines aregenerated by linear interpolation (as shown in thesecond column). The case of Fig. 6d needs some ex-planation. Note that a linear interpolation generates

Page 8: 1 Introduction - Seoul National University3map.snu.ac.kr/mskim/ftp/2dsweep.pdf · a moving mechanicalpart with its surrounding pack-age. Figure 3 illustrates the design steps that

J.-H. Lee et al.: Polygonal boundary approximation for a 2D general sweep 215

a

b

c

d

e

f

g

Fig. 6a–g.A line sweep is approximated by:a a quadrangle;b a triangle;c a quadrangle;d a quadrangle;e two triangles;f a triangle;g a triangle

Page 9: 1 Introduction - Seoul National University3map.snu.ac.kr/mskim/ftp/2dsweep.pdf · a moving mechanicalpart with its surrounding pack-age. Figure 3 illustrates the design steps that

216 J.-H. Lee et al.: Polygonal boundary approximation for a 2D general sweep

a b

1 2 3 4 5 6

c

e

d

Fig. 7a–e.Line sweeps wherel j,k andl j+1,k do not intersect:a Apj and Ap

j+1; b Apj ∪ Ap

j+1; c eachL j,k is a quadrangle;dthe boundary of a translational sweep based on envelope approximation;e sequential steps in envelope approximation (grayarea is thek-th line sweepL j,k)

short line segments in the middle of the interpola-tion. Thus, when the object does not shrink an edgequite dramatically, the linear interpolation does notapproximate the motion of a line segment appro-priately. Thus we approximate the line sweep asa rectangle rather than two triangles.Ahn et al. [3] approximate each line sweep bythe convex hull of two line segments, whereas ourmethod allows nonconvex line sweeps. Figure 7cshows an example where each line sweep is a quad-rangle; thus there is no difference between the twomethods in this case. Figure 8c shows an examplewhere each line sweep is composed of two triangles.

Note that, in the case of Fig. 8, our approach of usingnonconvex line sweeps produces a better approxima-tion than the convex-hull-based approach of Ahn etal. [3].Let L j,k denote a line sweep froml j,k to l j+1,k, andletL j denote the union of all these line sweeps:

L j =⋃

1≤ j≤n

L j,k, (3)

wheren is the number of line segments in the poly-gon Ap. We define anapproximate sweep operation

Page 10: 1 Introduction - Seoul National University3map.snu.ac.kr/mskim/ftp/2dsweep.pdf · a moving mechanicalpart with its surrounding pack-age. Figure 3 illustrates the design steps that

J.-H. Lee et al.: Polygonal boundary approximation for a 2D general sweep 217

a b

1 2 3 4 5 6

c

e

d

Fig. 8a–e.Line sweeps wherel j,k andl j+1,k intersect:a Apj andAp

j+1; b Apj ∪ Ap

j+1; c eachL j,k is a pair of triangles;d theboundary of a rotational sweep based on envelope approximation;e sequential steps in envelope approximation (gray areaisthek-th line sweepL j,k)

∨ on Apj andAp

j+1 as

Apj ∨ Ap

j+1= Apj ∪ Ap

j+1∪L j . (4)

Let ∨∂ denote the boundary of the∨ operation.Figures 9 and 10 illustrate how our approxima-tion method works. Note that, in these examples,Ap

j ∪L j is the same asApj ∨ Ap

j+1 (i.e., there is noneed to makeAp

j+1 a union.)When a moving object is convex, as is the case ofFig. 10, many line sweeps make no contribution tothe final sweep envelope. For example, (a)L j,1 is re-

dundant since it is included in the interior ofApj+1,

and (b) L j,8 is redundant sinceL j,9 and L j,10 arecloser to the final envelope boundary. After eliminat-ing all redundant line sweeps, Fig. 11 shows that twoline sweeps{L j,10, L j,22} are sufficient for generat-ing the same result as that of Fig. 10.Consider a convex moving objectA under a trans-lation. In Fig. 12a, the first instanceAj translates tothe second instanceAj+1 by a displacementv. Theswept area is the same as the convex hull ofAj andAj+1 (see Fig. 12b). Its boundary is the union of en-velope lineseu andel and some boundary curves of

Page 11: 1 Introduction - Seoul National University3map.snu.ac.kr/mskim/ftp/2dsweep.pdf · a moving mechanicalpart with its surrounding pack-age. Figure 3 illustrates the design steps that

218 J.-H. Lee et al.: Polygonal boundary approximation for a 2D general sweep

Fig. 9a–e. An approximate sweep operation on two consecutive instances of a 12-star-shaped concave moving object:a Ap

j and Apj+1; b Ap

j ∪ Apj+1; c {L j,k}; d Ap

j ∨ Apj+1; e sequential steps in computing

(Ap

j ∪ Apj+1

)∪ (⋃k L j,k), where

1≤ k≤ 24. Gray areain each subfigure of indexk represents thek-th line sweepL j,k

Page 12: 1 Introduction - Seoul National University3map.snu.ac.kr/mskim/ftp/2dsweep.pdf · a moving mechanicalpart with its surrounding pack-age. Figure 3 illustrates the design steps that

J.-H. Lee et al.: Polygonal boundary approximation for a 2D general sweep 219

Fig. 10a–e.An approximate sweep operation on two consecutive instances of a convex moving object:a Apj and Ap

j+1; bAp

j ∪ Apj+1; c {L j,k}; d Ap

j ∨ Apj+1; esequential steps in computing

(Ap

j ∪ Apj+1

)∪ (⋃k L j,k), where 1≤ k≤ 24.Gray area

in each subfigure of indexk represents thek-th line sweepL j,k

Page 13: 1 Introduction - Seoul National University3map.snu.ac.kr/mskim/ftp/2dsweep.pdf · a moving mechanicalpart with its surrounding pack-age. Figure 3 illustrates the design steps that

220 J.-H. Lee et al.: Polygonal boundary approximation for a 2D general sweep

a b

1 2 3 4 5 6

7 8 9 10 11 12

13 14 15 16 17 18

19 20 21 22 23 24

c

e

d

Fig. 11a–e.Fast approximation of sweep-envelopes:a Apj and Ap

j+1; b Apj ∪ Ap

j+1; c {L j,k∗}; d Apj ∨ Ap

j+1; e sequentialsteps in computing

(Ap

j ∪ Apj+1

)∪ (⋃k∗ L j,k∗), wherek∗ ∈ {10,22}. Gray areain each subfigure of indexk represents the

k-th line sweepL j,k

Page 14: 1 Introduction - Seoul National University3map.snu.ac.kr/mskim/ftp/2dsweep.pdf · a moving mechanicalpart with its surrounding pack-age. Figure 3 illustrates the design steps that

J.-H. Lee et al.: Polygonal boundary approximation for a 2D general sweep 221

a

v

el

eu

b

c d

Fig. 12a–d.A translational sweep of a convex moving object along a fixed directionv: a two instances of the moving objectand envelope lineseu andel ; b the exact boundary of a sweep;c line sweeps;d an approximate boundary of the sweep

Aj and Aj+1. Note thateu andel are line segmentsparallel tov. Moreover,eu andel are defined by theextreme points ofAj and Aj+1 in the directions or-thogonal to that ofv. In Fig. 12c, we approximatethe envelope edgesej,k, applying this technique topolygonal approximationsAp

j andApj+1.

When an object moves with rotation and shapechange, the selection of appropriate envelope edgesej,k becomes more difficult (see Figs. 13 and 14). InFig. 13, we form a union of all line sweeps to gen-erate the swept area, whereas Fig. 14 shows that twoline sweepsL j,10 andL j,22 are sufficient for gener-ating the same result as that of Fig. 13. Thus, we donot need to consider the setL j of all line sweeps.A reduced setL∗j of line sweeps is sufficient for theconstruction of the sweep envelope:

L∗j =⋃k∗

L j,k∗ ,

Apj ∨ Ap

j+1= Apj ∪ Ap

j+1∪L∗j ,

where thek∗th line sweeps are those that may po-tentially contribute to the sweep envelope. In otherwords,L∗j does not include redundant line sweeps

that can easily be excluded, considering the localconfiguration of adjacent line sweeps.In Figs. 13 and 15, most line sweeps belong to thecase of Fig. 6a. This is also the case in most practicalexamples (though the pure rotation of Fig. 8 is an ex-ception). Assume that three consecutive line sweepsL j,k−1, L j,k, andL j,k+1 are of the type of Fig. 6a.Then L j,k−1 and L j,k share an edge(pj,k, pj+1,k).Moreover, this edge(pj,k, pj+1,k) is redundant ifeach side of(pj,k, pj+1,k) belongs to eitherL j,k−1 orL j,k. (That is to say, the edge(pj,k, pj+1,k) is redun-dant if it is oriented oppositely inL j,k−1 and L j,k;see Ahn et al. [3].) A similar argument applies to theline sweepsL j,k and L j,k+1 and their shared edge(pj,k+1, pj+1,k+1). This technique applies to non-convex as well as convex moving objects. The detec-tion of other redundancies is more complex, and weskip the details here.Using a much reduced set improves the efficiencyof our algorithm significantly. Given two convexobjects with the same number of vertices, the setL∗j usually contains two line sweeps. As shown inFigs. 15 and 16, there may be more than two linesweeps contributing to the sweep envelope, in partic-ular, when the sampling is taken relatively sparsely

Page 15: 1 Introduction - Seoul National University3map.snu.ac.kr/mskim/ftp/2dsweep.pdf · a moving mechanicalpart with its surrounding pack-age. Figure 3 illustrates the design steps that

222 J.-H. Lee et al.: Polygonal boundary approximation for a 2D general sweep

Fig. 13a–e.An approximate sweep operation on two consecutive instances of a convex moving object with rotation and shapechange:a Ap

j and Apj+1 intersect at two points;b Ap

j ∪ Apj+1; c {L j,k}; d Ap

j ∨ Apj+1; e sequential steps in computing(

Apj ∪ Ap

j+1

)∪ (⋃k L j,k), where 1≤ k≤ 24.Gray areain each subfigure of indexk represents thek-th line sweepL j,k

Page 16: 1 Introduction - Seoul National University3map.snu.ac.kr/mskim/ftp/2dsweep.pdf · a moving mechanicalpart with its surrounding pack-age. Figure 3 illustrates the design steps that

J.-H. Lee et al.: Polygonal boundary approximation for a 2D general sweep 223

Fig. 14a–e.Fast approximation of sweep-envelopes:a Apj andAp

j+1; b Apj ∪ Ap

j+1; c {L j,k∗}; d Apj ∨ Ap

j+1; esequential stepsin computing

(Ap

j ∪ Apj+1

)∪ (⋃k∗ L j,k∗), wherek∗ ∈ {12, 22}. Gray areain each subfigure of indexk represents thek-th

line sweepL j,k

Page 17: 1 Introduction - Seoul National University3map.snu.ac.kr/mskim/ftp/2dsweep.pdf · a moving mechanicalpart with its surrounding pack-age. Figure 3 illustrates the design steps that

224 J.-H. Lee et al.: Polygonal boundary approximation for a 2D general sweep

Fig. 15a–e.Approximate sweep operation on two consecutive instances of a convex moving object with shape change:a Ap

j and Apj+1 intersect at four points;b Ap

j ∪ Apj+1; c {L j,k}; d Ap

j ∨ Apj+1; e sequential steps in computing(

Apj ∪ Ap

j+1

)∪ (⋃k L j,k), where 1≤ k≤ 24.Gray areain each subfigure of indexk represents thek-th line sweepL j,k

Page 18: 1 Introduction - Seoul National University3map.snu.ac.kr/mskim/ftp/2dsweep.pdf · a moving mechanicalpart with its surrounding pack-age. Figure 3 illustrates the design steps that

J.-H. Lee et al.: Polygonal boundary approximation for a 2D general sweep 225

Fig. 16a–e.Fast approximation of sweep-envelopes:a Apj and Ap

j+1; b Apj ∪ Ap

j+1; c {L j,k∗}; d Apj ∨ Ap

j+1; e sequentialsteps in computing

(Ap

j ∪ Apj+1

)∪ (⋃k∗ L j,k∗), wherek∗ ∈ {3,10, 15, 22}. Gray areain each subfigure of indexk represents

thek-th line sweepL j,k

Page 19: 1 Introduction - Seoul National University3map.snu.ac.kr/mskim/ftp/2dsweep.pdf · a moving mechanicalpart with its surrounding pack-age. Figure 3 illustrates the design steps that

226 J.-H. Lee et al.: Polygonal boundary approximation for a 2D general sweep

Fig. 17a–e.An example of approximate unsweep operation on two instances of a 12-star-shaped concave object:a Apj and

Apj+1; b Ap

j ∩ Apj+1; c {L j,k}; d Ap

j ∧ Apj+1; e sequential steps in computing

(Ap

j ∩ Apj+1

)∩ (⋂k(L j,k

)c), where 1≤ k≤24.Gray areain each subfigure of indexk represents thek-th line sweepL j,k

Page 20: 1 Introduction - Seoul National University3map.snu.ac.kr/mskim/ftp/2dsweep.pdf · a moving mechanicalpart with its surrounding pack-age. Figure 3 illustrates the design steps that

J.-H. Lee et al.: Polygonal boundary approximation for a 2D general sweep 227

Fig. 18a–e.An example of approximate unsweep operation on two instances of a convex object:a Apj and Ap

j+1; bAp

j ∩ Apj+1; c {L j,k}; d Ap

j ∧ Apj+1; e sequential steps in computing

(Ap

j ∩ Apj+1

)∩ (⋂k(L j,k

)c), where 1≤k≤ 24. Grayarea in each subfigure of indexk represents thek-th line sweepL j,kL j,k

Page 21: 1 Introduction - Seoul National University3map.snu.ac.kr/mskim/ftp/2dsweep.pdf · a moving mechanicalpart with its surrounding pack-age. Figure 3 illustrates the design steps that

228 J.-H. Lee et al.: Polygonal boundary approximation for a 2D general sweep

or the moving object changes its shape quite dra-matically. Even in this case, our algorithm detectscontributing line sweeps correctly. Figure 16e showsthatL∗j = {L j,3, L j,10, L j,15, L j,22}.Now, we define anapproximate unsweep operation∧ on Ap

j andApj+1 as

Apj ∧ Ap

j+1= Apj ∩ Ap

j+1∩(L j)c (5)

=(

Apj ∩ Ap

j+1

)−L j .

Let ∧∂ denote the boundary of the∧ operation.Figures 17 and 18 show two unsweeps: one fora nonconvex object and the other for a convex ob-ject. In particular, Fig. 17b and d are the results ofAp

j ∩ Apj+1 and Ap

j ∧ Apj+1, respectively. Note that

Fig. 17b and d are different sinceApj ∧ Ap

j+1 is ob-tained by subtracting some line sweepsL j,k fromAp

j ∩ Apj+1.

4 General sweep boundary

In this section, we define the general sweep as aninfinite union, and we introduce an algorithm that ap-proximates the boundary of a general sweep.A planar rigid motionM(t) at timet is represented asa 3×3 homogeneous matrix

M(t)=[

R(t) v(t)0 1

],

where R(t) is a 2×2 rotation matrix andv(t) isa translation vector[vx(t) vy(t)]T . In a generalsweep, arbitrary shape transformation can be appliedto the moving object. As in Fig. 19, the moving ob-ject can change its shape dynamically with possibletopological changes as well (i.e., while creating anddestroying holes). Therefore, the shape transforma-tion F(t) is nonlinear in general.Given a rigid motionM(t) and a shape transforma-tion F(t), the objectA at timet is represented as

A(t)= M(t) · F(t) · A. (6)

Moreover,∂A(t) represents the boundary ofA attime t. A general sweep produces a new object:

S= S(A,M, F)=⋃

t

M(t) · F(t) · A=⋃

t

A(t), (7)

where⋃

t means an infinite union of the movingobject. S(t1) =⋃t0≤t≤t1 A(t) represents a partially

Fig. 19a–c.General sweep:a the moving object changesits shape from a circle to a torus;b sampled instances ofthe moving object;c the boundary curve of the generalsweep

swept object from an initial timet0 up to the currenttime t1. By the definition of boolean boundary opera-tions given in (1), the boundary of a general sweep isdefined as

∂S= ∂S(A,M, F)= ∂(⋃

t

A(t)

)=

∂⋃t

A(t). (8)

In theory, S and∂S are the exact swept object andits boundary, respectively. However, in practice, itis nontrivial to compute the geometric objects de-fined by (6)–(8). As explained in the introduc-tion, the sweep-envelope curves are high-degree

Page 22: 1 Introduction - Seoul National University3map.snu.ac.kr/mskim/ftp/2dsweep.pdf · a moving mechanicalpart with its surrounding pack-age. Figure 3 illustrates the design steps that

J.-H. Lee et al.: Polygonal boundary approximation for a 2D general sweep 229

Fig. 20.Incrementally generating the boundary of a general sweep

Page 23: 1 Introduction - Seoul National University3map.snu.ac.kr/mskim/ftp/2dsweep.pdf · a moving mechanicalpart with its surrounding pack-age. Figure 3 illustrates the design steps that

230 J.-H. Lee et al.: Polygonal boundary approximation for a 2D general sweep

algebraic curves, and they may have complex self-intersections. Thus we need approximation; in par-ticular, polygonal approximation makes the bound-ary construction considerably easier.Given an initial timet0, a final timete, and the num-ber of discrete time intervalsn, a discrete time do-main is defined asD= {t j |t j = t0+ j∆t}, where 0≤j ≤ n and∆t = (te− t0)/n. From this point of view,(7) and (8) can be discretized, and we can compute anapproximate polygonal sweepSp and its polygonalboundary∂Sp as follows:

Sp= Sp(Ap,M, F) =⋃t∈D

Ap(t)=⋃

0≤ j≤n

Apj , (9)

∂Sp= ∂Sp(Ap,M, F) =∂⋃

t∈D

Ap(t)=∂⋃

0≤ j≤n

Apj ,

where Apj is a polygonal approximation ofAj =

A(t j ).Equation (9) generates a jagged swept area and itsshape is dependent on the sampling density (seeFigs. 4 and 5). To generate a smoother boundary, weneed to use an envelope approximation method asdescribed in Sect. 3. Using the line sweepL j of (3)and the approximate sweep operation of (4) for twoconsecutive instancesAj andAj+1, we can approx-imate the general sweep as

Sp(t0)= Sp0 = Ap

0, (10)

Sp(t j+1)= Spj+1= Sp

j ∪(

Apj ∨ Ap

j+1

)(11)

= Spj ∪ Ap

j+1∪L j .

Equation (10) is an initialization step and (11) de-scribes an induction step. Thus, our algorithm hasa sequential nature. Equation (11) implies that thecurrent sweepSp

j is incremented toSpj+1 by adding

the union Apj+1∪L j to Sp

j . Figure 20 shows theprocedure of incrementally generating the boundaryof a general sweep. The algorithm does not com-pute the envelope curve algebraically. Consecutiveinstances of a moving object are connected withstraight line segments (instead of smooth envelopecurve segments).

5 Sweep-related problems

In this section, we present algorithms that cansolve problems related to the sweep: unsweeps,

Minkowski sums and differences, and constant ra-dius offsets.

5.1 Unsweep

The unsweep is a geometric operation that definesan area belonging to “every” instance of a mov-ing object. In contrast, a sweep operation defines anarea belonging to at least one instance of the mov-ing object (see (7)). Figures 21 and 22 illustratethe difference between sweep and unsweep. Sweepgenerates a area larger than that of the moving ob-ject, whereas unsweep generates a smaller area. Theunsweep operation may result in an empty area asshown in Fig. 22d. Ilies and Shapiro [13] introducethe unsweep operation. They consider moving ob-jects with a fixed shape. As a set-theoretic dual of thesweep, the unsweep plays an important role in the de-sign of mechanical parts.Given a rigid motionM(t) and a shape transforma-tion F(t), the unsweep of an objectA is defined asfollows:

U =U(A,M, F)=⋂

t

M(t) · F(t) · A

=⋂

t

A(t). (12)

Similarly to the sweep operation, we can constructan unsweep using an envelope approximation of (5).Approximation of an unsweep boundary is given bythe following induction step:

U p(t0)=U p0 = Ap

0, (13)

U p(t j+1)=U pj+1=U p

j ∩(

Apj ∧ Ap

j+1

)=U p

j ∩ Apj+1∩

(L j)c.

5.2 The Minkowski sum

We describe an algorithm for computing the bound-ary of a Minkowski sum based on the relationshipbetween the sweep and the Minkowski sum. TheMinkowski sum of two objectsA andB is defined as

A⊕ B= {a+b | a∈ A, b∈ B}.It is easy to check that the Minkowski sum is commu-tative:A⊕ B= B⊕ A.The boundary of a Minkowski sum is closely relatedto the translational sweep of an object with a fixed

Page 24: 1 Introduction - Seoul National University3map.snu.ac.kr/mskim/ftp/2dsweep.pdf · a moving mechanicalpart with its surrounding pack-age. Figure 3 illustrates the design steps that

J.-H. Lee et al.: Polygonal boundary approximation for a 2D general sweep 231

Fig. 21a–d.Sweep and unsweep:a a moving object;b the object moves along a circle;c the sweep;d the unsweepFig. 22a–d.Sweep and unsweep:a a moving object;b the object moves along a circle;c the sweep;d an empty unsweep

shape and orientation. Assume thatA is fixed, andB moves around the boundary ofA, while the originOB of B traces along the boundary ofA. (We may as-sume that the originOB is located in the interior ofthe objectB.) Let SB denote the swept area ofB gen-erated by this motion. Then the areaSB includes thedifference ofA⊕ B andA:

SB ⊃ ((A⊕ B)− A) .

Moreover, we can represent the Minkowski sum bya union of two sets:

A⊕ B= A∪SB. (14)

Let CA =⋃i≥0 CA,i be the boundary curves of anobjectA, andSB be the swept area ofB tracing alongCA (see (2)). The translational sweepSB is computed

as

SB,i = S(B,MA,i , I)=⋃

t

MA,i (t) · I · B

=⋃

t

MA,i (t) · B,

SB =⋃i≥0

SB,i , (15)

where the identity mapI means that there is no shapechange, and eachMA,i (t) is a homogeneous mo-tion matrix representing the translation along eachboundary curveCA,i (t):

MA,i (t)=[

I CA,i (t)0 1

].

Page 25: 1 Introduction - Seoul National University3map.snu.ac.kr/mskim/ftp/2dsweep.pdf · a moving mechanicalpart with its surrounding pack-age. Figure 3 illustrates the design steps that

232 J.-H. Lee et al.: Polygonal boundary approximation for a 2D general sweep

Fig. 23a–g.Construction steps for the boundary of a Minkowski sum:a two objectsA and B; b B moves along the exteriorboundaryCA,0 of A; c ∂SB,0; d B moves along the hole boundaryCA,1 of A; e∂SB,1; f A∪∂SB,0∪∂SB,1; andg ∂(A⊕ B)

Page 26: 1 Introduction - Seoul National University3map.snu.ac.kr/mskim/ftp/2dsweep.pdf · a moving mechanicalpart with its surrounding pack-age. Figure 3 illustrates the design steps that

J.-H. Lee et al.: Polygonal boundary approximation for a 2D general sweep 233

Fig. 24a–d.Computing the boundary of a Minkowski sum based on a convolution curve approximation:a convolution curvesof two objects of Fig. 23a;b polygonal approximations of some convolution curves except some obviously redundant seg-ments;c a polygonal approximation of the boundary of a Minkowski sum;d a refinement of the result (c) using splinecurves

Fig. 25a,b.The Minkowski sumB⊕ A for the objects of Fig. 23a:a sweepingA around the boundary ofB; b ∂(B⊕ A)

Page 27: 1 Introduction - Seoul National University3map.snu.ac.kr/mskim/ftp/2dsweep.pdf · a moving mechanicalpart with its surrounding pack-age. Figure 3 illustrates the design steps that

234 J.-H. Lee et al.: Polygonal boundary approximation for a 2D general sweep

The Minkowski sum of (14) can be reformulatedwith (15):

A⊕ B= A∪SB = A∪⋃

i≥0

SB,i

. (16)

Now, we can represent the boundary of a Minkowskisum as

∂ (A⊕ B)= A∂∪ SB = A

∂∪ ∂⋃

i≥0

SB,i

. (17)

Thus, we can approximate the boundary of a Min-kowski sum following a construction scheme similarto that of (7)–(11):

∂(A⊕ B)' ∂ (Ap⊕ Bp)= Ap ∂∪ SpB, (18)

whereSpB is a polygonal approximation ofSB. Fig-

ure 23a shows the construction steps for the bound-ary of a Minkowski sum. Figure 23 a shows two inputobjects: a flower-shaped objectA and a Y-shaped ob-ject B. For boundary curvesCA,0 and CA,1 of theobject A, Fig. 23c and e show the correspondingsweepsSB,0 and SB,1, respectively. The boundary∂(A⊕ B) of Fig. 23g is constructed by computingA∪∂SB,0∪∂SB,1 (see Fig. 23f).In contrast to our algorithm, Lee et al. [16] computethe boundary of a Minkowski sum based on a con-volution curve approximation, where redundant con-volution curves are later eliminated and the remain-ing curves generate the boundary of a Minkowskisum. For the objects shown in Fig. 23a, Fig. 24 il-lustrates how the algorithm of Lee et al. [16] works.In particular, Fig. 24b and c show how the redundantloops are eliminated from the convolution curvesof Fig. 24a.By the commutativity of the Minkowski sum, we cansweep the objectA around the objectB:

B⊕ A= B∪SA= B∪⋃

j≥0

SA, j

.In this case, the exact and approximate boundaries ofa Minkowski sum are given as

∂ (B⊕ A)= B∂∪ SA, (19)

∂(Bp⊕ Ap)= Bp ∂∪ Sp

A. (20)

Note that (17) and (19) represent the same bound-aries of a Minkowski sum:

∂(A⊕ B)= A∂∪ SB = B

∂∪ SA = ∂(B⊕ A).

In (18) and (20), however, the corresponding ap-proximate boundaries of a Minkowski sum are notexactly the same; nevertheless, they have similarshapes when reasonable samplings and polygoniza-tions are used:

∂(Ap⊕ Bp)= Ap ∂∪ SpB ' Bp ∂∪ Sp

A= ∂(Bp⊕ Ap). (21)

For the objects of Fig. 23a, Fig. 25a shows the re-sult of sweepingA around the boundary ofB. Bythe commutativity of the Minkowski sum, Figs. 23gand 25b must be the same boundary curves.When we make a union of two alternative approx-imations of a Minkowski sum, we get a smootherboundary of the Minkowski sum. Figures 26 and 27illustrate how this approach works. The Minkowskisums of Fig. 26c and e look similar, though theyresult from the two different sweep sequences ofFig. 26b and d, respectively. When we overlapFig. 26c and e, their difference can be observed inFig. 26f. Figure 26g is the union of Fig. 26c and e,and it is less jagged than Fig. 26c and e. Figure 27is generated with the same objects as Fig. 26, butwith sparser samplings. Figure 27f shows that thetwo boundaries of Fig. 27c and e are very different.However, the boundary of Fig. 27g is significantlyless jagged than those of Fig. 27c and e. In Figs. 26and 27, we make a union of each instance of a mov-ing object without envelope approximation so as toshow the effectiveness of our approach. This tech-nique can be applied to other boundary constructionproblems as well (e.g., for interactive sweeping andoffsetting).

5.3 Minkowski difference

The Minkowski difference is closely related to theunsweep with no shape change. As the inverse ofthe Minkowski sum, the Minkowski difference is de-fined as follows [24]:

A B= (Ac⊕ B)c.

Page 28: 1 Introduction - Seoul National University3map.snu.ac.kr/mskim/ftp/2dsweep.pdf · a moving mechanicalpart with its surrounding pack-age. Figure 3 illustrates the design steps that

J.-H. Lee et al.: Polygonal boundary approximation for a 2D general sweep 235

Fig. 26a–g.Constructing the boundary of a Minkowski sum using a blending method for a dense sampling:a two objectsA and B; b B sweeps along the boundary ofA; c a rough polygonal approximation∂Sp

B ' ∂(A⊕ B); d A sweeps alongthe boundary ofB; e a rough polygonal approximation∂Sp

A ' ∂(A⊕ B); f ∂SpB and∂Sp

A; g a blending∂SpB and∂Sp

A as anapproximation of∂(A⊕ B)

Page 29: 1 Introduction - Seoul National University3map.snu.ac.kr/mskim/ftp/2dsweep.pdf · a moving mechanicalpart with its surrounding pack-age. Figure 3 illustrates the design steps that

236 J.-H. Lee et al.: Polygonal boundary approximation for a 2D general sweep

Fig. 27a–g.Constructing the boundary of a Minkowski sum using a blending method for a sparse sampling:a two objectsA and B; b B sweeps along the boundary ofA; c a rough polygonal approximation∂Sp

B ' ∂(A⊕ B); d A sweeps alongthe boundary ofB; e a rough polygonal approximation∂Sp

A ' ∂(A⊕ B); f ∂SpB and ∂Sp

A; g the union∂SpB∪∂Sp

A as anapproximation of∂(A⊕ B)

Page 30: 1 Introduction - Seoul National University3map.snu.ac.kr/mskim/ftp/2dsweep.pdf · a moving mechanicalpart with its surrounding pack-age. Figure 3 illustrates the design steps that

J.-H. Lee et al.: Polygonal boundary approximation for a 2D general sweep 237

Fig. 28a–g.The boundary of a Minkowski difference:a objectsA and B; b B sweeps along the exterior boundaryCA,0;c ∂SB,0 is the sweep boundary ofb; d B sweeps along the hole boundaryCA,1; e ∂SB,1 is the sweep boundary ofd; f(

Ac∪∂SB,0∪∂SB,1

)c; g ∂(A B)

Page 31: 1 Introduction - Seoul National University3map.snu.ac.kr/mskim/ftp/2dsweep.pdf · a moving mechanicalpart with its surrounding pack-age. Figure 3 illustrates the design steps that

238 J.-H. Lee et al.: Polygonal boundary approximation for a 2D general sweep

Fig. 29.Examples of offset curves

Let SB denote the sweep ofB around the boundary ofA. By complementing both sides of (15), we obtainthe unsweep ofBc around the boundary ofA:

UBc = (SB)c=

⋃i≥0

SB,i

c

. (22)

From (16) and (22), the Minkowski difference can bereformulated as

A B= (Ac∪SB)c

= A∩ (SB)c

= A∩UBc

= A∩⋂

i≥0

UBc,i

, (23)

whereUBc,i represents the unsweep ofBc aroundthe i th boundary curve ofA. The boundary ofa Minkowski difference is given as

∂(A B)= A∂∩UBc = A

∂∩ ∂⋂

i≥0

UBc,i

. (24)

We approximate the boundary of a Minkowski dif-ference and those of (7)–(11) similarly.

∂(A B)' ∂ (Ap Bp)= Ap ∂∩U pBc,

whereU pBc is a polygonal approximation ofUBc. Fig-

ure 28 shows the steps for constructing the bound-ary of a Minkowski difference. In Fig. 28f, the grayarea represents the complement of the objectA ofFig. 28a. Note that the Minkowski difference is notcommutative. Hence, in contrast to the case of con-structing a Minkowski sum, we cannot use the tech-nique of taking the union of two alternative represen-tations to improve the quality of approximation.

5.4 Constant radius offset

The constant radius offset is a special case of the gen-eral sweep and the Minkowski sum. Given a curveC, we offset the curveC by sweeping a circular discDr of a fixed radiusr along the trajectory curveC.The offset boundary of the trajectory curveC is rep-resented as

∂S= ∂S(Dr ,MC, I), (25)

where MC is the translation along the trajectorycurve C, and the identity mapI means no shapechange.When the discDr moves around the boundary of anobjectA, the offset boundary is given as

∂S= ∂S(Dr ,M∂A, I), (26)

Page 32: 1 Introduction - Seoul National University3map.snu.ac.kr/mskim/ftp/2dsweep.pdf · a moving mechanicalpart with its surrounding pack-age. Figure 3 illustrates the design steps that

J.-H. Lee et al.: Polygonal boundary approximation for a 2D general sweep 239

whereM∂A is the translation along the boundary ofA. Figure 29 shows the examples of offset curvesgenerated for various radiir .

6 Conclusion

In this paper, we presented an algorithm that com-putes an approximate polygonal boundary of thegeneral sweep for an arbitrary 2D curved object withholes. We define a general sweep as an infinite unionof the moving object and generate the sweep bound-ary in an incremental manner. Compared with pre-vious algorithms, our approximation algorithm hasmany advantages.

• It is easy to implement the algorithm robustlysince it is based on boolean operations on simplepolygons.• Envelope approximation is easy and relatively

precise since it is based on line sweeps (whichmay be nonconvex).• Incremental sweep construction makes the algo-

rithm useful for interactive shape design, colli-sion detection, and mechanical part design.• The unsweep can be implemented in the same

way as the sweep operation by replacing unionswith intersections.• Utilizing various computational shortcuts, the

implemented algorithm demonstrates real-timeperformance for moving objects with reason-able shape complexity and topological changes aswell.

The 3D extension of our algorithm requires a ro-bust implementation of boolean operations on sim-ple polyhedra. Since we start with simple polyhedra,their union and difference are much easier to imple-ment than the construction of the boundary of a 3Dswept volume from a set of sweep-envelope surfaces(approximated by complex polyhedra) which mayhave complex self-intersections. The 3D extension isan immediate goal of our future research.

Acknowledgements.The authors wish to acknowledge the financial sup-port of the Korea Research Foundation in the program year of 1998.

References

1. Abdel-Malek K, Yeh H-J (1997) Geometric representationof the swept volume using Jacobian rank-deficiency condi-tions. Comput Aided Des 29:457–468

2. Agin G, Binford T (1976) Representation and description ofcurved objects. IEEE Trans Comput 25:439–449

3. Ahn J-W, Kim M-S, Lim S-B (1993) Approximate gen-eral sweep boundary of a 2D curved object. CVGIP: GraphModels Image Process 55:98–128

4. Bajaj C, Kim M-S (1989) Generation of configuration spaceobstacles: the case of moving algebraic curves. Algorith-mica 4:157–172

5. Blackmore D, Leu MC, Shin F (1994) Analysis and mod-eling of deformed swept volumes. Comput Aided Des26:315–326

6. Blackmore D, Leu MC, Wang LP (1997) The sweep-envelope differential equation algorithm and its applicationto NC machining verification. Comput Aided Des 29:629–637

7. Chang T-I, Lee J-H, Kim M-S, Hong SJ (1998) Directmanipulation of generalized cylinders based on B-splinemotion. Visual Comput 14:228–239

8. Farin G (1990) Curves and surfaces for computer aided geo-metric design: a practical guide, 4th edn. Academic Press,San Diego, Calif

9. Foley J, Dam A van, Feiner S, Hughes J (1990) Computergraphics: principles and practice, 2nd edn. Addison-Wesley,Reading, Mass

10. Ghosh PK (1988) A mathematical model for shape de-scription using Minkowski operators. Comput Vision GraphImage Process 44:239–269

11. Greiner G, Hormann K (1998) Efficient clipping of arbi-trary polygons. ACM Trans Graph 17:71–83

12. Guibas L, Ramshaw L, Stolfi J (1983) A kinetic frame-work for computer geometry. In 24th Annual Symposiumon Foundations of Computer Science, IEEE, Tuscon, Ari-zona, pp 100–111

13. Ilies HT, Shapiro V The dual of sweep. Comput Aided Des31:185–201

14. Jüttler B (1995) Spatial rational motions and their appli-cation in computer aided geometric design. In: DæhlenM, Lyche T, Schumaker LL (eds) Mathematical methodsfor curves and surfaces. Vanderbilt University Press, LaVergne, Tenn., pp 271–280

15. Kim M-S, Park E-J, Lim S-B (1993) Approximation ofvariable-radius offset curves and its application to Bézierbrush-stroke design. Comput Aided Des 25:684–234

16. Lee I-K, Kim M-S, Elber G (1998) Polynomial/rationalapproximation of Minkowski sum boundary curves. GraphModels Image Process 60:136–165

17. Lozano-Pérez T (1983) Spatial planning: a configurationspace approach. IEEE Trans Comput 32:108–120

18. Margalit A, Knott GD (1989) An algorithm for computingthe union, intersection or difference of two polygons. Com-put Graph 13:167–183

19. Martin RR, Stephenson PC (1990) Sweeping of three-dimensional objects. Comput Aided Des 22:223–234

20. Parida L, Mudur SP (1994) Computational methodsfor evaluating swept object boundaries. Visual Comput10:266–276

21. Pottmann H (1997) General offset surfaces. Neural ParallelSci Comput 5:55–80

22. Requicha AAG, Voelcker HB (1985) Boolean operationsin solid modeling: boundary evaluation and merging algo-rithms. Proc IEEE 73:30–44

Page 33: 1 Introduction - Seoul National University3map.snu.ac.kr/mskim/ftp/2dsweep.pdf · a moving mechanicalpart with its surrounding pack-age. Figure 3 illustrates the design steps that

240 J.-H. Lee et al.: Polygonal boundary approximation for a 2D general sweep

23. Rossignac J, Requicha AAG (1986) Offsetting operations insolid modeling. Comput Aided Geom Des 3:129–148

24. Serra J (1986) Introduction to mathematical morphology.Comput Vision Graph Image Process 35:283–305

25. Wang WP, Wang KK (1986) Geometric modeling for sweptvolume of moving solids. IEEE Comput Graph Appl 6:8–17

26. Weld J, Leu M (1990) Geometric representation ofswept volumes with application to polyhedral objects. IntJ Robotics Res 9:105–117

27. Lee JH (1999) General sweep boundary construction basedon envelope and set operations. PhD Thesis, CSE dept,POSTECH

JOO-HAENG LEE is a SeniorResearcher at the Electronics andTelecommunications Research In-stitute (ETRI), Korea. He receivedhis BS, MS, and PhD in ComputerScience from POSTECH, Korea, in1994, 1996, and 1999, respectively.His research interests include geo-metric modeling, computer graph-ics and animation.

SUNG JE HONG is a Pro-fessor in Computer Science atPOSTECH, Korea. He receiveda BS in Electronics Engineeringfrom Seoul National University,Korea, in 1973. He also receivedan MS in Computer Science fromIowa State University in 1979,and a PhD in Computer Sciencefrom The University of Illinois atUrbana-Champaign in 1983. From1983 to 1989, he was a research

staff member at Corporate Research and Development, Gen-eral Electric. His research interests include VLSI architectures,parallel processing, and computer graphics.

MYUNG-SOO KIM is an As-sociate Professor in Computer En-gineering at Seoul National Uni-versity, Korea. He received a BSand MS in Mathematics fromSeoul National University, Korea,in 1980 and 1982, respectively.He also received MS degrees inApplied Mathematics (1985) andComputer Science (1987) fromPurdue University, where he com-pleted his PhD in Computer Sci-

ence in 1988. Since then, until recently, he was associated withComputer Science, POSTECH. His research interests includegeometric modeling and computer graphics