PIGMOD: parametric and interactive geometric modeller for mechanical design

PIGMOD: parametric and interactive geometric modeller for mechanical design

PIGMOD: parametric and interactive geometric modeller for mechanical design Koichi Kondo The paper describes the implementation of a geometric model...

1MB Sizes 3 Downloads 67 Views

PIGMOD: parametric and interactive geometric modeller for mechanical

design Koichi Kondo

The paper describes the implementation of a geometric modelling system named PIGMOD with a parametric design capability based on non-manifold geometric modelling. The basic idea is that a set of modelling operations can be so defined that there are correspondences between the geometric constraints and the modelling operations. The geometric relations are represented internally in terms of the modelling operation sequence. The modelling operations are implemented as manipulations on a non-manifold geometric model. The methods for modifying the geometric model automatically and consistently in accordance with changed or added dimensions are implemented in a simple and unified way. PIGMOD,parametricdesign,non-manifoldgeometricmodelling For mechanical applications, geometric shapes play an important role in realizing required functions on a machine. The designer has to consider a wide variety of technological criteria, such as kinematic, structural and dynamic properties, assembling constraints, manufacturing costs and so on, for defining the geometries of mechanical parts. Therefore, the mechanical parts are usually designed through iteratively modifying the geometries and evaluating properties from different points of view. A solid model is a powerful tool for representing 3D geometric shapes in a computer, and various engineering analyses can be performed using the solid model. However, current solid models are still insufficient for assisting the design process of mechanical parts. The designer usually defines the geometries of mechanical parts in terms of geometric relations and the dimensions shown in engineering drawings are good examples of these. Therefore, a geometric modelling system must have the capability of editing geometric relations simultaneously with the defining of geometric models. Research and Development Center, Toshiba Corporation, 4-1, Ukishima-cho, Kawasaki-ku,Kawasaki,KangawaPref. 210 Japan Paper received: 30 June 1989. Revised: 1 March 1990

volume 22 number 10 december 1 9 9 0

Using such a system, the designer can define the geometric model in close relation to geometric relations from the beginning of the design process. However, there are no simple and unified methods for representing geometric relations on a solid model, and for interactively changing, cancelling and adding these geometric relations. The paper describes the unified method for manipulating geometric relations represented on a geometric model. Geometric relations can be considered as geometric constraints and propagation of these constraints. The constraint satisfaction approach has been intensively studied for a long time in the field of artificial intelligence, and many constraint based systems have been proposed. In graphics and related fields, there are two pioneering systems: Sutherland's Sketchpad 1 and Borning's Thinglab2. Constraint propagation is the basic mechanism for deriving solutions which satisfy the given constraints. This is a powerful method, but has not yet been integrated with solid modelling technology. There are several previous works on parametric design and representation of dimensional constraints on two or three dimensional geometries. Roller eta/. ~, give a survey of recent research results in which these previous works are classified into three families: primary, algebraic and artificial intelligence approaches. The methods classified into the primary approach deal with limited constraints based on well understood algorithms, but have the capability of detecting an overconstrained scheme. Fitzgerald 4 dealt with vertical or horizontal constraints between two points and proposed a method for solving the problem of overconstrained figures. Gossard eta/), represented dimensional constraints on a CSG (constructive solid geometry) based solid model by introducing a relative position operator. But the method for automatic definitions of these relative position operators is not mentioned. The algebraic approach of variational geometry is discussed by Hillyard and Braid6, and Light and Gossard7. In this approach, dimensional constraints are translated into equations, and instances of a geometry are derived by solving a system of equations using an iterative numerical method. These methods are powerful and general, but

0010-4485/90/100633-12 © 1990 Butterworth-Heinemann Ltd

633

require a consistent and sufficient set of constraints selected by the user. Another family is based on the artificial intelligence approach. Aldefeld 8 used an expert system for deriving a geometry which satisfies the given constraints. But this method is limited to 2D problems. Kimura et al.9, represented geometric constraints using first order predicate logic, and derived instances of a geometry based on the geometric reasoning technique. Other works based on the artificial intelligence approach are also surveyed in Roller:~. On the other hand, there are several works on the historical representation of the drafting process and its applications to the modifications of geometries. For example, Yamaguchi et al. 1°, proposed a method to maintain the history of operation, and applied it to a simple drafting system. Roller's system 11 is also based on a similar approach. These approaches are also related to the 'programming by example' technique applied to graphical applications 12. But these systems deal only with 2D drawings, and give no method for extending these approaches to solid modelling systems. In the paper, the implementation of a geometric modelling system named PIGMOD (Parametric and Interactive Geometric Modeller for Mechanical Design) with parametric design capability based on non-manifold geometric modelling 7'8is discussed. This system has the capability of manipulating geometric constraints interactively on both 2D and 3D geometric models. The basic idea behind this system is that it is necessary to define modelling operations so that there are correspondences between them and the geometric constraints. A set of modelling operations which correspond to the geometric constraints provides the environment in which the designer is able to define the geometries in terms of geometric constraints. In this approach, the modelling operation sequence represents the method for constructing the geometric model and also represents the geometric constraints which define the geometries. The modelling operation sequence can be considered as a process for deriving solutions which satisfy given constraints. A history mechanism is implemented for representing the geometric constraints internally in terms of modelling operations. The dependencies among the geometric constraints are also represented as dependencies among the modelling operations. Manipulations on geometric relations, such as changing, cancelling and adding geometric relations, are realized as manipulations on modelling operations internally. This approach is also extended to the solid

