16
GRAPHICAL MODELS AND IMAGE PROCESSING Vol. 60, No. 1, January, pp. 77–92, 1998 ARTICLE NO. IP970451 Torus/Sphere Intersection Based on a Configuration Space Approach 1 Ku-Jin Kim and Myung-Soo Kim Department of Computer Science, POSTECH, Pohang 790-784, South Korea and Kyungho Oh Department of Mathematics, University of Missouri, St. Louis, Missouri 63121 Received January 21, 1997; revised September 3, 1997; accepted September 27, 1997 This paper presents an efficient and robust geometric algorithm that classifies and detects all possible types of torus/sphere intersec- tions, including all degenerate conic sections (circles) and singular intersections. Given a torus and a sphere, we treat one surface as an obstacle and the other surface as the envelope surface of a moving ball. In this case, the Configuration space (C-space) obstacle is the same as the constant radius offset of the original obstacle, where the radius of the moving ball is taken as the offset distance. Based on the intersection between the C-space obstacle and the trajectory of the center of the moving ball, we detect all the intersection loops and singular contact point/circle of the original torus and sphere. More- over, we generate exactly one starting point (for numerical curve tracing) on each connected component of the intersection curve. All required computations involve vector/distance computations and circle/circle intersections, which can be implemented efficiently and robustly. All degenerate conic sections (circles) can also be detected using a few additional simple geometric tests. The intersection curve itself (a quartic space curve, in general) is then approximated with a sequence of cubic curve segments. c 1998 Academic Press Key Words: surface/surface intersection; torus; sphere; configu- ration space. 1. INTRODUCTION Plane, natural quadrics (sphere, cylinder, and cone), and torus form the so-called CSG primitives in solid modeling systems. They have been frequently used in modeling simple mechanical parts. In the Boolean operations (union, intersection, and differ- ence) of CSG solid objects, we need to compute the intersection curves of these simple surfaces. Many algorithms have been developed for intersecting two freeform surfaces represented in parametric and/or implicit 1 This research was supported in part by the POSTECH Information Re- search Laboratories under Grant 96F502, by the Korean Ministry of Science and Technology under Grants 95-S-05-A-02-A and 96-NS-01-05-A-02-A of STEP 2000, and by Korea Science and Engineering Foundation (KOSEF) under Grant 96-0100-01-01-2. forms. (See [9, 20, 24] for surveys on surface intersection al- gorithms). In principle, they can be used for intersecting two simple surfaces. Unfortunately, there has been no single algo- rithm that can compute the intersection curve of two general surfaces accurately, robustly, and efficiently, while requiring no user intervention (see Chapter 12 of Hoschek and Lasser [9] for more details). In particular, when two surfaces have singular intersections, general algorithms have serious drawbacks in ro- bustness. Even if we restrict the application of general algorithms to simple surfaces only, we cannot expect significant improve- ment. Therefore, general surface intersection algorithms are not appropriate for intersecting simple surfaces (such as plane, nat- ural quadrics, and torus). For intersecting two quadric surfaces, there are many spe- cialized algorithms [6, 13, 14, 17, 19, 21, 27–29] that provide better solutions (in efficiency and robustness) than general sur- face intersection algorithms. Algebraic methods [6, 13, 14, 27, 29] (based on symbolic manipulation of surface equations) are general in the sense that they can handle all types of quadric sur- faces. However, when the algebraic algorithms are implemented using floating-point arithmetic, it is very difficult to ensure their robustness. Numerical errors in algebraic quantities may result in incorrect geometric decisions, especially when two intersecting surfaces have a nearly degenerate/singular configuration. More seriously, surface coefficients have no clear geometric mean- ing, which makes consistent geometric treatment more difficult. Purely symbolic computations may be used to guarantee the ro- bustness of these algebraic algorithms; however, the problem is then how to maintain the efficiency of these algorithms. In the case of intersecting two natural quadrics, the situa- tion is much better. There are reliable geometric algorithms that can intersect two natural quadrics efficiently and robustly [17, 19, 21, 28]. In particular, Miller and Goldman [19] clas- sify necessary and sufficient geometric conditions that corre- spond to all possible types of degenerate/singular intersections. All computations employed in these algorithms have clear geo- metric meanings. Moreover, they can be carried out efficiently and robustly. Together with similar geometric algorithms for 77 1077-3169/98 $25.00 Copyright c 1998 by Academic Press All rights of reproduction in any form reserved.

Torus/Sphere Intersection Based on a Configuration Space ...3map.snu.ac.kr/mskim/ftp/tsi.pdf · section loops connected at a singular intersection point (on the sphere S). The C-space

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Torus/Sphere Intersection Based on a Configuration Space ...3map.snu.ac.kr/mskim/ftp/tsi.pdf · section loops connected at a singular intersection point (on the sphere S). The C-space

January 24, 1998 16:31 CVIU GMIP451

GRAPHICAL MODELS AND IMAGE PROCESSING

Vol. 60, No. 1, January, pp. 77–92, 1998ARTICLE NO. IP970451

Torus/Sphere Intersection Based on a Configuration Space Approach1

Ku-Jin Kim and Myung-Soo Kim

Department of Computer Science, POSTECH, Pohang 790-784, South Korea

and

Kyungho Oh

Department of Mathematics, University of Missouri, St. Louis, Missouri 63121

Received January 21, 1997; revised September 3, 1997; accepted September 27, 1997

This paper presents an efficient and robust geometric algorithmthat classifies and detects all possible types of torus/sphere intersec-tions, including all degenerate conic sections (circles) and singularintersections. Given a torus and a sphere, we treat one surface as anobstacle and the other surface as the envelope surface of a movingball. In this case, the Configuration space (C-space) obstacle is thesame as the constant radius offset of the original obstacle, where theradius of the moving ball is taken as the offset distance. Based onthe intersection between the C-space obstacle and the trajectory ofthe center of the moving ball, we detect all the intersection loops andsingular contact point/circle of the original torus and sphere. More-over, we generate exactly one starting point (for numerical curvetracing) on each connected component of the intersection curve. Allrequired computations involve vector/distance computations andcircle/circle intersections, which can be implemented efficiently androbustly. All degenerate conic sections (circles) can also be detectedusing a few additional simple geometric tests. The intersection curveitself (a quartic space curve, in general) is then approximated witha sequence of cubic curve segments. c© 1998 Academic Press

Key Words: surface/surface intersection; torus; sphere; configu-ration space.

1. INTRODUCTION

Plane, natural quadrics (sphere, cylinder, and cone), and torusform the so-called CSG primitives in solid modeling systems.They have been frequently used in modeling simple mechanicalparts. In the Boolean operations (union, intersection, and differ-ence) of CSG solid objects, we need to compute the intersectioncurves of these simple surfaces.

Many algorithms have been developed for intersecting twofreeform surfaces represented in parametric and/or implicit

1 This research was supported in part by the POSTECH Information Re-search Laboratories under Grant 96F502, by the Korean Ministry of Scienceand Technology under Grants 95-S-05-A-02-A and 96-NS-01-05-A-02-A ofSTEP 2000, and by Korea Science and Engineering Foundation (KOSEF) underGrant 96-0100-01-01-2.

forms. (See [9, 20, 24] for surveys on surface intersection al-gorithms). In principle, they can be used for intersecting twosimple surfaces. Unfortunately, there has been no single algo-rithm that can compute the intersection curve of two generalsurfaces accurately, robustly, and efficiently, while requiring nouser intervention (see Chapter 12 of Hoschek and Lasser [9]for more details). In particular, when two surfaces have singularintersections, general algorithms have serious drawbacks in ro-bustness. Even if we restrict the application of general algorithmsto simple surfaces only, we cannot expect significant improve-ment. Therefore, general surface intersection algorithms are notappropriate for intersecting simple surfaces (such as plane, nat-ural quadrics, and torus).

