Discrete Coons patches

Discrete Coons patches

Computer Aided Geometric Design 16 (1999) 691–700 Discrete Coons patches Gerald Farin a,∗ , Dianne Hansford b,1 a Computer Science and Engineering, A...

288KB Sizes 12 Downloads 68 Views

Computer Aided Geometric Design 16 (1999) 691–700

Discrete Coons patches Gerald Farin a,∗ , Dianne Hansford b,1 a Computer Science and Engineering, Arizona State University, Tempe, AZ 85287-5406, USA b NURBS Depot, 4952 E. Mockingbird Ln., Paradise Valley, AZ 85253, USA

Received November 1998; revised April 1999

Abstract We investigate surfaces which interpolate given boundary curves. We show that the discrete bilinearly blended Coons patch can be defined as the solution of a linear system. With the goal of producing better shape than the Coons patch, this idea is generalized, resulting in a new method based on a blend of variational principles. We show that no single blend of variational principles can produce “good” shape for all boundary curve geometries. We also discuss triangular Coons patches and point out the connections to the rectangular case.  1999 Elsevier Science B.V. All rights reserved. Keywords: Coons patches; Variational principles; Discrete surfaces

Dedicated to Paul de Faget de Casteljau 1. Background One of the oldest surface problems in CAGD is the following: given four boundary curves, find a parametric surface x(u, v) with these as boundary curves. Some previous work on this topic include (Barnhill, 1982; Coons, 1964; Gordon, 1969). Let the given boundary curves be called x(u, 0),

x(u, 1),

x(0, v),

x(1, v).

Here we assume without loss of generality that the domain of the parametric surface x(u, v) is the unit square 0 6 u, v 6 1. A popular solution to this problem is the bilinearly blended Coons patch that interpolates to the given boundary curves: ∗ Corresponding author. E-mail: [email protected]. 1 E-mail: [email protected].

0167-8396/99/$ – see front matter  1999 Elsevier Science B.V. All rights reserved. PII: S 0 1 6 7 - 8 3 9 6 ( 9 9 ) 0 0 0 3 1 - X

692

G. Farin, D. Hansford / Computer Aided Geometric Design 16 (1999) 691–700

x(u, v) = (1 − u)x(0, v) + ux(1, v) + (1 − v)x(u, 0) + vx(u, 1)    x(0, 0) x(0, 1) 1 − v − [1 − u u] . x(1, 0) x(1, 1) v

(1)

From now on, we will refer to this method as the Coons patch. While the boundary curves x(u, 0), x(u, 1), x(0, v), x(1, v) may be totally arbitrary, in the early days the boundary polygons were discretized curves with many points on them. A more modern use for CAD/CAM would be to treat the boundary polygons as Bézier control polygons of an array of points bi,j ; i = 0, . . . , m, j = 0, . . . , n. A configuration for m = n = 3 looks like this: b00 b10 b20 b30

b01

b02

b31

b32

b03 b13 . b23 b33

Each bi,j is associated with a parameter pair (u, v) = (i/m, j/n), the Greville abscissae (Farin, 1996). The interior bi,j are defined by the discrete version of (1), which we will call the discrete Coons patch: bi,j = (1 − i/m)b0,j + i/mbm,j + (1 − j/n)bi,0 + j/nbi,n    b b0,n 1 − j/n − [ 1 − i/m i/m ] 0,0 bm,0 bm,n j/n

(2)

for 0 < i < m and 0 < j < n. Fig. 1 illustrates. Interpreting the boundary polygons as Bézier polygons, the resulting Coons patch would then be the control polygon of a Bézier surface that adheres to the given boundary information. In (Farin, 1992) it is shown that, in fact, the Bézier control points define the same patch as if Coons was applied to the transfinite boundary curves.

Fig. 1. Discrete Coons patches: an example. The given boundary vertices are marked dark; the computed interior ones are shown in a lighter color.

G. Farin, D. Hansford / Computer Aided Geometric Design 16 (1999) 691–700

693

Fig. 2. Permanence patches: an “optimal” control net for α = −0.257.

2. The minimum principle Coons patches minimize the twist in the sense that Z x2uv dS

(3)

U

is minimal exactly for the Coons patch, with the integral being taken over the unit square U . See Nielson et al. (1978). A surface x(u, v) minimizing this variational principle satisfies the Euler–Lagrange PDE xuuvv = 0.

(4)

