Exact and Approximate Representations of ... - Semantic Scholar

Report 7 Downloads 224 Views
Exact and Approximate Representations of Trimmed Surfaces with NURBS and B´ezier Surfaces Xin Li, Falai Chen Department of Mathematics, University of Science and Technology of China,Hefei, Anhui, China, 230026 Email:lixustc,chenfl@ustc.edu.cn

Abstract A trimmed surface is usually represented as a parametric surface with a set of trimming curves. However, many CAD processes and algorithms cannot be applied to trimmed surfaces directly because of the complexity in manipulating trimmed surfaces. Moreover, trimmed surfaces will create gaps between different trimmed surfaces. Thus it is desirable to represent a trimmed surface by a group of regular surfaces, such as NURBS or B´ezier surfaces. The present paper provides an algorithm to split a trimmed NURBS surface into several NURBS or B´ezier surfaces. The surface patches which domains are far away from the trimming curves coincide with the given trimmed NURBS surface and the patches which domains are close to the trimming curves are represented with high degree B´ezier surface patches (exact) or bi-cubic B-spline surfaces (approximate). The algorithm is simple, efficient and easy to implement. Compared with previous approaches ([1] and [3]), the new algorithm doesn’t change the parameterization of most regions and is easy to maintain the continuity. Since our algorithm can keep most of the patches unchanged, most of the surface patches will be C2 continuous. Furthermore, the surface patches can be locally merged to be G1 in the neighbor of trimming curves which is very difficult for those in [1] and [3]. Key words: Trimmed surface, NURBS, B´ezier surface, topologically inconsistent, intersection

1. Introduction Trimmed surfaces have become one of the most effective and widely used representations for various types of geometric applications, ranging from CAD/CAM applications to computer graphics. However, there is no standard representation for trimmed surfaces among different types of CAD systems. Moreover, there are geometric algorithms that can’t be directly applied to trimmed surfaces, such as deformation. Deformation of a trimmed surface may require re-evaluation of the trimming curves which is a time consuming process [2]. Trimmed surfaces are usually the results of intersecting different surfaces. Another major problem with trimmed

_____________________________ 978-1-4244-3701-6/09/$25.00 ©2009 IEEE 

surfaces is caused by the holes or gaps that occur along the seam where two surfaces intersect in a geometric model. This gap problem is sometimes called the ”topologically inconsistent surface intersection problem” [10]. It is the biggest impediment to the interpretability of CAD, CAE and CAM systems. One solution to these problems is to split a trimmed surface into other types of basic standard elements. In general, there are two approaches for decomposing trimmed surfaces. The tessellation of a trimmed surface into a set of triangular facets is the most popular approach. The other approach is to decompose a trimmed surface into regular B´ezier or NURBS surfaces. In the context of triangulation, Pieal and Richard [4] proposed to triangulate a trimmed NURBS surface in the parametric space. Cho et al. [9] adopted an unstructured Delaunay mesh approach for tessellating trimmed NURBS surfaces. Later, Ying-Liang and Hewitt [5] proposed an adaptive subdivision approach, which is useful for surfaces with high varying curvature. Furthermore, most of the algorithms suffer from cracks resulting from independent tessellation of surfaces that belong to the same body. For the decomposition of trimmed surfaces into NURBS, Hamann and Tsai [1] proposed to approximate a trimmed NURBS surface by a set of planar, ruled surfaces in the parametric domain. However, the method will create many degenerate patches. On the other hand, K.C.Hui [3] gave a feature-based decomposition algorithm. Both methods decompose a trimmed surface into a set of regular B-spline surfaces which are an approximation to the trimmed surface in the whole parametric domain, and which hardly keep the continuity between adjacent patches. The present paper provides a new algorithm to split a trimmed NURBS surface into several NURBS and B´ezier surface patches. The patches which domains are far away from the trimming curves will be kept exactly the same as the trimmed NURBS surface, and the patches which domains contain the trimming curves will be represented with high degree B´ezier patches (exact) or bi-cubic B-spline surfaces (approximate). The algorithm is simple, efficient and easy to implement. Compared with the algorithms in [1] and [3], the new algorithm doesn’t change the parameterization of most regions and is easy to maintain the continuity.

