Computers and Mathematics with Applications Approximate ... - Core

0 downloads 0 Views 628KB Size Report
Approximate implicitization of parametric surfaces by using compactly ..... approximate implicitization, in: Topics in Algebraic Geometry and Geometric Modeling, ...
Computers and Mathematics with Applications 56 (2008) 3064–3069

Contents lists available at ScienceDirect

Computers and Mathematics with Applications journal homepage: www.elsevier.com/locate/camwa

Approximate implicitization of parametric surfaces by using compactly supported radial basis functionsI Jinming Wu a,∗ , Renhong Wang b a

College of Statistics and Mathematics, Zhejiang Gongshang University, Hangzhou, 310018, China

b

Institute of Mathematical Sciences, Dalian University of Technology, Dalian 116024, China

article

info

Article history: Received 29 December 2007 Received in revised form 11 July 2008 Accepted 10 September 2008 Keywords: Approximate implicitization Parametric surfaces Compactly supported radial basis functions Boundary constraint points Normal constraint points

a b s t r a c t In this paper, a new approach is proposed to solve the approximate implicitization of parametric surfaces. It is primarily based on multivariate interpolation of scattered data by using compactly supported radial basis functions. Experimental results are provided to illustrate the proposed method is flexible and effective. Crown Copyright © 2008 Published by Elsevier Ltd. All rights reserved.

1. Introduction It is well known that parametric curves/surfaces and implicit curves/surfaces are two important topics in Computer Aided Geometry Design and Geometric Modeling. It is easy to generate points on parametric curves/surfaces. On the other hand, it is convenient to determine whether a point is on, inside, or outside a given solid with the implicit treatment. For any rational parametric curve/surface, we can convert it into implicit form. But for a general parametric curve/surface, we usually cannot compute its exact implicit form. Even though its exact implicit form can be computed, the curve/surface implicitization involves relatively complicated computation and the degree of the implicit curves/surfaces is higher. Another difficulty is that implicit curves/surfaces may have unexpected components and self-intersections which lead to computational instability and topological inconsistency in geometric modeling. All these unsatisfied properties limit the applications of the exact implicitization (especially surface implicitization) in practical fields. So finding curve/surface approximate implicitization has become a practical problem. In the past ten years, many researchers have proposed several approaches to solve this problem. The earlier work on approximate implicitization was done by Velho et al., who presented an approximate implicitization scheme from parametric surfaces to implicit surfaces based on wavelet analysis [1]. Sederberg et al. [2] proposed an approach to solve an approximate implicitization problem by using monoid curves and surfaces. The method used by Sederberg was made more available in Dokken’s work [3,4]. Chen et al. [5] presented the concept of interval implicitization of rational curves and developed the corresponding effective algorithm. Li et al. [6] considered approximate implicitization of plane parametric curves using the piecewise quadratic Bézier spline curves with G1 continuity.

I Project supported by the National Natural Science Foundation of China (Nos. 10271022, 60373093, and 60533060), the Foundation of Department of Education of Zhejiang Province (No. 20070628) and the Natural Science Foundation of Zhejiang Province (No. Y7080068). ∗ Corresponding author. E-mail address: [email protected] (J. Wu).

0898-1221/$ – see front matter Crown Copyright © 2008 Published by Elsevier Ltd. All rights reserved. doi:10.1016/j.camwa.2008.09.016

J. Wu, R. Wang / Computers and Mathematics with Applications 56 (2008) 3064–3069

3065

Table 1 Some of Wendland’s CSRBF φd,k ∈ PDd ∩ C 2k

φ1,0 = (1 − r )+ , φ3,0 = (1 − r )2+ , φ3,1 = (1 − r )4+ (4r + 1),

PD1 ∩ C 0 PD3 ∩ C 0 PD3 ∩ C 2

The current authors also proposed a method for solving the approximate implicitization of parametric curves based on RBF networks and MQ quasi-interpolation [7]. It is difficult to generalize the method in [7] to approximate parametric surfaces, though it possesses the advantages of shape preserving, good approximation behavior and so on. Based on multivariate scattered data interpolation using compactly supported radial basis functions, in this paper, we put forward a new and different approach for solving the approximate implicitization of parametric surfaces. Numerical examples are provided to demonstrate that the proposed method is flexible. 2. Approximate implicitization of parametric surfaces In this section, we firstly review the multivariate interpolation using radial basis functions, and then present the method of approximate implicitization of parametric surfaces. 2.1. RBF interpolation A radial basis function (RBF) is a relatively simple multivariate function generated by a univariate function. Due to its simple form and good approximation behavior, the radial basis function approach has become an effective tool for multivariate scattered data interpolation during the last two decades. For details, the readers may refer to [8,9] and references therein. For any given scattered data (Xj , fj ) ∈ Rn × R, j = 1, . . . , N, where points X1 , . . . , XN ∈ Rn are pairwise distinct. By kX − Xj k we usually denote the Euclid distance between two points X and Xi , the so-called radial basis function interpolation is to use a function φ : R+ −→ R to construct the following interpolant: s(X ) =

