Automatic recognition and representation of shape-based features in a geometric modeling system

Automatic recognition and representation of shape-based features in a geometric modeling system

COMPUTER VISION, GRAPHICS, AND IMAGE PROCESSING 48,93-123 (1989) Automatic Recognition and Representation of Shape-Based Features in a Geometr...

7MB Sizes 12 Downloads 45 Views

COMPUTER

VISION,

GRAPHICS,

AND

IMAGE

PROCESSING

48,93-123

(1989)

Automatic Recognition and Representation of Shape-Based Features in a Geometric Modeling System BIANCA FALCIDIENO

AND FRANCA GIANNINI

Institute per la Matematica Applicata del C. N. R., Via L.. B. Alberti 4, 16132 Genoa, Italy

Received March 14,1988; accepted February 9,1989

A method is presented for the automatic identification and extraction of feature information from the solid model of an object. The procedure consists in recognizing shape features, extracting these features as solid volumes, and arranging them in a hierarchical structure. This hierarchical model, described in this article, represents the main shape of the object at the highest levels of abstraction and its form features at lower levels of specification. The system is divided into three modules: feature recognition, feature extraction and feature organization. The recognitition step works on a face-based representation of solid objects, called a face adjacency hypergraph and it takes advantage of Kyprianou’s method (Shape Classification in Computer-Aided-Design, Ph.D. thesis, Computer Laboratory, University of Cambridge, England, July 1980). In the extraction phase each recognized form feature is completed by dummy entities in order to form a feasible object and in the organization step the completed features are arranged into a hierarchical graph, called Structured Face Adjacency Hypergraph. 6 1989 Academic

Press, Inc.

1. INTRODUCTION

A number of factors limit the successful use of CAD models for processing industrial parts. One of the major limitations is the lack of adequate representation of form features and then relationships for characterizing a semantically meaningful class of objects, i.e., a way in which features must be combined into object models so that this description is appropriate for recognizing all objects in the given class. Solid models are the central element in computer aided design systems. They are exact representations which belong to the class of complete, volumetric models based on the exact specification of a 3D object using either surface patches, sweeping rules, or volume primitives. Boundary model descriptions specify an object by its boundaries or enclosing surfaces using primitives such as edge and face. Volume representations describe an object in terms of solids such as generalized cylinders, cubes, spheres, and rectangular blocks. The main advantage of a complete solid model is that it provides an exact description that is object centered. However, solid modelers, if used for product modeling, have two major deficiencies: Incomplete product definition. Only the nominal geometry can be defined; tolerances and surface finish cannot be represented. Material specifications, surface treatments, designer’s instructions related to certain features, etc. cannot be stored. 93 0734-189X/89

$3.00

Copyright a 1989 by Academic Press. Inc. All rights of reproduction in any form reserved.

94

FALCIDIENO

AND

GIANNINI

Low level product de$nition, that is, in terms of low-level details, e.g., geometry and topology for boundary representations and primitives and operators for CSG representations.

It is clear that “pure” solid modelers cannot be used to drive applications such as process planning or manufacturability evaluation because some information required for these tasks (e.g., dimensions and tolerances, form features, materials) are totally absent from the solid modeler data base. In addition, the entities on which, for example, process planning is based, such as form features, require a higher level of abstraction than that which is available. In order to fill the gap between solid modeler possibilities and application needs we have defined a new kind of solid object representation which allows us to explicitly represent feature information. This representation consists of a hierarchical boundary structure that can model arbitrary solid objects to different levels of detail and can provide abstract shape properties for matching purposes. It is the output of the system proposed in this paper which can automatically identify and extract feature information from the boundary model of a part. Different problems must be solved in designing a system for feature recognition and representation; one of them is to define and request features in a computer system in such a way that they are easy to change and understand and are suitable for automatic feature extraction. The dictionary definition of the word “feature” is: “the make, shape, form, or appearance of a person or a thing.” In recent years the engineering design, manufacturing, and geometric modeling communities have given the term several formal definitions [Cam88]. The necessity for features research originally came from a desire to devise easier ways for geometry definition needed for NC programming and process planning. Thus, features were originally thought of as geometry that could be associated with specific machining operators. However, at present the term feature is used in a much broader sense and stretched to represent any set of information (geometric or non-geometric) that can be formulated in terms of generic parameters and properties, and referred to as a set in the reasoning process of some applications. This paper deals with features in a geometric modeling context and a form feature is here meant to be “a group of geometric and topological entities with a functional meaning in a certain context” [Cug88a]. Whereas by feature recognition we mean the recognition of expected patterns of geometry, corresponding to particular engineering functionality in parts of objects. In fact, a form feature can be expressed on the basis of two characteristics: one depending on the application and the other on the model. Since a feature is a part of a model, its shape can be completely described by its topological and geometric information. Furthermore, each feature has a specific meaning, which corresponds to a set of rules characterizing the functionality of the feature itself. Thus, form features can be identified on the basis of their geometry, topology, and functionality in a given application [Wi185]. Three fundamental approaches have been proposed for associating features with geometric models: (1) human-assisted feature recognition, (2) feature-based modeling, (3) automatic feature recognition and extraction.

GEOMETRIC

MODELING

SYSTEM

95

