PZkS0010-4485(96)00016-4
Commuter-AldedDsslgn, Vol. 26. No. 10, pp. 831441.1906 Copyright Q 1888 Elswier Science Ltd Printed in Great Britain. All rights reserved 0010-4485/88/t10.00+0.00
EL.WVlER
Geometric reasoning fo.r knowledge-based parametric design using graph representation Jae Yeol Lee and Kwangsoo Kim*
A promising approach to parametric design is based on the knowledge-based technique. However, one of the major drawbacks in this approach is that the inference process is computationally expensive to be applied to the interactive and intelligent CADsystems. This paper presents a new approach to geometric reasoning for knowledge-based parametric design using graph representation to improve the inference process. The geometric reasoning procedure consists of three steps: (1) representing a well-constrained design model and geometric rules into graphs; (2) selecting appropriate subgraphs from the design graph which may be used to induce new facts; and (3) selectively searching for the rule graphs having the same keys as the model subgraphs. The proposed approach is simple in concept, yet realizes significant inference time reduction. The concept presented here has been implemented on an IRIS Indigo workstation, and some implementation results are given to show the efficiency of the proposed approach. Copyright 0 1996 Elsevier Science Ltd Keywords: parametric design, geometric reasoning, constraint graph, geometric constraints
INTRODUCTION Computer-aided design and drafting systems have proved to be indispensable tools in many industrial environments. In traditional CAD systems, geometric modellings are performed by the exact specifications of geometry. Dimensions are derived from the geometry. Designers are required to know beforehand the precise dimensions of the geometry, and changes are difficult once these are entered into systems’. However, in the product development cycle, several design changes are typically needed before the full requirements for functionality, manufacturability and quality of a design are met. At this stage, only conceptual
Department of Industrial Engineering, Pohang University of Science and Technology, Pohang 790-784, South Korea *To whom correspondence should be addressed. Paper received: 15 June 1995. Revised: 13 February 1996
models are important. Therefore, traditional c.4~ systems are not suitable for most conceptual design situations. These facts imply that there is a need for a flexible tool for the conceptual design in which the user is not always sure about the fmal satisfactory design. Particularly, the specification of geometric shapes by dimensions and geometric constraints will satisfy the conceptual design semantics. Parametric design allows designers to make modifications to existing designs by changing parameter values, thus making it possible for them to create shapes without knowing precisely how they will be configured in the final desig&16. Parametric design has proved its value and now has been incorporated into various CAD/CAMsystems such as Pro/Engineer and I-DEAS Master Series. These parametric modelling systems have promised to revolutionize mechanical CAD/CAM systems. A promising approach to parametric design is based on knowledge-based techniques13-‘6. The knowledgebased approach is oriented toward symbol processing techniques in which the inference engine plays a prominent role in processing the geometric knowledge. In this approach, it is easy to express complicated constraints such as tangency and parallelism, and to separate the symbolic from the numerical aspects so that all the problems related to instability or accumulation of errors that afllict numerical techniques are completly avoided13”5. However, the inference process is computationally expensive to be applied to the interactive and intelligent CAD systems. The time complexity of the knowledge-based approach has been proved to be 0(n4) in Reference 13 where n is the number of geometric entities. For example, it takes several minutes of CPU time to set up a construction plan for a part designed with only 20-30 geometric elements. As the size of geometric elements increases, the inference time increases enormously. Although this problem was improved by other work, it is still one of the main issues in this approach. This paper presents a new approach to knowledgebased parametric design using graph representation to expedite the inference process. A design model is represented by a constraint graph or an undirected graph where nodes represent geometric entities and arcs 831
Geometric
reasoning
for knowledge-based
parametric
design: J Y Lee and K Kim
the large number of parameters can make the geometric constraint solving problem ill conditioned. Typically the convergence depends on the starting point, and the evaluation of a variant is inefficient and numerical error prone. The main advantage of this approach is that it can solve configurations such as area constraint that are unsolvable by other methods. The knowledge-based approach13-16 uses rule-based reasoning to deduce the geometric configuration which is described by a set of constraints. In reasoning process, constraints are represented as facts and stored in the fact base. The rule base contains rules that are potentially applicable in the domain of interest. The inference engine applies rules to the set of current facts to infer geometric elements. An output from the reasoning process is a construction plan which is a series of inferred rules. The parametric design model is then determined by sequentially evaluating the rules in the construction plan. In this approach, it is easy to express complicated constraints such as tangency, and it separates the symbolic from the numerical aspects. However, inefficient computation to search and match rules is the main disadvantage of this approach. Among the three main approaches, this paper focuses on the knowledge-based approach to overcome computational inefficiency in searching and matching rules in conventional knowledge-based parametric approaches.
represent constraints, i.e. relationships between geometric entities. Each rule is also represented by an undirected graph. A key is assigned to each rule graph. The geometric reasoning process is based on the hybrid of the graph representation and inference method. The inference method consists of two graph searching algorithms. The first algorithm searches for the constraint subgraphs whose associated constraints may fire rules. The second algorithm searches for the rule graphs which have the same keys as the selected constraint subgraphs. This approach provides a greater possibility of developing an interactive, intelligent CAD system especially for parametric models with significant complexity. The remainder of this paper is organized as follows. The second section describes the related work. This is followed by the graph representation of geometric constraints and rules. In the fourth section, the proposed geometric constraint solving methodology is described. In the fifth section, implementation results are analysed to verify the eficiency of the proposed approach. Finally, we conclude with some remarks.
RELATED WORK There are three major approaches for parametric design: the constructive approach, numerical approach, and knowledge-based approach2. The constructive approach4-’ utilizes the construction sequence of a design process. This approach locates the geometric entities of a design model through a sequence of geometric constructions analogous to ruler and compass operations. The sequence of operations is stored so that it can be executed again when parameter values are modified. Although the utilization of information about the design sequence results in fast design modifications, this approach cannot be applied directly to conventional CAD drawings. Furthermore, it forces the designer to follow a specific design sequence. In the numerical approach*-“, constraints are converted into a system of simultaneous equations. Then, the equations are solved by an iterative NewtonRaphson numerical method. During the iterations, this approach requires good initial values, so that the initial sketch must almost satisfy all the constraints from the beginning’*. The exponential number of solutions and
GRAPH REPRESENTATION OF CONSTRAINT!3 AND RULES Constraints define relations among geometric elements in a knowledge-based parametric design. Each constraint is described as an atomic formula whose constituent elements are a predicate symbol, a set of geometric elements, and a symbolic attribute131’5. Examples of constraints are as follows: Coordinate P: the location of a point P is known, Distance L1 & D: The distance between two lines L1 and L2 is D, Angle L1 L2 A: the angle between two lines L1 and L2 is A, Direction L A: the direction of a line L is A, Tangent L C*: two geometric elements L and C are tangent each other,
R
LW2 2% Cl
Distance Li LZ D Coefficient L, Direction L1 A ===> Coefficient L2
(a) Figure 1 Rules
832
c2
Tangent C Cl Tangent C C2 Coefticient C, Coefficient C2 Radius C R ===> Coefficient C
Coefficient L Distance Pl P2 D Coordinate P, On P1 L 0nP2L ===> Coordinate P2
(b)
(c)
Geometric
reasoning
for knowledge-based
Radius C R: the radius of a circle C is R, On P L: a point P is located on a line L, Parallel L, L2*: two lines L1 and L2 are parallel each other. In the last example, Parallel is a predicate symbol, L1 and L2 are geometric elements, and * is a symbolic attribute like Same-direction or Anti-direction. These attributes are maintained to provide a way of deciding which solution to choose with respect to the designer’s initial intent, since a dimensioning scheme can be satisfied by a number of configurations. When these constraints are applied to a design model, they are namedfacts and stored in a fact base. A rule is described as a condition-conclusion pair. The condition is a conjunction of atomic formulas, and the conclusion is a single atomic formula. Each atomic formula of a rule represents a pattern that is matched to an appropriate fact through a suitable substitution of the variables. If there is a match for all the atomic formulas of the condition, then a new fact is inferred according to the conclusion. Figure 2 shows examples of rules. In Figure la, the coefficient of Lz can be inferred if the distance between L, and L2 and the coefficient of L1 are known. In Figure lb, the coefficient of C can be inferred if the coefficients of the two tangent circles and the radius of C are known. In Figure Ic, the coordinate of P2 can be inferred if the distance between P, and P2, both of which lie on L, is known, and the coefficient of L and the coordinate of P, are known. Before describing the proposed approach, important terminologies that will be used throughout the paper are explained as follows. Coordinate P OnPL Direction L A
Distance LI b D Coefficient L,
(b)
(a) Center C P Tangent C L1 Tangent C b Perpendicular L, L2 I*--
I, P ‘I . .’
parametric
design: J Y Lee and K Kim
Definition 1: A set of constraints and geometric entities can be represented by a constraint graph (undirected graph) G = (N,A) where N = {n1,n2,. . . ,n,} and A = {a12,a13,. . . ,a,,-d. Each node ni in N represents a geometric entity which may be a point, a line, a circle, or another geometric entity, and each arc aij in A which connects two adjacent nodes ni and nj represents a geometric constraint between the two nodes such as distance, parallelism, or tangency. Examples of constraint graphs for a set of constraints are shown in Figure 2. The symbols 0, C, T, D, H, V, P, and A on arcs represent On, Centre, Tangent, Distance, Horizontal, Vertical, Perpendicular, and Angle predicates, respectively. The characters on arcs show the abbreviated symbols for geometric constraints. In a constraint graph, nodes are denoted by circles and arcs denoted by lines. IMdtion 2: A bold node represents a wek&$ned geometric element whose coefficient or coordinate is known. Definition 3: A solid node represents a semi-defined entity, for example, a line whose coefficient is not known but direction is known. IMnltion 4: A dashed note represents an undefined geometric entity which is neither well-defined nor semidefined. Note that rules can be also represented by graphs as shown in Figures 3 and 4. In rule graphs, well-defined, semi-defined, or undefined geometric entities in the condition part of a rule are represented by bold, solid, and dashed nodes, respectively, and the relations between the geometric entities by arcs. These rule graphs are classified into two categories; type 1 and type 2. Definition 5: A type I rule graph consists of one welldefined or semi-defined node, one semi-defined or undefined node, and one connecting arc. Definition 6: A type 2 rule graph consists of two welldefined nodes, one undefined node, and two or three connecting arcs. Figures 3 and 4 show examples of the type 1 and type 2 graphs, respectively. For the type 2 rule graphs, especially, when two connecting arcs between the welldefined nodes and the undefined node have different geometric relations, the rule graph may have the third arc between the two well-defined nodes as shown in Figure 4~. A key is assigned to each rule graph. The key consists of characters representing geometric entities and their relations. The first digit in a rule key represents a
OnPL Coordinate P Direction L A ===> Coefficient L
Angle L1 Lz Direction LI A ===> Direction L2 A’
C
0 -. I_
I:C) I_.
@--+--@ T
T ,*-_
+.a1 I I
.-. :J*‘l
(cl Figure 2
Constraint
graphs
LPO
LLA
(4
(b)
._a’
Figure 3
Rule graphs: type 1
833
Geometric
reasoning
for knowledge-based
parametric
design: J Y Lee and K Kim
Coefficient L Distance Pi P2 D Coordinate Pi OnPiL OnP*L ===> Coordinate P2
Tangent L, C
OnPiL OnP:!L Coordinate Pi Coordinate P2 ===> Coefficient L
Figure 4
Rule graphs:
Tangent L2 C Coefficient L, Coefficient L2 Radius C R ===> Coefficient C
LPPOO
CllTT
64
(b)
PplDOO cc>
type 2
geometric entity to be inferred. The other digits represent its adjacent geometric elements and their geometric relations. A small letter represents a well-defined geometric entity; ‘p’ for a point, ‘1’ for a line, and ‘c’ for a circle. A capital letter represents an undefined or semi-defined entity or a geometric relation; ‘0’ for On, ‘D’ for Distance, ‘A’ for Angle, etc. Examples are shown in Figures 3 and 4. In Figure 4c, ‘P’ stands for Pz, ‘p’ for PI, ‘1’for L, ‘D’ for a distance relation between P2 and P,, ‘0’ for an on relation between P2 and L, and ‘0’ for an on relation between P, and L. Note that the main purpose of assigning a key to each rule is to speed up rule matching, since a rule inferencing can be replaced by a key matching in constant time rather than matching all the rules to search for a specific rule as in a conventional knowledge-based approach. The next section discusses how those keys are used to match and fire rules in an efficient way.
Step 4: Repeat Steps l-3 until the search for the candidate subgraphs fails. The TOG1 procedure is very similar to the OOGI procedure, where the searching is done for the subgraphs whose associated constraints may infer the type 2 rules successfully. Examples of searching for the candidate subgraphs from a constraint graph are shown in Figure 5. Figure 5b shows a subgraph for the OOGI, its key, and the rule whose associated graph has the same key as the OOGI subgraph. Figure SC shows a subgraph for the TOGI, its key, and the rule whose associated graph has the same key as the TOG1 subgraph.
GEOMETRIC CONSTRAINT SOLVING Inference process The inference process consists of two procedures: one-toone graph inference (OOGI) and two-to-one graph inference (TOGI) procedures. These procedures find appropriate sets of constraints and geometric entities which may infer rules successfully. During the inference process, these two procedures are alternately executed until no more geometric element can be inferred or all the geometric elements are inferred. The OOGI procedure is summarized as follows. Step 1: From the constraint graph, search for the candidate subgraphs whose associated constraints may infer type 1 rules successfully, and assign keys to them. Step 2: For each subgraph, find the rule graph which has the same key as the subgraph and infer its associated rule. Step 3: If i&erred successfully,modify the constraint graph.
a34
LLP PI100 Direction Lz A Perpendicular Lz L3 ===> Direction L3 A’
(b)
Coefficient L4 Coefficient L5 On P3 L4 On P3 Lx ===> Coordinate
P3
(c)
Figure 5 Searching for the candidate subgraphs; (a) a constraint graph, (b) a subgraph for the OOGI and the associated rule, (c) a subgraph for the TOGI and the associated rule
Geometric
I
TNpool
reasoning
for knowledge-based
parametric
e
design: J Y Lee and K Kim
-1
ACpool
INpool
1
ADpool
L
Fignre 6
A schematic diagram for the inference process
Four node pools shown in Figure 6 are used in the inference process; a terminated node pool (TNpool), an inactive node pool (INpool), an active node pool (ACpool), and an adjacent node pool (ADpool). The TNpool stores the well-de&& nodes whose adjacent nodes are all well-defined. The INpool stores the undefined nodes whose adjacent nodes are all undefined. The ACpool stores the well-defined or semidefined nodes with at least one adjacent node that is semi-defined or undefined. The ADpool stores the undefined nodes with at least one adjacent node that is in the ACpool. Each geometric entity has two degrees of freedom in a plane, and a rigid geometric structure has three degrees of freedom, two translational and one rotational, which can uniquely locate the rigid body in a plane. Accordingly, an inference process should start with a constraint graph having at least three tixed degrees of freedom. For example, these three degrees of freedom may include a well-defined point node and a semi-defined line node. The nodes in the ACpool are the well-defined or semidefined nodes in the candidate subgraphs for the OOGI. The nodes in the ADpool are the undefined nodes in the candidate subgraphs for the TOGI. As the two types of inference procedures are executed alternately, the number of nodes in the TNpool increases, the number of nodes in the ACpool and ADpool increase at the beginning but decrease later, and the number of nodes in the INpool decreases. When the inference process ends, all the nodes are in the TNpool while no node is in the other node pools. The following procedure describes an overall scheme for solving geometric constraints.
Step 3: For each TOGI-enabled node bj in the ADpool, call TOGI(bi, TOGI_flag) until all the nodes in the ADpool are TOGI-disabled. Step 4: If both of the OOGI_flag and TOGI_flag are FALSE, then exit. Otherwise, go to Step 2. /*When the procedure ends, if all the nodes are not welldefined, then the given constraint graph is under constrained.*/ ENlZ_PROCRDURE The
OOGI procedure is described below.
OOGZ(node: f;:, Boolean: OOGZflag) {f;: is OOGI-enabled in the ACpool and not terminated} OOGZ_i’ag t FALSE; t_adj_Poolc the adjacent nodes of f; which are undefined or semi-defined; FOR each node bj in t_a&Pool DO key + key representing A, bj and aij; matched_ruletsearching for-type I _ruZes_having_same_key (key); IF (matched_rufe is NULL) THEN go to the next node bj; t-fact-base + store facts associated withA, bj, and aij; IF (inference (t_ fact-base, matched-rule) is TRUE) THEN OOGZ_Jag t TRUE; IF bj becomes semi-defined THEN make its adjacent nodes in the ACpool OOGIenabled; PR~CRD~R
ELSE
add bj to ACpool, and make it OOGI-enabled; add adjacent nodes of bj in INpool to ADpool, and make them TOGI-enabled; END-IF
add the inferred rule to the construction PROCEDURE geometric constraint solving INPUT: a constraint graph and four node pools. OUTPUT: a construction plan.
plan;
END-IF END-FOR IF (OOGZ_ -flag = FALSE) THEN
A becomes YOGI-disabled; Step 1: Repeat the following steps until a construction plan is fully generated or no more rules can be fired. Step 2: For each OOGI-enabled but non-terminated node f; in the ACpool, call OOGZ(J, OOGI_flag) until all the nodes in the ACpool are OOGI-disabled.
END-PROCEDURE
TheA, bj, and aij are the components of the candidate subgraphs for the type 1 rule matching, Disabled nodesL are skipped for the next OOGI procedure in order to speed up the reasoning process and become enabled again only when one of their adjacent nodes is inferred. 835
Geometric
reasoning
for knowledge-based
parametric
When all the nodes in the ACpool become disabled, the TOG1 procedure starts. TOGZ (node: bi, Boolean: TOGZ_Jag) {bi is TOGI-enabled in the ADpool} TOGZ_ flag t FALSE; t_adj_Pool+- the adjacent nodes of bi in ACpool; FOR each pair of nodesfj and fk in t_adj_Pool, andf, # fk PROCEDURE
DO IF (aij
and aik have the same geometric relations)
THEN
key + key representing bi, fi, fk, aij, and Uik; ELSE
key + key representing bi,~, fk, aij, aik, and ajk if
exists; matched_rule t searching-for-type
2_rules_having_ same-key (key); IF (matched-rule is NULL)THENgo to the next pair; t_ fact-base + store facts associated with bi, 4, ji, aii, and aik, and if exists; IF (inference (t_ fact-base, matched-rule) is TRUE) THEN ajk
TOGZ_ fzag +- TRUE;
move bi to ACpool, and make it OOGI-enabled; move adjacent nodes of bi in INpool to ADpool, and make them TOGI-enabled; add an inferred rule to the construction plan; END-IF END-FOR IF (TOGZ_flag
is
FALSE) THEN
bi becomes TOGI-disabled; END-PROCEDURE
The TOG1 is similar to the OOGI except that the searching is done for the subgraphs which may infer the type 2 rules. The bi, -f;, fk, aij, aik, and ajk are the components of the candidate graphs for the type 2 rule matching. When all the nodes in the ADpool become disabled, the TOG1 procedure stops and the OOGI procedure starts again. Though we have dealt with the rule graphs having oneto-one or two-to-one relations, there are, however, graphs having three-to-one relations. For example, Figure 7 shows a three-to-one graph which has three well-defined lines and one unknown circle. In this case, the three-to-one graph inference can be handled without any difficulty by a modified TOG1 procedure. Detection of under- and over-constrained geometry It is important to detect under- and over-constrained geometry during the design process. Over-constrained geometry has too many or conflicting dimensions and constraints. Under-constrained geometry has insufficient
design: J Y Lee and K Kim
dimensions and constraints to uniquely define the geometry. A graph with n nodes is over-constrained if there is a subgraph with m
Coefficient L, Coefficient L2 Coefficient L3 Tangent C L, Tangent C L2 Tangent C L3 ===> Coefficient C ClllTTT Figure 7
836
A rulefor a circle tangent
to three well-defined
lines
graph of a well-
Geometric reasoning for knowledge-based
parametric design: J Y Lee and K Kim
Fact Base OnP0L3
OnhL3 On PI L, On P2 L, On Pz L2 On POL2 Distance POP, D
Distancel,, P2H Angle I+ b a Coordinate PO Direction b A
(a)
(1) OOGI : LpO
(b)
(2) OOGI : LlA
.-.* i’L, )
._.
PI CT93
(4) TOGI : PllOD
(5) TOG1 : PplDOO
p2
(6) TOGI : LppOO
(4 Figure 8 An inference example; (a) a triangle design, (b) associated facts, (c) a constraint graph, (d) constraint subgraphs in inference process
constrained design model and n be the number of nodes in N. The time complexity of the proposed approach can be proved as follows. l
l
During the execution of the geometric constraint solving procedure described before, the main loop of the algorithm from Step 2 to Step 4 is executed less than 2n times, since each node has two degrees of freedom, and for each iteration at least one geometric entity must be inferred. Otherwise, the algorithm ends.
l
Let the number of nodes in the ACpool be nl and the number of nodes in the ADpool be n2. The OOGI and TOG1 procedures in Step 2 and Step 3 are executed less than n times, i.e. ni + n2 < n, because nodes in the ACpool and nodes in the ADpool are mutually exclusive, and there are also some nodes in the TNpool and INpool. The execution of the OOGI procedure, which tries to infer the adjacent nodes ofJ, can be done in constant time. There are a adjacent nodes for a nodefi where a -C n for a design configuration with significant 837
Geometric
reasoning
for knowledge-based
parametric
Table 1 Inference steps to make a construction plan
coefficient
Table 2
Regression results
Analysis of variance
Step 1 ODGI (f; = PO, bj = &, and LpO) On&Lo Coordinate Pa Direction L,J A +
design: J Y Lee and K Kim
Lg
Step 2 DOG1 (f; = L+ b, = ZQ, and LlA) Angle J% Lz Direction Ls A ---t Direction L2 A, Step 3 OGGI (fi = PO, bj = Lz, and LpO)
Source
DF
Sum of squares
Mean square
F*
Prob > F
Model Error C Total
2 21 23
0.25507 0.00812 0.26320
0.12754 0.00039
329.739
0.0001
Parameter estimates a = 0.000004331
p, = -0.000120
/j. = 0.019207
On&L2
Coordinate PO Direction Lr Al -+ Coefficient L2 Step 4 TOG1 (bi = P2,fi = L2, fk = Lo. and PllOD) Distance Lc P2 H On P2 L2 Coefficient L2 Coefficient & + Coordinate P2 Step 5 TOG1 (bi = P,,f; = PO, fk = &,, and PplDOO) Distance PO PI D Coefficient Lo Coordinate PO On
PO Lo
On PI Lo + Coordinate PI Step 6 TOG1 (bi = L, ,jj = PI, fk = P2, and LppOO) On P2 L, On PI L1 Coordinate P2 Coordinate P, -+ Coefficient L,
complexity and large geometries. For each adjacent node of A, key matching can be done in constant time, since there are about 60 rules, and the keys of all the rules are sorted into two binary trees so that key matching can be done at most O(6). Similarly, rule inferencing can be executed in constant time, e.g. oneto-one graph matching, if the key matching has been successfully done, which shows why a key is assigned to each rule. The execution of the TOG1 procedure can be proved in a similar way. The above results prove that the time complexity of the proposed algorithm is 0(n2). In addition, an experimental time complexity has been measured by an experimental analysis derived from simulations. Figure 9 shows ‘the plot of the square root of the execution time
E( r;) = 0.019207 - 0.000120X +0.000004331X2 Proof of accepting Ho: IfF*cF(l-a;p-l,n-p),concludeH,. IfF*>F(l-a;g-l,n-p),concludeHo. where F(l - a;p - 1,n -p) is F distribution, 1 - a is confidence interval, p - 1 is df of Model, and n - p is df of Error. For a = 0.01, F(.99;2,21) = 5.86, F’ = 329.739. Since F* > F(.99; 2,21), conclude HO.
versus the number of geometries of the 24 simulations. For the given simulation result, the best fitting regression analysis has been applied as follows: Yi = PO+ /?lXi + /3,X: + El where Yi is the execution time, Xi is the number of geometric elements in a design model, PO,pi, and ,!I2are parameters, el is a random error term with N(0, a2). The regression result is shown in Table 2. To verify whether or not the above regression model is appro riate, the following two alternatives have also been tested Pg. Ho:E( Yi) = 00 + &Xi Ha:E(K)
+ PzXf
#Po+Plxi+hX?
As shown in Table 2, H,, is accepted such that the assumed regression model is correct. We have also tested whether the best fitting regression model is either a linear model or the 3-order regression model in a similar manner. Neither of them proved to be adequate for the given data. The experimental analysis shows that the average time complexity tends to be O(n’) where n is the number of geometric entities. Note that the time complexity of the conventional forward inference is 4thorder polynomial (see Reference 13). A comparison of execution time between the proposed method and the conventional forward inference method for 2D drawings was also carried out. The results summarized in Table 3 show that the proposed approach reduces the computation time significantly. As an example, a bicycle frame consisting of 87
I I
Table 3
Comparison results
Number of elements 32 56 80 87 115 123 9 a38
A plot of the execution time versus the number of geometries
Number of facts
Time, (s)
Timea (s)
65 113 159 176 229 245
0.01 0.02 0.04 0.05 0.07 0.08
3 20 32 50 105 135
Time*: execution time for our approach. Timer,: execution time for a forward inference method.
Geometric
reasoning
for knowledge-based
parametric
design: J Y Lee and K Kim
approach, whereas it is about 50s in the conventional forward inference approach.
Feature-based parametric design
(a)
(b) Figure 10 A 2D design example; (a) a bicycle frame, (b) its modified shape
geometric entities is shown in Figure 10. After assigning appropriate constraints to the geometric elements, 176 facts are generated. Based on these facts, 87 rules are inferred to make a construction plan. The computation time to generate the construction plan is 0.05 s in our
The proposed 2D parametric approach has been extended and implemented as a module of the featurebased parametric design system developed by the authorsl’. The module has been written in c++ on an IRIS Indigo R4000 workstation. ACIS TM is used as a solid modelling kernel. In the feature-based parametric design system, a feature is parametrically designed by sketching a 2D section interactively, specifying geometric constraints, and sweeping the parametrically designed 2D section. Generally most of the engineering features have unique cross-sections and feature volumes can be easily generated by sweeping their sections. Block, slot, pocket, T-slot, and pocket with islands can be constructed via translational sweeping. Counterbore and countersunk holes can be constructed via rotational sweeping. Figure 11 shows an overall design process of the feature-based design system. The design process begins with a volume called a base feature, which can be generated by a translational or rotational sweeping of a parametrically designed 2D profile. After a base feature is created, a new 2D feature section is either sketched interactively in a 3D plane (e.g. a feature face) or read from the existing feature library. While the feature section is being sketched, dimensions and geometric constraints are assigned. Then, a geometric reasoning process starts to check the sketched feature section to see if its geometric relationships are properly constrained. After a proper section is obtained, a 3D feature volume is generated by sweeping. The designer continues adding features one by one while their relationships are maintained by a parametric design scheme. When a new feature is designed locally with respect to a parent feature, it is automatically changed if the parent feature is modified. The part shown in Figure 12~ is a cm*1 test part: MBB Gehaeuse. The Gehaeuse has been designed by 1 base, 28 depression, 6 protrusion, and 7 transition features. This part has been modified by changing dimensions as shown in Figure 126. Figure 13 shows a hinge that has been constructed by Boolean intersection operations of two features.
Adding New Features
2D Feature section sketch L
I
/
\
/
User _ Interface
2D Section Design
A ‘A_ \
3
Geometric constraints
A J
Sweeping
Geometric
Reasoning
1
3D Part
Boolean Operation
Figure 11 An overall design process of the feature-based parametric design
839
Geometric
reasoning
for knowledge-based
parametric
design: J Y Lee and K Kim
(4
(b) Figure 12 A 3D design Gehaeuse, (b) its modified
example shape
1; (a) a CAD*1
test part:
CONCLUSION Parametric design systems have proved to be indispensable tools in many applications such as mechanical part design, tolerance analysis, simulations, kinematics, and knowledge-based design automation. We have presented a new approach to geometric reasoning for knowledgebased parametric design using graph representation. Based on the unique graph representation and key assignment techniques, this approach overcomes the inefficient geometric reasoning process of the conventional knowledge-based approaches for well-constrained geometry. Some of the future work is listed below. 840
(b)
MBB Figure 13
l
l
A 3D design example
2; (a) a hinge, (b) its modified
shape
We have restricted the geometric entities to points, lines and circles. Conic sections and free-form curves such as B-spline curves should be added for the user to design more realistic parts. In this paper, we have only dealt with wellconstrained geometry. Accordingly, the user must constrain all the geometries in order for the system to understand how to use it. Constraining all the geometries takes time and effort; it is not a simple task, even for experienced users. At the same time, there are many situations where the designer is still conceptualizing the idea and does not want to assign all the constraints to the conceptual model. In such situations, it is more natural to allow the user to work
Geometric
reasoning
for knowledge-based
with under-constrained geometry while the system keeps track of the under-constrained model and provides as intuitive a result to the user as possible out of many alternatives. Thus, we are working to extend the current parametric design approach for the designer to do parametric design only where needed, without requiring the entire design model be constrained before proceeding. Our approach has been successfully applied to 2D sketches as well as feature-based parametric design. In addition, our approach can be applied to assembly modelling as a core model. Design parts can be designed by the proposed feature-based parametric design, and the assembly of these design parts can be achieved by one of the previous research*O.
0
12
13
14
15 16
17
ACKNOWLEDGMENTS
18
This research is supported in part by KOSEF (95 1- 1004072-2) and PIRL.
19
REFERENCES 1
2
3
4
5 6 I
8
9 10
11
Serrano, D ‘Automatic dimensioning in design for manufacturing’ Proc. Symp. Solid Modelring Foundations & CAD/CAM Applications ACM Press (1991) pp 379-386 Roller, D ‘Advanced methods for parametric design’ in Geometric MoaWing Methoak and Applications Springer-Verlag (1991) pp 251-266 Roller, D, Schonek, F and Verroust, A ‘Dimension-driven geometry in CAD:a survey’ in Theory and Practice of Geometric Modelling Springer-Verlag (1989) pp 509-523 Kondo, K ‘PIGMOD: parametric and interactive geometric modeller for mechanical design’ Comput.-Aided Des. Vol 22 No 10 (1990) __ pp 633-644 Railer, D ‘An approach to computer-aided parametric design’ Comput.-Aided Des. Vo123 No 5 (1991) pp 385-391 Gossard, D C, Z&ante, R P and Sakurai, H ‘Representing dimensions, tolerances, and features in MCAE systems’ IEEE Cornput. Graph. & Applic. Vol5 No 3 (1988) pp 51-59 Solano, L and Brunet, P ‘Constructive constraint-based model for parametric CAD systems’ Comput.-Aided Des. Vol 26 No 8 (1994) pp 614-612 Hillyard, R and Braid, I ‘Analysis of dimensions and tolerances in computer-aided mechanical design’ Comput.-Aided Des. Vol 10 No 3 (1978) pp 161-166 Lieht. R. Lin. V and Gossard. D C ‘Variational eeometrv in CAD’ Af?i &mp& Graph. Vol 15’No 3 (1981) pp lfi-177 _ Light, R A and Gossard, D ‘Modification of geometric models through variational geometry’ Cornput.-Aided Des. Vol 14 No 4 (1982) pp 209-214 Kondo, K ‘Algebraic method for manipulation of dimensional
20
parametric
design: J Y Lee and K Kim
relationships in geometric models’ Comput.-Aided Des. Vol 24 No 3 (1992) pp 141-147 Owen, J C ‘Algebraic solution for geometry from dimensional constraints’ Proc. Symp. Solid Mode[ling Foundations & CAD/CAM Applications ACM Press (1991) pp 379-407 Aldefeld, B ‘Variation of geometries based on a geometricreasoning method’ Comput.-Aided Des. Vol 20 No 3 (1988) pp 117-126 Sunde, G ‘Specification of shape by dimensions and other geometric constraints’ in Geometric Modelring for CAD Applications North-Holland (1990) pp 199-213 Suzuki, H, Ando, H and Kimura, F ‘Geometric constraints and reasoning for geometrical CADsystems’ Comput. & Graph. Vol 14 No 2 (1990) pp 211-224 Verroust, A, Schonek, F and Roller, D ‘Rule-oriented method for parameter&d computer-aided design’ Comput.-Aided Des. Vo125 No 10 (1993) pp 531-540 Lee, J Y ‘A study on feature-based parametric design’ MS Thesis Pohang University of Science and Technology, South Korea (1994) Bouma, W, Fudos, I, Hoffiann, C, Cai, J and Paige, R ‘Geometric constraint solver’ Comput.-Aided Des. Vo127 No 6 (1995) pp 487-501 Neter, J, Wasserman, W and Kutner, M H Applied Linear Statistical Models IRWIN (1990) Lee, K and Andrews, G ‘Inference of the positions of components in an assembly: Part 2’ Comput.-Aided Des. Vol 17 No 1 (1985) pp 20-24 Jae Yeol Lee received a BS and an MS in Industrial Engineeringfrom the Pohang University of Science and Technology (POSTECH), Korea, in 1992 and 1994, respectively. He is currently working toward his PhD at POSTECH. His research interests include feature-based parametric design. machining feature extraction and geometric reasoning in intelligent CAD.
Kwangsoo Kim is an associate professor in the Department of Industrial Engineering at the Pohang University of Science and Technology. His research interest is in the area of CAD/CAM. His current activities include feature-based parametric design. compound surface modelling. curve and surface offsetting, multiaxti machining simulation. product data exchange using STEP, and intelligent CAD.
841