N X

λj φ(kX − Xj k),

X = (x1 , x2 , . . . , xn )

j =1

satisfying the interpolation conditions s(Xi ) =

N X

λj φ(kXi − Xj k) = fi ,

i = 1, . . . , N .

j =1

Compactly supported radial basis functions (CSRBF for short) have only recently been constructed. Wu first constructed a broad variety of CSRBF[10]. Very recently, Wendland constructed these functions such that they possess the lowest degree among all CSRBF which are positive definite for given space dimension and prescribed order of smoothness [11]. They are radial basis functions which are positive definite on Rd for a given space dimension d (PDd ), belong to a prescribed smoothness class(C 2k ), are compactly supported and easy to evaluate. Some examples of such radial basis functions are given in Table 1. It is a useful property and provides a good selection of Wendland’s functions with respect to the order of continuity and the dimension of space. Nowadays, CSRBF have become a popular tool for multivariate interpolation of large scattered data [12,13]. In order to adapt the interpolation to scattered data of different densities, it is necessary to be able to scale the support of φ . So from now on we assume the radius α of support of φ is one and replace φ by

φα (·) = φ(·/α),

for α > 0.

Meanwhile, in order to achieve both the best possible approximation behavior and best possible stability with respect to the support of CSRBF, we adopt the strategy to choose the radius α as done in paper [12]. 2.2. Approximate implicitization of parametric surfaces Let r = r(u, v) be an arbitrary parametric surface(not necessarily rational form): x = x(u, v),

y = y(u, v),

z = z (u, v),

(u, v) ∈ D,

where x(u, v), y(u, v), and z (u, v) are arbitrary functions defined on D such as trigonometric and exponential functions, while the parametric surfaces discussed in papers [2,3,5] required to be rational form. It is an advantage of our proposed method of approximate implicitization. The use of RBF for the creation of implicit model has become an active research area (see [14,15] and references therein). These surfaces offer elegant property and well control over surface construction.

3066

J. Wu, R. Wang / Computers and Mathematics with Applications 56 (2008) 3064–3069

Fig. 1. Boundary constraint points and normal constraint points.

If a set of boundary constraint points BP = {Pi }ni=1 , Pi = (xi , yi , zi ) lying on the parametric surface is choosen ahead, then we naturally wish to construct an implicit surface {(x, y, z )|f (x, y, z ) = 0} such that it passes through this points set BP, i.e., f (Pi ) = 0,

i = 1, . . . , n.

In order to avoid the trivial solution from the multivariate interpolation, we have to add the additional constraint points where the implicit function f must take on the value of non-zero. Since it is hard to determine whether a point is inside or outside a given parametric surface, we create the implicit surface by adding normal constraint points. The normal constraints have also been introduced by Turk et al. [14] in their work. Since the outer normal vector is convenient to compute for any parametric form, a normal constraint point is introduced by a given small distance d along the outer normal vector and the normal constraint point is assigned the sufficiently small positive value (negative value) of c, which is illustrated in the case of curve in Fig. 1. A boundary constraint is always coupled with a normal constraint, but not every boundary constraint necessarily require a normal constraint. For example, if the normal vector (ru × rv ) is trivial on the boundary constraint point r(u0 , v0 ), then the corresponding normal constraint point is needless. Therefore, a set of normal constraint points NP = {Qi }Ni=n+1 can be generated. Hence, it gives rise to the following interpolation problem, i.e., finding an interpolation function f as follows: f (X ) =

n X

φα (kX − Pi k) +

N X

φα (kX − Qi k),

X = (x, y, z )

i=n+1

i=1

such that



f (Pi ) = 0, i = 1, . . . , n, f (Qi ) = c > 0, i = n + 1, . . . , N ,

∀Pi ∈ BP . ∀Qi ∈ NP .