Our algorithm can keep most of the patches unchanged, and the surface patches can be locally merged to be G1 in the neighbor of trimming curves which is very difficult for those in [1] and [3]. The paper is structured as follows. Section 2 gives the definition of trimmed NURBS surface. In section 3, we provide an algorithm to split a parametric domain of the trimmed NURBS surface into several four-sided regions such that the trimmed surface can be represented with NURBS and B´ezier surfaces. In Section 4 and 5, exact and approximate representations are computed for the trimmed surface respectively. We conclude the paper with some discussion and future work.

2. Trimmed NURBS Surfaces Trimmed NURBS is a standard way for representing cut-away surfaces in CAD. A trimmed NURBS surface is composed of a NURBS surface with a set of trimming loops. Each trimming loop consists of a set of trimming curves defined in the parametric space D. A NURBS surface of degree (p, q) has the following form: n

m

S(u, v) = ∑ ∑ Ri, j (u, v)Si, j , u ∈ [u0 , u1 ], v ∈ [v0 , v1 ],

(1)

i=0 j=0

with Ri, j (u, v) =

Ni,p (u)N j,q (v)ωi, j , n ∑k=0 ∑m l=0 Nk,p (u)Nl,q (v)ωi, j

where Si, j form a bidirectional control net, ωi, j are their respective weights, Ni,p (u) and N j,q (v) are polynomial Bspline basis functions. In this paper, we only discuss polynomial B-spline surfaces, that is, all the weights ωi, j equal ones. The rational case is similar as the polynomial case. The trimming curves can be of any form, however, when dealing with NURBS entities, it is very desirable to represent them in NURBS forms as Ci (t) = (ui (t), vi (t)) =

ni

∑ R j (t)Cij ,

(2)

j=0

where the Cij are the control points specified in the parameter domain of the surface for the i-th trimming curve. As illustrated in Figure 1, a trimming loop is a set of trimming curves joined properly to form outer or inner loops. Outer loops are oriented counter-clockwise, whereas inner loops are oriented clockwise. The trimmed surface is the result of mapping each loop onto the surface, and keeping, by convention, only the portion of the surface lying on the left of every loop.

3. Parametric Domain Splitting Algorithm As we known, the image of a curve in the parameter domain of a bi-cubic trimmed NURBS surface is a cubic

a.

b.

c.

Figure 1. A Trimmed NURBS surface. a. The surface before trimming; b The parametric domain with one trimming curve; c. The surface after trimming.

curve if and only if the curve is a line parallelling to the iso-parametric lines. To get low degree boundary curves on the NURBS surface, we decompose the parametric region into four-sided regions which boundaries consist of trimming curves or straight lines which are parallel to the isoparametric lines. And then we represent the trimmed surface with a set of NURBS surfaces. Details of the technique will be discussed in the following sections. The most challenging part of the representing trimmed NURBS surface with NURBS and B´ezier surfaces is to split the parametric domain into four-sided regions. In order to keep most of the surface patches to be unchanged (see section 4 and 5), we should split the parametric domain with lines parallel to iso-parametric lines. The main steps for the splitting algorithm are illustrated in Figure 2.

3.1. Compute Initial Regions Trimming curves will separate the parametric domain into two parts, one part is kept and the other part is skipped. When we tracing the trimming curves, the kept regions will always be on the right side of the trimming curves. If we split the parametric domain into four-sided regions, the boundary of some regions will be a part of the trimming curves. We called these regions to be trimmed regions. From section 4 and 5 we can see that we only need to approximate the surface patches defined on the trimmed regions. Tracing along the trimming curves, the intersections of trimmed regions on the trimming curves are referred to be turn points. In order to make less distortion, we regard most of turn points to be the points which satisfy that 



ui (t) = ±vi (t). The first step is to compute all the turn points on the trimming curves in parametric domain. This is trivial because we have the expressions for all the trimming curves. For instance, in the example in Figure 2 a, all the turn points are labeled with black circles. For each turn point, we can define two vectors in the parametric domain which are parallel to the iso-parametric directions, and point to the kept regions of the trimmed



a.

b.

c.

Figure 2. Splitting the parametric domain into four-sided regions.

