Extending Constructive Solid Geometry to … CSGDominant...
Transcript of Extending Constructive Solid Geometry to … CSGDominant...
Introduction Basic CSG Dominant Sets Projections Examples Implementation Conclusion
Extending Constructive Solid Geometry toProjections and Parametric Objects
George Tzoumas
joint work with D. Michelucci and S. Foufou
CNRS UMR 5158, LE2I, University of Burgundy, France
TMCE 2014May 19–23, 2014, Budapest, Hungary
Extending CSG to Projections and Parametric Objects G. Tzoumas ∗ 1/27
Introduction Basic CSG Dominant Sets Projections Examples Implementation Conclusion
Constructive Solid Geometry
Boolean constructions via set operators:I quantifier-free boolean formula
I atoms P < 0, P = 0, P ∈ PI operators ¬,∨,∧ for complement Ac , ∪, ∩I difference A− B = A ∩ Bc , De Morgan. . .
∩
circle parabola
CSG-tree representation
Extending CSG to Projections and Parametric Objects G. Tzoumas ∗ 2/27
Introduction Basic CSG Dominant Sets Projections Examples Implementation Conclusion
Motivation
Unified representation
I CSG primitives (boolean formulas)
I Projections (e.g. parametric solids)
I Minkowski Sums
I Extrusions or Sweeps
Basic functionality
I Test if set is empty. Force a set to be non-empty
I Compute topology (simplicial complex homotopy equiv.)
Extending CSG to Projections and Parametric Objects G. Tzoumas ∗ 3/27
Introduction Basic CSG Dominant Sets Projections Examples Implementation Conclusion
Motivation
Unified representation
I CSG primitives (boolean formulas)
I Projections (e.g. parametric solids)
I Minkowski Sums
I Extrusions or Sweeps
Basic functionality
I Test if set is empty. Force a set to be non-empty
I Compute topology (simplicial complex homotopy equiv.)
Extending CSG to Projections and Parametric Objects G. Tzoumas ∗ 3/27
Introduction Basic CSG Dominant Sets Projections Examples Implementation Conclusion
Previous work (list non-exhaustive)
Topological propertiesI semi-algebraic sets
I Cylindrical Algebraic Decomposition [Collins, 1975]
I semi-algebraic subsets homeomorphic to open boxes
I Interval Arithmetic [Delanoue et al, 2006]
I simplicial complex homotopy equivalent
I implicit surfacesI Interval Analysis & Morse Theory [Hart et al, 1997]
Extending CSG to Projections and Parametric Objects G. Tzoumas ∗ 4/27
Introduction Basic CSG Dominant Sets Projections Examples Implementation Conclusion
Previous work (list non-exhaustive)
Topological propertiesI semi-algebraic sets
I Cylindrical Algebraic Decomposition [Collins, 1975]
I semi-algebraic subsets homeomorphic to open boxes
I Interval Arithmetic [Delanoue et al, 2006]
I simplicial complex homotopy equivalent
I implicit surfacesI Interval Analysis & Morse Theory [Hart et al, 1997]
Extending CSG to Projections and Parametric Objects G. Tzoumas ∗ 4/27
Introduction Basic CSG Dominant Sets Projections Examples Implementation Conclusion
Previous work (list non-exhaustive)
Topological propertiesI semi-algebraic sets
I Cylindrical Algebraic Decomposition [Collins, 1975]
I semi-algebraic subsets homeomorphic to open boxes
I Interval Arithmetic [Delanoue et al, 2006]
I simplicial complex homotopy equivalent
I implicit surfacesI Interval Analysis & Morse Theory [Hart et al, 1997]
Extending CSG to Projections and Parametric Objects G. Tzoumas ∗ 4/27
Introduction Basic CSG Dominant Sets Projections Examples Implementation Conclusion
Primitives
Assume F (x , y) ≤ 0 (e.g. x2 + y2 − 1 ≤ 0)
I F (x , y) < 0 → points “inside”
I F (x , y) = 0 → points on the boundary
I F (x , y) > 0 → points “outside”
x : [. . .]y : [. . .]
Extending CSG to Projections and Parametric Objects G. Tzoumas ∗ 5/27
Introduction Basic CSG Dominant Sets Projections Examples Implementation Conclusion
Primitives“convert” inequality F (x , y) ≤ 0 to equality by adding a slack variable:
F (x , y)− s = 0, s ∈ (−∞, 0]
F (x , y) ≤ 0 −→ f (x , y ; s) = 0
I s < 0 → points “inside”
I s = 0 → points on the boundary
I s > 0 → points “outside”
I s : characteristic variable of set A
current newx : [. . .] s : [a, b]y : [. . .]...
Extending CSG to Projections and Parametric Objects G. Tzoumas ∗ 6/27
Introduction Basic CSG Dominant Sets Projections Examples Implementation Conclusion
Complement
GivenA : f (x; s) = 0
We obtain¬A : f (x;−s) = 0
Remark
complement still represented by points from the manifold
Extending CSG to Projections and Parametric Objects G. Tzoumas ∗ 7/27
Introduction Basic CSG Dominant Sets Projections Examples Implementation Conclusion
Disjunctive Normal Form
Given primitives A,B and expressions P,Qi
I A and ¬A are in DNF
I A ∪ B and A ∩ B are in DNF
I ¬(Q1 ∪ Q2) = ¬Q1 ∩ ¬Q2
I ¬(Q1 ∩ Q2) = ¬Q1 ∪ ¬Q2
I P ∩ (Q1∪Q2∪ . . .∪Qn) = (P ∩Q1)∪ (P ∩Q2)∪ . . .∪ (P ∩Qn)
projection distributes over union
π(Q1 ∪ Q2 ∪ . . . ∪ Qn) = π(Q1) ∪ π(Q2) ∪ . . . ∪ π(Qn)
Extending CSG to Projections and Parametric Objects G. Tzoumas ∗ 8/27
Introduction Basic CSG Dominant Sets Projections Examples Implementation Conclusion
Disjunctive Normal Form
Given primitives A,B and expressions P,Qi
I A and ¬A are in DNF
I A ∪ B and A ∩ B are in DNF
I ¬(Q1 ∪ Q2) = ¬Q1 ∩ ¬Q2
I ¬(Q1 ∩ Q2) = ¬Q1 ∪ ¬Q2
I P ∩ (Q1∪Q2∪ . . .∪Qn) = (P ∩Q1)∪ (P ∩Q2)∪ . . .∪ (P ∩Qn)
projection distributes over union
π(Q1 ∪ Q2 ∪ . . . ∪ Qn) = π(Q1) ∪ π(Q2) ∪ . . . ∪ π(Qn)
Extending CSG to Projections and Parametric Objects G. Tzoumas ∗ 8/27
Introduction Basic CSG Dominant Sets Projections Examples Implementation Conclusion
Union
P = A1 ∪ . . . ∪ An
Consider each primitive separately:
A1 : f1(x; s1)
A2 : f2(x; s2)...
An : fn(x; sn)
Remark
x may not be uniquely associated with a primitive
Extending CSG to Projections and Parametric Objects G. Tzoumas ∗ 9/27
Introduction Basic CSG Dominant Sets Projections Examples Implementation Conclusion
Intersection
P = A1 ∩ . . . ∩ An
Problem
x should be uniquely associated with a primitive
Extending CSG to Projections and Parametric Objects G. Tzoumas ∗ 10/27
Introduction Basic CSG Dominant Sets Projections Examples Implementation Conclusion
Intersection as union of disjoint sets (Dominant Set)A dominates B: A|B
I x ∈ A ∩ B
I value of A ≥ value of B
A ∩ B = A|B ∪ B|A (max)
A
B
A|B
B|A
A|B1, . . . ,Bn := x ∈ Rd : 0 ≥ sA ≥ sBi
Extending CSG to Projections and Parametric Objects G. Tzoumas ∗ 11/27
Introduction Basic CSG Dominant Sets Projections Examples Implementation Conclusion
Properties of dominant sets
A ∩ B = A|B ∪ B|A(A|B)|C = A|B,C
A|(B|C ) ∪ A|(C |B) = A|B,CA ∩ B ∩ C = (A|B,C ) ∪ (B|C ,A) ∪ (C |A,B)
¬(A|B) = ¬A ∪ ¬B ∪ B|A
sA
sB
0 ≥ sA ≥ sB
Extending CSG to Projections and Parametric Objects G. Tzoumas ∗ 12/27
Introduction Basic CSG Dominant Sets Projections Examples Implementation Conclusion
ProjectionA : f (x , y , z ; s) = 0
πz(A) =
∃ z :f (x , y , z ; s) = 0s is minimal
Lagrangian: (f (x , y , z ; s) = x2 + y2 + z2 − 1− s)
L : s + λf (x , y , z ; s) (works, but ugly!)
(3×3) :
L′λ : f (x , y , z ; s) = 0L′s : 1− λ = 0 ⇒ λ = 1
L′z : λ∂f (x,y ,z;s)∂z = 0 ⇒ 2z = 0
⇒
s = x2 + y2 − 1λ = 1z = 0
Extending CSG to Projections and Parametric Objects G. Tzoumas ∗ 13/27
Introduction Basic CSG Dominant Sets Projections Examples Implementation Conclusion
ProjectionA : f (x , y , z ; s) = 0
πz(A) =
∃ z :f (x , y , z ; s) = 0s is minimal
Lagrangian: (f (x , y , z ; s) = x2 + y2 + z2 − 1− s)
L : s + λf (x , y , z ; s) (works, but ugly!)
(3×3) :
L′λ : f (x , y , z ; s) = 0L′s : 1− λ = 0 ⇒ λ = 1
L′z : λ∂f (x,y ,z;s)∂z = 0 ⇒ 2z = 0
⇒
s = x2 + y2 − 1λ = 1z = 0
Extending CSG to Projections and Parametric Objects G. Tzoumas ∗ 13/27
Introduction Basic CSG Dominant Sets Projections Examples Implementation Conclusion
Projection
Theorem
Let A : f (x; s) be a geometric primitive. When projecting down k dimen-sions (eliminating x1 . . . xk), the projection can be specified by:
πk(A) −→ ∂f
∂x1=
∂f
∂x2= . . . =
∂f
∂xk= 0
Extending CSG to Projections and Parametric Objects G. Tzoumas ∗ 14/27
Introduction Basic CSG Dominant Sets Projections Examples Implementation Conclusion
Projection (revisited)
(2× 2) :
{f (x , y , z ; s) = 0∂f (x,y ,z;s)
∂z = 0⇒{
s = x2 + y2 − 1z = 0
Extending CSG to Projections and Parametric Objects G. Tzoumas ∗ 15/27
Introduction Basic CSG Dominant Sets Projections Examples Implementation Conclusion
Join Set
Primitives of more than one equation
A ./ B := x ∈ Rd : sA = sB ∧ sA ≤ 0
fA(x; sA) = 0fB(x; sB) = 0sA − sB = 0
Extending CSG to Projections and Parametric Objects G. Tzoumas ∗ 16/27
Introduction Basic CSG Dominant Sets Projections Examples Implementation Conclusion
Join Set ProjectionRecall that we minimize s wrt projected variables xi . . .
I ./ → constraint (reduces dim.)
I even more constraints → Jacobian
Lemma
Let A : f0(x; s) and Bi : fi (x; s), i = 1 . . . n geometric primitives. Then
πk(A ./ B1 ./ · · · ./ Bn)→{
∅, k ≤ nJi0i1...in(f0, f1, . . . , fn) = 0, k > n
,
where 1 ≤ i0 < i1 < . . . < in ≤ k
Extending CSG to Projections and Parametric Objects G. Tzoumas ∗ 17/27
Introduction Basic CSG Dominant Sets Projections Examples Implementation Conclusion
Dominant Set Projection
A
B
A|B
B|A
Theorem
πk(A|B) = πk(A)|B ∪ πk(A ./ B)
Constrained optimization problem. Critical value of s:
I inside primitive
I boundary conditions (joins)
Extending CSG to Projections and Parametric Objects G. Tzoumas ∗ 18/27
Introduction Basic CSG Dominant Sets Projections Examples Implementation Conclusion
Dominant Set Projection (generalized)
Theorem
πk(A|[Bm]1:n) =
πk(A)|[Bm]1:n⋃ni=1 πk(A ./ Bi )|[Bm]1:nm 6=i⋃ni ,j=1i<j
πk(A ./ Bi ./ Bj)|[Bm]1:nm 6=i ,m 6=j⋃ · · ·⋃πk(A ./ B1 ./ · · · ./ Bn)
Extending CSG to Projections and Parametric Objects G. Tzoumas ∗ 19/27
Introduction Basic CSG Dominant Sets Projections Examples Implementation Conclusion
Projection of Intersection
Basic transformation
π(A ∩ B) = π(A)|B ∪ π(B)|A ∪ π(A ./ B)
I contributing points from each primitive (critical points of s)
I contributing points from joint (boundary condition)
Extending CSG to Projections and Parametric Objects G. Tzoumas ∗ 20/27
Introduction Basic CSG Dominant Sets Projections Examples Implementation Conclusion
Intersection of projection of intersections
π(E1 ∩ E2) ∩ π(E1 ∩ E3)
= [π(E1|E2) ∪ π(E2|E1)] ∩ [π(E1|E3) ∪ π(E3|E1)] A ∩ B = A|B ∪ B|A= [π(E1|E2) ∩ π(E1|E3)] ∪ [π(E1|E2) ∩ π(E3|E1)]∪ (A ∪ B) ∩ (C ∪ D)→
[π(E2|E1) ∩ π(E1|E3)] ∪ [π(E2|E1) ∩ π(E3|E1)] DNF= [π(E1)|E2 ∪ E1 ./ E2] ∩ [π(E1)|E3 ∪ E1 ./ E3] ∪ · · · π(A|B) == [π(E1)|E2 ∩ π(E1)|E3] ∪ · · · π(A)|B ∪ 6 π(A ./ B)= [π(E1)|E2, π(E1)|E3)] ∪ [π(E1)|E3, π(E1)|E2] ∪ · · ·=
⋃18i=1 Si
Extending CSG to Projections and Parametric Objects G. Tzoumas ∗ 21/27
Introduction Basic CSG Dominant Sets Projections Examples Implementation Conclusion
Intersection of projection of intersections
π(E1 ∩ E2) ∩ π(E1 ∩ E3)
set contributing set formula
S1 π(E1)|E2, π(E1)|E3
S2 π(E1)|E3, π(E1)|E2
S3 π(E1) π(E1)|E2,E1 ./ E3
S4 π(E1)|E3,E1 ./ E2
S5 π(E1)|E2, π(E3)|E1
S6 π(E1)|E3, π(E2)|E1
S7 π(E2)|E1, π(E1)|E3
S8 π(E2) π(E2)|E1,E1 ./ E3
S9 π(E2)|E1, π(E3)|E1
S10 π(E3)|E1, π(E1)|E2
S11 π(E3) π(E3)|E1,E1 ./ E2
S12 π(E3)|E1, π(E2)|E1
S13 E1 ./ E2|(π(E1)|E3)S14 E1 ./ E2 E1 ./ E2|E1 ./ E3
S15 E1 ./ E2|(π(E3)|E1)S16 E1 ./ E3|(π(E1)|E2)S17 E1 ./ E3 E1 ./ E3|E1 ./ E2
S18 E1 ./ E3|(π(E2)|E1)
Extending CSG to Projections and Parametric Objects G. Tzoumas ∗ 22/27
Introduction Basic CSG Dominant Sets Projections Examples Implementation Conclusion
Parametric Disk
Via projections: project (eliminate) parameters
X : x − r cos θ = 0Y : y − r sin θ = 0R : r2 − 1 = s
,θ ∈ [−π, π)r ∈ [0, 1]
6 πr ,θ(R ./ X ./ Y )
Extending CSG to Projections and Parametric Objects G. Tzoumas ∗ 23/27
Introduction Basic CSG Dominant Sets Projections Examples Implementation Conclusion
Parametric Annulus
F : (x − cos t)2 + (y − sin t)2 − 1
4− s = 0 πt(F )→ ∂F
∂t= 0
Extending CSG to Projections and Parametric Objects G. Tzoumas ∗ 24/27
Introduction Basic CSG Dominant Sets Projections Examples Implementation Conclusion
Python/SAGE
x,y,z = SR.var(’x,y,z’)
A=PrimitiveSet((x− 34)2 +(y− 3
4)2 +(z− 3
4)2 < 2
3,
{x:RIF(-2,2), y:RIF(-2,2),z:RIF(-2,2)})B=PrimitiveSet((x− 1
4)2 +(y − 1
4)2 +(z− 1
4)2 < 1,
{x:RIF(-2,2), y:RIF(-2,2),z:RIF(-2,2)})G=ProjectionSet(IntersectionSet(A,B),set([z]))
Quimper [Chabert-Jaulin’09]
1.
116
(4z − 3)2 + 116
(4y − 3)2+
+ 116
(4x − 3)2 − s0 − 23
= 0
116
(4z − 1)2 + 116
(4y − 1)2+
+ 116
(4x − 1)2 − s1 − 1 = 0
2z − 32= 0, s0 − s1 ≥ 0
2.
116
(4z − 3)2 + 116
(4y − 3)2+
+ 116
(4x − 3)2 − s0 − 23
= 0
116
(4z − 1)2 + 116
(4y − 1)2+
+ 116
(4x − 1)2 − s1 − 1 = 0
s0 − s1 = 0
3.
116
(4z − 3)2 + 116
(4y − 3)2+
+ 116
(4x − 3)2 − s0 − 23
= 0
116
(4z − 1)2 + 116
(4y − 1)2+
+ 116
(4x − 1)2 − s1 − 1 = 0
2z − 12= 0, s1 − s0 ≥ 0
4. Identical to 2.
π(A ∩ B) = π(A)|B ∪ π(A ./ B) ∪ π(B)|A ∪ π(B ./ A)
Extending CSG to Projections and Parametric Objects G. Tzoumas ∗ 25/27
Introduction Basic CSG Dominant Sets Projections Examples Implementation Conclusion
Simplicial complex homotopy equivalent[Delanoue et al, 2006] extension for more types of sets
I projections, Minkowski sums
I star test
interior point s is a star
I if any segment from s lies inside
I if tangent planes at the boundary leave s on the same side(do not pass through!)
Extending CSG to Projections and Parametric Objects G. Tzoumas ∗ 26/27
Introduction Basic CSG Dominant Sets Projections Examples Implementation Conclusion
Simplicial complex homotopy equivalent[Delanoue et al, 2006] extension for more types of sets
I projections, Minkowski sums
I star test
interior point s is a star
I if any segment from s lies inside
I if tangent planes at the boundary leave s on the same side(do not pass through!)
Extending CSG to Projections and Parametric Objects G. Tzoumas ∗ 26/27
Introduction Basic CSG Dominant Sets Projections Examples Implementation Conclusion
Work in progress/Future work
I Star test(boundary, gradient?)
I other constructions(medial axis)
I Minkowski Sums(characteristic variable?)
Thank you!
Extending CSG to Projections and Parametric Objects G. Tzoumas ∗ 27/27
Introduction Basic CSG Dominant Sets Projections Examples Implementation Conclusion
Work in progress/Future work
I Star test(boundary, gradient?)
I other constructions(medial axis)
I Minkowski Sums(characteristic variable?)
Thank you!
Extending CSG to Projections and Parametric Objects G. Tzoumas ∗ 27/27