The Coons patch is known to produce less than desirable shapes in many cases. It appears that the affinity of the Coons patch with zero twists accounts for these shape defects. Considering Fig. 1, it is clear that the discrete Coons patch is too flat—a “good” surface would look like the one in Fig. 2. 2 If we apply the minimum principle (3) to the discrete Coons patch, we have that n−1 m−1 XX



11,1 bi,j

2

i=0 j =0

is minimal if the bi,j form a discrete Coons patch, where 11,1 bi,j = bi+1,j +1 − bi+1,j − bi,j +1 + bi,j . 2 “Good” here refers to the traditional designer’s paradigm that the interior of a surface should not have different shape characteristics than those implied by the boundary curves. Clearly the horizontal straight line on top of the Coons patch from Fig. 1 is not implied by the circle-shaped boundary polygons.

694

G. Farin, D. Hansford / Computer Aided Geometric Design 16 (1999) 691–700

3. The permanence principle The Coons patch satisfies a permanence principle: let two points (u0 , v0 ) and (u1 , v1 ) define a rectangle R in the domain U of the Coons patch. The four boundaries of this subpatch will map to four curves on the Coons patch. One may ask what the Coons patch to those four boundary curves is. The answer: the original Coons patch, restricted to the rectangle R. In fact, all schemes whose constructions satisfy a variational principle share this permanence principle property. One can apply this principle to a 3 × 3 grid from the discrete Coons patch, such as bi−1,j +1

bi,j +1

bi+1,j +1

bi−1,j

bi,j

bi+1,j

bi−1,j −1

bi,j −1

bi+1,j −1

.

If the control points of the boundary of this 3 × 3 grid are known, then as a consequence of the permanence principle, the interior point could be determined by bi,j = − 14 (bi−1,j +1 + bi+1,j +1 + bi−1,j −1 + bi+1,j −1 ) + 12 (bi,j +1 + bi−1,j + bi+1,j + bi,j −1 ). A neater way of writing this is using a mask: bi,j =

−1 2 −1 2 • 2 . −1 2 −1

1 × 4

(5)

This mask is indeed the discrete form of the Euler–Lagrange PDE (4). The discrete Coons patch has (m + 1) × (n + 1) vertices; of these, (m − 1) × (n − 1) are unknown. Eq. (5) gives one equation for each unknown. Thus we may find the discrete Coons patch as the solution of a linear system with (m − 1) × (n − 1) equations in as many unknowns. In the interior of the patch, the equations just relate the unknowns to each other; near the boundaries, they relate them to the knowns and unknowns. Of course, this is a very expensive way to compute the discrete Coons patch; yet it offers some new insights, and, more importantly, some improvements. The linear system for the discrete Coons patch employs a mask of the form α bi,j = β α

β • β

α β α

(6)

with α = −0.25 and β = 0.5. This suggests the possibility of different choices for α and β. Note that we always need 4α + 4β = 1 in order for (6) to utilize barycentric (or affine) combinations. By allowing other values of α and β, we obtain a new class of control net generation schemes—we call these permanence patches. If, for the data used in Fig. 1, we use α = −0.257, and solve the resulting linear system, we obtain Fig. 2. The resulting shape is much closer to any “designer’s intent”: the given

G. Farin, D. Hansford / Computer Aided Geometric Design 16 (1999) 691–700

695

Fig. 3. Permanence patches: a “minimal” control net for α = 0.

polygons came from a torus-like shape, and now we recapture that shape. 3 Note that the original discrete Coons patch from Fig. 1 failed miserably in this shape sense. If we select α = 0, we obtain Fig. 3. This mask is the discrete form of the Laplace PDE xuu + xvv = 0, and hence the resulting net very much resembles a minimal surface fit between the given boundary polygons. The mask in (6) is, in fact, a blend of the Euler–Lagrange and Laplace equations ! −1 2 −1 0 1 0 1 e × 2 • 2 + (1 − e) × 1 • 1 . (7) bi,j = 4 −1 2 −1 0 1 0 An asymmetric mask may be desired if m 6= n. This generalization corresponds to an asymmetric Laplace mask about the u and v directions. For more literature on variational principles for fair surface construction, see (Greiner, 1994; Kobbelt, 1997).

