Sie sind auf Seite 1von 30

Geometric Constraints Solving

Dominique Michelucci, June 2014, Nantes

June 21, 2014

Dominique Michelucci, June 2014, Nantes Geometric Constraints Solving


- Introduction
- Solving the Pentahedron
- An optimization of the star test
- The combinatorial Bernstein problem is hard
- Re-parameterization reduces irreducible
- A new representation for geometric sets

Dominique Michelucci, June 2014, Nantes Geometric Constraints Solving


Solving the Pentahedron

Two triangles ABC and DEF, connected with 3 quadrilaterals.


Edges AD, BE, CF.
y

F
C F C (xC,yC,0)

Isometry
D x
A
B A(0,0,0) B (dAB,0,0)

D
z
E E
(a) (b)


xA yA zA 1

x yB zB 1
|A , B , E , D | = B =0 (1)
xE yE zE 1

xD
yD zD 1

Dominique Michelucci, June 2014, Nantes Geometric Constraints Solving


2




 C1 : (A − B ) · (A − B ) − dAB =0

 2
C2 : (B − C ) · (B − C ) − dBC =0






 2
C3 : (C − A ) · (C − A ) − dCA =0






2

C4 : (D − E ) · (D − E ) − dDE =0






2

C5 : (E − F ) · (E − F ) − dEF =0







 2
 C6 :

 (F − D ) · (F − D ) − dFD =0

 2




 C7 : (A − D ) · (A − D ) − dAD =0

 2
C8 : (B − E ) · (B − E ) − dBE =0






2

C9 : (C − F ) · (C − F ) − dCF =0






copl(ABED ) = |A , B , E , D |





 C10 : =0
copl(BCFE ) = |B , C , F , E |

C11 : =0






copl(CADF ) = |C , A , D , F | = 0

 C12 :

Dominique Michelucci, June 2014, Nantes Geometric Constraints Solving


Wlog we can fix 6 unknowns in 3D:
A = (0, 0, 0), B = (xB , 0, 0), C = (xC , yC , 0).
It remains 12 equations and 12 unknowns: the system is
well-constrained.
xB , xC , yC are easy to compute.
It remains 9 equations and 9 unknowns.

Dominique Michelucci, June 2014, Nantes Geometric Constraints Solving


To reduce further the system, we need to remark that AD , BE , CF
are concurrent or parallel : Desargue’ theorem. We get a system in
3 equations and unknowns. Solving it with Alias is 42 times faster
than solving the system with size 9.
I
E F
I D
F D

D I
F
D
E F
I
A C
A C B E
A C
A C
B
B E B

Dominique Michelucci, June 2014, Nantes Geometric Constraints Solving


B
B E B E
XE
β c dBE
F I α1 I
a dDE
α dAB XD
C D A
γ D
dAD
A (a) b (b) A (c)
C

New formulation of the pentahedron problem. (a) Concurrent lines


AD, BE, and FG intersect in point I. (b) Illustration of Al-Kashi
theorem for triangles. (c) A 2D view illustrating the application of
Al-Kashi theorem for the new formulation of the pentahedron.

2XD XE cos α1 = XD2 + XE2 − dDE


2

and:

2(XD + dAD )(XE + dBE ) cos α1 = (XD + dAD )2 + (XE + dBE )2 − dAB
2
,

where XD denotes the unknown distance ID, XE denotes the


unknown distance IE, and XF refers to the unknown distance IF.

Dominique Michelucci, June 2014, Nantes Geometric Constraints Solving


The reduced 3D pentahedron system of three equations in three
unknowns.
 2  


 (XD + XE2 − dDE2
)(XD + dAD )(XE + dBE ) − XD XE (XD + dAD )2 + (XE + dBE )2 − dAB
2
=0

  
 2
 2 2 2 2 2

 (XE + XF − dEF )(XE + dBE )(XF + dCF ) − XE XF (XE + dBE ) + (XF + dCF ) − dBC = 0

  
 (X 2 + X 2 − d 2 )(X + d )(X + d ) − X X (X + d )2 + (X + d )2 − d 2 = 0


