Solving CSG equations for checking equivalency between two different geometric models

Solving CSG equations for checking equivalency between two different geometric models

Computer-Aided Design 36 (2004) 975–992 www.elsevier.com/locate/cad Solving CSG equations for checking equivalency between two different geometric mo...

706KB Sizes 0 Downloads 6 Views

Computer-Aided Design 36 (2004) 975–992 www.elsevier.com/locate/cad

Solving CSG equations for checking equivalency between two different geometric models Zhengdong Huang*, Shaopeng Tian, Ji Zhou School of Mechanical Science and Engineering, Huazhong University of Science and Technology, Wuhan, Hubei 430074, China

Abstract For two given parametric constructive solid geometry (CSG) models, the problem of determining their parameter domains in which the two models are equivalent is addressed. Here, two CSG models are equivalent if they represent the exact same region in R3 ; although their constituent features and feature attributes may differ. In this paper, an approach for solving the problem in a limited scope is proposed, in which a CSG model is polyhedral, its parametric form is explicit and its feature orientations are fixed. The solution includes the equivalent parameter domain for each model and parameter mapping that associates these two models on their equivalent parameter domains. One application of this research is to identify the equivalent parameter domains of two parametric part models, respectively, in the design option space and in the capability envelope set of a parametric machining process in order to facilitate the interoperation between part design and process planning through the generated parameter mapping between these two different kinds of models. q 2004 Elsevier Ltd. All rights reserved. Keywords: Parametric modeling; Constructive solid geometry equations; Model equivalency

1. Introduction Associating a part design model with a machining process is an important issue because it is a key for integration of design and manufacturing. Most research in this area focuses on the association at the feature-operation level. For example, extensive research has been done on extracting machining features from part boundary models or from part design-feature models and mapping the machining features into machining operations in a machining process using engineering rules defined within process knowledge bases. However, the integration based on the association at the feature-operation level is not as efficient as that at the part-process level where a given part model is directly associated with a complete machining process with a proper mapping between part model parameters and machining process parameters. Here the machining process is supposed to be parametric in a sense that its cutter sizes, cutter locations, and cutter path ranges, etc. may change depending on a vector of parameters, so that it can be adopted for machining of different parts. The association at the part-process level is important for variant process planning, one of the most applied approaches in industry for generating machining processes. Although it is important, * Corresponding author. Tel.: þ 86-27-87543973. E-mail address: [email protected] (Z. Huang). 0010-4485/$ - see front matter q 2004 Elsevier Ltd. All rights reserved. doi:10.1016/j.cad.2003.10.002

few researchers have paid attentions to this issue. Recently, Huang et al. [1] have proposed a new scheme for integrating part design and process planning through the intersection set of the part design option space and the capability envelope set of a machining process, where the capability envelope set is composed of all the parts that can be produced from given stocks using the machining process. They developed an approach for constructing the capability envelope set through parametric feature relational graph (P-FRG) matching and mixing between P-FRGs representing workpieces and those representing machining operations within a machining process. However, how to compare the parametric part models in a part design option space with those in a capability envelope set and how to create the parameter mapping between them are still an open problem. The goal of comparing two parametric part models is to check the equivalency between them, where equivalency means they represent the exact same region in R3 when only part geometry is considered, although their constituent features and attributes may be different. The result of this comparison is the parameter sub-domains in which they are equivalent. After the equivalent sub-domains are determined, the parameter mapping between them also needs to be created for finally associating these two part models. The main difficulties to achieve this goal come from the following aspects:

976

Z. Huang et al. / Computer-Aided Design 36 (2004) 975–992

† Non-uniqueness of part representations. Commonly a part is represented in the forms of constructive solid geometry (CSG) or Boundary Representations (B-rep). Since it is hard to use the B-rep approach to represent a variable part, the CSG approach is widely applied in parametric modeling where features or geometric primitives are its basic building blocks. Although the CSG representation scheme is unambiguous, it is not unique; this means that the same part can be represented in different CSG forms with different features and relationships. So, only comparing the CSG data structures is not enough; the 3D regions CSG models represent should be carefully checked during the comparison. This make the procedure complicated. † Existence of different positioning references. Usually, different part models have different geometric reference systems. For example, the models in the part design option space are defined with respect to their design datum while the models in the process capability envelope set are formed in reference to their machining datum within setups. Different reference systems make the coordinates representing the positions and orientations of two corresponding features, respectively, in the two models different. This means that the essential content in the model data for comparison is not the individual values; it is the relationships among them. So, the comparison should be carried out globally. † Implicitness of parametric representation. The chance that two fixed parts from different sources are identical is little. So, the comparison of two parametric parts has much wider uses in practice. However, most part parametric representations are defined implicitly through geometric constraints, whose valid parameter domain is not explicitly defined and the calculation of the feature attributes from their parameters is complicated; usually it is a constraintsolving procedure. This makes association of parameters of different parts and creation of mappings between them not easy. Although it is hard to achieve this goal completely based on the current development in this research area, some short-term progresses can still be made. The objective of the research in this paper is to develop an approach for determining the parameter domains of two parametric CSG models, in which they are equivalent, in a limited scope where a CSG model is polyhedral, its parametric form is explicit and its feature (or primitive) orientations are fixed. Here, a polyhedral part is represented using a list of polyhedral features organized in a CSG bi-branch tree while attributes of each feature, e.g. width, depth, and position, are explicitly defined as functions of part parameters. It is obvious that two part A and B are equivalent if and only if CSG model ðA2p BÞ


a Boolean combination of a set of half spaces. It will be proven that ðA2p BÞ


2. Related work There are two areas of research related to the work in this paper: parametric modeling and the integration of part design and process planning. In parametric modeling, commercial parametric CAD systems usually adopt a dual representation consisting of CSG and B-rep representations, where parameters and constraints are maintained at nodes of CSG trees and the corresponding evaluated topologic entities are kept in a B-rep representation. Many problems related to the dual representation are well documented in Refs. [2,3]. One severe problem is that designers cannot predict what they can get after they modify some parameters. The problem is caused mainly by two reasons. One is that the same topological entities in a B-rep may have a different name in the two representations, respectively, corresponding to the parameters before and after a parameter modification. The other is that the extent of a solid family to be defined by a parametric model is not well delimited by means of constraints in these systems. The former is the persistent naming problem and several heuristic methods have been proposed for dealing with it [4,5]. However, how to define a solid family is a more difficult problem. There are three kinds of research efforts that have been made in order to solve this problem in academic community: to develop an approach to precisely define semantics of a solid family, i.e. designer intent [6,7], to develop an algorithm to determine valid parameter ranges [8], and to investigate topology changes in a solid family [9 –11]. Besides geometric and algebraic constraints that have been already utilized by

Z. Huang et al. / Computer-Aided Design 36 (2004) 975–992

current CAD systems, Bidarra and Bronsvoort [6,7] introduced topologic constraints to precisely define the semantics of every feature in a model, which specify the extents of feature faces and the interaction types among different features. In this way, each feature is associated with a semantic definition that includes a set of different types of constraints. In the part level, like dual representation, a bi-level representation is used: a feature dependency graph and a cellular model. Cellular model facilitates solving the problems in boundary re-evaluating and topologic constraint checking. Even for a well-constrained solid family, usually, what parameters can instantiated a valid family member are not known before checking the constraints that define the family. This is not convenient for designers and it is one of reasons why family member instantiations fail. Hoffmann and Kim [8] developed an algorithm for determining the ranges of parameters which instantiate a valid model for a kind of 2D parametric models. Besides the above constraint-based definition, Raghothama et al. [9], have given a different definition for a solid family, which directly describes topology changes of the model boundaries in a family. In their definition, if two solids belong to the same family, there should be a sequence of continuous topology maps, each of which represent a small change of family parameters, connecting them and the changed intermediate models between them. The continuous topology map is to map the neighbor of a topology entity into the neighbor of a target topology entity and it is not required to be one-to-one; therefore, the local collapse of topological entities is allowed. With this definition, they also developed an algorithm for checking the consistency between CSG and B-rep in dual representation systems [10]. Recently, they extended this definition to a general framework for part families, which define part families for different types of part representations, such as B-rep, CSG, cellular model and feature model, based on topological categories derived from continuous topology maps, after defining specific topologies and topologic neighbors for each of them [11]. Although related, the research in this paper addresses a different issue in parametric modeling. The above work concentrates on modeling a solid family while this work focuses on comparing two different models. As mentioned above, the comparison work can be done through solving the CSG equations, but these equations are different from the traditional geometric constraint equations. The traditional constraint equations are created based on the equality of model’s geometry attributes, such as feature positions and feature sizes, while the CSG equations are constructed based on the equality of the 3D point sets that the models represent. There are many constraint solving methods that have been developed, for example, numerical iteration methods [12], rule-based reasoning methods [13], graph-based construction methods [14] and symbolic computation methods [15]. But, these methods cannot be used to solve the CSG equations before the constraint

