cad data visualization on mobile devices using sequential constrained delaunay triangulation

10
Computer-Aided Design 41 (2009) 375–384 Contents lists available at ScienceDirect Computer-Aided Design journal homepage: www.elsevier.com/locate/cad CAD data visualization on mobile devices using sequential constrained Delaunay triangulation Sang Wook Yang a , Young Choi a,* , Hyun Chan Lee b a Department of Mechanical Engineering, Chung-Ang University, 221, Huksuk-dong, Dongjak-gu, Seoul 156-756, Republic of Korea b Department of Industrial Engineering, Hongik University, 72-1, Sangsu-dong, Mapo-gu, Seoul 121-791, Republic of Korea article info Article history: Received 14 May 2008 Accepted 21 August 2008 Keywords: Mobile device Triangulation Visualization abstract 3D graphic rendering in mobile application programs is becoming increasingly popular with rapid advances in mobile device technology. Current 3D graphic rendering engines for mobile devices do not provide triangulation capabilities for surfaces; therefore, mobile 3D graphic applications have been dealing only with pre-tessellated geometric data. Since triangulation is comparatively expensive in terms of computation, real-time tessellation cannot be easily implemented on mobile devices with limited resources. No research has yet been reported on real-time triangulation on mobile devices. In this paper, we propose a real-time triangulation algorithm for visualization on mobile devices based on sequential constrained Delaunay triangulation. We apply a compact data structure and a sequential triangulation process for visualization of CAD data on mobile devices. In order to achieve a high performance and compact implementation of the triangulation, the nature of the CAD data is fully considered in the computational process. This paper also presents a prototype implementation for a mobile 3D CAD viewer running on a handheld Personal Digital Assistant (PDA). © 2008 Elsevier Ltd. All rights reserved. 1. Introduction Tessellated triangles are generally used for graphic application whenever possible, as they are directly rendered with graphic libraries. Most lightweight 3D viewers and mobile 3D applications use triangle data; however, the size of the triangle data is larger than that used in accurate geometric representation. Early graphic display on mobile devices supported only very simple 3D shape data format. Alternatively, triangulation and rendering computation requiring extensive computing time was processed on a remote server, and the pre-computed images were then transmitted and displayed on mobile devices. Subsequently, tessellated 3D shapes could be rendered easily on mobile devices using the APIs of OpenGL|ES and DirectX Mobile, and various graphic applications, including 3D games, have been developed using those APIs. These mobile graphic libraries currently support the rendering of only tessellated triangles. Su et al. [1] proposed a framework for multimedia mobile collaboration that handles 3D data as vector graphics and face mesh using Extensible Markup Language (XML). Lluch et al. [2] presented a client–server system in which a server extracts view- dependent simplified polygons of the 3D model and clients render * Corresponding author. Tel.: +82 2 820 5312; fax: +82 2 817 5101. E-mail addresses: [email protected] (S.W. Yang), [email protected] (Y. Choi), [email protected] (H.C. Lee). the polygons. Woodward et al. [3] presented an interactive mobile 3D CAD viewing system in which a compressed video stream is transmitted from the server to the client device. Zunino et al. [4] developed a rendering engine for PDA devices that dynamically adjusts the level-of-detail (LOD) of a polygonal model. However, these approaches require server systems that generate images, video streams, or polygonal data for mobile devices. Till date, there has been no research reported on real-time calculation of geometric data for visualization of 3D CAD data on mobile devices. It may appear that the hardware capability of mobile devices is insufficient to run CAD application programs; however, we draw attention to the fact that PDAs currently support more than 32 MB of memory and CPUs with clock speeds greater than 600 MHz. These specifications are analogous to those of desktop PCs used until a few years ago. We can, therefore, predict future advancements with reasonable certainty. Immediate access to 3D CAD data, without the constraints of time and location, will have a profound impact on ubiquitous manufacturing environments with wireless communication technologies [5]. 3D shapes are usually represented using parametric surfaces with boundaries in CAD and engineering applications. Therefore, the use of the triangulation process is inevitable for the visualiza- tion of such surface data on mobile devices. Real-time triangulation of CAD data on mobile devices offers some advantages over receiv- ing tessellated data from server computers. A tessellated model has to provide sufficient details to enable the users to verify or inspect the 3D model in certain applications. A high-precision tessellated 0010-4485/$ – see front matter © 2008 Elsevier Ltd. All rights reserved. doi:10.1016/j.cad.2008.08.005

Upload: snu-kr

Post on 25-Apr-2023

0 views

Category:

Documents


0 download

TRANSCRIPT

Computer-Aided Design 41 (2009) 375–384

Contents lists available at ScienceDirect

Computer-Aided Design

journal homepage: www.elsevier.com/locate/cad

CAD data visualization on mobile devices using sequential constrainedDelaunay triangulationSang Wook Yang a, Young Choi a,∗, Hyun Chan Lee ba Department of Mechanical Engineering, Chung-Ang University, 221, Huksuk-dong, Dongjak-gu, Seoul 156-756, Republic of Koreab Department of Industrial Engineering, Hongik University, 72-1, Sangsu-dong, Mapo-gu, Seoul 121-791, Republic of Korea

a r t i c l e i n f o

Article history:Received 14 May 2008Accepted 21 August 2008