For intersecting two quadric surfaces, there are many spe-cialized algorithms [6, 13, 14, 17, 19, 21, 27–29] that providebetter solutions (in efficiency and robustness) than general sur-face intersection algorithms. Algebraic methods [6, 13, 14, 27,29] (based on symbolic manipulation of surface equations) aregeneral in the sense that they can handle all types of quadric sur-faces. However, when the algebraic algorithms are implementedusing floating-point arithmetic, it is very difficult to ensure theirrobustness. Numerical errors in algebraic quantities may result inincorrect geometric decisions, especially when two intersectingsurfaces have a nearly degenerate/singular configuration. Moreseriously, surface coefficients have no clear geometric mean-ing, which makes consistent geometric treatment more difficult.Purely symbolic computations may be used to guarantee the ro-bustness of these algebraic algorithms; however, the problem isthen how to maintain the efficiency of these algorithms.

In the case of intersecting two natural quadrics, the situa-tion is much better. There are reliable geometric algorithmsthat can intersect two natural quadrics efficiently and robustly[17, 19, 21, 28]. In particular, Miller and Goldman [19] clas-sify necessary and sufficient geometric conditions that corre-spond to all possible types of degenerate/singular intersections.All computations employed in these algorithms have clear geo-metric meanings. Moreover, they can be carried out efficientlyand robustly. Together with similar geometric algorithms for

771077-3169/98 $25.00

Copyright c© 1998 by Academic PressAll rights of reproduction in any form reserved.

Page 2: Torus/Sphere Intersection Based on a Configuration Space ...3map.snu.ac.kr/mskim/ftp/tsi.pdf · section loops connected at a singular intersection point (on the sphere S). The C-space

January 24, 1998 16:31 CVIU GMIP451

78 KIM, KIM, AND OH

computing the planar sections of natural quadrics [11, 18], thesealgorithms [17, 19, 21, 28] can support efficient and robustBoolean operations for CSG objects constructed by planes andnatural quadrics. A natural question is how to extend the geo-metric coverage to include torus.

There are algebraic methods for intersecting two arbitrarycyclides [5, 10, 16]. Plane, natural quadrics, and torus are spe-cial types of cyclide. Therefore, these algorithms can be usedin intersecting a torus with other simple surfaces (plane, naturalquadrics, and torus). As in the case of two intersecting quadricsurfaces, algebraic methods are general, but they have limita-tions in robustness. Therefore, we need to develop geometricalgorithms that can guarantee efficiency and robustness at thesame time.

In this paper, we present a geometric algorithm that detects allpossible topological types of a torus/sphere intersection (TSI)curve and generates exactly one starting point (for numericalcurve tracing) on each connected component. All required com-putations involve vector/distance computations and circle/circleintersections, which can be implemented efficiently and robustlyusing floating-point arithmetic. Degenerate conic sections (cir-cles) in a TSI curve are detected using a few additional simplegeometric tests. Singular intersections are detected based on test-ing tangency in certain circle/circle intersections. The TSI curveitself (a quartic space curve, in general) is then numerically ap-proximated with a sequence of cubic curve segments [1, 3, 4].

Our algorithm is based on a geometric transformation that re-duces the TSI problem to a simpler problem of (i) classifying therelative position of a point with respect to the regions bounded bytwo tori or (ii) intersecting a circle with two concentric spheres.The geometric transformation generates the so-calledConfigu-ration space(C-space) obstacles [2, 15]. In robotics, the C-spaceapproach (proposed by Lozano-P´erez [15]) reduces the collisiondetection problem between a moving robot and an obstacle (i.e.,the intersection between two solid objects) to a simpler prob-lem of testing the containment of a point (called the referencepoint of the robot) in the C-space obstacle. In the case of a robotbounded/modeled by a sphere, the C-space obstacle with respectto the sphere (robot) is essentially the same as the offset of theoriginal obstacle [2].

When we consider the torus as an obstacle and the sphere asa moving robot, the C-space obstacle of the torus is bounded bytwo tori (with the same major radius, but with different minorradii). The relative position of the sphere center with respect tothe two tori provides an effective way of classifying and detect-ing all different topological types of the TSI curves. When weconsider the sphere as an obstacle and the torus as an envelopesurface of a moving ball along a circular trajectory, the C-spaceobstacle of the sphere is bounded by the inner and outer offsetsof the sphere (which are two concentric spheres). Intersectingthe trajectory circle of the moving ball with the C-space obstacle(bounded by two spheres), we can effectively classify the topo-logical type of the TSI curve and construct the TSI curve withall its singularities detected properly.

In each of the first three cases shown in Fig. 1, the toroidal vol-ume bounded byT and the ball bounded bySintersect in a singleconnected (volumetric) component. However, their boundarysurfacesT andS intersect in two closed loops (Fig. 1a) in an 8-figured loop with self-intersection (Fig. 1b) and in a single loop(Fig. 1c), respectively. The last case shown in Fig. 1d is relatedto a singular tangential intersection point. Note that the bolddots represent the center positions of the sweeping ball (insidethe torusT), each corresponding to a tangential contact withthe sphereS. In Fig. 2, these dots correspond to the intersectionpoints between the main circleC (of the torusT) and the C-spaceobstacle boundary (composed of two concentric spheres). Notethat the circleC is also the circular trajectory of the sweepingball’s center.

The classification of each possible type of intersection loop(s)can be made considerably easier when we do the C-space trans-formation. That is, in Fig. 2, the sphereS is expanded to avolume bounded by two spheresSI and SO, and the torus isshrunk to its main circleC. In Fig. 2a, the intersection betweenthe circleC and the volume (bounded bySI andSO) has twoconnected components (i.e., two circular arcs). Each componentcorresponds to a closed loop in the intersection curve betweenT andS. Moreover, in Fig. 2c, the intersection (in the C-space)has only one connected component. Therefore, the intersectioncurve ofT andS has a single closed loop. Figure 2b shows aninteresting degenerate case in which the intersection (betweenC and the C-space obstacle) may be considered as two com-ponents connected at the tangential intersection point with theinner sphereSI . The corresponding intersection curve ofT andS is an 8-figured curve which may be considered as two inter-section loops connected at a singular intersection point (on thesphereS). The C-space approach completely classifies all possi-ble topological types of TSI curves. However, it does not providea direct classification of all degenerate cases in which the TSIcurve is composed of planar conic sections. In this paper, wealso present simple geometric tests that can detect all possibletypes of degenerate conic sections (circles) in the TSI curve.

Piegl [22] considered the intersection of a torus with a plane.In particular, he observed a degenerate intersection in whicha plane has two tangential intersections with a torus. In thiscase, the intersection curve consists of two intersecting circles(called Yvone-Villarceau circles). Similarly, when a sphere hastwo tangential intersections with a torus, the intersection curveconsists of two Yvone-Villarceau circles (which are noncopla-nar, in general). When we enlarge the radius of the sphere, theintersection curve (composed of two circles) converges to twocoplanar circles contained in the limiting plane of the sphere. Infact, the Yvone-Villarceau circles are the only nontrivial conicsections that can be embedded in a torus. There are two othertypes of degenerate conic sections (circles) on a torus which arequite simple: (i) profiles circles and (ii) cross-sectional circles(see Fig. 4). We show that all degenerate circles can be detectedand computed using a few simple geometric tests including vec-tor/distance computations and circle/circle intersections.

