Intersecting a Freeform Surface with a General Swept Surface
Joon-Kyung Seong a Ku-Jin Kim b Myung-Soo Kim a,c Gershon Elber d Ralph R. Martin e a School
of Computer Science and Engineering, Seoul National University, Korea
b Dept.
of Computer Engineering, Kyungpook National University, Korea
c Institute
of Computer Technology, Seoul National University, Korea
d Dept.
of Computer Science, Technion, Haifa, 32000, Israel
e School
of Computer Science, Cardiff University, UK
Abstract We present efficient and robust algorithms for intersecting a rational parametric freeform surface with a general swept surface. A swept surface is given as a one-parameter family of cross-sectional curves. By computing the intersection between a freeform surface and each cross-sectional curve in the family, we can solve the intersection problem. We propose two approaches, which are closely related to each other. The first approach detects certain critical points on the intersection curve, and then connects them in a correct topology. The second approach converts the intersection problem to that of finding the zero-set of polynomial equations in the parameter space. We first present these algorithms for the special case of intersecting a freeform surface with a ruled surface or a ringed surface. We then consider the intersection with a general swept surface, where each cross-sectional curve may be defined as a rational parametric curve or as an implicit algebraic curve.
Key words: Surface-surface intersection, swept surfaces, ruled surfaces, ringed surfaces, freeform surfaces.
Email addresses:
[email protected] (Joon-Kyung Seong),
[email protected] (Ku-Jin Kim),
[email protected] (Myung-Soo Kim),
[email protected] (Gershon Elber),
[email protected] (Ralph R. Martin).
Preprint submitted to Elsevier Science
1 Introduction
Surface-surface intersection (SSI) is an important problem in geometric modeling and processing, particularly for applications in CAD/CAM and solid modeling. Many different approaches have been proposed. However, it is still a difficult problem to solve with sufficient accuracy, efficiency and robustness. The main difficulty lies in analyzing the topological structure of the intersection curve: it is not easy to determine the exact number of connected components and the correct topological arrangement of these components. Because of the difficulty in dealing with general freeform surfaces, considerable research has been devoted to intersecting surfaces of special types [13]. Martin et al. [14] and de Pont [3] considered intersection of a cyclide with a quadric, and with another cyclide. Johnstone [11] proposed an algorithm to intersect a cyclide with a ringed surface. (The term ‘ringed surface’ was coined by Johnstone [11]; it is a surface generated by sweeping a circle while changing its size and orientation.) Heo et al. [8] presented an algorithm for intersecting two ruled surfaces. They reduced the intersection problem to a search for the zero-set of the function: f (u, v) = 0, where f (u, v) is a bivariate polynomial of relatively low degree. This approach was later applied to the case of intersecting two ringed surfaces [7]. In the present paper, we extend this result to the intersection of a rational parametric freeform surface with a general swept surface. A swept surface is a one-parameter family of crosssectional curves. In this paper, we focus on the case where each curve in the family is obtained by applying an affine transformation to a template curve. By taking an affine spline motion applied to a template curve [10], we can generate a swept surface. Ruled surfaces and ringed surfaces are special types of swept surfaces, which are constructed by sweeping a line or a circle. We present two methods for intersecting a freeform surface with a swept surface. The first approach detects certain critical points on the intersection curve, and connects them in a correct topology; the curve segments connecting each pair of adjacent critical points is generated by a numerical curve tracing technique [1,2,5]. This procedure gives the entire intersection curve. The second approach transforms the intersection problem into a simple problem of solving a system of (n − 1) polynomial equations in n variables. (See Elber and Kim [6] or Patrikalakis and Maekawa [15] for details of solving a system of m polynomial equations in n variables.) Kim et al. [12] previously proposed a related topology-construction approach for intersecting a sphere with a surface of revolution. A surface of revolution is a special kind of swept surface which is generated by sweeping a circle of varying radius along a line. Figure 1(a) shows the silhouette CS of a sphere S and the generating curve CR+ for a surface of revolution R. Each point p1 (∈ CR+ ) outside the silhouette CS generates a circle on the surface R that has no intersection with the sphere S. 2
a
p1
p1 p3
p3 p2
p2
CS CR?
S
CR+ (a)
(b)
(c)
Fig. 1. Three different types of intersection between S and the circles of R.
Thus we can completely ignore the curve segments of CR+ that lie outside CS . On the other hand, each point p2 (∈ CR+ ) inside CS generates a circle that intersects the sphere S transversally in two distinct points. When we follow the curve CR+ inside the circle CS , we can trace two branches of the intersection curve S ∩ R, one on the front hemisphere and the other on the back hemisphere. The two branches are first created (starting at the same point) when the curve CR+ enters the circle CS , and they merge to form a closed loop when the curve CR+ leaves CS . Finally, each point p3 lying on CR+ and CS (∈ CR+ ∩CS ) generates a circle that intersects S tangentially. All tangential intersections between the sphere S and the cross-sectional circles of R can be detected by computing CR+ ∩ CS , which can be reduced to solving a univariate polynomial equation. We will use similar principles in the first approach presented in this paper. Here, we consider the intersection between a rational parametric freeform surface and a general swept surface. The topology of the intersection curve is in this case determined by certain critical points where cross-sectional curves of a swept surface intersects a freeform surface tangentially. The geometric condition of tangential intersection can be formulated as a system of n polynomial equations in n variables, which in general produces discrete solutions. The tangential condition is formulated as one of these equations. By deleting this equation, we obtain a system of (n − 1) equations in n variables, the solution of which generates a 1-manifold in the parameter space of the given freeform surface and the swept surface. The intersection curve is then constructed by projecting the 1-manifold into the uv-parameter plane of the freeform surface S(u, v). We first consider the problem of intersecting a freeform surface with a ruled surface or a ringed surface. We then consider the case of intersecting a freeform surface with a general swept surface. Each cross-sectional curve of the swept surface may be defined as a rational parametric curve or as an implicit algebraic curve that 3
moves under a rational affine spline motion [10]. The rest of this paper is organized as follows. In Section 2, we discuss how to construct the correct topology of an intersection curve based on detecting certain critical points on the curve. In Section 3, we give a simple technique for reducing the intersection problem to that of computing the simultaneous zero-set of (n − 1) polynomial equations in n variables. Section 4 presents some experimental results. Finally, in Section 5, we conclude this paper.
2 Topology Construction
We will first present an algorithm that detects critical points on the intersection curve and constructs the correct topological structure of the curve. The critical points are tangential intersection points between the freeform surface and the crosssectional curves of the swept surface. The basic idea of this approach is first explained using an illustrative example for a simple case where a freeform surface is intersected with a general cylindrical surface (i.e., a linear extrusion surface). Then we proceed to the cases where a freeform surface is intersected with a ruled surface, or a ringed surface. Finally, we show algorithms for intersecting a rational freeform surface with a general swept surface.
2.1 Intersection with a Cylindrical Surface
For the sake of simplicity, we first consider the case of intersecting a freeform surface with a cylindrical surface. We may assume that the cylindrical surface is generated by extruding a plane curve C(t) = (x(t), y(t), 0) along the z-direction. Let L(p) denote a line passing through a point p in the xy-plane and parallel to the z-axis. The line L(C(t)) intersects a freeform surface S(u, v) = (x(u, v), y(u, v), z(u, v)) tangentially if and only if the point C(t) = (x(t), y(t), 0) is located on the silhouette of S(u, v) when viewed along the z-direction. The silhouette curves and the boundary curves of S(u, v) subdivide the xy-plane into several regions. Figure 2 shows some such surface S(u, v) and its silhouette and boundary curves projected on to the xy-plane. Also shown are the corresponding six regions A0 , · · · , A5 on the plane. The location of a point p (in the xy-plane) leads to the following relation between a line L(p) and the surface S(u, v): (1) If p is on the silhouette curve of S(u, v), the line L(p) intersects S(u, v) tangentially at some location. 4
A0 q1
p1 A1 A2 q0 A3
p0 p2 q2
p3 y
A4 p4
A5 p5
x
Fig. 2. Regions on the xy-plane delimited by the silhouette curves and the boundary curves of S(u, v).
(2) If p is inside a region Ai , then L(p) intersects S(u, v) transversally at each intersection point. (3) If p and q are in the same region Ai , then L(p) and L(q) have the same number of intersections with S(u, v). For points pi , (0 ≤ i ≤ 5), located in the region Ai (Figure 2), the intersection between L(pi ) and S(u, v) is classified as follows: (1) (2) (3) (4) (5) (6)
L(p0 ) ∩ S(u, v) consists of one transversal intersection point. L(p1 ) ∩ S(u, v) consists of two transversal intersection points. L(p2 ) ∩ S(u, v) consists of three transversal intersection points. L(p3 ) ∩ S(u, v) consists of one transversal intersection point. L(p4 ) ∩ S(u, v) consists of two transversal intersection points. L(p5 ) ∩ S(u, v) has no intersection point.
For points qj , (0 ≤ j ≤ 2), on the silhouette or boundary curves, the intersection between L(qj ) and S(u, v) is classified as follows: (1) L(q0 ) ∩ S(u, v) consists of one tangential intersection point and one transversal intersection point. (2) L(q1 ) ∩ S(u, v) consists of one boundary point of S(u, v). (3) L(q2 ) ∩S(u, v) consists of one tangential intersection point and one boundary point of S(u, v). As one can notice from the above example, the number of intersections between the line L(p) and the surface S(u, v) changes when the point p passes across the silhouette or boundary curves of S(u, v). When the point p traces a continuous curve C(t) in the xy-plane, this observation leads to a classification of the topology of the intersection curve between a surface S(u, v) and a cylindrical surface. Let R(s, t) denote the cylindrical surface generated by extruding C(t) = (x(t), y(t), 0) 5
t10
t0
C(t0 )
C(t1 ) C(t2 ) C(t3 ) C(t7 )
C(t4 ) C(t5 ) C(t6 )
C(t8 ) C(t ) C(t10 ) 9
y
z transversal intersection
x
(a)
tangential intersection
boundary point
(b)
Fig. 3. Topological structure of the intersection curve between R(s, t) and S(u, v).
along the z-direction, where we take s = z. That is, the curve C(t) in Figure 3(a) is the projection of the cylindrical surface R(s, t) on to the xy-plane. For a fixed t0 , each ruling line R(s, t0 ) is projected on to a curve point C(t0 ). The topological structure of the intersection curve between S(u, v) and R(s, t) is completely determined by the intersection between C(t) and the silhouette and boundary curves of S(u, v). By subdividing S(u, v) and C(t) if necessary, we may assume that the curve C(t) does not pass through any of the self-intersection points of the silhouette or boundary curves of S(u, v); that is, it does not pass through points such as q2 in Figure 2. Moreover, we assume that the surface S(u, v) and the curve C(t) have no self-intersection. Figure 3(a) shows a sequence of points C(ti ), for i = 0, · · · , 10, where the evenindexed curve points C(t0 ), C(t2 ), · · · , C(t10 ) are located on the silhouette or boundary curves of S(u, v). On the other hand, the odd-indexed curve points C(t1 ), C(t3 ), · · · , C(t9 ) lie inside the regions Ai ; the ti satisfy ti−2 < ti−1 < ti . Now, in Figure 3(b), the curve C(t) is stretched out along its parameter line, which is the taxis. Each dotted line (parallel to the z-axis) corresponds to a ruling line L(C(ti )) of the cylindrical surface R(s, t). The correct topology of the intersection curve is completely determined by the discrete set of intersection points L(C(ti )) ∩ S(u, v), for i = 0, · · · , 10. The intersection points on each line L(C(ti )) are sorted along the z-direction. We connect discrete points on two adjacent vertical lines according to their z-order. Each tangential intersection point is connected to two transversal intersection points on an adjacent vertical line; or it is an isolated point. Three cases where the number of points on L(C(ti+1 )) is larger than on L(C(ti )) are shown in detail in Figure 4. In Figure 4(a) there is a tangential intersection point (marked with a filled circle) on L(ti+1 ), whereas in Figure 4(b) there is a boundary point (marked by a square) on L(ti+1 ). In these cases, a new component starts at 6
t
ti+1 ti
ti (a)
ti+1 ti (b)
ti+1 (c)
Fig. 4. Three cases where there are more points on L(ti+1 ) than on L(ti ).
the point, and the other remaining transversal intersection points are connected as usual. Figure 4(c) shows the case where L(ti ) contains a tangential intersection point, which may be considered as a double point and is thus connected to two transversal intersection points. In the opposite case, where the number of points on L(ti ) is larger than the number on L(ti+1 ), we apply a similar rule. In this case, two branches may meet at a tangential intersection point, where the corresponding loop is closed. In the above discussion, we considered the case where the curve C(t) intersects the silhouette or boundary curves of S(u, v) transversally. The case of tangential intersection is more involved. When the curve C(t) intersects the silhouette curve of S(u, v) tangentially at p, we may consider it as a double intersection. The tangential intersection point at L(p) ∩ S(u, v) becomes a singular point where two different loops meet and the intersection curve self-intersects. In the case where the curve C(t) touches the silhouette curve of S(u, v) externally, the tangential intersection point may be an isolated intersection point. Once the topological structure has been determined, the intersection curve itself can be constructed by numerically tracing the intersection curve using a conventional technique [1,2,5]. In some degenerate cases, the curve C(t) may also intersect the silhouette curves of S(u, v) along some curve segments C(t), (ta ≤ t ≤ tb ), not just at discrete points. The surface-surface intersection then includes some tangential intersection curves, or even some cylindrical surface patches. Such degenerate singular intersections are extremely difficult to deal with using conventional techniques. Nevertheless, in our approach, the problem is reduced to a simpler problem of extracting the silhouette curve segments or the silhouette surface patches of S(u, v) that project on to the corresponding curve segments C(t), (ta ≤ t ≤ tb ). Let N(u, v) = (nx (u, v), ny (u, v), nz (u, v)) denote a normal vector field of the surface S(u, v). We can construct the silhouette curve or the silhouette surface patch of S(u, v) along the z-direction by solving: nz (u, v) = 0. When the function nz (u, v) 7
vanishes over certain open regions in the uv-plane, the surface S(u, v) will intersect the cylindrical surface R(s, t) in some surface patches, not just in 1-manifold curves. 2.2 Intersection with a Ruled Surface
Now we consider the more general problem of intersecting a freeform surface S(u, v) with a ruled surface R(s, t). A ruled surface is defined by connecting two space curves C1 (t) and C2 (t) by a line: R(s, t) = C1 (t) + s(C2 (t) − C1 (t)). The ruling direction is no longer fixed, but is a function of t, namely C2 (t) − C1 (t). Nevertheless, we can apply a similar argument to the one used in the previous section to classify the critical points on an intersection curve. So, we need to detect the values of t that correspond to the ruling lines (in R(s, t)) that intersect S(u, v) tangentially or at its boundary curves S(u0 , v) or S(u, v0 ). Figure 5 shows a loop in the intersection curve. The loop is delimited by two tangential intersections of the moving line with the surface S(u, v).
Fig. 5. An intersection curve. Two ruling lines intersect tangentially with a freeform surface and delimit a loop on the intersection curve.
When a ruling line is tangent to the surface S(u, v), the surface point S(u, v) is on the line. Moreover, the ruling line is contained in the tangent plane of S(u, v) and thus it is orthogonal to the normal vector N(u, v). (See Figure 6(a) for a configuration where a ruling line touches the surface S(u, v).) From these conditions, we obtain the following system of three constraint equations: f1 (u, v, t)=hS(u, v) − C1 (t), N1 (t)i = 0, g1 (u, v, t)=hS(u, v) − C1 (t), N2 (t)i = 0, h1 (u, v, t)=hC2 (t) − C1 (t), N(u, v)i = 0, 8
(1) (2) (3)
C2 (t)
N (u, v) N (u, v)
C1 (t)
C(t)
D(t) S(u, v)
S(u, v) (a)
(b)
Fig. 6. A line (a) or a circle (b) touches the surface S(u, v).
where N1 (t) and N2 (t) are two non-parallel vectors which are orthogonal to the ruling direction C2 (t) − C1 (t). Hughes and M¨oller [9] proposed an elegant method for the construction of such vectors N1 (t) and N2 (t), which have degree no higher than that of C2 (t)−C1 (t). When the ruling direction C2 (t)−C1 (t) = (dx (t), dy (t), dz (t)) has its first component as the one with largest magnitude: |dx (t)| ≥ |dy (t)|, |dz (t)|, we can take N1 (t) = (dy (t), −dx (t), 0) and N2 (t) = (dz (t), 0, −dx (t)). Other cases can be handled in a similar way. The intersection between a boundary curve S(u, v0 ) and a ruling line can be computed by solving the following system of two equations: f2 (u, t)=hS(u, v0 ) − C1 (t), N1 (t)i = 0, g2 (u, t)=hS(u, v0 ) − C1 (t), N2 (t)i = 0. The intersection between S(u0 , v) and a ruling line can be computed in a similar way. After all critical points have been detected by solving the above systems of polynomial equations, their t-values are sorted in ascending order and given even indices: t0 < t2 < · · · < t2m . Now take t2k−1 = t2k−22+t2k . For each ti , (0 ≤ i ≤ 2m), we intersect the freeform surface S(u, v) with a ruling line R(s, ti ) : C1 (ti ) + s(C2 (ti ) − C1 (ti )). Let R(sj , ti ), (1 ≤ j ≤ ni ), denote the intersection points sorted along the ruling’s s-direction. We can now apply the topology construction scheme previously illustrated in Figure 3; in this case the s-axis is used instead of the z-axis. Once the 9
topology has been determined, each segment of the intersection curve is again generated by numerical curve tracing along the intersection between two surfaces [1,2,5]. In some degenerate cases, the ruled surface may intersect the surface S(u, v) tangentially along curve segments or even on surface patches. Equations (1)–(3) will then produce a set of 1-manifold curve segments or 2-manifold surface patches in the uvt-space as their solution set. We can distinguish the two cases by checking the dimensionality of the solution set. Whenever S(u, v) and R(s, t) intersect tangentially, the implicit surfaces f1 (u, v, t) = 0 and g1 (u, v, t) = 0 also intersect tangentially on their common solution set since in this case the equation f1 (u, v, t) − g1 (u, v, t) = 0 has multiple roots. Moreover, the implicit surface h1 (u, v, t) = 0 becomes singular on the common zero-set since the tangential condition is almost satisfied in the region close to tangential intersections. When the zero-set includes 2-manifold surface patches, the surfaces S(u, v) and R(s, t) also intersect tangentially over surface patches. This observation also applies to other types of surface-surface intersections to be discussed in later sections. 2.3 Intersection with a Ringed Surface
A ringed surface is a one-parameter family of circles, where the generator circle moves in space while continuously changing its position, size and orientation. Given a freeform surface S(u, v) and a ringed surface R(s, t) = ∪O t , their intersection curve can be computed by characterizing the intersection points between each circle O t and the surface S(u, v). Let C(t) denote the center of the circle O t ; and assume that the circle has radius r(t) and is contained in a plane with normal D(t). When the circle O t intersects the surface S(u, v), the surface point S(u, v) is contained in the circle O t : f3 (u, v, t) = hS(u, v) − C(t), D(t)i = 0, g3 (u, v, t) = k S(u, v) − C(t) k2 −r 2 (t) = 0.
(4) (5)
Equation (4) implies that S(u, v) is contained in the plane of the circle O t ; and Equation (5) means that the circle O t has radius r(t). Moreover, when the circle O t intersects the surface S(u, v) tangentially, the three vectors S(u, v) − C(t), D(t) and N(u, v) become coplanar. (See Figure 6(b) for a configuration where a circle touches the surface S(u, v).) Consequently, we have h3 (u, v, t) = h(S(u, v) − C(t)) × D(t), N(u, v)i = 0.
(6)
The intersection between a boundary curve S(u, v0) and a circle O t can be computed by solving the following system of two equations: 10
f4 (u, t) = hS(u, v0 ) − C(t), D(t)i = 0, g4 (u, t) = k S(u, v0) − C(t) k2 −r 2 (t) = 0. The case of S(u0 , v) ∩ O t can be computed similarly. The intersection curve itself is constructed by a numerical curve tracing. However, in the case of intersection with a ringed surface, the intersection points along the s-axis repeat themselves with a period of 2π. Thus, matching between two adjacent ti -circles becomes slightly more complicated. Given a set of discrete intersection points R(sj , ti ), (0 ≤ i ≤ 2m; 1 ≤ j ≤ ni ), on the ringed surface, we start a numerical curve tracing from a point R(sj , ti ), with an even index i, and continue the tracing until we reach an adjacent circle R(s, ti±1 ), where we find a mate R(sj , ti±1 ) from ni±1 possible candidates of transvesal intersection points. Once this connection has been made, the matching becomes straightforward for other intersection points on the two adjacent circles R(s, ti ) and R(s, ti±1 ).
2.4 Intersection with a Swept Surface
Now we consider the intersection of a freeform surface with a swept surface. A swept surface may be generated by sweeping a rational parametric curve in space or by sweeping an implicit algebraic curve. In the previous two cases of intersection with a ruled surface or a ringed surface, we represented the moving line or the moving circle as the intersection of two planes or as the intersection of a plane and a sphere. The same approach can be applied to a general cross-sectional curve that is defined as the intersection of two implicit surfaces. The curve can move under an affine spline motion [10] by making the two implicit surfaces move under the same motion. The cross-sectional curves may also be defined as the result of a rational affine spline motion applied to a template rational spline curve K(s). In this case, the curve parameter s also appears in the characterizing equations for tangential intersections.
2.4.1 Sweeping an Implicit Algebraic Curve We consider a general swept surface where each cross-sectional curve is defined as an intersection of two time-dependent implicit algebraic surfaces: F t (x, y, z) = 0 and Gt (x, y, z) = 0. The intersection curve between a rational freeform surface S(u, v) and the swept surface can be computed by solving
f5 (u, v, t)=F t (S(u, v)) = 0, g5 (u, v, t)=Gt (S(u, v)) = 0.
(7) (8) 11
Moreover, when the cross-sectional curve intersects the surface S(u, v) tangentially, we have D
E
h5 (u, v, t) = ∇F t (S(u, v)) × ∇Gt (S(u, v)), N(u, v) = 0,
(9)
where ∇F t is the gradient of F t and ∇Gt is the gradient of Gt . When two algebraic surfaces F (x, y, z) = 0 and G(x, y, z) = 0 are under the same affine spline motion, the two time-dependent algebraic surfaces are given as follows
F t (x, y, z) = F [(x, y, z) − T (t)]L−1 (t) = 0, Gt (x, y, z) = G [(x, y, z) − T (t)]L−1 (t) = 0, where T (t) represents a rational translational motion and L(t) is a non-singular 3×3 matrix with rational spline functions as its entries. Note that the inverse matrix L−1 (t) also has rational spline functions as its entries (as can be seen from Cramer’s rule). Figure 7 shows an example of a swept surface, where each cross-sectional curve is defined as the intersection of two quadrics.
(a)
(b)
Fig. 7. (a) A cross-sectional curve is represented as an intersection of two quadrics; and (b) A swept surface is generated by sweeping the intersection of two quadrics.
The intersection between a boundary curve S(u, v0) and the swept surface can be computed by solving f6 (u, t)=F t (S(u, v0)) = 0, g6 (u, t)=Gt (S(u, v0 )) = 0. The case of intersecting S(u0, v) and the swept surface can be handled in a similar way. 12
2.4.2 Sweeping a Rational Parametric Curve Let K(s) = (x(s), y(s), z(s)) denote a rational spline curve. Now we apply a timedependent non-singular linear transformation L(t) to K(s) and then a translation T (t) = (α(t), β(t), γ(t)) to the result K(s)L(t), where L(t) is a 3 × 3 matrix with each entry as a rational spline function of t, and α(t), β(t), and γ(t) are also rational functions of t. Then a rational swept surface R(s, t) is defined as R(s, t) = ∪[K(s)L(t) + T (t)]. The intersection between R(s, t) and a freeform surface S(u, v) is characterized by the following vector equation: f7 (u, v, s, t) = S(u, v) − K(s)L(t) − T (t) = 0.
(10)
At a tangential intersection point, the tangent vector K ′ (s)L(t) of a cross-sectional curve K(s)L(t) + T (t) should be orthogonal to the normal vector N(u, v) of the freeform surface S(u, v): h7 (u, v, s, t) = hK ′ (s)L(t), N(u, v)i = 0.
(11)
The intersection between a boundary curve S(u, v0) and the swept surface R(s, t) can be computed by solving f8 (u, s, t) = S(u, v0 ) − K(s)L(t) − T (t) = 0. The case of intersecting S(u0 , v) and R(s, t) can be handled in a similar way.
3 Reduction to Parameter Space
We now go on to present an alternative approach that reduces the intersection problem to that of computing the zero-set of (n−1) polynomial equations in n variables. When the cross-sectional curves are defined as the intersection of two implicit surfaces, the problem is formulated with n = 3, i.e., we need to solve two equations in three variables. On the other hand, when the cross-sectional curves are rational parametric curves, the problem is formulated with n = 4. In either case, the result is a 1-manifold in the parameter space. (In some degenerate cases, we may also produce some 2-manifold surface patches in the solution set.) By projecting the 1-manifold on to the uv-parameter plane of S(u, v), the intersection curve can be constructed. In the case of intersection with a ruled surface, we may represent each ruling line R(s, t) = C1 (t) + s(C2 (t) − C1 (t)) 13
Fig. 8. A ruled surface as a one-parameter family of lines, where each line is defined as the intersection of two non-parallel planes.
as the intersection of two non-parallel planes with normal vectors N1 (t) and N2 (t) (Figure 8). The intersection between a freeform surface S(u, v) and a ruling line is characterized as follows: f1 (u, v, t)=hS(u, v) − C1 (t), N1 (t)i = 0, g1 (u, v, t)=hS(u, v) − C1 (t), N2 (t)i = 0, which are two polynomial equations in three variables u, v, t.
Fig. 9. A ringed surface as a one-parameter family of circles, where each circle is defined as the intersection of a sphere and a plane.
Figure 9 shows a ringed surface as a one-parameter family of circles, where each circle is defined as the intersection between a sphere and a plane. The intersection condition between a freeform surface S(u, v) and a circle O t is given as follows: f3 (u, v, t)=hS(u, v) − C(t), D(t)i = 0, g3 (u, v, t)=k S(u, v) − C(t) k2 −r 2 (t) = 0, 14
which are two polynomial equations in three variables u, v, t. We can represent a swept surface as a one-parameter family of cross-sectional curves. For a swept surface generated by a one-parameter family of implicit algebraic curves, each defined by two algebraic surfaces, the intersection curve is constructed by solving f5 (u, v, t)=F t (S(u, v)) = 0, g5 (u, v, t)=Gt (S(u, v)) = 0, which are two polynomial equations in three variables u, v, t. When a swept surface is generated by a rational parametric curve K(s) under a rational affine spline motion, the intersection curve can be constructed by solving f7 (u, v, s, t) = S(u, v) − K(s)L(t) − T (t) = 0, which is a vector equation and represents three polynomial equations in four variables u, v, s, t. Now we have reduced the intersection problem to that of computing the zero-set of (n − 1) polynomial equations in n variables. The result is a 1-manifold. By projecting this zero-set on to the uv-plane, the intersection is generated as a curve embedded in the freeform surface S(u, v).
4 Discussion and Experimental Results
The polynomial equations for constructing topology have one more equation (for the tangential condition) than those for the problem reduction approach. Moreover, we have to solve n polynomial equations for topology construction, but one less equation for the reduction approach. However, the solutions of n equations are discrete points in general, whereas the zero-sets of (n−1) equations in the reduction approach are 1-manifolds. It is computationally more efficient to compute discrete solutions than to construct 1-manifolds. Therefore, it is worthwhile to solve the n polynomial equations in n variables needed for topology construction. Topology construction requires a second stage of numerical tracing that generates segments of the intersection curve. This can be achieved using conventional techniques for numerical tracing along intersection curves. Alternatively, we can solve (n − 1) polynomial equations in n variables, which have been formulated for the problem reduction approach. These equations define (n − 1) implicit surfaces in an n-dimensional space, which is yet another surface-surface intersection problem when n = 3. The two approaches proposed in this paper are thus closely related to 15
each other. The user may choose either one of them or combine both depending on applications and tools available. Figure 10(a) shows the result of intersecting the Utah teapot with a ruled surface using the topology construction scheme. Figure 10(b) shows the same teapot intersected with a ringed surface. Results based on the simple reduction scheme are shown in Figure 11. A result for intersection with a general swept surface is shown in Figure 12, where the intersection curves are shown in bold lines. The computation time for these results are about the same, all within one or two seconds on 2GHz Pentium IV machine.
(a)
(b) Fig. 10. Intersection between the Utah teapot and (a) a ruled surface or (b) a ringed surface.
16
Fig. 11. Intersection based on the problem reduction scheme.
Fig. 12. Intersection between a freeform surface and a swept surface.
Figure 13(a) shows a degenerate case where a cylinder and a torus intersect tangentially along a circle. The cylinder is given as a freeform surface S(u, v) and the torus is represented as a ringed surface. Figure 13(b) shows the zero-sets of f3 (u, v, t) = 0, g3 (u, v, t) = 0 and h3 (u, v, t) = 0 in red, magenta and yellow, respectively. The common zero-set of these three equations includes two discrete points (in green) and one line (in cyan). Along the cyan line, the two surfaces f3 (u, v, t) = 0 and g3 (u, v, t) = 0 meet tangentially, and the other surface h3 (u, v, t) = 0 is singular. On the other hand, at two green isolated intersection points, the three surfaces intersect transvesally. Figure 14(a) shows another exam17
(a)
(b)
Fig. 13. Degenerate tangential intersection along a curve.
(a)
(b)
Fig. 14. Degenerate tangential intersection on a surface patch.
18
ple of degenerate intersection where two surfaces intersect tangentially on a surface patch. In Figure 14(b), the two surfaces of f3 (u, v, t) = 0 and g3 (u, v, t) = 0 also meet tangentially on a surface patch (in cyan). Since the surface h3 (u, v, t) = 0 is singular over this area, the result of applying a marching cube algorithm generates a large volumetric solution set for −ǫ < h3 (u, v, t) < ǫ, even for a small value of ǫ > 0. Since h3 (u, v, t) = 0 is singular around this region, it is numerically unstable to compute its zero-set or to evaluate its normal direction. Thus we have constructed the common zero-set of f3 (u, v, t) = g3 (u, v, t) = 0 on a tangential surface patch by checking whether their gradients ∇f3 (u, v, t) and ∇g3 (u, v, t) are also collinear.
5 Conclusion
We have introduced two approaches to the problem of intersecting a freeform surface with a swept surface. Our first scheme was based on detecting critical points and constructing the intersection curve with a correct topology based on the critical points. Our second scheme reduces the surface-surface intersection problem to a zero-set finding in the parameter space. These two schemes are closely related to each other. Working in the parameter space, the proposed algorithm can also deal with degenerate singular intersections such as tangential intersection along a curve or overlap on a surface patch.
Acknowledgements
The authors would like to thank the anonymous reviewers for their useful comments. All the algorithms and figures presented in this paper were implemented and generated using the IRIT solid modeling system [4] developed at the Technion, Israel. This research was supported in part by the Israeli Ministry of Science Grant No. 01–01–01509, in part by the Korean Ministry of Science and Technology (MOST) under the Korean-Israeli binational research grant, in part by grant No. R01-2002-000-00512-0 from the Basic Research Program of the Korea Science and Engineering Foundation (KOSEF), and in part by Kyungpook National University Research Fund 2004.
References
[1] C. L. Bajaj, C. M. Hoffmann, R. E. Lynch, and J. E. H. Hopcroft. Tracing surface intersections. Computer Aided Geometric Design, Vol. 5, pp. 285–307, 1988.
19
[2] C. L. Bajaj and G. Xu. NURBS approximation of surface-surface intersection curves. Advances in Computational Mathematics, Vol. 2, Num. 1, pp. 1–21, 1994. [3] J. de Pont, Essays on the Cyclide Patch, Engineering Dept., Cambridge, 1984.
Ph.D. Thesis, Cambridge University
[4] G. Elber. IRIT 9.0 User’s Manual. The Technion-IIT, Haifa, Israel, 1997. Available at http://www.cs.technion.ac.il/ irit. [5] G. Elber, J.-J. Choi and M.-S. Kim, Ruled tracing. The Visual Computer, Vol. 13, No. 2, pp. 78–94, 1997. [6] G. Elber and M.-S. Kim, Geometric constraint solver using multivariate rational spline functions. Proc. of ACM Symposium on Solid Modeling and Applications, Ann Arbor, MI, June 4–8, 2001. [7] H.-S. Heo, S.J. Hong, J.-K. Seong, M.-S. Kim and G. Elber, The intersection of two ringed surfaces and some related problems. Graphical Models, Vol. 63, pp. 228–244, 2001. [8] H.-S. Heo, M.-S. Kim and G. Elber, Ruled/ruled surface intersection. Computer-Aided Design, Vol. 31, No. 1, pp. 33–50, 1999. [9] J. Hughes and T. M¨oller, Building an orthonormal basis from a unit vector. Journal of Graphics Tools, Vol. 4, No. 4, pp. 33–35, 1999. [10] D.-E. Hyun, B. J¨uttler and M.-S. Kim, Minimizing the distortion of affine spline motion. Graphical Models, Vol. 64, No. 2, pp. 128–144, 2002. [11] J. Johnstone, A new intersection algorithm for cyclides and swept surfaces using circle decomposition. Computer Aided Geometric Design, Vol. 10, No. 1, pp. 1–24, 1993. [12] K.-J. Kim, M.-S. Kim, and R. Martin, Intersecting a translationally or rotationally swept surface with a plane or a sphere. Proc. of Korea Israel Bi-National Conference on Geometrical Modeling and Computer Graphics in the World Wide Web Era, pp. 165–193, 1999. [13] M.-S. Kim, Intersecting surfaces of special types. Proceedings of Shape Modeling and Processing 99, pp. 122–128, Univ. of Aizu, Japan, March 1–4, 1999. [14] R. Martin, J. de Pont and T. Sharrock, Cyclide surfaces in computer aided design. Mathematics of Surfaces, Vol. 14, No. 4, pp. 349–375, Clarendon Press, 1986. [15] N. Patrikalakis and T. Maekawa, Shape Interrogation for Computer Aided Design and Manufacturing. Springer, 2002.
20