Keywords:Mobile deviceTriangulationVisualization

a b s t r a c t

3D graphic rendering in mobile application programs is becoming increasingly popular with rapidadvances in mobile device technology. Current 3D graphic rendering engines for mobile devices donot provide triangulation capabilities for surfaces; therefore, mobile 3D graphic applications have beendealing only with pre-tessellated geometric data. Since triangulation is comparatively expensive in termsof computation, real-time tessellation cannot be easily implemented on mobile devices with limitedresources. No research has yet been reported on real-time triangulation on mobile devices.In this paper, we propose a real-time triangulation algorithm for visualization on mobile devices

based on sequential constrained Delaunay triangulation. We apply a compact data structure and asequential triangulation process for visualization of CAD data on mobile devices. In order to achieve ahigh performance and compact implementation of the triangulation, the nature of the CAD data is fullyconsidered in the computational process. This paper also presents a prototype implementation for amobile 3D CAD viewer running on a handheld Personal Digital Assistant (PDA).

© 2008 Elsevier Ltd. All rights reserved.

1. Introduction

Tessellated triangles are generally used for graphic applicationwhenever possible, as they are directly rendered with graphiclibraries. Most lightweight 3D viewers and mobile 3D applicationsuse triangle data; however, the size of the triangle data is largerthan that used in accurate geometric representation.Early graphic display on mobile devices supported only very

simple 3D shape data format. Alternatively, triangulation andrendering computation requiring extensive computing time wasprocessed on a remote server, and the pre-computed images werethen transmitted and displayed on mobile devices. Subsequently,tessellated 3D shapes could be rendered easily on mobile devicesusing the APIs of OpenGL|ES and DirectX Mobile, and variousgraphic applications, including 3D games, have been developedusing those APIs. These mobile graphic libraries currently supportthe rendering of only tessellated triangles.Su et al. [1] proposed a framework for multimedia mobile

collaboration that handles 3D data as vector graphics and facemesh using Extensible Markup Language (XML). Lluch et al. [2]presented a client–server system in which a server extracts view-dependent simplified polygons of the 3D model and clients render

∗ Corresponding author. Tel.: +82 2 820 5312; fax: +82 2 817 5101.E-mail addresses: [email protected] (S.W. Yang), [email protected]

(Y. Choi), [email protected] (H.C. Lee).

0010-4485/$ – see front matter© 2008 Elsevier Ltd. All rights reserved.doi:10.1016/j.cad.2008.08.005

the polygons. Woodward et al. [3] presented an interactive mobile3D CAD viewing system in which a compressed video stream istransmitted from the server to the client device. Zunino et al. [4]developed a rendering engine for PDA devices that dynamicallyadjusts the level-of-detail (LOD) of a polygonal model. However,these approaches require server systems that generate images,video streams, or polygonal data for mobile devices. Till date,there has been no research reported on real-time calculation ofgeometric data for visualization of 3D CAD data on mobile devices.It may appear that the hardware capability of mobile devices is

insufficient to run CAD application programs; however, we drawattention to the fact that PDAs currently support more than 32MB of memory and CPUs with clock speeds greater than 600MHz. These specifications are analogous to those of desktop PCsused until a few years ago. We can, therefore, predict futureadvancements with reasonable certainty. Immediate access to 3DCAD data, without the constraints of time and location, will have aprofound impact on ubiquitous manufacturing environments withwireless communication technologies [5].3D shapes are usually represented using parametric surfaces

with boundaries in CAD and engineering applications. Therefore,the use of the triangulation process is inevitable for the visualiza-tion of such surface data onmobile devices. Real-time triangulationof CAD data onmobile devices offers some advantages over receiv-ing tessellated data from server computers. A tessellatedmodel hasto provide sufficient details to enable the users to verify or inspectthe 3D model in certain applications. A high-precision tessellated

376 S.W. Yang et al. / Computer-Aided Design 41 (2009) 375–384

Fig. 1. The ANC101 block and its triangulations.

model contains a large number of sampled points and triangles.Dynamic tessellation of exact and compact geometric representa-tions on mobile devices will eliminate the potentially significantcommunication bottleneck due to the transmission of a large vol-ume of tessellated data. The data size is crucial in mobile networkenvironments because the communication bandwidth of wirelessnetworks is much narrower than that of wired networks.For efficient visualization of CAD data on mobile devices, we

consider the nature of the 3D CAD data as an input to thetriangulation process. In a CAD model, a surface generally consistsof a surface geometry and boundary edges. Since the boundaryedges are ordered with their directions in a loop, boundaryedges are sequentially traversed for computation. Additionally,since free-form surfaces such as NURBS and Bezier surfaces havecurvatures, points on the boundary loop as well as those on thesurfaces need to be inserted into the triangulation process.In this paper, we propose a triangulation process for mobile

devices in the following sequence. In Section 2, we address therequirements for efficient visualization of bounded surfaces in CADmodel and propose a triangulation process. In Section 3,we explainstepwise the proposed triangulation process along with a compactdata structure. In Section 4, we explain the implementation of theproposed triangulation process and the experimental results. InSection 5, we present our conclusions.

2. Visualization of bounded surfaces of CAD data

2.1. Requirements for efficient visualization