Page 3: Torus/Sphere Intersection Based on a Configuration Space ...3map.snu.ac.kr/mskim/ftp/tsi.pdf · section loops connected at a singular intersection point (on the sphere S). The C-space

January 24, 1998 16:31 CVIU GMIP451

TORUS/SPHERE INTERSECTION 79

FIG. 1. Intersections between a torusT and a sphereS.

The detection of degenerate circles and singular intersectionsin a TSI curve is important since they are rational curves. That is,they can be represented exactly and efficiently. In the intersectionof two general quadric surfaces, Faroukiet al. [6] showed that alldegenerate conic sections and singular intersections are rationalcurves. In Section 2, we show that the real, affine TSI curve isthe same as the intersection of a sphere and a quadric surface.Therefore, all degenerate circles and singular intersection curvesin a TSI curve are also rational. Moreover, Shene and Johnstone[28] discussed the importance of conic sections in blending twonatural quadrics using cyclides. We have a similar advantage inthe torus/sphere intersection. LetTd andSd be the offsets ofTandS, respectively, with respect to the offset distanced. Whenthe offset surfacesTd andSd intersect in a degenerate circle ofradiusR, the torusT and the sphereS can be blended using atorus with a major radiusR and a minor radiusd (see Rossignacand Requicha [25, 26]).

The rest of this paper is organized as follows. In Section 2,we define some basic notations and review mathematical pre-liminaries. Section 3 presents geometric algorithms to computethe TSI curve. Finally, we conclude this paper in Section 4.

FIG. 2. Intersections between the main circle ofT and the C-space obstacle ofS.

2. MATHEMATICAL PRELIMINARIES

In this section, we introduce some basic notations and back-ground material which are useful in understanding the conceptsand algorithms presented in later sections. In Section 2.1, weintroduce notations for geometric primitives that will be used inthis paper. Section 2.2 shows that a real, affine TSI curve canbe realized as the intersection curve of a sphere and a quadraticsurface. In Section 2.3, we enumerate all possible types of conicsections (circles) that can be embedded in a torus. Moreover,we present simple geometric methods that detect each type ofdegenerate circle in a TSI curve (see more details in Kim andKim [12]).

2.1. Notations for Geometric Primitives

Notations for basic geometric primitives are summarized inTable 1, where 3D points/vectors are represented in boldface.Note that the torusTr,R(p,N) is the boundary of the sweepingvolume∪q∈CR(p,N) Br (q). When the ball centerq is located on themain circle of the torus (i.e.,q∈CR(p,N)), the torusTr,R(p,N)and the ballBr (q) share a cross-sectional circleCr (q,Nq), where

Page 4: Torus/Sphere Intersection Based on a Configuration Space ...3map.snu.ac.kr/mskim/ftp/tsi.pdf · section loops connected at a singular intersection point (on the sphere S). The C-space

January 24, 1998 16:31 CVIU GMIP451

80 KIM, KIM, AND OH

TABLE 1Notations for Geometric Primitives

e1, e2, e3 ∈ S2 Standard unit vectors:e1 = (1, 0, 0), e2 = (0, 1, 0),e3 = (0, 0, 1)

p, q ∈ R3 3D pointsN ∈ S2 Unit vector representing a plane normalNp,Nq ∈ S2 Unit vectors with tails atp andq, respectivelyL(p,N) The plane that containsp and is normal toNBδ(p) The ball with centerp and radiusδ: {q∈ R3 | ‖q− p‖≤ δ}Sδ(p) The sphere with centerp and radiusδ: {q∈ R3 | ‖q− p‖= δ}Cd(p,N) The circle with radiusd and centerp, and

contained in the planeL(p,N)Tr,R(p,N) The torus with minor radiusr , major

radiusR, centerp, and main circleCR(p,N)

Nq=N× (q− p)/‖q− p‖. Figure 3 shows three different typesof tori Tr,R(p,N) for (a) r < R, (b) r = R, and (c)r > R. In thispaper, we assume that the input torus is always of the first type;that is, we assume 0< r < R. However, when we offset the torusfor the generation of a C-space obstacle, the resulting C-spacetorus may be of the types (b) and (c).

2.2. TSI as a Quartic Curve

We show that the real, affine TSI curve is the same as theintersection curve of a sphere and a quadric surface. Thus, thealgebraic degree of a real, affine TSI curve is four at most. By ap-plying translation and rotation if necessary, we may assume thatthe torusT is given in a standard position and orientation; thatis, its center is at the origin and its main circle is contained in thexy plane:T = Tr,R(0, e3), where0= (0, 0, 0) ande3= (0, 0, 1).The sphereS is in an arbitrary position:S= Sδ((α, β, γ )).

The implicit equation of the torusT = Tr,R(0, e3) is given as

(x2+ y2+ z2+ R2− r 2)2− 4R2(x2+ y2) = 0. (1)

Moreover, the implicit equation of the sphereS= Sδ((α, β, γ ))is given by

(x − α)2+ (y− β)2+ (z− γ )2− δ2 = 0,

FIG. 3. (a) Tr,R(p,N) with r < R, (b) Tr,R(p,N) with r = R, and (c)Tr,R(p,N) with r > R.

equivalently,

x2+ y2+ z2 = δ2− α2− β2− γ 2+ 2αx + 2βy+ 2γ z. (2)

By substituting Eq. (2) to Eq. (1), we obtain

(2αx + 2βy+ 2γ z+ E)2− 4R2(x2+ y2) = 0, (3)

whereE= R2− r 2+ δ2−α2−β2− γ 2. This equation can bereformulated as a quadric surface as

4(α2− R2)x2+ 4(β2− R2)y2+ 4γ 2z2+ 8(αβ)xy+ 8(βγ )yz

+ 8(γα)zx+ 4(αE)x + 4(βE)y+ 4(γ E)z+ E2 = 0. (4)

The TSI curve is the same as the intersection curve of thesphereS and the quadric surface defined by Eq. (4). But, thequadric surface of Eq. (4) is not a natural quadric. For example,when (α, β, γ )= (1, 0, 0), R= 3, r = 1, andδ= 3, Eq. (4) rep-resents an elliptic cylinder. When (α, β, γ )= (3, 0, 0), R= 2,r = 0.5, and δ= 3, Eq. (4) represents a hyperbolic cylinder.Therefore, we cannot use the intersection algorithms for nat-ural quadrics to solve the TSI problem [17, 19, 21, 27, 28].Though there are algebraic algorithms for intersecting two gen-eral quadrics [6, 13, 14, 29], they have limitations in numeri-cal stability (see [17, 19] for related discussions). Therefore, weneed to develop an efficient and robust geometric method to com-pute the TSI curve. In this paper, we present such an algorithmusing a geometric transformation that reduces the torus/sphereintersection problem to a simpler problem of either (i) classify-ing the containment of a point in an open region bounded by twotoroidal surfaces or (ii) intersecting a circle with two concentricspheres. Using a few vector/distance computations, we can re-duce this problem to either (i) classifying the containment of apoint in a circular region or (ii) intersecting two circles in thesame plane. These computations can be implemented in an effi-cient and robust way using floating-point arithmetic. We discussthis in more detail in Section 3.

2.3. Degenerate Circles in a TSI Curve

Conic sections embedded in a torus must be circles of spe-cial types (see Fig. 4): (i) profile circles, (ii) cross-sectional

Page 5: Torus/Sphere Intersection Based on a Configuration Space ...3map.snu.ac.kr/mskim/ftp/tsi.pdf · section loops connected at a singular intersection point (on the sphere S). The C-space