NURBS. These two vectors tell us which directions we can build the initial regions. According to the vectors of two adjacent turn points, we can easily construct the initial patches except in some concave regions. In the case with concave regions, two initial regions will overlap in the neighbor of the turn point which happens in Figure 2.a with two red circle points. The method to treat this case is to insert some new turn points and create a degenerate foursided patches such as the two triangle patches in Figure 2. a. If two adjacent initial patches belong to the same case, we can merge them into one patch. However, the initial regions will intersect with each other if two trimming curves are too close to each other, which happens in Figure 2.a. To solve this problem, we subdivide the regions and create two new initial regions so as to all the new regions don’t intersect each other. The result of subdivision is shown in Figure 2.b.

the algorithm in NURBS-based software Rhinoceros and demonstrate some examples in Figure 3.

3.2. Extend Initial Regions After constructing the initial regions, the second step is to extend the initial regions as far as possible. All the foursided regions can be extended to one direction except the degenerate four-sided regions which can’t be extended. The result of extending the example in Figure 2.a. is shown in Figure 2.c.

3.3. Add New Regions Till now, we have constructed all the trimmed regions. However there are still some empty regions in the parametric domain. These regions are all rectangles and have some common vertices with the existing initial regions. So we can add some new rectangle regions which don’t contain the trimming curves by checking whether the neighbors of the vertices of the initial regions are empty. In Figure 2.c, the new patch are labeled with grey. Finally, we split the parametric domain of a trimmed surface into a set of four-sided regions. We implement



Figure 3. Some examples for splitting the parametric domain of a trimmed NURBS into four-sided regions.

4. Exact Representation In this section, we will discuss how to represent the surface patches which parametric domain are obtained in previous section with NURBS and B´ezier surfaces. The rectangle regions are easily computed by knot insertion algorithm [2]. In fact, suppose the coordinates of the left-down and right-up corners of a rectangular region

are (s0 ,t0 ) and (s1 ,t1 ) respectively. To represent the surface patch with a B-spline surface, we just need to insert knots s0 , s1 into u direction and t0 , t1 into v direction three times respectively. To exactly represent a map from the trimmed region, we need a degree 6 × 18 B´ezier surface patch in general. As both the trimming curves and trimmed NURBS can be converted into B´ezier form, so the basic problem for exact representation is to represent a bi-cubic B´ezier surface 3

We present two examples for exact representation with B´ezier surface in Figure 5 and Figure 6. The first picture is the B´ezier surface before trimming and the second one is the trimmed surface with control points. Figure 6 provide a figure for exact representation with degenerate B´ezier surfaces.

3

B(u, v) = ∑ ∑ Bi, j B3i (u)B3j (v) i=0 j=0

trimmed by a cubic B´ezier curve 3

3

i=0

i=0

c(t) = ∑ ci B3i (t) = ∑ (si ,ti )B3i (t).

to

3! Here B3i (t) = i!(3−i)! (1 − t)3−it 3 and 1. As c0 and c3 are on the boundary,

t, u, v are all from 0 so s0 = 0 and s3 = 1.

f 0,1

f 3,1

f 3,0

f 0,0

a.

´ Figure 5. Exact represent with Bezier surface.

b.

Figure 4. The free-form deformation to exact represent ´ ´ a trimmed Bezier surface with high degree Bezier surfaces. The basic idea to represent the trimmed B´ezier surface 6 18 6 with the form Q(s,t) = ∑18 i=0 ∑ j=0 qi, j Bi (u)B j (v) is to view this process as a free-form deformation introduced in [6]. The free-form deformation for this problem is defined as 3

(u, v) = f (s,t) = ∑ ∑ fi, j B3i (s)B1j (t).

(3)

i=0 j=0

fi,0 = ( 3i , 0.0).

Here fi,1 = ci and So Q(s,t) = B(u, v) = B( f (s,t)) is a degree 6 × 18 B´ezier surface. To compute the B´ezier control points for Q(s,t), we use a simple method to compute the derivative of Q(s,t) for t. For example, the first row control points qi,0 can be easily computed by setting t = 0 and the second row control points are the linear combination of the first row control points and the first derivative along t direction which is Bu ( f (s,t)) ft + Bv ( f (s,t)) ft . So we can get all the control 2 3 points by computing Q(s, 0), ∂∂Qt (s, 0), ∂∂ tQ2 (s, 0), ∂∂ tQ3 (s, 0), Q(s, 1),