In most cases, CAD data is represented as solids with boundaryrepresentation, wherein the boundary surfaces are represented astrimmed parametric, quadric, or planar surfaces. For the graphicrendering of a model such as that shown in Fig. 1(a), the surfacesof the model must be triangulated as shown in Fig. 1(b) or Fig. 1(c).The model in the figure is the ANSI/ANC101 block commonly usedto evaluate CAD/CAM application software.The triangulation in Fig. 1(b) was processed using the ANSYS

11.0 mesh generator and that in Fig. 1(c) was processed using ourimplementation. From the finite element analysis point of view,Fig. 1(b) is a better triangulation than Fig. 1(c) because the trianglesin Fig. 1(c) are far from being approximately regular. In general,triangle mesh with near regular shapes renders better simulationresult in engineering analysis. However, the triangulation inFig. 1(c) is considered superior for the purpose of visualizationbecause it contains fewer triangles while maintaining the samelevel of visual approximation. Fig. 1(b) has 22 610 triangles, whileFig. 1(c) has only 2 676 triangles.In a process of triangulation for visualization, points are

sampled sequentially along the boundary edges of surfacesbased on the tolerance requirement and curvature of the edge.These points then act as generators of the triangulation. Sincetwo neighboring surfaces share an edge in spite of havingdifferent geometric equations, the triangulated surfaces have toshare sampled points along the shared boundary in order to

accomplish a water-tight triangulation for the solid. In a water-tight triangulation, each triangle edge is shared by exactly twotriangles [6]. Fig. 2 shows an example of awater-tight triangulationof a solid. Fig. 2(b) is the magnified figure of the dotted box onFig. 2(a). Fig. 2(b) shows that all the edges are topologically sharedby two triangles.

2.2. Overall triangulation process

Triangulation of parametric surfaces in the 3D object space isusually carried out in the 2D parametric space under a predefinedtolerance. The 2D triangles thus generated are thenmappedback tothe object space [7–9]. O’Rouke summarized various triangulationalgorithms and their histories in his book [10]. Su and Drysdaleclassified sequential Delaunay triangulations into five categoriesand experimentally compared their performances [11]. Sadoyanet al. presented a uniform triangulation algorithm for CAD thatforms a Cartesian lattice to divide the parametric domain intoadjacent rectangular cells [9]. These cells are used to generatenon-intersecting polygons without holes, and the density of thepartitioning lines is selected based on surface curvatures.Two characteristics of curved surfaces in CAD data are taken

into consideration for triangulation. Firstly, each boundary loopof each surface is composed of a sequential list of edges.Secondly, the internal points for curvature consideration areadaptively generated during the triangulation. We therefore usean incremental construction algorithm of Constrained DelaunayTriangulation (CDT) for a computationally fast and compactimplementation so that the prototype implementation can run onmobile devices. We formulated the following three steps for thebounded surface triangulation process:Step1: Build a CDTwhile tracing the boundary loops of a surface.Step 2: Add internal points to the triangulation to consider

surface curvature.Step 3: Select triangles that lie within the surface boundaries.Fig. 3 shows a simple curved solid block and its triangulation

generated using our approach. The sample solidmodelwas createdusing Pro/EngineerTM.The triangulations in Fig. 4 represent the results of individual

steps of our visualization process carried out for the top surface ofthe block shown in Fig. 3.In Step 1, as represented in Fig. 4(a), the curves of the inner

and outer loops are converted into approximating polylines inthe parametric domain. Each resulting segment of the polylinesbecomes a constraint edge with a direction in the boundary loop.In this step, triangles are generated using boundary edges alone. InStep 2, as represented in Fig. 4(b), internal points are added to thetriangulation. The points in Fig. 4(b) that do not appear in Fig. 4(a)are generated to take into consideration the surface curvature. Forplanar surfaces, this step will not be necessary. In Fig. 4(b), thepoints outside the surface boundary are intentionally retained forcomputational efficiency. The computation for the in–out test ofthe points is more expensive than that required when these pointsare added to the triangulation. The dummy triangles placed outside

S.W. Yang et al. / Computer-Aided Design 41 (2009) 375–384 377

Fig. 2. Water-tight triangulation.

Fig. 3. A simple block and its triangulation.

Fig. 4. Three steps in the triangulation of a bounded curved surface.

the boundaries are removed easily in Step 3. The time cost analysisfor this computation strategy is discussed in Sections 3.3 and 4.3.Fig. 4(c) represents the result obtained from Step 3.

3. Proposed triangulation process

The compact data structure used throughout the triangulationprocess is discussed in Section 3.1. The three steps briefly discussedin the previous section are then elaborated in Sections 3.2–3.4.

3.1. A compact data structure for triangulation

A simple array-based representation called interworld datastructure [12] had been devised for the topology of a quasi-triangulation that is a dual structure of the Voronoi diagram of3D spheres in the Euclidean distance metric. We propose a newdata structure called Constraints Embedded Triangle (CET) datastructure which is simpler than the interworld data structuredevised for the representation of tetrahedra in 3D space. The CET

data structure not only represents triangles but also constraintinformation that is efficient for constrained triangulation in 2Ddomain.Denoting a vertex as v, a set of n vertices can be denoted as

