Smoothing surfaces using reflection lines for families of splines

Smoothing surfaces using reflection lines for families of splines

Smoothing surfaces using reflection lines for families of splines E Kaufmann and R Klass In car body design there exist various possibilities to desig...

380KB Sizes 7 Downloads 65 Views

Smoothing surfaces using reflection lines for families of splines E Kaufmann and R Klass In car body design there exist various possibilities to design surfaces with given boundaries. In many cases the resulting surtaces are not automatically smooth enough. A method is presented to define reflection lines on special splines as, for example, the intersection curves of a surface and a family of planes. These reflection lines represent surface irregularities in a very sensitive manner. If the reflection lines have to be changed, a suitable new family ot splines is calculated. These smoothed splines can be used to create a smoothed surface. The resulting algorithm has been implemented in a CADCAM system. computer-aidedgeometric design,surfacedesign,surfacesmoothing, reflection lines, splines Local or global irregularities of surfaces in CAD can be detected by several methods. Some of these methods use curvature properties t. A very simple way is to display curves of constant Gaussian curvature using colours. Others use the angle between rays from lightpoints or lightlines and surface normals z~ to define isophotes or reflection lines on surfaces. If the surface has to be smoothed, one possibility is to approximate by use of polynomials with standard B6zier methods 4's. Often it is necessary first to smooth the points that are used to define the surface by interpolation ~'. These methods improve the quality of reflection lines or isophotes, i.e. the quality of the surface. Another way to smooth surfaces is to control the reflection lines directly. That means the new surface has to be calculated out of the old one using a given correction of the reflection lines. This has been done by Klass 3. In this paper a new kind of reflection lines is introduced that seems to be very useful in practice. These reflection lines are defined for a family of splines. The splines represent the surfaces that have to be smoothed, and usually they are either parameter curves or intersection curves of the surfaces with a family of planes (see Figures 1 and 2).

REFLECTION LINES FOR SPLINE FAMILIES Definition Suppose a family of planes that are parallel to a Daimler-Benz, Abt. ADTK, D-7032 Sindelfingen, FRG

312

common vector V is given, and in each of the planes there is a C 2 spline. The splines need to be locally convex, i.e. their curvature must be nonzero everywhere. If the right orientation of the planes is chosen, it may be assumed that the curvature is positive. Then for each spline the oriented angle 0~ between V and the spline tangent vector (see Figure 3) is strictly monotonous. If one particular value of ~ is fixed, there is no more than one point on each spline where the angle of the tangent equals ~. If these points are connected by line segments where some 'natural order' of the splines is assumed - the resulting polygon is called the reflection line that corresponds to angle ~.. In Figure 2, the reflection lines for seven equally distributed angles of a family of parallel sections of a car body (see Figure 1) are shown.

CONTROL OF TANGENTS VIA REFLECTION LINES To improve the reflection lines needs • a domain on each spline where changes are permitted (local control) • an adequate number of reflection lines that pass through this domain • a corrected version of each reflection line, prescribed by the designer Now the splines have to be adjusted so that their new reflection lines (for the same angles) match the prescribed ones. This is done for each spline seperately. The method can be described most conveniently if the spline is represented in terms of B-splines. Let the spline be given by s(u) =~C,NI~(u)

(1)

where NI~are the normalized B-splines of degree n, with multiple knots in the end points of the spline, and C~ are the control points (see Boehm et al.7). Let the knots uj, uk mark the end points of the domain of change. The adjusted spline g=s+d

(2)

is obtained by addition of a difference spline

0010-4485/88/060312-05 $03.00 © 1988 Butterworth & Co (Publishers) Ltd

computer-aided design

Figure 1. Car body described by surfaces k-n

d(u)=

~

1

e,N~(u)

(3)

i=i

ei = hiWi

(4)

