Realize automatically calculating the structured data of product by interconnection constraint multiaxis simulation figure
Technical field
The present invention relates to computer program and industrial design field, be specifically related to the method for Design of Industrial Product, algorithm, bag
Include the structured data using two-dimentional interconnection constraint multiaxis simulation figure based on directed graph to realize automatically calculating product.
Background technology
Commercially provide for object is designed, engineering, multiple system and programs of manufacture.CAD is computer
The abbreviation of Aided Design, such as, it relates to the software solution of design object, and conventional CAD systems typically requires user
Structure input by sentence geometric figure, but the constructivity of some figure describes and is not easy to, in order to make up conventional CAD systems not
Foot, preferably meets the requirement of conceptual design, improves design efficiency, is attempted to introduce thought and the method for artificial intelligence
Intelligent CAD is formed in CAD system.The principal character of intelligent CAD and mark are parametrization and variable design.
The parametric technology that later stage occurs has been firstly introduced the concept of constraint, and parametric technology is by one group of parameter and control zero
One group of physical dimension sequence of component geometry figure is corresponding, when giving different parameter values, it is possible to produce a series of tool
There are the parts of similar geometry figure.The feature of parametrization Solid Modelling is: design based on features, full-scale constraint,
Total according to relevant, the amendment of Dimension Drive design.
Variation technology is the once leap of parametric technology.Variation technology is complete as one by whole designing draft
System consider, unrelated with the order of construction process, the control size in sketch and topological relation are all represented with constraint,
It is fully defining that this makes the sketch at design initial stage can not be, and becomes not having fully defining control size and topological relation
Amount stores, temporarily with current drafting size assignment.Designer can any stage to any size in sketch and
Topological relation redefines, and the most this redefining also need not involve the change of all geometry entities in sketch.Variable
The mode of flexible more this model that change technology provides effectively supports the conceptual design of CAD, can make the creation of designer
Power and imaginative power are played more fully.
The core of parametric technology and Variation technology is once some sizes and topological relation given designing draft,
System just can automatically generate corresponding design drawing, and the process of this Geometric Constraint Solving can be understood as the automatic of geometric construction
Change process.
Summary of the invention
The technical problem to be solved in the present invention is to provide one to realize automatically pushing away by interconnection constraint multiaxis simulation figure
Calculating the structured data of product, use two-dimensional constrains based on directed graph to solve, vertex representation geometric element, while represent constraint, about
Bundle figure will be mutually related all of geometry together with constraint relationship.
In order to solve above-mentioned technical problem, the present invention is accomplished by:
Realize automatically calculating the structured data of product by interconnection constraint multiaxis simulation figure, it specifically includes following step
Rapid:
1) select to set up the constraints graph that product is made up of summit and binding side;
2) Planar Mechanisms judgement is carried out according to the constraint direction arbitrarily chosen in constraints graph;
3) constraints graph of structure is carried out confined equilibrium;
4) constraint solving sequence is carried out according to the constraints graph after adjusting confined equilibrium.
In order to improve the interaction design ability of system, and avoiding the appearance of Planar Mechanisms situation, it is complete that the present invention proposes geometry
Full definition status (state when shape of geometry and position determine completely), the judgement meeting following all conditions is that geometry is complete
Definition status:
(1) there is not Planar Mechanisms in the front commitments bundle of geometric object;
(2) the residue degree of freedom of geometric object is 0;
(3) in constraints graph, reversely commitments bundle before any one of this geometry, utilizes confined equilibrium method, the most all loses
Losing, i.e. all front commitments bundle of this geometric object all cannot be reverse.
For above-mentioned steps 2) in Planar Mechanisms judge for, its concrete determination methods is as follows:
(21), then there is Planar Mechanisms in confined equilibrium failure;The most there is not Planar Mechanisms;
(22), after confined equilibrium failure, in constraints graph, all reverse failed constraints are all Planar Mechanisms;
(23) geometric object that Planar Mechanisms points to is all the geometric object at Planar Mechanisms place.
For above-mentioned steps 3) in confined equilibrium, its concrete confined equilibrium method step is as follows:
(31) definition summit (residue degree of freedom is less than the summit of 0 or afoul constraint tramsfer summit) was first found;
(32) in the front commitments bundle crossing definition summit, select a constraint and carry out reversely, it is desirable to after reversely, cross definition summit
Be no longer definition summit, after inverted constraint, entered step (33), if commitments bundle can be reverse before not suitably, then divide below
Two kinds of situations:
(321) if that crosses that definition summit is because that inverted constraint causes crosses definition summit, then recover the direction of constraint, weight
The newly selected one suitably before hold constraint direction, carry out step (32);
(322) if crossing definition summit is that initial that crosses definition summit, then there is Planar Mechanisms, confined equilibrium in this constraints graph
Failure;
(33) the constraint tramsfer summit being reversed, if transmission summit was not the summit of definition, then confined equilibrium success, i.e.
Constraints graph adjusts successfully, and constraints graph does not exist Planar Mechanisms;If transmission summit was definition summit, definition was treated as on transmission summit
Summit, proceeds step (32).
For above-mentioned steps 4) in constraint solving sequence concrete grammar as follows:
(41) the transmission summit I that a newly added or new amendment retrains is selected;
(42) as one, transmission summit I is solved queue element (QE) putting into solve at the tail of the queue of queue;
(43) the transmission constraint of traversal transmission summit I, if the transmission constraint of transmission summit I all travels through complete, then goes to step
Suddenly (48), otherwise, choose a transmission constraint I not traveled through, obtain the transmission summit II of transmission constraint I;
(44) if transmission summit II is not in solving queue, then the father vertex of record transmission summit II, will transmission summit II
As new transmission summit I, go to step (42);If summit II is in solving queue in transmission, obtain transmitting the father vertex of summit I
For transmitting summit III, then empty transit shed, transmission summit I is pressed into transit shed;
(45) transmission summit III is pressed into transit shed, if transmission summit III is exactly transmission summit, summit II, or transmission
Summit III, transmission summit II belong to same solve queue element (QE) (explanation solve in queue from transmission summit II to transmission summit
The summit of I constitutes loop), go to step (46), otherwise, by the father vertex of transmission summit III as new transmission summit
III, goes to step (45), if transmission summit III does not has father vertex (i.e. transmission summit III is starting point), goes to step (47);
(46) adjustment solves queue, the queue element (QE) at transit shed inner vertex place is merged into one, new queue element (QE)
Element is placed in and solves the position transmitting II place, summit queue element (QE) in queue, goes to step (43);
(47) if solving in queue, after transmission II place, summit queue element (QE) comes transmission I place, summit queue element (QE), turn
To step (43), otherwise, adjust and solve queue, summit II place queue element (QE) will be transmitted and transmit about along transmission summit II
After the queue element (QE) at the place, all summits that Shu Fangxiang traverses comes the queue element (QE) at transmission I place, summit, go to step
(43);
(48) if transmission summit I does not has father vertex (i.e. transmission summit I is starting point), then algorithm so far terminates;If transmission
Summit I has father vertex, then return the father vertex of transmission summit I, by the father vertex of transmission summit I as new transmission summit I, turns
To step (43).
Compared with prior art, the present invention is had the advantages that
Proposed by the invention based on constraints graph, geometric element and constraint are associated together, are retrained by balance,
Carry out the judgement of Planar Mechanisms, it is to avoid geometry cross definition cause without solving equations calculating;Carry out the fully defining state of geometry
Judging, the design work for designer provides foundation, improves Human-computer Interactive Design efficiency;By solving Queue Algorithm, by complexity
Constraints graph decomposes, and improves solving speed, efficiency, it is achieved constraint solving, solves the problem of management of Complex Constraints information.
Accompanying drawing explanation
Fig. 1 a is the geometric representation constructed by the present invention;
Fig. 1 b is the constraint schematic diagram of Fig. 1 a;
Fig. 2 a is fully defining condition adjudgement geometric representation;
Fig. 2 b is the constraint schematic diagram of Fig. 2 a;
Fig. 3 a is that Planar Mechanisms judges geometric representation;
Fig. 3 b is the constraint schematic diagram of Fig. 3 a;
Fig. 4 a is the confined equilibrium schematic diagram I of constraints graph in the present invention;
Fig. 4 b is the confined equilibrium schematic diagram II of constraints graph in the present invention;
Fig. 4 c is the confined equilibrium schematic diagram III of constraints graph in the present invention;
Fig. 4 d is the confined equilibrium schematic diagram IV of constraints graph in the present invention;
Fig. 4 e is the confined equilibrium schematic diagram V of constraints graph in the present invention;
Fig. 4 f is the confined equilibrium schematic diagram VI of constraints graph in the present invention;
Fig. 5 is the geometric representation in the present invention after the confined equilibrium of constraints graph.
Detailed description of the invention
With specific embodiment, the detailed description of the invention of the present invention is described in further detail below in conjunction with the accompanying drawings.
The process of setting up of constraints graph is exactly to create new summit and binding side, and the process they linked together.Top
Point represents a certain geometric elements such as point, straight line or circle, and summit and transmission summit can be held again in summit before being divided into, the arrow of constraint refers to
To summit be referred to as the transmission summit of this constraint, summit is held before being referred to as this constraint in the initial summit of the arrow of constraint.
Binding side is to represent with the directive limit of band arrow, and it can be divided into front commitments bundle and transmission constraint, points to
The binding side on summit is referred to as the front commitments bundle on this summit, and the binding side initial from this summit is referred to as the transmission constraint on this summit.
As shown in Figure 1a, 6 the geometric element summits being made up of 3 some P1, P2, P3 and 3 straight lines L1, L2, L3 are created
Triangle;Then creating these 6 summits constraint e1, e2, e3, e4, e5, e6 on straight line, wherein e1 is that a P1 points to directly
Line L1, e2~e6 carry out similar process, how shown in 1b, then add the distance restraint of 10mm between P1 and P2 on its basis
E9, the direction of constraint e9 is pointed to P2 by P1, is represented that the position of obligatory point P2 is come in the position of P1 by the distance of 10mm;Then add
Between the horizontal restraint e8 and straight line L1 and L3 of the fixed constraint e7 and straight line L1 of P1 300Constraint e10.
As shown in Fig. 2 a, 2b, some P1 " has fixed constraint e1 ", there is also and a little retrain on straight line between some P1 " and straight line L1 "
E2 ", straight line L2 " has horizontal restraint e3 ", there is Parallel Constraint e4 between straight line L1 " and L2 " simultaneously ".Therefore use above-mentioned rule to enter
The judgement of the fully defining state of row geometry:
P1 " front commitments bundle e1 " is not Planar Mechanisms, P1, and " residue degree of freedom is 0, e1 " can not be reverse, and therefore P1 " is complete
Definition status;
Straight line L1 " front commitments bundle e2 ", the residue degree of freedom of e4 " not being Planar Mechanisms, straight line L1 " they are 0, reverse e2 " and
When e4 " all failed (e3 " and e4 " constraint conflict each other is simultaneously directed to straight line L2 ", definition occurred), therefore straight line L1 " is complete
Definition status;
Straight line L2 " front commitments bundle e3 " is not Planar Mechanisms, but straight line L2 " residue degree of freedom be 1, therefore straight line L2 is " no
It is fully defining state, and is in deficient definition status.
Owing to the constraint redundancy of geometry causes the geometry that is referred to as of constraint solving failure to cross definition, and it is several to cause constraints graph to exist
What crosses the constraint of definition is referred to as Planar Mechanisms, when the difference of all constraint degree sums of geometry degree of freedom commitments front with it bundle is referred to as geometry
Residue degree of freedom, and the reason causing geometry to cross definition is: the residue degree of freedom of geometry is less than zero or there is constraint conflict.
How shown in 3a, 3b, e1'~e4' be some constraint and e5' on straight line be that the horizontal restraint of straight line L1', e6' are
The vertically constraint of straight line L2', e7' are the tangent constraints justifying C1 and straight line L2'.Again add straight line L1' parallel with straight line L2'
Constraint e8', carries out confined equilibrium according to algorithm, and result confined equilibrium unsuccessfully exists Planar Mechanisms;E5', e6' and e8' in constraints graph
Reversely failure (due to the mechanism of constraint conflict, other constraints are not reversed), it is determined that for Planar Mechanisms;The straight line that they are pointed
L1' and L2' is Planar Mechanisms place geometry, i.e. level, vertically and Parallel Constraint is Planar Mechanisms, and straight line L1' and L2' is Planar Mechanisms institute
Geometry.
The vertical constraint e11 of the most newly added L2 Yu L1, as shown in fig. 4 a, crosses definition summit and is probably newly added
The transmission summit L1 of constraint e11;Owing to L1 was definition summit, its front commitments bundle e11 and e8 constraint conflict, and the residue of L1 is certainly
By degree less than 0, owing to there is constraint conflict, can only inverted constraint e8 or e11 (the reversely mistake of other front commitments Shu Wufa releasing L1
Definition status), after inverted constraint e8, L1 was still definition status, recovered the direction of constraint e8, and inverted constraint e11 makes the L1 be no longer
Cross definition summit, as shown in Figure 4 b.
As illustrated in fig. 4 c, the transmission summit L2 of constraint e11 became definition summit, and its residue degree of freedom is less than 0, reverse L2
Front commitments bundle e3, making L2 was no longer definition summit;After inverted constraint e3, the transmission summit P2 of constraint e3 became definition top
Point, its residue degree of freedom, less than 0, the front commitments bundle e9 of reverse P2, makes P2 be not definition summit, as shown in figure 4d.Then
After inverted constraint e9, the transmission summit P1 of constraint e9 became definition summit, and the most front commitments bundle of P1 can be reverse,
Recover the direction of e9;The front commitments bundle e2 reselecting P2 carries out reversely, and making P2 was no longer definition summit such as Fig. 4 e institute
Show, obtain inverted constraint e2 failure according to analysis method section before, recover the direction of e2, and then P2 the most suitably before commitments
Bundle can be reverse, therefore recovers the direction of constraint e3.
Further, selecting a front commitments bundle e4 of L2 to carry out reversely, making L2 was no longer definition summit such as Fig. 4 f institute
Showing, after reverse e4, the transmission summit P3 of e4 was not that definition summit, i.e. constraints graph adjust successfully.
By the constraints graph after being adjusted to merit being carried out constraint solving queue order, as shown in fig. 4f.
Being pressed into by the transmission summit L2 of newly added vertical constraint e11 and solve queue, now solving queue is L2;Then just time
Go through the transmission constraint e4 of L2, transmission summit P3, P3 must be played not in solving queue, P3 press-in is solved in queue, asking now
Dequeue is classified as P3;Do not transmit constraint due to P3, return to the father vertex L2 of P3, more complete to the transmission constraint traversal of L2, L2
Being starting point, algorithm terminates.Finally give and solve queue: L2 → P3, i.e. first pass through geometry L1, P2 and constraint e11, e3 calculate
L2, then calculate P3 by geometry L2, L3 and constraint e4, e5.The figure finally given be exactly one be filled foot institute constrained as figure
Geometric figure shown in 5.
The above is only embodiments of the present invention, again states, comes for those skilled in the art
Saying, under the premise without departing from the principles of the invention, it is also possible to the present invention is carried out some improvement, the present invention is also listed in these improvement in
In scope of the claims.