V = {v} = {v0, v1, . . . , vn−1}. A set of l constraint edges can bedenoted as C = {c} = {c0, c1, . . . , cl−1}, where c = (vi, vj), i 6= j,0 ≤ i, j < n. A triangulation of V and C can be stored in an array ofm triangles T (V , C) = {t} = {t0, t1, . . . , tm−1}, where

v = (x, y, L) (1)t = (M0,M1,M2,N0,N1,N2, f0, f1, f2). (2)

x and y in Eq. (1) are Cartesian coordinates on the parametricdomain, and L denotes an index of one of the triangles connectedto v. This index is the minimal information that enables traversalfrom an arbitrary vertex. In Eq. (2), Mi denotes an array index ofa vertex in V . The vertices referenced by M0, M1, and M2 are inthe counter-clockwise order in the parametric domain. Ni denotesan array index of a triangle in T . The triangle referenced by Ni is aneighbor to triangle t and not connected to the vertex referenced

378 S.W. Yang et al. / Computer-Aided Design 41 (2009) 375–384

Fig. 5. An example of a CDT with indexed vertices and triangles.

Table 1Triangle array data for the triangulation in Fig. 5.

t M0 M1 M2 N0 N1 N2 f0 f1 f2

t0 5 0 1 ∅ 7 6 1 0 0t1 0 4 8 5 ∅ 10 0 0 2t2 3 2 1 7 ∅ 3 2 0 2t3 6 2 3 2 9 8 1 0 0t4 7 4 3 9 ∅ 5 2 0 0t5 8 4 7 4 ∅ 1 0 0 0t6 6 0 5 0 8 10 0 0 0t7 5 1 2 2 8 0 1 0 0t8 5 2 6 3 6 7 0 0 0t9 6 3 4 4 10 3 1 0 0t10 6 4 0 1 6 9 1 0 0

by Mi. The indices can be represented as pointers or references inthe implementation. The constraint edge information is implicitlystored in the data structure t . fi is a flag indicatingwhether the edgethat is not connected to the vertex referenced byMi is a constraintedge or not. The flag value is an enumeration of {0, 1, 2}. The value0 implies that the indicated edge is not a constraint edge. The value1 implies that the indicated edge of t is a constraint edge, whosedirection in the context of the triangle is the same as the directionof the edge in the context of the boundary loop. The value 2 impliesthat the indicated edge of t is a constraint edge whose direction inthe context of the triangle is opposite to the direction of the edge inthe context of the boundary loop. With this flag, the data structurecan represent not only the topology of the triangulation but alsoconstraint edge information. Since each flag can be expressed withtwo bits, only one byte is sufficient to represent three flags.Fig. 5 shows an example of a CDT T (V , C) = {t0, t1, . . . , t10} for

V = {v0, v1, . . . , v8} and constraint edges C = {(v0, v1), (v1, v2),(v2, v3), (v3, v4), (v4, v0)}. Note that C constitutes an edge loop,and the vertices in the loop are ordered in the counter-clockwisedirection.Table 1 enumerates the triangulation data for vertices with a

constraint edge loop in Fig. 5. The data structure describes notonly the adjacency of the triangles and vertices but also theedge constraints. See the row corresponding to t3 = ((6, 2, 3),(2, 9, 8), (1, 0, 0)) in Table 1. Each number of the first threenumbers is a vertex index and these three numbers mean thatt3 consists of v6, v2, and v3, ordered in the counter-clockwisedirection. The second three numbers indicate adjacent triangles.The adjacent triangles t2, t9, and t8 indicated by indices (2, 9, 8) arelocated on the opposite side of the corresponding vertices v6, v2,and v3. The last three numbers describe attributes of edges. In thetriangle t3, the edge located on the opposite side of v6 is a constraintedge and its direction in t3 is the same as the direction of the edge inthe boundary loop. Therefore, the value of the corresponding flag f0is 1. In the third row of Table 1, which describes t2, the index valuefor N2 is 3, and the corresponding edge flag f2 has a value of 2. Thisshows that the edge between v2 and v3 bears different flag valueswhen the edge is used in t3 and when it is used in t2 respectively.

This simple data structure is very important in our visualizationprocess since it includes all the information for a constrained trian-gulation in a compact and complete manner. In our implementa-tion, the vertices are contained in a kd-tree data structure and theindices are coded as pointers.

3.2. Sequential CDT with boundary edges

The incremental algorithm is easy to implement and allowsinsertion of new points in a dynamic manner [13]. The incre-mental construction procedure consists of ‘‘Locate’’ and ‘‘Update’’steps [10,13]. The Locate step involves finding a candidate regionformodificationwhen a new site is added to the Delaunay triangu-lation. The triangulation is modified in the Update step. Since theUpdate process in CDT requires only linear time complexity [11],the Locate process is the bottleneck in the entire computationprocedure. Several researches that deal with efficient searchinghave been reported. Bentley et al. [15] proposed the average O(n)construction algorithm for adding n uniformly distributed sites.Boissonnat [14] proposed a method to speed up the processby using a search tree formed using the history that is savedduring incremental computation. Guibas and Stolfi [16] showedthat starting from an arbitrary point in the uniformly distributedpoint set, O(

√n) is the time required in the worst case for se-