January 24, 1998 16:31 CVIU GMIP451

TORUS/SPHERE INTERSECTION 81

FIG. 4. (a) Profile circles, (b) cross-sectional circles, and (c) Yvone-Villarceau circles.

circles, and (iii) Yvone-Villarceau circles. This classification isa well-known result in classical geometry [23]. In fact, we caneasily prove this using an elementary (but tedious) derivation.Instead of a rigorous proof, we present illustrative examples ofthese special types of circles and discuss how to detect each ofthem.

In Section 3, a simple method based on a C-space transfor-mation will be introduced that can test the existence of twoYvone-Villarceau circles in a TSI curve. The construction of thetwo Yvone-Villarceau circles is given in Kim and Kim [12]. Weomit the details here.

The TSI curve may contain a profile circle only if the centerof a sphereS is located on the main axis of the torusT . Givena torusT = Tr,R(p1,N) and a sphereS= Sδ(p2), this conditioncan be tested using

(p2− p1)× N = 0.

If this condition holds, we consider the planar sections ofT andS on the planeL that contains the main axis ofT . The torusTintersects with the planeL in two cross-sectional circlesC+r andC−r of radiusr , and the sphereS intersects with the planeL in acircleCδ of radiusδ (see Fig. 5). The TSI curve consists of two

FIG. 5. Profile circles in TSI.

profile circles if and only if the circleCδ intersects withC+r (orC−r ) in two points. The center and radius of the TSI curve can beconstructed using the information obtained from the circle/circleintersectionCδ ∩C+r (or Cδ ∩C−r ).

The detection of cross-sectional circles in a TSI curve is morecomplex. First, the radius ofS must be larger than or equal tothe minor radius ofT :

δ ≥ r.

Then the center ofSmust be contained in the main plane ofT ,which can be easily tested as

〈p2− p1,N〉 = 0.

Finally, the following condition must be satisfied (see Fig. 6):

‖p2− p1‖2 = R2+ δ2− r 2.

3. TORUS/SPHERE INTERSECTION

This section introduces two methods of computing the TSIcurve based on a C-space approach. Given a torusT = Tr,R(p1,N)

Page 6: Torus/Sphere Intersection Based on a Configuration Space ...3map.snu.ac.kr/mskim/ftp/tsi.pdf · section loops connected at a singular intersection point (on the sphere S). The C-space

January 24, 1998 16:31 CVIU GMIP451

82 KIM, KIM, AND OH

FIG. 6. Cross-sectional circles in TSI.

and a sphereS= Sδ(p2), the first method considers the case of0<δ≤ r , and the second method considers the case of 0< r <δ.In the first method, the relative position of the sphere cen-ter p2 with respect to the torusT determines the TSI curve.In the second method, the relative position of the main cir-cle CR(p1,N) with respect to the sphereS determines the TSIcurve. The C-space approach is useful in classifying the relativepositions.

3.1. The Case of 0<δ≤ r

In this case, we consider the torusT as an obstacle and com-pute the C-space obstacle of the torusT with respect to thesphereS. By applying a simple translation, we may assumethat the torusT has its center at the origin,T = Tr,R(0,N), andthe sphereS is given asS= Sδ(p). The C-space obstacle ofT isbounded by the±δ-offsets of the torus; i.e., the inner offset torusT I = Tr−δ,R(0,N) and the outer offset torusT O= Tr+δ,R(0,N).

3.1.1. Case Analysis for Singular Intersections

Whenr + δ≥ R, the outer torusT O self-intersects. LetT D

denote the self-intersected part ofT O (see Figs. 3b and 3c). (Inthe case ofr + δ < R, T O has no self-intersection; thus we haveT D =∅.) Based on the relative position ofp with respect toT I ,T O, andT D, we can classify all possible topological types ofthe TSI curves. The TSI curve has singularity (i.e., the torusTand the sphereS have a tangential intersection atpT ∈ T ∩ S)if and only if the centerp of S is on the boundary ofT I , T O,and T D, wherepT is an orthogonal projection ofp onto thesurfaceT . Note thatp is also the±δ-offset point ofpT ∈ T (seeFig. 7). There are five different cases to consider (for singularintersections):

1. p∈ T O\T D: the TSI curve degenerates into a pointpT

(Fig. 7a).2. p∈ T D andp is a vertex ofT D: the TSI curve degenerates

into a circle (Fig. 7b).

3. p∈ T D andp is not a vertex: the TSI curve is a quarticspace curve with singularity atpT (Fig. 7c).

4. p∈ T I and 0<δ< r : the TSI curve degenerates into apointpT (Fig. 7d).

5. p∈ T I and 0<δ= r : the TSI curve degenerates into acircle (Fig. 7e).

The figures in the left columns of Figs. 7 and 8 illustrate therelative positions ofp in the C-space of the torusT ; the figuresin the right columns of Figs. 7 and 8 illustrate the correspondingrelative configurations ofT andS.

In Case 2 considered above, the torus and the sphere touchalong a degenerate circle. When we enlarge the radiusδ of thesphereSslightly, the sphereSwill intersect with the torusT intwo different circles. Therefore, the degenerate circle of Fig. 7bmay be considered as the limit of these two converging circles.When the limiting circle is interpreted as an overlap of two iden-tical circles, the singular degenerate circle has a total algebraicdegree of four. Therefore, it is clear that there is no other loopin the TSI curve.

In Case 3 considered above, the TSI curve has degree fourand the curve has four branches at the singular point (i.e., atthe tangential intersection point ofT andS). (In algebraic ge-ometry, two opposite branch directions are counted as a singlebranch; however, in this paper, we count them separately to makethe counting scheme more intuitive for the engineering commu-nity.) We can easily compute these four branches by comparingthe Dupin indicatrices of the torusT and the sphereS at theirtangential intersection point (see also Piegl [22]). The wholeTSI curve can be detected by tracing along only two appropriatebranches at the singular point. Using the result of Faroukiet al.[6], we can also represent the TSI curve (with a singular point)exactly as a rational quartic space curve. The fact that there isno other loop in the TSI curve will become clear when we dis-cuss the relationship between the number of intersection loopsand the winding number assigned to each 3D (volumetric) openregion bounded byT I , T O, andT D.

Page 7: Torus/Sphere Intersection Based on a Configuration Space ...3map.snu.ac.kr/mskim/ftp/tsi.pdf · section loops connected at a singular intersection point (on the sphere S). The C-space

January 24, 1998 16:31 CVIU GMIP451

TORUS/SPHERE INTERSECTION 83

In Case 5, when we enlarge the radiusδ of the sphereSslightly,the sphereS will intersect with the torusT in an irreduciblequartic space curve. But, when we relocate the centerp of S inthe main plane ofT and at a distance

√R2+ δ2− r 2 from the

center ofT , the sphereS will intersect with the torusT in twodegenerate circles (see Section 2.3 and Fig. 6). As the radiusδ ofSconverges to the minor radiusr of T , the two degenerate circlesconverge to the singular degenerate circle of Case 5 shown inFig. 7e. Therefore, we can apply an argument similar to that ofCase 2 and conclude that there is no other loop in the TSI curve.

3.1.2. Case Analysis for Nonsingular Intersections

The TSI curve has no singularity if and only if the centerp of S is not located on the toroidal surfaceT I , T O, or T D.Let T I

− andT I+ denote the interior and exterior open regions of

R3 separated by the closed surfaceT I . T D− andT D

+ are definedsimilarly. T O

− and T O+ are the open regions separated by the

closed surfaceT O\T DO, whereT DO

denotesT D except twovertices ofT D. There are four different cases to consider (fornonsingular intersections):