where the Wi are fixed unit vectors that define the direction of change and the hi are scalar parameters to be determined. Of course, only those B-splines are used who support is inside the domain of change (see Figure 4). There are several reasonable ways to choose the directions of change, e.g. • W, in the plane of the spline, orthogonal to the tangent s'(u). • W~ = W, a constant vector in the plane not parallel to any s'(ui), i = j , . . . , k . Consider a reflection line for angle ~ together with its corrected version. Let u and ~ be the parameters of those two spline points where the original and the corrected reflection line crosses the spline, respectively. This means the tangent vector s'(u) has angle ~ with V, S'(L~) will in general have a slightly different angle

volume 20 number 6 july/august 1988

with V, and the adjusted spline g should be determined such that g'(6) again has angle ~ with V. Choose a vector q in the plane of the spline orthogonal to s'(u). Then the condition on ~ can be expressed by g'(6).q=0

(5)

By equation (2) this is a linear equation for the first derivative d'(6) of the difference spline. On the other hand, the standard formula d'(u)=~

n

( e i - ei-1)N~-l(u)

(6)

Ui+ n - - U i

together with equation (4) describes d'(6) as a linear function in h = ( h i ..... hk-n 1). If both of these are combined, then this gives a linear equation L(h)=0

(7)

whose coefficients can be worked out easily. Suppose m reflection lines for angles ~1..... (~m pass through the domain of change, together with their

313

I I

I

J

Figure 2. Reflection lines for parallel horizontal .sections oi car body in Figure 1

V

Figure 3. Definition of spline reflection lines

314

computer-aided design

N.] (u) I

where p is the unit normal vector of the plane. In the case of cubic splines it is sufficient to demand positive curvature at the knots ui,..., uk. This can be seen from the following arguments. It is assumed that the B~zier polygon of every segment of s(u) between the knots uj and uk intersects lines parallel to W no more than once. This property is preserved in g(u). For such cubic segments the curvature is positive in both end points if and only if the polygon is convex (use equation (10) and the calculation of derivatives from B~zier points in Boehm et al.7). If the polygon is convex, the spline cannot have turning points (by the 'variation diminishing property '7) and is thus locally convex. As the denominator in equation (10) is positive everywhere, the sign of the curvature of the adjusted spline g equals the sign of

N~+ I [u)

ui Figure 4. B-spline modification