a

model by implementing all kinds of modelling operations, from 2D drafting operations to manipulations on the solid model, based on non-manifold geometric modelling in a unified manner. In the paper the relations between the modelling operations and the geometric constraints are described. Then, methods for modifying the geometric model in accordance with changed dimensions and adding or cancelling dimensional relations are shown in relation to constraint propagation. Next, the implementation of modelling operations based on non-manifold geometric modelling is described. Finally, an example is shown.

MODELLING OPERATIONS Modelling operations correspond to commands which the designer actually uses for defining geometries and comprise a wide variety of operations from 2D drafting operations to manipulations on 3D solid objects, such as sweeping faces, gluing two solids, and so on. The method proposed in the paper includes a variety of modelling operations which provide unrestricted and flexible environments for defining geometries. The designer is able to define the geometries just as s/he makes engineering drawings using rulers, compasses etc. These modelling operations are implemented in a unified way based on non-manifold geometric modelling which will be described later. Figure 1 shows some examples of the implemented 2D drafting operations. The reason why the circular line is divided into several segments is that representing a closed line using only one segment brings about topological ambiguity into the geometric model database based on non-manifold geometric modelling. From the viewpoint of geometric constraints, executing modelling operations corresponds to defining geometric constraints on the model. For example, the modelling operation for drawing a line segment horizontally specifying the datum point and the length corresponds to the geometric constraint which defines the distance between two vertices and the direction vector of the line segment. The modelling operation for drawing a circle specifying the centre vertex and the radius corresponds to the geometric constraint which defines the distance between the centre vertex and the points on the circle. Moreover, the modelling operations for deleting geometric entities provides the capability for representing complicated geometric constraints. If

b



d

e

f

©

Figure 7. Examples of implemented 2D drafting operations (a) draw line segment horizontally; (b) connect two points by line segment; (c) draw circle; (d) draw parallel line; (e) draw line segment which is tangent to two circles; (f) delete line segment

634

computer-aided design

the designer is allowed to delete any geometric entity, s/he is able to define any auxiliary geometric entity. An additional line which is used just for marking a certain point is a good example. For instance, consider the problem of defining a triangle shown in Figure 2(a). Such a triangle is usually drawn using two additional lines as shown in Figure 2(b) for defining the position of the vertex: V 3. The sample modelling operation sequence becomes as follows: • Operation-l: put one vertex Vl. • Operation-2: put one vertex V2 relative to V~ (dimension a is specified). • Operation-3: connect V~ and V2 by an edge El. • Operation-4: draw a circular line A~ whose centre is V2 (dimension b is specified). • Operation-5: draw a line A 2 parallel to E~(dimension c is specified). • Operation-6: obtain the vertex V3 by calculating the intersection between A~ and A2. • Operation-7: delete A~ and A 2. • Operation-8: connect V3 and V2 by an edge E2. • Operation-9: connect V~ and V~ by an edge E3. The additional line A1 corresponds to the geometric constraint which defines the distance to the vertex V2 while the additional line A2 denotes the geometric constraint which defines the distance to the edge E1. Calculating the intersection between these two additional a

b

b

.__ V3f_..~" AI

A2

E3 ~

V

I

E2

V2

Figure 2. Example of (a) dimensional constraints and (b) corresponding additional lines

volume 22 number 10 december 1990

lines can be considered as defining the conjunction of these two geometric constraints. The set of these modelling operations enables the designer to input the dimensional constraints directly and incrementally into the geometric modelling system using the corresponding modelling operations. For this reason modelling operations must be defined for every primitive geometric constraint, but these primitive modelling operations cannot be implemented on current solid modelling systems because wire-frame representation, surface representation and simultaneous representation of these forms is not allowed. This is the main reason why non-manifold geometric modelling is used as the framework for this system. More precisely, each modelling operation is related to the following information: • newly generated or deleted geometric entity; • geometric entity which is used as datum; • type of geometric relation which is defined by executing the modelling operation; • a set of dimensional values which define the geometric relation. The modelling operations are mainly categorized in terms of topological manipulations on the geometric model database, and there are several variations for each of these with respect to the corresponding geometric relation. For example, consider the topological manipulation by which one vertex is generated, and several modelling operations can be defined for this on the geometric model database. One is the modelling operation for generating a vertex by specifying the position directly using the three values of the x, y and z coordinates. This defines no geometric relation to other geometric entities, because the position of the new vertex is determined independent of other geometric entities. The other is one in which the position of the new vertex is calculated using the datum vertex and a relative positional relation. This defines the geometric constraint between two vertices, and shows that it is propagated from the datum vertex to the new vertex. This means that the new vertex depends on the datum vertex in terms of the positional relation. Another modelling operation is also possible in which the position of the new vertex is calculated as the middle point of two specified vertices. In this case, the new vertex depends on two specified vertices. In this way, the modelling operations are categorized first in terms of topological manipulations on the geometric model database, and further classified in terms of corresponding geometric relations. The modelling operation sequence executed by the designer is maintained in a history mechanism. This history mechanism also maintains the geometric constraints, dependencies among these constraints, and how these geometric constraints are propagated, all in terms of the executed modelling operations in a unified manner. Figure 3 schematically shows how the geometric constraints are propagated for the example shown in Figure 2 as a directed graph. Every arc in this graph corresponds to the executed modelling operation, and the direction of the arc denotes the direction in

635

Operation

~

~