The first approach has been used in preparing input for process planning activity [Cha85] and it is clear that this method is neither convenient nor efficient, but necessary in the absence of a better product definition method. The second approach provides a means for augmenting geometric models with additional non-geometric data by using features stored in libraries and networking them together as needed. It can be successfully applied if the context in which the part is considered is known “a priori,” and it provides an excellent user interface for solid modeling. However, for many powerful applications it is necessary to use the automatic feature extraction technique since features may be needed which are of a higher level than those used to create the part, or features may be needed for a context different than that used to create the part model. The problem of automatic feature extraction has been the subject of previous research. Feature decomposition has been accomplished by using recursive subtraction of convex hulls to subdivide a limited class of objects into their disjunctive volume elements [Woo82]. An algorithm for the decomposition of 2.5 D parts (composed purely of horizontal and vertical faces) has been described by Grayer in his work [Gra75]. In another work Armstrong [Arm841 has proposed a method that indicates which cells to remove from a stock block of material. A very interesting method has been developed by Kyprianou [Kyp80] for the automatic recognition of shape features from a representation generated by a boundary solid modeler. This approach is based on a syntactic pattern recognition and it may recognize a wide feature domain: slots, pockets, holes, bosses, bridges, implicit and explicit protrusions, etc. Other methods based on a similar classification of concave/convex faces and edges are described in [Sak88] and [Jos88]. Another interesting approach has been proposed by Henderson [Hen84]. This method takes advantage of rules of logic to describe some common features of a part such as holes and slots. It consists in recognizing cavity features, extracting those features as solid volumes of material to be removed, and arranging them in a feature graph, a high-level manufacturing data structure, which consists of nodes for the features and links for their relationships. Other techniques for feature recognition are based on CSG tree manipulation. In this context, feature extraction using principal axes is detailed in [Lee87]. The primitives in the model are represented by their principal axes in local coordinates. These principal axes can be collected and clustered according to spatial relationships. Features can then be extracted based on conditions defined by the feature. Another approach is matching trees to shape templates, as proposed by Woodwark in [Wood88]. In this method, features are a pattern represented by a combination.of primitives. If the same combination of primitives occurs in a model, then a master version of a feature is instantiated and compared to the volume on the model where the feature is expected. If the two models match, the feature has been identified. In this paper we describe another approach to the automatic recognition and extraction of features. The system is constituted by three components: a feature recognizer, a feature extractor and a feature organizer. The feature recognizer works on a face-based representation of the solid object called a face adjacency hypergraph or FAH-model and takes advantage of Kyprianou’s method. The feature extractor separates recognized form features from the main shape of the object and represents

96

FALCIDIENO

AND GIANNINI

them as FAH components. The feature organizer arranges the extracted features into a hierarchical feature graph, in which the main shape of the object is represented at the highest levels of abstraction while form features are described at lower levels of specification. The remaining sections of this article are organized as follows: in Section 2 the definition of the boundary model face adjacency hypergraph is given together with the data structure; Section 3 describes the hierarchical boundary model built on top of the FAH, called the structured face adjacency hypergruph, and a data structure encoding the boundary of an object in a hierarchical form. In Section 4 we give the definition of the three steps (feature recognition, feature extraction, feature organization) which constitute the core of the feature recognition system. 2. THE FACE ADJACENCY

HYPERGRAPH

MODEL

The range of objects we consider belong to the class of 2-manifold objects bounded by compact (closed) oriented 2-manifold surfaces. A 2-manifold surface is a 2-dimensional connected surface (which may be geometrically located in 3-dimensional space), where each point on the surface is topologically equivalent to an open disk. A topological description of the boundary of a 2-manifold object is a relational model, in which the three primitive topological entities defining its boundary, namely faces, edges, and vertices, are explicitly represented together with their mutual adjacency relationships. By reflecting the intrinsic hierarchy among the geometric data in which surfaces are considered as primary defining geometric entities, and curves and points as derived ones, we have defined a relational boundary model, called a face adjacency hypergraph, in which the nodes describe the object faces, whereas the arcs and the hyperarcs represent the relationships among the faces induced by the sets of edges and vertices, respectively [Ans85]. In a boundary representation B, of an object S, the sets Es and Vs of its edges and vertices define two relations over the set I;, of the faces of S. Two faces fi and f2 are called edge-a¢ if and only if there exists an edge in Es shared by fi and fi. Also, two faces fi and fi are called uertex-adjacent if there exists a vertex in V, belonging to both fi and fi. The edge-adjacency relation and the partition of F, defined by the vertex-adjacency relation can be represented as a hypergraph, that is, a graph in which the arcs may connect an arbitrary number of nodes [Ber77]. The face adjacency hypergruph (FAH) of an object S is a labeled hypergraph defined as a triple G = (N, A, H) such that: (i) For every face f in Fs there exists a unique node in N corresponding to f and labeled f. (ii) For every edge e in Es, shared by two faces fi and f2, there exists a unique arc in A joining the two nodes fi and f2 corresponding to faces fi and f2, which is labeled e. (iii) Let Fu c FS the set of the faces of S incident to a vertex u of V, and N, c N the subset of nodes of G corresponding to the faces of F,. Then, for every u in V,, there exists a unique hyperarc in H which connects the nodes of N,, and is labeled u.

GEOMETRIC

f3

fr

MODELING

SYSTEM

97

f5

f4 / fi

@

fs

FIG. 1.

A cube and its FAH

representation.

Figure 1 shows the FAH representation of a cube. In the diagram, the dashed lines represent the hyperarcs of the FAH, while the continuous ones denote its arcs. All of the three primitive topological entities describing the boundary of an object are represented by distinct elements of the FAH. The FAH may be disconnected: every shell of the object is represented by a distinct connected hypergraph component. Conversely, every component in the FAH describes a shell of the object. The FAH may correctly represent curved-faced objects as well, since self-loops are considered admissible. In order to produce a relational boundary model of general objects we have extended the definition of the face adjacency hypergraph, as described below. Any arc of the FAH is labeled with the names of the two extreme vertices of the edge it represents. Henceforth, objects with faces sharing two or more edges can be described by the model, since the edge-vertex relation is explicitly encoded into the labels assigned to the arcs of G. Also, each arc is labeled with the names of the two loops to which the corresponding edge belongs, thus encoding the edge-loop relation. The arcs incident to any given node f of G are organized into different ordered sequences, each composed only of those arcs which have the same loop label and thus correspond to a distinct loop on face f. In this way, the loop-edge relation is encoded in the model. In other words, all the edges bounding any given face f of S can be obtained from the FAH G of S by considering the arcs of G incident to f according to their loop labels and giving the ordered arc sequence within each set of such arcs having the same loop label. By attaching the vertex and loop labels to its arcs, the FAH becomes a labeled multihypergraph, in order to provide a complete topological description of any solid object bounded by a compact, oriented 2-manifold surface [An&S, Def88]. 2.1. FAH Internal Encoding Struhue The topology of any solid object is completely and unambiguously represented by the description of the three topological entities defining its boundary (faces, edges, vertices) and any suitably selected subset of their mutual adjacency relations. In the diagram depicted in Fig. 2a the nine mutual adjacency relations are shown. In this drawing each arrow represents an adjacency relation between an ordered pair or primitive entities [WeiSSI.

98

FALCIDIENO

AND GIANNINI

(a)

(b) FIG. 2. (a) Diagram of the nine adjacency relationships in an adjacency topology consisting of faces, edges, and vertices. (b) Diagram of the symmetric structure.

A boundary data structure can thus be thought of as a set of adjacency relations between pairs of topological entities. Since storing too many relations increases the storage complexity of the data structure, it is important to identify a minimal subset of relations, which provide a sufficient topological representation of the object boundary, thus ensuring the efficiency of the structure accessing algorithms at the same time. If the combination selected is suhkient, it is not necessary to rely on geometric information to obtain all the remaining adjacency relations. Since there are many possible data structure schemes, selecting the most efficient one over a specific application domain is not an easy problem. In order to store the face adjacency hypergraph, which is a face-based model, we have adopted the symmetric structure (see Fig. 2b), which is the most efficient among the face-based representations [Woo85]. This data structure explicitly encodes four relations, namely the edge-face, the face-edge, the edge-vertex, and the vertex-edge relations. This data structure, originally developed by Woo [Woo85], is the most efficient with respect to time and space complexity among the ones which explicitly encode the face-edge and edge-face relations, the basic ones for the FAH model. Figure 3 describes the internal encoding of the symmetric structure in the form of a set of Pascal record declarations. The record of type shell describes the surface enclosing the object, and thus simply consists of a pointer to the list of faces composing it. The face list is organized as a singly linked list, and thus each record of type face contains the pointer to the next element in the list (nextface). Since each face is bounded by a set of loops, each face record also contains the pointer to the list of loops bounding the corresponding face (looplist). Hence, if F is the number of the object faces, the global storage cost of the face list is equal to 2 F. The list of the loops is a singly linked list, in which each record contains the pointer to the next element (nextloop) together with the link to the face to which the loop

GEOMETRIC TYPE

fptr 1ptr beptr eptr vptr ieptr

MODELING

SYSTEM

99

= 7 face; = 7 loop; = t boundingedge; = t edge; = t vertex; = t incidentedge;

shell = record facelist end;

: fptr

face = record nextface : fptr; looplist : lptr end; loop = record nextloop : lptr; edgelist : beptr; face : fptr end; boundingedge

= record nextedge : beptr; edge : eptr end;

edge = record loop : array [O..l] of lptr; vert : array [O..l] of vptr end; vertex

= record incidentedgelist x,y,z : real end;

: ieptr;

incidentedge

= record nextedge : ieptr; edge : eptr end;

FIG. 3. Pascal record type declarations describing the symmetric data structure.

belongs (face) and with the link to the sublist of the edges forming the loop (edgelist). The latter is a linear list, in which each record, of type boundingedge, contains the pointer to the record describing the edge (edge) and the link to the next element in a sublist (nextedge). Notice that this substructure encodes the face-edge relation as a combination of the face-loop and loop-edge ones. If E and L denote the number of edges and loops on the faces of the object, then the total storage cost of the loop list together with its sublist is 2E + 3L. Each edge of the object is encoded in a record of type edge which contains the pointers to the loops sharing it

100

FALCIDIENO

AND GIANNINI

(loop) and to the records describing its extreme vertices (vert). Thus, a record of type edge encodes both the edge-loop and the edge-vertex relations, with a total cost of 4E. Each vertex is encoded in a record of type vertex which contains its Cartesian coordinates (x, y, Z) and the link to the sublist of the edges incident to it (incidentedgelist). E ach subl’is t is a singly linked list, in which each record of type incidentedge contains the pointer to the record describing the corresponding edge (edge) together with the pointer to the next element in the list (nextedge). These sublists together with the field incidentedgeht in each vertex record encode the vertex-edge relation, with a total storage cost of Y + 4E. Hence, the global storage cost of a FAH representation of an object is 2F + 10E + 3L + V.

Since we are primarily concerned with the topological description of the object boundary, the 3-dimensional coordinate values are the only geometric information we have included in the structure. The three fields in each vertex record containing such information are thus not counted in the computation of the storage cost. The structure, however, could be easily extended to represent curved-faced objects as well, by associating the surface equation or patch information with every face record and spline, or other curve information with every record describing an edge. In the description of the data structure, we have assumed that a solid object consists of a single shell. The situation in which a solid object contains one or more hollow cavities, still consisting of a single connected volume, can be simply handled by describing such an object as a list of separate shells. A binary tree structure can also be used in order to maintain information regarding the containment relations of the shells [We%]. 3. THE STRUCTURED

BOUNDARY

MODEL

A specific problem that must be solved in designing a feature extraction system is how to represent, in a model, the extracted feature information. This structure or feature-based model should be suitable for feature representation, easy to modify, and coherent with the input model of the examined part, in order to also express the feature information in terms of geometric and topological entities. Furthermore, it should also encode the basic relationships among features: hierarchy and adjacency. It is thus necessary that a feature-based model is defined by a hierarchical structure which means that high-level features should not be directly expressed in terms of the basic defining entities of the part solid model (such as faces, edges, and vertices). Instead, the high-level features should be described by means of intermediate features of a lower level, in turn defined in terms of their intermediate features lower than themselves, and so on down to intermediate level features that are defined in terms of the input entities of the system. To meet the previously expressed requirements, we have defined a new boundary model which is based on a hierarchical structure. Whereas such hierarchical organization is quite often adopted for volumetric representations (e.g., hierarchical generalized cylinders [Chi86], octrees [Mea82]), classical boundary schemes describe all the parts of the boundary of an object at one level of specification. On the contrary, the FAH representation is particularly suitable to be hierarchically organized and permits us to obtain a boundary description of an object at

GEOMETRIC

MODELING

successively finer levels of specification. Hierarchical

101

SYSTEM

A hierarchical

representation,

called a

face adjacency hypergraph, has been proposed in a previous work

[A&5, DeF88], but this model does not permit the representation of objects which do not present an intrinsic hierarchy. Thus, herein we propose an extension of this hierarchical structure, called a structured face adjacency hypergraph, which better fits the hierachical organization of the features of an object [Fa187, Gia86]. 3.1. The Structured Face Adjacency Hypergraph A structured face adjacency hypergraph (SFAH) can be formally defined as a pair g* = (H, G), where G is the acyclic oriented graph describing its hierarchical structure and H is a family of FAHs, each of which, called a component of g*, is associated with a distinct node in H. There are specially designated nodes, called roots, from which all other nodes originate. A component Hi in g* is a parent if it refers other components and, conversely, it is a child if it is referred by other components. The ancestors of a component are the components from the root node to the current node. Any non-root component of g* is the FAH representation of a feature in its parent graphs. The parent-child relation between any pair of components Hi and Hj of g* is defined by a set of nodes which belong to both Hi and Hi. These nodes are called connection nodes in the parent component Hi and dummy nodes in the child component Hi. The connection nodes of Hi in Hi correspond to those faces in the object to which the feature is attached. The nodes in the graph Hi which correspond to the connection nodes of Hi are called dummy nodes, since each dummy node in Hi describes a face added to the feature represented by Hi, in order to form an admissible solid object. Hence, there exists a correspondence between the set Dj of dummy nodes of Hj and the set Cj of the connection nodes of Hj in Hi. This correspondence is not a one-to-one correspondence because more dummy nodes can be connected to a single connection node, as in the case of the object depicted in Fig. 4a. If we consider the handle attached to the face fi as a feature of the box, the SFAH representation of the object will be composed by two components (Fig. 4b): a root component HO, representing a box and a child component HI corresponding to the handle. In this model the face fi is represented by the connection node fi in the component HO, whereas there are two corresponding dummy nodes in HI which

(a)

tb)

FIG. 4. A box with a handle attached to face fi (a); its SFAH representation (b).

102

FALCIDIENO

AND GIANNINI

(a) (b)

FIG. 5. (a) An object with a pocket and a through-hole; (b) SFAH representation of the object; (c) FAH representations of the SFAH components.

represent the two dummy faces added to the feature in order to form an admissible solid object. This hierarchical structure has been applied to describe 3-dimensional objects and their topological form features [Ans87]. For example, a protrusion or a depression is represented by a component of the SFAH which expands a node of its parent graph, while a through-hole is represented by a component which expands a pair of nodes in its parent graph. In Fig. 5b the SFAH of an object S with a pocket and a through-hole is shown (Fig. 5a). The SFAH is composed of three graphs. Component Ha, which describes the main object shape (the big box), component Hi which describes the pocket on face fi of the box, the component Hz which represents the through-hole. This component is a child of a two previous ones because it is attached to faces fi and f3 which belong to the box and to the pocket, respectively. The relation between Hi and HO is defined by the connection node fi in H,,, and the dummy node fi and Hi. The relation between H, and H,, is defined by the connection node f2 in HO and the dummy node fi in H,, whereas the relation between H, and HI is defined by the connection node f3 and HI and the dummy node f3 and Hz.

GEOMETRIC

MODELING

SYSTEM

103

FIG. 6. (a) A box with a depression on an edge and a through-hole. (b) Steps for the extraction of the through-hole as a solid volume.

Note that the arcs incident to f, and fi in HO and the arcs incident to f3 in Hi correspond to the edges belonging to the external loops of the faces fi, f2, and f3, respectively, see Fig. SC. The arcs in Hi incident to the dummy node fi correspond to the edges of the inner loop defined on face fi by the pocket. The same is true for the arcs incident to the two dummy nodes f2 and f3 of Hz. The bounding loops of a dummy face and of the correspondent connection face can be completely disjoint as in the case of the pocket and the through-hole of Fig. 5a, but they can also be partially coincident as is the depression on an edge formed by the two faces, fi and f,, depicted in Fig. 6a. In this case, if, for example, we consider the connection face fs in the parent component and the correspondent dummy face in the child component (see Fig. 6d) their boundary loops are partially overlapping. It means that a feature can originate loops belonging either to a single face or to a set of adjacent faces. In the latter case, we can group the set of connection nodes of a hypergraph Hi into a single macro-connection node that we call connection-face set. Similarly, the set of the dummy nodes of Hj which correspond to that set of connection nodes will be grouped to form a dummy-face

104

FALCIDIENO

AND GIANNINI

FIG. 6. (c) Steps for the extraction of the depression.

set. The concept of macro-node represents a way of structuring the set of connection and dummy nodes of a component of g* which allows us to complete in a similar way different kinds of features [Fal87]. Finally, it is important to point out that this structure is able to represent models with multiple roots, as in the case of the bridge shown in Fig. 7. The SFAH representation of this object is composed by two root components, HO and Hi, and by component H, which is child of both H,, and HI. 3.2. SFAH Internal

Encoding Structure

In this section we describe the hierarchical data structure which encodes the SFAH model. This hierarchical structure is created on top of the FAH data structure which is used as the internal representation of each component of the

GEOMETRIC

MODELING

SYSTEM

FIG. 6. (d) Hierarchical representation of the object.

FIG. 7. A bridge and its SFAH representation.

105

106

FALCIDIENO

TYPE

AND

GIANNINI

sptr = T shell; rcptr = 7 rootcomp; wptr = t component; cfsptr = t comrectionfaceset; dfsptr = t dummyfaceset; cfptr = t connectionface; dfptr = t dummyface; featype = (D,P); rootcomp = record nextroot : rcptr; currcomp : coptr end; component = record wmp : sptr; dummylist : dfsptr; connectionlist : cfsptr end; connectionfaceset = record nextcfset : cfsptr; childcomp : coptr; cfacelist : cfptr; childtype : featype end; connectionface = record nextcface : cfptr; face : fptr end; dummyfaceset = record nextdfset : dfsptr; parent : coptr; dfacelist : dfptr end; dummyface = record nextdface : dfptr; face : fptr; connectionf : fptr end;

FIG. 8.

Pascal

recorddeclarationdescribingthe hierarchicaldata structure

GEOMETRIC

MODELING

SYSTEM

107

SFAH. Figure 8 describes this hierarchical boundary structure by giving the Pascal record declarations of the elements composing it. The record of type roorcomp describes the list of root components of the hierarchical graph and simply contains the pointer currcomp to the description of the current root component and the pointer to the next element of the list (nextroot). Thus, if R is the number of root components, the global storage cost for this list is 2R. In the structure any component Hi of the SFAH is described by a record of type component, which contains the pointer to its FAH representation (camp), and the links to its parent components (dummylist) and to child components (connection&). Hence, if C is the number of the non-root components the global storage cost for this list is 3C + 3R. Every component is linked to its children through a record of type connectionfaceset, which encodes the concept of macro-connection node introduced in the previous paragraph. This record contains the type of feature (childtype): P if it is a protrusion, D if it is a depression, the pointer to the feature component (childcomp), the pointer to the next element in the list (nexrcfser) and the pointer to the list of the faces forming the macro-connection node (cfucelisr). This last list is a singly linked list, in which each record of type connecrionfuce contains the pointer to the face in the shell (face) and the link to the next element in the sublist (nextcface). Thus, if there are Cf connection faces, the global storage cost for the connectionfaceset and for the connectionface records is 2Cf + 4C. In the same way, for every component the list of the records of type dymmyfuceser keeps the link with the parent components. Every record of type dummyfaceset corresponds to a macro-dummy node and contains the pointer to the list of the dummy faces composing it (deface&), the pointer to the father component (parent) and the link to the next element of the list (nexrdfser). The record of type dummyfuce contains the pointer to the face (face), the pointer to the correspondent connection face (connecrionf) and the pointer to the next element in the list (nexrdfuce). For the dummyfaceset records the global storage cost is 3C, while for the dummyface records it is 3Df, where Df is the number of the dummy faces. Hence, the overhead due to the hierarchical description of an object is given by the sum of the previous costs: 5R + 1OC + 2Cf + 3Df.

Thus, the global storage cost for the SFAH representation is given by the sum of the costs of the hierarchical structure and the FAH representation for each component: 2F+lOE+3L+

V+5R+lOC+2Cf+3Df.

This storage complexity has been computed under the assumption non-root component has only one father component.

that each

3.3. Basic Operations on the FAH and SFAH Models

Based on the Face Adjacency Hypergraph we have defined a solid modeler based on a set of primitive Euler operators [A&5], which work on the faces of an object considered as primitive defining entities and ensure that the topological requirement expressed by Euler’s rule generalization is always satisfied [Big86].

108

FALCIDIENO

AND GIANNINI

TABLE 1 List of Basic Euler Operators Make-Face-Vertex-Shell(s, f, CJ) (STf, e, u, g, h) -* (3 + 1, f + 1, e, u + 1, g, h) ,Make-Edge-Vertex(s, f, u, e’, u’) (s, f, e, 0, g, h) --) (4 f, e + Lo + 1, g, h) Make-Edge-Face(s, f, ul, ~2, e’, f’) (s, f, e, 4 g, h) + (s, f + 1, e + 1, 4 g, h) Make-Face-KilLHoleloop-Genus(s, h , f’) (3, f, e, u, g, h) -+ 6, f + 1, e, u, g - 1, h - 1) Make-Face-ShelLKilLHolelcop(s, h, s’, f’) (s, f, e, u, g, h) + (s + 1, f + 1, e, 0, g, h - 1)