4. More on permanence patches A point on a Coons patch depends on eight points only—Coons patches are local in that sense. On the other hand, a point on a permanence patch (for α 6= −0.25) depends on all boundary points and is therefore global. We believe this accounts for the potentially improved shapes. Since the discrete partial derivatives are dependent upon m and n, so is the affect of α. However, an interesting observation is that for a given m and n, a single choice of α will not always produce “good” shape. The appropriate value depends on the geometry of the boundary curves. Fig. 4 illustrates. In other words, no geometry-independent combination of Euler–Lagrange and Laplace masks will be sufficient for all geometries. It is not clear whether an asymmetric mask is necessary to achieve “good” shape. 3 The α value for this example was found empirically.

696

G. Farin, D. Hansford / Computer Aided Geometric Design 16 (1999) 691–700

Fig. 4. Permanence patches for two 3 × 3 nets. To achieve the desired shape, the torus-like data set on the left requires α = −0.75, whereas the “tent” on the right requires α = −0.25 (Coons).

Permanence patches have bilinear precision in the following sense. Let the four corner points determine a bilinear patch. Place the remaining edge Bézier points equally spaced along the edges. The resulting permanence patch points reproduce the bilinear patch. To see this, substitute the linear expressions for the edge points relative to the corner points into the mask in (6), and the middle Bézier point takes the form bi,j = bi−1,j −1 (α + β) + bi+1,j −1 (α + β) + bi−1,j +1 (α + β) + bi+1,j +1 (α + β). The mask was constructed to preserve barycentric combinations, so α + β = 1/4. Since this is a permanence patch, this bilinear property will hold for arbitrary m and n.

5. Triangular permanence patches The control net of a triangular Bézier patch is a piecewise linear surface (see (Farin, 1986)). One may then ask: given three boundary control polygons, what is a “good” control net to fit in between them? Various triangular methods (Barnhill and Gregory, 1975; Nielson et al., 1978, 1979; Nielson, 1980; Perronnet, 1997) may be employed here, but a permanence principle can also be established by utilizing a mask of the form α β β x= (8) β • β α β β α with 3α + 6β = 1. We will call the patches formed with this mask triangular permanence patches. Generalizing rectangular patches, one interpretation of this mask is as follows. For cubic Bézier patches there are nine interior edges, and associated with each edge is a quadrilateral. Form nine equations for x, requiring the quadrilaterals to be as close as possible to parallelograms. The least squares solution for x results in the mask (8) with α = −1/9. An example is illustrated in Fig. 5. As we did for rectangular patches, let us consider this problem in terms of discretized PDEs. As noted in Nielson et al. (1978), fourth order partials are not appropriate. Additionally, the first order derivatives yield an asymmetric mask. The only derivatives we need to consider are of second order. These are illustrated in Fig. 7. As noted above,

G. Farin, D. Hansford / Computer Aided Geometric Design 16 (1999) 691–700

697

Fig. 5. Triangular permanence patch: Coons generalization with α = −1/9.

Fig. 6. Triangular permanence patch: Coons generalization with α = −1/3.

Fig. 7. A schematic description of the second order partials of a triangular patch. Left, second order derivatives for the Laplace mask. Right, the quadrilaterals for the corner twist minimizing mask.

there are nine “twist equations”; we differentiate them as the three corner twists and the six interior twists. Due to the cyclic nature of the interior twists, the mask that these equations generate is identical to that of the Laplace mask. Therefore, the mask (8) can be described as a blend of a corner twist minimizing mask and a Laplace mask:   −2 0 1 2 2 1 1  + (1 − e) × (9) x = e × . 2 • 2 1 • 1 6 −2 2 2 − 2 0 1 1 0 Our twist-minimizing mask (α = −1/9) which we derived as the solution to a least squares problem, is actually a blend of the PDE masks with e = 1/3. The patch corresponding to α = −1/3, or e = 1, which is simply the corner twist minimizer. It is illustrated in Fig. 6.

698

G. Farin, D. Hansford / Computer Aided Geometric Design 16 (1999) 691–700

Fig. 8. Triangular permanence patch: a “minimal” surface with α = 0.

