Variational Design and Fairing of Spline Surfaces

Report 1 Downloads 140 Views
EUROGRAPHICS ’94 / M. Daehlen and L. Kjelldahl (Guest Editors), Blackwell Publishers © Eurographics Association, 1994

Volume 13, (1994), number 3

Variational Design and Fairing of Spline Surfaces Günther Greiner Computer Graphics Group, University of Erlangen Am Weichselgarten 9, D-91058 Erlangen, Germany email: [email protected]

Abstract Variational principles have become quite popular in the design of free form surfaces. Among others they are used for fairing purposes. The choice of the ‘right’ fairness functional is a crucial step. There is always a tradeoff between high quality and computational effort. I n this paper we present fairness functionals that allow fairing efficiently, i.e., produce high quality surfaces in a reasonable amount of time. These functionals can be considered as simplified thin plate energy functionals f o r parametric surfaces or as simplified MVC functionals.

1 Introduction Modeling free form surfaces by specifying the control points or, modifying surfaces by changing some of its control points, is a popular way to construct surfaces having the required overall shape. In case the surface is determined by a large amount of control points, these manipulations often produce wrinkles or other flaws in parts of the surface. In a second, post processing step, one has to smoothen these regions. This procedure is called fairing (see [7] for basics on the subject). A standard approach is to consider the surface as a thin plate and change it locally in such a way that the energy of the thin plate described by the surface will be minimal. The exact functional expressing the energy of a thin plate is very complicated. As a consequence, this method is computationally very demanding and requires a lot of time. In the functional case, i.e., when the z-coordinate in 3D-space can be expressed as a bivariate function of x and y coordinates, there is a simplified thin plate energy functional which is (in most cases) a good approximation of the exact energy and can be handled rather easily. It seems that there is no similar simplified functional in the parametric case. The ad hoc transition (though used by some authors) of this functional will, in general, be a rather bad approximation to the exact energy. We are going to describe how correct simplifications of the exact thin plate energy functional for parametric surfaces can be obtained that allow solutions in a reasonable time. Moreover, we describe simplifications of the so-called MVC functionals (see [12]) which are also well suited for fairing purposes. The basic idea is the following. When fairing has to be done, one already has a surface, call it , which is a good approximation to the find result call it . The surface is used to define an appropriate, quadratic, positive definite functional which serves as a fairness functional. Thus we do not consider some universal fairing functional, instead, we introduce a data dependent fairness functional. Details are described in the next section. Minimizing will then yield the desired faired surface . In the subsequent sections we describe in detail two fairing methods for tensor product spline surfaces which use these functionals. A global method and an iterative procedure. The global method described in Section 3 can be used in cases where not too many control points are involved (at most several hundreds), while the local method described in Section 4 can be applied also to very large sets of control points.

C-144

2

G. Greiner / Variational Design and Fairing of Spline Surfaces

Appropriate Fairness Functionals

Usually, for fairing a parametrized surface that coincides with choose the surface following functional

in some interior region one tries to outside of and, in addition, minimizes the

denote the principal curvatures of the surface G . denotes the surface element. where and and mean curvature Using the notions of Gaussian curvature instead of the principle curvatures, the functional (1) can be reformulated as

By the Gauss-Bonnet Theorem from differential geometry [8], the integral over Gaussian curvature can be expressed as an integral over the boundary of Since in the fairing we do not change the boundary values, the second term in ( 1 ’ )can be omitted in the optimization process. That is, we obtain the same result when minimzing the following functional

Since this functional (as well as (1) and (1’)) is highly nonlinear, the numerical solution to this problem will be very involved and time consuming. To overcome this difficulty, one simplifies the functional. E.g. in [1] where tensor product spline surfaces are considered, this is achieved by evaluting the integrand of (1) only at the corners of the rectangular patch. Another possibility is t o work with simpler functionals (e.g., quadratic ones). Often one uses the (simplified) thin plate energy. The corresponding functional then is

However, this functional is a good approximation only in the functional case, but may fail to be close to the correct thing in the parametric case. A better approximation to the functional (2), by a quadratic functional can be obtained as follows. Choose a parametrized surface that is close to the desired surface, and consider the functional