quentially searching triangles in the direction toward a specifiedpoint. Ohya et al. [17] proposed an acceleration algorithm usingbucket data structure. Zhao and Bikdash [18] presented a Locatealgorithmbased on range searching, derived a bound on the graph-theoretical radius (GTR), and analytically characterized the GTR interms of the sharpness of the element angles.In our approach, sequentially sampled constraint edges along

boundary curves are the input data for the CDT process.Sequentially connected constraint edges are obtained from theordered edges in boundary loops in a CAD data representation.When the constraint edges are sequentially added, the Locateprocess starts from the tip of the previously inserted edge. Withthis approach,we can process the CDTwith an empirically constanttime. Fig. 6 shows the snap-shots of a triangulation process asconstraint edges are added from boundary curves. The surface hastwo boundary loops, one is the outer boundary and the other isthe inner boundary representing a hole. Fig. 6(a) and (b) showthe outer loop being incrementally added, while Fig. 6(c), (d), (e),and (f) show the inner loop being incrementally added. The thicklines in Fig. 6 are the constraint edges that were obtained fromboundary loops. Fig. 6(c) and (d) show the incremental addition ofa disconnected constraint edge fromanew loop. Unlike the processof incrementally adding connected constraint edges, the Locateprocess that results in Fig. 6(c) requires that the nearest point fromthe current triangulation be located. In this case,we use the kd-treeto locate the nearest vertex in the current triangulation.Our approach uses Anglada’s incremental algorithm [13] with

the proposed CET data structure. The Locate step is accomplishedby our own algorithm and the Update step is by Anglada’salgorithm. The problem definition of the Locate step is to find anenclosing triangle te in a triangulation T (V , C) for a new point p,whereV = {v0, v1, . . . , vn−1} and p 6∈ V . Our Locate process startsfrom vn−1.We define an operator resulting in a vertex vop(t,Mi) = vMi and

an operator resulting in a triangle top(t,Nj) = tNj, where vMi ∈ Vand tNj ∈ T . The operator vop(t,Mi) returns a vertex indicated byMiof triangle t , and the operator top(t,Nj) returns an adjacent triangleindicated byNj of t . A triangle edge is denoted as a pair (t, k), wherek = 0, 1, 2. The edge (t, k) then follows the orientation of t and isshared by two adjacent triangles t and top(t,Nk).When a new point p is encountered, the following steps are

performed in the Locate process:

S.W. Yang et al. / Computer-Aided Design 41 (2009) 375–384 379

Fig. 6. Snap-shots of an incremental CDT process.

Fig. 7. An example of the Locate process for a new point p.

Step 1: Find a triangle t0, where an edge (t0, k) is intersected bythe segment vn−1p and vop(t0,Mk) = vn−1. If t0 encloses p, then sette = t0 and quit. Else, set current triangle t = t0.Step 2: Determine l, where top(top(t,Nk),Nl) = t . Move to next

triangle t = top(t,Nk).Step 3: If t encloses p, then te = t . Quit.Step 4: Find an edge (t, j) intersected by vn−1p, where j 6= l.Step 5: Set k = j and continue to Step 2.Fig. 7 depicts the Locate algorithm. Assume that vn−1 has a

pointer to tr . In Step 1, we can use the adjacency information fromthe data structure to traverse from tr to the intersecting triangle,in this case t0, along either the clockwise or counter-clockwisedirection. The direction of traversal is decided based on the anglesbetween vn−1p and the two edges of tr emanating from vn−1. Sincet0 does not enclose p in this case, we proceed to the next step. InStep 2, we move to the next triangle t1 determined by top(t0,Nk),where k satisfies vop(t0,Mk) = vn−1. In Step 3, since the currenttriangle t1 does not enclose point p, we proceed to the next step.In Step 4, we find a new intersecting edge with vn−1p and restartfrom Step 2. Since t2 encloses p, the process terminates.However, when starting a new edge loop or adding an isolated

point, there is no previous vertex to refer. Therefore, we need todecide a reference point in order to locate the triangle containingthe new point. Although we can use an arbitrary v ∈ V as thestarting vertex, this approach is computationally inefficient for alarge number of triangles. Therefore, we use the kd-tree to locatethe nearest point as a reference point. The kd-tree is known to have

a maximum time complexity of O(log n) for finding the nearestpoint in a k-dimensional space [19].After te is found, the triangulation T (V , C) is updated with the

newly added point and constraint edge by the Update process.When a new vertex is added to the triangulation T , te is splitinto three triangles. One or more triangles adjacent to te mayoccasionally violate the empty circle property [11,13]. In Fig. 8(a),two triangles do not satisfy the empty circle property. An operationcalled ‘‘edge swap’’ or ‘‘edge flip’’ [11,13,16] is applied to removethis redundancy, as shown in Fig. 8(b). Fig. 8(c) depicts the casewhere no edge in the new triangulation coincides with the newlyadded constraint edge. In this case, all the triangles intersectingwith the new constraint edge are identified. The intersectingtriangular region is then divided into two separate regions by theconstraint edge, and each region is re-triangulated. Fig. 8(d) showsthe final result. More details of Update process with constraintedges can be found in [13].

3.3. Curved surface approximation