_~[~perati.~ -6 0perai~° t n-Ope~r~t ~i°2n_84

Operatio9~ n_ ~ Operatio8n__ / ~ r ation-~"~J~perat ion~.3 ,at,oo-

dimension is supposed to define the relation between two geometric entities, and this dimensional relation is defined by generating a new geometric entity relative to an existing one. A modelling operation which has two or more corresponding arcs is that for generating geometric entities which satisfy the conjunction of dimensional relations. The modelling operation for obtaining an intersecting point, that for determining a middle point of specified two vertices, and so on, belongs to such an operation. For example, operation-3 for drawing the edge E~ corresponds to calculating the geometry of an edge which satisfies the positional constraints for vertices V1 and V 2. Operation-6 corresponds to satisfying the conjunction of the constraints denoted as dimensions b and c.

Figure 3. Relation between geometric entities and propagated geometric constraints tor example shown in Figure 2

DETECTING AND CANCELLING DIMENSIONAL RELATIONS

which the corresponding geometric constraint is propagated. Every node corresponds to a geometric entity, such as a vertex, edge, or face. Every constraint propagation graph defined by executing modelling operations always becomes an acyclic graph, because geometric entities which will be defined afterwards cannot be used as datum geometric entities. This is one of the important characteristics for manipulating them. The root node in a directed constraint propagation graph shows that the corresponding geometric entity is independent of others in terms of the geometric constraints. For example, the vertex V1 is the root node in the constraint propagation graph shown in Figure 3. All geometric constraints which have influence on a particular geometric entity can be enumerated by traversing this directed graph in the reverse direction. A set of dimensional relations which defines the geometry of the specified entity corresponds to the set of arcs which form the path from root nodes to the node of the specified entity. A set of root nodes which correspond to a particular geometric entity shows a set of geometric entities whose geometries must be defined for determining the geometry of the specified entity. For example, the dimension a can be enumerated as the geometric constraint concerned with the edge E1by traversing and enumerating the arcs which correspond to Operation-2 and Operation-3. The set of root nodes for E1 becomes { V1 }, and this shows that the geometry of E~is uniquely defined by the position of V~. The way in which the geometry of the specified entity is defined is easily checked by enumerating the root nodes. This simple checking procedure is effectively used for seeing whether adding the dimensional relations causes overdimensioning or not. Another significant characteristic of this graph is that all arcs which connect a particular node and its parent nodes correspond to the same modelling operation. The reason being that these arcs correspond to the modelling operation concerned with generating the geometric entity which corresponds to the particular node. The modelling operation related to a dimensional value has only one corresponding arc, because a

As shown above, geometric constraints and how they are propagated is maintained in the history mechanism. The dimensional relation between any two geometric entities can be detected using this information. The dimensional relation corresponds to the propagation of the geometric constraints between two geometric entities. Therefore, checking dimensional relations is equivalent to checking propagated geometric constraints. Let G1 and G2 be geometric entities to be checked, and SN~ and SN2 be sets of the root nodes for G1 and G2, respectively. Because the constraint propagation graph for G1 and G2 is acyclic, SN~ and SN2 are necessarily found by traversing this constraint propagation graph in the reverse direction. If there exists an identical node in both SN~ and SN2, there is a dimensional relation between G~ and G2. The dimensional relations concerned with these two geometric entities are enumerated by finding paths in the graph between two corresponding nodes, and by checking dimensions related to the arcs in these paths. For example, consider the problem of checking the dimensional relation between two vertices V2 and V3 in Figure 3. In this case, G~ and G2 become V2 and V 3, respectively. Both SN1 and SN2are sets which contain only one element: V 1 (SN~ = SN2-- {Vl}). This means that there are relationships between these two vertices, because both V 2 and V~ are uniquely defined by V~ in terms of dimensional relations. There are several paths between V2 and V-~. The path which consists of arcs operation-4 and operation-6 is related to the dimension b, while the one that comprises the arcs operation-3, operation-5 and operation-6 is related to the dimension c. A dimensional relation corresponds to the propagation of a geometric constraint, the propagation of which is internally represented as a modelling operation. So, cancelling a dimensional relation is equivalent to cancelling the propagation of a geometric constraint. This means that every dimensional relation can be cancelled by replacing its corresponding modelling operation. As described in the previous section, every modelling operation has variations which apply the same topological operations but define other geometric relations. A dimensional relation is cancelled by replacing its corresponding modelling operation with that which

636

computer-aided design

applies the same topological manipulation but defines no geometric relation. For example, the dimensional relation denoted by b in Figure 2 can be cancelled by replacing operation-4 with the modelling operation for drawing a circle whose centre is directly specified by the numerical values of the x, y and z coordinates. The default values for these coordinates will be the same as the vertex V 2 but the geometric constraint which corresponds to operation-4 will not be propagated because the positional change of the vertex V 2 will not cause a positional change of the circle A1. In this case, the value for the radius is set to b, but this constraint is defined between the circle and the centre point specified by the x, y and z coordinates. For instance, when the vertex V 2 is moved to the position denoted by V'2 in Figure 4, with the distance between the two vertices V1 and V2 fixed, the position of the vertex V'3 is calculated using the fixed circle A1 and the modified line A'2, as shown by solid lines. If the dimensional relation is not cancelled, this triangle is rotated rigidly, as shown by the dot-dashed lines. After cancelling the relation, the constraint propagation graph becomes as shown in Figure 5, and the nodes V~ and A1 are both root nodes for the vertex V3. This means that the triangle shown in Figure 4 by the solid lines is uniquely defined only when the positions of both the vertex V~ and the circle A~ are specified, and is under-dimensioned. The dimensional relation denoted by a can be cancelled by replacing operation-2, however, this operation explicitly defines the distance between V~ and V2, and also implicitly defines that the direction vector from V~ to V2 is horizontal, and these two relations are cancelled at the same time. If the designer wants to cancel these two relations independently, s/he has to define them independently. In other words, the designer has to determine the vertex V 2as the intersecting

A A2

V3

,/~

~"

s

.f/7 \

"--. X

_/. _.:.._.\-v,, ,,,,, vI

A'.-----

\

\ ,, .

.

.

.

V 2

Figure 4. Modified geometries on positional change of V2: solid line: when dimensional relation is cancelled; and dot-dashed line when dimensional relation remains

volume 22 number 10 december 1990

Figure 5. Relation between geometric entities and propagated geometric constraints after cancelling dimensional relation point between the line which defines the direction vector and the circle which represents the distance.

CHANGING DIMENSIONS The method for modifying geometric models automatically and consistently in accordance with the changed values of dimensions using historical information maintained in the history mechanism is now discussed. No topological change in the geometric model is supposed to occur in the following discussion. As shown above, dimensions are considered as geometric constraints for defining geometries, and these geometric constraints correspond to modelling operations. When a dimension is specified, its corresponding modelling operation is uniquely identified. In this approach, the geometries which satisfy a set of given geometric constraints are considered to be derived by executing their corresponding modelling operations. Changing a dimension is equivalent to replacing a corresponding geometric constraint in accordance with the new value and replacing a corresponding geometric constraint can be considered as replacing a corresponding modelling operation in accordance with the new value. Therefore, geometries which satisfy the new set of geometric constraints can be derived by cancelling such modelling operations which depend on the dimensional change and by executing these modelling operations again in accordance with the new value. Modified geometries can also be derived by resetting the geometric model database and by executing all modelling operations again. Consider the example shown in Figure 2, for instance, when the designer specifies a new value to the dimension denoted by c, operation-5 is the corresponding modelling operation. In this case, the four modelling operations from operation-6 to operation-9 depend on operation5, as shown in Figure 3. If the geometric model is modified by cancelling these modelling operations, the modelling operations 5 to 9 should be cancelled, and executed again in accordance with the new value for dimension c. If the geometric model is modified by

637

resetting the database, nine modelling operations should be executed. For achieving a shorter execution time, the computational cost for executing or cancelling the modelling operations can be roughly evaluated considering the number of generated or deleted geometric entities and so on. The method for modifying the geometric model (resetting the database or cancelling modelling operations)is determined by making an approximate evaluation of the total computational cost for executing and cancelling necessary modelling operations. Moreover, the computational time is greatly reduced by cancelling and executing only those geometrical calculations necessary for deriving the modified geometries in actual implementation. Because no topological change on a geometric model is considered in this system, the cancelled topological manipulations for changing a dimensional value are necessarily executed again and construct the same topological representation. This means that the modified geometric model can be derived without cancelling or executing topological manipulations on the geometric model database. Therefore, the topological manipulations and the geometric calculations are implemented separately, and the modified geometric model is derived without cancelling or executing topological manipulations.

ADDING DIMENSIONAL RELATIONS In this section, the method for adding dimensional relations between two existing geometric entities is described. The modelling operation sequence and dependencies among the modelling operations are modified in accordance with the added dimensional relations. The basic approach for adding dimensional relations is that an addition is assigned without modifying the existing modelling operation sequence to one which is related to no dimensional relations. In general, an additional relation specified by the designer differs from a geometric relation for a modelling operation to which an added relation is internally assigned, and this relation for internal representation is derived by propagating geometric constraints. These added dimensions must be capable of change and the geometric model is automatically and consistently modified in the same way as dimensions defined by executing modelling operations. The procedure for adding dimensional relations is roughly divided into the following stages: • Stage 1 : check whether adding a dimensional relation causes over-dimensioning or not. • Stage 2: find a modelling operation to which the added dimensional relation is assigned. • Stage 3: calculate the dimensional value which satisfies the set of geometric constraints for the modelling operation found in the previous stage. • Stage4: reconstruct the geometric model by cancelling or executing modelling operations. This approach requires a reasoning process for calculating the dimensional value for the modelling operation to which the new relation will be internally assigned.

638

However, the constraint propagation graph shown in Figure 3 remains acyclic even after adding dimensional relations. This characteristic of the constraint propagation graph simplifies the procedure for detecting whether adding dimensional relations causes over-dimensioning or not. The reasoning mechanism for calculating the dimensional value is realized based on the simple constraint .propagation approach independent of this over-dimensioning checking mechanism, and can be easily extended by introducing a rule-based reasoning mechanism which is commonly used in systems based on the artificial intelligence approach :~'~'~. For example, consider the problem of adding a relation denoted by b', as shown in Figure 6, after cancelling the geometric relation denoted by b in Figure 2(a). The constraint propagation graph before adding the relation b' is the same as that shown in Figure 5. A detailed procedure for adding dimensional relations is described below in relation to this example. Checking whether adding a dimensional relation causes over-dimensioning or not is equivalent to checking whether the specified geometric entities between which the additional relation will be defined are rigidly related with each other in terms of a dimensional relation or not. This can also be expressed as equivalent to checking the existence of extra degrees of freedom between the specified geometric entities. Whether the specified geometric entities are rigidly related with each other or not is checked by enumerating the root nodes for these specified two geometric entities. Let G1 and G2 be the geometric entities between which the geometric relation is added, and let SN1 and SN2 be sets of root nodes for G~ and G2, respectively. G~ is uniquely defined only when the positions for all geometric entities which correspond to the nodes in SN1 are specified. G2 is also uniquely defined in the same way. It can be considered that the nodes in SN~ and SN2 define the degrees of freedom of G~ and G2, respectively. Therefore, when SN1 and SN2are identical, G2 is uniquely defined when G~ is uniquely defined, and vice versa. This means that the geometric entities, G1 and G2, are rigidly related with each other, and no extra degrees of freedom remain for the newly added relations. When attempting to define a relation b' between V, and V3, as shown in Figure 6, G~ and G2 become V~ and V-~, respectively, in the constraint propagation graph shown in Figure 5. So, SN~ is [V~Ij, and SN2 is [V~, A~I. In this case, SN1 and SN2 are not identical. V~ is the root node for itself and depends only on itself, but V3 depends on V~ and A~. Therefore, it is necessary for determining the geometry of V~ to define the geometry of A~ even after the position of V1 is defined. It can be considered that V~ has the extra degree of freedom which corresponds to A~, and this extra degree of freedom can be replaced by the added dimensional relation b'. This means that adding the new relation will not cause over-dimensioning, and that the additional relation must be so defined internally that A~ becomes the descendant node of V~. When the designer defines two geometric models independently and tries to add a new relation between these two geometric models, SN1 and SN2 become

computer-aided design

-I Figure 6. Example of added dimensional relation completely different sets, and adding a new relation will not cause over-dimensioning. In the next stage, it is necessary to find the modelling operation to which the new relation is assigned. Where adding the relation will not cause over-dimensioning, SN1 and SN2 are not identical and some nodes in SN~ or SN2 correspond to the cancelled geometric relations or their equivalent relations, and the newly added relation is assigned to one of these. An equivalent relation is defined in this paper as the one which is capable of being defined by replacing the modelling operation. It therefore corresponds to the modelling operation which currently defines no dimensional relations and which has a geometric entity defined previously to the modelling operation as a candidate for the datum entity. Such cancelled or equivalent relations correspond to root nodes which are included exclusively in SN~ or SN2, and can be considered as the extra degrees of freedom mentioned above. Such a root node and the node of the candidate entity for the datum will become the end node and the start node of the newly defined arc, respectively, in the geometric constraint propagation graph. When such a root node is found in SN3, the candidate geometric entity for the datum must correspond to the descendant node of the node in SN2, and the added relation should be so assigned to this relation that this root node becomes the descendant node of the datum entity. If there are several cancelled or equivalent geometric relations to which the relation can be assigned, the new relation is assigned to the modelling operation which has been found first while searching such a relation in the current implementation. In the example of Figure 5, the node A~ is exclusively included in SN2 (A3¢SN~, A~SN2, SN~ = {V~}, SN2 --{ V~, A1 }), and represents the extra degree of freedom. V2 can be used as the candidate entity for the datum, and is the descendant node of V~. In this sense, the node A~ which corresponds to the cancelled geometric relation certainly satisfies the condition described above and the new relation b' is assigned to the modelling operation for drawing a circle. Therefore, the dimension b' is internally represented as the radius of the circle, and as the constraint propagation from V 2 to A~.

volume 22 number 10 december 1990

When the modelling operation, to which the new relation is assigned, is found, it is necessary to calculate its dimensional value. This value is calculated by the reasoning mechanism based on constraint propagation. This reasoning mechanism finds a path in the constraint propagation graph for calculating the dimensional value, and then, propagates geometric constraints along it. For example, the value of the radius must be calculated for the modelling operation for drawing a circle, and the positional relation between two vertices must be calculated for the modelling operation for putting in a vertex. In the example shown in Figure 6, the dimension b' must be translated into the radius of the circle A1. In this case, the position of the vertex V3 is derived using the existing dimensional relation denoted by c and the new dimensional relation denoted by b'. In other words, the vertex V 3 is defined by directly propagating the geometric constraints which correspond to dimensions b' and c from Vl to V 3. In this way, the reasoning mechanism adds a temporary arc between two specified entities which is newly defined by the added relation, and then finds a path for calculating the dimensional value which includes this newly defined temporary arc in the following way. The end node of the arc, to which the additional relation will be internally assigned, is the root node in the constraint propagation graph, and one of two terminal nodes of the temporary arc becomes the descendant node of this node. Therefore, the path for calculating the dimensional value basically comprises the following paths: • the path from the start node of the relation to which the additional relation is internally assigned to its root node; • the successive path from this root node to the start node of the temporary arc; • the temporary arc; and • the path from the end node of the temporary arc to the end node of the relation to which the additional relation is internally assigned. In this example, the radius of the circle corresponds to the geometric constraint propagated from V 2 to A1, shown in Figure 7 by a dot-dashed line. The path for calculating the dimensional value is as shown in Figure 7 by dotted lines. The dimensional value is computed by propagating geometric constraints along this path. For this computation, some geometric constraints must be propagated backwards. Therefore, every modelling operation has a procedure for propagating geometric constraints backward. Using these procedures which will be discussed in detail below it becomes possible to calculate the geometric relation for the modelling operation to which the new relation is internally assigned. This calculated dimensional value is related to the geometric constraints which were propagated for deriving it. When the dimensional values for these geometric constraints are changed the dimensional value for the added relation is calculated again by propagating the constraints in the same way as before so that all geometric

639

of the latter category is much more complicated than that of the former. Returning to the example shown in Figure 7, two geometric constraints must be propagated backward. First, the geometric constraint which corresponds to dimension a must be propagated backward from V: to V~. Let the vector R be the positional relation which corresponds to dimension a shown in Figure 6. Then, the forward constraint propagation is expressed as V2=VI+R and the backward constraint propagation is expressed as

V, = V 2 -- R Figure 7. Constraint propagation for deriving dimensional value for modelling operation to which new relation is assigned; dotted line: known geometric constraints; and dot-dashed line for unknown geometric constraint constraints are satisfied. In Figure 6, the radius will be calculated again when dimension c is changed. After calculating the dimensional value for the modelling operation, the geometric model is reconstructed in the same way as the procedure for changing dimensions described earlier. At this stage, the geometric constraints are propagated in the direction shown by the dot-dashed line and solid lines in Figure 7. The constraints denoted by the dotted lines are propagated just for computing the geometric constraint shown by the dot-dashed line.

BACKWARD CONSTRAINT PROPAGATION Backward constraint propagation is very important for realizing the capability of adding dimensional relations. Every modelling operation has a procedure for propagating geometric constraints backward and these are roughly classified into two categories. The first category corresponds to modelling operations which have only one corresponding arc in the constraint propagation graph. As described above, such a modelling operation is related to a dimensional value, and defines the constraint propagation from the datum geometric entity to the newly generated one. So, backward constraint propagation is realized as a constraint propagation from the newly generated geometric entity to the datum geometric entity, and defines the geometry of this uniquely. Another category corresponds to modelling operations which have two or more corresponding arcs in the constraint propagation graph. Such a modelling operation is executed for calculating the geometric entity which satisfies the conjunction of several conditions. Therefore, backward constraint propagation generally does not give the information for determining the geometries of the entities which correspond to the parent nodes. For example, two lines on the same plane define one intersecting point when these two lines are not parallel, but this intersecting point does not uniquely define the geometries of these two lines. Therefore, backward constraint propagation

640

This constraint propagation is categorized into the former one, and can be executed in a very simple way. The geometry of V~ is uniquely determined by this backward constraint propagation. On the other hand, the backward constraint propagation from V3 to A 7 shown in Figure 7 by a dotted line is classified into the latter category. This backward constraint propagation only says that the vertex VB must be located on the circle A~, and does not uniquely define the geometry of the circle A1. However, this backward constraint propagation denotes that the radius of A1, r, is derived as the distance between its centre C1 and V~

In this case, C~ is the same as V2, and the desired value r can be calculated. But some constraints classified into the latter category can be propagated backwards in a simple way under a particular condition. Taking a middle point constraint apart from the example shown in Figure 7; forward constraint propagation is defined as determining the middle point PBof the specified two vertices P~ and P2. Then, the forward constraint propagation is expressed as P~= (P1 + P2)/2 and the backward constraint propagation is expressed as

PI=P~x2--P~ P2=PB x 2--P1 under the condition that one of these two vertices, P~ and P2, is known. Of course, it is impossible to uniquely determine the geometries of both P~ and P2 using only the geometry of PB, and this backward constraint propagation gives only the relation between P~ and P2. This method is applicable to most simple cases which can be seen in engineering drawings of mechanical parts. Datum lines or datum planes can be easily and efficiently changed through cancelling and adding dimensional relations. However, there is a limitation in current implementation, and an extended reasoning mechanism is necessary to cope with 2D or 3D

computer-aided design

complicated exceptional cases. Two difficulties lie in the backward constraint propagation for the geometric constraints of the latter category. The first one is the existence of branches to be traversed backwards in the path for calculating the dimensional value. Such branches represent the existence of constraint propagations which cannot simply be propagated backwards without assumptions or heuristics from a global point of view. Relaxation or a special purpose procedure must be used for such a problem. Another difficulty is such backward constraint propagation which does not determine the geometry such as that from V3 to A~ in Figure 7. If there are constraints to be successively propagated backwards to such a constraint, these constraints have no starting point for backward propagation and even constraints which are classified into the former category cannot be propagated. Heuristics are also necessary to overcome this problem. The problems which can be solved depend on the heuristic power of the reasoning mechanism. For instance, consider the problem of defining a quadrangle shown in Figure 8(a). The example shows the typical difficulties in backwards constraint propagation. This quadrangle is uniquely defined by four dimensional relations (suitably dimensioned), and can be drawn using two additional lines, as shown in Figure 8(b). Constraint propagations among vertices a

°

-I A2 \ \ V4

bY

VI

~__

A,

V2

Figure 8. Another exampleof geometry (a) dimensional constraints; (b) corresponding additional lines

volume 22 number 10 december 1990

I

I I i

I

! !

-% Figure 9. Relation among vertices and additional lines and propagated geometric constraints for example shown in Figure 8. Solid line: forward constraint propagation; dotted line: backward constraint propagation tor deriving relative position of V 7 to V4 and additional lines can be represented as shown in Figure 9. In the example, V1 and V 4 are rigidly related, and therefore, it must be possible to calculate the position of Vl relative to V4 for adding dimensional relations. Such computation is necessary when the designer wants to define an additional relation between V 4 and another previously defined geometric entity. The path for calculating the position of V~ relative to V4 is shown in Figure 9 by dotted lines. This path has a branch at V 4to be traversed backwards. The backwards constraint propagations from A~ to V2 and from A 2 to V3 do not define the geometries V2 and V3, respectively, and both constraints from Vl to V 2 and from V~ to V3, which are classified into the former class, cannot be propagated backwards. This means that this backwards constraint propagation cannot be executed using procedures attached to every modelling operation, however, one way is to calculate the relative position of V 4 to V~ by forward constraint propagation and to reverse this positional relation, because this quadrangle is suitably dimensioned and is rigidly determined. But, in general, heuristics is necessary for extracting partial geometry which is suitably dimensioned from the constraint propagation graph. Another way for this backward constraint propagation is illustrated in Figure 10. In this solution, the order of constraint propagation is changed and a merging node Vl of backwards constraint propagation is derived by calculating the intersecting point between two additional lines. The horizontal and vertical lines are drawn from V4 and two additional circles whose centres are on the terminals of these two lines are defined. The intersecting point between these two circular lines represents the relative position of Vl to V4. But the backwards constraint propagation is not commutative in general, and in a changed order should be planned based on some heuristics. How to derive a merging node such as V~

641

o

_1

IMPLEMENTING MODELLING OPERATIONS v

4

i . . . . . . . . . b 1

I

J

Figure 10. One solution for deriving relative position of V~ to V4

also cannot be determined in a general way. Therefore, some heuristics is indispensable for solving the problem in this way and a rule-based reasoning mechanism would be effective for implementing them. However, such a heuristic reasoning mechanism is not currently implemented and will be included in future works.

UNDO AND REDO The newly proposed method for adding dimensional relations is characterized in the following way, and makes it possible to implement an UNDO operation or a REDO operation in a simple way. Such operations are indispensable for realizing a designer friendly interactive environment. In such an environment, the designer can iteratively modify the geometric model until the requirements for a mechanical part are satisfied. The main characteristic of this method is that an additional relation is internally assigned to the modelling operation which corresponds to the cancelled geometric relation or to no geometric constraint. The dimensional value for the modelling operation is calculated by propagating geometric constraints, and the internally represented modelling operation sequence is the same as the initial execution except for the dimensional values or the constraint types. This means that the constraint propagation graph is always acyclic, and also that the topological operation sequence is the same as that in the initial execution, even after changing dimensional values or adding and cancelling dimensional relations. This is very important for realizing an UNDO or a REDO operation. All manipulations on dimensions can be realized as manipulations on constraints related to the modelling operations, and can be cancelled by setting previously used constraints. All modelling operations can be cancelled by applying inverse topological construction operators which are described below. Therefore, the designer can return to a previous state by an UNDO operation at any modelling stage.

642

Executing modelling operations implies executing topological manipulations on a geometric model database. However, current boundary based solid modelling systems use manifold representations based on the assumption that every point on a surface is 2D, that is, every point has a neighbourhood which is homeomorphic to a 2D disk 14't~'16. Therefore; a wireframe and a surface model cannot be represented by current boundary based solid modelling systems. Also solid modelling systems based on CSG (constructive solid geometry) do not have the capability for representing wire-frame or surface forms. This means that the modelling operations described above cannot be implemented on current solid modelling systems. In this newly proposed system, the modelling operations are implemented in a uniform way based on nonmanifold geometric modelling which gives a framework allowing a unified and simultaneous representation of wire-frame, surface and solid modelling forms. Weiler proposed the radial edge structure ~'14 as the data structure for non-manifold boundary representation and the implemented system described in the paper is also based on Weiler's radial edge structure. A set of basic construction operators is provided for building and modifying non-manifold geometric modelling topology representations 1~14. Every operator has its inverse operator, and every topological manipulation can be cancelled by applying it. The construction operators are roughly divided into three types: manifold operators, non-manifold operators and general operators. This is because some topological manipulations need different information depending on whether they are executed in manifold or non-manifold situations. Manifold operators are basically compatible with Euler operators 1~ which are used in boundary based solid modelling systems. Non-manifold operators are defined for manipulating non-manifold situations. General operators are provided for topological manipulations which require no difference in specifications. The implementation of these construction operators is much more complicated than that of the Euler operators because of flexibility and complexity of the data structure, but these operators enable unified and simultaneous manipulations on wire-frame, surface and solid modeling forms. Figure 11 shows some of the implemented construction operators. These construction operators provide a flexible basis for realizing modelling operations. Modelling operations are executed by constructing topological representations and assigning geometries to face, edge and vertex elements. For instance, the modelling operation for drawing a line segment shown in Figure l(a) is implemented by executing non-manifold-make-edgevertex and assigning geometries to the newly generated vertex and edge. Every modelling operation can be cancelled by assigning previous geornetries and applying inverse operators.

Example The geometric modelling system described in the paper has been implemented using Common LISP~7.

computer-aided design

General operators ~. I

I

I

-

- Nothing s

I

I

I

G-MSV ( Make - Shell -Vertex )

I x

¢-

4



G-KSV ( Kill -Shell - Vertex ) G-MRSFL (Make - Region - Shell - Face -Loop) =G-KRSFL (K ill -Region - Shell-Face -Loop )

J





(~- $ p I it - edqe G-Join - edge

Non-manifold- operators

N-ME ( M a k e - Edge )

B

N-KE ( Kill - Edge) N-MEV (Make - Edge -Vertex)

A

l

11

N-KEV ( K ill -Edge -Vertex ) -MF I~Make-FaCe)N-KF



(Kill-Face) Manifold - operators

M-MVL (Make - V e r t e x - L o o p

nL

M-KVL ( K ill -Vertex -Loop ) M-MEV ( M a k e - Edge-Vertex)

~

M - K EV ( K ill - Edge -Vertex) M-MEKL ( Make - Eddie - Kill - Loop)

CONCLUSIONS

M-KEML ( K i l l - Edge-Make-Loop ) M - MEF ( M a k e - Edge-Face ) =

I~-KEF Kill-Edge-Face ) I~M-MZEV e k e - Zero-len~lth-Edge-Vertex )