is the Laplace-Beltrami operator related to (see e.g. [8]). It is a second order elliptic Here partial differential operator with non-constant coefficients. The coefficients depend on the first fundamental form of the surface . More precisely, the Laplace-Beltrami operator applied to a scalar function h yields

are the coefficients of the first fundamental form corresponding to and is its determinant. denotes the usual inner product in 3-dimensional Euclidean space. The Laplace-Beltrami operator typically will be applied to scalar functions. When as in formula (4), we apply it to each component applying it to a vector valued function, individually (i.e, After all these complicated formulas, the functional defined in (4) seems to be rather complicated. Actually, it is much simpler to deal with than any of the functionals (1), (1’) or (2). Moreover, it has some interesting properties listed below (see [5]) . Here

G. Greiner / Variational Design and Fairing of Spline Surfaces

2 . 1 Proposition. Considering tions having fixed values outside

as a functional on the set of all twice differentiable parametrizathe following holds.

a)

is a positive definite, quadratic functional.

b)

only depends on the geometry of the surface

c) If

C-145

not on the parametrization.

then

Let us briefly comment on these properties. From a) it follows that determining the minimum reduces to solving a linear system. In fact, the minimum is characterized by the fact that the gradient of this functional vanishes. Since it is a quadratic functional, its gradient is linear! Moreover, positive definiteness guarantees the existence of a a unique minimum. From b) it follows, that when choosing the surface we do not have to care about a special parametrization or a special parameter space. From c) it follows that in case is chosen in such a way that it is close to the surface we are looking for, then for this surface is a good approximation of the functional described in formula (2), at least in a neighborhood of A rigorous mathematical statement is the following: 2.2 Consequences.

with a constant const not depending on F provided that the distance is suficiently small. The constant is independent of F . Note however, that the distance “dist” has to be measured with respect to the Sobolev norm, that is the partial derivatives (up to order two) enter. is the following. Provided that the parametriza2.3 Remark. Another way to explain the meaning of tion is isometric (i.e., at every point the first fundamental form is the 2 x 2 unit matrix), then (1) and (3) yield the same value at F = and will not differ very much, provided that F is close to . The same holds true for (2) and the following functional

denotes the usual Laplacian of Euclidean 2-space. Thus in case is where an nearly isometric parametrization, then (3) and (4) would be good approximations for (1) and (2) respectively. This however, will be rarely the case. The situation can be improved by reparametrization the surface. Even then, only special surfaces can be parametrized nearly isometrically. The situation changes quite drastically, when one allows non-plane parameter spaces. Then every surface can be parametrized isometrically very easily. Use the surface itself as parameter space and consider the identical paramerization! Then however, one has t o replace in (5) the standard Laplacian by the Laplacian of the non-plane parameter space, which is the Laplace-Beltrami operator. In the design process so-called MVC functionals have proven to yield surfaces of perfect shape [12, 13, 11]. These functionals minimize the variation of the curvature. That is, they involve derivatives of the curvature. A typical example is the following.

As above, denote the principle curvatures and denote the corresponding directions of principle curvature. The complexity of this functional and hence the numerical treatment are even worse than for (1).

C-146

G. Greiner / Variational Design and Fairing of Spline Surfaces

We are going to describe how quadratic approximations to these functionals can be obtained. The idea is similar as above. Since derivatives of the curvature involve third order derivatives of the parametrization, we are looking for a quadratic functional which contains third order derivatives. Actually we are looking for something which simultanuously minimizes all third order derivatives. The following functional does this job

Here grad

denotes the gradient. It has to be applied to each component of

Thus

the integrand is However, this functional does not take into account the special geometry which we are looking for. After the discussion above i t i s clear how to modify it in order : Consider gradient, Laplacian, inner product and area to incorporate the geometry described by element with respect to the surface . Thus the simplified MVC functional we are looking for is

Here denotes the inner product with respect to the Riemannian metric (= first fundamental form) induced by And, for a scalar function h , the gradient with respect to is given by Again, denote the coefficients and g the determinant of the first fundamental form of the integrand has the . Thus for following form