In general, achieving a balance between the number of trianglesand the rendering quality is important; however, a small numberof triangles is preferable for mobile devices with relatively lowhardware capabilities. While triangulation that does not takeinto account surface curvature may yield minimum number oftriangles, it does not properly incorporate the internal shapes ofcurved surfaces. Fig. 9 shows an example of improper triangulationthat does not consider the curvature of the original surface. Thetriangulation to the right is a CDT generated by boundary edgesalone.The surface marked with the dotted circle in Fig. 9 is part of

a cylindrical surface; the right side of the figure represents thecorresponding boundary in the parametric domain. The cylindricalsurface is parameterized with a two-degree equation in the u-direction and a one-degree equation in the v-direction. Since thecurvature characteristics were ignored, the triangulation on theright side of Fig. 9 has two large triangles, resulting in improperrendering of the surface.The most popular method to reflect surface curvature is

adaptive triangulation that generates a larger number of triangles

380 S.W. Yang et al. / Computer-Aided Design 41 (2009) 375–384

(a) Splitting the enclosing triangle ofp in T .

(b) Edge swap. (c) Inserting a constraint edge. (d) Update completed: new T .

Fig. 8. An example of the Update process when a constraint edge is added.

Fig. 9. Improper triangulation caused by ignoring the curvature of a surface.

inside the surface. We applied a simple method to reflect surfacecurvature because optimal surface approximation is not theprimary concern of our research. First, the parametric domain issplit into a small number of grids. For a NURBS surface, knot valuesare used as the grid border. A grid is then recursively split intofour if the deviation at the center of the grid is larger than a giventolerance.The internal points in Fig. 4(b) and Fig. 10 are generated for

reflecting surface curvature. Note that the generated points maylie either inside or outside the surface boundaries. If we insert thepoints only in the inner region of the surface boundaries, we mustcarry out the in–out test for each point. It costs a computation timeof O(nm) for n constraint edge segments withm generated points;this represents a considerable time cost. We therefore decidednot to eliminate the points lying outside. Constructing triangleswith redundant points costs less than performing the in–out test.Its computational effect is further discussed in Section 4.3 withexperimental data.

3.4. Selecting triangles in the inner region

In Fig. 4(c), the triangles bounded with loops are shaded. Theshaded triangles are internal triangles and are the ‘‘real’’ trianglesto be drawn. Triangles are generated on both inner and outer

regions in order to avoid the expensive in–out test. Therefore, theinner triangles need to be selected. Theprocess for this is as follows.Step 1: Insert all edges (t, i) into a queue, where at least one of

the flag values fi of t equals 1. If the flag value 1 appears more thanonce, the first flag index i is chosen.Step 2: Pop an edge (t, i) from the queue. t is judged as an inner

triangle.Step 3: If a flag of t , fj = 0 (where j 6= i and j = 0, 1, 2) and

the adjacent triangle top(t,Nj) has not yet been judged as an innertriangle, then find k, where top(top(t,Nj),Nk) = t . Insert the pair(top(t,Nj), k) into the queue.Step 4: If the queue is not empty, continue to Step 2. Else,

terminate the process.The shaded triangles in Fig. 10(a) are those selected in Step 1.

Fig. 10(b) shows the propagation process corresponding to Steps2–4. The newly selected triangles in Fig. 10(b) share at least oneedge with the shaded triangles in Fig. 10(a). Propagation continuesuntil the queue is empty, as shown in Fig. 10(c).

4. Implementation and experimental results

4.1. An implementation of the mobile CAD data viewer

Fig. 11 depicts the architecture of the 3D CAD viewer for aPDA. All modules in the figure run on a PDA. The viewer consistsof the following four modules. (a) The first module reads a STEP(STandard for Exchange of Product model data) physical file asinput data for CAD. (b) All the edge curves in a CADmodel data areapproximated into 3D polylines; these polylines are then mappedonto parametric domains of each surface along the direction of thesurface loops. (c) 2D sequential CDT is performedon the parametricspace of each surface. (d) The triangles calculated on theparametricdomain are mapped back to the 3D space and rendered on a PDAusing OpenGL|ES or DirectX Mobile graphic APIs.We implemented a 3D CAD viewer application program that

runs on a PDA device based on our sequential CDT process.With the exception of graphic rendering libraries, the STEP dataparser and geometry calculationmodules were implemented fromscratch in order to develop compact and fast program modulesrunning on mobile devices. The proposed triangulation process

Fig. 10. Selection of inner triangles.

S.W. Yang et al. / Computer-Aided Design 41 (2009) 375–384 381

Fig. 11. A CAD visualization software on a PDA.

Table 2A comparison among CAD data, triangulated data, and exact visualization data.

Comparison of model data sizes

CAD data (STEP) No. of surfaces 98 270No. of boundary curves 206 692No. of boundary loops 131 346Data size (STEP file) 138 KB 440 KB

Triangulated data No. of triangles 2676 10161Data size 118 KB 216 KB

Visualization data No. of vertices (3) 151 488No. of planes (12) 56 140No. of conic surfaces (14) 42 132No. of lines (2) 23 422No. of conic curves (15) 83 270Data size 14 KB 28 KB

is implemented in C++ programming language and developedusingMicrosoft Visual Studio 2005, MicrosoftWindowsMobile 5.0Pocket PC SDK, DirectX mobile, and OpenGL|ES 1.1. Fig. 11(d) wascaptured from Windows Mobile 5.0 Pocket PC Emulator, which isused for developing PDA programs on desktop computers. All thetests and performancemeasurements in this paper were run on anHP hx2790b PDA with a 624 MHz CPU clock and 32 MB memory.