Thus, the implicit surface S = {(x, y, z )|f (x, y, z ) = 0} is exactly the required approximate implicit surface of with respect to its corresponding parametric surface r(u, v). The number of boundary constraint points is always large since it is always required to describe the original parametric surface, thus in this paper we use CSRBF to deal with the above multivariate scattered data interpolation. It is obvious that the above proposed algorithm is suitable for the approximate implicitization of parametric curves. 2.3. RBF center reduction Since the number of interpolation points is relatively large, a flexible strategy to reduce the RBF center is to use RBF networks. For details, the readers may refer to [16,17]. A RBF network is a three layer feed-back network consisting of one input layer, one hidden layer, and one output layer [16]. The input layer feeds the input data to each neuron of hidden layer. Each hidden layer neuron calculates the distance between the input vector and its own center. The determined distance is transformed via radial basis functions, and the result is exported from a neuron. Each output layer neuron is fully connected to the hidden layer and computes a linear weight sum of the outputs of the hidden neurons. The output formula of a RBF network is calculated as follows: fj (x) = λj0 +

N X

λji φα (kx − ci k),

j = 1, . . . , M ,

i =1

where M denotes the number of the output layer neurons, N denotes the number of the hidden layer neurons, x ∈ Rn denotes the input data, ck represents the center of the kth basis function, λj0 denotes the biases of the jth hidden layer neuron and λji is the weight parameter between the ith hidden layer neuron and the jth output layer neuron. The application of a RBF network requires a training set for learning phase and a testing set for evaluating phase.

J. Wu, R. Wang / Computers and Mathematics with Applications 56 (2008) 3064–3069

3067

Fig. 2. Original surfaces.

Whereas, the number and the location of the centers is the key point in the design of RBF network. If we choose the centers of the radial basis functions properly, any multivariate continuous function can be approximated with arbitrary precision by a RBF network with small number of neurons. Throughout this paper, the nearest neighbor-clustering algorithm for RBF neural network is adopted directly. 2.4. Main algorithm With the above preparations, we can summarize the algorithm of approximate implicitization of parametric surfaces as follows. Algorithm 2.1. Approximate implicitization of parametric surfaces. Input Output Step 1. Step 2. Step 3.

Parametric surface: x = x(u, v), y = y(u, v), z = z (u, v), (u, v) ∈ D. Approximate implicit surface: S = {(x, y, z )|f (x, y, z ) = 0}. Choose the the set of boundary constraint points BP = {Pi }ni=1 . Generate the corresponding set of normal constraint points NP = {Qi }Ni=n+1 . Compute the approximate function f (x, y, z ) by using RBF neural networks.

The implicit surface S = {(x, y, z )|f (x, y, z ) = 0} is exactly the required approximate implicit surface. As for the obtained approximate implicit surfaces, we have the result Theorem 2.1. Parametric surface r = r(u, v) can be approximated with arbitrary precision by using compactly supported radial basis functions. 3. Numerical examples In this section, several numerical examples are given to illustrate the proposed method for approximate implicitization of parametric surfaces is flexible. Example 3.1. Consider the following three parametric surfaces (see Fig. 2) r1 (u, v) =



1 − u2

,

1 − v2

,

4uv

1 + u2 + v 2 1 + u2 + v 2 1 + u2 + v 2

,

2u(1 − v 2 ) 1 − u2 − v 2 , , (2 + u2 + v 2 )2 (2 + u2 + v 2 )2 (1 + u2 + v 2 )2 p r3 (u, v) = (u cos v, u sin v, 2 (1 − u2 )). r2 (u, v) =



2(1 − u2 )v





,

The parameters for these three parametric surfaces of r1 (u, v), r2 (u, v) and r3 (u, v) take values in [0, 1] × [0, 1], [0, 1]

× [0, 1], and [0, 1] × [0, 2π ].

Here, we choose the CSRBF as the Wendland’s function φ(r ) = (1 − r )4+ (4r + 1) and select 100 arbitrary boundary constraint points. Their approximate surfaces are shown in Figs. 3–5. Here, the implicit surfaces f1 (x, y, z ) = 0 and f2 (x, y, z ) = 0 are generated in Fig. 3 when the normal constraint points are 100 and 10, respectively. The other two Figures are generated similarly. Choose 2000 arbitrary points as a testing set. Their maximum errors and variances for Figs. 3–5 are listed in Table 2. It is a simple fact that the boundary constraint points play the decisive role in determining the implicit surface. That’s to say, the approximate implicit surface is obviously not sensitive to the normal constraint points, which is exactly the convenience and advantage of the proposed method.

