Universitat Politècnica de Catalunya Deartament de Llenguatges i Sistemes Informàtics PhD Thesis Geometric Constraint Solving in 2D November, 1998 Antoni Soto i Riera Advisor: Robert Joan i Arinyo
Contents 1. Motivation. 2. Geometric Constraint Problem (GCP). 3. Aroaches to Geometric Constraint Solving. 4. Constructive technique. 5. Hybrid technique. 6. Conclusions and future work. 1
Motivation d7 d2 a4 t5 d6 rd5 d5 t4 Feature-based CAD systems + Editable reresentation (Ere) 2-dimensional constraint-based editor 2
Geometric Constraint Problem y C x D L BC L AC h α A L AB B d y = x v v = 0.5 A geometric constraint roblem (GCP) consists of A set of geometric elements {A,, L AB, }. A set of values {d, α, h} A set of dimensional variables {x, y}. A set of external variables {v}. A set of valuated and symbolic constraints. A set of equations. 3
Reresentation: Geometric Constraint Grah The geometric constraints of a GCP can be reresented by a constraint grah G = (E, V ). y C D L AC x h L BC α L AB A d B The vertices in V are two-dimensional geometric elements with two degrees of freedom. The edges in E are constraints that reduce by one the degrees of freedom. 4
Reresentation: First-order Logic y C x D L BC L AC h α A L AB B d y = x v v = 0.5 A geometric constraint roblem can be reresented by a formula in first-order logic. ϕ(a, B, C, D, L AB, L AC, L BC, x, y, v) d(a, B) = d on(a, L AB ) on(b, L AB ) on(a, L AC ) on(c, L AC ) on(d, L AC ) on(b, L BC ) on(c, L BC ) h(c, L AB ) = h a(l AB, L BC ) = α d(a, C) = x d(c, D) = y y = x v v = 0.5 5
Geometric Constraint Solving Geometric constraint solving (GCS) consists in roving the truth of the formula A B C D L AB L AC L BC x y v ϕ(a, B, C, D, L AB, L AC, L BC, x, y, v) by finding the osition of the geometric elements and the values of tags and external variables that satisfy the constraints. 6
Over-constrained Geometric Constraint Problem Theorem 1 (Laman, 1970) Let G = (P, D) a geometric constraint grah where the vertices in P are oints in the two dimensional Euclidean sace and the edges D P P are distance constraints. G is generically well constrained if and only if for all G = (P, D ), subgrah of G induced by P P, 1. D 2 P 3, and 2. D = 2 P 3. r r r 7
Structurally over-constrained Geometric Constraint Problem Definition 1 A geometric constraint grah is structurally over-constrained if and only if exists an induced subgrah with n vertices and m edges such that m > 2 n 3. Definition 2 A geometric constraint grah is structurally well-constrained if and only if it is not structurally over-constrained and E = 2 V 3. Definition 3 A geometric constraint grah is structurally under-constrained if and only if it is not structurally over-constrained and E 2 V 3. 8
Aroaches to Geometric Constraint Solving Solving systems of equations Numerical Constraint Solvers Symbolic Constraint Solvers Proagation Methods Structural analysis Constructive Constraint Solvers Grah based Rule based Degrees of freedom analysis Geometric theorem roving 9
Constructive technique: Ruler-and-comass constructibility A oint P is constructible if there exists a finite sequence P 0, P 1,..., P n = P of oints in the lane with the following roerty. Let S j = {P 0, P 1,..., P j }, for 1 j n. For each 2 j n is either 1. the intersection of two distinct straight lines, each joining two oints of S j 1, or 2. a oint of intersection of a straight line joining two oints of S j 1 and a circle with centre a oint of S j 1 and radius the distance between two oints of S j 1, or 3. a oint of intersection of two distinct circles, each with centre a oint of S j 1 and radius the distance between two oints of S j 1. 10
Constructive technique: Constraints sets A CA set is a air of oriented segments which are mutually constrained in angle. 4 3 1 2 A CD set is a set of oints with mutually constrained distances. 1 3 5 2 4 A CH set is a oint and a segment constrained by the erendicular distance from the oint to the segment. 1 2 3 11
Constructive technique: Geometric locus cd 2 1 cd 1 CR ca 1 ca 1 1 2 1 2 3 cd 1 CC cd 1 RA ch 1 ch 1 cd 1 1 2 cd 1 1 2 RP RT 12
cd 1 Constructive technique: Set of rules cd 2 cd 3 1 2 cd 1 CR-CR cd 2 ca 1 cd 2 ca 1 1 1 cd 1 CR-CC CR-RA ch 1 cd 2 cd 2 ch 1 1 1 cd 1 cd 1 CR-RP CR-RT 13
Constructive technique: Analysis and Construction hases ϕ( 1, 2, 3 ) d( 1, 2 ) = d 1 d( 2, 3 ) = d 2 d( 3, 1 ) = d 3 Geometric Constraint Problem 3 analysis d 3 d 2 1 d 1 2 ψ( 1, 2, 3 ) 1 = (0, 0) 2 = (d 1, 0) 3 = inter(circle( 1, d 3 ), circle( 2, d 2 )) Constructive Formula construction υ d 1 = 200 d 2 = 180 d 3 = 220 Values ψ υ ( 1, 2, 3 ) 1 = (0, 0) 2 = (200, 0) 3 = (140, 169.706) Valuated Formula 14
Constructive technique: Structure of the Analysis hase ϕ( 1, 2, 3 ) d( 1, 2 ) = d 1 d( 2, 3 ) = d 2 d( 3, 1 ) = d 3 translation C2(cd 1, 1, 2, d 1 ) C2(cd 2, 2, 3, d 2 ) C2(cd 3, 1, 3, d 3 ) E 0 cd 1 = { 1, 2 } cd 2 = { 2, 3 } cd 3 = { 1, 3 } analysis DDD(cd 4, 1, 2, 3, cd 1, cd 2, cd 3 ) E f cd 4 = { 1, 2, 3 } generation ψ( 1, 2, 3 ) 1 = (0, 0) 2 = (d 1, 0) 3 = inter(circle( 1, d 3 ), circle( 2, d 2 )) 15
Constructive technique: Correctness (1) Let R be a set of tules (D, X) where D is a set of CD sets, and X is a set of CA sets and CH sets. Let ρ = DDD DDX DXX be a reduction relation. We define the abstract reduction system R = R, ρ. We roof termination and confluence that imlies canonicity and unique normal form roerty. 16
Constructive technique: Correctness (2) d 4 q s r s d 3 d 2 q a l h m r DDD q DAH s q r d 1 DAH s r DDD d 5 d 4 17
Constructive technique: Reduction rules (1) (D, X) DDD ((D {d 1, d 2, d 3 }) {d 1 d 2 d 3 }, X) if {d 1, d 2, d 3 } D d 1 d 2 = {1} d 2 d 3 = {2} d 1 d 3 = {3} 1 2 3 18
Constructive technique: Reduction rules (2) (D, X) DDX ((D {d 1, d 2 }) {d 1 d 2 unts(x 1 )}, X {x 1 }) {d 1, d 2 } D d 1 d 2 = { 1 } d if 2 x 1 X unts(x 1 ) d 1 = {} 1 19
Constructive technique: Reduction rules (3) (D, X) DXX ((D {d 1 }) {d 1 unts(x 1 ) unts(x 2 )}, X {x 1, x 2 }) d 1 D {x if 1, x 2 } X unts(x 1 ) d 1 = {} unts(x 2 ) d 1 = {} 20
Hybrid technique: Introduction Goal Solve symbolic constraints keeing the two hases of the constructive technique for valuated constraints. Idea Federate a constructive solver and an equational solver. Required A technique of analysis of systems of equations. 21
Hybrid technique: Analysis of systems of equations 1. Reresent the structure of the systems of equations by a biartite grah (bigrah). x = 5 x = 2y x = y 2y = z yt = u 3t = uu = w v x y z t u v w 2. Comute the Dulmage-Mendelsohn decomosition of the bigrah. V 0 is the over-determined art, V is the underdetermined art. V 1,, V n are the consistent art. x = 5 x = 2y x = y 2y = z yt = u 3t = uu = w v x y z t u v w V 0 V 1 V2 V 22
Hybrid technique: Motivation (1) A geometric constraint roblem that can not be solved without considering geometric variables. d 1 b a o 1, t 1 l d 2 n α 1 g α 2 m d o 2, t 2 c ϕ(a, b, c, d, g, l, m, n, r) d(a, b) = d 1 d(b, c) = d 2 on(a, l) on(b, l) on(b, n) on(c, n) on(c, m) on(d, m) a(l, n) = α 1 a(l, m) = α 2 d(g, c) = r h(g, l) = r h(g, m) = r d(g, d) = r 23
Hybrid technique: Motivation (2) Final state of the geometric analyzer. C 1 d 1 b a o 1, t 1 l d 2 n α 1 g α 2 m d o 2, t 2 c Final state of the equational analyzer. d(g, a) = r h(g, l) = r h(g, m) = r d(g, d) = r r 24
Hybrid technique: Technique (1) 1. Reresent geometric variables in the bigrah (B). d(g, a) = r h(g, l) = r h(g, m) = r d(g, d) = r g x a x a y g y l x l y r n x n y d x d x 2. Comute R(B, C 1 ), the restriction of bigrah B by CD set C 1. The equations are analyzed with resect to a coordinate system (CD set). d(g, a) = r h(g, l) = r h(g, m) = r d(g, d) = r g x g y r d x d x V 1 V 25
Hybrid technique: Technique (2) 3. For each solved dimensional variable, add a new constraint set to the state of the geometric analyzer. 4. For each air of solved geometric variables (v x, v y ), add the geometric element v to the rojection CD set C 1. 5. Remove solved variables and equations from the bigrah B. C 1 d 1 b a o 1, t 1 l d 2 n α 1 g α 2 m d o 2, t 2 c C 2 26
Hybrid technique: Correctness (1) Let S be a set of tules (D, X, B) where D is a set of CD sets, X is a set of CA sets and CH sets, and B is a bigraf reresenting symbolic geometric constraints and equations. Let ρ relation. be the constructive reduction Let κ be the equational analysis reduction relation. We define the abstract reduction system S = S, ρ κ. We roof termination and confluence that imlies canonicity and unique normal form roerty. 27
Conclusions A correct ruler-and-comass constructive method. A clean hase structure. A correct hybrid method combining a constructive method and an equation analysis method. A rototye imlementation. 28
Future work Study the domain of constructive methods. Extending the domain of our constructive method. Selection of the solution. Determine the range of values of a constraint. 29