with

The properties of the functional are listed in the following proposition. a) and b) coincide with the corresponding statements of Proposition 2.1. 2.4 Proposition. Considering tions having fixed values outside

as a functional on the set of all three times differentiable parametrizathe following holds.

a)

is a positive definite, quadratic functional.

b)

only depends on the geometry of the surface

c)

not on the parametrization.

then

The consequences of a) and b) are the same as in case of Proposition 2.1 (see 2.2). In particular, the minimum of can be determined by solving a linear system.

G. Greiner / Variational Design and Fairing of Spline Surfaces

3

Global

Fairing

for

Tensor

Product

We assume that there is a parametrized surface . Then fairing can be achieved as follows: Choose as fairing functional

either

or

Spline

C-147

Surfaces

having some wrinkles in a subdomain defined in (4) and (7) respectively.

Solve the variational problem

The resulting minimum is the surface

we are looking for.

In practical applications one will deal with a certain finite dimensional set of parametrizations, call it S . Each F S is a mapping from a fixed parameter space into . S may consist of tensor product spline surfaces over a rectangular grid, or of piecewise Bézier patches (over a triangulation), or of triangular splines (over a triangulation and an associated cloud of knots, see [2]) or a scheme of split surfaces (e.g., Clough-Tocher or Powell-Sabin). For simplicity we restrict ourselves to the case of tensor product spline surfaces and describe the procedure in detail for this situation. The parameter space will be rectangle and there are knot vectors and Multiple knot are allowed with the restriction that -continuity is guaranteed. Thus interior knots may have multiplicity up to n - 2 , exterior knots up to n + 1 . The corresponding normalized (univariate) B-spline functions of degree n subordinated to T and S will be denoted by respectively. Then, has its support in the interval and in and . S consists of all tensor product B-spline surfaces of degree (n,n) subordinated to T x S . Thus each F S has a unique representation where are the control points. The subregion in which fairing has to be performed is best specified by determining a subset of the indices . Note that the control point modifies the surface only in the rectangle In the following we only want to do fairing in the interior. Therefore, we require that is a subset of For fairing at the boundary see the remark at the end of this section. For a set the corresponding subregion is given by Next we identify all control points that have influence on the subregion . These are the control points having an index ( i , j ) satisfying Call this set . In case is is the rectangle the rectangular set . Then for any surface we have that and coincide on Hence, Thus for minimizing we only have to take into consideration the control points with indices in The control points with indices in are the ones which have to be determined in the optimization process, while the control points with indices belonging to the difference remain fixed. Due to the quadratic nature of our functional we end up with a least square problem for the coefficients 3.1 Fairing with the simplified minimal energy functional We choose as given by (4). Then we have

G. Greiner / Variational Design and Fairing of Spline Surfaces

C-148

Introducing the quantities

we obtain

We have to minimize this symmetric quadratic functional over the control points , we denote them the control points are the control points of square problem leads to the following linear system

while This least

Only the control points on the left-hand side are unknows. The one on the right-hand side are the control points of the surface ! There are as many equations in (9) as we have indices in . Each that is three scalar equations, one for the x-,y- and z-component. equation is a vector equation in So we have a linear system of size denotes the number of coefficients in . However, the coefficient matrices are identical for x-, y- and z-component. for Only the right-hand side differs. Thus we only have to solve a linear system of size three different right-hand sides. We summarize the steps explained in detail above . for which fairing has

Given a tensor product spline surface to be done, perform the following steps:

1. Specify a subset of interior indices describing the region where fairing has t o he done and determine the set 2. For determine the coefficients of the linear system given in (8) by numerical quadrature.

