• Aucun résultat trouvé

Yan-TaoLi*,Shi-MinHu,Jia-GuangSun Aconstructiveapproachtosolving3-Dgeometricconstraintsystemsusingdependenceanalysis

N/A
N/A
Protected

Academic year: 2022

Partager "Yan-TaoLi*,Shi-MinHu,Jia-GuangSun Aconstructiveapproachtosolving3-Dgeometricconstraintsystemsusingdependenceanalysis"

Copied!
12
0
0

Texte intégral

(1)

A constructive approach to solving 3-D geometric constraint systems using dependence analysis

Yan-Tao Li*, Shi-Min Hu, Jia-Guang Sun

Department of Computer Science and Technology, Tsinghua University, Beijing, China Received 9 June 2000; revised 7 December 2000; accepted 9 December 2000

Abstract

Solving geometric constraint systems in 3-D is much more complicated than that in 2-D because the number of variables is larger and some of the results valid in 2-D cannot be extended for 3-D. In this paper, we propose a new DOF-based graph constructive method to geometric constraint systems solving that can ef®ciently handle well-, over- and under-constrained systems based on the dependence analysis. The basic idea is that the solutions of some geometric elements depend on some others because of the constraints between them. If some geometric elements depend on each other, they must be solved together. In our approach, we ®rst identify all structurally redundant constraints, then we add some constraints to well constrain the system. And we prove that the order of a constraint system after processing under-constrained cases is not more than that of the original system multiplied by 5. After that, we apply a recursive searching process to identify all the clusters, which is shown to be capable of getting the minimum order-reduction result of a well-constrained system. We also brie¯y describe the constraint evaluation phase and show the implementation results of our method.q2001 Elsevier Science Ltd. All rights reserved.

Keywords: Geometric constraints; Dependence analysis; Basic clusters; Graph reduction

1. Introduction

The problem of solving geometric constraint systems is an important topic in developing intelligent or parametric CAD systems [1±3,9±13]. In constraint based CAD appli- cations, the design objects are viewed as a geometric constraint system constituted of various geometric elements and constraints, and the designs are modi®ed by changing the parameter values. Therefore, geometric constraint solver has been considered as an important tool in many applica- tions such as mechanical part design, simulations, kine- matics, and assembly design.

There are many attempts in the literature to provide a powerful yet ef®cient method for solving geometric constraint problems. Among them, we distinguish three major approaches for solving declarative constraint systems:

the numerical approach, symbolic approach, and synthetic approach.

In the numerical approach, the geometric constraints are translated into a system of equations. The constraints on simple geometry, such as distance, angle, and incidence,

can be represented by polynomials. Therefore, it can be restricted to algebraic equations and various numerical tech- niques are used to solve them. Sketchpad [22] and ThingLab [2] used numerical relaxation as the last resort of solving constraint problems. Duff et al. [4] provided a review of algorithms that process systems of linear equations to ®nd sub-sets of equations, which de®ne values for several vari- ables. Light and Gossard [14] used such techniques to parti- tion the Jacobian matrix associated with a set of geometric constraints, and thus improved the ef®ciency of numerical constraint solution. The main advantage of numerical meth- ods is their generality. However, the shortcomings of numerical methods include slow runtimes, numerical instabilities, and dif®culties in handling redundant constraints.

In the symbolic approach, the constraints are also trans- formed into algebraic equations. Instead of being solved directly, the equations are ®rst changed to new forms using general symbolic methods such as Wu-Ritt's charac- teristic set method [7] and the GroÈbner basis method [15], and then the new equations are solved numerically. The symbolic approach may provide complete methods for many geometric constraint satisfaction problems. If the constraints are used symbolically, the parameterized solu- tions are produced. These generic solutions can be evaluated

Computer-Aided Design 34 (2002) 97±108

COMPUTER-AIDED DESIGN

0010-4485/02/$ - see front matterq2001 Elsevier Science Ltd. All rights reserved.

PII: S0010-4485(01)00054-9

www.elsevier.com/locate/cad

* Corresponding author. Tel.: 186-10-62782052; fax: 186-10- 62771138.

E-mail address:lyt@ncc.cs.tsinghua.edu.cn (Y.-T. Li).

(2)

for different constraint assignments. The disadvantage of symbolic solvers is that current methods are still too slow for real time computation.

In the synthetic approach, a planning phase is carried out to transform the constraint problem into a step-by-step constructive form that is easy to compute, then the constraint system can be solved ef®ciently. Two main tech- niques used in the synthetic approach are the rule-based search and the graph analysis. In the approach of Borning [2], a constraint was represented as a rule and was assigned a set of methods that could be invoked to satisfy the constraint. Roller [18] and Verroust et al. [23] described another approach of rule-based constraint evaluation based on the earlier works of Sunde [21]. Kramer [16] tried to determine a solution that satis®es the speci®ed constraints by analyzing the degree of freedom using techniques from kinematics. Owen [17] and Bouma et al. [3] presented graph reduction approaches to solve geometric constraint systems.

Hoffmann and Vermeer [11] extended the algorithm from Bouma et al. [3] for 3 dimensions. Fudos and Hoffmann [6]

presented the correctness proof of a graph-based variational geometric constraint solver. Lee and Kim [13] solved a geometric constraint problem by incrementally identifying a set of constrained geometric elements with 3 DOF as a rigid body. At present, most parametric design systems adopt the graph reduction approach as a fundamental scheme for solving declarative geometric constraint systems.