F D FD F CF D AD F D F CF D AD CA

Dominique Michelucci, June 2014, Nantes Geometric Constraints Solving


Unexpected 3D pentahedra where edges AD , BE , FD are
parallel

F’’

D E

F’

E’
A C

Geometric construction of a parallel pentahedron, where edges


AD , BE, and CF are parallel. The geometric construction is a
constructive proof: translate the "roof", solve a tetrahedron, etc. It
fails when some triangular or tetraedric inequality is violated.

Dominique Michelucci, June 2014, Nantes Geometric Constraints Solving


Unexpected flat (2D) pentahedra, in finite number

In the flat solutions, edges AD , BE , CF need no more to be parallel.


Coplanarity constraints of faces cancel.
By Laman’s theorem, the system is well-constrained.

Dominique Michelucci, June 2014, Nantes Geometric Constraints Solving


E2

F2

B
F1

A C E1

F2 E2

E1

F1
D

The flat pentahedron and the sextic. Pin ABC. Choose an


orientation for DEF. Forget the constraint on the length CF. Then
when AD rotates around A , F describes the sextic curve. F lies on
the sextic, and the cercle (C , dCF ).

Dominique Michelucci, June 2014, Nantes Geometric Constraints Solving


Lessons from the Pentahedron

We have no algorithm to find the best formulation for constraints :(


There are unexpected solutions ! Ex: For the hexahedron (a cube
is a regular hexahedron), there is a manifold with dimension 1 of
flat hexahedra.

V E F DoF DoR status


pentahedron 6 9 6 9 9 Well 0
hexahedron 8 12 6 13 12 Under 1
dodecahedron 20 30 12 37 30 Under 7
icosahedron 12 30 20 21 30 Over − 9
octahedron 6 12 8 9 12 Over − 3
tetrahedron 4 6 4 5 6 Over − 1

It makes interval solvers unusable: they cover a continuum of


solutions with tiny boxes.

Dominique Michelucci, June 2014, Nantes Geometric Constraints Solving


IMPROVEMENT OF THE STAR TEST

Delanoue, Jaulin, Cottenceau’s method constructs a simplicial


complex homotopic to an object defined by unions-intersections of
primitives defined by inequations (ex: x 2 + y 2 + z 2 − 1 ≤ 0)
The main tool is the star test. s is a star for a set K iff
s ∈ K and p ∈ K ⇒ the segment (s , p ) ∈ K
A bounding box of K is subdivided until the object is covered with
0D, 1D, 2D, 3D... boxes B the centre of which are stars for B ∩ K .
If s is a star for A and for B, it is a star for A ∪ B, and for A ∩ B:
primitives can be treated independently.

Dominique Michelucci, June 2014, Nantes Geometric Constraints Solving


Let f be a C 1 function from Rd to R, B ⊂ Rd be a convex set and
S = { x ∈ B | f (x ) ≤ 0}. If there exists s ∈ S such that

{x ∈ B | f (x ) = 0, ∇f (x ) · (x − s ) ≤ 0} = ∅, (2)

then S is s-star-shaped.

Dominique Michelucci, June 2014, Nantes Geometric Constraints Solving


Improving the star test: Let S be defined by f (x ) ≤ 0, where f (x ) is
a degree n polynomial, given a point s = (s1 , . . . , sd ), then the star
condition ∇f (x ) · (x − s ) is also a degree n polynomial.
Let F (x , h ) be a degree n homogeneous polynomial, such that
F (x , 1) = f (x ). Then the star condition for s ∈ S becomes

{(x , h ) ∈ (B , [1, 1]) | F (x , h ) = 0,


∇F (x , h ) · ((x , h ) − (s , h )) ≤ 0} = ∅.

Since F (x , h ) is a homogeneous polynomial, we have

∇F (x , h ) · (x , h ) = nF (x , h ).

Therefore, the star condition becomes

{x ∈ B | F (x , 1) = 0, −∇F (x , 1) · (s , 1) ≤ 0} = ∅. (3)

It reduces the subdivision depth because the degree of


−∇F (x , 1) · (s , 1) is n − 1.
Dominique Michelucci, June 2014, Nantes Geometric Constraints Solving
Remark: for conics/quadrics, the line/plane equation is the
equation of the polar of s w.r.t. the conic.

Dominique Michelucci, June 2014, Nantes Geometric Constraints Solving


Star-shaped objects are used to show the improvement of our
homogeneous method. The center of the box is used as the
candidate point.
Original Homogeneous
Object-Arithmetic
IA Bernstein IA Bernstein
S1 ∩ B1 10 6 0 0
S2 ∩ B2 10 9 0 0
S3 ∩ B3 8 7 0 0
S4 ∩ B4 18 10 0 0
S5 ∩ B5 13 9 0 0
The depth of subdivision in the star test performed for algebraic
objects.

Dominique Michelucci, June 2014, Nantes Geometric Constraints Solving


Dominique Michelucci, June 2014, Nantes Geometric Constraints Solving
Dominique Michelucci, June 2014, Nantes Geometric Constraints Solving
Dominique Michelucci, June 2014, Nantes Geometric Constraints Solving
THE COMBINATORIAL BERNSTEIN PROBLEM IS
HARD

Let P (X ) be a polynomial in X = (x1 , . . . xn ). Then a lower (upper)


bound of P ([0, 1]n ) is the smallest (greatest) coefficient of P in the
tensorial Bernstein basis. Remark: bounds are exact when all
partial degrees are 1.
Thus the combinatorial Bernstein pbm arises: find the smallest
(greatest) coefficient of a polynomial P in the tensorial Bernstein
basis.

Dominique Michelucci, June 2014, Nantes Geometric Constraints Solving


!
(d ) d
Bi (t ) = (1 − t )n−i t i , i = 0, ..., d
i

Bid1,i,d,...
2 ,...
(x1 , x2 , . . .) = Bid1 (x1 ) × Bid2 (x2 ) . . .
1 2 1 2

Where is the difficulty? Often P is sparse in the canonical tensorial


basis. But it is no more in the tensorial Bernstein basis. Even for
partial degrees equal to one, there is 2n Bernstein polynomials,
and P (X ) = 1 is the sum of all of them.
This pbm is NP-hard. Proof: reduce MAX-3 SAT to BERNSTEIN
problem.

Dominique Michelucci, June 2014, Nantes Geometric Constraints Solving


We define a map φ which maps each clause to a multivariate
"clausal polynomial", as follows:

φ(T ) = 0 or, with abuse of notation: T = 0


φ(F ) = 1 or, with abuse of notation: F = 1
φ(x ) = x , where x is a variable
φ(x̄ ) = 1 − x where x is a variable
φ(x ∨ y ) = φ(x ) × φ(y )

Dominique Michelucci, June 2014, Nantes Geometric Constraints Solving


Thus, for example:

φ(x ∨ y ∨ z ) = xyz
φ(x ∨ y ∨ z̄ ) = xy (1 − z )
φ(x ∨ ȳ ∨ z̄ ) = x (1 − y )(1 − z )
φ(x̄ ∨ ȳ ∨ z̄ ) = (1 − x )(1 − y )(1 − z )

Caution. We use φ(T ) = 0 and φ(F ) = 1 to simplify the proof,


though it is not the usual convention. Moreover, we will use:
x 2 = x , y 2 = y , z 2 = z, etc, so that φ(x ∨ x̄ ) = x (1 − x ) = x − x 2 = 0.
Also, φ(x ∨ x ) = x 2 = x = φ(x ) and
φ(x̄ ∨ x̄ ) = (1 − x )2 = 1 − 2x + x 2 = 1 − x = φ(x̄ ). This way, all
clausal polynomials will have partial degree at most 1 for all
variables.

Dominique Michelucci, June 2014, Nantes Geometric Constraints Solving


Let Hn or H be the unit hypercube [0, 1]n in n dimensions, and
Vn = {0, 1}n or V be the set of its 2n vertices. Each vertex x ∈ Vn
gives an assignment: xi = 0 means xi is T , xi = 1 means xi is F.
From now on, we confuse assignments and vertices.
The SAT polynomial associated to a SAT instance c1 ∧ c2 . . . cK is,
by definition, p = Kc=1 φ(ck ), the sum of the clausal polynomials
P
pk = φ(ck ) of its clauses ck . Thus, if P (x ) is a 3-SAT problem, and
if p (x ) = φ(P (x )) is its associated SAT polynomial, then p (x ) is
the number of clauses in P which are violated by the
assignment x = (x1 , x2 , . . . xn ), xi ∈ {T , F }, T = 0, F = 1. Thus x ∗
satisfies the 3-SAT problem P (x ) if p (x ∗ ) = 0.

Dominique Michelucci, June 2014, Nantes Geometric Constraints Solving


In the tensorial canonical base, the SAT polynomial φ(P (x )) has a
size proportional to the size n + K (where n is the number of
boolean unknowns, and K the number of clauses) of the SAT
problem, and can be computed in linear time O (n + K ).

Dominique Michelucci, June 2014, Nantes Geometric Constraints Solving


Exemple of a 3SAT problem:

φ(C1 : x ∨ y ∨ z ) = xyz = B1110 + B1111


φ(C2 : x ∨ y ∨ z̄ ) = xy (1 − z ) = B1100 + B1101
φ(C3 : x ∨ ȳ ∨ z ) = x (1 − y )z = B1010 + B1011
φ(C4 : x̄ ∨ y ∨ t ) = (1 − x )yt = B0101 + B0111
φ(C5 : x̄ ∨ ȳ ∨ t̄ ) = (1 − x )(1 − y )(1 − t ) = B0000 + B0010
φ(C6 : x ∨ ȳ ∨ z̄ ) = x (1 − y )(1 − z ) = B1000 + B1001
φ(C7 : x̄ ∨ y ∨ z ) = (1 − x )yz = B0110 + B0111

Dominique Michelucci, June 2014, Nantes Geometric Constraints Solving


The SAT polynomial p = φ(P ) of P, i.e., the sum of all φ(Ck ), is:

B0000 + B0010 + B0101 + B0110 + 2B0111 + B1000 + B1001


+B1010 + B1011 + B1100 + B1101 + B1110 + B1111

The TBB coefficients are zero for:


B0001 , thus (x , y , z , t ) = (0, 0, 0, 1) = (T , T , T , F ) satisfies P.
B0011 , thus (x , y , z , t ) = (0, 0, 1, 1) = (T , T , F , F ) satisfies P.
B0100 , thus (x , y , z , t ) = (0, 1, 0, 0) = (T , F , T , T ) satisfies P.

Dominique Michelucci, June 2014, Nantes Geometric Constraints Solving


The proof: the smallest coefficient of φ(P ) = p in the TBB is a
lower bound of min p ([0, 1]n ), the minimal number of violated
clauses.
Actually the lower bound is exact because p is partial degree 1 for
all variables.
Thus MAX-3SAT reduces polynomially to the BERNSTEIN
problem.
But MAX-3SAT is hard (harder than 3SAT).
Thus the BERNSTEIN problem is as hard as MAX-3SAT.

Dominique Michelucci, June 2014, Nantes Geometric Constraints Solving


To bypass this, we introduce the Bernstein polytope: we resort to
linear programming to enclose polynomials, or reduce boxes
preserving roots of polynomials.

Dominique Michelucci, June 2014, Nantes Geometric Constraints Solving

Das könnte Ihnen auch gefallen