3. Solve three times (for

Then, the control points

and

of the resulting surface

the linear system

are given by

Besides solving the linear system, the most complicated step in the procedure is the determination of the coefficients by numerical integration. However, the implementation shows that there is no need for an accurate integration method. Quadrature formalus involving evaluation at four interior already produce good results. Also the simple midpoint points in each rectangle formula

G. Greiner / Variational Design and Fairing of Spline Surfaces

C-149

can be used. 3.2 Fairing with the simplified MVC functional

If we choose as fairing functional given by (7) everything mentioned in 3.1 remains true, except that the quantities are given by

Figure 1: The left figure shows the initial surface, the right figure the surface after fairing with the global method. As fairing functional the simplified MVC functional has been used.

3.3 Modifications. a) In fairing one often requires additionally that the resulting surface does not move too far away from the initial surface . For this purpose a tolerance is specified. This can be easily achieved as follows. Having determined the control points as described above, one checks for every If not, replace by whether Another approach guaranteeing that the resulting surface stays close to the initial surface might be the following. Add to the fairing functional J a term The larger the constant Const is chosen, the more the resulting surface . Note that by this modification the new fairing functional remains quadratic and will stick to positve definite. Hence, the numerical treatment can be handled similarly.

b) Instead using to define the fairing functional and respectively, one can use a modified surface obtained by averaging the control points having indices in . The implementation shows, that the following choice gives a slightly better result than working with . Define the control points of by c) Obviously, the fairing method described above can be iterated. The resulting surface may be used as starting point for another fairing process. As long as one considers the same subregion (the same set it turns out, that in many case a second step is not neccesary. A possible third step

C-150

G. Greiner / Variational Design and Fairing of Spline Surfaces

hardly changes anything. However, we do not have a rigorous proof for the convergence of this iteration procedure! 3.4 Fairing at the boundary.

So far we have not allowed that the region where fairing has to be done meets the boundary. This assumptions guarantees that the boundary of the surface will not be changed. Thus the surface cannot contract. Otherwise this may happen. Think of the extreme case where contains all indices (including the ones at the boundary). Then the method will produce the trivial surface contracted to the point 0 . If one also wants to do fairing at the boundary, we propose the following two step procedure. 1) Do fairing of those boundary curves where meets the boundary. 2) Remove the boundary indices from and perform fairing as described above. Possibly one has to repeat these steps several times. Of course, fairing of the (boundary) curves can be done by an variational approach as well.

4

Local Fairing for Tensor Product Spline Surfaces

In this section we present an alternative to the method described in the previous section. The idea is that instead minimizing over a set of control points one minimizes in each step only over one control point. This can be done for any of the fairing functionals given in (4) and (7). 4.1 The basic step.

We perform fairing as described in Sect. 3 for the special case where index . Then Its solution is given by to a single equation for

contains only a single interior The linear system (9) reduces

Thus the resulting surface is obtained from by replacing the control point by defined in (10). Formula (10) shows that the new control point is obtained by a linear combination of the control points in a rectangular neighborhood. In general one has to do fairing in a subdomain specified by a set of many indices. This can be achieved by replacing subsequently one of the control points specified by by the control point given by (10). Note that in each step the initial surface changes, therefore the coefficients have to be recomputed! Moreover, it does not suffice to do this only once for every index . In order to obtain good results one has to go over the whole set several times. We summarize the procedure.

G. Greiner / Variational Design and Fairing of Spline Surfaces

C-151

Figure 2: To the surface of Fig. 1 the also the local fairing method has been applied. The four figures shown here are the resulting surfaces after 1, 2, 5 and 10 iterations.

4.2 The local method. Given a tensor product spline surface to be done, perform the following steps: 1. Specify a subset

for which fairing has

of interior indices describing the region where fairing has

to be done. 2. For every

n), and replace

determine the coefficients by the expression given in (10).