1. p∈ T O+ : the TSI curve is empty (Fig. 8a).

2. p∈ T I−: the TSI curve is empty (Fig. 8b).

3. p∈ T O− ∩ T I

+ ∩ T D+ : the TSI curve has only one loop

(Fig. 8c).4. p∈ T D

− : the TSI curve has two loops (Fig. 8d).

Note that each pointp /∈ T I ∪ T O ∪ T D (i.e.,p is not located onany of the toroidal surfacesT I , T O, andT D) must belong to oneof the four open regions enumerated in the above classification.In Case 4 considered above, each loop of the TSI curve maydegenerate into a circle when the pointp is located on the mainaxis of the torusT (see Section 2.3 and Fig. 5).

3.1.3. Winding Number Theory

The number of closed loops in the TSI curve is closely relatedto the winding number of the two toroidal surfacesT O andT I

around the centerp of the sphereS. When we give the normal ori-entations of the surfacesT O andT D into the outward directions(i.e., pointing to the regionsT O

+ andT D+ , respectively) and that of

the surfaceT I into the inward direction (i.e., pointing to the re-gionT I

−), the winding numbers assigned to the open regionsT O+

andT I− are both zero. Moreover, the winding number assigned to

T O− ∩ T I

+ ∩ T D+ is one and that assigned toT D

− is two. A formaldefinition of winding number can be found in a standard text-book of differential topology [8]. But there is a simple way tocompute the winding number assigned to an open region. Thatis, when we cut the spaceR3 by a planeL that passes through apoint p, the toroidal surfacesT I andT O will intersect with theplane in some closed planar curves. These closed curves boundthe planar open regions:T O

+ ∩ L , T I− ∩ L , (T O

− ∩ T I+ ∩ T D

+ )∩ L ,andT D

− ∩ L in the planeL. When we trace each curve so thatthe curve normal (inherited from the surface normal orientation)is always to the right-hand side of the curve advancing direc-

tion, we can determine the winding number of the planar curvesaround the selected pointp. Figure 9 shows two examples of pla-nar cuts, in which the planeL is taken so that it contains the pointp and is orthogonal to the normal vectorN. Figure 9a is the resultof a planar cut applied to the example shown in Fig. 8c. Note thatthe winding number of two oriented circles aroundp is one. Fig-ure 9b shows a similar result applied to the example of Fig. 8d.The winding number of four oriented circles aroundp is two.One can also show that the winding number is unique as long asp is selected in the same open region,T O

+ , TI−, T

O− ∩ T I

+ ∩ T D+ ,

or T D− .

When we consider the sphereS= Sδ(p) as a moving sphere,as the sphereS passes through a touching configuration withthe torusT , the number of closed loops in the TSI curveT ∩ Sincreases/decreases. That is, when the centerp of S passessthroughT I , T O, or T D, the number of TSI loops increases/decreases depending on the winding numbers of the correspond-ing open regions bounded by the toroidal surfacesT I , T O, andT D. A case-by-case analysis of each of the four different casespossible (enumerated in Fig. 8) will show that the winding num-ber of each open region properly classifies the number of closedloops in the TSI curve. In general, an argument based on theJordan-Brouwer Separation Theorem will provide a rigorousproof for the relation between the winding number and the num-ber of closed loops in the TSI curve [8]. We omit the details here.

Guibaset al. [7] showed an application of the winding num-ber (defined for planar closed loops which may self-intersect)in computing the number of connected components in the inter-section of two planar objects. However, they did not consideran intersected volume with interior holes (e.g., an object withgenus 1) such as the volume bounded byT andS in Fig. 8d.

3.1.4. ALGORITHM: Torus SphereIntersectionI

ALGORITHM: TorusSphereIntersectionI of Appendix A sum-marizes the TSI algorithm based on the above case analyses.In this algorithm, we assume that cubic curve tracing routinesTraceSingularTSI Curve (T, S, P) and TraceRegularTSICurve (T, S, P), are available, whereT is a torus,S is a sphere,and P is the set of starting points (exactly one point for eachclosed loop of the TSI curve). Each singular intersection curvecan be traced starting from its singular point (see also Piegl [22]),the details of which are given in the routine TraceSingularTSICurve. One may also use the technique of Faroukiet al. [6] foran exact rational parametrization of the singular quartic spacecurve. To deal with the case in whichT andShave no tangentialintersection point, a starting point must be generated on eachclosed loop of the TSI curve. After that, each curve compo-nent is traced using the routine TraceRegularTSI Curve. Ourimplementation of the two curve tracing routines is based oncustomizing the general SSI procedures of Choi [4] to the spe-cial case of intersecting a torus with a sphere (see also Bajajet al. [1, 3]).

Lines (1)–(3) compute orthogonal projections ofp onto thetorusT . Given a pointp (not located on the main axis of the

Page 8: Torus/Sphere Intersection Based on a Configuration Space ...3map.snu.ac.kr/mskim/ftp/tsi.pdf · section loops connected at a singular intersection point (on the sphere S). The C-space

January 24, 1998 16:31 CVIU GMIP451

84 KIM, KIM, AND OH

FIG. 7. Degenerate or singular intersections.

Page 9: Torus/Sphere Intersection Based on a Configuration Space ...3map.snu.ac.kr/mskim/ftp/tsi.pdf · section loops connected at a singular intersection point (on the sphere S). The C-space

January 24, 1998 16:31 CVIU GMIP451

TORUS/SPHERE INTERSECTION 85

FIG. 8. Regular intersections.

Page 10: Torus/Sphere Intersection Based on a Configuration Space ...3map.snu.ac.kr/mskim/ftp/tsi.pdf · section loops connected at a singular intersection point (on the sphere S). The C-space

January 24, 1998 16:31 CVIU GMIP451

86 KIM, KIM, AND OH

FIG. 9. Counting winding numbers using planar cuts.

torusT), the closest pointpc of the main circleCR(0,N) to thepointp is computed as

pc = Rp− 〈p,N〉N‖p− 〈p,N〉N‖ .

Similarly, the farthest pointp f is given by

p f = −Rp− 〈p,N〉N‖p− 〈p,N〉N‖ .

Line (4) considers the case in which there is only a singleloop in the TSI curve. It is easy to show that the sphereS andthe cross-sectional circleCr (pc,Npc) intersect in two differentpoints. We take any one of the two points as a starting point forcurve tracing. Line (6) handles the case in which the intersectedvolume bounded byT and S is an object with genus 1 (seeFig. 8d). In this case, each cross-sectional circleCr (C(t),NC(t))intersects the sphereS in two different points. Moreover, eachpoint belongs to a different loop in the TSI curve. Thus bothintersection points can be used as starting points for numericalcurve tracing.

In Line (5), we assume the availability of the routine ComputeProfile Circles (T, S), which computes two degenerate profilecircles in the TSI curve. Each profile circle is contained in aplane that is orthogonal to the normal vectorN. The distance ofthe plane from the main plane of the torus and the radius of eachprofile circle can be computed by intersecting two circles (seeSection 2.3 and Fig. 5).

In ALGORITHM: TorusSphereIntersectionI, except theprocedures for numerical curve tracing, all the required com-putations are vector/distance computations and circle/circle in-tersections. The numerical errors in these operations can be mea-sured geometrically. Moreover, the maximum distance betweena cubic approximation curve segment and the torus (or the sphere)can be measured with high accuracy, utilizing the simple struc-ture of the torus and the sphere. The geometric nature of theseerrors enables an efficient and robust implementation of our al-gorithm using floating-point arithmetic.

3.2. The Case of 0< r <δ