977

equations that guarantee the equality of the model’s point sets are derived. However, the derivation of the constraint equations from the CSG equations is a complicated problem when taking into account the non-uniqueness of the CSG representation of a part and the alternatives of its parameterization. The motivation of the model comparison in this research is to integrate part design with process planning through the common parametric models that are shared by these two different product development divisions. There are a lot of research works that have been done to address the integration of part design and process planning. The objective of this integration is to reduce the cost caused from improper design. Most works in this area are to check the manufacturability of each feature on a part one by one through geometric reasoning [16]. Recently, some authors began to study methods of checking the manufacturability of a part against an entire machining process through the equivalency evaluation between the designed part model and synthetically composed part models in the capability envelope of a machining process from a sequence of feature relational graphs representing the operations in the process [1]. Some researchers have paid attention to the issue of equivalency checking between two part models. Regli and Cicirello [17] have studied the method of comparing parts through matching the part feature structures, which is defined as Model Dependency Graph, a directed acyclic graph, representing feature orders in the model. Huang and Yip-Hoi [18] have given a more sophisticated feature relational graph with parameterization to represent part structures and have developed an approach for matching the graphs with parameter recognition. Although feature relational graphs and graph isomorphism algorithms facilitate the comparison of two part models, the existence of multiple feature relational graph representations for the same part weakens the significances of this kind of methods. One of the research areas dealing with the non-uniqueness of part representations is the conversion of part models from design-feature-based to machining-feature-based. The major differences between these two kinds of models come from the fact that machining-feature-based models only consist of negative features while design-feature-based models may include negative features as well as positive features. Various methods have been developed for this purpose [19,20]. However, the non-uniqueness of the part representations is not only due to differences between design features and machining features; there are also multiple different machining-feature-based models for the same part because of a well-known problem, feature interactions. Lee and Kim [21] have presented an approach for generating alternative interpretations of machiningfeature-based models. As the technology in parametric modeling is becoming more and more mature, planning a machining process based on parametric models is unavoidable and identifying the associations between a parametric part family with one or

978

Z. Huang et al. / Computer-Aided Design 36 (2004) 975–992

more parameterized process is becoming more and more important. The effort to determine the equivalent parameter sub-domains between two parametric models in the present research is in this direction. To our knowledge, there is no such work documented before. Here, a theory from linear algebra [22,23] is applied to develop an approach for generating the explicit expressions of the parameter subdomains within which two polyhedral CSG models are equivalent.

Here, t is its parameter vector and Dt is its parameter domain. 2. Convex polyhedrons. Convex polyhedron is defined as the intersection of multiple half spaces. If half spaces in a convex polyhedron are parametric, then, the convex polyhedron is called parametric, too. It is denoted as the following: CðtÞ ¼

m \ p