4M-KZEV (Kill - Zero-length - Edge -Vertex )

Figure 1'1. Examples of implemented construction operators

a

/

Figure 12 shows an example of the modelling process. First, three circles were defined and tangent lines were drawn. Then, a tangent circle was drawn and unnecessary line segments and vertices were deleted. At this stage, only a line drawing was represented as a wire-frame model. Next, the faces were defined and swept. The final shape was represented as a solid model, and mass properties, such as the centre of gravity, moments of inertia and so on, were calculated directly using this model. Dimensional relations were automatically extracted from the historical information of the modelling operation sequence, and were displayed on the screen. These dimensional relations could easily be changed by picking up the dimension and specifying a new value. Variations in geometries are shown in Figure 13. These modified geometries were generated by changing the dimensional values for the distance between the two cylinders and for the thickness of this part. The geometries for all entities which depend on these dimensional changes were automatically modified by a computer. For example, the planar faces on the side of the part were so moved that these faces were tangent to the cylindrical faces. The computational time for these modifications was rather short because only geometrical calculations were executed.

In the paper, the implementation of a geometric modelling system named PIGMOD with a parametric design capability based on non-manifold geometric modelling has been discussed. Non-manifold geometric modelling is a framework which allows a unified and simultaneous representation of wire-frame, surface and solid modelling forms, and provides a powerful basis for realizing flexible and user friendly methods for developing a geometric model. Its diversified and unrestricted processes enable the designer to develop