In this case, we consider the sphereS= Sδ(p2) as an obstacleand the torusT = Tr,R(p1,N1) as the envelope surface of a mov-ing ball Br (C(t)), whereC(t) is a parametrization of the main

Page 11: Torus/Sphere Intersection Based on a Configuration Space ...3map.snu.ac.kr/mskim/ftp/tsi.pdf · section loops connected at a singular intersection point (on the sphere S). The C-space

January 24, 1998 16:31 CVIU GMIP451

TORUS/SPHERE INTERSECTION 87

circle CR(p1,N1) of the torusT . That is,T = Bdr(∪Br (C(t))),whereBdr means the boundary of a closed (volumetric) regionin R3. By applying a translation, we may assume that the sphereShas its center at the originS= Sδ(0), and the torusT is givenasT = Tr,R(p,N). The C-space obstacle of the sphereS (withrespect to the moving ballBr (C(t)) of radiusr ) is bounded bythe±r -offsets of the sphereS, that is, the inner offset sphereSI = Sδ−r (0) and the outer offset sphereSO= Sδ+r (0). Let SI

−andSI

+ denote the inner and outer open regions (ofR3) that areseparated bySI . SO

− andSO+ are defined in a similar way.

3.2.1. Counting the Number of Closed Loops

When we give the normal orientation of the outer sphereSO asoutward (i.e., into the direction pointing to the open regionSO

+ ),and that of the inner sphereSI as inward (i.e., into the directionpointing to the open regionSI

−), the two spheresSI and SO

separate the spaceR3 into three open regionsSO+ , SO

− ∩ SI+, and

SI−, with the corresponding winding numbers zero, one, and zero,

respectively. Consider the case in which the ballBr (C(t)) moves,while its centerC(t) is located in the open regionSO

− ∩ SI+, only

for t1≤ t ≤ t2. The ballBr (C(t)) (t1≤ t ≤ t2) intersects with thesphereS= Sδ(0) in a circular discD(t). We have the relation(see Fig. 10).

D(t) = Br (C(t)) ∩ S⊂ S

∪D(t) = ∪(Br (C(t)) ∩ S) = (∪Br (C(t))) ∩ S⊂ S.

The TSI curveT ∩ S is the boundary curve of the region∪D(t)on the sphereS (Fig. 10b). Moreover, it is the envelope curveof the one-parameter family of circular discsD(t) on the sphereS. With the exception of some degenerate cases, eachD(t) con-tributes two points,γ−(t) andγ+(t), to the envelope curve. Thesetwo points are the same as the two intersection points of thecross-sectional circleCr (C(t),NC(t)) with the sphereS, whereNC(t)= (C′(t))/‖C′(t)‖ (Fig. 10c).

When the main circleCR(p,N) is totally contained in the openregionSO

+ or SI−, the TSI curve is empty since no ballBr (C(t))

intersects with the sphereS. Next, we consider the case in whichthe main circleCR(p,N) is totally contained in the open regionSI+ ∩ SO

− . In this case, each cross-sectional circleCr (C(t),NC(t))intersects with the sphereS at two different points,γ−(t) andγ+(t). As the cross-sectional circleCr (C(t),NC(t)) sweeps outthe entire torusT , the two points,γ−(t) and γ+(t), generatetwo smooth curves that bound the connected region∪D(t) onthe sphereS. Therefore, the TSI curve consists of two closedloops (Fig. 11a). When the main circleCR(p,N) has a tangentialcontact (at a pointp0) with eitherSI or SO, the two closed loopsin the TSI curve have a contact atpS, forming an 8-figured loop(Fig. 11b), wherepS is the orthogonal projection ofp0 onto thesphereS. Note thatp0 is ther -offset of pS∈ S if p0∈ SO, orp0 is the (−r )-offset ofpS∈ S if p0∈ SI . The figures in the leftcolumns of Figs. 11 and 12 illustrate the relative position of themain circleCR(p,N) of the torusT in the C-space of the sphere

FIG. 10. (a) T ∩ S, (b) ∪t1≤t≤t2 D(t), (c) ∪t̂1≤t≤t̂2(Cr (C(t),NC(t)) ∩ S),(d) γ−(t) andγ+(t).

S; the figures in the right columns of Figs. 11 and 12 illustratethe corresponding relative configurations ofT andS.

Assume that the ballBr (C(t)) intersects with the sphereS,for t1≤ t ≤ t2, and there is no intersection betweenBr (C(t))andS, for t1− ε < t < t1 and t2< t < t2+ ε, whereε >0 is anarbitrarily small positive number. Then, there are some valuesof t̂1 andt̂2 such that (Fig. 10):

• t1< t̂1< t̂2< t2.• Cr (C(t),NC(t))∩ S=∅, for t1< t < t̂1 or t̂2< t < t2.• Cr (C(t),NC(t))∩ S={γ−(t)= γ+(t)}, for t = t̂1, t̂2.• Cr (C(t),NC(t))∩ S={γ−(t), γ+(t)},withγ−(t) 6= γ+(t), for

t̂1< t < t̂2.

The boundary curve of the region∪t1≤t≤t2 D(t) (on the sphereS)

Page 12: Torus/Sphere Intersection Based on a Configuration Space ...3map.snu.ac.kr/mskim/ftp/tsi.pdf · section loops connected at a singular intersection point (on the sphere S). The C-space

January 24, 1998 16:31 CVIU GMIP451

88 KIM, KIM, AND OH

FIG. 11. Regular or singular intersections.

is the same as the union

∪t̂1≤t≤t̂2(Cr (C(t),NC(t)) ∩ S).

Since the cross-sectional circlesCr (C(t),NC(t)) are all disjoint,no boundary point of∪t1≤t≤t2 D(t) can be shared by two differentinstances ofCr (C(t),NC(t)), for t̂1 ≤ t ≤ t̂2. Therefore, the twocurvesγ−(t) andγ+(t) have no intersection, fort̂1< t < t̂2. They

have no self-intersection, either. Moreover, these two curvesare connected at two common end points,γ−(t̂1)= γ+(t̂1) andγ−(t̂2)= γ+(t̂2). The resulting boundary curve of∪D(t) thusforms a closed loop on the sphereS.

In the above discussion, we showed that when the main circleCR(p,N) intersects withSO

− ∩ SI+, but is not totally contained

in the open regionSO− ∩ SI

+, each connected component of theintersectionCR(p,N)∩ (SO

− ∩ SI+) produces a closed loop in the

TSI curve. We can easily show that there are at most two con-nected components in the intersectionCR(p,N)∩ (SO

− ∩ SI+).

This is because the main circleCR(p,N) may intersect withthe inner sphereSI at no more than two points. (The planeLcontaining the main circleCR(p,N) intersects with the sphereSI in a circle; then this circle may intersect withCR(p,N) at nomore than two points.) Similarly, the main circleCR(p,N) mayintersect with the outer sphereSO at no more than two points.

3.2.2. More Examples

Figures 11c and 11d show two cases in which the intersectionCR(p,N)∩ (SO

− ∩ SI+) has one and two connected component(s),

respectively. The corresponding TSI curve consists of one andtwo closed loop(s), respectively. In Fig. 11e, the circular arcCR(p,N)∩ (SO

− ∩ SI+) has a tangential intersection withSO at a

pointp0∈ SO. The corresponding TSI curve is an 8-figured curvewith singularity atpS∈ S, wherepS is the orthogonal projectionof p0 onto the sphereS. Note thatp0 is also ther -offset ofpS.