Hi ðtÞ; t [ Dt

i¼1

CðtÞ can also be expressed in another way: 3. Definitions

CðtÞ ¼ {xlAðtÞx þ BðtÞ $ 0; A [ Rm£3 ; B [ Rm ;

3.1. Notations

x [ R3 }; t [ Dt

For the convenience of descriptions, the following notations are used in this paper: † Expression M ¼ ðmij Þ $ 0 means mij $ 0 for each component of matrix M: So does an expression with symbol ¼ , . or # . † Symbol x denotes a 3D point in space. † Symbol t denotes a parameter vector. † H c is the regularized complement of set H. 3.2. Terminologies The following is the formal definitions for the terms that are used to describe the problem to be solved in this research. 1. Half spaces. When a 3D space is divided into two parts by a plane, the regularized set of each part is called half space. If the coefficients of the plane equation for a half space are dependent on a set of parameters, the half space is called parametric half space. It is expressed as follows: HðtÞ ¼ {xlaðtÞT x þ bðtÞ $ 0; a; x [ R3 ; b [ R1 }; t [ Dt

3. Features. A feature is defined as a union of a set of parametric convex polyhedrons, and feature attributes, e.g. width, depth, position and orientation, are the parameters of its constituent convex polyhedrons. Formally, it is defined as follows: FðaÞ ¼

s [ p

Ci ðaÞ

i¼1

Here, the feature attribute vector is denoted by letter a: In a parametric part model, the feature attribute vector is dependent on the part parameter vector t with a function mapping a ¼ f ðtÞ; the relationship is represented as follows: FðaÞ ¼ Fðf ðtÞÞ; a ¼ f ðtÞ; t [ Dt Fig. 1 gives an example of feature definitions using half spaces. This is a T-shaped slot feature, which is composed of two convex polyhedrons, C1 and C2 : The detail expression of C1 is shown in the figure; its half space inequalities related to feature dimensions in the local coordinate system is given in Fig. 1a and Fig. 1b shows how to transform the inequalities to the form related to the part parameters in the part coordinate system.

Fig. 1. Half space representation of features.

Z. Huang et al. / Computer-Aided Design 36 (2004) 975–992

4. CSG standard forms. Usually, a CSG model is represented using a bi-branch tree, where leaf nodes are features and the other nodes are Boolean operators. However, it is more convenient to express a CSG model in a Boolean expression for analysis. The Boolean expression of the CSG model with features as its leaf nodes can be written in the following form: CSGðtÞ ¼

p [

Gi1 i2 i3 …in ðtÞ; t [ Dt T Here Gi1 i2 i3 …in ðtÞ ¼ p nk¼1 Fkik ðak Þ; ik [ { 2 1; 0; 1}; ak ¼ fk ðtÞ; k ¼ 1; 2; …; n; n is the number of the features in the model, Fk is a feature, Fk21 ¼ Fkc ; Fk0 ¼ R3 and Fk1 ¼ Fk : Fkc is the regularized complement of feature Fk : After the features in the above expression are replaced with their half space expressions, the expression of the CSG model can be transformed to the following standard form: CSGðtÞ ¼

k [ p

Ci ðtÞ; t [ Dt

ð1Þ

i¼1

T mi Here Ci ðtÞ ¼ p j¼1 Hi;j : Note the regularized complement of a half space is still a half space. Eq. (1) is called standard CSG form in this research; it expresses a CSG model with half spaces as its leaf nodes. 5. CSG equation and its root set. For a parametric CSG model CSGðtÞ; the expression CSGðtÞ ¼ B is defined as a CSG equation and its root set {tlCSGðtÞ ¼ B} is the parameter domain in which the model represents an empty space region. 6. CSG equation for checking the equivalency of two parametric CSG models. Given two CSG models, if they define the same space region, they are called equivalent. For two parametric CSG models, CSGA ðtÞ and CSGB ðtÞ; t [ Dt ; the following CSG equation is called the CSG equation for checking the equivalency of the two parametric CSG models. p

p

p

ðCSGA ðtÞ2 CSGB ðtÞÞ< ðCSGB ðtÞ2 CSGA ðtÞÞ¼B

ð2Þ

Suppose the root set of the above CSG equation is SAB ; then, the parameter domain in which they are equivalent is S ¼ Dt > SAB : If S is determined to be empty, CSGA ðtÞ and CSGB ðtÞ are not equivalent at all. Otherwise, they are equivalent for each parameter within S: Here, Dt is the parameter domain shared by the two models. If the two models are defined with different parameter vectors, e.g. t1 [ D1 and t2 [ D2 ; then, choose t ¼ ðt1 ; t2 Þ and Dt ¼ D1 £ D2 : 3.3. Properties Some properties directly derived from the above definitions are listed in the following. Property 1. If a CSG model represents a bounded space region, then, the terms Ci in its standard CSG form represent a bounded (or empty) region, too.

979

Property 2. If a CSG model represents a bounded space region, then, there exist 3 independent half spaces in each of its term Ci within its standard CSG form; this means, ’Hi;j1 ; Hi;j2 and Hi;j3 [ {Hi;1 ; Hi;2 ; …; Hi;mi }; so that l ai;j1

ai;j2

ai;j3 l – 0; ai;jk is the normal vector of Hi;jk ;

k ¼ 1; 2; 3 Here, l p l is a determinant. For simplicity, the CSG models discussed in this paper are supposed to be bounded. Property 3. The equivalent parameter domain S of CSGAA ðtÞ and CSGBB ðtÞ; t [ Dt ; can be expressed in the form: ! k \ ð3Þ S ¼ Dt > Si i¼1

Here, Si ¼ {tlCi ðtÞ ¼ B} ðCSGA ðtÞ 2p CSGB ðtÞÞ


k [ p

Ci ðtÞ

i¼1

Fig. 2 gives an example of the CSG equation. The two CSG models to be compared are shown, respectively, in Fig. 2a and b, the expression of the CSG equation for comparing them is given in Fig. 2c, and the space region represented by Ci ðtÞ in the equation is also illustrated in the figure. The types of the features in this example are all BLOCK, which consists of one convex polyhedron with 6 half spaces.

4. Theorems In this section, several theorems, which lay the theoretic foundation of algorithms for solving a CSG equation, are given. According to Eq. (3), the major issues needed to be addressed for solving a CSG equation include the following aspects: † How to reduce the numbers of Si in Eq. (3). Expanding a CSG expression to a standard form may produce a big number of Ci because of combinations among different features. This may make computation cost higher than acceptable. † How to generate inequalities which define the root sets Si for Ci ðtÞ ¼ B: In addition, the number of the inequalities should be as small as possible, considering computation efficiency. † How to efficiently solve the inequality system implied in Eq. (3), provided that Dt can also be expressed using a set of inequalities like Si :

980

Z. Huang et al. / Computer-Aided Design 36 (2004) 975–992

Fig. 2. CSG equation.

The third issue will be addressed in Section 5. Here, several important theorems that can be utilized to solve the problems for the two other issues are developed first. 4.1. Removing the redundant Ci The following two theorems show a way for removing redundant Ci in a CSG equation by checking inclusive relationships between two different Ci : Theorem 1. A term Ci in a CSG equation can be removed if one of the following conditions is satisfied: (a) There exist two half-spaces H1 and H2 in Ci so that H1 ðtÞ >p H2 ðtÞ ¼ B; ;t [ Dt : Here, Ci ðtÞ can be expressed in the form Ci ðtÞ ¼ Cr ðtÞ >p H1 ðtÞ >p H2 ðtÞ: (b) There exists a term Cj in the CSG equation so that Cj;1 ðtÞ $ Ci;1 ðtÞ; ;t [ Dt : Here, Cj ðtÞ ¼ Cr ðtÞ >p Cj;1 ðtÞ; and Ci ðtÞ ¼ Cr ðtÞ >p Ci;1 ðtÞ: Although the theorem is obvious, the algorithm based on the conditions in the theorem is efficient in removing redundant Ci in a CSG equation. The following theorem can be used to check the inclusion conditions in the above theorem in a limited scope. Theorem 2. Let C1 ðtÞ ¼ {xlA1 x þ B10 t þ B11 $ 0}; CP 2 ðtÞ ¼ {xlA x þ B t þ B $ 0}; t [ D ; and D ¼ {tlt ¼ 20 P 21 t t i ri v i P2 P þ j pj wj þ k lk qk ; ri [ R1 ; pj ; lk $ 0; l ¼ 1:} k k

If there exists a matrix M satisfying the following conditions, then, there is C1 ðtÞ $ C2 ðtÞ; ;t [ Dt : (a) (b) (c) (d) (e)

A1 ¼ MA2 ; M $ 0; ðB10 2 MB20 Þvi ¼ 0; ;i ðB10 2 MB20 Þwj $ 0; ;j; ðB10 2 MB20 Þqk þ ðB11 2 MB21 Þ $ 0; ;k:

Proof. From condition (a), there is the following equation: A1 x þ B10 t þ B11 ¼ MðA2 x þ B20 t þ B21 Þ þ ðB10 2 MB20 Þt þðB11 2 MB21 Þ: Thus, if ðB10 2 MB20 Þt þ ðB11 þ MB21 Þ $ 0 for all t [ Dt ; then there is C1 ðtÞ $ C2 ðtÞ; ;t [ Dt ; taking into account condition (b). Replace the expression of t in Dt into this inequality, then, the conclusion of this theorem can be reached if conditions (c –e) are satisfied. A Similarly, there is a method for checking the condition (a) in Theorem 1. Suppose H1 : aT1 x þ bT10 t þ b11 $ 0 and H2 : aT2 x þ bT20 t þ b21 $ 0: If there exists a constant m , 0 so that a1 ¼ ma2 and ðb10 2 mb20 ÞT t þ ðb11 2 mb21 Þ # 0 for all parameter t [ Dt ; then, the condition (a) is satisfied. With the same reason as that in the above theorem, this inequality can be guaranteed with conditions: ðb10 2 mb20 ÞT vi ¼ 0; ðb10 2 mb20 ÞT wj # 0 and ðb10 2 mb20 ÞT qk þ ðb11 2 mb21 Þ # 0; ;i; j; k: Although the parameter domain Dt is usually defined in an implicit form with a set of inequalities like Dt ¼ {tlAd t þ Bd # 0}; here, for the convenience of condition-checking, it is supposed to have an explicit form, which can be generated from the implicit form using the algorithm given later.

Z. Huang et al. / Computer-Aided Design 36 (2004) 975–992

4.2. Generating the inequalities defining Si In order to derive the inequalities that define the root set Si of term Ci in the CSG equation, here, a sufficient and necessary condition for Ci ¼ B is given. Theorem 3. Suppose C ¼ H1 >p H2 >p … >p Hm ðm . 3Þ; a term of a standard CSG expression, and Hi ði ¼ 1; 2; …; mÞ is a half space in R3 : Then, the following is a sufficient and necessary condition for C ¼ B : ðaÞ’i;j;k;l[{1;2;3;…;m}; Hi >p Hj >p Hk >p Hl ¼B:

ð4Þ

(b) At least three of Hi ; Hj ; Hk and Hl are independent. Proof. It is obvious that conditions (a – b) are sufficient for C ¼ B: The following is to prove that they are necessary, too. If H1 >p H2 >p … >p Hm ¼ B; there exist Hi1 ; Hi2 ; …; Hih [ {H1 ; H2 ; …; Hm } ð2 # h # mÞ that satisfy C0 – B and C0 >p Hih ¼ B where C0 ¼ Hi1 >p Hi2 >p … >p Hiðh21Þ : Suppose p0 is the nearest vertex of C0 away from Hih : Denote the normal vector of Hih as ah and the half spaces adjacent to p0 in C0 as Hp1 ; Hp2 ; …; Hpk ðk # h 2 1Þ: Then, from Hp1 ; Hp2 ; …; Hpk ; three or less half spaces can be identified, whose intersection has empty intersection with Hih ; in the following ways: Case 1. If there exists a Hpi whose normal vector api is the opposite direction of ah ; i.e. aph api ¼ 21; then, Hih >p Hpi ¼ B (see Fig. 3a). According to Property 2, there exist two other half spaces Hj and Hk [ {H1 ; H2 ; …; Hm } that make Hpi ; Hj and Hk independent while Hih >p Hpi >p Hj >p Hk ¼ B: Case 2. Otherwise, if there exists an edge ep;i which is perpendicular to ah ; i.e. aph ep;i ¼ 0; and Hpi and Hpðiþ1Þ are the two planes connected to edge ep;i ; then, Hih >p Hpi >p Hpðiþ1Þ ¼ B (see Fig. 3b). This is because p0 is the nearest vertex; Hih >p Hpi >p Hpðiþ1Þ – B if and only if there is a vertex on Hpi or Hpðiþ1Þ ; which is closer to Hih than p0 : According to Property 2, there exists another half space Hj [ {H1 ; H2 ; …; Hm } that make Hpi ; Hpðiþ1Þ and Hj independent while Hih >p Hpi >p Hpðiþ1Þ >p Hj ¼ B: Case 3. Otherwise, use a plane, perpendicular to ah ; to intersect with Hp1 ; Hp2 ; …; Hpk ; and form a convex polygon. If there exists a pair of parallel edges in the polygon

981

(see Fig. 3c), denote the two planes containing these two edges as Hpi and Hpj ; and choose one of planes in the e direction as Hpg ; here, e is the direction of the intersection line of Hpi and Hpj ; which satisfies aph e $ 0: Then, Hih >p Hpi >p Hpj >p Hpg ¼ B: Case 4. Otherwise, choose three edges which form a triangle containing the polygon. Denote Hpi ; Hpj and Hpg to be the three planes containing the three edges, respectively (see Fig. 3d). Then, Hih >p Hpi >p Hpj >p Hpg ¼ B: For cases 3 and 4, obviously, Hpi ; Hpj and Hpg are independent. So, conditions (a – b) are necessary for C ¼ B: The following theorem further develops the conditions in Theorem 3 into inequalities, which can be used to determine the root set of the CSG equations. Theorem 4. The intersection set of four linear half spaces in R3 ; at least three of which are independent, is empty if and only if the following conditions are satisfied: ðaÞ ðBp NÞ=Ni # 0 when Ni – 0; for i ¼ 1; 2; 3; 4:

ð5Þ

(b) The non-zero components of N have the same sign. Here, N ¼ ðN1 ; N2 ; N3 ; N4 Þ; N1 ¼ la2 a3 a4 l; N2 ¼ 2la1 a3 a4 l; N3 ¼ la1 a2 a4 l; N4 ¼ 2la1 a2 a3 l; A ¼ ½a1 a2 a3 a4 T [ R4£3 ; B [ R4 ; Ax þ B $ 0 represents the inequalities of the four half-spaces. l p l is a determinant. Proof. Suppose PðxÞ ¼ Ax þ B is the parametric representation for a super plane in R4 ; then, the parametric super plane PðxÞ can also be expressed in the implicit form ðP 2 BÞ p N ¼ PN 2 BN ¼ 0; here N ¼ ðN1 ; N2 ; N3 ; N4 Þ is the normal vector of the super plane. Since at least three of these linear half-spaces are independent, there is N – 0: If the intersections between the super plane PðxÞ and the four coordinate axes ðx1 ; 0; 0; 0Þ; ð0; x2 ; 0; 0Þ; ð0; 0; x3 ; 0Þ or ð0; 0; 0; x4 Þ in R4 exist, they should, respectively, be the following: xi ¼ ðBp NÞ=Ni ; i ¼ 1; 2; 3; 4: Since {xlAx þ B $ 0; x [ R3 } ¼ B means that super plane ðP 2 BÞp N ¼ 0 should not intersect with the axes in their positive side, or not pass through the origin into R4þ : Fig. 4 lists the five cases of the relationships between the super plane and R4þ : The cases (d –e) in the figure represent {xlAx þ B $ 0; x [ R3 } ¼ B; which is equivalent to conditions (a –b) of this theorem. A

Fig. 3. Non-intersecting half spaces in an empty term C:

982

Z. Huang et al. / Computer-Aided Design 36 (2004) 975–992

Fig. 4. The relationship between the super plane PðxÞ and R4þ :

T mi Corollary 1. Suppose Ci ðtÞ ¼ p j¼1 Hi;j ðmi . 3Þ is a term of a standard CSG expression, and Hi;j ðj ¼ 1; 2; …; mi Þ is a half space in R3 : Then, its root set Si ¼ {tlCi ðtÞ ¼ B} is the following: Si ¼

l [

Dh ;

h¼1

l # Cm4 i ¼

mi ! 4!p ðmi 2 4Þ!

Here Dh ¼ {tlðBp NÞ=Nk # 0 for a non-zero Nk };

ð6Þ

h ¼ 1; 2; …; l The above Dh s are a parameter sub-domain defined by only one inequality that is created from any four distinct half spaces in Ci ; for which N ¼ ðN1 ; N2 ; N3 ; N4 Þ – 0 and the non-zero components of N have the same sign. The same sign requirement for Ni in Corollary 1 means that if the intersection of half spaces includes a small open sphere when they are translated to the origin of the coordinate system (see Fig. 5a), then, their intersection will not be empty no matter where they originally are; otherwise (see Fig. 5b), their regularized intersection could be empty when they are separated by translation. The inequality in Eq. (6) becomes easier to solve when Ni or ai in Theorem 4, which are determined

by feature orientations, are fixed in a parametric model. Corollary 2. If orientations of features in a CSG equation are fixed, and their position and size attributes are a linear function of the CSG’s parameters, then, the inequality in (6) is also linear to the CSG’s parameters. Definition. If the inequality in (6) for a CSG equation is linear to the CSG’s parameters, then the CSG equation is called as a linear CSG equation. Thus, there is Dh ¼ {tlaTh t þ bh # 0} for a linear CSG equation.

4.3. Removing the redundant Si Obviously, a root set Si in Eq. (3) can be removed if Si $ Dt or if there exists another Sj so that Si $ Sj : The following theorem gives a method for checking these inclusive relationships. Theorem 5. Let Sg ¼ Dg;1 < Dg;2 < · · · < Dg;lðgÞ ; g ¼ i; j: (a) If Di;lðiÞ $ Dt > Dci;1 > Dci;2 > · · · > Dci;lðiÞ21 ; Si $Dt :

Fig. 5. Identifying an empty Dh through orientations of half spaces.

then,

Z. Huang et al. / Computer-Aided Design 36 (2004) 975–992

(b) If Di;lðiÞ $ Dj;h > Dci;1 > Dci;2 > · · · > Dci;lðiÞ1 ; for all h ¼ 1; 2; …; lðjÞ; then Si $ Sj : Proof. From Dt ¼ ðDt > Di;1 Þ < ðDt > Dci;1 Þ and Di;1 $ Dt > Di;1 ; it can be obtained that Si ¼ Di;1 < Di;2 < · · · < Di;lðiÞ $ Dt if and only if Di;2 < · · · < Di;lðiÞ $ Dt > Dci;1 : Continuing in this way for Di;2 ; …; Di;lðiÞ21 ; there is the conclusion (a). Similarly, the conclusion (b) can also be proven. Suppose Dt ¼ {tlAd t þ Bd # 0}: The complement Dci;k of Di;k can be expressed using one inequality like Di;k itself. Thus, Dci;1 > Dci;2 > · · · > Dci;lðiÞ21 and Dj;h > Dci;1 > Dci;2 > · · · > Dci;lðiÞ21 for all h ¼ 1; 2; …; lðjÞ have the form I ¼ {tlAt þ B # 0}: Let Di;lðiÞ is defined by aT t þ b # 0: Like Theorem 2, it can be proven that Di;lðiÞ $ I if there exists M $ 0 so that aT ¼ MA; b 2 MB # 0: For the special case of Si $ Sj that each inequality in Sj is the same as one of inequalities in Si ; only need to test if I ¼ B by checking whether I includes Dj;k and Dci;m at the same time when Dj;k ¼ Di;m : For the example in Fig. 2, its feature half space expressions can be generated using the formula given in Fig. 1b, which are listed as follows: 2

0

6 60 6 6 60 6 F1 : Ax þ 6 6 60 6 6 60 4 0

2

1

6 61 6 6 60 6 F2 : Ax þ 6 6 60 6 6 60 4 0

0:5

3

2

0

7 0 7 7 7 0 7 7 7$0 7 0 7 7 7 0 7 5

7 6 6 0:5 7 7 6 7" # 6 7 6 21 7 t1 6 7 6 þ 7 6 6 2 7 t 2 7 6 7 6 6 0 7 5 4

3

2

7 6 6 07 7 6 7" # 6 7 6 0 7 t1 6 7 þ6 7 6 6 17 7 t2 6 7 6 7 6 05 4

0

2 6 6 6 6 6 6 F5 : Ax þ 6 6 6 6 6 6 4

2

1

6 6 21 6 6 6 0 6 A¼6 6 6 0 6 6 6 0 4

0:5

6 6 0:5 6 6 6 0 6 F3 : Ax þ 6 6 6 0 6 6 6 0 4 0

0

0

0

0

0

0

1

0

0

0

0

0

0

3

3

7 0 7 7 7 0 7 7 7$0 7 0 7 7 7 0 7 5

21 1 0 0

0 0

20:5

0

0 1

0:5

0

0

21

0

1

0

0

0

0

0 0 1 21 0 0

0

2

3

2

72 3 6 6 1 07 6 7 t3 76 7 6 7 7 6 1 0 76 t4 7 6 6 76 7 þ 6 76 7 6 6 7 6 0 07 74 t5 5 6 6 7 6 0 07 4 5 t6

0

3

7 0 7 7 7 0 7 7 7$0 7 0 7 7 7 0 7 5 10

3

2

72 3 6 6 0 07 6 7 t3 76 7 6 7 7 6 0 1 76 t4 7 6 6 76 7 þ 6 76 7 6 6 7 6 0 07 74 t5 5 6 6 7 6 0 07 4 5 t6 0 0

0

3

7 0 7 7 7 0 7 7 7$0 7 0 7 7 7 0 7 5 10

3

7 0 7 7 7 0 7 7 7: 7 0 7 7 7 1 7 5 21

Si ¼

8 [

Dh ;

D1 ¼ {tlt3 # 0};

h¼1

D2 ¼ {tl 2 0:5t2 þ 0:5t3 # 0}; D4 ¼ {tlt3 2 t6 # 0};

72 3 6 6 07 6 7 t3 76 7 6 6 7 6 07 7 6 t4 7 6 76 7 þ 6 76 7 6 6 7 6 07 7 4 t5 5 6 6 7 6 07 4 5 t6 0

0

0 0

0

D6 ¼ {tlt4 # 0}; 2

0

The CSG equation in the example could originally be expanded to 1312 CðtÞ terms, but, using the redundancyremoval method presented in Theorems 1 and 2, only 30 of them are generated. After generating root sets for the 30 CðtÞ terms using the method given in Corollary 1, the number of root sets Si can be further reduced to 21 with the approach developed from Theorem 5. For the Ci ðtÞ in Fig. 2a, its root set Si is the following:

10

0

0:5

6 6 20:5 6 6 6 0 6 F4 : Ax þ 6 6 6 0 6 6 6 0 4

0

10

0

0

3

2

983

0 0 0 0 0 10

D3 ¼ {tl 2 t2 þ t4 # 0};

D5 ¼ {tlt3 2 t5 # 0}; D7 ¼ {tl 2 0:5t2 þ 0:5t3 2 t5 # 0};

3

D8 ¼ {tlt3 2 t5 2 t6 # 0}:

7 7 7 7 7 7 7$0 7 7 7 7 7 5

5. Algorithms In this section, an approach for generating the solution of a linear CSG equation is proposed. In the approach, the solution is expressed as a union of feasibility domains for

984

Z. Huang et al. / Computer-Aided Design 36 (2004) 975–992

a set of related inequality systems. It is expensive to independently solve these inequality systems. Taking advantage of the commonality among these related systems, the G-algorithm [22,23] is adopted to solve them. After the feasibility domains are determined, the parameter mapping relationships between two CSG models can also be created through the solution expression obtained. 5.1. Solution as the union of feasibility domains of a set of related inequality systems According to Eqs. (3) and (6), the solution of a linear CSG equation can be expressed in the following form: [ S¼ Pi1 ;i2 ;…;ik ð7Þ Here Pi1 ;i2 ;…;ik ¼ Dt > D1;i1 > D2;i2 > · · · > Dk;ik Si ¼ Di;1 < Di;2 < · · · < Di;lðiÞ ; i ¼ 1; 2; …; k Di;j ¼ {tlaTi;j t þ bi;j # 0}; Dt ¼ {tlAd t þ Bd # 0} Actually, most Pi1 i2 ;…;ik in Eq. (7) are empty because the number of its inequality constraints is much bigger than the parameter number. However identifying those non-empty Pi1 i2 ;…;ik needs to search the combination space of Di;j : As shown in Fig. 6, Pi1 i2 ;…;ik ; a portion of the solution S; is the solution of an inequality system which is composed of inequalities in Dt and inequalities in Di;j that is on a search path passing through the Di;j array from left to right without missing a column. Although the number of these inequality systems can be greatly reduced using the methods proposed in the theorems of Section 4, there could still be a big number of such systems that need to be solved; therefore, solving them one by one is expensive. Considering the following two facts is helpful for reducing the computation cost. † These inequality systems are related. For example, most systems share many common inequalities because a Di;j is passed through by many search paths. † For most cases, from a portion of inequalities in such a system, its solution can be determined to be empty; therefore, it is not necessary to solve the total systems.

Fig. 6. A search path among Di;j and its corresponding Pi1 i2 ;…;ik :

5.2. G-algorithm for incrementally solving a set of related inequality systems Castillo et al. [22,23] developed an algorithm, called Galgorithm, to solve an inequality system incrementally. For a given homogeneous inequality system AT t # 0; which may consist of a set of equations BT t ¼ 0 and a set of inequalities C T t # 0 when A has the form A ¼ {a1 ; a2 ; …; am } ¼ {Bl 2 BlC}; G-algorithm can generate two sets of vectors V ¼ {v1 ; v2 ; …} and W ¼ {w1 ; w2 ; …} for the solution of the system in the way: t ¼ P expressing P ri vi þ pi wi ; ri [ R1 ; pi [ Rþ : When a new inequality or an equation is added to the system, G-algorithm can update the vector set V and W to express the solution of the new system with relatively small computation cost compared to solving the new system from beginning. So, Galgorithm is thought as an incremental algorithm that is suitable for solving the related inequality systems for a linear CSG equation. The detail of the G-algorithm is given in Appendix A. For a heterogeneous system AT t þ b # 0; it can be transformed to a homogeneous one first by introducing additional temporary parameter component tnþ1 : " T #" # t A b #0 tnþ1 0 21 Then, force tnþ1 ¼ 1 after obtaining the solution for the homogeneous system. Generally, the solution for a heterogeneous system has the following form after making constraint tnþ1 ¼ 1 satisfied [22]: X X X rl vl þ pj wj þ lk qk ; rl [ R1 ; pj ; lk $ 0; t¼ l

X

j

k

lk ¼ 1

ð8Þ

k

5.3. Procedures for solving a linear CSG equation The procedure for solving a linear CSG equation includes the following steps: 1. Generate the CSG standard form from the CSG tree representation of the CSG equation. This step includes two sub-steps. One is to generate the Boolean expression in features: CSGðtÞ ¼

p F2i2 >p · · · >p Fnin : The other is to transform the Boolean expression in features to the CSG standard form. Procedure 1 gives the detail of the first sub-step, in which the Boolean expressions is generated iteratively from the leaf nodes to the root node. Procedure 2 shows how the CSG standard form for a term in the above Boolean expression is generated in the second substep, where the methods given in Theorems 1 and 2 are applied to remove redundant Ci :

Z. Huang et al. / Computer-Aided Design 36 (2004) 975–992

985

Procedure 1. Generating Boolean expression in features from a CSG tree.

2. Generate inequalities for Di;j ði ¼ 1; 2; …; k; j ¼ 1; 2; …; lðiÞÞ: In this step, the method developed in Theorems 3 and 4 and Corollary 1 is adopted to generate inequalities in Di;j of Si for each Ci in the CSG standard form and the method given in Theorem 5 is further used to remove the redundant Si : Procedure 3 is for the generation of the root set Si : 3. Search the Di;j array to identify the non-empty Pi1 i2 ;…;ik (see Fig. 6), incrementally solve the inequality system for Pi1 i2 ;…;ik using the G-algorithm, and express the solution in the form of Eq. (8) if there is a solution. The detail of this process is given in Procedure 4. In this procedure, the search is carried out in the breadth-first manner because it facilitates the incremental redundancy-removal among all the paths ending at each Si : Here, a path is redundant if its inequalities include all the inequalities of some other paths. 4. Separate the parameters for model CSGA and model CSGB and create the mapping relationships between them. Firstly, the parameter vector t ¼ ðt1 ; t2 ; …; tn Þ is divided into two parts tA ¼ ðt1 ; t2 ; …; tm Þ and tB ¼ ðtmþ1 ; tmþ2 ; …; tn Þ: For each non-empty Pi1 i2 ;…;ik ; its solution expression (8) is

rewritten in the way tA ¼ C1 s; tB ¼ C2 s; s ¼ ðr; p; lÞ: There are two cases for creating the mapping: a. When dimðsÞ # dimðtA Þ; let tA ¼ ðtA;1 ; tA;2 Þ; tA;1 ¼ C1;1 s; tA;2 ¼ C1;2 s; lC1;1 l – 0; and then, the mapping from tA to tB is the following: 21 tB ¼ ½C2 C1;1 0tA

tA [Deq;A ¼{tA ltA ¼C1 s;21, ri ,þ1;pj ; lk $0; Slk ¼1} b. Otherwise, let s ¼ ðs1 ; s2 Þ; tA ¼ C1;1 s1 þ C1;2 s2 ; tB ¼ C2;1 s1 þ C2;2 s2 ; lC1;1 l – 0; and then, the mapping from tA to tB is the following: 21 21 tB ¼ C2;1 C1;1 tA þ ½C2;2 2 C2;1 C1;1 C1;2 s2

tA [Deq;A ¼{tA ltA ¼C1 s;21, ri ,þ1;pj ; lk $0; Slk ¼1}; s2 [ {s2 ltA ¼ C1;1 s1 þ C1;2 s2 ; tA [ Deq;A } Here, Deq;A is the equivalent parameter domain for model CSGA : Similarly, the equivalent parameter domain Deq;B for model CSGB ; and the mapping from tB to tA can be

Procedure 2. Generating the CSG standard form for a term in the Boolean expression in features.

986

Z. Huang et al. / Computer-Aided Design 36 (2004) 975–992

Procedure 3. Generating the root set Si for a term Ci in the CSG standard form.

obtained. During the implementation, the above matrices can be generated using iterative matrix transformations like those in the Gaussian-Elimination Method. It is worth to notice that the mappings may not necessarily be one-to-one because the nature of relationship between the parameters of two models is complicated. Usually, the case (a) gives a many-to-one mapping and the case (b) gives a one-to-many. The many-to-many mappings are not discussed here, which are correspondent to the situation lC1;1 l ¼ 0 in both the case (a) and (b). For the example in Fig. 2, only one path is remained when the search procedure ends, which produces one solution: t ¼ ðt1 ; t2 ; …; t6 Þ ¼ pð3; 2; 6; 4; 2; 2Þ p $ 0

The mapping between ðt1 ; t2 Þ and ðt3 ; t4 ; t5 ; t6 Þ is the following: 2

t3

3

2

2

6 7 6 6 t 7 6 1:333 6 47 6 6 7¼6 6 7 6 6 t5 7 6 0:666 4 5 4 0:666 t6

0

3

7" # 07 7 t1 7 ; 7 07 5 t2 0

ðt1 ; t2 Þ [ Deq;A ¼ {ðt1 ; t2 Þlðt1 ; t2 Þ ¼ pð3; 2Þ; p $ 0} Here, Deq;A is the parameter domain of model CSGA ; in which models CSGA and CSGB are equivalent and the above expression gives their parameter relationships.

Procedure 4. Searching for the solutions in the Di;j array.

Z. Huang et al. / Computer-Aided Design 36 (2004) 975–992

987

6. Implementation

6.2. Examples

In this section, a description of the program coded according to the methodologies given above and the results from running the program to two examples are presented.

The above approach has been applied to the following two examples, in which, the model CSGA represents the design of a part while the model CSGB ; represents the operations used to machine the part in a process plan. The solutions generated include the equivalent parameter domains and parameter mappings, which can help part designers or process planners to choose their parameters while considering the requirements of the others. Here, the first example only has one solution while the second has multiple solutions. Fig. 8 shows the first example. In the example, the model CSGA is composed of six positive features while the model CSGB is formed from one positive feature and three negative features. The two models both are parametric and they, respectively, have three and seven parameters. Using the program, it can be determined that they are equivalent in the parameter domain Deq;A ; which is shown in Fig. 8c. The equivalent parameter domain is obtained from the solution data (see Table 1); Deq;A is the convex polyhedron whose vertex coordinates are the data in the columns of CSGA s parameters in Table 1. The parameter mapping is given in Table 2, from which the equivalent CSGB parameters tB can be determined for each CSGA parameter vector tA in Deq;A : For example, for tA ¼ ð2; 8; 5Þ [ Deq;A ; it is easy to identify the simplex to which tA belongs and the tA s expression related to the four vertices of the simplex tA ¼ð18=72Þ ð0;2;0Þþð37=72Þð0;10;8Þþð9=72Þð0;10;0Þþð8=72Þð18;10;8Þ: According to Table 1, there are l1 þ l4 ¼9=72; l2 þ l7 ¼ 18=72 and l3 þ l9 ¼37=72; thus, from Table 2, there is tB ¼ 2c1 þ8c2 þ5c3 þ l4 p4 þ l7 p7 þ l9 p9 þp0 ; 0# l4 #9=72; 0#

6.1. Implementation flowchart The approach presented in this paper has been implemented using Microsoft Visual Cþ þ . Fig. 7 shows the flowchart of the implementation. The input of the program includes two CSG model files and a feature type definition file. The data of the model file consist of the CSG nodes in the CSG tree, the information of features at the leaf nodes, the matrices representing the mappings from the part parameters to feature attributes and the inequalities defining the part parameter domain. The file used for defining feature types has the data of matrices that give the mappings from the feature dimensions to the feature’s half space representation within the local coordinate system at the origin of the feature (see Fig. 1). Firstly, the program generates the expressions of Boolean combinations of features in the CSG equation that is formed from the two input model files, and converts the expressions into the CSG standard forms, that is, the expressions of Boolean combinations of half spaces. Secondly, the program generates the inequalities of the root sets for each term in the standard form. After this, the program searches the inequality array that is formed with the root sets, identifies the search paths that represent the non-empty solutions, and transform the solutions into parameter mappings. Finally, output the solutions in the form of Eq. (8) and the matrices for parameter mappings.

Fig. 7. Implementation flowchart.

988

Z. Huang et al. / Computer-Aided Design 36 (2004) 975–992

Fig. 8. Example of the CSG equation that has only one solution.

l7 #18=72; 0# l9 #37=72: So, tA is mapped to multiple tB : When choose l4 ¼ l7 ¼ l9 ¼0; CSGA ðtA Þ is equivalent to the CSGB in which the width of F8 ; that is t5 ; reaches its maximum value 15.554; in contrast, when l4 ¼9=72; l7 ¼ 18=72 and l9 ¼37=72; it is equivalent to the model in which the width reaches its minimum value 5.656. The second example is given in Fig. 9. Similarly, the model CSGA only includes positive features while the model CSGB is composed of 1 positive BLOCK feature and three other negative features. Although they seem different,

they could be equivalent when their parameters are constrained within some domains. Using the program, there are eight solutions found, which are correspondent to eight different search paths in Procedure 4. Fig. 9c shows the equivalent parameter domains and the model match situations in these eight solutions. Although all the equivalent parameter domains for CSGA are bounded, those for CSGB could be bounded or unbounded. Actually, the different solutions are just related to the different ranges of parameter variations in CSGB ; like parameter t6 and t9 :

Table 1 P P The solution of the first example (t ¼ 9k¼1 lk qk ; lk $ 0; k lk ¼ 1Þ

q1 q2 q3 q4 q5 q6 q7 q8 q9

t1

t2

t3

t4

t5

t6

t7

t8

t9

t10

0.00 0.00 0.00 0.00 10.0 18.0 0.00 18.0 0.00

10.0 2.00 10.0 10.0 2.00 10.0 2.00 10.0 10.0

0.0 0.0 8.0 0.0 0.0 0.0 0.0 8.0 8.0

29.0 25.0 29.0 20.0 20.0 20.0 20.0 20.0 20.0

15.556349 21.213203 15.556349 2.8284270 14.142136 2.8284270 14.142136 2.8284270 2.8284270

21.920310 24.748737 21.920310 15.556349 21.213203 15.556349 21.213203 15.556349 15.556349

25.0 25.0 25.0 25.0 20.0 16.0 25.0 16.0 25.0

30.0 30.0 30.0 30.0 20.0 12.0 30.0 12.0 30.0

0.00 16.0 0.00 0.00 16.0 0.00 16.0 0.00 0.00

40.0 40.0 32.0 40.0 40.0 40.0 40.0 32.0 32.0

Z. Huang et al. / Computer-Aided Design 36 (2004) 975–992

989

Table 2 P The parameter mapping of the first example ðtB ¼ 3i¼1 ci ti þ l4 p4 þ l7 p7 þ l9 p9 þ p0 Þ

c1 c2 c3 p0 p4 p7 p9

t4

t5

t6

t7

t8

t9

t10

20.50 0.50 0.00 24.0 29.00 25.00 29.00

20.7071070 20.7071070 0.0000000 22.627417 212.727922 27.0710680 212.727922

20.3535530 20.3535530 0.0000000 25.455844 26.3639610 23.5355340 26.3639610

20.50 0.00 0.00 25.0 0.00 0.00 0.00

21.00 0.00 0.00 30.0 0.00 0.00 0.00

0.00 22.00 0.00 20.0 0.00 0.00 0.00

0.00 0.00 21.00 40.0 0.00 0.00 0.00

Note: p0 ¼ ðl1 þ l2 þ · · · þ l18 Þp0

Tables 3 and 4 give the data of the fourth solution P4 : From this example, it can be seen that the CSG equation may have multiple solutions and different solutions usually represent different match situations between the two models to be compared, though the same match situation may be related

to more than one solution like P1 and P2 because of the nonuniqueness of parametric representations. For the first example, the program generates 25 terms for the Boolean expression in features, 84 terms for the CSG standard form, 20 root sets after removing redundant Si and

Fig. 9. Example of the CSG equation that has multiple solutions.

990

Z. Huang et al. / Computer-Aided Design 36 (2004) 975–992

Table 3 P P The solution P4 of the second example (t ¼ p1 w1 þ 18 k lk ¼ 1) k¼1 lk qk ; p1 $ 0; lk $ 0;

w1 q1 q2 q3 q18

t1

t2

t3

t4

t5

t6

t7

t8

t9

t10

0.000000 0.000000 0.000000 0.000000 0.000000

0.000000 0.000000 0.000000 20.00000 20.00000

0.000000 0.000000 0.000000 20.00000 0.000000

0.00000 40.0000 40.0000 40.0000 25.0000

0.0000000 28.284271 28.284271 0.0000000 7.0710680

1.000000 42.42640 42.42640 28.28427 31.81981

0.000000 40.00000 40.00000 20.00000 15.00000

0.000000 0.000000 0.000000 0.000000 10.00000

0.000000 0.000000 40.00000 0.000000 10.00000

0.000000 20.00000 20.00000 20.00000 20.00000

Table 4 P P The parameter mapping of P4 in the second example ðtB ¼ 3i¼1 ci ti þ p1 u1 þ i[{1;…;17} – {1;3;8} li pi þ p0 Þ

c1 c2 c3 u1 p0 p2 … p17

t4

t5

t6

t7

20.500000 20.750000 0.7500000 0.0000000 40.000000 0.0000000

20.707107 21.060660 20.353553 0.000000 28.28427 0.000000

20.353553 20.530330 20.176777 1.000000 42.42641 0.000000

5.0000000

7.071068

3.535534

20.500000 21.250000 0.2500000 0.0000000 40.000000 0.0000000 … 5.0000000

t8 1.000000 0.500000 20.50000 0.000000 0.000000 0.000000 210.0000

t9

t10

1.000000 0.500000 20.500000 0.000000 0.000000 40.00000

21.000000 0.0000000 20.000000 0.000000 20.000000 0.000000

10.000000

20.000000

Note: p0 ¼ ðl1 þ l2 þ · · · þ l18 Þp0 .

1 solution. The whole run lasts 14.891 s on a PC with Intel Pentium III 697 MHz/256MB processor. On the same machine, the run for the second example takes 1025.294 s, and it produces 13 terms for the Boolean expression in features, 54 terms for the CSG standard form, 18 root sets after removing redundant Si and eight different solutions.

7. Discussion The main contributions of this research are the approach for generating the inequalities that define the equivalent parameter domain of two parametric polyhedral models and the algorithms for solving the inequalities when the inequalities are linear. Here, the parametric models can be design-feature-based or machining-feature-based; the former represents a part design while the later represents a machining process. So, the methods developed here can be used to compare two different part designs and two different machining processes, and compare a part design with a machining process. Usually, a parametric model is a solution that satisfies the requirements its designer or planner specifies; therefore, the model with the equivalent parameter domain produced by the method actually gives a solution satisfying the different requirements from different designer(s) and/or planner(s). So, there is a potential to use the method in the software that supports collaboration in product development. In addition, the parameter mappings generated with the method can help part designers to calculate the process parameters, which might assist them to evaluate the manufacturing cost, of a part design besides checking its manufacturability with respect to a currently available process, and also can help process planners to

realize the parts with what feature structures and with what sizes the process they currently design can machine. This means that it is possible to apply the method to support the interoperation between part design and process planning. Another application is the comparison of different machining process alternatives that may correspond to different selections of machining feature types or different decompositions of machining feature states; the parameter mappings generated in the method are helpful in determining the process parameters from one to another. While this research presents a novel approach for checking the equivalency of two parametric models, it does not address the efficiency problem as a whole. The major factor that affects the efficiency of the method is the number of inequalities generated for the definition of the equivalent parameter domain. Although there are several approaches that have been proposed in this research to reduce the inequality number, such as the methods for removing redundant CðtÞ; SðtÞ and searching paths, the number of inequalities could still be big for complex models. However, it is not impossible to improve this situation. For example, some obvious feature face matches can be identified first through a rough comparison, then, the root set for the term CðtÞ including these matched faces can be reduced to include only the inequality generated from the matched faces with two other half spaces in the CðtÞ: Another factor that is important for the efficiency of the method is the inequality order in which the G-algorithm solves the inequalities because the algorithm is sensitive to it. A rearrangement of the columns of the Di;j array upon a beforehand analysis is helpful for the efficiency improvement. Due to lack of space, we do not elaborate upon the above two issues here.

Z. Huang et al. / Computer-Aided Design 36 (2004) 975–992

Equivalency checking with parameter mapping generation is a hard task; this research only considers polyhedral models with fixed feature orientations. However, there still exist a couple of ways to extend the method. If let feature orientations be variable, the inequalities defining the equivalent parameter domain will be nonlinear. For nonlinear inequalities, one way to solve them is to use a union of intersections of linear half spaces to approximate the nonlinear half space represented by each of the nonlinear inequalities in the parameter space and then to adopt the method developed here to solve the linear inequalities representing the linear half spaces obtained from the linearization. Similarly, the linearization approach can also be applied to the transformation from polyhedral models to non-polyhedral models. Although this research only takes two parts into account for the equivalency checking, it is possible to extend the method for the case of more than two parts. While equivalency is a transitive property in general, the equivalent parameter domains with different parts may different; therefore, the main goal of the equivalency checking for multiple parts is to determine the common equivalent parameter domain, which can be obtained by iteratively applying the method in this research to one part with all the other parts, making the parameter domain of the part shrink to the new equivalent parameter domain each time. Although there exist possibilities to improve and extend the method, extensive efforts are still necessary for achieving the goals. The future work includes the following aspects: † † † † †

Extend the method to non-linear CSG equations. Extend the method to non-polyhedral parametric models. Extend the method to implicit parameter models. Extend the method to the case of more than two models. Improve the efficiency of the method.

8. Conclusions As more and more parts, even whole products, are modeled using parametric CAD systems, engineers in the downstream of product development cycle, like process planning, cannot carry out their tasks without handling parametric models. Checking the equivalency between two parametric models is one of these needs. Especially, it is essential for the integration of part design with process planning at the part-process level, when the capability envelope of a process is represented using a set of finished workpiece models with parametric features. In this paper, for two polyhedral feature models with explicit parameterization, the inequalities that define their equivalent parameter domains are derived from their CSG representations. Furthermore, for the parametric models with fixed feature orientations, the approaches for removing the redundant inequalities and the algorithm for solving the remaining

991

inequalities are developed. The final solution includes the equivalent parameter domains and parameter mappings that associate these two models, which are useful for enhancing the interoperability between the two product development areas the two models, respectively, related to.

Acknowledgements The authors gratefully acknowledge the financial support of grant #50275060 from the National Science Foundation of China (NSFC), under which the present research was possible.

Appendix A

G-algorithm for incrementally solving an inequality system Input. Coefficient vectors A ¼ {a1 ; a2 ; …; am } ¼ {BlC} for an inequality system with its solution set S ¼ {xlAT x # 0} ¼ {xlBT x ¼ 0 and C T x # 0}; x [ Rn : Output. V ¼ {v1 ; v2 ; …} and W ¼ {w1 ; w2 ; …};Pwhich are S in the form: S ¼ {xlx ¼ ri vi þ P used to express pi wi ; ri [ Rn ; pi [ Rþ }: Initialization. Let V ð0Þ ¼ In ; W ð0Þ ¼ B; and U ð0Þ ¼ ð0Þ ðV lW ð0Þ Þ; where In is the identity matrix of dimension n: Let IAðuj Þ ¼ B; j ¼ 1; 2; …; n; h ¼ 1; and U ð1Þ ¼ U ð0Þ : Step 1. Calculate th ¼ aTh U ðhÞ : h – 0Þ among those Step 2. Find a pivot column ðtpivot ðhÞ columns in V : Step 3. If no pivot has been found, go to Step 5. Otherwise go to Step 4. Step 4. Normalize the pivot column by dividing it by h : Perform the pivoting process by letting uhij ¼ 2tpivot h h h uij þ tj ui;pivot for all j – pivot: Append the index h to the IAðuj Þ sets for all j – pivot: If ah [ B; remove vector uhpivot from V ðhÞ and go to Step 6, Otherwise, remove uhpivot from V ðhÞ ; and add it to W ðhÞ : Then, go to Step 6. Step 5. Append the index h to the IAðuj Þ sets for all j such that tj ¼ 0 and uj [ V ðhÞ : Determine the sets I 2 ¼ {ilwTi ah , 0}; I þ ¼ {ilwTi ah . 0}; and I 0 ¼ {ilwTi ah ¼ 0}; where wi [ W ðhÞ ; and append to IAðwi Þ the index h for all i [ I 0 : If ah [ B; remove from W ðhÞ all wi such that i [ I – or i [ I þ : Otherwise, if I þ ¼ B; then go to Step 6. Otherwise, for each i [ I 2 and j [ I þ build the sets IAðwij Þ ¼ ðIAðwi Þ > IAðwj Þ Þ < {h}: If there are no indices p [ I – ; q [ I þ ; k [ I 0 ; such that IAðwij Þ # IAðwpq Þ and IAðwij Þ # IAðwk Þ ; then append to W ðhÞ the vector wij ¼ tjh wi -tih wj : This vector is associated with the set IAðwij Þ : Next, remove from W ðhÞ all wi such that i [ I þ : Step 6. If h , m; let h ¼ h þ 1 and go to Step 1; otherwise, return matrix V ðhÞ and W ðhÞ ; and exit.

992

Z. Huang et al. / Computer-Aided Design 36 (2004) 975–992

References [1] Huang Z, Yip-Hoi D, Zhou J. A graph-based approach for capturing the capability envelope of a machining process. ASME J Manuf Sci Engng 2003;125(2):272–88. [2] Shapiro V, Vossler DL. What is a parametric family of solids? Proceedings of the Third ACM Symposium on Solid Modeling and Applications, Salt Lake City, Utah, USA; 1995. p. 43–54. [3] Chen X, Hoffmann CM. On editability of feature-based design. Comput-Aided Des 1996;27(12):905 –14. [4] Capoyleas V, Chen X, Hoffmann CM. Generic naming in generative, constraint-based design. Comput-Aided Des 1996;28(1):17–26. [5] Kripac J. A mechanism for persistently naming topological entities in history-based parametric solid models. Comput-Aided Des 1997; 29(2):113– 22. [6] Bidarra R, Bronsvoort WF. On families of objects and their semantics. Proceedings of IEEE Geometric Modeling and Processing, April 10 – 12, 2000, Hong Kong, China, IEEE Computer Society, CA, USA; 2000. p. 101–11. [7] Bidarra R, Bronsvoort WF. Semantic feature modeling. ComputAided Des 2000;32:201 –25. [8] Hoffmann C, Kim K-J. Towards valid parametric CAD models. Comput-Aided Des 2001;33(1):81 –90. [9] Raghothama S, Shapiro V. Boundary representation deformation in parametric solid modeling. ACM Trans Graphics 1998;17(4):259– 86. [10] Raghothama S, Shapiro V. Consistent updates in dual representation systems. Comput-Aided Des 2000;32:463–77. [11] Raghothama S, Shapiro V. Topological framework for part families. Proceedings of the seventh ACM Symposium on Solid Modeling and Applications, Saarbrucken, Germany; 2002. p. 1 –12. [12] Light R, Gossard D. Modification of geometric models through variational geometry. Comput-Aided Des 1982;14(4):209 –14. [13] Verroust A, Schonek F, Roller D. Rule-oriented method for parameterized computer-aided design. Comput-Aided Des 1992; 24(3):221–33. [14] Fudos I, Hoffmann CM. A graph-constructive approach to solving systems of geometric constraints. ACM Trans Graphics 1997;16(2): 179–216. [15] Kondo K. Algebraic method for manipulation of dimensional relationships in geometric models. Comput-Aided Des 1992;24(3): 141–7. [16] Gupta SK, Nau DS. Systematic approach to analyzing the manufacturability of machined parts. Comput-Aided Des 1995;27(5): 323–42. [17] Regli WC, Cicirello VA. Managing digital libraries for computeraided design. Comput-Aided Des 2000;32:119–32. [18] Huang Z, Yip-Hoi D. High-level features recognition using feature relationship graphs. Comput-Aided Des 2002;34:561 –82. [19] Lee J-Y, Kim K. A feature-based approach to extracting machining features. Comput-Aided Des 1998;30(13):1019– 35. [20] Li WD, Ong SK, Nee AYC. Recognizing manufacturing features from a design-by-feature model. Comput-Aided Des 2002;34(11):849– 68.

[21] Lee JY, Kim K. Generating alternative interpretations of machining features. Int J Adv Manufact Technol 1999;15:38–48. [22] Castillo E, Cobo A, Jubete F, Pruneda RE, Castillo C. An orthogonally based pivoting transformation of matrices and some applications. SIAM J Matrix Anal Appl 2000;22(3):666–81. [23] Castillo E, Jubete F, Pruneda RE, Solares C. Obtaining simultaneous solutions of linear subsystems of inequalities and duals. Linear Algebra Appl 2002;346:131– 54.

Zhengdong Huang is an associate professor in the CAD center at Huazhong University of Science and Technology (HUST), China. He worked as a post-doctor in the ERC for Reconfigurable Machining Systems at the University of Michigan, Ann Arbor, from 1998 to 2002. He received his BS degree in Computational Mathematics from Wuhan University, his MS degree in Applied Mathematics from Zhejiang University and his PhD degree in Mechanical Engineering from HUST. His research interests include CAD/CAM, computer aided process planning, computer graphics and its applications in manufacturing.

Shaopeng Tian is a PhD student in School of Mechanical Science and Engineering at Huazhong University of Science and Technology. His research interests include computer-aided design, computer graphics and computer-aided process planning. He received a BS and a MS in Auto Engine from Wuhan University of Technology in 1993 and 1997, respectively.

Ji Zhou is a professor of mechanical engineering at Huazhong University of Science and Technology (HUST). His research interests include optimal design, intelligent CAD and computer integrated manufacturing system. He received his BS degree in mechanical engineering from Tsinghua University and his MS degree in mechanical engineering from HUST. He received his PhD degree in mechanical engineering from New York State University at Buffalo.