3068

J. Wu, R. Wang / Computers and Mathematics with Applications 56 (2008) 3064–3069

Fig. 3. Two approximate implicit surfaces for r1 (u, v).

Fig. 4. Two approximate implicit surfaces for r2 (u, v).

Fig. 5. Two approximate implicit surfaces for r3 (u, v). Table 2 Max errors and variances

Max error Variance

f1 (x, y, z )

f2 (x, y, z )

g 1 (x , y , z )

g2 (x, y, z )

h1 (x, y, z )

h2 (x , y , z )

1.28(−3) 8.26(−8)

1.40(−3) 6.49(−8)

3.92(−3) 2.96(−6)

3.53(−3) 2.63(−6)

3.62(−3) 5.38(−6)

1.57(−3) 2.13(−6)

4. Conclusion A new method for solving the approximate implicitization of surfaces with any parametric form is proposed. The proposed method is dependent on multivariate scattered data interpolation by using CSRBF. From numerous examples we have tested, we found that the number of normal constraint points has little effect on the approximate implicit surface as long as we select sufficiently many boundary constraint points. Moreover, the approximate implicit surface is also not sensitive to the distance d and value c. Hence, the proposed method is flexible. It is pointed out that the optimal choice of the number and location of boundary constraint points, and the influence of normal constraint points on approximate implicit surfaces remain to be our future research. Acknowledgements We are very grateful to the referees for their careful reading of the manuscript and many valuable comments and remarks, which greatly improved this paper. References [1] L. Vehlo, J. Gomes, Approximate conversion from parametric to implicit surfaces, Computer Graphics Forum 15 (1996) 327–337. [2] T.W. Sederberg, J. Zheng, K. Klimaszewski, T. Dokken, Approximate implicit using monoid curves and surfaces, Graphical Model and Image Processing 61 (1999) 177–198.

J. Wu, R. Wang / Computers and Mathematics with Applications 56 (2008) 3064–3069

3069

[3] T. Dokken, in: T. Lyche, L.L. Schumaker (Eds.), Approximate implicitization, Mathematical Methods for Curves and Surfaces, Oslo 2000, Vanderbilt University Press, 2001, pp. 81–102. [4] T. Dokken, J.B. Thomassen, Overview of approximate implicitization, in: Topics in Algebraic Geometry and Geometric Modeling, AMS Contemporary Mathematics 334 (2003) 169–184. [5] F.L. Chen, L. Deng, Interval implicitization of rational curves, CAGD 21 (2004) 401–415. [6] M. Li, X.S. Gao, S.C. Chou, Quadratic approximation to plane parametric curves and its application in approximate implicitization, Visual Computers 22 (2006) 906–917. [7] R.H. Wang, J.M. Wu, Approximate implicitization based on RBF networks and MQ quasi-interpolation, Journal of Computational Mathematics 25 (1) (2007) 97–103. [8] M. Buhmann, Radial Basis Function: Theory and Implementations, Cambridge University Press, 2000. [9] Z.M. Wu, Radial basis functions–A survey, Advance in Mathematics 27 (1998) 202–208 (Chinese). [10] Z.M. Wu, Multivariate compactly supported positive definite radial functions, Advances in Computational Mathematics 4 (1995) 283–292. [11] H. Wendland, Piecewise polynomial, positive definite and compactly supported radial basis functions of minimal degree, Advances in Computational Mathematics 4 (1995) 389–396. [12] M.S. Floater, A. Iske, Multistep scattered data interpolation using compactly supported radial basis functions, Journal of Computational and Applied Mathematics 73 (1996) 65–78. [13] D. Lazzaro, L.B. Montefusco, Radial basis functions for the multivariate interpolation of large scattered data sets, Journal of Computational and Applied Mathematics 140 (2002) 521–536. [14] G. Turk, J.F. O’Brien, Modelling with implicit surfaces that interpolate, ACM Transactions on Graphics 21 (2002) 855–873. [15] Y. Ohatake, A. Belyaev, H.P. Seidel, 3D scattered data interpolation and approximation with multilevel compactly supported RBFs, Graphical Models 67 (2005) 150–165. [16] H. Simon, Neural Network: A Comprenhensive Foundation, second edition, China Machine Press, Beijing, 2004. [17] B.T. Liao, F.L. Chen, Application of RBF networks on scattered data interpolation, Journal of China University of Sicience and Technology 31 (2001) 135–142.