OolO-44%5(94Mooo9-3
ComputewVdedCesign, Vol. 27, No. 8, pp. 573586.1995 CopyigM Q 1995 Elsevier Science Ltd Printed in Great Britain. All rtohts reserved 00104485/95 $10.00 + 0.00
Research Quadric shell intersections Vinod Kumar and Debasish Dutta
The paper considers intersections of natural quadric shells (surfaces with thickness). A natural quadric shell can be thought of as a solid defined by a natural quadric surface and its offset (which is again a quadric). Thus, the intersection of quadric shells is essentially the same as the set of intersections of quadric surfaces and their offsets. An approach is presented to obtain the intersection of any two offset surfaces (of the initial quadrics) in terms of the offset distances. For the intersection of any two shells (which contain the initial quadrics as one of their surfaces), the intersection curve can be obtained directly by substituting the appropriate shell thickness (offset distances) in the general solution. Keywords: shells
Surface
intersections,
solid modelling,
quadric
Intersections of natural quadric primitives (cones, cylinders and spheres) arise frequently in geometric modelling. This subject has been widely studied, and efficient methods have been proposed (see, for exam-
ple, References l-5). Typically, the curve of intersection is of degree 4, and various methods exist for obtaining the intersection curve. In all these approaches, the intersection is solved for between two given surfaces having ‘zero’ thickness. However, in mechanical design, as well as in sheet metal design, the physical objects that are being described by the quadric (or any parametric) equations do possess a finite thickness. This metal thickness cannot be ignored and can range from 2 mm to as much as several inches in heavy duty industrial application@. We refer to a surface having finite thickness as a ‘shell’. The thickness of a shell is the offset distance of the outer surface from the inner surface, or vice versa. Consider any two natural quadric shells P and Q with thicknesses s and t, respectively. If these two shells intersect, a set of intersection curves is obtained, corresponding to the intersection of outer and inner surfaces of the two shells. This set of intersection curves can also be interpreted as Pinnerf-l Qinner z intersection of two inner surfaces of P and Q
Department of Mechanical Engineering, Ann Arbor, MI 48109-2125, USA
University of Michigan,
Paper Received: 30 January 1994. Reuised: 20 September 1994
Pouter
nQinner z Offs(Pinoer ) n Qinner
where Off,(A) represents the surface which is an offset of A with offse distance h. Note that the choice of as the initial surfaces is arbitrary, and ‘ime* and Qinner so any one of the four intersections mentioned above can be considered initially, and the rest become the intersection of offset surfaces of the initial surfaces. The offset surface of a cone as defined in this paper is different from the usual rolling ball offset (refer to the appendix). Also, if the thickness of a shell (say P) is changed to a new value (i.e the distance s between is changed), the new shell intersection and p0”te.r pimfx which has to be obtained can still be interpreted as above, but with a new value of s. Thus, to obtain the intersection of natural quadric shells, we analyse the intersection of quadric offset surfaces and aim to develop an efficient method for this problem. The intersection curve of the original two surfaces need not have any resemblance (either topologically or geometrically) to the intersection curve of the offset surfaces. Assuming that the intersection curve for two given quadric surfaces can be obtained easily using the current techniques, if one needs the intersection curve of their offset surfaces, surface-surface intersection (SSI) has to be performed again to obtain that curve. This is to say that SSI has to be done every time an intersection curve is required, even though it is known that the two surfaces being considered are offsets of the original surfaces for which the intersection curve has already been obtained. Restricting the case to natural quadrics, we know that these surfaces are closed under offsetting and so their offsets are precisely defined and easy to obtain. The problem we address in this paper is that of how, given two natural quadrics, one can obtain the intersection curves for any of their offset surfaces without performing an SSI each time. In this paper, we consider the natural quadrics (i.e. cones, cylinders and spheres) and a few higher degree surfaces (tori and cyclides). The second section of the paper describes the general idea of the method adopted. The third section focuses on the natural quadrics in detail and examples are given to illustrate this method. In the fourth section, an extension of this approach to include the torus and the cyclide is outlined. In the fifth section, an iterative
Computer-Aided
Design Volume 27 Number 8 August 1995
573
Quadric shell intersection: V Kumar and D Dutta scheme to obtain a set of intersection points (instead of the complete intersection curve) is presented. The sixth section summarizes the work. OFFSET
where I-&,x I-L ’ = IH, x H,,I rjlH H, = du
INTERSECTION
In this section, we develop a general method to intersect two offset surfaces Off,(G) and Off,(H) which are offsets of two given surfaces G and H. The primary goal is to obtain a solution to this intersection in terms of their offset distances, s and t. Hence the intersection is solved for only once, and the intersection curve of two particular offset surfaces Off,(G) and Off,(H) can then be obtained directly by substituting the respective offset distances of the surfaces (s = a and t = b) in the solution.
Substituting the parametric equations into the implicit equation yields F(u,u,s,t)=G(x(u,u,t),y(u,u,t),z(u,u,t),s) =0
of the original surfaces
To obtain the intersection of two surfaces, we represent one surface implicitly (G) and the other parametrically (H). The two original surfaces are thus defined as follows: G(x, y, z) = 0
or I’ = u,(u, s, t)
(1)
where the bold letters indicate vectors and r is a vector [x, y, z]. Substituting the parametric equations into the implicit equation yields
Solve the above equation for one of the parameters u = u,(u) or u = u,(u)
(3) curve between as
r = C(a,s,t)
G and H is
r=C(u,s,t)=H’(u,U,(U,S,t),t)
.
or (4)
Note that solving Equation 2 will yield multiple solutions, each of which could be a rational function. Equation 3 begin in general a multiple-valued rational function, generating the solution in the form of Equation 4 might be very difficult. However, for the case of natural quadrics, Equation 2 is only a quadratic equation, and it can be solved with reasonable accuracy without many problems. of offset surfaces
Using a scheme similar to that above, the intersection of two offset surfaces Off,(G) and Off,(H), can be developed as follows: G(x,y,z,s)
574
.
It may not always be possible to separate out the variables u or u from Equations 2 or 6. It is more often, very difficult to solve such an equation. However, for the case of natural quadrics, it can be shown that this can be achieved easily and that it is only a quadratic equation. In the fourth section, we address this point for the torus and the cyclide. No assumption has been made about what types of surface are handled and their algebraic degree, except that one surface is defined implicitly and the other parametrically.
QUADRIC
OFFSET
Derivation
of geometric parameters
INTERSECTIONS
The general equation of a quadric defined implicitly is given as ux~+byZ+cz2+2&y+2exz
=O
r=H(u,u)+t.~(u,u)=H’(u,u,t)
(8)
Thus the intersection curve is now obtained in terms of the offset distances. Substituting appropriate values for s and t will yield the intersection curve for the pair of offset surfaces. Each pair of values (sl, tl> corresponds to the intersection of the offset surfaces Off,(G)fl Off,(H), whose offsets from G and H are given by s, and t , , respectively. It is important to note the following two facts:
r = C(u) = H(u,(u),u)
r = C(u) = H(u, u,(u)>
= H’(u,(u,s,t),u,t)
or
(2)
F(u,u)=G(x(u,u),y(u,~),z(~,~))=O
Then the intersection obtained parametrically
(7)
Then the intersection curve is obtained as
r = H(u, u>
Intersection
(6)
Solving the above equation for one of the parameters, say u, in terms of the other parameter u and the offset parameters s and t,
Intersection Intersection
HI,=:
(5)
Computer-Aided Design Volume 27, Number 8 August 1995
+2fyz+2~+2hy+2iz+j=o
Quadric shell intersection:V Kumar and D Dutta
l/7-
(9)
a2=
-%idd)
l/2
l-b
(
3_a_b_c
l/2
l-c Given this implicit form, the type of the quadric can be classified by methods described in References 2 and 7. As mentioned in Reference 2, the quadric can be transformed into a canonical form by diagonalizing the subdiscriminant matrix Q, (the upper-left 3 X 3 principal submatrix of Q) and applying congruence transformations. Then the geometric parameters of the quadrics can be extracted from the canonical form. Though this method is well known and referred to very often, we were unable to find any source which gives the solution. Hence, in this section, we present the results of the above mentioned method to extract geometric parameters of the natural quadrics. The implicit and parametric representations of the natural quadrics using their geometric parameters are given in the appendix. Sphere The geometric parameters be obtained as follows:
(refer to Equation
23) can
x0= -g zo= -i R = (g2 + h2 + i2 -j)1’2
(10)
Cylinder Multiply the implicit equation (or the matrix Q) by a factor of 2/(a + b -t-c) and represent the coefficients by prime symbols a’, 6’ etc.). Then, the geometric parameters (refer to Equation 24) are given by a1
=
(1 - aY2
a2 = -sgn(d’)(l
- 6’)“’
a3 = - sgn(e’)(l
- c’)l”
Xb =
-e’ -g’b’
(
3-a-b-c
1
(c+b-l)g-dh-ei X” =
2-a-b-c
-dg+(a+c-l)h-fi Y, = Z” =
2-a-b-c -eg-fh-(a+b-1)i
(12)
2-a-b-c
It can also be seen that the following constraint satisfied:
is
-g’(c+b-l)-h’(a+c-1) -i2(a + b - 1) + 2dhg + 2egi + 2jhi j=
2-a-b-c
It can be shown that the rank of the subdiscriminant matrix, Q, is 3 for a cone and 2 for a cylinder.
+ d’h’
1 -c’
Zb = 1 r = (a’Xb”+ b’yb” +
(11) C’Z;
By defining tsvo quadrics, one implicitly and the other parametrically, the procedure outlined in the subsection on the intersection of offset surfaces can be used to obtain the offset intersection. The surface to be parameterized (and in standard orientation) is always chosen in the following order: cone, cylinder and sphere. The other surface is then represented in implicit form with arbitrary orientation. Note that, in the parametric equations (given in the appendix), the parameter u is not involved in any trigonometric function (except in sphere-sphere intersection). Thus Equation 6 now reduces to a quadratic equation in u of the form K1(u,s,t).v2+K2(u,s,t).u
1 --cl -f’ +g’d’ - a’h’
Yb =
-%de)
Quad& intersection
-h
y,=
a3=
+
2d’X,y,
+ 2e’xbzb + 2f’ybzb -j’)“’
Cone The geometric parameters (refer to Equation 25) for a cone are derived in a similar way as for the cylinder. The parameters of the cylinder can be derived as a special case of the cone. (Y= arctan(2 -a -6 - c)l”
+K,(u,s,t)
=o
(13)
The above equation can be easily solved for u to yield the solution of the form of Equations 7. Substituting the real roots of u into the parametric equation of the quadric yields the intersection fully defined (parametrically) in terms of the offset variables s and t (this is Equations 8). Substituting suitable values for s and t gives tk solution for that particular offset intersection. For the sphere-sphere intersection, Equation 6 reduces to the very simple trigonometric equation cos U cQs U =K(s,t)
(14)
which can be solved easily to obtain Equations 7 and 8. While solving trigonometric equations, it is necessary to take all the roots which lie in the parametric range. It is understood that the functions K,, K,, K,, and K include the geometric parameters of the two original quad&. Thus, for quadric offset intersections, Equation 6 can be solved to obtain Equations 7 and the intersection curve is obtained as in Equations 8. Computer-Aided Design Volume 27, Number 8 August 1995 575
Quadric shell intersection:
V Kumar and D Dutta
Degenerate cases
Thus the solution of the intersection curve becomes
[I [ --
The above scheme does not differentiate
between a normal intersection (where the intersection curve is a 4th-degree space curve) and a degenerate intersection’. All the degenerate cases are solved in a similar way to a normal intersection, except that, in degenerate cases, the solution of Equation 13 may turn out to have imaginary roots. Therefore, either those roots can be ignored directly before proceeding to Equations 8, or, in Equations 8, the points which yield imaginary values can be neglected. The disadvantage of handling all cases in a single fashion is that the geometrical and topological information on the intersection curve is not obtained. In degenerate intersection in particular, it may be necessary to identify the degenerate cases and obtain all the geometrical parameters of the intersection curve (for example the tonics). The geometrical tests as developed by Miller4 can be incorporated along with this method to identify all these cases and obtain the necessary geometrical parameters. Note that these geometric tests have to be performed for every pair of offset values (s, t). The geometric conditions can be modified to include the offset distances and the degenerate cases can be identified (see the example in the subsection on cylinder-sphere intersection).
X
c=
y = Z
3 cos u 3 sin u
1 &-3((2 cos u - 1))“’
?r/3lUIlT/3
1
(20)
It can be seen from Equation 19 that u has real roots for the range of u shown in Equation 20. The above mentioned steps were performed symbolically in MAPLE, and required a CPU time of 0.433 s on an HP9000/715. Figure 2 shows the intersection for the above mentioned case. The intersection curve is shown separately in Figure lb. To illustrate how the geometric tests can be modified to identify degenerate cases, one particular case is considered. If the sphere centre lies on the cylinder axis, the test for the degenerate cases becomes f‘=r+t-(d+s)
(21)
where f < 0 for a two-circle intersection, f = 0 for a tangent-circle intersection, and f > 0 for no intersection. Cone-cone
intersection
In this example, the cylinder of radius r is placed in the standard orientation and is defined parametrically. The sphere of radius d is in arbitrary orientation (a, 0, b) and is defined implicitly. The equations of offset cylinder and offset sphere are
In this example, one of the cones, C,, is placed in the standard orientation, with its vertex at (O,O,01, its axis along (O,O,l), and its half angle as 22.5”. The other cone, C?, is placed in an arbitrary orientation, with its vertex at (3,2,5), its axis along (0,l,O>, and its half angle as 15”. The intersection is solved in terms of the offset distances. The time taken to solve this intersection using MAPLE was 12.9 s on an HP9000/715. Figure 2 shows the cone-cone intersection in which cone C,, is offset from cone C, by a distance of 1, and the second cone Co2, is offset from cone C, by a distance of 2.
for Off,(H),
DISCUSSION
Examples Cylinder-sphere
G(x,y,z,s)
intersection
and =(x-&+y*+(z-t&
(d+s)’
=o
(16)
for Off,(G). Substituting Equation 15 into Equation 16, we get ((I + t) * cos u - a? + ((r + t) I sin u)’ +(u-b)2-(d+s)2=0
(17)
The above equation is of the form of Equation 13 and it can be solved for u in terms of u, s and t. For example, if r = 2, d = 2, a = 3, and b = 1, then the solution would be u = 1 k (6(2 + t) cos u - 9 + s* - t2 + 4(s - t ))
I/?
(18) Now, the intersection curve for a set of offset surfaces can be obtained from the above solution by substituting the appropriate s and t values. If s = 1 and t = 1, then u = 1 k 3(2 cos u - l)l’* 576
Computer-Aided
(19)
The method outlined obtains the intersection curve for two given quadrics in terms of the offset parameters. It has the advantage of solving for the intersection only once, and all intersections of the offset surfaces (of the two given quadrics) are obtained parametrically in closed form by substituting the suitable offset parameter values. The method does not distinguish between degenerate cases and so they are handled exactly as any other intersection. Therefore the specific geometric details of the degenerate intersection curve are not obtained. If this is not desired, appropriate steps can be added to obtain the geometric parameters for the degenerate cases (as discussed above). Although this method is algebraic, the steps involved in Equations 6-8 can be performed symbolically using such packages as MAPLE. The solution is obtained symbolically and finally the numerical values of the parameters are substituted to obtain the intersection curve. Thus, the method is robust and numerically stable. This method is fast and all the intersections for two quadric offsets can be obtained simply by substituting values for the offset distances. The only computa-
Design Volume 27, Number 8 August 1995
Quadric shell intersection: V Kumar and D Dutta
QJIR
1 Cylinder-sphere
intersection; (a) surfaces, (b) intersection
tion involved is in obtaining the solution of the Equation 6, and it is done only once. This is ideally suitable where a number of offset intersections for two given quadrics are required. The solution derived for any two quadric intersections was based on the parameterization described in the appendix. The intersection curve obtained, which is
curve
represented parametrically, may have some missing points owing to the way it has been parameterized. To obtain all the points of the curve, a reparameterization can be attempted or an alternative parameter can be extracted from Equation 6. Restricting the case to quadrics, this problem arises because of the singularities present in the solution, Equations 7. This is mainly Computer-Aided Design Volume 27, Number 8 August 1995
577
Quadric shell intersection:
V Kumar and D Dutta
(a)
Figure 2
Cone-cone
intersection;
(a) intersection,
(b) intersection
because of the presence of trigonometric functions or rational functions in the solution. In geometric modelling, the primitives, in general, are bounded. However, the algebraic representation inherently does not bound the quadrics, and so separate constraints have to be imposed to achieve this effect. For this purpose, either the constraints can be
578
Computer-Aided
curve
incorporated into this method, or the final intersection curve can be trimmed according to the constraints. This can be done by finding the parameter range of the intersection curve obtained by this method which satisfies all the constraints. The final intersection curve is then represented by the same parameterization for a restricted parameter range.
Design Volume 27, Number 8 August 1995
Quadric shell intersection: V Kumar and D Dutta
EXTENSION TO HIGHER DEGREE SURFACES
ITERATIVE SCHEME
The extension of this method to higher degree surfaces depends on whether Equation 6 can be solved to obtain Equations 7. This was achieved easily for the quadrics, but need not be the case for higher degree surfaces. It is not clear whether it is always possible to obtain Equations 7 and how this depends on the type of parameterization used. Hence this method can be used if Equation 6 can be transformed to Equation 7 for the given surfaces (which was found to be true for the quadrics as represented in the appendix). Even if Equations 7 can be obtained, all the solutions have to be analysed, and the correct ones should be identified. This might not be an easy task for higher degree surfaces. As the degree of the intersection curve increases, the accuracy of the coefficients becomes more critical, and hence may lead to numerical instability as well as error in the intersection curve itself. For the intersection of the torus/cyclide with a quadric, it was possible to extract a parameter from Equation 6. Whether this is possible for all intersections of tori and cyclides (such as a torus-torus intersection) remains to be investigated. The torus being a special case of a cyclide, we illustrate the method for a cyclide-cylinder example.
Cyclide-cylinder intersection In this degree cyclide sented
example, we try to extend this method to higher surfaces: a Dupin cyclide and cylinder. The is placed in standard orientation and is repreparametrically’: m(c - a ‘COSU cos W>+ b%os U
X=
a -c’cos besin u (a --~.cos
Y=
.Z=
a -c’cos
U cos W w)
Given two natural quadric shells, identify the points of intersection of the shells which are contained in a plane S passing through the axis of one of the shells. Given a point in one of the intersection curves of the shells, find the points on the other curves which are similar to the given point (similarity being defined as the points being in a position identical to the given point in their respective intersection curves) and lie in the plane S (again S is assumed to pass through the axis of one of the shells). For example, Figure 7 shows the intersection of two shells P and Q in the plane S. The point C (belonging to pinner fl Qinner and lying on the plane S> is said to correspond (be in a similar position) to point 0 (of the curve Po,t,, fl Q,,,,, and also lying on S). In the same way, point C’ corresponds to point 0’. The same definition can be used for defining similar points on the other two curves. Given a portion of one of the intersection curves of the shells, find the corresponding portions from all the other intersection curves lying in the same range as the portion of the given intersection curve. Here, the range is defined as the angle of the portion of the intersection curve with respect to the axis of one of the shells. The portion of the given intersection curve can be broken into a set of points, and the solution to the above problem (in the second bullet point) can be used for each of these points to solve this case.
u cos W
b-sin w (cecos u -m> a -c’cos
The method outlined in the previous section focuses on obtaining a closed-form solution for the intersection of the natural quadric shells. However, it may not always be necessary to obtain the general solution for the intersection. There may be instances (that are similar to the cases mentioned in Reference 6) where the entire intersection curve is not required, such as the following:
U cos W
(22)
For this example, a = 5, c = 1, m = 3. The cylinder has its axis along the x axis with a radius of 1. This intersection is shown in Figure 3. One interesting point to note is that the offset of a cyclide is a cyclide with the value of m incremented by the offset distance’. Figure 4 shows the intersection of two offset surfaces generated from the surfaces shown in Figure 3. The cylinder was offset by a distance of 4 and the cyclide was offset by a distance of 1. Note that the topologies of the intersection curves shown in Figures 3 and 4 are different, although the same solution was used to derive the intersection curve by plugging in suitable values for the offset distances. The time taken to generate the solution for this example using MAPLEon an HP9000/715 was 18.2 s.
such cases, instead of solving for the complete intersection, we can try to obtain the required points using some algebraic or iterative technique. We elaborate on each of these problems further. The first problem could be restated as that of finding the points of intersection of the shells P, Q and the plane S
be defined by specifying a point and the axis of one of the shells (say P). As S contains the axis of P, the intersection (P n S> reduces to a set of lines (circles in the case of spheres) and it can be easily determined. Now the section of P (lines/circles) can be intersected with Q. Thus, the problem has been reduced to a case of line/circle-shell intersection, which is basically a set of line/circle-quadric (natural) intersections each having at most two real points. These intersections can be easily solved analytically and this is not discussed further.
Computer-Aided Design Volume 27, Number 8 August 1995
579
Quadric shell intersection: V Kumar and D Dutta
Figure 3
Cyclide-cylinder
intersection;
(a) intersection,
(b) intersection
curve
In the next two problems, a part of one intersection curve of the shells (or a point for the second case mentioned above) is given, and we must find similar point(s) on the other intersection curves of the shells. This is essentially the same problem as that above, but further analysis is required to identify the points from
580
Computer-Aided Design Volume 27, Number 8 August 1995
the intersection which correspond to the given point. However, this processing to obtain the corresponding points may not be possible using analytical methods. In such a case, iterative techniques prove to be more useful. Also, iterative techniques can be easily extended beyond the domain of natural quadrics, and
Quadric shell intersection: V Kumar and D Dutta
some of the restrictions (such as the thickness of the shell being a constant) can be relaxed. Hence, in this section, we present an iterative scheme for the last two problems and show how it can be modified to solve the first one.
Figure 4
Algorithm for iterative scheme Given two shells (P & Q) and an intersection point 0 from the intersection curve I’,,,,, fl Qouter, the corresponding point C (from the curve Pi,,,, fl Qinner) lying
Offset cyclide and offset cylinder intersection; (a) intersection, (b) intersection curve
Computer-Aided Design Volume 27, Number 8 August 1995
581
Quadric shell intersection:
V Kumar and D Dutta
Example: cone-cone intersection
in the plane S (defined by 0 and the axis of P) is obtained. The shell P is assumed to be in the standard orientation. The algorithm is as follows:
This example (see Figure 6) illustrates the iterative scheme to identify the point C from the curve Pinnern Q,,,,, given a point on the curve P,,,,, rl Q,,,,,. Using Table 1, the appropriate functions and profiles are chosen and identified. A search is conducted on Li to identify the correct point C by choosing a point P on the line L, obtained by projecting the point 0 onto the line (see Figure 7). It is possible that the projection of 0 on Li lies beyond the inner vertex, in which case the vertex (the origin of Li) is chosen as P. The functions F, and F, are chosen as the implicit form of the surfaces of Q (defined in the appendix). The search scheme helps in identifying the correct point C that corresponds to the point 0 (instead of choosing point C’ which corresponds to 0’).
(1) For the point 0 of the curve P,,,,, n Qouter, create the plane S passing through the axis of P and the point 0. (2) In the section plane S, find the section profile of the shell P, which is essentially P f-jS. The section profile of P will either be a set of lines or a set of circles. Note that the section profile of Q is not required. The section profile of the surfaces Pi,,,, and P,,,,, are denoted by Li and L,, respectively. (3) Identify a suitable geometric property/criterion of Q to be used for the search. For the natural quadrics, the implicit equation of the surfaces of Q (F = 0, as defined in the appendix) can be used as the criterion to check whether a test point lies on (F = 01, inside (F < 01, or outside (F > 0) the surface. The criterion (polynomial in the implicit equation) denoted by F is used with appropriate subscripts for Qinner and Qouter: F, and F,. (4) A search is performed on the appropriate section profile of P CL, =L,) using the criterion (F, = F,) of Q to identify the point C on the curve Pi,,,, n Qinner. The search is iterative and it converges on the point of interest. The search is conducted depending on the values of the functions F, (on L,) and Fb (on L,, i.e. F, on L, in this case) at the starting point (which in most cases is chosen as the projection of 0 on L,). The method is shown in Figure 5. L, represents the section on which the search is performed and F, represents the related criterion on that section profile. L, represents the section profile on which the given point lies and Fb represents the related criterion on that section. The direction which is given in the flowchart is up or down for the cylinder and cone (as its axis is along the z axis) and is clockwise or counterclockwise for a circular section with respect to the centre of the section. Once the direction is known, then the required point (where F, = 0 or a positive minimum) can be obtained efficiently using any of the 1D search methods, such as the golden section method or a combination of the golden section method and polynomial interpolation”. The search finally yields the corresponding inner intersection point C for that outer point 0. The iterative scheme can also be used to obtain portions of other intersection curves using the profiles and criteria shown in Table 1. In all these cases, it has been assumed that the point 0 of the intersection curve p0,*,, n Qmer is given. However, if a point from some other curve is provided, then the function Fb and profile L, have to be changed accordingly to correspond to the criterion and profile of surfaces containing the point 0. 582
Computer-Aided
Discussion The main advantage of the iterative approach is that the required points are obtained without having to solve for the complete intersection problem. The search can be done very efficiently, as the criterion that is used for the search is a simple continuous function that is easy to evaluate, and the search domain is also a simple plane curve (in most cases a line). The method is also capable of handling cases where one of the primitives is a surface and not a shell, i.e. it is of zero thickness. If P is a surface, L, and L, coincide and so the points 0 and C lie on the same line. If Q is a surface, then F, and Fb become the same. In this method, it is assumed that the quadric-quadric intersection in the plane S is a set of points. Thus, this algorithm is not well suited for degenerate cases where the intersection turns out to be line(s) or a plane curve. This algorithm can be modified for the first case (that in the first bullet point in the section on the iterative scheme) where all the intersection points are required. This can be handled by performing the search on the entire domain of L, and identifying all the points that satisfy Fa. All references to L, and Fb in the search can be neglected. Also, the search can be started at the beginning of the domain of L, (without depending on the start point generated from L,).
SUMMARY In this paper, we have outlined an approach to find the intersection curves of quadric shells. As the inner and outer surfaces of these shells are offset surfaces of one another, the intersection between two such shells then becomes equivalent to the intersection between surfaces which are offsets of the initial surfaces chosen arbitrarily from two shells. The main aim was to perform the intersection between the offset surfaces using the known methods but to include the offset distances as variables into the formulation. Once the solution has been obtained, all other intersection curves can be generated by substituting appropriate values for the offset distances. Thus, for the intersection of two quadric shells, the intersection curves of the surfaces
Design Volume 27, Number 8 August 1995
Quadric shell intersection: V Kumar and D Dutta
COmpUte
the fUllCtiOllS paand F,, It the Start pOiIlt 4
F,
Gointhedimctionof &xrea&g Fa until Pa m.achesxxoora+ve lninimulll.
Fs=O
F,=O
F,=+ve minimum
1 Goiutlu : direction of +veFku AlF,=O. I .y--nJ I
F,=O
4
I
‘I
Check if +ve values of F, aminthcaamediat.ion
Gointhedimctio~~ of-veF,toreach F,=O
No )
asthatof+veFb W
Flgure 5
I
I
Search flowchart
Table 1 Selection of section profile and search functions Search on profile L,
Intersection
PLn”,,n Qinncr
Li
pinner n Qouter POUfcrn
Li
LO
Qinncr
F,
Fb
Fi FO
FO F,
4
FO
Profile for F,(L,)
LO LO
LO
(outer or inner) can be determined directly. Also, the thicknesses of the shells can be altered and the new intersection curve can be evaluated as the solution has been obtained in terms of the offset distances. An iterative method has also been presented to identify a set of intersection points if the complete intersection curve is not needed. The method has also been shown to be applicable to tori and cyclides.
REFERENCES
Figure 6
Cone-cone
intersection
Farouki, R T, Neff, C A and O’Connor, M A ‘Automatic parsing of degenerate quadric-surface intersections’ ACM Trans. Graph. Vol 8 No 3 (1989) Lcvin, J Z ‘A parametric algorithm for drawing pictures for solid objects composed of quadric surfaces’ Commun. ACM Vol 19 No 10 (1976) L&n, J Z ‘Mathematical models for determining the intersections of quadric surfaces’ Comput. Graph. & Image Proc. Vol 11 No 1 (1979) Miller, J R ‘Geometric approaches to nonplanar quadric surface intersection curves’ ACM Truns. Graph. Vol 6 No 4 (1987) Sarraga, R F ‘Algebraic methods for intersections of quadric surfaces in GMSOLID’ Comput. Vkion Graph. & Image Proc. Vol22 No 2 (1983) Wentland, K and Dutta, D ‘Method for offset-we generation for sheet-metal design’ Comput.-Aided Des. Vol25 No 10 (1993)
Computer-Aided Design Volume 27, Number 8 August 1995
583
Quadric shell intersection: V Kumar and D Dutta
Figure 7 Section profile with search details [The section profile of Q, in general a conic, is shown for clarity and is not required
Dresden, A Solid Analytical Geometry and Determinants Dover, USA (1964) Forsyth, A R Lectures on Differential Geometry of Curves and Surfaces Cambridge University Press (1912) Martin, R R ‘Principal patches for computational geometry’ PhD Thesis Cambridge University, UK (1982) Rao, S S Optimization: Theory and Applications Halsted Press, USA (1984)
for the search
algorithm.]
Cylinder The implicit form is (P-B).(P-B)-((P-B).~~)*-((R+s)~=O
where P=
BIBLIOGRAPHY
[xyz]
is a point on the cylinder, Miller, J R and Goldman, R N ‘Using tangent balls to find plane sections of natural quadrics’ IEEE Comput. Graph. & Applic. Vol 2 No 2 (1992) Salmon, G A Treatise on Conic Sections Chelsea Publishing, USA (1911). Salmon, G A Treatise on the Analytical Geometry of Three Dimensions Vols 1 and 2 (5th Ed.) Longman, Green & Co., UK (1912) Sommerville, D Y Analytical Geometry of Three Dimensions Cambridge University Press, UK (1934).
B=[.x,y,
261
is a base point on the axis of the cylinder, and A= [a, a:
$1
is the normalized axis direction. Expanding the above equation yields
APPENDIX (x-x,)’ The natural quadrics can be expressed in both parametric form (standard orientation) and in implicit form (arbitrary orientation) as follows:
+ (y -yJ2
+(y -y,)*a,
+ (z -z$ + (z-z*)Y23)2
- ((x -xb)*a, - (R +sj2 = 0
The parametric form is
Sphere
X s=
The implicit form is
Y
IIz
OIUL~IT;
(X-XO)2+(y-yg)Z+(*-~20~2-~(R+S~2=0
=
(r+t)*cos
u
(r +t).sin
u
I
V
-DsvsD
The parametric form is
Cone i-[,l-[:~~~~~~n,“] 05u<2lr; 584
-9T/2~U~7r/2
The implicit form is (23)
Computer-Aided Design Volume 27, Number 8 August 1995
(24)
Quadric shell intersection: V Kumar and D Dutta
where
be flipped for the range v < 0, making them the inward normals. Figure 8 shows both the cases. This work takes the first case as the offset surface. The parametric form for the offset surface of the cone given in Equation 25 can be obtained, using Equation 5, as
P= [xyz] is a point on the cone, A = [a, a2 a31
t
is the axis of the cone, T=tan
v.v-T+
(Y v*v*T+
(where (Y is the half angle of the cone), “‘=V-
((&)*A)
t
I
(1 + T*)“* I tT
cos u
sin u
’ - (1 + T*)l’*
is the vertex of the offset cone, and
is the vertex of the given cone. The parametric (for the initial surface) is
(1 + T*)l’*
(26)
OIUI27T
The first case in Figure 8 is obtained from Equation 26 by letting the parameter v take negative values, i.e. by having sgn v = 1 for all values of v. Also, the range of the parameter v is modified to
form
-
1 T(l + T*)l’*
(25)
t
T(l + T*)l’*
(27)
while the initial surface is defined by Equation 25 for the range 0 2 v ID. The two extreme values of v in Expression 27 correspond to the points a and b in Figure 8. Using this modified range and letting v have negative values would precisely yield the outer/offset cone until its apex. Also, to get the outer/offset surface to the same base (z = D) as the initial cone, the range has to be extended. Thus, the initial and offset surface of the shell are defined for two different ranges of v. This offset/outer surface can also be obtained by translating the initial cone by a distance (t(1 + T*)l/*)/T in the negative z direction (in standard orientation). The implicit form of the cone is derived using this method. To obtain the inner offset surface,
Note that the above equations define the implicit offset surfaces (with the offset parameter s> and the original surfaces are obtained with s = 0. Similarly, the offset parametric surfaces are given (except for the cone) and the corresponding original surfaces are obtained with t = 0. These offset parametric equations can also be obtained from the original surface (i.e. with t = 0) and then using Equations 5. For the cases of a sphere and a cylinder, the offset surfaces are obtained directly by incrementing the radius by the offset distance. For the cone, the offset surface used in this work is not the usual rolling ball notion of offsetting. To realize the quadric shell for the cone, the normals have to
I
Figure 8 Offset used to obtain shell and rolling ball offset of cone. [The normals are indicated from the initial surface to the offset surface.]
Computer-Aided Design Volume 27, Number 8 August 1995
585
Quadric shell intersection: V Kumar and D Dutta
the same formulation can be used, but with a negative value for the offset distance, t. The rolling ball offset of the cone (the second case in Figure 8) can also be obtained from Equation 26 by using sgn u =
(
-1
1
v20 UC0
Thus Equation 5 can be used to yield the offset as required for the shell or the rolling ball offset.
Vinod Kumar is currently a PhD student working in the area of CAGD. He receioed his Masters degree in mechanical engineering from Rugers University, NJ and his Bachelors degree from IITMadras, India
586
Computer-Aided Design Volume 27, Number 8 August 1995
Debasish Dutta received his PhD from Purdue Uniwrsity and currently teaches in the Department of Mechanical Engineering % Applied Mechanics, at the Uniwrsi@ of Michigan, Ann Arbor.