∂Q ∂ 2Q ∂ t (s, 1), ∂ t 2 (s, 1).

´ Figure 6. Exact represent with degenerate Bezier surface. There is a special case for xi = 3i . In this case, the surface is degree 3 × 12 because ft (s, 0) = 0 for all s.

5. Approximate Representation Thought we can represent a trimmed NURBS surface exactly, yet we have to resort to very high degree B´ezier surfaces. As bi-cubic surface is more popular in CAD, representing the trimmed surface with bi-cubic B-spline surfaces has more advantages. In this section, we will describe an algorithm to approximately represent the trimmed surface with bi-cubic B-spline surfaces. The surface which domain is far away form the trimming curves will be kept exact the same as the trimmed NURBS surface. We begin by inserting one row of control points along the top of the surface as shown in Figure 7.b. The control points Pi, j in Figure 7 are computed as follows. By the properties of B´ezier surfaces, along the top border the control points Pi,0 define the image of the trimming curve. So we force the top boundary curve to



P0,0

P0,0

Pm,0

0

Pm,0

0 e

a.

b.

Figure 7. Approximation with splines.

approximation the image of the trimming curve. However, P0,0 and Pm,0 are computed by interpolation the image of the two end points. And P1,0 and Pm−1,0 are computed by interpolation the tangent of the image of the trimming curve at the two end points. This will guarantee the patches around the end points to have the same tangent plane. According to the exact representation, the tangent plane can be obtained from free-form deformation. The next row of the control points Pi,1 define the partial derivatives of the surface with respect to one direction. This row of control points can likewise be found by sampling the partial derivatives with the free-form deformation defined in equation (3). If you want to fit the third row of control points, you can insert one more control points before approximation to keep the perturbation regions to be in a very narrow region close to the trimming curves. However, the fitting algorithm cannot guarantee the three patches around the trimming curve to be C1 , as the case illustrated in Figure 8. In this case, the B-spline control points C, A0 , A2 and C, A1 , A3 are not collinear. In the following, we will provide a method to locally merge them into a G1 smooth surface. $



D 7

 

'

& $

7

D D D E E  

$

$

%

%

7

(a0 + a1 )a20 D1 + (a0 + a1 + a2 )(3a20 + 3a0 a1 + a21 )A1 Bˆ 1 = − a0 (3a20 + 4a0 a1 + a21 + 2a0 a2 + a1 a2 ) (a0 + a1 )2 (a0 + a1 + a2 ) C, a0 (3a20 + 4a0 a1 + a21 + 2a0 a2 + a1 a2 ) (b0 + b1 )b20 D2 + (b0 + b1 + b2 )(3b20 + 3b0 b1 + b21 )A2 Bˆ 2 = − b0 (3b20 + 4b0 b1 + b21 + 2b0 b2 + b1 b2 ) (b0 + b1 )2 (b0 + b1 + b2 ) C. b0 (3b20 + 4b0 b1 + b21 + 2b0 b2 + b1 b2 ) Notice that C and Ai lie on a same plane, and according to the free-form deformation in the last section, we can get A1 −C A0 −C A2 −C = + , a0 b3 b0 A2 −C A1 −C A3 −C = + . b0 a0 a3 Then we can modify T0 , T2 into Tˆ0 and Tˆ2 to ensure the surface to be G1 : b3 b3 (Bˆ 1 − A1 ) − (T1 − A1 ), 3(a0 + a1 ) b0 a3 a3 ˆ ˆ T2 = A2 + (B2 − A2 ) − (T1 − A2 ). 3(b0 + b1 ) a0 Tˆ0 = A1 +

Figure 9 illustrates an example where a trimmed surface is represented by B-spline surfaces exactly or approximately. The left one is represented with a B´ezier surface which is painted in blue and the other B-spline surface is in red. The right one is represented with eight B-spline surfaces with different colors. We also show the control points in this case. Figure 10 is another example for approximate representation of a trimmed surface with B-spline surfaces.



' E





E

Figure 8. G1 smooth for the extraordinary vertex for the B-spline surface. Suppose we are given the control points of a B-spline



