Computer-Aided Design 35 (2003) 807–812 www.elsevier.com/locate/cad
A tolerant approach to reconstruct topology from unorganized trimmed surfaces Joon C. Park, Yun C. Chung* DDM Center, Cubictek co., Ltd, 1101 DeungChon-dong, Kanseo-gu, 157-030 Seoul, South Korea Received 3 February 2002; received in revised form 28 May 2002; accepted 29 May 2002
Abstract Presented in this paper is a topology reconstruction algorithm from a set of unorganized trimmed surfaces. Error-prone small geometric elements are handled to give proper topological information. It gives complete topology to topologically complete models, and it is also tolerant to incomplete models. The proposed algorithm is vertex-based in that clues for topological information are searched from the set of vertices first, not from that of edges. q 2003 Elsevier Science Ltd. All rights reserved. Keywords: Topology reconstruction; Vertex-based algorithm; Common edge
1. Introduction As the application of CAD/CAM becomes universal at various stages of product realization cycle, commercial CAD/CAM systems tend to be used as a specialized tool for a specific application. As a result, it has been frequent and necessary to exchange CAD data among different CAD/CAM systems [1]. For the purpose of exchanging CAD data, neutral file formats such as initial graphics exchange specification (IGES) [2] or drawing interchange file format (DXF) [3] are commonly used. But these formats are not sufficient in or incapable of transferring topological information. IGES (later than version 5.2) and the standard for the exchange of product model data (STEP) [4] can convey topological information in addition to geometrical information. Not all systems handle topological information like CATIA (version 4.x). Lots of systems generate neutral files without topological information even though they handle the information. Even if the topological information is transferred via neutral file formats, the exchange could be wrong due to the lack of appropriate functions in pre- or post-processors implemented within systems [5]. Topological information is compulsory in several areas such as CAM, rapid prototyping (RP) processes, and finite element method (FEM) mesh generation. Especially in the field of CAM, it is a time consuming or almost impossible job to protect sharp convex regions or to get a machining * Corresponding author. Tel.: þ 82-2-3664-4700; fax: þ82-2-3664-4701. E-mail address:
[email protected] (Y.C. Chung).
area exactly covering some connected faces without topological information [6 – 8]. Recently solid modelers are widely adopted in many areas. Solid model itself has complete topological information, but it is lost during data interface via neutral file. So, it is important to reconstruct the original topological information embedded in the solid model. In the previous works, they use edge-based approaches for surface models and vertex-based ones for facet models to construct topological information. They are focused on the construction of topology, not on the reconstruction of it. Reconstruction of topology means the process of recovery of the topological information originally embedded in the input model. It is common that small geometric elements as shown in Fig. 1 are not properly handled. Short edges (Fig. 1(a)), strip-shaped narrow surface (Fig. 1(b)) and narrow part of a surface (Fig. 1(c)) are typical examples. Topology around these small geometric elements or shapes should be exactly constructed because they could be more important features rather than bigger ones. Evensen and Dokken [8] deals with untrimmed surfaces only and cannot treat ordinary CAD data usually consisting of trimmed surfaces. Rock and Wozny [9] and Barequet and Sharir [10] deal with triangular facet models and polygonal facet models, respectively. They proposed algorithms based on the concept of vertex-merging, which firstly checks vertex equivalence with the user-given tolerance. To reduce search time, special data structure like AVL-tree or range searching technique is adopted.
0010-4485/03/$ - see front matter q 2003 Elsevier Science Ltd. All rights reserved. PII: S 0 0 1 0 - 4 4 8 5 ( 0 2 ) 0 0 1 0 5 - 7
808
J.C. Park, Y.C. Chung / Computer-Aided Design 35 (2003) 807–812
Fig. 1. Error-prone small geometric elements.
Sheng and Meier [11] takes an edge-based approach for surface models consisting of trimmed surfaces. Here every trimming curve is sampled into a point-sequence curve or a PS-curve, which is a sequence of points representing a curve. They take clues for topology from the unique matching segments where a segment means a line segment connecting two consecutive sampled points. The constructed topology around strip-shaped narrow surfaces may be inconsistent. In other words, the resulting topology becomes different according to the unique matching segment that is a seed for zipping. In Barequet and Sharir [10], connected facets’ polygonal boundary curves, which may be regarded as trimming loops, are sampled into PS-curves with uniform arc-length. A partial curve matching technique [12] is adopted to get candidate matching borders. Since shorter portions included in more than one significant matching candidate are simply eliminated, the topology around strip-shaped narrow surface may not be constructed or become wrong. As pointed out earlier, small geometric elements may lead to wrong result. It is because they allow adjacency relationship to edges on a same surface. When non-manifold input model is given, the automatically computed result is not always satisfactory. As an effort to overcome the above weaknesses, we propose a vertex-based topology reconstruction algorithm. Once vertices are merged, candidate matches are found automatically. That is, candidate matches are the edges whose two end vertices are in common vertex relationship, respectively. Here, an assumption is presumed that for any two edges to be in common edge relationship it is a necessary condition that the two vertices at both ends are in
common vertex relationship. A proper treatment for narrow surfaces and short edges are also presented. The overall structure of the paper is as follows. Section 2 presents preliminary definitions. The vertex-based topology reconstruction algorithm is described in detail in Section 3. The concluding remarks are given in Section 4.
2. Preliminary definitions Topology is adjacency information between modeling elements such as vertices, edges and faces [13]. A surface model consists of unorganized trimmed surfaces without any topological information. A trimmed surface is composed of a base surface plus one or more trimming loops, each of which is a sequence of edges and closed without self-intersection. Each edge has its own direction and two bounding vertices at both ends. Some topological concepts are shown in Fig. 2. Several definitions are described below. Definition 1 (Common Vertex). The vertices are said to be in common vertex relation if they correspond to a unique vertex in the topological structure made from a surface model. Definition 2 (Common Edge). The edges are said to be in common edge relation if they correspond to a unique edge in the topological structure made from a surface model. Definition 3 (Boundary Edge, Boundary Vertex). The edges not corresponding to any common edge are called boundary edges. The vertices connected to boundary edges are called boundary vertices.
3. Topology reconstruction algorithm The overview of the proposed algorithm is shown in Fig. 3. The problem’s input and output is as follows: † Input: {trimmed surfaces}, 1(same point tolerance). † Output: {trimmed surfaces} þ common edge information.
Fig. 2. Some definitions for topology reconstruction.
First, common vertices are found applying tolerance sphere successively. Common vertices should be regrouped
J.C. Park, Y.C. Chung / Computer-Aided Design 35 (2003) 807–812
809
Fig. 5. Common vertex regrouping.
tolerance sphere. The drifted vertices are treated in a later step. The efficiency of common vertex finding is dependent on the data structure to store vertices. When a balanced binary search tree such as AVL tree or BB-tree is used, the tree construction time is Oðn log nÞ [14], where n is the number of vertices. Nested tree structure is known to be more efficient [14], but we just used a BB-tree. 3.2. Regrouping common vertices Fig. 3. Algorithm overview.
to manage small geometric elements. Common edges are found from those whose vertices are in common vertex relation at both ends. In the step of finding common vertices, some vertices are not grouped in the proper common vertex. To resolve these cases, boundary edge zipping process is needed. If topologically complete surface model is a given input, it’s enough. But if not, some topology editing operations are needed. 3.1. Finding common vertices Applying tolerance sphere concept, vertices in common vertex relations are found successively one by one. When inserting a new vertex into common vertex, the representative position should be updated. This may cause undesirable effect called vertex drift [13]. Average position is taken to reduce this effect. But the effect is not fully removed, as shown in Fig. 4. Three vertices P, Q, and R are within a tolerance sphere C in Fig. 4(a). In Fig. 4(b), tolerance sphere C2 is moved from C1 by adding a new vertex Q. It has a new center at the position M and cannot include the vertex R. Same point tolerance (1 ) is used as the radius of the
Fig. 4. Vertex drift.
If an edge is shorter than the same point tolerance (1 ), the two end vertices can be merged into a same common vertex. But this is not desirable. It is because even a short edge may have its own mate as shown in Fig. 5. To manage the vertices from a same surface, we split them into different common vertices as shown in Fig. 5. Taking the two end vertices as individual seeds and applying the minimum distance rule can form new common vertices. The minimum distance rule is choosing the vertex to merge as the nearest one from the two seeds. Some other cases are shown in Fig. 6. In Fig. 6(a) and (b), both vertices are, respectively, from the outer loop or from the inner loops of a surface. In Fig. 6(c), one is from the outer loop and the other is from an inner loop. Those vertices should not be common. 3.3. Finding common edges Edges having vertices in common vertex relation at both ends are candidates of matching edges. If the number of candidate matches is N, then NðN 2 1Þ/2 pairs are compared. But, mostly N is 2, so just one time comparison is done. Comparison of a pair of curves is similar to that of Sheng and Meier’s [11]. The two curves are sampled within the chordal deviation tolerance of 1/2. For the sake of computing time, gap test at one or two points can be done in advance to discard absurd candidates.
Fig. 6. Vertices on a same surface.
810
J.C. Park, Y.C. Chung / Computer-Aided Design 35 (2003) 807–812
Fig. 9. Ambiguity of closed surface definition. Fig. 7. Common edge regrouping.
When edges from a same surface are declared as common, they are false common edges due to sharp vertex as shown in Fig. 7. To resolve this, regrouping must be done starting from the two edges as individual seeds. When a non-manifold edge exists, the number of edges to be declared as common edge is greater than or equal to 3. In this case, the edges are just marked as non-manifold edges. 3.4. Zipping boundary edges Some vertices are not grouped into proper common vertices due to vertex drift. To reconstruct topological information around these, edge zipping around them is needed. Boundary edges are targets for checking if there is any matching edge. As shown in Fig. 8, candidate of matching edges can be found with neighboring common vertex information. If the distance from a candidate vertex (P ) to any vertex already in common vertex relation (Q and R ) is less than 21, it is grouped into the common vertex (C3). 3.5. Edges on a closed surface In the previous explanation of the proposed algorithm, every pair of edges from a same surface is not allowed to be a common edge. As a result, edge pairs on a same closed surface are excluded from candidates of common edges. Even if it makes our approach tolerable, it seems to be an important drawback. Following two reasons took us into no other way: † Definition of a closed surface is not obvious. † Common edges on a same surface can break a topological assumption. Practically the only way for detecting closed surfaces is to evaluate geometrical gap with position information
Fig. 8. Boundary edge zipping.
of the two opposite edges. It is because the end of surfaces are rolled or folded and the normal at the ends is not stable or reliable in some practical examples. On the other hand, a surface could be ‘topologically not closed’ when it is ‘geometrically closed’. Also, not all trimmed surfaces are closed when the base surfaces are closed. Fig. 9 shows several shapes of surfaces whose two opposite edges are geometrically common but topologically ambiguous. To manage a small or narrow shape we use a restricted topological assumption. The assumption is that no edges on a same surface can be common. Without the assumption, the edges bolded in Fig. 10 could be regarded as common because they are geometrically closed. It becomes confusing or hard to discriminate cases among them. Moreover, that can yield worse result than leaving them boundary edges. It is because the boundary edges can be easily managed in the later step, but false common edges are not. In Fig. 10(d), surface s1 and s3 could be the same (i.e. a geometrically closed surface). Allowing ‘geometrically common edges’ to be ‘topologically common’, some surfaces are separated without any topological neighborhood. It is not what we want. An example of Fig. 10(d) was shown in Fig. 11. Here, surface s1 and s3 is a same cylindrical surface. Surface s2 is a lofted surface made from several section curves including two seaming curves of the cylindrical surface. 3.6. Topology editing There are two types of topology editing: automatic and manual. Insertion of a missing vertex is a typical example of automatic topology editing. When a vertex is missing as shown in Fig. 12, a new vertex can be inserted to generate a new common edge. In Fig. 12,
Fig. 10. Geometrically common edges.
J.C. Park, Y.C. Chung / Computer-Aided Design 35 (2003) 807–812
811
Fig. 11. An example of geometrically common edges.
Fig. 12. Insertion of a missing vertex—automatic topology editing.
edge e1 is split by the newly inserted vertex and declared as in common edge with edge e2. Interactive topology editing is needed because automatic topology editing cannot always give satisfactory output. It is also useful when some geometric modification is needed to give correct topology. Target of interactive editing is the boundary edges and non-manifold edges. Several basic operations, some of which could be automated, are listed as follows: † † † †
Vertex: insertion. Edge: split. Common vertex: declaration or cancellation. Common edge: declaration and cancellation.
4. Discussions and conclusions We have implemented and tested the algorithm in Cþ þ on a PC. Boundary edges of a surface model after topology
reconstruction are shown in Fig. 13 even though we did not implement topology editing. The proposed algorithm is a reconstruction scheme of the topological information originally embedded in the input surface model consisting of unorganized trimmed surfaces. Handled are error-prone small geometric elements such as short edges, narrow surfaces and vertices from a face within the same point tolerance. For this, common vertices and common edges with some conditions are regrouped to be separated. It gives complete topology to topologically complete models, and it is also tolerant to incomplete models. It is vertexbased algorithm which finds clues for topology from the set of vertices, not from that of edges. Common vertex finding is done in Oðn log nÞ time using a BB-tree, where n is the number of vertices. The candidate matching edges are directly known from the result of the common vertex information. If an edge is a pure subset of another edge and both vertices are not in common vertex relation with either of the counterpart edge, then the clue for common edge is not found. In this paper, it is treated as a manual topology editing. An efficient automatic method for this case is needed. To handle small geometric elements without confusion, the seaming curve of a closed surface is excluded from candidates of common edges. Since closed surfaces are rare in most practical CAD data, interactive topology editing may be tolerable. But, it is needed to automatically detect all the common edges including the seaming curve case.
Fig. 13. An application—boundary edge detection.
812
J.C. Park, Y.C. Chung / Computer-Aided Design 35 (2003) 807–812
To get a model with a consistent orientation and to find and remove invalid elements, validity checking for topology is needed.
References [1] Goult RJ, Shearar PA, editors. Improving the performance of neutral file data transform. Berlin: Springer; 1990. [2] IGES(version 5.2). NIST, 1993. [3] AutoCAD Reference Manual (release 11). AutoDesk Inc., August 7, 1990. [4] Owen J. STEP: an introduction. Winchester, England: Information Geometers; 1993. [5] Krause FL, Stiel C, Luddemann J. Processing of CAD-data— conversion, verification and repair. In: Hoffmann C, Bronsvort W, editors. Proceedings Fourth Symposium on Solid Modeling and Applications. Atlanta, Georgia: ACM SIGGRAPH; 1997. p. 248– 54. [6] Choi BK, Jerard RB. Sculptured surface machining: theory and applications. Dordrecht: Kluwer Academic Publishers; 1998. [7] Choi BK. Various geometric aspects of die and mold machining. IFIP conference presentation material, August, 1998. [8] Evensen P, Dokken T. Experiences using adjacency analysis for building topology structures. In: Strasser W, Seidel HP, editors. Theory and practice of geometric modeling. Berlin: Springer; 1989. p. 419–32. [9] Rock SJ, Wozny MJ. Generating topological information from a bucket of facets. In: Marcus HL, Beaman JJ, Barlow JW, Bourell DL, Crawford RH, editors. Solid Freeform Fabrication Symposium Proceedings. Austin: The University of Texas; 1992. p. 251 –9. [10] Barequet G, Sharir M. Filling gaps in the boundary of a polyhedron. Comput Aided Geomet Des 1995;12:207–29. [11] Sheng X, Meier R. Generating topological structures for surface models. IEEE Comput Graphics Appl 1995;November:35–41.
[12] Schwarts JT, Sharir M. Identification of partially obscured objects in two and three dimensions by matching noisy characteristic curves. Int J Robot Res 1987;6(2). [13] Choi Y. Vertex-based boundary representation of non-manifold geometric models. PhD Thesis. Department of Mechanical Engineering, Carnegie Mellon University, 1989. [14] Berg MD, Kreveld MV, Overmars M, Schwarzkopf O. Computational geometry (algorithms and applications), 2nd ed. Berlin: Springer; 1998.
Joon C. Park is a senior researcher at Cubictek Co., a CAD/CAM software company in Korea. He received a BS from Seoul National University in 1993, and an MS from KAIST (Korea Advanced Institute of Science and Technology) in 1995, both in Industrial Engineering. His research interests include geometric modeling, CAD data interface and CAD/CAM system.
Yun C. Chung is a chief engineer of Cubictek, a CAD/CAM software company in Korea. He received a BS from Hanyang University in 1989, and an MS and a Ph.D. from KAIST, Korea, in 1991 and 1996, all in industrial engineering. He worked for DaimlerChrysler Technology Center, USA, from 1998 through 1999 as a research engineer. His research interests include surface and solid modeling, sculptured surface machining, computer graphics and information systems.