Alternative representation for parametric cubic curves and surfaces

Alternative representation for parametric cubic curves and surfaces

Alternative representation for parametric cubic curves and surfaces Henry G Timmer A representation for parametric cubic curves and surfaces is presen...

309KB Sizes 3 Downloads 122 Views

Alternative representation for parametric cubic curves and surfaces Henry G Timmer A representation for parametric cubic curves and surfaces is presented which incorporates the polygonal approach popularized by the B#zier and B-spline schemes. Since the curves more closely mimic the polygon than their counterparts employing the B~zier or B-spline schemes, the method is potentially useful for creating and manipulating geometric models. In connection with the logical extension o f the approach from curves to surfaces, a discussion of the relationship between continuity and redundant data storage is included. Parametric cubics (PCs) have found widespread application in the numerical representation of curves and surfaces~. Schemes for defining and representing these entities have evolved which employ a wide range of mathematical sophistication. The basic problem, simply stated, is to enable the designer to create curves and surfaces which behave as he wants them to. The PC is a powerful tool which, when properly defined, is capable of representing most geometric entities of practical interest. Unfortunately, during the early years of its implementation, procedures which properly exploited this power were not available, and the PC acquired a reputation among designers as being 'unpredictable'. Use of cubic interpolating splines proved to be a useful means of defining multisegmented PC curves with satisfactory continuity properties, but there were still problems with undesirable wiggles as well as the global nature of the representation. The approximation schemes, employed by both the Bezier and B-spline representations, sought to improve the situation by providing local control and allowing the designer to model with polygons. The mathematical curve then approximated the polygon to some degree,and the designer was freed from the confusing consideration of parametrization and tangent vector magnitudes. The major complaint against the approximation schemes was the very loose conformity between the curve and the polygon (and vice versa). Designers found it difficult to create the desired curve by def ning a polygon with such poor mimicking properties. The scheme presented here represents a compromise between interpolation and approximation in an attempt to increase the conformity between the curve and its defining polygon. An important practical consideration is the relationship between computational efficiency and storage Douglas Aircraft Company, 3855 Lakewood Boulevard, Long Beach, CA 90846, USA

volume 12 number 1 january 1980

requirements. A computationally efficient data structure is likely to employ some degree of redundant information. The use of separate data structures for database retention and operational evaluation is suggested as a reasonable compromise. CURVES A single PC curve segment usually requires four vectors to define it. Thus, for an unconstrained space curve, the PC may be said to have 12 degrees of freedom. If P denotes a position vector (x, y, z) and u is the parametric coordinate, the governing equation may be written in matrix form as: P(u) = UMX.

(0 ~< u ~< 1)

(1)

The matrices M and X depend on the selected representation format, while U = [u 3, u 2, u, 1 ]. As examples, consider the following formats: • Algebraic: 0 0 0

MA =

1 0 0

0 1 0

0 XA =

• Geometric: 3 -2 0 1

MG=

0

XG=

o

P(1) L P'(0)~

P'(1)J

• 4 point:

|18-27 3 6 -

M4=1/2 ]-11

I_ 2

18 - 9

o

0

X4 =

P(1/3)~

P(2/3)~" P(1) J(2)

Clearly, each of the preceding formats has a class of applications where it excels. The algebraic form provides computational efficiency, but the X A lacks a clear identification with the curve geometry that is provided by both XG and X4. The XG contains endpoint slope data, while the X4 constrains the interior of the curve. The approximation scheme employed by B~zier2 defines the curve as N P(u) = ~ ~i(u)Pi i=1

(3)

where the Pi are the N vertices of a polygon and the ~i(u) are Nth order Bernstein polynomials. For the case of a PC, N = 4 and the ~/i(U) are given by

0010-4485/80/010025-04 $02.00 © 1980 IPC Business Press

25

Using the geometric form of the PC, the parametric midpoint of the curve is given by

P3

P(1/2) = ½ (P, + P.) + 1 (P'(0) - P'(1 )) = ½(PI + P4) + 1 (P2-PI

+ P3-P4)

(8)

= 1(P2 + P3) = Ps

PI

P,,

P6=}(PI. P4),

Figure I. Polygonal representation o f a PC curve

Thus, the PC interpolates the midpoint of the middle segment at u = 1/2. Although the curve appears to be tangent to the middle segment at u = 1/2 for some convex polygons, the derivative at this point can be evaluated as

P4

(P3-P2)

P'(I/2) = 1 (P4-P,)+ )j

(9)

Thus, the top of the polygon is tangent to the curve at u = 1/2 only if P,-PI is parallel to P3-P2. This special case is a plane curve and corresponds to the PC approximation to the conic defined by these constraints. An important feature of the B~zier and B-spline is that the curve is guaranteed to lie within the convex hull of its defining polygon. While this is not strictly the case for the present polygonal representation, it is almost true. A PC defined in this manner very closely mimics the polygon. For this polygonal representation