surface and the knot intervals as illustrated in Figure 8. We will modify Bi and Ti into Bˆ i and Tˆi respectively to ensure the surface to be G1 . First, we will modify B1 , B2 into Bˆ 1 and Bˆ 2 in following equations. These equations make the boundary B´ezier curve to be quadratic which is determined by the control points C, A1 , B1 and D1 .

Figure 9. Exact representation and Approximation representation.

implement. We also provide some examples to illustrate the algorithm. As we have decomposed the trimmed NURBS surface into a set of NURBS surfaces, so we cam merge all the NURBS surfaces into one watertight T-spline surface using the algorithm in [7] and [8]. We will study some unify scheme for this conversion in the future. Figure 10. Approximating a teapot model with B-spline surfaces and zebra lines on the models. The surface is almost C2 except the regions close to the trimming curves. Both the methods of Hamann and Hui’s ([1] and [3]) effectively decomposed a trimmed surface into regular surfaces. The shapes of the patches created using Hamanns method depend on the distribution of the extremals. Patches are degenerated wherever there is a single pair of adjacent maxima and minima. Moreover, narrow patches (The grey patch) may be obtained as shown in 11. a. And it is very difficult to merge the surface because there exist very special case of several surface patches meats. The same problem will occurs in Hui’s method. The method may create many patches meet at a point which it is very difficult to study the continuity such as the patches corresponding to the face F1 and F2 in Figure 11. b and they will change the whole surface in the approximation process. However, the method in present paper will create very unify of patches connective relations. And most of the patches will kept exact the same as the origin NURBS surface.

Acknowledgement The authors are support by A National Key Basic Research Project of China (No. 2004CB318000), NSF of China (No. 60533060, 60473132 and 10626049), Chinese Academy of Science (Startup Scientific Research Foundation), Doctorial Program of MOE of China and the 111 Project (No. b07033).

References [1] B. Hamann, P. Y. Tsai, ”A tessellation algorithm for the representation of trimmed NURBS surface with arbitrary trimming curves”, Computer-Aided Design, Vol.28, pp.461472, June 1996. [2] G. Farin, Curves and Surfaces for CAGD – A Practical Guide. Morgan Kaufmann Publishers, 2002. [3] K. C. Hui, Yiu-Bun Wu, ”Feature-based decomposition of trimmed surface”, Computer-Aided Design, Vol. 37, pp.859867, Aug. 2005,. [4] L. A. Piegl and W. Tiller, ”Geometry-based triangulation of trimmed NURBS surfaces”, Computer-Aided Design. Vol.30, pp.11-18, Jan. 1998.

9

[5] M. yingLiang and Terry Hewitt, ”Adaptive Tessellation for Trimmed NURBS surfaces”, in preceeding of Eurographics, 2002.

)

)

D

E

F

Figure 11. Compared with the methods in [1] and [3].

6. Discussion And Future Work The present paper provides an algorithm to split the parametric domain of a trimmed NURBS surface into several regular four-sided regions and to represent the trimmed NURBS surface with several B-spline and B´ezier surface patches. The patches which domains are rectangle regions are kept exactly the same as the trimmed NURBS surface and the patches which domain contains the trimming curves as a boundaries are represented with high degree B´ezier patches (exactly) or bi-cubic B-spline surfaces (approximately). The algorithm is simple, efficient and easy to

[6] T. W. Sederberg and S. R. Parry, ”Free-Form Deformation of Solid Primitives”, Computer Graphics, pp.151-160, August 1986. [7] T. W. Sederberg, J. Zheng, A. Bakenov, and A. Nasri, ”Tsplines and T-NURCCs”, ACM Transactions on Graphics, Vol.22, pp.161-172, Sep. 2003. [8] T. W. Sederberg, D. L. Cardon, G. T. Finnigan, N. S. North, J. Zheng, and T. Lyche, ”T-spline simplification and local refinement”, ACM Transactions on Graphics, Vol 23, pp. 276283, Sep. 2004. [9] W. Cho, N. M. Patrikalakis and J. Peraire, ”Approximate development of trimmed patches for surface tessellation”, Computer-Aided Design, Vol.30, pp.1077-1087, 1998. [10] X. Song, T. W. Sederberg, J. Zheng, R. T. Farouki and J. Hass, ”Linear perturbation methods for topologically consistent representations of free-form surface intersections”, ComputerAided Geometric Design, Vol.21, pp.303C319, March 2004.