Computer-aided geometric design and panel generation for hull forms based on rational cubic Bézier curves

Computer-aided geometric design and panel generation for hull forms based on rational cubic Bézier curves

Computer Aided Geometric Design 10 (1993) 53-i 537-549 North-Holland COMAID 331 Computer-aided geometric design and panel generation for hull...

939KB Sizes 0 Downloads 68 Views

Computer

Aided

Geometric

Design

10 (1993)

53-i

537-549

North-Holland

COMAID 331

Computer-aided geometric design and panel generation for hull forms based on rational cubic Bkzier curves J.S. Kouh and S.W. Chau Institute of Naval Architecture and Ocean Engineering, National Taiwan University, Taipei, Taiwan. ROC

Received April 1992 Revised January 1993

Kouh, J.S. and S.W. Chau, Computer-aided geometric design and panel generation for hull forms based on rational cubic Bezier curves, Computer Aided Geometric Design 10 (1993) 537-549. For generation of hull forms, a method using rational cubic Bezier curves is chosen because of their superior segmentwise local-weighted behavior. A hull form is defined by two sets of grid lines-transverse grid lines arranged in length direction and longitudinal grid lines arranged in depth direction. Transverse lines are first defined, the points on the transverse lines with the same curve parameter values are then fitted to define longitudinal lines. Thereby, each curve is described by a rational cubic Bezier curve in space. The bilge, flat side and flat bottom can be defined precisely and more flexibilities are provided for defining bow and stern regions. By the way, a hull surface can be generated which is useful to produce desired data for hydrostatic or panel generations. Keywords. Rational cubic Bezier curves; hull form generation;

surface interpolation.