5

P~ Mp =

Figure 2. Polygonal representation o f a multisegment curve

,I,, (u) = ( 1 - . ) 3 , ~2 (u) = 3u(1-u) 2 , ~3 (u) = 3u2 (l-u), e, (u) = u 3

--8 40

4 -0 0

f! tl

0)

Xp =

P4 J

or, using the blending function interpretation, (0~u~
(4) P2

P"

Examining P(u) and P'(u) at the segment endpoints (u = 0 and u = 1) yields P(0)=P, , P(1)=P4 P'(0) = 3(P2-P,), P'(1) = 3(P4-P3)

-

so that the curve is shown to be tangent to the polygon at PI and P4. Points P2 and P3 do not lie on the curve. The idea of defining curves by specifying polygons proved to be very user-oriented. The only dissatisfaction expressed by designers concerned the lack of conformity between the polygon and the curve. In B(~zier'sapproach, this situation tends to worsen as the order of the polynomials increases. In the case of the PC, only the middle segment of the polygon is not 'tied to the curve'. Using B-splines3 improved the conformity between the curve and the polygon, but the middle segment still tended to float above the curve. The convex hull and variation diminishing properties were nice, but designers still had some problems in obtaining the desired curve without iteration. In an attempt to improve this situation, the following hypothesis was employed: since the polygon legs were proportional to the endpoint derivatives, reducing the constant of proportionality should bring the middle segment down onto the curve. A value of 1/4, ie, P'(0) = 4(P2-P, ) P'(1) = 4(P4-P3), (6) appeared to cause the middle segment to be tangent to the curve at its midpoint (Figure 1). To investigate this result analytically, the midpoint of the middle segment is written as (7) Ps = 1 (p= + P.3)

26

Closed

- - k2

(5)

P4

P,

P4

PI

Figure 3. Example contrasting open and closed curves v B14

B13

O'

B12

o,

B24

B34

0

0

844 o

iB23

I E~3

XB22

['B32

x

x.

I B43 o

B42

Bll 0

'0

0

0

B21

B31

B41

mU

Figure 4. 5chematic diagram o f polygonal patch representation

computer=aided design

P(u) = ~; •i(u)Pi /=-1

(11)

where * , (u) = (1-2u)(1-u) 2

(u) = 4u(1-u)' % (u) = 4u 2 (l-u)

(12)

¢ 4 (u) = (2u-1)u 2

This form of representation appears to be a good compromise between interpolation and approximation. What's more important is that it provides a good basis for graphically constructing a well behaved curve satisfying practical constraints. This scheme can be used to define a string of PC curves possessing both Co and Ct continuity. Let l~ be an open polygon defined by N vertices where N is an even number /> 4. The example shown in Figure 2 has N = 8 and results in N/2 - 1 = 3 segments. There are N/2 - 2 interior segment joints indicated by tic marks between P3 and P4 and again between Ps P6. The designer is free to select the location of the segment endpoints (ie, the points of tangency as a fraction of the segments I P4-P3 I and IP6-Ps I. The specification of these N/2 - 2 k-factors (0~
SURFACES

The polygonal representation is logically extensible to PC patches. A PC patch may be expressed in matrix form as P(u,v) = UMBM T VT

(13)

where the elements are analogous to the case of a curve with the geometry-dependent quantities being restricted to the 4 x 4 B matrix. The 16 vector elements of B are necessary to specify the patch completely. Consider the schematic of the patch shown in Figure 4. Specifying the patch boundary curves accounts for 12 vectors distributed along the patch perimeter. The polygon vertices are elements of the B matrix as indicated in Figure 4. Thus, columns 1 and 4 of the B matrix represent the boundary curves u = 0 and u = 1, while rows 1 and 4 represent the boundary curves v = 0 and v = 1. The four interior vectors require further consideration. Intuition and experience lend to the suspicion that these vectors are related to the corner point twist vectors. Evaluating the mixed derivative Puv (0,0) yields

Puv (0,0) : 16(B22 + B,, - B , 2 - B 2 , )

(14)

This expression can be rearranged to yield B22 as a function of the corner point conditions. 1 [Pu(0,0) + Pv(0,0)] +11 Puv(0,0) B22= P ( O , O ) + ~-

(15)

B32 = P(1,0) ÷ ¼ [Pv(1,0)-eu(1,0)]

Puv(1,0)

B33 = P ( 1 , I ) - l [ P u ( 1 , 1 ) + P v ( 1 , 1 ) ]

+ i 1 Puv(1,1)

(16)

The elements of the B matrix are points which form an umbrella for the patch. Connecting the elements of B with straight lines produces a wire-frame model which closely approximates the patch (and vice versa). The interior segments (shown as dashed lines) portray the variation of the tangent vectors as they blend from boundary to boundary. Obviously, the B~zier or B-spline approach produces a similar network which can be interpreted in the same manner. As in the case of the curve, the difference lies in the degree to which the network mimics the surface. In the case of the curve, the midpoint of the polygon top was interpolated. The analogous situation for the patch is shown to be P(1/2,1/2) = ¥1 (B22 + B23 + B32 + B33),

(17)

ie, the patch midpoint is the average of the four interior vertices. The polygonal representation of C1 continuous rectangular networks of patches is a logical extension that is analogous to the treatment of multisegment curves. Figure 5 shows a 2 x 2 array of patches employing the polygonal representation. The points indicated by the o-symbols are assumed to be connected by straight-line elements. As in the case of curves, the points denoted by the x-symbols are located on the straight lines defined by the adjoining o-points. Relative positions of the x-points are determined by specifying the fractional values k or/. The constant ratios k and / satisfy the usual criterion for Ct continuity between patches, but the region surrounding an interior corner point suggests a possible problem. The corner point must lie on each of the indicated straight lines. Consequently, the surrounding four points must be coplanar, and this plane is tangent to the surface. Thus, simply specifying the o-points along with k and / will not guarantee Cl continuity. The example of Figure 5 illustrating the polygonal representation for Ci continuous surface also indicates the implied advantage of data compaction. Using 16 vectors for each patch would require 16 x 4 x 3 = 192 numbers to define the set of four patches. A first-level compaction accounting for Co continuity reduces the quantity to 7 x 7 x 3 = 147 numbers. Taking full advantage of the C~ continuity as shown would use 6 x 6 x 3 + 2 = 110 numbers. The issue of data compaction is important and can no O - - O - - O ~ X

! !

o

o

0

0

o

o

o

!

o

o

I

o

0 - - 0 - - 0

' i I

l

O

~

O

l

x

X

l !

o

o

0

0

~

o

o

i

o

o

o

l

0

,'

0 1

0

o

I

I

,

I

'

]

o

,'

k

Similarly, 1 [Pu(O,1)-Pv(0,1)] - 1 1 Puv(0,1) B23 = P(0,1) + ~-

volume 12 number I january 1980

Figure 3. Redundant data for multipatch surfaces with Co end C1 continuity

27

50

numbers for each patch, while Ct compaction yields

Unpocked

N-2) n = 12(1 + ~1 + ~1 + ~1 ) + (M +MN

(19)

,~ 4 o

~

:30

numbers per patch. Although C2 continuity has not been considered in this paper, it is easy to see that a C2 compaction would yield

Co Continuity

+ MN27+ (..M + N - 2 ) (20) MN numbers for each patch. Figure 6 illustrates the savings for an N x N square mesh. n=3 + 9

._~ 2o C1 Continuity •m 10 0

o o

I

I

5

10

I

I

15

20

C 2 Continuity I 25

REFERENCES

Mesh size (N )

I Peters, G J 'Interactive computer graphics application of the parametric bicubic surface to engineering design problems' in Barnhill, R E and Riesenfeld, R F (eds) Comput. Aided Geometric Des. Academic Press (1974)

Figure 6. Effect o f continuity considerations on storage requirements

longer be ignored. Extending the above consideration to a general M x N mesh of patches, an unpacked storage format would require 48 numbers for each patch. Applying Co compaction yields n = 27

+ 9 I'-+ '-)+ 3 M

N

2 B(~zier, P 'Mathematical and practical possibilities of Unisurf' in Barnhill, R E and Riesenfeld, R F (eds) Comput. Aided Geometric Des. Academic Press (1974)

(18)

MN

+

Gordon, W J and Riesenfeld, R F 'B-spline curves and surfaces' in Barnhill, R E and Riesenfeld, R F (eds) Comput. Aided Geometric Des. Academic Press (1974)

®

@

i : A UFACTUR[ [ C

Manufacturing Engineering Proceedings of lhe 2nd Jont Polylechn~cs Symposium. t t-13 June 1979, Lonchesler Polylechn~c. UK The aim of this symposium was to bring together industrialists, researchers and students in a common forum where their problems and achievements could be examined and discussed. Topics covered include: Machine tools; Bearings and tribology; Computers/Microprocessors; Forming and fabrication; Electrochemical machining; Material removal and processes.

Further information, available on request from: The Sales Manager IPC Science and Technology Press Limited, PO Box 63, Westbury House, Bury Street, Guildford, Surrey, England GU2 5BH

July t979/cloth/260 pages/O 86103 0t3 3 £t5.00 net {S39.00]

28

computer-aided design