4.2. Comparison of data size between triangulated data and exactgeometry data

The prototype viewer currently reads in STEP physical filesand they contain B-rep solid models. A STEP physical file is nota compact data since it is in the uncompressed text format andincludes entities that are not needed for visualization. If we extractgeometric entities for visualization from STEP data and re-writethem in a binary format, the size of the model data becomescompact as in Table 2.Table 2 shows data size comparison among the size of

STEP physical file, triangulated data, and exact geometry basedvisualization data. In the table, the sizes of triangulated data are118 KB and 216 KB, and the sizes of corresponding exact geometrybased visualization data are 14 KB and 28 KB. We can see thatthe exact geometry based visualization data has much smaller

size than the size of triangulated data. It is extracted from STEPB-rep data and composed of geometric entities to be visualized. Thenumber in the brace indicates sum of the number of indices andthe number of single precision floating data required to representthe corresponding geometric entity. For example, a plane geometryconsists of a vector for location and three vectors for direction.Since a vector can be denoted by three floating point data in the 3Dspace, a plane can be denoted by twelve floating point numbers.The number 12 shown in the item ‘No. of planes (12)’ indicatesnumber of floating point data necessary to describe a plane. Thenumbers of triangles in the table was determined based on thereasonable quality of visualization on 640×480 resolution displaythat is most popular for currently used PDAs.

4.3. Experiments for measuring triangulation performance

The triangulations in Figs. 4 and 10 have 110 constraintedge segments and 66 inserted points. We measured thetriangulation performance for the same model with varyingnumber of constraint edges and inserted points. The results showthat our sequential algorithm has linear time consumption. Forexperimental purposes, internal points were inserted first andconstraint edgeswere added subsequently in order to observe howthe calculation time for sequential CDT is affected by the numberof points.

382 S.W. Yang et al. / Computer-Aided Design 41 (2009) 375–384

(a) 116 pts. (b) 266 pts. (c) 516 pts.

Fig. 12. Test data for Table 2 and Fig. 13.

Fig. 13. Sequential CDT time with varying number of pre-inserted points.

Fig. 12 shows test data with varying number of insertion pointsand 110 fixed constraint edges. Table 3 lists the calculation timesfor triangulation of the surfaces in Fig. 12. The computation timenoted as ‘‘Full triangulation time’’ is the time taken for insertingsurface points aswell as boundary edges,while that noted as ‘‘Timefor sequential constraints insertion’’ is the time taken for insertingboundary edges alone.Fig. 13 is a graphwhich shows that the computation time for full

triangulation is proportional to the number of pre-inserted points.Construction with constraint edges is affected to a very smallextent by the number of pre-inserted points. This implies thatthe computation time required for our sequential CDT dependsdominantly on the number of edge segments and to a very smallextent on the number of pre-inserted points.Fig. 14 shows another experimental result for the data shown in

Fig. 15. This experiment showshow thenumber of constraint edgesaffects the computation time for sequential construction insertionwhen the number of inserted points is fixed. In the graph, theconstraint insertion time is proportional to the number of edgesegments, and the time increases only slightly with increasingnumber of pre-inserted points.Fig. 15 shows the sample data used in the experiment

corresponding to the graph of Fig. 14. The holes are inserted toincrease the number of constraint edge segments. If the density ofthe inserted points increases, the frequency of an edge segmentintersecting a triangle increases. This explains why, as shown inFig. 14, the computation time for the data with large number of

Fig. 14. Computing time for sequential constraint insertion.

Table 3Triangulation times for varying number of insertion points, with 110 fixedconstraint edge segments.

Number of pre-inserted points 66 116 266 366 516 666

Full triangulation time 182 248 465 588 828 1023Time for sequential constraints insertion 129 136 164 162 169 174

(Unit: milliseconds).

pre-inserted points increases more rapidly than the time taken forthe data with small number of pre-inserted points.For test purposes, the CAD models in Fig. 16 are visualized

and CDT computation times for each model are measured on aPDA. The models shown in Fig. 16 are taken from the NationalDesign Repository [20]. The number appearing below each modelindicates the number of constraint edge segments.The models are tested with three Locate methods. The first

method finds the nearest existing vertex to a newly added pointusing the kd-tree. The second method randomizes the sequenceof edge segments in order to optimize the search tree. The thirdis our sequential Locate method. The test results, excluding theinternal points, are shown in Fig. 17. For a fair comparison of thethree Locate methods, we replaced only the Locate module in ourexperimental program. The result shows that our sequential Locatemethod is the fastest.Fig. 18 shows pictures of the test models in Fig. 16 being

displayed on a PDA. The triangulation is performed on the PDAand viewed with a dynamic user interface. Users can rotate,zoom, and pan the model with a stylus pen. The triangulationtime for the rightmost model with 9 480 edges is approximately10 s. The speed, although not as fast as that of desktop CADviewers, is reasonably acceptable for practical use andwill become

S.W. Yang et al. / Computer-Aided Design 41 (2009) 375–384 383

Fig. 15. Test data for varying number of edges and insertion points.

Fig. 16. Test models for measuring CDT computation time on a PDA.

