Single-valued surfaces in cylindrical coordinates

Single-valued surfaces in cylindrical coordinates

Single-valued surfaces in cylindrical coordinates J S&nchez-Reyes A method is given for the approximation of single-valued surfaces in cylindrical co...

1MB Sizes 1 Downloads 77 Views

Single-valued surfaces in cylindrical coordinates J S&nchez-Reyes

A method is given for the approximation of single-valued surfaces in cylindrical coordinates. These surfaces are defined by a mesh of control points on regularly spaced radial directions. As such surfaces generate two halt-spaces, they can be incorporated as primitives in a solid-modelling system. This concept immediately extends to cylindrical solids with internal parameterization that are useful for describing nonhomogeneous materials. geometry, surtaces,solids, cylindrical coordinates

One of the most important issues in computer-aided geometric design is the integration of free-form surface techniques into solid-modelling systems 1-3. In surface modelling, piecewise parametric polynomial surfaces are used. These surfaces are not guaranteed to bound any closed object. Moreover, if they define a solid object, there is no immediate algorithm to determine whether a given point is within or outside the solid. On the other hand, implicit surfaces are used for solid-modelling purposes, as they naturally define half-spaces. These half-spaces can be combined by the performance of Boolean operations to form closed solid objects. Implicit surfaces are usually restricted to planar faces or quadrics. Sederberg 4 has developed a control-point technique to define algebraic patches of any degree, i.e. surfaces expressed by an implicit polynomial equation. However, the control of the shape of an algebraic patch is not as simple as it is for parametric patches. From algebraic geometry, it is known that any rational parametric surface can be expressed as an algebraic surface. Unfortunately, the algebraic degree is much higher than the rational degree. For low-degree rational surfaces, this implicitization is still feasible. Therefore, the use of quadratic and biquadratic patches has been proposed as one of the strategies s for the introduction of free-form surfaces into solid modellers. Ayala 6 has integrated biquadratic patches into an extended octree structure. Nevertheless, the amount of free-form modelling that can be achieved with these surfaces is restricted.

Department d'Enginyeria Mec&nica, ETSEIB,Polytechnic University of Catalonia, Diagonal 647, 08028 Barcelona, Spain Paper received: 11 December 1989. Revised: 25 May 1990

volume 23 number 8 october 1991

This paper suggests a different approach that is based on the use of single-valued surfaces. In particular, many engineering parts can be described as single-valued surfaces r = r(O, z) in a system of cylindrical coordinates (r, 0, z) (see Figure 1). The main advantage of this representation is that the point classification can be performed with little effort: a given point P0 = (r0, 0o, z0) lies within the volume defined by the surface if ro < r(Oo, Zo). Hence, such surfaces generate two half-spaces, and can be incorporated as primitives in a solid-modelling system. A method for the approximation of single-valued surfaces in cylindrical coordinates is given. The resulting surfaces are the analogue of nonparametric B6zier patches z z = f(x, y) in Cartesian coordinates. To define a surface spanning between two vertical planes containing the z axis and two horizontal planes perpendicular to this axis, the corresponding control points will be regularly spaced with respect to the angular coordinate 0 and the z coordinate between these planes. The surface is constructed by evaluating in the z direction each vertical line of the control mesh as a nonparametric B6zier curve 7 r = r(z). This process generates points lying on a horizontal plane that define a rational B6zier curve r = r(O) that is single-valued in polar coordinates 8. By the evaluation of this curve in the 0 direction, the point of the surface corresponding to (0, z) is obtained. If the precedence of evaluations is swapped, a different surface is geherated. The resulting surfaces are not tensor-product surfaces, but they enjoy many of the properties of the

(r,P, z)

Z

Figure 1. System of cylindrical coordinates (r, 0, z)

0010-4485/91/080561-08 © 1991 Butterworth-Heinemann Ltd

561

Bezier scheme, such as the corner point interpolation and the containment in the convex hull. Conditions for the continuity of piecewise surfaces are formulated. Finally, a third radial parameter is introduced to define volumes with internal parameterization.