An important concept behind the solvers based on graph reduction isrigidity, since there is an intrinsic relationship between well-constrained problems and generically rigid constraint graphs [19]. Although the graph reduction meth- ods have acquired great success in solving 2-D geometric constraint systems, ®nding an algorithm to systematically produce a realization for any 2-D constraint system is still an open problem. In 3 dimensions this problem is even more intricate, since a general characterization for generically rigid 3-D constraint graphs has not been presented.

In this paper, we present a new method of dependence analysis to analyze 3-D geometric constraint systems. The basic idea of dependence analysis is that the solutions of some geometric elements depend on some others because of the constraints between them. If some geometric elements depend on each other, they must be solved together. Using bipartite matchings without weights, we analyze the rela- tionships between rigidity of the constraint graph and connectivity of the corresponding dependence graph of a constraint system. The maximum matching method has been considered by, for example, Serrano and Gossard [20], Latham and Middleditch [12], and Hoffmann et al.

[10]. As pointed out by Hoffmann et al. [10], the previous methods (1) can not directly identify well-constrained sub- graphs of a constraint system and (2) provide no natural way of ®nding a minimal well-constrained sub-graph. Using the relationships provided in this paper, we give the conditions when a sub-graph corresponds to a well-constrained one and

prove that our reduction method obtains the minimum order-reduction result of a well-constrained system.

In practice, under- and over-constrained cases frequently exist. For over-constrained cases, we give a rule to check whether a constraint is structurally redundant. After deleting all the redundant constraints, the over-constrained system is translated to structurally under- or well-constrained system.

For under-constrained cases, we add some constraints to satisfy the well-constrained requirement. And we show that the order of the new well-constrained system after adding the additional constraints is not more than that of the original system multiplied by 5.

Based on the dependence analysis, a DOF-based graph constructive method capable of ef®ciently handling well-, over- and under-constrained systems is described. Like most graph-based constraint solvers, the proposed method contains two phases: (1) analysis phase and (2) constraint evaluation phase. In the analysis phase of our approach, after converting the under- and over-constrained cases into well-constrained cases, we apply a recursive searching process to identify all the clusters. Then the whole constraint system is translated into a tree structure such that the none-leaf nodes are basic cluster nodes and the leaf nodes are geometric elements. Our reduction method can handleanytype of constraint systems. In the constraint evaluation phase, the inner constraints of each cluster are solved together, and then the results are propagated to the whole constraint system. And we also show the implemen- tation results of our method.

The remainder of this paper is organized as follows.

Section 2 presents the dependence analysis method.

Section 3 brie¯y describes the constraint evaluation phase. Section 4 shows the implementation results.

Finally, Section 5 presents a summary with some remarks.

2. Dependence analysis

Dependence analysis is concerned with the associations between the geometric elements and constraints. In this paper, the theory and examples are presented in a 3-dimen- sional domain. Of course, there are similar conclusions in a 2-D plane.

2.1. De®nitions and representation

The geometric elements include points, lines, planes, spheres, cylinders and polyhedrons. Each element has corre- spondingdegree of freedomthat is the minimal number of real-valued parameters required to specify the element in space unambiguously, noted as DOF…g†. A geometric constraint c reduces the DOFs of relative geometric elements by a certain number, called the degree of constraintofc, noted asDOC…c†. If the DOC of a constraint is more than one, that constraint can be substituted by several constraints with one DOC each.

For the convenience of constraint processing, we add a

(3)

world coordinate systemwcsinto the constraint system. In the reduction process,wcsis considered to be a rigid body withsixDOF. Then it is ®xed and is the start point of the constraint evaluation phase, i.e.wcs haszero DOF in the constraint evaluation process. With an appropriate represen- tation and some preprocessing, we may restrict ourselves to rigid bodies and pairwise constraints. For example, a point may be equally turned into a rigid body by adding three directions on the point and three vector-plane-angle constraints between those directions and the coordinate planes ofwcs. Therefore, all the geometric elements consid- ered in this paper are rigid bodies withsixDOF each and all the constraints are pairwise constraints withoneDOC each.

A geometric constraint system can be represented by a constraint graph Gˆ …V;E†, in which each node is a geometric element and each edge is a constraint. Fig. 1 gives an example of nine polyhedrons and the correspond- ing constraint graph. Astructure graphis a bipartite graph in which each node represents a constraint or a geometric element. The edges in the structure graph link each constraint node to two geometric element nodes constrained by that constraint.

Following Fudos and Hoffmann [6], we give the de®ni- tions of under-, well- and over-constraint problems. A graph withn nodes is structurallyover-constrained if there is an induced sub-graph withm#nnodes and more than 6m26 edges. A graph is structurallyunder-constrainedif it is not structurally over-constrained, and the number of edges is less than 6n26. And a graph is structurally well- constrained if it is not structurally over-constrained, and the number of edges is equal to 6n26. Note that a structu- rally well-constrained graph can be over-constrained in a geometric sense, for example, if there are three points p1;p2;p3 with three distance constraints, where distance…p1;p2†.distance…p1;p3†1distance…p2;p3†.

Sincewcshas zero DOF in the constraint evaluation phase, a well-constrained problem has a ®nite number of solutions if there is no numerical redundancies.

In order to illustrate the constraint propagation process, we specify one rigid body as the starting point. We de®ne that rigid body as thebaseof the constraint system.

For each geometric element g in a well-constrained system, there must be some corresponding constraints such that the sum of DOCs of those constraints is equal to the DOF ofg. Thus we have the following theorem.