Fig. 17. Comparison of three Locate methods.

fast enough with the rather quick advance in performance ofprocessors. The implemented viewer also providesmulti-threadedtriangulation. After reading a STEP physical file, the viewer showsa wireframe model for user interaction, while the triangulation isprocessed in the background thread.

5. Conclusions

Since thepurpose of theCDTprocess discussed in this paper is toapply awhole visualization process for CAD data tomobile devices,efficiency of computation and compactness of data structure inthe CDT process are the most important aspects to be considered.For efficient triangulation, we devised a sequential CDT processthat utilizes the characteristic of B-rep CAD data that a surface hasordered lists of boundary edges. For compactness, we devised CETdata structure representing constraint edges in the triangle datawithminimalmemory requirement. The results of experiments forsurfaces show that the CDT process has linear computation time.The test results for variousmodel data show that the implementedsoftware has a reasonable computational performance for thevisualization of CAD data on a PDA in practical applications.The proposed approach for 3D CAD visualization on mobile

devices has three advantages over visualization methods in earlier

384 S.W. Yang et al. / Computer-Aided Design 41 (2009) 375–384

Fig. 18. 3D CAD models on PDAs.

researches [1–4]. Firstly, no complex translation or data conversionis required in order to visualize CAD data on a PDA. If wewant to reduce the size of the model data to be transferred tomobile devices, only extraction of geometries and compression arenecessary. Themobile viewer triangulates CAD data directly on themobile device. Secondly, the LOD can be easily controlled in viewerapplications. The LOD can be handled in the triangulation modulesof the mobile viewer. Thirdly, the wireless data transmission tomobile devices is faster because the size of accurate geometryrepresentation is much smaller than that of pre-tessellated data.The prototype implementation can be further improved forpractical application using adaptive internal point generation foroptimal surface approximation and definition of visualization databased on exact geometries.

Acknowledgements

This work was supported by the Korea Science and EngineeringFoundation (KOSEF) grants (R11-2007-028-03001-0 and R01-2006-000-10327-0) funded by the Korea government (MEST).

References

[1] Su X, Prabhu BS, Chu CC, Gadh R. Middleware for multimedia mobile collab-orative system. In: Proceedings of 3rd annual wireless telecommunicationssymposium. 2004; p. 112–9.

[2] Lluch J, Gait’an R, Camahort E, Viv’o R. Interactive three-dimensional renderingonmobile computer devices. ACM International Conference Proceeding Series2005;265:254–7.

[3] Woodward C, Valli S, Honkamaa P, Hakkarainen M. Wireless 3D CAD viewingon a PDA device. In: Proceedings of the 2nd Asian international mobilecomputing conference. 2002; p. 83–7.

[4] Zunino C, Lamberti F, Sanna A. A 3d multiresolution rendering engine for PDAdevices. SCI 2003;5:538–42.

[5] Zhekun L, Gadh R, Yujin R, Prabhu BS. Study of potential of wireless internettechnologies in manufacturing. In: Proceedings of the third internationalconference on electronic commerce engineering. 2003; p. 426–8.

[6] Haimes R, Aftosmis MJ. Watertight anisotropic surface meshing usingquadrilateral patches. In: 13th international meshing roundtable. 2004.

[7] Ghassemi F. Automatic mesh generation scheme for a two or threedimensional triangular curved surface. Computers and Structures 1982;15:613–26.

[8] Anastasiou K, Chan CT. Automatic triangular mesh generation scheme forcurved surfaces. Communications in Numerical Methods in Engineering 1996;12:197–208.

[9] Sadoyan H, Zakarian A, Avagyan V, Mohanty P. Robust uniform triangulationalgorithm for computer aided design. Computer-Aided Design 2006;38(10):1134–44.

[10] O’Rouke J. Computational geometry in C. 2nd ed. Cambridge University Press;1998.

[11] Su P, Drysdale RL. A comparison of sequential Delaunay triangulationalgorithms. Symposium on Computational Geometry 1995;61–70.

[12] Kim DS, Kim D, Cho Y, Sugihara K. Quasi-triangulation and interworld datastructure in three dimensions. Computer Aided Design 2006;38(7):808–19.

[13] Anglada MV. An improved incremental algorithm for constructing restrictedDelaunay triangulations. Computers Graphics 1997;21:215–23.

[14] Boissonnat JD, Teillaud M. On the randomized construction of the Delaunaytree. Theoretical Computer Science 1993;112:339–54.

[15] Bentley JL, Weide BW, Yao AC. Optimal expected time algorithms forclosest point problems. ACM Transactions on Mathematical Software 1980;6:563–80.

[16] Guibas L, Stolfi J. Primitives for the manipulation of general subdivisions andthe computation of Voronoi diagrams. ACM Transactions on Graphics 1985;4:75–123.

[17] Ohya T, Iri M, Murota K. A fast Voronoi-diagram algorithm with quaternarytree bucketing. Information Processing Letters 1984;8:227–31.

[18] Zhao H, Bikdash M. Algorithm to locate points in a Delaunay triangulation.In: Proceedings of the 38th southeastern symposium on system theory. 2006;p. 211–5.

[19] Bentley JL. Multidimensional binary search trees used for associativesearching. Communications of ACM 1975;18:509–17.

[20] National design repository. http://www.designrepository.org.