KilLFace-VertexXhell(f, u, s) (3, f, e, 0, g, h) + (s - 1, f - 1, e, u - 1, g, h) KilLEdge-Face(e, f) (3, f, e, 4 g, h) + (3, f - 1, e - 1, 0, g, h) KilLEdge-Vertex( e, u) (3, f, e, 0, g, h) + (s, f, e - Lo - 1, g, h) KilLFace-ShelLMake-Holeloop(s, f, h’) (s, f, e, u, g, h) + (s - 1, f - 1, e, 0, g, h + 1) KilLFace-Make-Holeloop_Genus( f, h’) (s, f, e, u, g, h) + (s, f - 1, e, u, g + 1, h + 1) Nofe s = shell, f = face, e = edge, u = vertex, g = genus, h = holeloop.

These operators are listed in Table 1 together with their inverses which correspond to the inverse removal operators. The same set of operators has been applied to build the SFAH model of an object with some modifications [CasSS]. In particular, two operators and their inverses can be applied to the SFAH model: the MFVS and the MFSKH together with the inverses KFVS and KFSMH. These operators allow us to restructure the SFAH model in order to adopt the hierarchical structure of an object defined, for example, in terms of design features, to a new object description in terms of features of different functionality. 4. THE SYSTEM FOR FORM FEATURE