Each closed loop of Fig. 11a degenerates into a profile circleof the torusT if and only if the main axis of the torusT passesthrough the center of the sphereS, which can be detected bythe conditionp×N= 0 (see Section 2.3 and Fig. 5). Moreover,each closed loop of Fig. 11d degenerates into a cross-sectionalcircle of the torusT if and only if the center of the sphereSis contained in the main plane of the torusT (i.e., 〈p,N〉=0)and the distance between the two centers ofT andS (i.e.,‖p‖)satisfies the condition‖p‖2= R2+ δ2− r 2 (see Fig. 6).

Figures 12a and 12b show singular degenerate cases in whichthe main circleCR(p,N) has two tangential intersection pointswith SO ∪ SI . Each tangential intersection point generates a sin-gular point in the corresponding TSI curve. Therefore, there aretwo singular points in the TSI curve. Being a self-intersectionpoint of the TSI curve, each singular point has multiplicity two.When we pass a planeL through the two singular points, theplaneL cannot intersect with any other point of the TSI curvesince the planeL already intersects with the TSI curve (of de-gree four) at four points (counting the multiplicity properly).The only exception is the case in which the planeL completelycontains at least one component of the TSI curve. This meansthat each component of the singular TSI curve is a planar curve.Moreover, this planar curve is embedded in the sphereS. That is,this curve must be a circle. Consequently, the TSI curve consistsof two circles (called Yvone-Villarceau circles) when there aretwo singular points (see also Piegl [22] and Fig. 4c). Each singu-larity can be easily detected from a tangential intersection of themain circleCR(p,N) with the two concentric spheresSO ∪ SI .

Page 13: Torus/Sphere Intersection Based on a Configuration Space ...3map.snu.ac.kr/mskim/ftp/tsi.pdf · section loops connected at a singular intersection point (on the sphere S). The C-space

January 24, 1998 16:31 CVIU GMIP451

TORUS/SPHERE INTERSECTION 89

FIG. 12. Degenerate intersections in circle(s).

Page 14: Torus/Sphere Intersection Based on a Configuration Space ...3map.snu.ac.kr/mskim/ftp/tsi.pdf · section loops connected at a singular intersection point (on the sphere S). The C-space

January 24, 1998 16:31 CVIU GMIP451

90 KIM, KIM, AND OH

Figures 12c and 12d show other degenerate cases in whichthe main circleCR(p,N) is totally embedded in the sphereSO

or SI . Then the torusT intersects with the sphereS tangen-tially along a circle. In this case, the intersection circle must beconsidered to have multiplicity two; that is, as the limit of twoconverging circles, which produces an overlap of two identicalcircles. Therefore, there is no other loop in the TSI curve.

3.2.3. ALGORITHM: Torus SphereIntersectionII

ALGORITHM: TorusSphereIntersectionII of Appendix B sum-marizes the algorithm discussed above. Similarly to TorusSphereIntersectionI of Appendix A, we assume that the twocurve tracing routines TraceSingularTSI Curve (T, S, P) andTraceRegularTSI Curve (T, S, P) are available. Moreover, inLines (1), (2), and (4), we assume that the routines computingdegenerate circles of the TSI curve are available (see Section 2.3and Figs. 4–6).

Line (3) corresponds to the case shown in Fig. 11c. As-sume that the ballBr (C(t)) intersects with the sphereS, onlyfor t1≤ t ≤ t2, (i.e., C(t1)= p1 andC(t2)= p2), and the cross-sectional circleCr (C(t),NC(t)) intersects with the sphereS, fort1< t̂1≤ t ≤ t̂2< t2 (see also Section 3.2.1). Since the TSI curveis symmetric with respect to bothT andS, we have the relation

t1 < t̂1 ≤ t1+ t22≤ t̂2 < t2.

Note that the middle pointq in Line (3) is the same asC((t1+t2)/2). Therefore, the cross-sectional circleCr (q,Nq) intersectswith the sphereS at two different points. We take only one ofthem as a starting point for numerical curve tracing.

Line (5) corresponds to the case shown in Fig. 11d. LetC(ti ) =pi , for i = 1, 2, 3, 4. Note that the ballBr (C((t1+ t2)/2)) is to-

APPENDIX A

TSI Algorithm for the Case of 0< δ ≤ r

ALGORITHM: Torus Sphere Intersection I /∗ For the case of 0< δ ≤ r ∗/Input: T = Tr,R(0,N); /∗ Torus∗/

S= Sδ(p); /∗ Sphere∗/begin

if p ∈ T O\T D then begin /∗ Fig. 7a∗/(1) pT := p+ δ pc−p

‖pc−p‖ , wherepc is the closest point ofCR(0,N) to p;Output({pT });end

else if p∈ T D andp is a vertex ofT D then /∗ Fig. 7b∗/Output(C1(q,N)), where1 = δ

δ+r R andq = rδ+r p;

else if p∈ T D andp is not a vertex ofT D then begin /∗ Fig. 7c∗/

tally contained inside the sphereS, and the ballBr (C(t3+ t4)/2)is totally contained outside the sphereS. Then any profile cir-cle of the torusT will intersect with the sphereS at two dif-ferent points (see Fig. 4a for profile circles). Moreover, eachintersection point belongs to a different component of the TSIcurve. In Line (5), we take the profile circleCR+r (p,N) of thelargest radius. The two intersection points inS∩CR+r (p,N) areused as the starting points for the two closed loops in the TSIcurve.

4. CONCLUSION

Given two arbitrary surfaces, the determination of all pos-sible topological types of surface–surface intersection curve isnontrivial, in general. This is indeed the case even for two in-tersecting natural quadrics [19]. However, in the case of the TSIcurve computation considered in this paper, we demonstratedthat the classification can be made considerably easier based onC-space transformation.

We demonstrated that all topological/geometric classifica-tions (including singular point and/or degenerate circle detec-tion) can be carried out using vector/distance computations andcircle/circle intersections. Moreover, we showed that exactly onestarting point on each closed loop of the TSI curve can be gener-ated by using an additional circle/circle intersection. Therefore,the algorithm can be implemented efficiently and robustly usingfloating-point arithmetic.

The basic approach of this paper can be extended to moregeneral types of torus/surface intersection such as torus/cylinder,torus/cone, torus/torus, and torus/cyclide intersections. We arecurrently investigating this generalization as an important futurework.

Page 15: Torus/Sphere Intersection Based on a Configuration Space ...3map.snu.ac.kr/mskim/ftp/tsi.pdf · section loops connected at a singular intersection point (on the sphere S). The C-space

January 24, 1998 16:31 CVIU GMIP451

TORUS/SPHERE INTERSECTION 91

(2) pT := p+ δ p f−p||p f−p|| , wherep f is the farthest point ofCR(0,N) from p;

TraceSingularTSI Curve(T, S, {pT });end

else if p∈ T I thenif 0< δ < r then begin /∗ Fig. 7d∗/

(3) pT := pc + r p−pc

‖p−pc‖ , wherepc is the closest point ofCR(0,N) to p;Output({pT }),end

else ifδ = r then /∗ Fig. 7e∗/Output(Cr (p,Np)), whereNp = N× p

‖p‖ ;else if p∈ T O

+ ∪ T I− then /∗ Figs. 8a and 8b∗/

Output (∅);else if p∈ T O

− ∩ T I+ ∩ T D

+ then begin /∗ Fig. 8c∗/pc := the closest point ofCR(0,N) to p;

(4) pSC := one point ofS∩ Cr (pc,Npc), whereNpc = N× pc

‖pc‖ ;TraceRegularTSI Curve(T, S, {pSC});end

else if p∈ T D− then

