Visual Comput (2005) 21: 858–864 DOI 10.1007/s00371-005-0345-8
Jin Jin Zheng Jian J. Zhang H.J. Zhou L.G. Shen
Published online: 1 September 2005 © Springer-Verlag 2005
J.J. Zheng (u) · L.G. Shen Department of Precision Machinery and Precision Instrumentation, University of Science and Technology of China, Hefei, China 230026
[email protected] J.J. Zhang NCCA, Bournemouth University, Poole, Dorset BH12 5BB, UK H.J. Zhou NSRL, University of Science and Technology of China, Hefei, China 230029 ∗ This
work is supported by the Hundred Talents Project of CAS and NSF of China (60473133)
ORIGINAL ARTICLE
Smooth spline surface generation over meshes of irregular topology∗
Abstract An efficient method for generating a smooth spline surface over an irregular mesh is presented in this paper. Similar to the methods proposed by [1–4], this method generates a generalised bi-quadratic B-spline surface and achieves C 1 smoothness. However, the rules to construct the control points for the proposed spline surfaces are much simpler and easier to follow. The construction process consists of two steps: subdividing the initial mesh once using the Catmull– Clark [5] subdivision rules and generating a collection of smoothly connected surface patches using the resultant mesh. As most of the final mesh is quadrilateral apart
1 Introduction The construction of smooth surfaces over control meshes has been a popular topic in computer-aided geometric design. A control mesh is said to be regular if each of the mesh points is surrounded by four quadrilaterals. Many parametric surfaces, including B-spline surfaces, can be used to generate surfaces over regular meshes and have been incorporated into many commercial computer graphics and CAD packages. However, they are not valid for irregular meshes since they require the control meshes to form a regular quadrilateral structure. To overcome this limitation, a number of methods have been proposed for the construction of smooth surfaces of irregular topology. Roughly speaking, these methods can
from the neighbourhood of the extraordinary points, most of the surface patches are regular quadratic B-splines. The neighbourhood of the extraordinary points is covered by quadratic Zheng–Ball patches [6]. Keywords Spline surface · Subdivision · Irregular mesh · Surface generation
be categorised into two groups: the first group produces the final surface as the limit of a refinement subdivision procedure, known as the subdivision surfaces, whilst the second group describes the final surface with a spline surface. 1.1 Subdivision surfaces Recursive subdivision surfaces were developed to tackle the topological limitation [5, 7]. Starting with a mesh of polygons, these methods iteratively apply a refinement procedure. In the limit, a smooth surface is obtained. Although it is considered that the subdivision surfaces do not admit a closed analytical expression, Stam [8] managed to derive a method for the exact evaluation of a Catmull– Clark surface.
Smooth spline surface generation
859
1.2 Spline surfaces Taking an irregular mesh as input, the methods of spline surface presented by Peters [3, 4] and Loop [2] carry out a Doo–Sabin subdivision procedure [7] once or twice. Surface patches are then derived around each vertex. A bi-quadratic B-spline surface is generated where the mesh is regular. Around the irregular areas bi-cubic surfaces or triangular patches are used. The union of all the patches forms a smooth surface. As an application of an S-patch, Loop and DeRose [2] presented another similar method. After subdivision once, the irregular areas are filled by S-patches. By using a Catmull–Clark subdivision [5], Peters [9] generated a bi-cubic scheme. The resulting patches join together parametrically with C 2 smoothness and agree with the Catmull–Clark limit surface except around the irregular vertices. Overall, it is a C 1 scheme. 1.3 The proposed approach Motivated by Loop’s and Peters’ approaches, this paper presents a similar method to create a smooth spline surface over an irregular topology mesh. The method can be used to construct B-spline-like surfaces using Zheng–Ball patches. This method takes as input an irregular mesh and produces as output a spline surface composed of a collection of smoothly joined patches. The construction process takes only two steps. The first step is to carry out a single Catmull–Clark subdivision over the initial mesh, resulting in a new refined mesh. This new mesh has a simpler structure, since every face has exactly four edges. In the second step, a surface patch is constructed corresponding to each vertex. The patch is a bi-quadratic B´ezier patch if the valence of the vertex 1 is four, or a quadratic Zheng–Ball patch [6] otherwise. The union of all these surface patches constitutes a C 1 smooth spline surface. The main advantage of this method is its simplicity and efficiency. It also avoids the existence of twist vectors, which would usually occur when filling a Zheng–Ball patch into an n-sided hole. This new proposed method is different from other similar techniques in the following aspects: – Peters’ methods [3, 4, 9] require control point adjustment near extraordinary vertices. But the proposed method needs no adjustment: one level of subdivision produces all the control points for the final surface. – The proposed method takes fewer steps to process compared with Peters’ methods. – The proposed method is much simpler for producing the control points of a Zheng–Ball patch. It does not go through the complicated conversion of control points compared with [1, 2]. 1
The valence of a vertex is the number of its incident edges.
Fig. 1. Sphere produced with Loop’s method [2](left) and with the proposed method (right)
Figure 1 shows two objects generated from the same initial mesh. The object on the left was produced with Loop’s method [2] and that on the right by the proposed method. The remaining sections of this paper are organised as follows. Section 2 introduces some preliminary knowledge of quadratic Zheng–Ball patches, which will be used as building blocks. In Sect. 3, the new technique is presented to construct smooth spline surfaces over a closed irregular mesh. Section 4 extends the application of this technique to open meshes. Section 5 concludes the paper.
2 Preliminaries As preliminary knowledge, in this section, we briefly review the Zheng–Ball surface patch. A Zheng–Ball patch is a generation of a Sabin patch [12] that is valid for threeor five-sided areas. For more details, the reader is referred to [6, 12–15]. An n-sided quadratic Zheng–Ball patch is defined as follows, when n ≥ 3: r(u) =
1
Bλ (u)rλ ,
(1)
j=0 min λ= j
where λ = (λ1 , λ2 , · · · , λn ) represents the n-ple subscripts, min λ = minni=1 {λi }, u = (u 1 , u 2 , · · · , u n ) represents n parameters of which only two are independent, rλ stands for the control points in R3 , as shown in Fig. 2, and Bλ(u) are the associated basis functions whose expressions are given as follows: Bλ(u) = ⎧ 2 2 n λj ⎪ ⎨ λi−1 λi j=1 u j (1 + f λ (u)) +Sn (u), ⎪ λj ⎩ 2 2 n j=1 u j (1 + f λ (u)) , λi−1 λi
λ = (1, · · · , 1) for other λ , (2)
860
J.J. Zheng et al.
Fig. 2. Control points for a six-sided quadratic Zheng–Ball patch
Fig. 4. Applying Catmull–Clark subdivision once to vertex V with valence n
faces. Control mesh M0 may be closed or open. In this section, we discuss the closed meshes. Open meshes with boundaries will be discussed in the next section. There are two steps in the construction of a spline surface: • Step 1. Apply a Catmull–Clark subdivision once. • Step 2. Construct one patch for each vertex in the resulting mesh. Fig. 3. Control vectors (←−) for cross-boundary first derivatives
The output is a collection of patches, which are either tensor product B´ezier patches or quadratic Zheng–Ball patches with an overall C 1 smoothness.
where
n 2 2 λ Sn (u) = 1 − u j j (1 + f λ(u)) λi−1 λi λ
(3)
j=1
3.1 Mesh subdivision
and the functions f λ (u) and the parameters are given by
The purpose of the first step is to sort out the mesh irregularity so that all faces of the mesh have exactly four edges. 0 f 2δi (u) = −2u i+1 u i+2 , (4) Given a 1user-defined irregular mesh M , a new refined mesh M can be created by carrying out a Catmull–Clark f δi +δi+1 (u) = −u i+2 , (5) subdivision once. However, if all its faces are already fourf λ (u) = 0 forλ = (1, 1, 1) , (6) sided, the user may have another option: use the mesh u 1 + u 2 + u 3 = 2u 1 u 2 u 3 + 1 ; (7) directly. This will create a spline surface closest to the initial mesh M0 . • n ≥ 5: For a given mesh, three types of points are identified when applying a Catmull–Clark subdivision [5]. They are f λ (u) = 0 , (8) the face points f , edge points e and vertex points v. All j =i−1,i d j + j =i,i+1 d j n ui = 1 − , (9) these points may be either ordinary or extraordinary depending on their valence. Vertices of valence 4 are called d j j =k−1,k k=1 ordinary, and the others are called extraordinary. Clearly, each vertex V of valence n of mesh M0 is inin which di are auxiliary variables satisfying cident to n faces and n edges. In the refined mesh M1 , the
2π di−1 + di+1 = 1 + 2 cos di , i = 1, 2, · · · , n . (10) new vertices associated with vertex V are computed by: n fi = centroid of the ith face incident to V , (11) (i = 1, · · · , n) , 1 3 Spline surface generation over an irregular ei = (V + fi−1 + fi + Vi ) (i = 1, · · · , n) , (12) 4 closed mesh • n = 3:
The starting point of this method is a user-defined irregular mesh M0 , which is a collection of vertices, edges and
where subscripts are taken modulo the valence n of vertex V, and Vi is the endpoint of the ith edge emanating
Smooth spline surface generation
from V:
n n 1 1 1 2V + fi + ei . v= 4 n n i=1
861
(13)
i=1
Note that all faces of the new mesh M1 are now foursided. The valence of the new vertex point v remains n, the valence of a new edge point is 4, and the valence of a new face point is the number of edges of the corresponding face of mesh M0 . 3.2 Patch generation The second step is to construct one surface patch for each vertex of mesh M1 ensuring that all such patches joined together smoothly. For an ordinary vertex, as it is surrounded by four 4-sided faces, a bi-quadratic B´ezier patch is used. For an extraordinary vertex, an n-sided quadratic Zheng–Ball patch will be generated where n is the valence of the vertex. Every edge of a patch of either type is a quadratic B´ezier curve defined by three control points, two endpoints and one midpoint. Understandably, the endpoints are also the corner points of the corresponding surface patch, such as c1 , · · · , c5 in Fig. 5. Note that any two adjacent patches constructed with the above rule share common boundary control points, and their control vectors for cross-boundary derivatives are identical in pairs, as illustrated in Fig. 6. This implies that they are joined with C 1 continuity. As a result, the union of all such patches constitutes a smooth spline surface. In fact, a bi-quadratic B-spline surface is generated where the mesh is regular. Figure 7 shows the initial meshes and the resulting spline surfaces of a geometric object modelled using the algorithm developed above, where the patches on the corners are non-quadrilateral Zheng–Ball patches and the others are bi-quadratic B´ezier patches. As can be seen, despite its simple geometry, it could be tricky to model using the conventional methods, as it has both holes and branches.
Fig. 6. Two adjacent patches joined with C 1 continuity. They share common boundary points (◦). Their control vectors (−→) and (· · · →) for cross-boundary first derivatives are identical in pairs respectively
Fig. 7. Closed irregular mesh and the resulting geometric model. Patch structure: Patches on the corners are non-quadrilateral Zheng–Ball patches; the others are bi-quadratic B´ezier patches
4 Spline surface generation over an irregular open mesh In the last section we discussed the procedure of constructing a smooth spline surface over a closed mesh. In this section, we extend the rules to cover an open mesh. The main task is to deal with the mesh boundaries. 4.1 Subdivision rules for mesh boundaries Similar to the treatment of a closed mesh, the process for an open mesh also consists of two steps: subdividing the mesh to make all faces four-sided and constructing a surface patch corresponding to each vertex.
Fig. 5. Control point generation corresponding to a vertex of valence 5
Boundary mesh subdivision for 2- and 3-valent vertices. Given an n-valent vertex V of the initial mesh M0 on a boundary, where n = 2 or 3, the new vertices of the refined mesh M1 are generated with the following rules, as
862
J.J. Zheng et al.
Fig. 8. Subdivision around a boundary vertex v (n = 3)
Fig. 10. Left: Concave inner boundary vertex V of valence 4. Right: New boundary vertices W1 and W4 of valence 3
shown in Fig. 8: fi = Centroid of the i-th face incident to V , 1 ei = (V + Vi ) , (i = 1, · · · , n) , 2 v=V,
(14) (15) (16)
where Vi stands for the endpoint of the ith edge emanating from vertex V. Boundary mesh subdivision for vertices of valence > 3. For a vertex V of valence n > 3, a preprocessing step is carried out which is to insert some extra vertices into the initial mesh. This is to make the valence of all boundary vertices no greater than 3. For each vertex V of valence n > 3, n new vertices Wi , (i = 1, · · · , n) are created by 1 1 Wi = V + Vi , 2 2
i = 1, · · · , n .
(17)
For a convex boundary vertex V, Vi and Wi form an (n + 1)-sided face of the mesh M0 , as shown in Fig. 9. For a concave or flat boundary vertex V, Wi form an n-sided face of the mesh M0 , and V is removed from the mesh, as shown in Fig. 10. After this treatment, all boundary vertices of mesh M0 have valence of either 2 or 3. Subdivision is then performed using the boundary subdivision rules Eqs. 14–16.
Boundary face: at lease one of its vertices is a boundary vertex. Intermediate vertex: not a boundary vertex, but at least one of its surrounding faces is a boundary face. Inner vertex: none of the faces surrounding is a boundary face. For each inner vertex of mesh M1 , the algorithm presented in Sect. 3.2 either generates a bi-quadratic B´ezier patch if n = 4 or an n-sided Zheng–Ball patch if n ≥ 4. We have seen that all patches are joined smoothly. In what follows, we will discuss patch generation corresponding to the intermediate vertices of mesh M1 . Note that after boundary subdivision all the boundary vertices are of valence 2 or 3. And all the boundary vertices are included in the resulting patches. Boundary patches corresponding to an intermediate vertex. Suppose d is an intermediate vertex of valence n in M1 . d2i+1 , i = 0, · · · , n − 1, are the n mesh vertices emanating from d. fi , i = 1, · · · , n, are the n surrounding faces. d2i , i = 1, · · · , n, are the n mesh vertices in faces di diagonal to d, respectively (Fig. 11). Then the patch corresponding to d is either a bi-quadratic B´ezier patch (n = 4) or an n-sided Sabin–Zheng–Ball patch (n ≥ 4) [6, 12]. Its control points are generated by the following rules: • d is a central control point. • d2i is a corner control point if its valence is 2.
4.2 Boundary patches To simplify our discussion, the following definitions are given. Boundary vertex: vertex on the boundary of M1 .
Fig. 9. Left: Convex boundary vertex V0 of valence 4. Right: New boundary vertices V0 , W1 and W4 of valence 2 or 3
Fig. 11. Intermediate vertex d (valence 5). Control points (◦) for the patch corresponding to it
Smooth spline surface generation
863
ure 12b shows a complex model generated by the aboveproposed method.
5 Conclusions
Fig. 12. Two models generated from open meshes by proposed method
• d2i−1 is a mid-edge control point if its valence is 3. • 12 (di + di+1 ) is a corner control point if the valences of di and di+1 are 3. • 12 (d2i−1 + d) and 12 (d2i+1 + d) are the two mid-edge control points if fi is not a boundary face. • The centroid of face fi is a corner control point if fi is not a boundary face. The rules guarantee the resulting boundary patch will be joined with other boundary patches and non-boundary patches with C 1 continuity. Figure 12a shows three intersected cylinders. They are constructed over an open mesh. The openings of the cylinders are approximated by four quadratic curves. Fig-
In this paper, a simple and efficient method has been presented to construct a C 1 smooth spline surface over an irregular mesh, which may be either closed or open. The resulting surface is a generalised bi-quadratic B-spline surface. This construction process consists of two steps. The first step is to subdivide an initial mesh once using Catmull–Clark subdivision rules. The purpose of this step is to regularise the mesh so that all its faces have exactly four sides. The second step is to construct a bi-quadratic B´ezier patch for each vertex when its valence is four or to construct a quadratic Sabin [12] or Zheng–Ball patch [6] when its valence is other than four. All these patches will be joined together with C 1 smoothness. This method works for both closed and open meshes. What also needs to be pointed out is that this method is not simply an n-sided hole filling scheme. Although the Catmull–Clark mesh isolates an arbitrary mesh into regular and irregular areas, the scheme is designed such that the irregular areas are treated as integral parts of the whole process. There is no need to work out the twist vectors, as would be necessary in filling a Sabin or Zheng–Ball patch in an n-sided hole. Acknowledgement The authors would like to thank the referees for their valuable comments and suggestions.
References 1. Loop, C., DeRose, T.: Generalised B-spline surfaces of arbitrary topology. In: Proceedings of SIGGRAPH, pp. 347–356 (1990) 2. Loop, C.: Smooth spline surfaces over irregular meshes. In: Proceedings of SIGGRAPH, pp. 303–310.(1994) 3. Peters, J.:Smooth free-form surfaces over irregular meshes generalising quadratic splines. Comput. Aided Geom. Des. 10, 347–361 (1993) 4. Peters, J.: Constructing C 1 surfaces of arbitrary topology using bi-quadratic and bi-cubic splines. In: Sapidis, N. (ed.) Designing Fair Curves and Surfaces, pp. 277–294. SIAM, Philadelphia (1994) 5. Catmull, E., Clark, J.: Recursively generated B-spline surfaces on arbitrary
6.
7. 8.
9. 10.
topological meshes. Comput. Aided Des. 10, 350–355 (1978) Zheng, J.J., Ball, A.A.: Control point surfaces over non- four-sided areas. Comput. Aided Geom. Des. 14, 807–820 (1997) Doo, D., Sabin, M.: Behaviour of recursive division surfaces near extraordinary points. Comput. Aided Des. 10(6), 356–360 (1978) Stam, J.: Exact evaluation of Catmull-Clark subdivision surfaces at arbitrary parameter values. In: Proceedings of SIGGRAPH, pp. 395–404 (1998) Peters, J.: Patching Catmull–Clark meshes. In: Proceedings of SIGGRAPH, pp. 255–258 (2000) Ball, A.A., Zheng, J.J.: Degree elevation for n-sided surfaces. Comput. Aided Geom. Des. 18(2), 135–147 (2001)
11. Navau, J., Garcia, N.: Modeling surfaces from meshes of arbitrary topology. Comput. Aided Geom. Des. 17, 643–671 (2000) 12. Sabin, M.A.: Non-rectangular surfaces suitable for inclusion in a B-spline surface. In: Hagen, T. (ed.) Eurographics, 57–69 (1983) 13. Zheng, J.J.: The n-sided control point surfaces without twist vectors. Comput. Aided Geom. Des. 18(2), 129–134 (2001) 14. Zheng, J.J., Zhang, J.J.: Interactive deformation of irregular surface models. Lecture Notes in Computer Science 2330, 239–248 (2002) 15. Lin, J., Ball, A. A., Zheng, J.J.: Surface modelling and mesh generation for simulating superplastic forming. J. Mat. Process. Tech. 80–81, 613–619 (1998)
864
J.J. Zheng et al.
J.J. Z HENG was born in 1963. He is a professor in the Department of Precision Machinery and Precision Instrumentation, University of Science and Technology of China, Hefei, China. He received his Ph.D. in computer aided geometric modelling from the University of Birmingham, UK, in 1998. His research interests include computer-aided geometric design, computer-aided engineering design, microelectro-mechanical systems and computer simulation.
J.J. Z HANG was born in 1959. He is a professor of computer graphics and the head of research at the Bournemouth Media School, Bournemouth University, UK. He received his Ph.D. from the Chongqing University, China, in 1987. His research interests include computer graphics, computer-aided design and computer animation. H.J. Z HOU was born in 1963. She is a senior engineer at the National Synchrotron Radiation Laboratory, Hefei, China. She received her
M.Sci. from the University of Central England, Birmingham, UK. Her research interests include mechanical design, micro-electro-mechanical systems and vacuum technology. L.G. S HEN was born in 1946. She is a professor in the Department of Precision Machinery and Precision Instrumentation, University of Science and Technology of China, Hefei, China. Her research interests include e-design, e-manufacturing, e-education and micro-electromechanical systems.