SINGLE-VALUED CURVES Nonparametric B6zier curves and single-valued curves in polar coordinates are the main elements in the construction of single-valued surfaces in cylindrical coordinates. In this section, both types of curve are briefly reviewed.

For the approximation of single-valued functions in Cartesian coordinates y = f(x), nonparametric B6zier curves 7 are used (see Figure 2a). These form a special subset of nonrational B6zier curves that is characterized by control points Pi = (xi, Yi) lying over abscissae regularly spaced at a distance A× along the x axis: 0 ~< i ~< n

where n is the degree of the curve. The curve can be written as

y(x) = £ yiBl'(u)

X --

/---- 0,1 . . . . . n

(1)

In a similar way to the Cartesian case, single-valued curves r = r(O) can be defined in a system of polar coordinates (r, 0). The author has developed a method 8 for the approximation of such curves by using a subset of planar rational B6zier curves. For curves of degree n required to span a given angle 2hA between two radial directions 0 o and 0,,, this subset is characterized by the following constraints: • control points p i = (ri , Oi) on radial directions regularly spaced at an angle 2A < x (as shown in Figure 2b):

0 <. i <. n

• the weight corresponding to the control point Pi -- (ri, 0i):

where --

....

It must be noted that such a subset of B6zier curves is closed with respect to the degree-elevation or subdivision operations. These processes generate new curves with control points that remain regularly spaced along the x axis and that, in consequence, belong to the subset.

0i = 00 + i2A

i=0

U

Bl'(u)=(7)u'(1--u)

Single-valued rational B6zier curves

Nonparametric B6zier curves

x i = x0 + iA x

and ue[0, 1]. Bl~(u)denotes the Bernstein polynomials of degree n:

X0

-

wi = Pi = (ri)-1

nA x

Using the parameter u el0,1], the corresponding rational B6zier curve x(u) can be written as

Y~ P3

£ wipiBn(u) X(U) =

i=0

L wiBn(u) i=0 Pl

P2

where u e [0, 1]. By the introduction of a new angular parameter t e l - A , A], defined by X3

Xo

X

u --

tan t 4- T

(2)

2T where T = tan A, the rational curve can easily be expressed as single-valued in polar coordinates: P2

p(O) = r 1(0)= L PiAn (t) i=0

where t = O/n, and the radial direction 0 = 0 has been chosen in such a way that 0 = 0 o + 0n. An(t) indicates certain sinusoidal functions, in a similar way to Bernstein polynomials:

An(t ) = b

Figure 2. Single-valued curves of degree n = 3; (a) in Cartesian coordinates, (b) in polar coordinates 562

i

s~

s i n n - i ( A -- t)sini(z~ + t)

where S2 = sin(2A). Substituting the change of parameter in Equation 2 into Equation 1, the following relationship between the above sinusoidal functions and Bernstein

computer-aided design

Alternatively, the precedence in evaluations for v and t can be swapped:

polynomials is derived:

where C = cos A. The above-mentioned subset of rational B6zier curves is closed with respect to the degree elevation, lhis process generates two curves whose control points remain regularly spaced with respect to the angular coordinate O. As for degree elevation, in general, a curve of degree n cannot be expressed as a curve of degree n + 1. This is deduced by comparing their expansions in terms of the Fourier series of the parameter 0 given in Reference 8. A rational B~zier curve of the subset could certainly be submitted to the degree elevation n ~ n + 1, but the resulting curve would not belong to the subset. Nevertheless, curves of degree n form a subset of curves of degree kn, where k is any natural number. Therefore, the subset is closed with respect to the degree elevation, which is performed as n ~ kn.

DEFINING SINGLE-VALUED SURFACES IN CYLINDRICAL COORDINATES Mesh of control points Single-valued surfaces in cylindrical coordinates are defined by a mesh of control points pq (0 ~ i ~ m; 0 ~ j ~ n) that lie on radial directions regularly spaced with respect to both the angular direction 0 and the vertical direction z. If a surface is required to span a given angle 2mz~ between two radial planes, and a given distance nA z between two horizontal planes, the control points pq of the surface are:

