Research Representation scheme for defining and operating form features Liang-Chyau Sheu and James T Lin
A representation scheme is presented that is suitable for defining and operating form features. Five basic constituents, B-rep solid components, measure entities, size, location and constraints, are used to represent a single form feature. With these constituents, form features are defined structurally and procedurally. Parts are then represented by a hiDher-level structure, called a featuredependency graph, in which feature-position operators link the form features. In the FDG model, dimensions are used to determine the size and locations of form features. This property makes the manipulation of form features more consistent with the designer's intent. A c++ implementation of the physical data structure according to the logical representation scheme is discussed. form features, representationscheme, can/CAM, dimension,solidmodel
In an automated computer-integrated manufacturing (CIM) environment, a friendly, interactive interface between man and machine is necessary for the designer to lae able to perform the tasks of conceptual design. More importantly, the data prepared in the design stage should be used to drive the downstream activities. Current representation schemes of computer-aided design (CAD)systems have evolved into solid models which can represent 3D objects in geometrically complete and unambiguous ways 1. However, from the viewpoint of designers and computer-aided manufacturing (CAM) applications, conventional CAD systems are still not convenient to use. The product models stored in CAD databases can support only limited technological information. Moreover, current CAD systems are Departmentof IndustrialEngineering,NationalTsingHua University, Hsinchu, Taiwan 30043 Paper received:26 April 1992. Revised: 9 November 1992
volume 25 number 6 june 1993
mismatched in their level of abstraction with downstream applications 2-5. To overcome the obstacles of integrating CAD/CAM systems, many researchers devote themselves to methods for automatically recognizing and extracting useful information sets from CAD databases. The information sets, such as hole, slot, pocket etc., that are commonly used in the mechanical community are usually called features. The most important methods for the automatic recognition of features are summarized in Reference 6. The feature-recognition approach, however, suffers from the algorithms being fairly complex and generally limited to only simple features. Further, the problems of missing information and a poor design environment cannot be solved directly by this approach. A relatively new trend in CAD/CAMresearch field is the feature-based design (or design by features). It can be informally interpreted as 'designing products with terminologies that are meaningful to designers or applications without referring to the geometric details of which the features are composed'. Further, applicationspecific information can be incorporated in the part model from the beginning. Therefore, the ideas of feature-based design imply a more convenient design environment, and a stronger connection between CAD and CAM systems. A feature-based representation scheme is essential to an integrated feature-based CAD/CAM environment, and must be developed first for the following reasons : 'Feature-based design' is still a fuzzy term. A conventional solid-modeling system with a 'feature command shell' would provide designers with a better input mechanism, and this could thus be declared a feature-based design system. If the feature information is not well represented in the part model, the downstream applications still recognize features only with much effort, and the benefit of feature-based design declines.
0010-4485/93/060333-15 © 1993 8utterworth-Heinemann Ltd
333
L-C Sheu and J T Lin
/
• The modeling capability is generally limited in currently proposed feature-based systems because only a few predefined features are available. Because features depend on applications, one should not expect a canonical set of features to exist 7. Therefore, the modeling capability becomes the main drawback of feature-based design. Obviously, this problem can be overcome only if the representation scheme provides methods for the incremental creation of form features. • Because features in the part model are sensitive to context, editing and modifying existing features in the part model seems difficult and prone to error s . For example, it is easy to delete a simple slot which does not interact with other features. However, it becomes harder to decide whether or not to delete a through hole if that hole is situated inside a slot when the slot is deleted by the user. Similarly, extending the width of a slot may cause it to intersect with other features so that the original design intent may be violated. Providing that the designer's intent can be captured and stored in the part model, tasks such as feature modification would be much easier. We now discuss conventional geometric representations, constructive solid 9eometry (CSG) 1'9 and boundary representation (B-rep) 1°'11, which are currently widely used by solid modelers, from the point of view of feature-based modeling to discover their deficiencies. In pure CSG, solids are represented as binary trees with primitives as leaves and Boolean set operators as interior nodes. Naive intuition indicates that the leaves of a CSG tree can be used to represent simple form features, and the Boolean set operators can be interpreted as the machining processes, such as milling and drilling. Difficulties arise when the part and features become complicated. The features that do not belong to the primitive set must be constructed by several primitives and operators; therefore, they are not uniquely represented. For example, the counter bore of the part shown in Figure la can be represented by the two CSG trees shown in Figures lb and c. The second problem, which is more serious, is that, because CSG is an 'unevaluated' scheme, attaching dimensional and tolerance information to low-level entities is impossible unless the whole CSG tree is evaluated. B-rep represents a solid with faces, edges, vertices, and their topological relationships; therefore, the low-level geometric entities are explicitly stored in the B-rep solid model. One benefit of B-rep is that the nongeometric data, such as tolerances, can be attached to the geometric entities directly. However, identifying a specific feature in a pure B-rep solid model is extremely difficult, because B-rep represents geometric entities and topological relationships at the 1 level only. For example, in Figure 2, the slot is a form feature of the part ; f2 and f3 belong to the slot, and fx belongs to the raw part. In B-rep data, f l is an adjacent face to rE, and fa is also adjacent to rE. Therefore, f l and fa have the same topological relationship to f2, and computers have problems in identifying the boundary of that slot. Another drawback of both CSG and B-rep is that they
334
m
c
Figure 1. Features are not uniquely represented in CSG trees; ( a) part with a counterbore, (b ) two cylinder primitives are unioned to represent the counterbore, ( c ) two cylinder primitives are subtracted from the block primitive to represent the eounterbore slot boundary
/
/ /
Figure 2. Difficulties in identifyino slot boundary If1: face of raw part, f2: face of slot, f3: face of slot. Relation: f, adjacent to f2, f3 adjacent to .1"2.]
computer-aided design
Representation scheme for defining and operating form features
fail to represent dimensions explicitly. Representing dimensions in the part model is important, because dimensioning is a natural way of describing both a part's geometry and its functionality12 (refer to References 13 or 14 for a formal interpretation of dimensions and tolerances). For example, Figure 3a shows two parts that are designed to be assembled. Both methods of annotating dimensions (see Figures 3b and 3c) can be used to describe the position and size of the slot in the lower part, but, under the functional requirement (assembly), the method shown in Figure 3b is more reasonable, because d 3 remains unchanged if the part's width is changed; therefore, the condition for assembly is not violated. As the annotated dimensions generally denote critical points of the mechanical parts, the automatic translation of changes in dimensions into corresponding changes in geometry of a part model is an efficient method for part manipulation. Such a mechanism is called dimension-driven geometry ( D D G ) 12. In the face of these problems and requirements, our objective has been to develop a representation scheme for feature-based design that will • explicitly store form features in the part, and retain all the benefits of traditional solid models, • represent the dimensions at a high level of abstraction so that DDG can be achieved., • be extensible so as to provide a foundation to develop other higher-level applications. The remaining sections of this paper are organized as follows. After a survey of related studies, the basic components of form features are described. In the next section, we discuss how a form feature is defined with these components. A high-level structure which organizes
match
~deal
notmatch ~ I" C
d1
enlargedl ,-[
Figure 3. Dimensions reflect the designer's intent; ( a ) two parts are designed to be assembled, ( b ) the width of the slot is critical, and it is annotated as a dimension in this part, ( c ) the width of the slot is not represented explicitly
volume 25 number 6 june 1993
the form features as a part model is introduced, followed by an example to illustrate how the evaluation proceeds with this scheme. A c++ implementation of physical data structure is introduced before the concluding remarks.
RELATED RESEARCH Miner 15 proposed a system called FEDDS (FEature Description Design System), in which the representation of a mechanical part is similar to a CSG tree. By replacing the leaves of the CSG tree with evaluated B-reps and building tables that contain the reference faces, form features can be explicitly represented. His work focused on the manipulation of features rather than the representation scheme itself. Requicha and Chan 16 dealt directly with the CSG tree to represent tolerances using the theory of tolerancing. An independent graph called the VGraph is created to represent the variational information related to the mechanical part. The lowest-level entities of the VGraph are NFaces, which represent nominal faces of objects, and connect to CSG primitives via a special indexing mechanism. Features of two types are represented in the VGraph: 'surface features' (SFeat nodes) and 'curve features' (CFeat nodes). An SFeat node is either a VFace node, which is a portion of an NFace, or a FaceOP node, which forms a group of VFaces. Similarly, a CFeat node may be a VEdge or an EdgeOp; a VEdge is the intersection of two VFaces. SFeat and CFeat contain attribute lists to interface with the top-level entities of the VGraph, the DatSys nodes (datum systems). Roy and Liu 17 used a hybrid CSG/B-rep structure to represent both lower-level and higher-level entities. The CSG-like structure is a hierarchical organization of features that provides a multilevel representation of the object component relations. By coupling a 'spatialrelationship graph' (SRG) with the CSG representation, one locates the features and primitives relative to each other or with respect to a predefined datum reference frame. The boundary model corresponding to each level of the CSG tree is represented as a hypergraph called a 'face-adjacency graph' (FAG)18. On completion of the object-building process, the B-rep model retains a 'structured face-adjacency graph' (SFAG). Tolerances and other information may be attached to arcs of an SFAG or arcs of an SRG as attributes. The linking mechanism between the CSG tree and the B-rep model is similar to Miner's'reference faces'. The implementation of this tolerance representation 19,2° is based on the TWIN21 B-rep solid model. Shah et al. 4'5"22 built a form-feature modeling shell based on a CSG modeler. The top level of the feature model is a 'feature-relationship graph', which records both the adjacency and the parent-child dependency of form features. The nominal part geometry and cognition rules are created and stored in a frame-based data structure. The solid shape of a feature is defined by a CSG primitive or a CSG tree, the position and orientation of which are completely determined by a set of parameters and expressions. Tolerances are treated as 335
L-C Sheu and J T Lin
precision features that are created in another modeling shell. Gossard et al. 12 created a hybrid CSG/B-rep structure using the relative-position operator ( R P O ) concept. They divided a form feature into faces which are situated on nodes of the object graph. The set operator nodes are used to construct the form features and the part. The RPO nodes are used to represent the dimensions. The geometry is modified automatically when the dimensions are changed with the help of RPO. Because a form feature is represented by several nodes in their structure, it might be difficult to identify a specific form feature. Wang and O z s o y 23 presented a scheme which combines a modified CSG tree with a B-rep data structure to represent features. In their work, geometric features are classified into two groups : low-level primitive features and high-level form features. Primitive features, which can be used to define dimensions and tolerances, are explicitly described in B-rep data in terms of faces, edges and vertices. Form features are built on top of primitive features, and are initially stored in a feature library. A form feature is added to a part model by first instancing it from the feature library, and then attaching the implicit representation (a set of parameters and a set of feature faces) and explicit representation (evaluated B-rep data with each face referring to the corresponding feature face ) to the B-rep and CSG tree, respectively. Dimensions and tolerances are treated as constraints, and represented as constraining operators which support dimension-driven geometry. Gomes and Teixeira 24 also developed a hybrid CSG/B-rep scheme for feature modeling. In a similar way to other work on this approach, the CSG level represents the high-level relationships between features, and the B-rep model describes the details. An additional structure, called a feature topological structure (FTS), is coupled with the B-rep model to retain the construction history. In summary, most work shows the necessity of combining a B-rep representation scheme with a higher-level structure, which may be CSG-like or a completely new structure, and introducing D&T (dimensions and tolerances) information into the part model, for feature-based modeling. However, the issue of how to define new form features has rarely been treated ;it is, therefore, an important focus of this paper.
ELEMENTARY CONSTITUENTS OF FORM FEATURES A form-feature representation consists of the shape representation and the mechanisms to handle the form feature. The shape of a form feature is principally represented by a volume or by the surfaces of the enclosed volume. Figure 4 shows these two approaches. In a volume representation, a pocket feature is a rigid solid, whereas, in surface representation, a pocket may be represented by five or four faces, depending on whether the pocket is closed or open. The volume representation is superior, because features are easier to manipulate a.
336
volume approach: a rigid solid /~
#
volumeapproach: a rigid solid
surface approach: 5 faces close pocket
//
Y
surfaceapproach: 4 faces
S
open
Figure 4. Volume approach and surface approach to represent shape of feature
Other factors of concern are the mechanisms necessary for form features, and how they are joined together. Mechanisms for positioning and resizing features are provided by the representation scheme, as they are convenient for designers and applications in handling form features. Other properties, such as tolerances, are not treated as kernel elements of the representation, because they can be added to form features as attributes when they are needed. Joining the volume and all the mechanisms together, and incorporating them into a single data structure and providing a set of predefined form features, seems a poor idea, because the descriptive capability of the representation becomes limited. Instead, keeping the elements separate and then providing a procedure to bind them, is more rational. Five constituents are therefore proposed for this purpose : solid components, measure entities, size, location and constraints. Each is described in detail below.
Solid components The solid component represents the volume and the associated low-level geometric and topological information of a form feature. For convenience in attaching information to this volume, the necessary low-level entities of solid objects must be stored explicitly. In this sense, B-rep is more suitable than CSG for representing
computer-aided design
Representation scheme for defining and operating form features the volume of a single form feature. Downstream applications, such as NC program generation, which need an ordered traversing of the outer boundary of a form feature, can easily obtain the information about the faces, edges and vertices from the B-rep model. Therefore, B-rep serves as the internal representation of solid volumes in this scheme. The B-rep data structure that we use is derived from Mfintylfi's halfedoe data structure 25'26. As shown in Figure 5, a solid object is represented hierarchically by components, faces, loops, halfedges, edges and vertices in the halfedge data structure. Their topological relationships are represented by single and double arrows in Figure 5. A single arrow means that a link is stored to represent the relationship in the physical data structure, whereas a double arrow means that several links are stored. For example, as a face belongs to a unique solid component, there is a single arrow pointing from the face to the solid component. A solid component is bounded by a set of faces ; therefore, the relationship is represented by a double arrow directed from the solid component to the face. The fundamental method of building a half-edgerepresented solid component is by means of Euler operators 27. The coordinates of vertices are stored with a set of parameters. More convenient methods, such as sweeping or Boolean operations, can also be provided readily to construct solid volumes.
geometric entity, and type (face, edge, vertex etc.), and all the dimensions that refer to it are recorded in the ME structure. The ME can be further classified as physical measure entities (PME) and artificial measure entities (AME). The PME refer to the faces, edges or vertices physically stored in the solid components. For example, the width of the slot shown in Figure 6a is measured by the distance between the two sidewalls, which are represented by two faces in the solid model. AME such as the principal axis of a hole (see Figure 6b) and datum planes do not originally exist in the solid model; therefore, they must be created and treated as special geometric entities. The reasons why dimensions are not attached directly to geometric entities stored in the solid component follow. First, only the PME have corresponding geometric entities stored in the solid component. Second, as only a small part of the geometric entities is explicitly dimensioned, adding dimensional information to the B-rep increases the complexity of the data structure. Third, when some dimensions of the part are modified, all the corresponding geometric entities must be adjusted automatically. The ME serve as 'notifiers' in this case; that is, the inference mechanism of the designing system decides what and how geometric entities should be adjusted from the information stored in the ME.
Measure entities
Sizes (dimensions)
The measure entities (ME) are the interfaces used to attach dimensions to the solid component. The
A size (dimension) (SD) is a high-level abstraction of a specific dimension which controls an intrinsic size of form feature. It refers to two ME that belong to the same form feature, and its value corresponds to a specific parameter stored in the solid component. One example of SD is the width of the slot shown in Figure 6a. How many SD should be added to a form feature depends on the number of parameters used to construct the solid component. For example, as a rectangular block has three parameters (length, width and height), three SD must be defined to represent the size of the form feature. Values of SD may be self-determined or dependent on other features. For example, in Figure 7a, the depth d2 of a through hole, in general, is completely dependent on the thickness dx of the raw part. The depth of a blind hole can be self-determined (Figure 7b), or determined by the thickness of the raw part and another dimension (d 3 in Figure 7c). 15 relationships of dimension entities identified by Roy et al. 17 can be applied to SD (and LD, introduced below ) to ensure the correctness of dimensioning. They are (a) vertex-vertex, (b) vertex-edge, (c) vertex-axis, (d) vertex-median plane, (e) vertex-face, (f) edge-edge, (g) edge-axis, (h) edge-median plane, (i) edge-face, (j) axis-axis, (k) axis-median plane, (1) axis-surface, (m) median plane-median plane, (n) median plane-face, and (o) face-face. The preconditions necessary for these relationships, for example that two faces must be parallel to produce a reasonable face-face dimension, can be easily verified with the ME referred by the SD.
Component
Face
-I ',
lEdge
Loop
Halfedge
~[
Figure5.
Vertex
J
Hierarchical halfedye data structure
volume 25 number 6 june 1993
337
L-C Sheu and J T Lin
size(dimension)
I/ , / IMEI \
Ilink to Ilist of
co n~o this.s/ width
~ ~ r ' l ~
CpME, " "
~
/! 1 / ",,/J/J',,nktol,,,to, ~ I B'Rep Jdimensi°ns I - ' ' - ' '
~""'~
I, ' ' /
' moa, ontity.
-"-
-
'
V V slot volume
,,nk,o I,,,,o,
I ,
b
dangling geometricl
J dlmensions
I - "
entity
J
I
- "
- u-
measure entity. hole volume
(AME)
!princip~axis
Figure 6. Physical measure entity and artificial measure entity; ( a ) two P M E are attached to faces of the slot volume, ( b ) an A M E is attached to the principal axis of the hole volume
Locations (dimensions) Location dimensions ( L D ) are used to represent the relative position relationships between child and parent features. The parent feature can be the raw part, another feature or a datum feature (which contains only the AME). The structure of the LD is the same as that of the SD. The difference is that one ME referred to by LD must belong to the parent feature, the position of which is fixed when the child feature is processed (created, modified or evaluated). This mechanism is a significant characteristic, as a form feature can be located relatively and flexibly to other features without specifying the absolute coordinates. An example of the L D is da, as shown in Figure 7. The LD and SD are obviously correlated. As we have seen in Figures 7b and c, the
338
arrangements of d 1, d 2 and d 3 have special meanings for designers, dl is the SD of the raw part, d E is the SD of a blind hole, and d 3 is the LD of a blind hole. To prevent the violation of the validity of this part, the conditions d 2 + d 3 = d t and dl,2, a > 0, must be satisfied. Consider the case in which the raw part is enlarged. The depth of the blind hole in Figure 7b does not change, but the depth of the blind hole in Figure 7c increases; the results are shown in Figures 7d and 7e. Although the L D refers to the ME of both the parent and the child features, the supplier of the L D is the child feature. The reason is that only the child-feature ME, whose locations depend on parent features, can be predicted. Therefore, before a form feature is added to a part model, its L D invariably contain dangling sides.
computer-aided design
Representation scheme for defining and operating form features
blind hole
through hole
c
a
I
iiiiiiiiiiiiiii!iiiiii iiil d
2
::::::::::::::::::
at)
!~!~!~!!!~!!!~!~!!!!!!!!!!!!!! ........................,.-.., iiiiiiiiiiiiii)ii~i~ ili!ii!iiiiliiiiiiiiiiili!iiiiiii!iiiiiiiiiiiiiiii !!!i i!!i!i!!!!!i!!!!!!!!!!!!ii~l!i!!i}!)ii!i!i: ::::::::::::::::::::::::::::::
d
e
Figure 7. Dimensions that control the depth of hole features; ( a ) depth of through hole = thickness of raw part, ( b ) depth of blind hole is controlled by d2, and d3 is not annotated on drawing, ( c ) depth of blind hole is controlled by dl and d3, and d2 is not be annotated on drawing, ( d ) d2 is not changed after dl is changed, ( e ) de is changed after dl is changed, and d3 is not changed
!
,1
d4
;3raw part Figure 8. Generic form of hole features & Figure 7 Constraints Constraints are defined to restrict the special behaviour of a form feature. All three of the features shown in Figures 7a, b and c have a volume of the same type (cylinder). However, they behave differently because of different arrangements and permitted values in their SD and LD. Figure 8 shows a generic form of the hole features shown in Figure 7, in which a dimension with a nil value
volume 25 number 6 june 1993
is permitted. Dimensions of two special types can be defined in constraints. First, if the value of a dimension is determined before the feature is created, that dimension is called bounded. For example, d# is bounded to 0 in every case of Figure 7, because the top face of the hole volume invariably overlaps with the top face of the raw part. Second, if the value of a dimension can be derived automatically and dynamically, that dimension is called implicit. For example, d 3 in Figure 7b and d 2 in Figure 7c are implicit. If a dimension is neither bounded nor implicit, like d 2 in Figure 7b and d 3 in Figure 7c, it becomes a design value. We show how a simple constraint which represents a linear dimension chain is formulated with the current concepts. Figure 9a shows the generic constraint of the hole feature that is represented as a loop. The measure entities (ME or AME) are represented as nodes, and the dimensions (LD or SD) as arcs. The directions of the arcs are chosen arbitrarily, but they must be consistent (e.g. from - Y to + Y). If a node or an arc is marked with an asterisk, it is bounded. If an arc is represented by a broken line, it is implicit. There can be only one implicit dimension in a single loop. As ME x and ME 2 belong to the parent feature, they are bounded. Subsequently, dl is bounded because it refers to ME 1 and ME2. The process to determine the value of an implicit arc starts from the node to which the arc points, and then traverses back to the node at which the arc starts. The values of all the traversed arcs are summed to 6 when
339
L-C Sheu and J T Lin :g
"
dl
da
°
® Id2 ® 13=0 A !
®
a
b
0
0
® dl
the traversing starts from M E g to M E 2, and the values of the arcs sum to (d2 + 0 - dl ). In Figure 9d, the result is ( 0 - d l + d 3 ) . The bounded dimension d I and measure entities ME~ and ME2, in every case, are not parts of the hole feature and inaccessible when we define the constraint. It is unnecessary to construct the whole loop like those in Figure 9 to have a constraint. All we have to do is to store the information in the definition of a hole feature as follows (case b): 'Linear constraint: d 3 ~ d 2 - , d4, d2 implicit, d 3 bounded to 0, d 4 bounded to 0.' In this way, the constraint is modeled as a chain. As d 3 and d4 are LD, the loop can be constructed automatically by adding the arc between two ends of the chain, and the implicit value of d2 can be derived with the method mentioned above. In some cases, it is unnecessary to construct the loop. Figure 10 shows that the position of the counterbore's principal axis is determined by two LD, and its behaviour is modeled as two constraints. The concepts of linear constraints can be extended to more complex constraints, such as angular constraints or patterns to locate features. The main difficulties are that complex constraints are not easy to store in a data structure, and that the inference mechanism is hard to implement. A feasible solution is to build the constraints into an independent knowledge base, and to interface the feature-based design system with the expert system through the application-programming interface (API).
k !
! d2 !
-~
(princip~ axis.artificial)
/
d2 d2
MI"I[(fac,e.)
e
d
Figure 9. Linear constraints to derive values o f dimensions; ( a ) linear constraint, general case, ( b ) d2 = IO - dr + 0[, ( c ) d3 = Ide + 0 - dl], ( d) de = IO - dl + d3l [(b), (c) and (d) are the constraints of the hole features in Figure 7;
(a) is a general case.] dr_ traversing. Starting from any node and traversing back to it, the total sum of the arcs' values must be zero. Therefore, [61 becomes the value of the implicit dimension. In Figure 9b, we traverse the loop from M E 3 to ME~. The sum is (0 - d l + 0), of which the absolute value equals the depth of the through hole. In Figure 9c,
340
~*
Figure 10. Two constraints are used to determine position o f principal axis
computer-aided design
Representation scheme for defining and operating form features
T a
b
t2
Y
14
1
C Linear constraints: 1 "~s.~L,
15bound~d to O
÷
g Figure II. Define pockets," ( a ) block with three parameters, ( b ) attach six measure entities forface-locatin9 pocket, ( c ) set up three size dimensions, ( d ) set up six location dimensions, ( e ) closedpocket, ( f ) closedpocket, ( 9 ) open pocket
volume 25 number 6 june 1993
341
L-C Sheu and J T Lin
DEFINING FORM FEATURES The constituents described in the previous section tend not to be invoked individually by users and then be attached to the part model at runtime, because this is too tedious and difficult. Instead, form features that are generally used are defined in terms of those constituents and stored as a feature library. This section takes the pocket feature as an example to illustrate the procedure of defining form features. The steps are shown in Figure 11. Select~create a solid primitive." The volume of a pocket can be represented as a block primitive of which the geometric size is controlled by three parameters I, w and h. As a block is a simple and commonly used solid primitive, it is predefined, and can be selected directly from the primitive library. • Attach sufficient measure entities: If the pocket size and location are intended to be determined by its faces, six PME may be attached to the faces ( M E 1 - M E 6). No AME are needed in this case. • Set up size dimensions: Three SD (sl, sz and s3) can be set up to represent the size of the pocket. Each refers to two ME of this feature, and the face-face dimensioning condition is valid owing to the geometric properties of the block solid primitive. The values of these SD map to the parameters l, w and h, respectively. • Set up location." To make the definition more generic, we can set up six LD (11-16) with two LD in each direction. • Set up constraints: The three SD and six LD form three linear dimension chains in the x, y and z directions. As a pocket situated completely inside the part material is meaningless in machining, the location dimension 15 is invariably bounded to 0. Two sets of constraints are shown in Figures 1 le and 1 If to define two differently behaved closed pockets. Further, in Figure 1 lg, setting 11 to zero makes the feature become an open pocket. •
The feature library can grow incrementally to meet the requirements of a specific application. For example, if it is common to add slots to raw parts with irregular shapes, it might be convenient to define a slot with AME for positioning. In general, the feature library contains several definitions of a form feature with different positioning/dimensioning methods. Therefore, the designing system can invoke the best feature definition for designers after evaluating the context of the addition of the form feature.
FEATURE-DEPENDENCY GRAPH AND FEATURE-POSITION OPERATOR The feature-dependency graph ( F D G ) is the topmostlevel structure of the representation scheme, in which form features are arranged in accordance with their interdependency. Capturing the feature interdependency is an important task in the product-designing stage. For example, if feature B is located relative to feature A (i.e.
342
feature A supplies the reference surface to feature B), all subsequent changes of position or size of feature A must be reflected in feature B to perform automatic modification. The F D G consists of nodes of two types. The first is the form feature constructed with the elements described above. The other is the 'operator', termed the feature-position operator ( F P O ) , which represents the relative positioning relationship between two feature nodes. The reasons for developing the F D G and FPO, and an explanation of how features and FPOs are put together to form an F D G , are explained below. With the representation of form features described above, it is easy to find the upward dependency (child to parent) through the LD embedded in the form features. Conceptually, a part can be viewed as an acyclic graph (see Figure 12). The root of the graph stands for the raw part, whereas the other nodes are used to represent the form features added to the part. The arcs (shown by arrows in Figure 12) can be thought of as the LD contained in the features. Whenever the child feature needs the information about its parent features, it can scan all its LDs, and retrieve the necessary data via ME referred to by those LD. Therefore, the representation we have here is sufficient for tasks such as the solving of the constraints of a newly added form feature, which do not need to inform other features of additional messages. In addition to upward dependency, the downward dependency (parent to children) must be explicitly stored in the part model to ease and speed the tasks in which the parent feature must pass information to its child features. Without explicit downward-dependency information, examining all the parent-feature ME that are referred to by LD, and then finding the ME that belong to the child features, can also serve this purpose. However, such an approach is obviously too laborious. Therefore, the F P O structure is introduced to the representation scheme to store explicitly the featureinterdependency relationships. The structure of the F P O is shown in Figure 13, which consists mainly of two parts : a parent-feature reference and a child-feature reference. With the references stored in the FPO, the parent-child relationship can be easily identified by an FPO. To link all the feature nodes and the F P O together, two additional lists are added to each feature node. The feature which has child features retains a list of references to the F P O to record all the child features. Similarly, the feature which refers to other features retains a list of references to FPOs to record all the parent features. Therefore, the demonstrating part shown in Figure 12 is represented as an FDG, as shown in Figure 14, in which the arrows labelled p indicate the parent features. The F D G is efficient for representing the high-level relationships of features, wherein multidependency is permitted. For example, the location of the through hole shown in Figure 14 is dependent on the raw part and the through slot; this feature can be easily represented in the F D G model. This characteristic becomes more important when modifying the part model. For example, if the through slot is removed from the part model, consequent modifications of the through hole can be
computer-aided design
Representationschemefor definingand operatingform features
through slot
through hole
raw part
a
6 LDs ~ ~ " d ~ ' i ~ 2i m p l i m ~ /
(for boundedb°tt°mtoface,0) 3 LDs
(through slot)
~ (2 for principalaxis,
~
(through hole)
1 for top face with bounded value O)
b
~,e *
constraints of slot
•
th of hole
constraints of hole
C
Figure 12. Example part represented as graph; ( a ) part with slot and hole, ( b ) part represented as graph: only upward dependency is kept, ( c ) feature constraints determined with several reasonable methods. The simplest one is to remove the through hole, as it depends on the through slot. An alternative is to keep the through hole in the part model by modifying the LD that refer to the through slot. This procedure makes sense because the through hole also depends on the raw part, and, from
volume 25 number6 june 1993
the LD, we find that the hole can be machined from the bottom face of the raw part. More complicated decisions, such as whether to extend the hole length to keep it as a through hole, or whether to change the hole to a blind hole, can be made by the applications with the information supported by the FDG.
343
L-C Sheu and J T Lin )arent feature
following processes :
[ parent_____.FPO list ~ " J ~ ~ ~
_"z-
•
I c h i l d r e n ~ ~ F PI O~l i s t r-m ' r-~
•
parent FPO
i child
• •
I
-
-
child feature
•
Figure 13. FPO retains interdependency relationships between parent and child features
Step 1." Start from the feature node in which modification occurs. Build a working Jeature list ( W F L ) containing the references to the features that are directly connected to the starting node by inspecting the F P O list of that node. Then mark the starting node as evaluated. Step 2." If the working-feature list is empty, the evaluation process is completed. Otherwise, remove the first feature, termed the working feature ( W F ) , from the working-feature list, and go to Step 3. Step 3." If the working feature is already evaluated, return to Step 2. Otherwise, go to Step 4. Step 4." Verify whether all the parent features of the working feature (found via the F P O ) have been evaluated. If any parent feature has not yet been evaluated (not marked), ignore this removed working feature, and proceed to the next (return to Step 2). Eventually, we can find a feature for which all the parent features are evaluated. G o to Step 5 with this working feature. Step 5." Append all the child features that are directly connected to the working feature to the workingfeature list. Evaluate the dimensions of the working feature via the LD, SD and constraints, and mark it as evaluated. Then return to Step 2.
Figure 15 shows the evaluation processes of a part with four features. In Figure 15, the modification occurs in the t o p m o s t ( r o o t ) feature f 0 ; therefore, all the nodes in the F D G , whether directly connected to a root or not, are put in the working-feature list for evaluation. Such a situation requires the m a x i m u m steps of evaluation (16 steps in Figure 15). If we suppose that the modification
P
P panDntFOP
i=t:
(nil) i d~ild FOP list: S fo, raw part (O1,02,07,04) P
parent FOP list:
~
(01)
children FPO list:
children FPO list:
(O3)
Figure 14. Example part shown in Figure 12 is represented as a feature-dependency graph
EVALUATION OF FI3G Here, we illustrate the manipulation of form features by an example which evaluates an F D G part model to a single B-rep solid object. Evaluation or reevaluation is necessary for graphic rendering or when features are added to or deleted from an F D G model, or when some dimensions are modified by the user. This task is performed in a t o p - d o w n m a n n e r according to the
344
. n t FOP,ist: (O4) (O6)
(o'~,~ ) children FPO
(os)
I~:
I~nnt FOPlist: (O5.O6,07) children FPOlist: (nil)
Figure 15. Evaluation process 0/" FDG, size of JiJ is modified, reevaluation is required [ 1 : create WFL (working-feature list ): (Jl, fz, J4, f3 ), evaluated (Jo). 2: remove WF (working feature): fl, WLF: (`/'2,`/4, J3 ). 3: evaluate ,/"1, WFL f3, f2 )' evaluated (Jo, fl ). 4 : remove WF : )'2, WFL : (J4, .13, `/2). 5: evaluate fz, WFL: (f,~, f3, f2, f4), evaluated (fo, ./1,
:(f2,f4,
./"2). 6 : remove WF : f4, WFL : (./3, f2, f4). 7 : .f4 cannot be evaluated (f3 has not been evaluated). 8: remove WF: f3, WFL: (f2, f4). 9: evaluate f3, WFL: (f2, f4, f4 ), evaluated (./o, ./'1,`/2,f3 )- 10: remove WF : fz, WFL : (f4, `/4 ). 11 : fz is evaluated, proceed. 12 : remove WF : f4, WFL: (f4). 13: evaluate f4, WFL: (f4), evaluated (fo, fl, f:, f3, `/4). 14: remove WF: ./-4, WFL: 0. 15:.f4 is evaluated, proceed. 16: WFL is empty, stop.]
computer-aided design
Representation scheme for defining and operating form features occurs in f3, only one dependent feature f4 is put in the working-feature list, and the number of evaluating steps is much less than that of the previous case. Hence, in most cases, the reevaluation of an FDG is completed by the recalculation of the parameters of only a small portion of the nodes. In an interactive system, this feature is a very important factor in improving efficiency. The evaluation discussed here is concerned only with deriving the values of the positions and dimensions of the features. The combination of two B-rep solids is performed by traditional Boolean operations such as difference and union. Techniques for implementing such Boolean operations are mainly dependent on the physical B-rep data structure. The vertex-neighbourhood classification 28, developed by Miintyl~i, is taken to be the kernel of Boolean operations for solid objects represented by this representation scheme.
IMPLEMENTATION The c++ language (AT&T c++ Version 2.1 standard) is suitable for implementing the physical data structure of the FDG model according to the logical scheme that we propose. The constituents of form features, the FPO and the FDG referred to above are implemented in a class hierarchy (see Figure 16), which offers a great modularity through the inheritance and polymorphism of C+ + .
At the top of the class hierarchy is an abstract class named Object. In c++ terminology, an abstract class means that no object can be declared as that class directly. Instead, the abstract class provides virtual functions that act as place holders for functions of the same signature, and may be redefined in derived classes. For example, a virtual function, isA(), is defined in the class Object for all objects of the derived classes to register their class ........ i : Obl,~t '. ....... :
,..... I....
I ~
'...... [
FDGE~nent ....
,~ .
I
.
.
.
,
.
.
.
.
.
Fea~JreBement ' .
.
.
I
.
.
.
~ .....
l GolWcaint
CONCLUSIONS
. . . . . i ,/~bs'allclClass q
FaceEntlty I
,
name. The isA ( ) function is redefined eventually in the subsequent derived classes. An object of SD returns SD_class when calling its member function isA(), whereas an object of the class LD returns LD_class when its isA ( ) is called. This mechanism provides a convenient way of implementing complicated relationships, because the general behavior of a group of classes can be declared in virtual functions of their base class. For example, to determine the nominal value of a specific SD object, types of the two measure entities referred to by the size must be known. There can be 15 relationships between dimension entities. Instead of being built in the SD class, the methods of determining dimension values are implemented through the methods of the ME class. In the ME class, calls for determining dimension values are passed to methods of the GeometryEntity class. The values of dimension are determined by methods, including the 15 relationships, implemented in the five derived classes of the GeometryEntity class; it can be guaranteed that proper methods are invoked. It is easy to identify classes relating to the logical model introduced in the previous section from the class hierarchy. Other classes in the hierarchy are created for convenience of implementation. The FDGElement class is the base class of Feature and FPO. It is consistent with our logical model, because an FDG model comprises features and FPOs. Similarly, the FeatureElement class is the base class of SolidComponeut, ME, Dimension and Constraint. The GeometryEntity is an abstract representation of the geometric entity stored in the B-rep model. Every ME object contains a GeometryEntity object as its member data to represent the geometric information. Eventually, the GeometryEntity objects link the physical B-rep model stored as member data of SoliflComponent. Implementing the FDG model as the class hierarchy has the following benefits. First, inheritance and polymorphism facilitate the construction of the data structure. Second, the physical B-rep model is isolated from the logical model. More clearly, only the GeometryEntity and SolidComponent classes interact with the B-rep model. Therefore, the FDG data structure can be easily implemented on the basis of any B-rep data structure, and not necessarily the hierarchical halfedge data structure proposed in our system.
r~-]
InstanceClass
Figure 16. FDG model-class hierarchy
volume 25 number 6 june 1993
We have proposed a new representation scheme for modeling with form features. The highest-level structure of the representation, called a feature-dependency graph, represents the relationships between features in the part model. Feature-position operators act as the bridges between dependent features in the FDG. Each form feature consists of a B-rep model to represent its volume, a set of abstract measure entities to support the basis for dimensioning, a set of sizes (dimensions) to control its intrinsic size, a set of locations (dimensions) for location relative to parent features, and a set of constraints to define special behaviour in positioning and dimensioning.
345
L-C Sheu and J T Lin
The advantages of the representation scheme are as follows: • It is structural. Several levels of abstraction are logically represented and organized in the FDG structure. It is easy for applications to access and analyze information associated with each level. Moreover, information related to the features, such as tolerances, can be added to different levels without violating the original structure. For example, conventional limit ( + ) tolerances on dimensions can be attached to dimension entities as attributes, whereas the form tolerances, such as flatness of faces, can be attached to geometric entities. • It is extensible. The representation scheme supplies the methods for creating new form features. Further, new features can be defined by adding some constraints to existing ones in the feature hierarchy, as in the example shown in Figure 11, without them invariably having to be constructed from the beginning. • It is robust. With the constraints defined in features, if the users input errors, which may violate the feasible conditions, this can be detected. Problems of numeric errors that occur in calculating geometric data can also be reduced. For example, in the manufacturability test application, the entrance faces of features can be identified by searching the LD that are explicitly bounded to zero. With conventional solid models, the entrance faces may be covered by thin walls that are caused by numeric errors of Boolean operations. On the basis of this representation scheme, the future work is to develop a complete set of feature-modeling methodologies, and a feature-creation module that provides users with an interactive interface to build solid primitives and to bind all the necessary components to create new form features. The constraining rules for modeling the behaviour of form features must be abundant, and must be able to be extended to meet the requirements of several applications. Methods of validating constraining rules are also required. The otttine storage of feature definitions (i.e. the feature library ) must be designed. Finally, the user interface for part design must be able to retrieve feature definitions from a feature library, and make the form features act as intended.
using knowledge-based systems and feature recognition algorithms' Int. J. Comput. Integr. Manuf. Vol 1 No 2 (1988) pp 89 100 Roller, D 'Design by features: an approach to high level shape manipulations' Comput. Indust. Vol 12 No 6 (1989) pp 185-191
Shah, J J and Rogers, M T 'Functional requirements and conceptual design of the feature-based modelling system' Comput.-Aided Eng. J. Vol 5 No 1 (1988) p p 9 15
Shah, J J and Rogers, M T 'Expert form feature modeling shell' Comput.-Aided Des. Vol 20 No 9 (1988) pp 515-524
Shah, J J 'Assessment of features technology' Comput.-AidedDes. Vo123 No 5 ( 1991 ) pp 331-343 Requicha, A A G and Vandenbrande, J H 'Form features for mechanical design and manufacturing'
Proc. ASME Computers in Engineering Conf. (1989)
Rossignae, J R 'Issues on feature-based editing and interrogation of solid models' Comput. & Graph. Vol 14 No 2 (1990) pp 149 172
Requicha, A A G and Voleehar, H B ' Solid modeling : a historical summary and contemporary assessment' IEEE Comput. Graph. & Applic. Vol 2 No 2 (1982) pp 9-24 10 Weiler, K 'Edge-based data structures for solid modeling in curved-surface environments' IEEE Comput. Graph. & Applic. Vol 5 No 1 (1985) pp 21-40 11 Woo, T C 'A combinatorial analysis of boundary data structure schemata' IEEE Comput. Graph & Applic. Vol 5 No 3 (1985) pp 19-27 12 Gossard, D C, Zulfaote, R P and Sakurai, H 'Representing dimensions, tolerances, and features in MCAE systems' IEEE Comput. Graph & Applic. Vol 8 No 2 (1988) pp 51-59
ACKNOWLEDGEMENT We thank the National Science Council, Taiwan, for support under Contract NSC 80-0415-E007-14.
REFERENCES Requieha, A A G 'Representations for rigid solids: theory, methods, and systems' ACM Comput. Surv. Vol 12 No 4 (1980) pp 437-464
Graves, G R, Yelamanchili, B and Parks, C M 'An interface architecture for C A D / C A P P integration
346
13 Juster, N P 'Modelling and representation of dimensions and tolerances : a survey' Comput.-Aided Des. Vol 24 No 1 (1992) pp 3-17
14 Roy, U, Liu, C R and Woo, T C 'Review of dimensioning and tolerancing: representation and processing' Comput.-Aided Des. Vol 23 No 7 ( 1991 ) pp 466-483 15 Miner, R H 'A method for the representation and manipulation of geometric features in a solid model' Master's Thesis Dep. Mechanical Engineering, Massachusetts Institute of Technology, USA (1985)
computer-aided design
Representation scheme for defining and operating form features 16 Requicha, A A G and Chan, S C 'Representation of
geometric features, tolerances, and attributes in solid modelers based on constructive geometry' IEEE J. Robot. & Autom. Vol RA-2 No 3 (1986) pp 156-166 17 Roy, U and Liu, C R 'Feature-based representational scheme of a solid modeler for providing dimensioning and tolerancing information' Robot. & Comput.Integr. Manuf. Vol 4 No 3/4 (1988) pp 335-345 18 Ansaldi, S, de Floriani,
L and Falcidieno, B 'Geometric modeling of solid objects by using a face adjacency graph representation' A CM SIGGRAPH Vol 19 No 3 (1985) pp 131-139
19 Roy, U, Pollard, M D, Mantooth, K and Liu, C R 'Tolerance representation scheme in solid model: Part I' Technical Report TR-ERC 89-1 Engineering Research Center for Intelligent Manufacturing Systems, Schls. Engineering, Purdue University, USA (Jan 1989)
package' Master's Thesis Schl. Mechanical Engineering, Purdue University, USA (Dec 1987)
22 Shah, J J and Miller, D 'A structure for integrating geometric tolerances with form features and geometric models' Proc. A S M E Computers in Engineering Conf. ( 1989 ) 23 Wang, N and Ozsoy, M 'A scheme to represent features, dimensions, and tolerances in geometric modeling' J. Manuf. Syst. Vol 10 No 3 (1991) pp 233-240
24 Gomes, A J P and Teixeira, J C G 'Form feature modelling in a hybrid CSG/Brep scheme' Comput. & Graph. Vol 15 No 2 (1991) pp 217-229 25 Miintylii, M An Introduction to Solid Modeling Computer Science Press, USA (1988) 26 Sheu, L C 'A form feature-based solid modeling system' Master's Thesis Industrial Engineering Dep., National Tsing Hua University, Taiwan (1990)
20 Roy, U, Mantooth, K, Pollard, M D and Liu, C R
'Tolerance representation scheme in solid model: Part II' Technical Report TR-ERC 89-2 Engineering Research Center for Intelligent Manufacturing Systems, Schls. Engineering, Purdue University, USA (Jan 1989) 21 Mashburn, T A 'A polygonal solid modeling
voiumu 25 number 6 june 1993
27 Mintylii, M and Sulonen, R 'GWB : a solid modeler with Euler operators' IEEE Comput. Graph & Applic. Vol 2 No 7 (1982) pp 17-32
28 Miintyl~, M 'Boolean operations of 2-manifolds through vertex neighborhood classification' ACM Trans. Graph. Vol 5 No 1 (1986) pp 1-29
347