We thus see that the triangular case differs from the rectangular one in that now the solution to the least squares system is not the same as that to the corner twist minimizer. 5.1. Quadratic precision For α = −1/6, we create a quadratic precision configuration. 4 The triangular permanence patches resulting from α = −1/6 enjoy a quadratic precision property in the following sense: Let Q be a quadratic (discrete) patch. Degree elevate it to an arbitrary degree n, resulting in a patch EQ. Then apply the permanence construction to the boundary curves, resulting in a patch P EQ. We claim that EQ = P EQ. For a proof, observe that EQ is the control net of a quadratic Bézier patch which was degree elevated to degree n. Thus all third derivatives of this patch are zero. The coefficients of a third derivative are obtained by averaging all “cubic” subnets of EQ. If all those averages are to vanish, then each of the subnets had to be “quadratic” itself, i.e., it had to satisfy a relationship of the form (8) with α = −1/6. This is precisely what the permanence construction yields when applied to the boundaries of EQ, thus proving our claim. 5.2. More on triangular permanence patches For α = 0, we obtain the discrete Laplace mask, resulting in surfaces which are close to minimal in the sense of differential geometry. Fig. 8 illustrates. For all α values, triangular permanence patches have linear precision in the sense that if the given edge control points are equally spaced along the edges then linear functions are reproduced. The proof is completely analogous to the one for rectangular patches. Just as with the rectangular permanence patch, there are α values which produce singularities. Additionally, the behavior of the patch corresponding to a particular α value is dependent on the degree of the patch. An automatic method for determining the “optimal” α is under development. In Fig. 9, an α value has been selected that certainly produces a nicer shape than that of Fig. 5. 4 Another mask which has quadratic precision was given by Barron (1988), however this mask is not symmetric.

G. Farin, D. Hansford / Computer Aided Geometric Design 16 (1999) 691–700

699

Fig. 9. Triangular permanence patch: an “optimal” α = −0.2.

6. Conclusions We reformulated the discrete Coons patch and generalized it to permanence patches, both for the rectangular and the triangular cases. The generalization allowed us to produce shapes which are more desirable than the standard Coons shapes. These methods were also described in terms of discrete PDEs. In Fig. 4, we illustrated (for rectangular patches) that no single blend of Euler–Lagrange and Laplace variational principles can produce “good” shape for all boundary curve geometries. We thus conjecture that one has to employ shape descriptors that adapt to the given boundary information instead of using a rigid blend of variational principles. One also needs conditions on the shape parameters to ensure solvability of the linear system.

Acknowledgements We appreciate the comments by the referees regarding the relevance of the discretized PDE approach. References Barnhill, R. (1982), Coons’ patches, Computers in Industry 3, 37–43. Barnhill, R. and Gregory, J. (1975), Polynomial interpolation to boundary data on triangles, Math. Computation 29 (131), 726–735. Barron, P. (1988), The general formula of the quadratically precise nine-parameter interpolant, Technical Report, University of Utah, manuscript. Coons, S. (1964), Surfaces for computer aided design, Technical Report, MIT. Available as AD 663 504 from the National Technical Information service, Springfield, VA 22161. Farin, G. (1986), Triangular Bernstein–Bézier patches, Computer Aided Geometric Design 3 (2), 83–128. Farin, G. (1992), Commutativity of Coons and tensor product operators, Rocky Mtn. J. Math. 22 (2), 541–547.

700

G. Farin, D. Hansford / Computer Aided Geometric Design 16 (1999) 691–700

Farin, G. (1996), Curves and Surfaces for Computer Aided Geometric Design, 4th ed., Academic Press. Gordon, W. (1969), Free-form surface interpolation through curve networks, Technical Report GMR921, General Motors Research Laboratories. Greiner, G. (1994), Variational design and fairing of spline surfaces, Computer Graphics Forum 13, 143–154. Kobbelt, L. (1997), Discrete fairing, in: Goodman, T. and Martin, R., eds., The Mathematics of Surfaces VII, Winchester, Information Geometers, 101–131. Nielson, G. (1980), Minimum norm interpolation in triangles, SIAM J. Numer. Analysis 17 (1), 46– 62. Nielson, G., Thomas, D. and Wixom, J. (1978), Boundary data interpolation on triangular domains, Technical Report GMR-2834, General Motors Research Laboratories. Nielson, G., Thomas, D. and Wixom, J. (1979), Interpolation in triangles, Bull. Austral. Math. Society 20, 115–130. Perronnet, A. (1997), Triangle, tetrahedron, pentahedron transfinite interpolations. Applications to the generation of C 0 or G1 -continuous algebraic meshes, in: Proc. 6th International Conference on Numerical Grid Generation in Computational Field Simulation, Avery Hill Campus, Greenwich, England, 467–476.