1. Introduction Rational spline functions provide powerful tools for defining free-form curves and surfaces and some analytic primitives such as conic sections that are all widely used in engineering ([Tiller ‘83, Piegl & Tiller ‘871). These superior properties have led them to be adopted for representing ship lines and surfaces ( [Kouh & Soding ‘851). The major advantage of the rational spline method stems from the fact that it requires only a single mathematical formulation for the precise definition of both geometry shapes stated above. There are two approaches in modeling smooth ship surfaces by means of computer applications: one approach is representation and the other is design. The representation Correspondence to: Institute of Naval Architecture Taiwan, ROC. Email: [email protected]. 0167-8396/93/$06.00

@ 1993 -

and Ocean Engineering,

Elsevier Science Publishers

National Taiwan University,

B.V. All rights reserved

Taipei,

J.S. Kouh. S. U’. Chau / HuN forms based on cubic Bkier

538

curves

approach is processed by interpolation on the basis of an existing line drawing consisting of a set of sectional curves, while the design approach deals with the generation of a fully new hull form. Due to the different initial conditions, they are generally solved by separated mathematicai methods or computer codes. The generation approach is considered in this paper. To this end, rational cubic Blzier curves are chosen as the underlying mathematical theory, because they are suitable for creative design by interactive manipulations. A hull surface is generated by the lofting surface concept ([Soding ‘67, Kouh & Soding ‘851) and the depth function method ([Kuiper ‘7011, which are much easier for users to understand than direct surface definition ( [Fog ‘84 f ). A rational Bizier curve is defined by controt points and weights. It preserves the convex-hull property which makes it convenient to use, and one does not need to specify the intrinsic properties concerning derivatives etc. as in the definition of a rational spline curve. In comparison with rational B-spline curves, rational Bezier curves can define a curve segment by segment while continuities between the adjacent segments can be ensured by automatically generated control points calculated from continuity conditions between the two segments. This is a great advantage in any step-by-step design process.

2. Mathematical formulation for curves

2.1. Definition of a rational cubic Bkier

curve segment

A rational cubic Blzier curve segment is defined by

where B,s (t) = (6/i!(3 - i)!)t’( 1 - t)3-i are Bernstein polynomials of degree 3. The points Pi are called control points of P(t) . They form a so-called control polygon. The values u/; are the weights of control points Pi.The restriction IJ$ > 0 is made here to ensure that the denominator of ( I > is positive for t E [O, 11 and P(t)will hence be free from singularities in this interval. A nonrational cubic Bizier curve segment is thus a special case of a rational cubic Bezier curve segment with all weights E$ = 1. While the denominator of (1) is a scalar, the numerator is a vector containing three Cartesian coordinates x, y and z. By matrix formulation, ( I) can be expressed by

P(t)

=

(2)

(3)

J.S. Kouh, S. I+: Chau / Hull f&m

based on cubic BPzier curves

(1)

Fig. I. A rational Bizier curve segment.

339

ControlPolygon

(2) wo=

l.W,=

l.W2=

l.W,=

(3) wc=

l.Wt

=

l.W,=

z.w,=

1

(4) wo=

l.W,

=lO,W*=

t.w,*

1

1

Fig. 2. Effect of the weights.

where C(t) = [T]]M][e]T, D(t) = [T] [M][W]r. transpose of a matrix. Here l IT] = [ 1 t t2 t’] is called the parameter row vector, is called the transformation

The superscript

T means

the

matrix,

L-1 3 -3 l] [B] = [IV,P, W,P, &Pz IV3P 3] is called the geometric coefficient matrix, and l [W] =: [ WQ IV, Wl E’s] is called the weight row vector. A rational cubic Bizier curve segment is defined by a control polygon PoPiPzP3 with all weights equal to I as shown in Fig. I. The endpoints of this rational cubic Bezier curve segment are PO and P3 at t = 0 and t = 1 as also shown in Fig. 1. The effects of weights are shown in Fig. 2: the curve segment shape can be pulled away in the direction where the weight is concentrated. l

2.2. Geometric properties of a r~~io~~l Bhier curve segment In a computer-aided ship hull design system, besides the offsets of ship lines, the geometric properties such as tangent vectors, second-derivative vectors and curvature vectors are also needed. The tangent and second-derivative vectors provide the curvedesigning and curve-fitting process with a means to ensure the continuity between adjacent segments. In spite of the curve-creating process, the curvature vector can offer a guide to identify whether the curve is sufficiently smooth or not. The mathematical formulations of these vectors are discussed below. From equation (31, a tangent vector T(t) of a rational cubic Bezier curve segment is determined by I”(t) =

ZP(t) =

C'D- CD’ o2

(4)

where C’(t)

= -&t)

= [T] [M]‘[B]=,

D’(t) = $D(t)

= [T fl IW’[W I T T

J.S. Kouh. S. W Chau / Hull fimns

540

I -3

ElMI’ =

3

0

0

-36 -129 -96

0 3

0

A second-derivative by S(t)

=

0

0

based on cubic Bkier

curves

I .

0

vector 5’(t) of a rational

$P(i) = -&) = c”

cubic Bezier curve segment is determined

- 2P’Di

- pp

(5)

D

where

C”(t) =

-&r) = [Tl vfl”[~lT, 6 6 -12 18 -18 -6 0

and a curvature

0

vector K(t)

D"(t)

=

=

,T(t),3

[M]“[WJT,

0 6

00 is determined

by

T(t) x S(t) K(t)

= [T]

(6)

-

The symbol x between 2’ and S denotes the vector product. The tangent vectors, secondderivative vectors and curvature vectors at the endpoints are then T(t

= 0) = 32(Pi

T(t = 1) = 32(PJ

-PI)),

(7)

- Pz),

(8)

S(t = 0) = S(t

= 1) =

K(t

= 0) =

-P*)(l-3%)), + W2(Pz -P3)

-P3) T(t = 0) x s(t

= 0) ’

IT(t = 0)13 K(t

=: 1) =

T(t = l)xS(t= (T(t = 1)13

2.3. Subdivision

1)

(9) (10) (11) (12)



of a‘curve segment

Subdivision is to divide a curve segment into two sub-segments while the original segment shape remains the same. The advantage of subdivision is that it allows us to change only part of original segment shape whilst keeping the others unchanged. It is especially useful for fitting a curve which needs some local shape manipulation. A curve segment can be subdivided into two sub-segments by a parameter t in the interval [0, 11. In Fig. 3, the point P(t f divides not only the curve segment P(O), P( 1) into two segments but also the control polygon into two sub-control polygons. The new contro1 points can be

J.S. Kouh. S. WT.Chau /Hull

wo t

forms based on cubic Bkier

OO I ‘j”wo

=

curves

Ml

s w,o ’ ‘W,

P,”

0 Fig. 3. Subdivision

t=1 of curve segment.

P

calculated from the intermediate point P: (t ) . The points Pi (t ), Pk (t ), Pz ( t ), Pi (t ) form the control polygon corresponding to the arc P(O)-P(t) and P~(t),P:(t),P:(t),~(t) form the control polygon corresponding to the arc P(t)-P( 1). The weights of new control points can be calculated from the intermediate weights Wjr(t). The weights W:(t), W;(t), W:(t), I+$(0 are the weights corresponding to the arc P(O)-P(t) and W:(t), W:(r), W;(t), LVt(t) correspond to the arc P(t)-P(1). The relation between these sub-control points and weights are shown in Fig. 3. According to [Farin ‘831, the intermediate weight M;!(t) and point P:(t) are defined by

W{(t) =

2

(13)

&+jB,'(t),

j=O (14)

where Pp (t) = Pi (t ) are the old control points. 2.4. Degree elevation of a curve segment

Degree elevation is to increase the order of a curve segment but not to change the curve segment’s shape. If different order primitives are used in a CAD system, it is more practical to use a unified mathematical formulation. Ship lines are composed of straight lines in the flat sides and the flat bottom, of conic sections in the bow, stem and bilge regions and free-form curves in other zones. Straight lines are usually defined by curve segments of degree one, conic sections by degree two and free-form curves by degree three, but we can elevate them all into curves of degree three. So, all the primitives can be dealt with the same algorithms for degree three without other modifications or additional efforts. If PI), . . . ) P, and Pa,...,Pz,l are two control polygons with corresponding weights U: and Wi* that describe the same rational Bezier curve segment, then they must satisfy the following relationship derived in [ Farin ‘831: Pf = Pf_,

(“lJyi),

i=O ,..., n+l,

(15)

J.S. Kouh, S. I+‘. Chau / Hull forms based on cubic Bkier

542

curves

Fig. 4. Degree elevation of curve segment.

~wq+$i),

i=o

)...)

n+l.

As shown in Fig. 4, if a rational quadratic Bezier curve segment is determined by control points PO,Pi, Pz with weights I@&Ct;, Wl, then the corresponding rational cubic Bezier curve segment is defined by

P; = PO, P; = PI, (17)

3. Conic conditions Conic conditions are discussed here in order to define the bilge, bow and stern parts exactly, which are generally composed of conic sections. To let it be handled more easily, a rational quadratic Bezier curve segment is chosen for this purpose. Then the degree elevation stated above can be applied to upgrade the rational quadratic polynomial into the cubic polynomial, Thus only an unified formulation of a curve segment is required in the computer program. If there are control points Pa, Pi, Pz with weights we Z 1, WI = l/k, Wz = 1, the kind of conic sections is determined according to [Faux & Pratt ‘793 as shown in Fig. 5 by k> 1,

ellipse,

k = 1,

parabola,

(18)

0 < k < 1, hyperbola. The conditions for a circular arc besides k > 1 are m The radius of the arc is R = ,/(l

+ 4b2)/4b.

= Pi Pz and b = d-/2. (191

J.S. Kouh. S. W. Chau / Hull forms based on cubic Bkier curves

h

A

Y

543

PI =(0.5.2)

Hyperbola 4

=

l/5

Porobolo k=l

X 0

Po=(O.O)

p2

=(I

w2 = 1 WOE1 Fig. 5. A conic section.

u;+2

.O)

p,,+,

2 ,,+Z

Fig. 6. Curve fitting by a rational cubic BCzier curve.

3.1. Properties of rational cubic Btkier curve segment The properties of rational cubic Bezier curve segment can be summarized as follows: 1. Nonrational cubic Bezier curve segments are a special case of rational cubic Blzier curve segments with all weights I+: = 1. 2. The curve shape is determined not only by control points, but also by the weights. The extra degrees of freedom offer more flexibility in controlling the curve segment’s shape. 3. The values of the weights are relative to each other. The curve segment will not change if they are all multiplied by a value greater than 0. 4. Just like nonrational Bezier curve segments, rational Bezier curve segments imitate the shape of control polygon. 5. Rational BCzier curve segments are geometric transformation (translation, rotation, scaling and projection) invariant, i.e. the transformation of control points is equivalent to the transformation of the segment. 6. Subdivision is a useful tool if only a small part of cume segment has to be modified. 7. Like free-form curves, straight lines and conic sections can also be defined exactly. If degree elevation is used, an unified formulation can be obtained, no matter what kind of primitive (straight line, conic curve, free-form cun-e) is dealt with. 3.2. Smooth curve fitting If there are n + 1 different data points Qe,.. . , Q, in space to be passed by a segmentwise connected curve, n rational cubic Bezier curve segments are to be specified to describe this curve. Consequently, 3n + 1 control points PO,. . . , P3,, and corresponding 3n + 1 weights Wc,. . . , W3, must be determined by continuity conditions between adjacent curve segments as shown in Fig. 6. The global parameters corresponding to the data points are denoted by uo = O,.. ., u,, = 1. In order to enable us to solve equations Qo,...,Q, easily, the parameters ui and weights PI; are determined by user’s choice. The details will

J.S. Kouh. S. LG..Chau / Hull forms based on cubic Bhxer curves

544

Fig. 7. Relation between local parameter

I and global parameter u.

be discussed in Section 3.2. Here, only the unknowns Pa,. . . , PJ~ are considered. three continuitv conditions which come into question are: 1. Co continkty condition. P3i = Qil

condition.

Ti(t = 1) = Ti+l(t This can be expressed f%

=

Ui+

i.= 1,

= 0),

equivalently

l)l,fi

1 -

(20)

i = O,...,n.

2. C I continuity

The

.,n - 1.

(21)

by

P’(t = O)lofi + 1

=

lli

Ui+2

(21a)

ui+ I

-

or 3(Wi+21w3i+3)

(P3i+3 ui+l

-

PJi+Z) = 3(6+4/Wi+3

-

1(P3i+4 Ui+2

ui

-

ui+

I

P3i+3

)

(21b)

where t is the local parameter running from 0 to 1 for each curve segment and u is the global parameter for the whole curve. The relation between t and u is expressed by t=

U ui+l

lli -

(22) ui

(see Fig. 7). 3. C2 continuity Si(t

condition.

= 1) =Si+l(t=O),

This can be expressed P”(t (ui+l

= l)j,f -

ui)’

i

i=

equivalently =

Pr

(t

(-5(i+2

= -

l,...,

n-l.

(23)

by O)lof

i+l

ui+l

J2

(23a)

J.S. Kouh. S. W Chau / Huil forms bawd on cubic BPzier curves

545

or 6

1

(Z(i+i - Ui)’ “jr+3

(

@>i+l tp3f+I + w3i+Z

1

- P3i+3)

(P31+2

-

p3i+31(1e~))

6

= (l(j+z - Z(j+i )*

ct5i+5(P3i+5

-

P31+3)

@tji+3

+ “ii+a(P3,+~-P3,+3)(1

The boundary conditions for starting points (~(0 = 0) and endpoints specified as follows. (i) A tangent vector is given by T,J(u = 0) = T, (ii) A second-derivative So(u = 0) =S,

or

T,(u

(23b)

-2)).

(l(,, = 1) can be

= 1) = T,.

(24)

vector is given by or

Sn(u=

l)=S,.

From eqs. (20), (21b), (23b), (24) and (25), a system of linear equations 3n + 1 unknown control points PO,. . . , Pjn can be built up: [Al(3n+l)x(3n+l)[Xl(3n+l)x3

= [Blc3n+1,.3

(25) for the

(26)

where [A] is the matrix of geometric coefficients, [X] is the matrix of control points, and [B] is the matrix of geometric boundary conditions. Using the Gaussian elimination method, all the control points can be obtained from (26), which completes the curve-fitting process.

4. Hull surface generation 4.1. The lofting surface concept and the depth frtnction For the purpose of design and representation, a hull surface is generated by a lofting surface concept. A lofting surface is constructed by specifying some master curves (crosssectional curves) which describe the main geometrical features of the surface shape. For more flexibility, the master curves are not necessarily confined to a plane: they can be any space curve. In this way, master curves are arranged in the ship’s length direction as frames supporting the ship hull to be defined. Longitudinal curves are then generated by fitting the points of equal global parameter values u on the master curves, so that a single three-dimensional surface can be swept out along the master curves from bottom to top, as shown in Fig. 8. Just like master curves, all longitudinal curves are described by rational cubic Bezier curves in the parametric space following [Mortenson ‘851, which is used in expressing the relation between the local parameter t or the global parameter u and the three Cartesian coordinates _Y,_v, 1.

546

J.S. Kouh. S. f+: Chau / Hull forms based on cubrc Bixer

*

G=&+qy+$*

curves

1

V U’

1-7: 8

-

Master 13

Curves

: Longitudal

Curves

Fig. 8. Master curves and longitudinal curves.

4.2. Master curves Master curves are defined in the depth direction. The boundary curves on a general hull surface such as profile curves, flat side curves and flat bottom tunes must be specified as master curves, since otherwise the hull surface cannot be exactly described as expected. Master curves can be defined in two different ways: the generation approach and representation approach. In the design approach, curves are defined segment by segment and the continuity between the adjacent cume segments is ensured by control points which are determined to satisfy with the prescribed continuity conditions and which cannot be specified by the user. In the representation approach, however, a curve-fitting process is used to determine the master curves from the ship lines. The distribution of the parameter in the master curve is determined by the distance between data points in order to prevent local irregularities caused by nonuniform spacing of the data points and to simplify the computation process. 4.3. Longitudinal curves After dividing all master curves with an equal number of points, we can generate longitudinal curves by fitting a curve through the points on the master curves with equal parameter value. The distribution of the parameter on a master curve is determined by arc length so that longitudinal curves are spaced more uniformly on the hull surface. However, if knuckle lines occur in the length direction, the distribution of the parameter on master curves is determined by a uniform parameter interval in order to describe the knuckle lines exactly. Because of the demand for fitting smoother longitudinal curies, the choice of the parameter distribution at the data points is the same as in the process of defining master curves, i.e. by the distance between data points. The weights of all control points are given by a linear interpolation method to avoid local concentration on the longitudinal curves. The weights of data points must be specified first to control the curve shape. Linear interpolation is then applied on the other control points to determine their weights. At the endpoints or internal points where the boundary curves (also master curves) pass through, prescribed boundary conditions are specified in order to fit the longitudinal curves properly for the desired hull form. 4.4. Surface interpolation Surface interpolation is an important calculation method to produce data for further applications, such as grid generation for CFD methods or hydrostatic computations. Because longitudinal curves extend almost in the length direction of a ship. they may

J.S. Kouh. S. W. Chau / Hull forms based on cubrc Bkier curves

Fig. 9. Approximation

547

of hull surface by small panels.

well be parallel to the waterline. They are hence not suitable for calculating intersection points with planes parallel to the longitudinal axis of a ship to generate ship plans such as a water plan or a sheer plan. To overcome this disadvantage, the concept of grid points as in the finite element method is used. Thereby, many longitudinal curves are generated as described above and they are subdivided into many line segments. The endpoints of each line segment are called grid points. By connecting the grid points of two adjacent longitudinal curves, a hull surface can be approximated by a number of small quadrangular panels bounded by four line segments as shown in Fig. 9. Each panel is again divided by connecting two diagonal points into two triangles (see Fig. 9), which can be defined uniquely by a plane equation through their three vertices. In this way, intersection of the hull surface with a specified plane is carried out by cutting the specified plane through these triangular planes. Obviously the quality of the resulting surface interpolation is proportional to the number of small panels used.

5. Results of hull form generation and panel creation We have made some figures in order to demonstrate the results from the developed software system based on rational cubic Bezier curves. Figure 10 shows the projections of the master curves used for generating the hull form of a tanker. In order to describe the bow part exactly, a master curve is especially defined near the stem profile. Furthermore, conic sections are specified there while the longitudinal curves are generated. The interpolated ship lines are shown in Fig. 11, while Fig. 12 shows a perspective view of interpolated waterlines, sectional curves and the input master curves. The result of an automatic generated panel model is shown in Fig. 13 which can be used as a pre-processor for e.g. flow calculations around ship hulls.

6. Conclusion A software system based on rational cubic Bezier curves for geometric modeling of hull surfaces has been built. It can be seen that only few master curves are required to define a complete ship hull. This can be a very useful tool for hull form generation in order to produce data for further applications such as hydrostatic or potential flow computations.

J.S. Kouh. S. L+‘.Chau / Hull forms based on cubic Bkier

Fig. 10.

Fig. 11.

curves

J.S. Kouh. S. U: Chau / Hul/_ibrms based on cubic Bt;:icr tunes

549

Fig. I2.

Fig. 13.

Acknowledgements

The authors wish to thank the National Science Council, Republic of China, for the financial support under grant No. NSC 8 l-04~3-EOO2-09. Thanks are also due to Mr. C.H. Ho for preparing the figure of panel model.

References Farin, G. (1983), Algorithms for rational BCzier curves, Computer-Aided Design IS, 73-77. Faux, I.D. and Pratt, M.J. (1979), Co~pufational Geometry fir Design and ~~~a~l~~cture,Ellis Hotwood, Chichester, UK. Fog, N.G. ( 1984). Creative definition and fairing of ship hulls using a B-spline surface, Computer-Aided Design 16, 225-229. Kouh, J.S. and Soding, H. ( 1985), Rational cubic splines for ship hull representation, ICCAS, 12-23. Kuiper, C. ( f 970), Preliminary design of ship lines-mathematical methods, J. Ship Research, 52-66. Monenson, 1M.E. (1985), Geometric ~~~odeii~g,Wiley, New York. PiegI, L. and Tiller, W. (1987), Curve and surface constructions using rational B-splines, Computer-Aided Design 19, 485-498. Soding, H. ( i967), Das Straken von Schiffslinien mit Digitalrechnem, HANSA, Nr. 16, 1386-I 393. Tiller, W. ( 1983). Rational B-spline for curve and surface representation. IEEE CG&A, September, 61-69.