Pq = (rip Oii, zq)

Oii = 00 + (2A)i 0 ~< i ~< m zij = z o + Azj 0 <~ j <~ n The parameters t, v of the surface $(t, v) are defined by 0 = mt t e [ - A , A] (3) z = z o + vnA z v•[O, 1]

A point $(t, v) corresponding to the given values t, v is calculated by the application of the following algorithm: • Each of the ith nonparametric B~zier curves of degree n, with control polygons determined by the ith line in the control mesh, is evaluated for v. This process generates m + l points pi(v) (0~
j=O

• The single-valued curve in polar coordinates of degree m defined by control points pi(v)is evaluated for u, yielding the desired point $(t, v). The inverse of the distance p = r -1 from the z axis to this point is given by

p(t, v) = £ Am(t) i=0 ri(v)

volume 23 number 8 october 1991

Pl(t) =

pijAm(t) i=0

Pij = -

rij

• The nonparametric B~zier curve of degree n defined by the control points pi(v) is evaluated for v, yielding the desired point $(t, v). The distance from the z axis to this point is given by A B~(v) r(t, v) = ~, i=0 Pi(t)

(5b)

By comparison of Equations 5a and 5b, it is concluded that, in general, the equations define two different families of surfaces. Henceforth, these families of surfaces are referred to as vt and tv surfaces, respectively. The lack of symmetry is not surprising, as the system of coordinates in which the surfaces are constructed are not symmetrical, i.e. the coordinates (0, z) cannot be freely swapped. Although the algorithm for the construction of these surfaces may resemble that for tensor-products surfaces, the resulting surfaces are not tensor-product. A tensor-product surface 7 is of the form x ( u , v ) = ~,i~,jci,jFi,j(u, v), where the basis functions Fi,/ can be expressed as the products Fi,j(u,v)= fi(u)gi(v). The surfaces in Equations 5a or 5b cannot be factorized in the required form, neither in Cartesian coordinates, nor in cylindrical coordinates.

Expression as rational polynomial surfaces

Algorithm for evaluation of the surface

ri(v) = £ rqB~(v)

• Each of the jth single-valued curves in polar coordinates of degree m with control polygons determined by the jth horizontal level in the control mesh is evaluated for value v. This process generates n + 1 points [l(t) 0 <~ j <~ n on a radial vertical plane that are regularly spaced with respect to z. The inverses of their distances to the z axis are

(5a)

The vt surfaces of Equation 5a take the following form in Cartesian coordinates:

~wi(v)B',~(u)pi(v)

S(u, v)

i=o

pi(v) = L PiIBi ~(v) i=o

-

i=o

/=o

where ue[0, 1] is determined by the change of parameter described in Equation 2. If the above formula is expanded into the quotient of two polynomials, it can be checked that their degree is (m, n'), with n' > n. An analogous result holds for the family of tv surfaces, whose rational polynomial expression is of degree (m', n), where m' > m. It must be remarked that these surfaces are not rational B6zier surfaces of degree (m, n) with control points Pii and weights w i = pi = (ri) -1, except in very special cases, such as ruled cylindrical surfaces of the z axis.

563

Properties Although single-valued surfaces in cylindrical coordinates are not tensor-product surfaces, they enjoy many of the positive properties of the B(~zier scheme. The following properties are immediately deduced from those of Bezier curves and single-valued curves in polar coordinates: • The boundary curves of the surface are: v = 0; v = 1 : single-valued curves in polar coordinates, and t = - A ; t = A: nonparametric B6zier curves, whose control polygons are determined by the corresponding row or column in the control mesh. • As a consequence, the surface is tangent to the control mesh at the four corner points Po0, Pmo, p0n,

PtT]n •

• The surface is contained in the convex hull of the control mesh, as both nonparametric B(~zier and single-valued curves in polar coordinates are contained in the convex hull of their respective control polygons. • vt surfaces can be subdivided into two patches in the v direction, by the application of the algorithm of nonparametric B6zier curves. The resulting patches have control points regularly spaced with

respect to/) and z. Analogously, tv surlaces (:an be subdivided in the t direction. • A similar result holds for degree elevation. This can be performed, in the v direction (n -* n + 1) for vt surfaces, or in the t direction ( m - * k m ) for tv surfaces, k being any natural number. The resulting control points remain regularly spaced.

Examples Figure 3 shows several single-valued vt surfaces with their respective control meshes. Just as for B6zier surfaces, inner control points exert a pull on the portion of the surface near them. A radial displacement of one of these points is less effective for points far from the z axis, as control points of single-valued curves in polar coordinates appearing in the construction of the surface have weights equal to the inverses of their distances to the z axis.

COMPOSITE SURFACES Definitions Consider two adjacent cylindrical surfaces I and II, with control meshes (m, n) of the same dimension. C o

P22 _

P02

~P12

T Pol

(

~

Pll I)1o

Poo

b

P22 Pl2

Pll

a

~Plo

POO' ~

c

/

Figure 3. Single-valued surfaces in cylindrical coordinates of control mesh; (a) (m, n) =:(2, 2), (b) (m, n) =(2, 3), (c) (m, n) =:(3, 2)

564

computer-aided design

continuity being assumed, i.e. that both surfaces share control points along the common boundary, the general conditions for C R continuity will be derived. (The superscripts I and II are used to denote symbols corresponding to patches I and II, respectively.) As the parameters t, v cannot be freely swapped, conditions for continuity must be formulated separately for unions along the t = constant boundaries (radial vertical planes) or v = constant boundaries (horizontal planes). The parameter values defining these boundaries will be assumed to be

I

II

boundary t = constant

t=A

boundary v = constant

v=l

t=-A

v=0

The continuity conditions that will be formulated correspond to geometric continuity if the parameters t, v are used. For parametric continuity, the surface must be parameterized by 0, z. vt

surfaces: continuity in v direction

The condition for C R continuity in the v direction between vt patches I and II across the v = constant boundary is derived from Equation 5a. It is the C R continuity of the m + 1 pairs of nonparametric B6zier curves of degree n pl(v) and pll(v)(0 ~< i ~< m) derived from Equation 4. For a detailed description of continuity conditions for BEzier curves and their relationship with the de Casteljau algorithm, the reader is referred to Reference 7. For C 1 continuity, control points pit,n_1, Pl, n Plilo, Plll must be aligned. In the case of the aforementioned nonparametric B~zier curves, this condition becomes

ri,IIoAz2

+

JI AI Fi, IL.~ z

:

0

rl / All\2 i II ii i =11 /AI ~2 i,n--2[~z) -- ri,n_ lAz2Az Jr- ri, l Z ~ z 2 A z - - ri,2tl-~ z) = 0

O <<. i <<. m

= 0

As Bernstein polynomials are linearly independent, Equation 7 transforms to II r°'J

- - 2 m -- 1

r~_ 1,i

Vj

II

ro,j _ ~1 Vj II rl,j The geometric interpretation of this condition is shown in Figure 4, where the horizontal jth section is shown. The alignment of points Pro--l, ' ' i = Po,i, " Pl,i " is not i, Pro, sufficient. They must also define similar polygons for all values of j. In other words, the angle ~ between the radial direction and the segment joining these three points must be the same for any value of j. This condition is more restrictive than that for continuity across the v = constant boundary. Nevertheless, this constraint is naturally satisfied in many engineering pieces, such as those shown in Figure 5, where ~ - - 9 0 ° along certain radial planes. These objects have been generated by joining, with C 1 continuity, several cylindrical patches of degree (m, n) = (4, 3). Each patch spans an angle of 90 °. The sculptured surface in Figure 5a is composed of four patches, and those in Figures 5b and 5c are composed of eight patches. Assuming C 1 continuity, the condition for C 2 continuity is derived in a similar way: II

ro,j

__ 2m_2Vj

rL -- 2,j II ro,j II r2,1

0 <~ i <~ m

where Az2 = A~ + A~. Assuming C 1 continuity, the condition for C 2 continuity turns out to be

/1"1are constants such that

~'m--1 SI21 -- $22 JI- ~1 s/

=

rl All i,n_ lLSz - -

~'m--1,

where

__

~2Vj

where 2m--2, 22 are constants such that ~m_2(S~)

2 -- , ~ m _ 1 S 2 2 S ~

+ 21522 S/ -- 22(S/) 2 = 0

In general, the condition for C R continuity can be expressed as a certain linear combination of functions I

vt surfaces: continuity in t direction

Pm - ] ,J

The condition for C R continuity in the t direction between vt patches is also derived from Equation 5a. It is the C R continuity of the two single-valued B6zier curves in polar coordinates of degree m whose control points are pl(v) and pl)(v)(0 ~< i ~< m). The inverses of the distances from the z axis to these points are denoted by pl(v) and pll(v), respectively. The conditions for the C R continuity of single-valued curves in polar coordinates are described in Reference 8. In particular, the condition for C 1 continuity can be written as pL_l(V)S~ - - plol(v)S22 -~- p~(v)SI2_ = 0 (6)

II

P],i

where $22 = sin(2A L + 2A"). From the above expression, the condition for C 1 continuity is derived as r~(v) _ _ rlm_l(V)

r~(v) r~(v)

-- 2rn_ 1

-- 21

volume 23 number 8 october 1991

(7)

z axis Figure 4. Condition for C ~ continuity in t direction for vt surfaces

565

tv surfaces: continuity in t direction The condition for C R continuity between tv patches I and II in the t direction across the t = constant boundary is derived from Equation 5b. It is the C R continuity of single-valued curves in polar coordinates pl(t), pll(t) (0 <, j <~ n). For C 1 continuity, control points P~ 1,j, I . . Pro,/= P0,j, PI,j must be aligned: pl c-II I _11 e l m 1 , j 3 2 - - pro,iS22 + ~Ul,/a 2 = 0 0 ~< j ~< n Assuming C 1 continuity, the C2-continuity condition can be expressed by the scalar equation

plm--2,/L,5,,2 2/

--

_n S22 S2II -'l- P~"1 , j ~~2 2 a~l2 ~m--l,j

~, ,Si,2 - - ~U2,j~ 2J =

0

O<~j~n tv surfaces: continuity in v direction

I Figure 5. C 1 composite cylindrical surfaces; ( a) comprising four patches, (b), (c) comprising eight patches plm R(v) . . . . . p~(v) . . . . . p~(v) being equal to 0, such as Equation 6 for R = 1. The continuity of single-valued curves in polar coordinates defined by each jth horizontal level in the control mesh is a necessary, but not sufficient, condition. In addition, polygons . . . . . p~,j(v) must be similar for all p ~ _ ~,/(v),. .., po,j(v) " values of j, i.e. equal apart from the scale factor.

566

The condition for C R continuity of tv surfaces across the v = constant boundary is deduced in the same way as is C R continuity across the t = constant boundary of vt surfaces. This condition can now be expressed as a certain linear combination of functions rlm_R(v) .... , r~(v),..., r~(v) equal to O. In analogy, the continuity of nonparametric B~zier curves defined by each ith vertical column in the control mesh is a necessary, but not sufficient, condition. In addition, the horizontal planes of control points j = n - R,..., n in patch I and j = 0 , . . . , R in patch II must be equal apart from the scale factor.

computer-aided design

CYLINDRICAL VOLUMES WITH INTERNAL PARAMETERIZATION Modelling nonhomogeneous solids

\

There is a wide range of applications where not only is the description of the surface bounding a volume needed, but also information about the interior structure of the volume is required. Common examples are composite-material modelling and finite-element analysis. For this purpose, the B~zier representation of surfaces has been generalized to volumes 9'1°. Such volumes, also known as hyperpatches, represent the solid swept by a surface when it moves through space and its shape is simultaneously modified. This swept surface is expressed by a third parameter, and it is governed by internal control points exerting a pull on the intermediate surfaces that are defined for different values of this parameter. In this section, a similar scheme is developed that is based on the use of single-valued surfaces in cylindrical coordinates.

Mesh of control points A cylindrical volume is defined by a 3D mesh of control points Pqk composed of q + 1 2D regular meshes in cylindrical coordinates:

Pqk = (rqk, Oijk, Zijk ) where

Oi/k = 0o + (2A)i

\

zijk = z0 + Azj and O <~ i <~ m, O <~ j <~ n, and O <~ k <, q. The parameters t, v, s of the volume V(t, v, s) are those of Equation 3, plus a third radial parameter s t [ 0 , 1] indicating the radial layer.

Algorithm for evaluating volume A point Y(t, v, s) corresponding to the given values t, v, s is calculated by applying the following scheme: • Each of the ijth Bezier curves of degree q with control polygons determined by the ijth radial line of control points is evaluated for value s. Such B~zier curves are straight radial lines. This process generates a mesh of control points pq(s): q

pij(s) = ~ pijkB~(s) k=O

• The single-valued surface in cylindrical coordinates of degree m defined by control points pq(s) (0 ~< i ~< m; 0 ~< j ~< n) is evaluated for values t, v. The resulting point V(t, v, s) is given by Equations 5a or 5b where qj takes the form q k=0

Examples The internal structure of two cylindrical volumes and their respective 3D control meshes are shown in Figure 6. The external boundaries s = 0, s = 1 and the internal

volume 23 number 8 october 1991

(

Figure 6. Cylindrical volumes with internal parameterization of control mesh (m, n, q) = (2, 2, 2) layers s = 1/3, s = 2/3 are represented. Both volumes differ in the position of the control point marked with the solid black circle, which controls the distribution of the internal sheets. The properties of these solids (corner points interpolation, containment in the convex hull, and so on) are a straightforward generalization of those for cylindrical surfaces.

CONCLUSIONS Single-valued surfaces in cylindrical coordinates are of interest, as they define half-spaces, and, consequently, they can be introduced as primitives in a solid-modeller system. The construction of these surfaces is based on the use of nonparametric B~zier curves and single-valued curves in polar coordinates. Two families of surfaces are defined, and both enjoy many of the positive properties of the B~zier scheme. Conditions for continuity between adjacent patches are more restrictive than those for rectangular B~zier patches. By the introduction of a third parameter, the scheme is extended to the definition of cylindrical volumes with internal parameterization.

567

REFERENCES Miller, R 'Sculptured surfaces in solid models: issues and alternative approaches' IEEEComput. Graph. & Applic. Vol 6 No 12 (1986) pp 37-48 2 V~rady, T and Pratt, M J 'Design techniques for the definition of solid objects with free-form geometry' Comput. Aided Geom. Des. Vol 1 No 3 (1984) pp 207-255 Casale, M 'Free-form solid modeling with trimmed surface patches' IEEE Comput. Graph. & Applic. Vol 7 No 1 (1987) pp 33-43 4 Sederberg, T W 'Piecewise algebraic surface patches' Comput. Aided Geom. Des. Vol 2 (1985) pp 53-59 5 Goldman, R N 'The role of surfaces in solid

568

modeling' in Farin, G E (Fd.) Geometric: Modeling: Algorithms and New Trends SIAM, USA (1987) 6 Ayala, D 'Boolean operations between solids and surfaces by octrees: models and algorithms' Comput.-Aided Des. Vo120 No 8 (1988) pp 452-465 7 Farin, G Curves and Surfaces for Computer Aided Geometric Design Academic Press, USA (1988) 8 S.~nchez-Reyes, J 'Single-valued curves in polar coordinates' Comput.-Aided Des. Vol 22 No 1 (1990) pp 19-26 9 Casale, M and Stanton, E D 'An overview of analytic solid modelling' IEEE Comput. Graph. & Applie. Vol 5 No 2 (1985) pp 45-56 10 Lasser, D 'Bernstein-B~zier representation of volumes' Comput. Aided Geom. Des. Vol 2 (1985) pp 145-149

computer-aided design