K(u) = (~'(u) x g"(u))'p

Uk

= (s'(u) x s"(u) + d'(u) x s"(u)

corrected versions. Then this gives a system of linear equations Ll(h) = 0 ..... Lm(h)= 0

(8)

for the parameters h = (hi,..., hk_n_l). Depending on the number k - j - n of parameters h~, the number m of reflection lines, and their distribution in the domain of change, the system (8) may be under- or overdetermined. Therefore the method of least squares is applied to minimize the function G(h) = (giLl(h)) 2 + " " + (gmLm(h)) 2

(9)

where g~ are positive weights, which can be chosen equal 1 for a first try. Finally, the parameters h of a minimum of G determine the adjusted spline g by equations (2)-(4). In practice, the best results are obtained with slightly overdetermined systems. In case the curvature of the spline varies much over the domain of change, the weights should be unequal, e.g. weight g~ proportional to the radius of curvature in the point s(t3,).

The solution calculated in the previous section is often very sensitive to the given corrections of the reflection lines. Without additional precautions, oscillating splines may be obtained, which are useless for the purpose here. To avoid this it is required that the local convexity of the original spline be preserved in the adjusted spline. In other words, it has to be guaranteed that its curvature is positive everywhere. It will be shown how this is achieved in the simplest case where the sp[ines are cubic and the directions of change W~ = W constant. The (signed) curvature of any planar curve s(u) is

IIs'(u)ll ~

volume 20 number 6 july/august 1988

+ s'(u) x d"(u))-p Here equation (2) was used, and the term d ' x d" vanishes due to W~ = W = constant. Substituting equation (6) and the analogous formula for the second derivative d" (u), for u fixed K(u) is again a linear function in the parameters hj hk_n_ 1 of the difference spline. As it is sufficient to guarantee positive curvature at the knots, choose some small 8 > 0 and demand the inequalities .....

K(ui)~> 8

i=j,...,k

(12)

This is a system of linear inequalities for the parameters h = ( h i ..... hk-n_l), which describes the permitted solutions. Thus the quadratic function G(h) in equation (9) has to be minimized under the linear restrictions in equation (12). This is a well known problem in quadratic programming, which can be solved by standard methods 9.

APPLICATION FOR SMOOTHING SURFACES

PRESERVATION OF CONVEXITY

C(u) = (s'(u) x s"(u)).p

(11)

(10)

Now this method is applied for smoothing surfaces. In car body design the standard case is that many surfaces have to be smoothed simultaneously. On these surfaces there are boundary conditions, i.e. there are regions on the surface that are not allowed to change. The method proceeds in the following steps: • Define the domain where the surfaces may be changed. • Calculate a suitable family of splines on the surfaces that cover the desired domain. (This can be done by intersection with planes or using parameter lines.) • Display the reflection lines of the splines. • Improve the reflection lines and calculate the new splines.

315

DISCUSSION

Figure 5. RooJ of a car (le~t half)

i II

If the family of splines does not consist of parameter lines, the new surface cannot be produced by interpolation. It is necessary to 'lift' the (lid surface in the direction of its normal vectors to the new splines. the correct distances of lifting can be estimated using the differences between the improved family of splines and the old surface. This method works, but the results are not always good enough. 5o it would be necessary to try other methods of lifting surfaces to given families of splines (compare Pratt'). Another remarkable feature of these reflection lines of splines is that they always look very similar to the physical reflection lines of surfaces. This means that if the reflection lines of splines have been improved, those of the surfaces have improved, too. The method described in this paper is implemented in the CADCAM system Syrko at Daimler-Benz and has been used successfully to improve the quality of outer skin surfaces in car body design.

REFERENCES I Hoschek, I 'Detecting regions with undesirable curvature' Comput. Aided Geometric: Des. Vo[ 1 No 2 (1984) pp 183-192 Figure 6. Parameter lines of the roof and reflection lines

Ht

F

2. Poeschl, T 'Detecting surface irregularities using isophotes' Comput. Aided Geometric Des. Vol 1 No 2 (1984) pp 163-168 3 Klass, R 'Correction of local surface irregularities using reflection lines' Comput.-Aided Des. Vol 12 No 2 (March 1980) pp 73-78 4 Kjellander, J A P 'Smoothing of cubic parametric splines' Comput-Aided Des. Vo115 No 3 (May 1983) pp 175-179 5 Kjellander, I A P 'Smoothing of bicubic parametric surfaces' Comput.-Aided Des. Vol 15 No 5 (September 1983) pp 288-294

Figure 7. Reflection lines of modified spline family; maximum deviation of the splines 0.5 mm

6 Renz, W 'Interactive smoothing of digital point data' Comput.-Aided Des. Vol 14 No 5 (September 1982) pp 267-27O

7 Boehm, W, Farin, G and Kahmann, I 'A survey of curve surface methods in CAGD' Comput. Aided Geometrk Des. Vo[ 1 No 1 (1984) pp 1-60

• Lift the surfaces to the new splines or interpolate. In the example here the roof of a car is used (see

Figure 5). It is represented by a bicubic spline surface. The family of splines consists of parameter lines. Displaying reflection lines, the surface irregularities can be seen (see Figure 6). In Figure 7 the resulting splines can be seen after repeated correction of the reflection lines. In this case the new surface of the roof is calculated by standard C ~ interpolation of the improved family of splines 7, The maximal distance of the new surface from the old one is 9.5 ram.

316

8 Pratt, M J 'Smooth parametric surface approximations to discrete data' Comput. Aided Ceometrk: De.s. Vol 2 (1985) pp 165--171 9 Schitlkowski, K 'Nonlinear programming codes' in Lecture notes in economics and mathematical systems Springer, Berlin, FRG (1980)

BIBLIOGRAPHY Farin, G 'Some aspects of car body design at Daimler genz' in Farin, G ted) Surfaces in CAGD North-Holland, Amsterdam, Netherlands (1983)

computer-aided design