b

f

g

Figure "12. Example of modelling operation sequence for building solid object volume 22 number 10 december 1990

643

2 Borning, A 'The programming language aspects of ThingLab, a constraint-oriented simulation laboratory' ACM TOPLAS Vol 3 No 4 (1981) pp 353-387 3 Roller, D, Schonek, F and Verroust, A 'Dimensiondriven geometry in CAD: a survey' Theory and Practice of Geometric Modeling Springer-Verlag (1989) 4 Fitzgeiald, W 'Using axial dimensions to determine the proportions of line drawings in computer graphics' Comput.-Aided Des. Vol 13 No 6 (1981) pp 377-382 5 Gossard, D, Zuffante, R and Sakurai, H 'Representing dimensions, tolerances and features in MCAE systems' IEEE Comput. Graphics and Applications Vol 8 No 3 (1988) pp 51-59 6 Hillyard, R C and Braid, I C 'Analysis of dimensions and tolerances in computer-aided mechanical design' Comput.-Aided Des. Vol 10 No 3 (1978) pp 161-166 7 Light, R A and Gossard, D C 'Modification of geometric models through variational geometry' Comput.-Aided Des. Vo114 No 4 (1982) pp 209-214

Figure 13. Modified geometric models

a geometric model in a way which agrees with the designer's intention. The modelling operations are so defined that there are correspondences between the modelling operations and the geometric constraints. History representation based on the modelling operations has been proposed for maintaining the geometric constraints defined in the design process. The dimensional constraints are maintained and updated in a unified way in terms of the modelling operations. A method for representing an additional geometric relation in the existing modelling operation sequence has also been proposed. Therefore, the geometric model can be modified automatically and consistently in accordance with the changed or added dimensions in a simple and uniform way. This method has been successfully implemented and applied to several examples. ACKNOWLEDGEMENT The author is indebted to Dr K Ohtomi and Mr K Kameyama for valuable suggestions and discussions in revising this paper. REFERENCES 1 Sutherland, I E 'SKETCHPAD a man-machine graphical communication system' Proc. AFIPSSpring Joint Comput. Conf. (1963) pp 329-346