RECOGNITION

AND EXTRACTION

The system consists of a feature recognizer, a feature extractor and a feature organizer, as shown in Fig. 9. The feature recognizer works on the FAH representation of a solid object and takes advantage of Kyprianou’s method. The feature extractor separates recognized form features from the main shape of the object and represents them as FAH components, which correspond to volumes that need to be removed or added to the main shape in order to form a feasible object. The feature

GEOMETRIC

MODELING

109

SYSTEM

vet -/RECOGNITIONI

Objt mo’ de1 -

\

( 1

feature list

faces q

L EXTRACTION Y / 3RGANIZATIOIV final SFaW L

J

/

USE

Euler Modeler

FIG. 9. General system architecture.

organizer arranges the extracted features into a hierarchical feature graph, which corresponds to the SFAH representation introduced in the previous paragraph. 4.1. The Feature Recognition Step Feature recognition is based on a method that uses the syntactical recognition devised by Kyprianou [Kyp80, Jar84], who has defined a feature grammar similar to a Chomsky grammar. Syntactic pattern recognition is a formalized technique for representing complex patterns in terms of simple subpatterns and relations among these subpatterns. A given pattern is decomposed recursively into simpler subpatterns, called pattern primitives. Sequences of patterns are linked together to form complex patterns. The possible sequences can be organized according to a language syntax just as, in formal languages, characters make up words which in turn make up sentences. The resulting language is called a pattern description language. The rules that define valid compositions of primitives into patterns are specified by the grammar of the pattern description language [Kyp80]. The grammar is

110

FALCIDIENO

*

AND

b

GIANNINI

c

FIG. 10. Structural primitives: convex edge (a); concave edge (b); smooth edge (c).

defined as a quadruple (S, T, P, I) where: S is a finite set of structural primitives, T is a finite set of terminal primitives, P is a set of. production rules showing how a feature may be generated from other elements of the grammar and I is a finite set of initial primitives, or starting points, from which features in the particular language are generated. The three basic structural primitives used in constructing the feature grammar are: conuex loop, concaue loop and smooth loop. A loop is defined as

FIG. 11. Depression grammar: 0 is the first loop in the grammar; v has been used to form a loop pair; 0 is a loop that has been considered; and u means concave loop.

GEOMETRIC

FIG.

MODELING

SYSTEM

111

12. Examples of depression (a) and protrusion (b).

convex if it is formed by only convex edges, concave if it contains at least a concave edge, and smooth if it contains smooth edges, that is edges on which there is no change in surface normal between the adjacent faces, see Fig. 10. In Fig. 11 the feature grammar for the creation of depression features is given. If we change concave loops with convex loops in this definition the feature grammar for protrusion features is produced. By using this technique it is possible to identify different categories of form features as slots, pockets, simple or nested depressions, protrusions and so on. Shape features can be defined as explicit or implicit. Explicit features are those features originating inner loops on faces, while all the remaining ones are called implicit features and can be identified by the presence of concave edges. Furthermore, form features, can be divided into two general classes: one corresponding to the external shape (protrusions) and the other one corresponding to the internal shape (depressions), see Fig. 12. These features are defined as [Kyp80, Jar841 : a depression D is a set of connected faces such that: (i) every face in D is adjacent to at least another face in D through a concave edge, (ii) every edge of the boundary of D is convex; a protrusion P is a set of connected faces such that: (i) every face in P is adjacent to at least another face in P through a convex edge, (ii) every edge of the boundary of P is concave. The goal of the feature recognition step is the identification of D- and P-features. To do this in the first phase all the edges and loops of the FAH model of an object are examined and initially edges and loops are classified as either concave or convex. Then, a list of faces to which features are attached is created. These faces are called primary faces and are defined as containing concave edges in their external loop or enclosing inner loops. Finally, all the faces belonging to a feature are identified and the recognized feature is classified as a D- or P-feature. In this last phase, first, explicit features are searched. Let S be the representation of the object in input, F, the set of faces and f a primary face with the internal loop

112

FALCIDIENO

FIG.

AND GIANNINI

13. Explicit depression.

1. The set F of the faces belonging to each explicit feature is defined as follows: F = { f E I;, such that 3 an edge e on f, e E I or f is adjacent to another face in F through an edge of its external loop}. The recognized feature is a D-feature if 1 is a convex loop otherwise it is a P-feature. In Fig. 13 an example of an explicit depression is depicted. In the case of implicit features, let S be the representation of the initial object, F, the set of the its face and f a primary face with concave edges on its external loop, the set F of faces belonging to it is defined: F = { f E F, such that f is adjacent to f or to another face in F through a concave edge}. In this case, in order to distinguish a D-feature from a P-feature, it is necessary to identify all the convex boundaries of the feature. These boundaries are closed loops of edges belonging to a set B, such that: B=

{eEEssuchthateEfjandeEfi/fiE--andfiEF}.

In this definition Es is the set of the edges of S. Each of these loops will constitute a so-called macroloop, whereas the set of adjacent faces not belonging to the feature identifies a group of faces that will correspond to a macroconnection node as defined in the previous paragraph. If in this search no more than two macroloops are found, and it is possible to identify a closed loop of concave edges which do not belong to the same face, then the feature is an implicit protrusion (see Fig. 14), whereas, in the other case .,it is an implicit depression [Fa187]. If a D-feature is found, its faces coincide with the faces determined by the recursive search, whereas if a P-feature has been identified, the set of the feature faces can be determined by including only the faces which lie between the concave loop and the convex boundary that do not include it as an inner loop and by adding the faces adjacent to that convex boundary. For example, in the object of Fig. 14, the recognizer has identified the faces { fi, f2, fs, f4, fS, f6} as candidate feature faces since they are mutually adjacent through concave edges, but fl and f2 do not belong to it because they contain the concave loop as an inner loop. Thus, in order to extract all the faces of the P-feature

GEOMETRIC

MODELING

SYSTEM

113

FIG. 14. Implicit protrusion.

it is also necessary to add the faces adjacent to the concave boundary that do not contain the concave loop, as is the face f7 in the case of Fig. 14. In this step, implicit D- and P-features are considered at the same level as the features originating from inner loops [Gia86], whereas Kyprianou’s method considers these features as attributes of the sets of faces belonging to the main shape of the object or to the explicit features. Algorithm FEATURE-RECOGNITION, given below, is the description of the effect of the syntactic recognition described before. The following functions and procedures are used as primitives in the algorithm description: -INNER-PRIMARY-FACE(P,,,, Hi) returns a face f belonging to the set of primary faces with inner loops (Pi,j) and to the component Hi. -FIRST-INNER-LOOP(f, 1) returns the first inner loop 1 on the face f. -INNER-FEATURE-FACES(Z& f, 1, B,, C,, pk) returns the set Fk of the faces of the feature, the set B, of the inner loops belonging to the feature, the set C, of the connection faces containing elements of B, and the function pk that links every element of B, to its correspondent face in C,. -IS~A~CONVEX~LOOP(l) returns the value TRUE if 1 is formed by convex edges, the value FALSE otherwise. -ARE-OTIIERJNNER-LOOPS(f, 1) returns the value TRUE if 1 is not the unique inner loop in f, the value FALSE otherwise. -DEC~NUMBER~INNER~LOOPS( f ) decrements the number of the inner loops of f. -CONCAVE-PRIMARY EACE( P,,, , Hi) returns a face f belonging to the set of primary faces with concave edges (Pcd) and to the component Hi. -EXTERNAL-LOOP(f, 1) returns the external loop 1 of the face f. -CONCAVE-FEATURE-FACES( Hi, 1) returns the set of the faces which are recursively adjacent to the edges of loop 1 through concave edges and belonging to the component Hi. -CONVEX-BOUNDARIES( Hi, Fk, C,, pk) returns the list B, of the macroloops of the feature formed by the convex edges which lie on one face only of Fk,

114

FALCIDIENO

AND GIANNINI

the set C, of the faces adjacent to those edges and the relation pk between the edges of the macro-loops and the faces of C,. -CONCAVE-LOOP(F,): returns the list of the concave edges shared by the faces of the set Fk and defining a closed loop. -PROTRUSION-FACES(Hj, Fk, &I,, B,, C,): updates the set of the faces Fk of a P-feature shared by the concave loop CUB, and the macro-loop of B, which does not contain CUB, as inner loop and returns the set C, of the faces of the macro-connection node which are adjacent to the edges of CUB,. Algorithm

FEATURERECOGNITION( H,, P,,,, P,,,, Fk, C,, B,, pk, type). is a component of SFAH; is the set of primary faces with inner loops; is the set of primary faces with concave edges; is the set of faces belonging to the recognized feature; is the set of the connection faces of Hi; is the set of the loops of edges which bound the feature; is the mapping from Bk to Ck is the type of the recognized feature (P- or D-feature)//

//Hi: Pilf: Pcef: Fk: Ck: Bk: pk:

type:

f := INNER-PRIMARY-FACE(Pilf, if f # nil then FIRST-INNERLOOP( f, 1) Fk := INNERFEATURELFACES( if ISA-CONVEX-LOOP(l) then

type := D else type := P end if if AREOTHERINNERLOOPS( DEC-NUMBER-INNERLOOPS( else Pi/f:= end if

Pi/f-

Hi)

Hi, f, 1, Bk, Ck, pk)

f,

1) then f)

[f]

else f

:= CONCAVEPRIMARY-FACE( nil then

if f # cuBk

Pcef,

Hi)

:= [ ]

EXTERNAL-LOOP( f, 1) fk := CONCAVE-FEATURE_FACES( Hi, 1) Bk := CONVEX-BOUNDARIES-( Hi, Fk, Ck, pk) if NUMBER( Bk) = 2 then cuBk := CONCAVELOOP( Fk) end if if cvBk

= [ ] then

type := D else

type := P Fk := PROTRUSION-FACES(H2,

Fk, cuBk,

Bk, Ck)

Bk := cvBk end if Pcef := Pcef - [f] end if end//feature-recognition//

The example in Fig. 6 shows an object with a through hole, that defines two inner loops: one on face f2 and the other on face fS, and a depression on an edge formed

GEOMETRIC

MODELING

SYSTEM

115

by the faces fi and f,. In this case, during the marking step, the system identifies a set of primary faces with inner loops { f2, fs} and a set of primary faces with concave edges { f2, f7, f9,fro, fil, fi2}. Starting from a face belonging to the first set of faces the system identifies a through hole. Then, the system recognizes the D-feature formed by faces f2 and f, are bounded by the highlighted edges. 4.2. The Feature Extraction

Step

The faces of the feature on the part itself do not necessarily infer any information about the extent of material to be removed or added in order to create the feature. A more complete and appropriate representation of a feature requires data not only about the feature surfaces, but also about its volume. For this reason, after having determined all the faces belonging to the feature, the model is completed by adding a set of dummy entities (faces, edges, and vertices) in order to make the closed, compact and 2-manifold object corresponding to the feature [Fa187]. Then, the feature extraction phase creates the shell corresponding to the feature object by duplicating the faces identified in the recognition step and completes them by dummy faces, dummy edges, and sometimes also dummy vertices. In the feature extraction step the new faces will be defined as dummy faces in the SFAH representation, while the existing faces from which the dummy faces originate will correspond to connection faces. In the completing phase the algorithm makes use of Euler operators, which ensure that the resulting feature object satisfies the topological validity requirement expressed by Euler’s rule. The feature extraction step applied to the FAH description, H,, of the object consists of a transformation of a part of the boundary of Hi into a new shell, Hk, that is described by the connected subgraph, Fk, and an updating of the remaining FAH structure. The graph obtained by completion of Hi - Hk is called a reduced graph defined by Hi and Hk and denoted H{ = (IV;‘, A[). Let Hi = (Ni, Aj) and let Hk = (Nk, Ak) be the set of the connection nodes of Hk in Hi defined as C, = { f in N/there exists an arc in Aj - A, and an arc in A, incident to f }. In fact, a connection node of Hk in Hi is any node of Hi having arcs incident to it, which belong to both H, and Hk. Thus, 11:’ = N, - Nk u C,, whereas A; is obtained by a modification of Ai - A,. In fact, a transformation should be applied to arcs of Ai - A, so that H,’ describes an admissible object. Hk is completed by the insertion of the dummy nodes D, corresponding to the connection nodes which belong to Hi and, if necessary, of arcs and hyperarcs which transform the features into an admissible object. The creation of the feature shell is very easy for features which originate inner loops on faces, because it is sufficient only to use Euler operators which delete the inner loops and create faces corresponding to those inner loops. In Fig. 6b the sequence of steps made for the extraction of a through-hole is shown. In case of the implicit features the system acts differently because it is necessary also to add new edges and new vertices. Thus, in order to determine the new entities, the system makes use of the convex boundaries identified in the previous step. In this case, for each face belonging to the main shape and containing some edges of the macroloop it is necessary to employ the two edges that do not belong to the boundary and are incident to the convex vertices common to both the main shape

116

FALCIDIENO

AND

GIANNINI

and the feature. Then, each new dummy edge will correspond to the segment defined by the intersection between the two straight lines defined by those two edges and the starting point. Finally, the resulting dummy face is created, that is to say, the face delimited by the dummy edges just defined and the edges belonging to the convex boundary, that lie on the correspondent connection face. In the example of Fig. 6a the pairs of convex vertices to be considered are {u.,, us}, { ui2, ui}, {us, ur2}, and { ur, u4}. The correspondent pairs of edges which will be extended are {es, es}, { eir, e,,}, {es, ei,} and {e,,, es}. The resulting dummy faces will be bounded by the loops: {esr, es, es, es*}, { eis, es4, ess, e,}, { e317e 35, e34, e15}, and { e33, e35, e32, e4}, see Fig. 6~. Also in this case, for the creation of the dummy entities, the algorithm makes use of Euler operators. The following procedures are used as primitives in the description of the algorithm FEATURE-EXTRACTION: -ARE-INNER-LOOPS(B,) returns the value TRUE if the elements of B, are inner loops, the value FALSE otherwise. -MAKE~FACE~KILL~HOLELOOP_GENUS( Hk, 1, f’) Euler operator that makes a new face f’ in component Hi in such a way that its boundary is coincident with the deleted loop 1. The genus of the object is decremented as a consequence. -ADD-CORRESPONDENCE( f, f ‘, qk) defines the mapping qk between dummy face f’ and the connection face f. -ADD-DUMMY-FACE( D,, f ‘) adds the face f’ to the set D, of the dummy faces. -LAST-LOOP( B,J returns the last loop 1 of B,. -MAKE~FACE~SHELL~KILL_HOLELOOP( Hk, 1, Hl, f ‘) Euler operator that makes a new shell Hk) by deleting a loop 1 in component Hk and creating a new face f’ of H; in such a way that its boundary is coincident with the deleted loop. -MAKE-FACE-VERTEXSHELL( H;, f ‘, u’) Euler operator that defines a new shell H/ consisting of one face f’ and one vertex u’ belonging to f’. -EDGE-NOT-ALREADY-CREATED( Hi, f, S,Hk) returns an edge of face f in Hi belonging to the set S, whose correspondent in Hk has not been already created. -LAST-EDGE-NOT-ALREAD-CREATED( e, Hi, f, S, H,J returns the value TRUE if e is the last edge of face f in Hi belonging to the set S, whose correspondent edge in Hk has not been created, the value FALSE otherwise. -END-POINTS( f, e, ui, u2) returns the extreme vertices ui and u2 of the edge e that lies on face f. -CORRESPONDENTYERTEX(Hi, u, Hk, u*) returns the vertex u* in Hk that has the same coordinates of the vertex u which belongs to Hi. -MAKE-EDGE-VERTEX( Hk, f, u, e’, u’). Euler operator that adds a new edge e’ on a face f of Hk, which connects an existing vertex u to a new one u’. -MAKE-EDGE-FACE( Hk, ui, u2, f, e’, f ‘). Euler operator that inserts a new face f’ and a new edge e’, which must have the extreme vertices ui and u2 and the adjacent face f already defined.

GEOMETRIC

MODELING

117

SYSTEM

-EDGES-TO-ADD( f, Bk) determines the dummy edges and vertices needed to be added to the already existing edges of face f that belong to the boundary B,, so that the boundary of the dummy face will correspond to the connection face f is formed. -UPDATE-COMPONENT(Hi, Hk) updates the component I?, by making a glue operation between the components H, and Hk.

ALGORITHM FEATURE-EXTRACTION( //Hi: Fk: Ck: Bk: pk: Hk: Dk: qk: if

Hi, Fk, C,, B,,

pk,

Hk, D,, qk).

is a component of the SFAH; is the set of faces of the recognized feature; is the set of connection faces of Hk in Hi; is the set of loops of the edges bounding the feature; is the mapping from Bk to Ck; is the FAH representation of the feature; is the set of the dummy faces of Hk wrt Hi; is the mapping from Dk to Ck// AREJNNERLOOPS( Bk) then Bk’ = Bk-LASTLOOP( Bk) for eoey (1 in Bk’) do f:=pk(l)

-

MAKE_FACELKILL-HOLELOOP-GENUS( ADDXORRESPONDENCF(f, f’, qk) ADD-DUMMY-FACE( Dk, f’) end for 1 = LAST-LOOP(Bk)

f

Hi,

1, f’)

:= pk(1)

MAKE_FACESHELLXILL-HOLEL.OOP( ADD-CORRESPONDENCE( f, f ‘, qk) ADD-DUMMY-FACE( Dk, f’)

Hi,

1, Hk, f’)

else

MAKEFACELVERTEX-SHELL( Hk, f *, II’) every face f in Fk do e := EDGE-NOT-ALREADY-CREATED( Hi, f, Bk, Hk) while not LAST-EDGELNOT.ALREADYCRFATFD(e, Hi, f, Bk, Hk) END-POINTS( f, e, 01, ~2) CORRESPONDENT-VERTEK( Hi, ul, Hk, al*) MAKE_EDGE_VERTEK( Hk, f*, ul*, e’, u’) e := EDGENOT-ALREADY-CREATED( Hi, f, Bk, Hk)

for

do

end while

END-POINTS( f, e, ul, 02) CORRESPONDENT-VERTFX( Hi, ul, Hk, ul*) CORRESPONDENT-VERTEK(Hi, ~2, Hk, u2*) MAKELEDGEFACEJ Hk, ul*, u2*, f*, e’, f’) end for for euey face f in Ck do Ek := EDGES-TOADD( f, Bk) e := EDG&NOT-ALREADY-CRFATFD( Hi, f, Ek, Hk) while not LAST-EDGELNOTALREADY-CRFATFD(e, Hi, f, Ek, Hk) END-POINTS( f, e, ul,u2) CORRESPONDENT-VERTFX(Hi, ul, Hk, ul*) MAKE-EDGE-VERTFK( Hk, f *, vl*, e’, u’) end while END-POINTS( f, e, ul, ~2)

do

118

FALCIDIENO CORRESPONDENT-VERTlX( CORRESPONDENT-VERTl=( MAKELEDGE_FACE( ADD-CORRESPONDENCE(f, ADD-DUMMY-FACE( end for UPDATl%COMPONENT( end if end FEATURE3XTRACTION

Hk, ul*,

Hi, Hi, u2*, f’,

AND

GIANNINI

ul, Hk, ol*) 02, Hk, u2*) f*, e’, f’) qk)

Dk, f’) Hi, Hk)

4.3. The Feature Organization

Step

In this phase the feature shells created in the previous step are linked in a hierarchical graph according to their adjacency. The SFAH representation g* of an object with its form features is recursively created by applying an abstraction transformation which operates on one pair of components at a time. The first step of the abstraction of a component Hk, corresponding to a feature of a component Hi, consists of inserting Hk in g* at a lower level of specification in the hierarchy as a direct descendent of Hi. The relations between the two components are stored through the definition of connection and dummy nodes identified in the previous step. The second step is the definition of the relationships among Hk and other components Hi # Hi in g*. To do this it is necessary to check if some faces of Hk are connection faces with respect to some other components Hi # Hi. In this case, it is necessary to reorganize the SFAH structure by inserting Hk as a father component of fj. In the same way it is necessary to verify if some faces of Hk are dummy faces with respect to some other components Hj # Hi; in this case Hk will become a child component of Hj. As an example, Figure 6d shows the hierarchical representation of the object depicted in Fig. 6a. In this case, when the component HZ, corresponding to the depression on an edge, is inserted into the SFAH structure it must be put as a parent component of HI since the face f2, now belonging to H,, was a connection face in H, with respect to the component HI. Algorithm FEATURE-ORGANIZATION given below is the description of the effect of an abstraction transformation applied to a feature component Hk of a component Hi of a SFAH g*. In the description of the algorithm the following procedures and functions are used as primitives: -ADD-COMPONENT-TO-SFAH(

g*, Hk) inserts a new component Hk into

g*. -ADD-ARC-TO-SFAH(g*, ( Hi, Hk)) adds a new arc (Hi, Hk) to the graph describing g*. -CONNECTION-NODES(H,, H,) returns the set of the connection nodes of Hi in Hi ( Hj must be a direct descendent of Hi). -DELETE-ARC-FROM-SFAH( g*, (Hi, Hj)) deletes arc (Hi, Hj) from the graph describing g*. -UPDATE-CONNECTION-FACE_SET( g*, ( Hj, Hk), (Hi, Hj)) updates the connection face set of Hi wrt Hj by deleting all the connection faces of Hi that now belong to Hk.

GEOMETRIC

MODELING

119

SYSTEM

-DUMMY-NODES(& Hj) returns the set of the dummy nodes of Hi in H, ( Hj must be a direct predecessor of Hi). -UPDATE-DUMMY-FACE-SET( g*, (Hi, Hk), (Hi, Hj)) updates the dummy-face set of Hi wrt Hj, by deleting all the dummy faces of Hi that now belong to Hk. ALGORITHM FEATURE-ORGANIZATION( //Hi: Hk: Ck: Dk: qk:

g*:

Hi,

Hk,

C,,

D,,

qk,

g*).

is the FAH representation of a component of the SFAH g*; is the FAH representation of the feature component; is the set of the connection faces of Hk wrt Hi; is the set of the dummy faces of Hk in Hi; is the mapping from Dk to Ck, that defines the relation between Hk and Hi; is the SFAH description of the object//

ADD-COMPONENT-TO-SFAH(g*, Hk) ADD-ARC-TO-SFAH( g*, (Hi, Hk)) for every component Hj in CHILDREN( g*, Hi) Cj := CONNECTION-NODES( Hi, Hj)

do

if(CjnHk#[])then

ADD-ARC-TO-SFAH( if (Cj

Hk)

c

g*, ( Hk, Hj))

then

DELETELARCJN-SFAH(

g*, (Hi,

Hj))

else

UPDATE-CONNECTION-FACE.SET( if

g*, (Hj,

Hk),

(Hi,

Hj))

end end if

end for for every component Hj in Dj := DUMMY-NODES( if (Djn Hk+[ ])then

FATHERS(g*,

ADD-ARC-TO-SFAH( if (Dj

c

Hk)

Hi)

do

Hi, Hj)

g’, (Hj,

Hk))

then

DELETEARC-IN-SFAH(

g*, (Hj,

Hi))

else

UPDATE-DUMMY-FACE-SET( if end if end of end FEATURE-ORGANIZATION

g*, (Hj,

Hk),

(Hi,

Hj))

end

5. IMPLEMENTATION

AND CONCLUSION

The method described here was implemented in Pascal on an Apollo DN4000 workstation using a solid modeler based on FAH representation and Euler operators. In Fig. 15 an example of how the system works is shown. In this sequence some steps of the whole recognition and extraction process are shown for an object with three features: a protrusion on a face, a slot, and a through-hole. This method has been used in a system for computer aided process planning [Cug88b] and the SFAH model has been chosen as reference model for feature-based modeling systems [Fa188, Cas88j and as 3D representation of objects with features recognized from 2D descriptions in terms of technical drawings [Cug88a].

120

FALCIDIENO

AND GIANNINI

A

B FIG. 15. An example of the system use: (a) the starting object; (b) recognition and extraction of the P’ ,otrusion; (c) recognition and extraction of the through-hole; (d) recognition and extraction of the slot.

GEOMETRIC

MODELING

FIG. 15-Continued

SYSTEM

121

122

FALCIDIENO

AND GIANNINI

FIG. 16. A box with a chamfer on an edge.

The advantages of this method are: (1) The hierarchical decomposition of the boundary of an object into a main shape and its form features expressed as a hierarchy of volumes described by their boundary and the possibility of its easy updating. In fact, this hierarchical organization is not rigid, in the sense that the structured hypergraph representation of an object can be reorganized by applying abstraction and expansion transformation, so as to adapt it to a new object description expressed in terms of a different functionality. (2) The method works in the framework of solid modeling and generates symbolic descriptions of recognized features. It works directly on solid models and does not require any conversion of solid model data. Furthermore, the hierarchical description of the feature-based model produced is completely coherent and consistent with the input B-rep of the object because it is built on top of it. The limitation of the method is that the system is able to recognize only shape features which define loops or macroloops on the boundary of the object, that is Dor P-features. Due to this restriction, the system is not able to identify the so-called area-features, such as bevels and chamfers on edges and vertices, because the loop they define on the boundary of the object coincides with the external loop of a face. An example of these features is shown in Fig. 16, where a box with a chamfer on an edge is depicted; its bounding loop is formed by the edges {e,, e2, es, e4} and coincides with the boundary of the face f7. ACKNOWLEDGMENTS The work was partially supported by the I.M.A.-C.N.R.-Italcad Finahzzato Tecnologie Meccaniche-Sottoprogetto 1.2.

[A&7] [Arm841 [Ber77] [Big861

agreement and by the Progetto

REFERENCES S. Ansaldi, L. De Floriani, and B. Falcidieno, Geometric modeling of solid objects by using a face adjacency graph representation (SIGGRAPH ‘85), Comput. Graphics 19, No. 3,198s. S. Ansaldi and B. Falcidieno, Form Feature Representation and Recognition in a Structured Boundary Model, North-Holland, Amsterdam, Encamacao, McLaughlin Eds., Wozny, 1988. G. T. Armstrong, G. C. Corey, and A. de Pennington, Numerical code generation from a geometric modeling system, in Solid Modeling by Computers: From Theory to Applications, Plenum, New York, 1984. C. Berge, Graphes et Hypergraphes, Dunod, Paris, 1977. Biggs, E. K. Lloyd, and R. J. Wilson, Graph Theory 1736-1936, Oxford Univ. Press, London, 1986.

GEOMETRIC [Cam881 [Cas88] [Cha85] [Chi86] [Cug88a] [Cug88b] [Def88] [Fal87] [Fa188] [Gia86] [Gra75] [Hen841 [Jar841 [Jos88]

WYPW [Lee871 [Mea821 [SakSS]

[Wei86] [Wi185] [Woo821

123

CAD,

Cambridge,

1988.

K. Weiler, Edge-based data structures for solid modeling in curved-surface environment, IEEE Comput. Graphics Appl. 5, No. 1, 1985, 21-40. K. Weiler, Topological structures for geometric modeling, Ph.D. thesis, Rensselaer Polytechnic Institute, Troy, NY, August 1986. P. W. Wilson and M. Pratt, Requirements for Support of Form Features in a Solid Modelling System, Tech. Report, Geometric Modelling Project, CAM-I, 1985. T. Woo, Feature extraction by volume decomposition, in Proceedings, Conf. on CA D/CAM in Mechanical

(Woo851

SYSTEM

J. Shah,. P. Sreevelson, M. Rogers, R. Billo, and A. Mathew, Current Sfatur of Feature Technology, CAM-I Report R-88-GM-04,1988. L. Casu and B. Falcidieno, A Feature-Based Modeling System Built on Top of Euler Operators, Tech. Report 52, I.M.A., C.N.R., 1988. T. C. Chang and R. Wysh, An Introduction to Automated Process Planning Systems, Prentice-Hall, Englewood Cliffs, NJ, 1985. R. T. Chin and C. R. Dyer, Model-based recognition in robot vision, ACM Comput. Sumevs. 18, No. L.1986. U. Cugini, B. Falcidieno, P. Mussio and M. Protti, Towards automatic indexing of product models in a CIM environment, in Proceedings, IEEE Int. Conf. on Languages for Automation, Washington, 1988. U. Cugini, B. Falcidieno, and P. Mussio, Exploiting knowledge in a CAD/CAM architecture, in Intelligent CAD II, North-Holland, Amsterdam, 1988. L. De Floriani and B. Falcidieno, A hierarchical boundary model for solid object representation, ACM Trans. Graphics 7, No. 1, 1988. B. Falcidieno and F. Giannini, Feature extraction and organization into a structured boundary model, in Proceedings, EUROGRAPHICS ‘87, North-Holland, Amsterdam, 1987. B. Falcidieno and B. Fossati, Representing Tolerance Information in Feature-Based Solid Modeling, Tech. Report NO. 51, I.M.A.-C.N.R., 1988. F. G&mini, Feature Recognition in a Boundary Model, thesis, Universid di Genova Italy, 1986. [Italian] A. R. Grayer, A Computer Link between Design and Manufacture, Ph.D., University of Cambridge, Cambridge, England, 1975. M. R. Henderson, Extraction of Feature Information from Three-Dimensional CAD Data, Ph.D. thesis, Purdue University, 1984. G. E. Jared, Shape features in geometric modeling, in Solid Modeling by Computers: From Theory to Applications, Plenum, New York, 1984. S. Joshi and T. Chary, Graph-based heuristics for recognition of mechanical features from a 3D solid model, Comput. Aided Des. 20, No. 2, 1988. L. K. Kyprianou, Shape Classification in Computer-Aided-Design, Ph.D. dissertation, Computer Laboratory, University of Cambridge, England, July 1980. Y. C. Lee and K. S. Fu, Machine understanding of CSG: Extraction and unification of manufacturing features, IEEE Comput. Graphics Appl. 7, No. 1, 1987. D. Meagher, Geometric modeling using octree encoding, Comput. Graphics Image Process. June 1982. H. Sakurai and D. C. Gossard, Shape feature recognition: A bridge between symbolic and numeric computing environment, in preprints of the Second IFIP WC 5.2 Workshop on Intelligent

[Wei

MODELING

Engineering,

MIT,

Cambridge,

MA,

March

1982.

T. Woo, A combinatorial analysis of boundary data structure schemata, IEEE Comput. Graphics Appl. 5, No. 3, 1985. [Wood881 J. R. Woodwark, Some speculations on feature recognition, Computer Aided Des. 20, No. 4, 1988.