, (for

3. Repeat step 2 until convergence, i.e. the surface changes only by a certain, a

priori specified amount.

The only non-trivial step in this method is the determination of the coefficients which has to be done by numerical integration. As mentioned in Sect. 3 it is enough to work with simple quadrature

C-152

G. Greiner / Variational Design and Fairing of Spline Surfaces

formulas. The method described above, can be compared to the usual Gauss-Seidel iteration for linear systems. There in each single step one unknown is altered in order to satisfy the i-th equation exact. This has to be done for all unknowns and than the whole process will be repeated until convergence.

Figure 3 : Fairing the Torus on the left using the global method. The right image was obtained by the MVC functional (7), the one in the middle by the minimal energy functional (4).

5

Concluding Remarks

5.1 Implementation. Preliminary implementation of all methods (local/global and minmal energy/MVC) has been done and several examples have been tested. Some are shown in the figures. The fairing regions consisted of up to 100 control points. The results show that the MVC method produces better results (see Fig. 3 ) . In cases were some isolated points were picked out of the fairing region, only with the MVC functional one obtains a good result. The use of the minimal energy functional produces peaks in this situatio n (see Fig. 4). 5.2 Conclusion. In this paper we have introduced two fairing functionals which are good approximations to minimal energy functionals and MVC functionals respectively. The functionals are data dependent. That is, knowledge of the geometry of the final result is necessary to define the functionals. Both functionals are simple enough (quadratic, positive definite) to perform the optimization in a reasonable time. Moreover, we have introduced two methods, a global and a local method, for fairing of tensor product spline surfaces. This can be done with either of the functionals. In the global method a single step yields the result. One has to do numerical integration and solve a linear system. The size of this system is proportional to the number of control points involved in the fairing process. In the local method, one single step involves only numerical integration. This step, however has to be executed very often. Depending on the number of control points involved in the fairing process, one has to do it 10 - 100 times for each control point.

5.3 Future Work More examples have to be tested and comparisons have to be done in order to decide which method (local or global) is preferable. Furthermore, fairing at the boundary (as described in 3.4) has to be included. A comfortable user interface has to be build in order to allow interactively specifying the region where fairing has to be done. Also integrating it in modelling systems as a future task. Moreover, the method will be implemented for other classes of surfaces, triangular spline surfaces and split surfaces.

G. Greiner / Variational Design and Fairing of Spline Surfaces

C-153

Figure 4: Same thing as in Fig. 3 for another configuration. In addition, one control point in the interior, the one close t o the peak, remain fixed.

References [1] G.-P. Bonneau, H. Hagen, and St. Hahmann. Variational surface design and surface interrogation. Computer Graphics Forum, 12(3):447-459, 1993. [2] W. Dahmen, C. A. Micchelli, and H.-P. Seidel. Blossoming bedgets b-spline bases built better by b-patches. Math. Comp., 59:97-115, 1992. [3] M. Eck and J. Hadenfeld. Local energy fairing of B-spline curves. preprint, 1994. [4] G. Farin and N. Sapidis. Curvature and fairness of curves and surfaces. IEEE CGA, 9:52-57, 1989. [5] G. Greiner. Surface construction based on variational principles. In P. J. Laurent, A. LeMéhauté, and L. L. Schumaker, editors, Curves and Surfaces II, Boston, 1994. AKPeters. [6] H. Hagen and G. Schulze. Automatic smoothing with geometric surface patches. CAGD, 4:231236, 1987. [7] J. Hoschek and D. Lasser. Grundlagen der geometrischen Datenverarbeitung. B. G. Teubner, Stuttgart, 1992. [8] W. Klingenberg. A Course in Differential Geometry. Springer-Verlag, Berlin Heidelberg, 1978. [9] E. T. Y . Lee. Energy, fairness, and a counterexample. CAD, 22:37-40, 1990.

C-154

G. Greiner / Variational Design and Fairing of Spline Surfaces

[10] N.J. Lott and D.I. Pullin. Method for fairing B-spline surfaces. CAD, 22:597-604, 1988.

[11] M. Lounsberry, St. Mann, and T. DeRose. Parametric surface interpolation. IEEE Comp. Graphics Appl., 12:45-52, 1992. [12] H. P. Moreton and C. Séquin. Functional optimization for fair surface design. ACM Computer Graphics, 26:167-176, 1992. [13] H. P. Moreton and C. H. Séquin. Scale-invariant minimum-cost curves: Fair and robust design implements. Computer Graphics Forum, 12 (3) :473-484, 1993. [14] W. Welch and A. Witkin. Variational surface design. ACM Computer Graphics, 26:157-166, 1992.