644

8 Aldefeld, B 'Variation of geometries based on a geometric-reasoning method' Comput.-Aided Des. Vol 20 No 3 (1988) pp 117-126 9 Kimura, F, Suzuki, H and Wingard, L 'A uniform approach to dimensioning and tolerancing in product modelling' Prep. CAPE'86 (1986) pp 165-178 10 Yamaguchi, Y, Kimura, F and Paul J W ten Hagen 'Interaction management in CAD systems with history mechanism' EUROGRAPHICS'87 NorthHolland pp 543-554 (1987) 11 Roller, D 'A system for interactive variational design' Proc. 1988 IFIP/NSF Workshop on Geometric Modelling North-Holland (1989) 12 Lieberman, H 'Toward intelligent interfaces for graphic design applications' Proc. Int. Conf. Fifth Generation Comput. Systems ( FGCS'88) (1988) pp 1073-1080 13 Weiler, K J 'Non-manifold geometric modeling' Extended Abstract for IFIP W.G.5.2 Workshop on Geometric Modeling (1986) 14 Weiler, K J Topological structures for geometric modeling PhD Thesis (Rensselaer Polytechnic Institute) (1986) 15 M~ntyl~i, M An introduction to solid modeling Computer Science Press (1988) 16 Requicha, A A G 'Representation for rigid solids: theory, methods and systems' ACM Computing Surveys Vol 12 No 4 (1980) pp 437-464 17 Guy, L Steele Jr Common LISP: The Language Digital Press (1984)

computer-aided design