if p × N = 0 then /∗ Fig. 8d∗/(5) ComputeProfile Circles (T, S);

else(6) TraceRegularTSI Curve(T, S, S∩Cr (C(t),NC(t))),

whereCr (C(t),NC(t)) is an arbitrary cross-sectional curve ofT ;end

APPENDIX B

TSI Algorithm for the Case of 0< r < δ

ALGORITHM: Torus Sphere Intersection II /∗ For the case of 0< r < δ ∗/Input: T = Tr,R(p,N); /∗ Torus∗/

S= Sδ(0); /∗ Sphere∗/begin

DP := {Sr (pi ) ∩ S| pi is a tangential intersection point ofCR(p,N) with SO ∪ SI };if CR(p,N) ⊂ SO

+ ∪ SI− then /∗ There is no intersection∗/

Output (∅);else ifCR(p,N) ⊂ SO

− ∩ SI+ then /∗ Fig. 11a∗/

if p × N = 0 then(1) ComputeProfile Circles (T, S);

elseTraceRegularTSI Curve(T, S, S∩ Cr (C(0),NC(0)));

else if|DP| = 1 then /∗ Figs. 11b and 11e∗/TraceSingularTSI Curve(T, S, DP);

else if|DP| = 2 then /∗ Figs. 12a and 12b∗/(2) ComputeYvone VillarceauCircles(T, S, DP);

else ifCR(p,N) is embedded inSI then /∗ Fig. 12c∗/Output(C1(q,N)), where1 = δ

δ−r R andq = δδ−r p;

else ifCR(p,N) is embedded inSO then /∗ Fig. 12d∗/Output(C1(q,N)), where1 = δ

δ+r R andq = δδ+r p;

else beginif there is only one circular arcC1 in CR(p,N) ∩ (SO

− ∩ SI+) then begin

Page 16: Torus/Sphere Intersection Based on a Configuration Space ...3map.snu.ac.kr/mskim/ftp/tsi.pdf · section loops connected at a singular intersection point (on the sphere S). The C-space

January 24, 1998 16:31 CVIU GMIP451

92 KIM, KIM, AND OH

(3) q := the middle point ofC1; /∗ Fig. 11c∗/pi := a point inS∩ Cr (q,Nq), whereNq := N× q−p

‖q−p‖ ;TraceRegularTSI Curve(T, S, {pi });end

else begin /∗ Fig. 11d∗/if 〈p,N〉 = 0 and‖p‖2 = R2+ δ2− r 2 then

(4) ComputeCrossSectionalCircles (T, S)else

(5) TraceRegularTSI Curve(T, S, {S∩ CR+r (p,N)});end

endend

ACKNOWLEDGMENTS

The authors thank Dr. John Woodwark, Dr. Ralph Martin, and Prof. HelmutPottmann for information about previous work on cyclide/quadric intersectionand classical results in descriptive geometry. We are also grateful to the anony-mous referees for their careful reviews and suggestions, which contributed tothe readability of this paper.

REFERENCES

1. C. Bajaj, C. Hoffmann, J. Hopcroft, and R. Lynch, Tracing surface inter-sectionsComput. Aided Geometric Design5, 1988, 285–307.

2. C. Bajaj and M.-S. Kim, Generation of configuration space obstacles: Thecase of a moving sphere,IEEE J. of Robotics Automation4(1), 1988, 94–99.

3. C. Bajaj and G. Xu, NURBS approximation of surface/surface intersectioncurves,Adv. Comput. Math.2(1), 1994, 1–21.

4. J.-J. Choi,Local Canonical Cubic Curve Tracing along Surface/SurfaceIntersections, Ph.D. Thesis, Dept. of Computer Science, POSTECH,Feb. 1997.

5. J. de Pont,Essays on the Cyclide Patches, Ph.D. Thesis, Cambridge Univ.Engineering Dept. Cambridge, 1984.

6. R. Farouki, C. Neff, and M. O’Connor, Automatic parsing of degeneratequadric-surface intersections,ACM Trans. Graphics8(3), 1989, 174–203.

7. L. Guibas, L. Ramshaw, and J. Stolfi, A kinetic framework for computa-tional geometry, inProc. of 24th Annual Symp. on Foundations of ComputerScience, 1983, pp. 100–111.

8. V. Guillemin and A. Pollack,Differential Topology, Prentice-Hall, Engle-wood Cliffs, NJ, 1974.

9. J. Hoschek and D. Lasser,Fundamentals of Computer Aided GeometricDesign, A.K. Peters, Wellesley, MA, 1993.

10. J. Johnstone, A new intersection algorithm for cyclides and swept surfacesusing circle decomposition,Comput. Aided Geometric Design10(1), 1993,1–24.

11. J. Johnstone and C.-K. Shene, Computing the intersection of a plane and anatural quadric,Computers & Graphics16(2), 1992, 179–186.

12. K.-J. Kim and M.-S. Kim, Computing all conic sections in torus and simplesurface intersection curves, in preparation.

13. J. Levin, A parametric algorithm for drawing pictures of solid objects com-posed of quadric surfaces,Commun. ACM19(10), 1976, 555–563.

14. J. Levin, Mathematical models for determining the intersections of quadricsurfaces,Comput. Graphics Image Process. 11, 1979, 73–87.

15. T. Lozano-P´erez, Spatial planning: A configuration space approach,IEEETrans. Comput. 32(2), 1983, 108–120.

16. R. Martin, J. de Pont, and T. Sharrock, Cyclide surfaces in computer aideddesign, inThe Mathematics of Surfaces I(J. A. Gregory, Ed.), pp. 253–267,Clarendon Press, Oxford, 1986.

17. J. Miller, Geometric approaches to nonplanar quadric surface intersectioncurves,ACM Trans. Graphics6(4), 1987, 274–307.

18. J. Miller and R. Goldman, Using tangent balls to find plane sections ofnatural quadrics,IEEE Comput. Graphics Appl., 1992, 68–82.

19. J. Miller and R. Goldman, Geometric algorithms for detecting and calculat-ing all conic sections in the intersection of any two natural quadric surfaces,Graphical Models Image Process. 57(1), 1995, 55–66.

20. N. Patrikalakis, Surface-to-surface intersections,IEEE Comput. GraphicsAppl., 1993, 89–95.

21. L. Piegl, Geometric method of intersecting natural quadrics represented intrimmed surface form,Comput. Aided Design21(4), 1989, 201–212.

22. L. Piegl, Constructive geometric approach to surface-surface intersection,in Geometry Processing for Design and Manufacturing(R. E. Barnhill,Ed.), Chap. 7, pp. 137–159, SIAM, 1992.

23. H. Pottmann, personal communication.

24. M. Pratt and A. Geisow, Surface/surface intersection problems, inThe Math-ematics of Surfaces I(J. A. Gregory, Ed.), pp. 117–142, Clarendon Press,Oxford, 1986.

25. J. Rossignac and A. Requicha, Constant-radius blending in solid modeling,Comput. Mech. Eng.3(1), 1984, 65–73.

26. J. Rossignac and A. Requicha, Offsetting operations in solid modeling,Comput. Aided Geometric Design3(2), 1986, 129–148.

27. R. Sarraga, Algebraic methods for intersections of quadric surfaces inGMSOLID, Comput. Vision Graphics Image Process.22(2), 1983, 222–238.

28. C.-K. Shene and J. Johnstone, On the lower degree intersections of twonatural quadrics,ACM Trans. Graphics13(4), 1994, 400–424.

29. I. Wilf and Y. Manor, Quadric-surface intersection curves: Shape and struc-ture,Comput. Aided Design25(10), 1993, 633–643.