Theorem 1. Let Bˆ …V;C;E†be the structure graph of a well-constrained system, where V is the set of geometric element nodes, C is the set of constraint nodes and E is the set of edges. Then there exists a partition of C such that 1. ;vi[V2{base}correspond to a constraint set Ci,C

s.t.;cj[Ci,cjand viare adjacent and X

cj[Ci

DOC…cj† ˆDOF…vi†

2. Cˆ <

1#m#uVuCm

and;Cm;Cn,Cm>Cn ˆF.

Proof. ;vi[V2{base}, replaceviwithDOF…vi†nodes and copy the edges incident withvito each new node. Then each node ofVstands for one variable and each node ofC stands for one equation. Since the constraint system is well- constrained, we can ®nd a complete matching according to the sparse matrix theory [4]. Thus ;vi[V2{base}, the corresponding constraint set Ci is the set of matching constraints of the new nodes that have replacedvi.A From the proof, we can get the partition ofCbased on the maximal matching algorithm of bipartite graphs. The parti- tion result of Fig. 1(b) is shown in Fig. 2, in whichwcsis set to be the base. The arcs in Fig. 2 indicate the matching of geometric elements and constraint sets.

After constraint partition, we can convert the structure graphBˆ …V;C;E†into a directed graph via the following operations. ;eiˆ,vp;cq.[E, letvr be the correspond- ing geometric element of constraintcqin the partition result,

Fig. 1. A constraint system and corresponding constraint graph.

Fig. 2. The constraint partition result of Fig. 1(b).

(4)

ifr±p, add an directed edge,vp;vr.. After deleting all the constraint nodes and the edges incident with them, we get a directed graph calleddependence graph, which has at least two strong components (i.e. maximal strongly connected induced graph). Fig. 3 shows the dependence graph of Fig. 1(b).

Theorem 2. The dependence graph of a well-constrained system becomes exactly the constraint graph after convert- ing the directed edges to undirected ones.

Proof. From the generating process of dependence graph we see the conclusion clearly.A

2.2. Relationships between graph rigidity and connectivity In design applications, usually there is a set of geometric elements whose positions and orientations relative to each other are known according to the constraints between them.

These geometric elements can form a rigid body with 6 DOF (3 translational DOF and 3 rotational DOF). In the constraint graph, the corresponding nodes and the edges between them constitute a well-constrained induced graph Gr.Gris called aclusterand can be combined into a single node. The combination operation is called reduction, a reduction is denoted by !R and a sequence of reductions is denoted by!pR. For a clusterGˆ …V;E†, there exists the relation

X

vi[VDOF…vi†2 X

cj[EDOC…cj† ˆ6;

i.e. 6V2Eˆ6.

A cluster that does not contain sub-clusters is called a basic cluster. We divide the basic cluster patterns into two categories: pattern 1 is that there exists node g in the cluster such that the number of incident edges of g with outer nodes is not less than DOF…g†; and the resi- duals are pattern 2. Fig. 4 illustrates patterns 1 and 2.

A constraint system may have many different reduction ways. Theorder of a clusteris the number of nodes in that cluster. Theorder of a reduction resultis the maximal order of all the clusters in that reduction result, and theorder of a constraint graphis the minimal order ofallpossible reduc- tion results. The order of a reduction result can be used to evaluate whether the reduction method is satisfying.

There are certain relationships between the rigid induced graphs of the constraint graph and corresponding strongly

connectedinduced graphs of the dependence graph. Theo- rems 3±6 provide a mathematical basis of the reduction method to well-constrained systems.

Theorem 3. The geometric elements of a basic cluster of pattern 2 are strongly connected in the dependence graph if the base does not belong to that cluster.

Proof (by contradiction). Let Grˆ …Vr;Er† be a basic cluster of pattern 2 and Dr ˆ …Vr;Ar†be the corresponding induced graph of the dependence graph. Suppose'vi;vj[Vr, viand vj are not strongly connected inDr. ThenDr can be divided intoDr1ˆ …Vr1;Ar1†andDr2 ˆ …Vr2;Ar2†that are not strongly connected, as shown in Fig. 5. IfVr2ˆ1,vjcorre- sponds to six outer constraints, i.e.nˆ6, thenGr falls into basic cluster pattern 1. ThereforeVr2.1. BecauseGrdoes not contain sub-clusters, we know that 6Vr226.Ar2.Gr is well-constrained, then each variable must has a correspond- ing constraint, i.e. 6Vr2ˆAr21n. Sincen#6, the equa- tion becomes 6Vr2#Ar216, it is contrary to 6Vr226.Ar2.A

Theorem 4. The geometric elements of basic cluster pattern 1 except for the node incident with n$6 outer edges are strongly connected in the dependence graph if the base does not belong to that cluster.

Proof. The proof is similar to that of thereom 3.A Theorem 5. There exists a strong component Dr of the dependence graph D of a well-constrained system such that Dr corresponds to basic cluster pattern 1 or 2, or Dr and one outer node correspond to basic cluster pattern 1 after some steps of reduction.

Proof. After reducing all the basic clusters of the strong

Fig. 3. The dependence graph of Fig. 1(b).

Fig. 4. Two basic cluster patterns.

Fig. 5. Two parts ofDrthat is not strongly connected.

(5)

components ofDrecursively,Dbecomes an acyclic digraph if each strong component is considered to be one node. If there existsDrthat corresponds to basic cluster pattern 1 or 2, the conclusion is true. Otherwise, two different cases can be distinguished according to the number of strong compo- nents ofD. Case 1 (the number of strong components is 2):

Let Dr and {base} be the two components. Because Dis well-constrained and there are no sub-basic clusters inDr, Drand {base} corresponds to basic cluster pattern 1. Case 2 (the number of strong components is more than 2): Assume there is no suchDrso as toDrand an outer node correspond to basic cluster pattern 1. Because there is no sub-basic clusters in each strong component and D is well- constrained, we can see thatDcorresponds to basic cluster pattern 1. Then the induced graph G…D2{base}† is strongly connected, this is contrary to the fact that D is acyclic.A

Theorem 6. Let D be the dependence graph of a well- constrained system. D is a basic cluster if the number of strong components of D is 2 when arbitrary node n of D is regarded as the base.

Proof. Assume there is induced graphDrˆ …Vr;Ar†inD that corresponds to a cluster. Letnbe a node ofDr. Whenn is regarded as the base, because 6Vr2Arˆ6 and every node ofDexcept for n corresponds to six constraints, we know that;v[Vr2{n}, the corresponding constraint set is a subset of Ar. Therefore, no outer arcs are directed towardsDr, this is contrary to the fact thatDhas only two strong components.A

2.3. Processing over-constrained cases

For over-constrained cases, we can use the constraint partition method to check whether a constraint is structu- rally redundant. After deleting all the redundant constraints, the over-constrained graph is translated to structurally under- or well-constrained graph.

Theorem 7. Assume constraint system Gˆ …V;E†

becomes over-constrained by adding constraint cˆ,vp;vq., where vp and vq belong to V. Then there exists a constraint that has no corresponding geometric element when vpis set to be the base.

Proof. Becausecover constrainsG, we know that there is

an induced graph Giˆ …Vi;Ei† of Gsuch thatc[Gi and 6Vi26,Ei. Sincevp[Gi is set to be the base, there must be Ei26…Vi21† constraints that can not ®nd corresponding geometric elements.A

Algorithm 1. The algorithm to deleting structurally redundant constraints.

Input: Gˆ …V;E†, the constraint graph of a constraint system.

Output:G, the well- or under-constrained system.

procedureOVER_TO_UNDERORWELL(G) begin

1 generate graphGpˆ …Vp;Ep†such thatVpˆVand EpˆF;

2 forcˆ,vp;vq.[Edo 3 begin

4 addctoGp;

5 setvpas the base ofGp;

6 generate structure graphBp ofGp;

7 partite the constraint set ofBp using the maximal matching algorithm of bipartite graph;

8 if some constraint cannot ®nd corresponding geometric elementthen

9 setcbe structurally redundant and delete it from GandGp;

10 end 11 returnG;

end

Obviously, Algorithm 1 identi®es all the structurally redun- dant constraints. From graph theory [5] we know that a maximal matching of the bipartite graph can be found in O…VE†. Since we haveO…E† ˆO…V†for a design, Algo- rithm 1 takesO…V3†in all.

2.4. Processing under-constrained cases

It is much more complex to deal with under-constrained cases. LetGrbe an induced graph of constraint graphG.Gr is called a pseudo-cluster if it becomes well-constrained after adding more than zero constraints that do not over constrain G. A pseudo-cluster that does not contain sub- pseudo clusters is called a basic pseudo-cluster. Note that a basic pseudo-cluster may contain sub-clusters, for exam- ple,G2in Fig. 6. There are three rules to evaluate the addi- tional constraints that convert an under-constrained graph into a well-constrained one.

Rule 1. They do not over constrain the constraint graph.

Rule 2. They do not change the structure of the constraint graph.

Rule 3. The order of the constraint system does not increase.

It is explicit that Rule 1 must be satis®ed for all additional

Fig. 6. An under-constrained system with two basic pseudo-clusters.

(6)

constraints. In practical applications, usually the user ignores some constraints for simplicity and the related induced graphs correspond to basic pseudo-clusters. We expect that the additional constraints make the basic pseudo-clusters well-constrained. However, it is dif®cult to ®nd an algorithm to satisfy this requirement. Obviously, the basic pseudo-clusters are determined by the topology and the numbers of edges between node pairs of the constraint graph. And if the additional constraints change the structure of the constraint graph, the basic pseudo-clus- ters with two nodes cannot become clusters. For example, if we do not add constraint between u and v in Fig. 6, G1 cannot become well-constrained. Therefore, we use Rule 2 to evaluate the additional constraints.

When decomposing the constraint system, we hope to get the best reduction result whose order is equal to that of the constraint system. And if the additional constraints increase the order of the constraint system, that of the reduction result will increase consequently. Thus Rule 3 is applied to judge whether the way of adding constraints is good.

Actually, Rule 3 relates to Rule 2 because the order of a constraint system is decided by those of the basic clusters and pseudo-clusters of that system. As can be seen in below materials, our method that does not change the constraint graph structure increases the order of the constraint system by less than ®ve times.

For example, we need two additional constraints to well constrain the under-constrained system illustrated in Fig. 7(a). If we place the two constraints as Fig.

7(b), the order of the reduction result is not minimal.

A better result is shown in Fig. 7(c).

Theorem 8. Let S be the set of constraints that do not over

constrain the constraint system and translate basic pseudo- cluster Gpˆ …Vp;Ep† to well-constrained graph,x…u;v†be the number of edges between u and v that are two nodes in Vp. Then after replacing every sub-cluster of Gp with a single node, (1) S#62max;u;v[Vpx…u;v† and (2) the constraints S of can be all added between arbitrary node u and v.

Proof. IfVpˆ2, obviously the conclusions are correct.

Otherwise, after replacing every cluster ofGpwith a single node, let

x…u0;v0† ˆ max

;u;v[Vpx…u;v†

andG0ˆ …V0;E0†be anarbitraryinduced graph ofGpsuch thatu0;v0[V0. We know that 6V026.E0. SinceGpis a basic pseudo-cluster and does not contain sub-pseudo clusters, the relationship 6V026.E0must still be satis-

®ed after we add one edge betweenu0andv0, and the addi- tional constraint do not over constrain Gp. We repeat the process of adding edges between u0 andv0, and u0 andv0 become a well-constrained induced graph after adding 62 x…u0;v0† edges. Therefore, Gp must become well- constrained after adding less than 62x…u0;v0†edges, i.e.

j jS ,62 max

;u;v[Vp

x…u;v†:

And from the process of adding edges we can see that the constraints ofS can be all added between arbitrary nodeu andv.A

Theorem 9. Let u and v be two arbitrary nodes of an under-constrained graph and x…u;v† be the number of edges between u and v. Then after adding less than or equal to62x…u;v†edges between u and v, there exists an induced graph Gr such that (1) u;v[Gr and (2) Gr is a cluster and the whole constraint system is not over- constrained.Gris noted as well…u;v†.

Proof. The proof is similar to that of Theorem 8.A Obviously, if we set nodeu as the base,well…u;v†is the combination of the strong component containing vand all the prior strong components of the dependence graph. And well…u;v†need not to be a basic pseudo-cluster after deleting the additional constraints, as illustrated in Fig. 8. Then we

Fig. 7. An under-constrained system and the additional constraints.

Fig. 8. Adjusting the additional constraints.

(7)

must adjust the additional constraints to get a more prefer- able result.

Assume Gpˆ …Vp;Ep† become well-constrained after adding some constraints and Erˆ{,ur;vr.uur;vr[ Vp}#Ep be the edge set such that we can add more than zero constraints betweenur andvr. From the de®nition of basic pseudo-cluster, we know that Gp is a basic pseudo- cluster if well…ur;vr† is Gp for arbitrary edge ,ur;vr.[Er.

It is clear that all nodes of a basic pseudo-cluster are connected, i.e. a basic pseudo-cluster contains at least one existing edge. Therefore, we can add constraints between the nodes that are adjacent to well constrain the basic pseudo-cluster. In this way, the topology of the constraint graph remains the same and the structure of the graph does not change.

From above discussion, we can give an algorithm to convert under-constrained cases to well-constrained cases.

Algorithm 2. The algorithm to convert under-constrained cases to well-constrained cases.

Input: Gˆ …V;E†, the constraint graph of an under- constrained system.

Output:G, the well-constrained system.

procedureUNDER_TO_WELL(G) begin

1 ifthere are more than one connected components inG 2 thenforall connected componentGrthat do not contain

wcsdo

3 add six edges betweenwcsand arbitraryv0 [Gr; 4 E'ÃE;

5 for ,u,v. [E' and the priority of ,u;v. is minimaldo

6 begin

7 delete all the edges betweenuandvfromE';

8 addx,6 edges that is not structurally redundant to Ebetweenuandv. Then a cluster containingu andvis generated;

9 ifxˆ0then 10 continue;

11 u0Ãu,v0Ãv;

12 setuas the base ofG;

13 generate structure graphBand dependence graphD ofG;

14 G'Ãwell…u;v†;

15 delete all the additional edges fromG'andG;

16 ifG'±Gthen 17 begin

18 delete all edges that appear inG'fromE';

19 UNDER_TO_WELL(G');

20 end

21 end

22 ifGis not well-constrainedthen

23 add constraints between u0 and v0 to well constrainG;

24 returnG;

end

In line 5 of Algorithm 2, if we have added edges betweenu and v, then the priority of,u;v. is maximal. Otherwise, the priority of ,u;v. is minimal means that the number of edges betweenu and vis minimal. In Algorithm 2, the process of adding constraints betweenuandvcostsO…6E2† in the worst case. If there arexedges inG'in line 19, the loop of line 5±21 will be repeated for O…E†2x times.

SinceO…E† ˆO…V†, we can see that Algorithm 2 requires O…V3† in all.

Theorem 10. Algorithm 2 converts an under-constrained graph into a well-constrained one.

Proof. In Algorithm 2, line 1±3 make the constraint graph connected. For arbitrary edge ,u;v.,well…u;v†is well- constrained. Sincewell…u;v†is connected with outer nodes, it is an induced graph of other well-constrained graph. Algo- rithm 2 processes all the edges, thus it converts an under- constrained graph into a well-constrained one.A

After adding some constraints to a basic pseudo-cluster, it is possible that we can not add constraints to some other basic pseudo-clusters. As shown in Fig. 9, when we add some constraints toGp,G1andG2 disappear.

Let G1 ˆ …V1;E1† and G2ˆ …V2;E2† be two basic pseudo-clusters and V1.V2, x…u;v† be the number of edges between nodeu andv. Generally speaking, we have the relationship

u;v[Vmin1;x…u;v†.0x…u;v†, min

m;n[V2;x…m;n†.0x…m;n†:

The loop of line 5±21 in Algorithm 2 searches the basic pseudo-clusters from the minimalx…u;v†, this strategy will keep the basic pseudo-clusters with more nodes in general.

Lemma 1. Let Gp and G1;G2;¼;Gn be basic pseudo- clusters. Assume G1;G2;¼;Gn disappear if Gp becomes a basic cluster after adding some constraints, and Gp disappear if G1;G2;¼;Gn become basic clusters. Then n#5.

Proof. Let s…G† be the number of edges that well

Fig. 9.G1andG2disappear when we add some contraints toGp.

(8)

constrain basic pseudo-cluster G. From Theorem 8 we know that 1#s…G†#5, then Gp `occupies' the constraints of no more than ®ve other basic pseudo- clusters. Thus n#5.A

Lemma 2. The node number of the intersection of two basic pseudo-clusters is not more than one.

Proof. LetG1ˆ …V1;E1†andG2ˆ …V2;E2†be two basic pseudo-clusters, Gsˆ …Vs;Es† be the intersection, and Gtotalˆ …Vtotal;Etotal†be the union ofG1andG2. Obviously Gs±G1 and Gs±G2. Let assume 6V126ˆE11p, then after adding p constraints to G1, we know that EtotalˆE11p1E22Esˆ6V1261E22Es#6Vtotal26. Since VtotalˆV11V22Vs, we get 6Vs2Es

#6V22E2. IfEs±0,Gsbecomes a cluster after adding less than 6V22E226 edges. This is contrary to the fact thatG2 is a basic pseudo-cluster.A

Theorem 11. Assume Algorithm 2 convert under- constrained graph G to well-constrained graph G'. Let p be the order of G and q be that of G'.Then q#5p.

Proof. Immediately from Lemma 1 and 2.A 2.5. Reduction algorithms

After processing over- and under-constrained cases, the whole constraint system is converted into a well-constrained graph. From Theorem 5 we know that we can identify the clusters of a well-constrained graph via searching the strong components of the dependence graph. By applying the searching process recursively, the whole constraint system can be translated into a tree structure such that the none-leaf nodes are basic cluster nodes and the leaf nodes are geometric elements. Algorithm 3 gives the process to well-constrained system reduction and Algorithm 4 gives the top-level description to constraint system reduction.

Algorithm 3. The algorithm to well-constrained system reduction.

Input:Gˆ …V;E†, the constraint graph of a well-constrained system.

Output:n, the root vertex after reduction.

procedureWELL_GRAPH_REDUCTION(G) begin

1 forv[V do 2 begin

3 setvas the base;

4 generate structure graphB;

5 generate dependence graph D using the maximal matching algorithm of bipartite graph;

6 search all the strong componentsD1;D2;¼Dm; 7 ifm±2then

8 begin

9 search all well-constrained induced graphs G1;G2;¼Gr, which are irrelevant to each other;

10 foriÃ1untilrdo

11 WELL_GRAPH_REDUCTION(Gi);

12 end

13 end

14 replaceGwith a single cluster noden;

15 returnn;

end

SinceEˆ6V26, line 5 costsO…V2†and line 4, 6 and 9 cost eachO…V†. If there are xnodes inGiin line 11, the loop of line 1±13 will be repeated forV2xtimes. There- fore, Algorithm 3 requiresO…V3†in all.

A well-constrained system may have many different reduction ways. Using the proposed method, we can obtain the minimum order-reduction result of a well-constrained system.

Lemma 3. The node number of the intersection of two basic clusters is not more than one.

Proof. LetR1ˆ …V1;E1†andR2ˆ …V2;E2†be two basic clusters, Sˆ …Vs;Es† be the intersection, and Stotalˆ …Vtotal;Etotal† be the union of R1 and R2. Then we have EtotalˆE11E22Esˆ6V12616V2262Es

ˆ6Vtotal21216Vs2Es. Since Etotal#6Vtotal26, we get 6Vs#Es16. If Es±0, since R1 and R2 are basic clusters, we get Es,6Vs26, it is contrary to 6Vs#Es16. Thus Shas one or zero node.A

Theorem 12. Algorithm 3 gets the minimum order-reduc- tion result of a well-constrained system.

Proof. Letp be the maximal order of basic clusters (may after some reduction steps) of a well-constrained systemG.

Obviously the minimum order of the all possible reduction results is p. In Algorithm 3, every time a basic cluster is reduced. Three different cases can be distinguished based on the relationship of current reducing clusterG1and arbitrary clusterG2. Case 1:G1 and G2 are not intersected. The two reduction steps are independent, so the orders ofG1 andG2 are not more thanp. Case 2:G1andG2are intersected. From Lemma 3 we know that one cluster can be a node of the other, thus the orders are not more thanp. Case 3:G2becomes basic cluster after reducingG1. Obviously the orders ofG1andG2 are not more thanp. From the previous we know the order of the reduction result generated by Algorithm 3 isp.A Algorithm 4. The top-level algorithm to constraint system reduction.

Input: Gˆ …V;E†, the constraint graph of a constraint system.

Output:n, the root vertex after reduction.

(9)

procedure CONSTRAINT_GRAPH_REDUCTION (G)begin

process the geometric elements and constraints such that each nodes of G has six DOF and each constraint has one DOC;

GÃOVER_TO_UNDERORWELL(G);

GÃUNDER_TO_WELL(G);

nÃWELL_GRAPH_REDUCTION(G);

returnn;

end

It is clear that Algorithm 4 takes O…V3† in all. And the correctness proof of the proposed reduction method can be found in the appendix.

3. Constraint evaluation process

After the reduction process, the constraints entailed must be solved. In order to solve a single cluster ef®ciently, we apply analytic solution if the combination pattern of constraints is supported. Otherwise, we use the Newton- Raphson method to solve the equations.

Once a cluster being solved, the result should be propa- gated to the whole constraint system. In the design process, many modi®cations of designs are generated by modifying one parameter of a constraint or a geometric element. In such cases, We can ®nd the cluster containing the modi®ed parameter and solve it, then solve the whole constraint system by solving parent of current cluster in series till the root cluster. When several parameters are modi®ed simultaneously, we may solve the whole constraint system by solving every branch of the cluster tree. And the solving process of one branch is irrelevant to those of other branches.

4. Implementation

The proposed method has been implemented as an assem- bly constraint solver in a feature-based parametric CAD system of GEMS 5.0. In the reduction process, all the basic clusters are reduced recursively. And in the constraint evaluation process, the clusters are solved using analytic or iterative methods. The reduction process of Fig. 1(b) is given in Fig. 10.

Fig. 11 gives an example of a bicycle assembly, which contains 27 parts and 62 assembly constraints. Each part has six DOF, and after preprocessing, the assembly constraints are translated into 157 valid geometric constraints with one DOC each. Then we get the well-constrained system after deleting seven structurally redundant constraints and adding 12 constraints. And the assembly is constructed by solving all the constraints entailed using the Newton-Raphson method.

5. Conclusion

We have presented a new DOF-based graph construc- tive method to geometric constraint systems solving based on the dependence analysis of the geometric elements.

The basic idea is that the geometric elements whose solu- tions depend on each other must be solved together. In our approach, we make a constraint graph well-constrained by

®rst deleting all structurally redundant constraints, and then adding constraints by three rules to the under- constrained system. And we prove that the order of a constraint system after processing under-constrained cases is not more than that of the original system multi- plied by 5. After that, we apply a recursive searching process to identify all the clusters, which can get the minimum order-reduction result of a well-constrained system. We also brie¯y describe the constraint evaluation

Fig. 10. The reduction process of Fig. 1(b).

(10)

phase. Finally we give the implementation results of our approach.

The proposed method is capable of ef®ciently hand- ling well-, over- and under-constrained systems and can process any type of constraint systems. Algorithms, such as those described in Owen [17], Bouma et al.

[3] and Lee and Kim [13], are more ef®cient than the algorithms proposed in this paper in 2-D plane, but their domain is restricted. In addition, they cannot handle 3-D constraint problems ef®ciently.

Some of the future works are listed below.

² Although we have presented algorithms to reduce the constraint systems, the ef®ciency of the algorithms may be improved. More ef®cient ways should be found to process over- and under-constrained cases and accelerate the reduction process.

² The stability of numerical solving should be improved and the optimization methods are considered. According to Ge et al. [8], the BFGS method is stable and effective.

And it may be considered to adopt a heuristic way to ®nd the intended solutions.

² The proposed method is a generic one and disposes of the structural constraint types. Future work is needed to deal with the numerical redundancy problem.

Acknowledgements

This research was supported in part by the National Natural Science Foundation of China (Project No.

69902004) and NKBRSF (Project No. 1998030600).

Fig. 11. A bicycle assembly.

(11)

Appendix. The correctness proof of the reduction method

Following Fudos and Hoffmann [6] and Lee and Kim [13], we present the correctness proof of the proposed method by proving that the reduction algorithm iscanonical for well-constrained problems. For the de®nitions of cano- nical and con¯uent, see [6] or [13].

Lemma A1. If GI !pRGM, the induced graph that corresponds to a cluster in GM is structurally well- constrained.

Proof. We prove the conclusion by induction on the length of the reduction sequence that drivesGM from GI. The induction basis isGMˆGIand is trivial. For the induc- tion step, consider the last reduction step that merges the clusterR1;R2;¼Rkinto a new clusterR. LetGibe the sub- graph ofGIcorresponding toRi…1#i#k†. Letniandeibe the number of nodes and edges in the sub-graph Gi, respectively. Because the node sets ofGi are disjoint, we

know thatRhas nˆ X

1#i#k

ni nodes and eˆ X

1#i#k

ei16k26

edges. Sinceeiˆ6ni26…1#i#k†, we get eˆ6n26, thus the sub-graph is structurally well-constrained.z Theorem A1. A reduction is locally con¯uent.

Proof. Assume thatGI !pRGMand there are two different reductionsGM !R1 GM1 andGM !R2 GM2. Then we have to show thatGM2!R1 GM3 andGM1!R2 GM3. From Lemma 3 we know that the intersection of two basic clusters can only be one node, thus after one reduction step, the new cluster node becomes one node of the other cluster, then !R1 and

!R2 commute.z

Theorem A2. The proposed algorithm terminates.

Proof. In line 14 of Algorithm 3, each cluster reduction replaces at least two nodes in the constraint graph by a single node. Therefore, the number of nodes in the graph decreases monotonically and the process must terminate when there is a single cluster node in the graph.z

Theorem A3. The proposed reduction process is con¯uent.

Proof. Immediately from Theorem A1 and A2.z

Theorem A4. The proposed reduction algorithm is cano- nical for well-constrained problems.

Proof. Let assume two single node graphs be the results of reduction process for graph G. Because the reduction process is con¯uent and the two graphs are reduction results ofG, they may con¯ate to a common reductionG'. And they cannot be further reduced so that they must be identical since they are single node graphs. Therefore, all single node graphs obtained at the end of the reduction process are identical, and the process is canonical.z

References

[1] Aldefeld B. Variation of geometries based on a geometric-reasoning method. Computer Aided Design 1988;20(3):117±26.

[2] Borning A. The programming language aspect of ThingLab. ACM Trans. On Programming Language and Systems 1981;3(4):353±87.

[3] Bouma W, Fudos I, Hoffmann CM, Cai J, Paige R. Geometric constraint solver. Computer Aided Design 1995;27(6):487±501.

[4] Duff IS, Erisman AM, Reid JK. Direct methods for sparse matrices.

Oxford Scienti®c Publications, 1986.

[5] Foulds LR. Graph theory application. Springer-Verlag, 1992.

[6] Fudos I, Hoffmann CM. Correctness proof of a geometric constraint Fig. 11. (continued)

(12)

solver. International Journal of Computational Geometry & Applica- tions 1996;6(4):405±20.

[7] Gao XS, Chou SC. Solving geometric constraint systems. II. A symbolic approach and decision of rc-constructibility. Computer Aided Design 1998;30(2):115±22.

[8] Ge JX, Chou SC, Gao XS. Geometric constraint satisfaction using optimization methods. Computer Aided Design 1999;31(14):867±79.

[9] Heydon A, Nelson G. The Juno-2 constraint-based drawing editor, SRC Research Report 131a, 1994.

[10] Hoffmann CM, Lomonosov A, Sitharam M. Finding solvable sub-sets of constraint graphs. In: Smolka G, editor. Springer LNCS 1330, 1997. p. 463±77.

[11] Hoffmann CM, Vermeer PJ. Geometric constraint solving in R2 and R3. In Computing in euclidean geometry, 2nd ed. World Scienti®c Publishing, 1994.

[12] Latham RS, Middleditch AE. Connectivity analysis: a tool for proces- sing geometric constraints. Computer Aided Design 1996;28(11):917±28.

[13] Lee JY, Kim K. A 2-D geometric constraint solver using DOF-based graph reduction. Computer Aided Design 1998;30(11):883±96.

[14] Light RA, Gossard DC. Modi®cation of geometric models through variational geometry. Computer Aided Design 1982;14(4):209±14.

[15] Kondo K. Algebraic method for manipulation of dimensional rela- tionships in geometric models. Computer Aided Design 1992;24(3):141±7.

[16] Kramer GA. A geometric constraint engine. Arti®cial Intelligence 1992;58:327±60.

[17] Owen JC. Algebraic solution for geometry from dimensional constraints. In Proceedings of the First Symposium on Solid Modeling Foundations and CAD/CAM Applications, ACM Press, 1991. p. 379±

[18] Roller D. A system for interactive variation design. In: Wozny J,407.

Turner, Preiss K, editors. Geometric modelling for product engineer- ing, North Holland, 1990. p. 207±19.

[19] Sansone G. Orthogonal functions. Revised English Edition. Dover, 1991.

[20] Serrano D, Gossard DC. Combining mathematical models with geometric models in CAE systems. In Proceedings of the ASME Computer in Engineering Conference, Chicago, IL, 1986. p. 277±84.

[21] Sunde, G., A CAD system with declarative speci®cation of shape, Eurographics workshop on intelligent CAD systems, Noorwijkerhout, the Netherlands, 1987, pp. 90±104.

[22] Sutherland I. Sketchpad, a man-machine graphical communication system. In Proceedings. of the Spring Joint Comp. Conference, North-Holland, 1963. p. 329±45.

[23] Verroust A, Schonec F, Roller D. Rule oriented method for parame- terized computer-aided design. Computer Aided Design 1992;24(10):531±40.

Shi-Min Huis an associate professor in the Department of Computer Science and Tech- nology, Tsinghua University. He received a BSc in Mathematics from Jilin University in 1990, a MSc and a PhD degree in Computa- tional Geometry and Computer Graphics both from Zhejiang University in 1993 and 1996.

His research interests are in computer aided geometric design, computer graphics, and content-based image indexing.

Yan-Tao Liis a PhD student in the Department of Computer Science and Technology, Tsinghua University, Beijing, P. R. China. He received a BSc degree from the Department of Precision Instruments and Mechanology, Tsinghua University in 1997. His current research interests include geometric constraint solving, feature- based design, and image based modelling.

Jia-Guang Sunis a professor in the Depart- ment of Computer Science and Technology, Tsinghua University. He is also director of the National CAD Engineering Center at Tsinghua University, and Academician of Chinese Academy of Engineering. His research interests are in computer aided geometric design, computer graphics, and product data management.

Références

Documents relatifs

On the other hand, by loose we mean that the OS and the applications are linked as separate programs and the OS loads the application programs (the common model in desktop

to identify maximal G -well-onstrained subsystems, and Algorithm 2, in order to ompute the boundary of the identied MGSs. The algorithm

Considering a representation of embedded generalized maps as labeled graphs introduced in [13] and in which node labels and associated labeling constraints encode object embedding,

A seminal result is Artstein’s theorem [1, Theorem 5.1] which proves, for affine systems, the existence of a control Lyapunov function is equivalent to the existence of a

The thesis is split into five parts: the first (Chapter 1 ) presents an overview of the BIP framework; the second (Chapter 2 ) describes our compositional verification approach

Let us consider for example the extended graph edit distance (EGED) defined in [14]. This distance extends GE D by adding two edit operations for splitting and merging nodes.

This paper presents a framework for the specification of relay diagrams in a formal language, B-method, based on the specification of a graph and its properties.. The use of a

In the case of a distributed control architecture, each decider agent is responsible for the decision making process in its enterprise; whether in a centralized or