SLIDE 1
Encasement: A method to compute geometric arrangements Joseph - - PowerPoint PPT Presentation
Encasement: A method to compute geometric arrangements Joseph - - PowerPoint PPT Presentation
Encasement: A method to compute geometric arrangements Joseph Masterjohn University of Miami Department of Computer Science Sept 30, 2015 Overview Overview What is an Arrangement? Start with a sheet of material. What is an Arrangement?
SLIDE 2
SLIDE 3
Overview
SLIDE 4
What is an Arrangement?
Start with a sheet of material.
SLIDE 5
What is an Arrangement?
Cut it with some curves
SLIDE 6
What is an Arrangement?
The arrangement is the resulting shapes
SLIDE 7
What is an Arrangement?
An arrangement in 2D is a decomposition of the plane into disjoint sets, which is induced by a set of curves in the plane.
SLIDE 8
What is an Arrangement?
An arrangement in 2D is a decomposition of the plane into disjoint sets, which is induced by a set of curves in the plane. The idea generalizes to 3D and higher, but for the purposes of visualization we will stick to 2D.
SLIDE 9
Overview
SLIDE 10
Applications
An arrangement is a fundamental operation that is the basis for many other geometric algorithms.
SLIDE 11
Applications
An arrangement is a fundamental operation that is the basis for many other geometric algorithms. Useful for range searching
SLIDE 12
Applications
An arrangement is a fundamental operation that is the basis for many other geometric algorithms. Useful for range searching Various geometric optimization problems (Distance Selection, Diameter in 3D, Biggest line segment in a simple polygon, etc.)
SLIDE 13
Applications
An arrangement is a fundamental operation that is the basis for many other geometric algorithms. Useful for range searching Various geometric optimization problems (Distance Selection, Diameter in 3D, Biggest line segment in a simple polygon, etc.) Motion planning in robotics, arrangement of ”contact surfaces” defines the configuration space of a robotic body.
SLIDE 14
Applications
An arrangement is a fundamental operation that is the basis for many other geometric algorithms. Useful for range searching Various geometric optimization problems (Distance Selection, Diameter in 3D, Biggest line segment in a simple polygon, etc.) Motion planning in robotics, arrangement of ”contact surfaces” defines the configuration space of a robotic body. Assembly planning, given two sets of objects placed rigidly and non-overlapping, can they be merged by some motion (i.e. assembled) while still remaining rigid and non-overlapping?
SLIDE 15
Overview
SLIDE 16
Overview
SLIDE 17
Resultants
Exact computation of intersections using resultants
SLIDE 18
Resultants
Exact computation of intersections using resultants For P(x), Q(x) ∈ k[x] : res(P, Q) =
- (x,y):P(x)=Q(y)=0
(x − y)
SLIDE 19
Resultants
Exact computation of intersections using resultants For P(x), Q(x) ∈ k[x] : res(P, Q) =
- (x,y):P(x)=Q(y)=0
(x − y) If the two polynomials share a root, then this product is zero.
SLIDE 20
Resultants
Exact computation of intersections using resultants For P(x), Q(x) ∈ k[x] : res(P, Q) =
- (x,y):P(x)=Q(y)=0
(x − y) If the two polynomials share a root, then this product is zero. The resultant can be computed by the determinant of the Sylvester Matrix.
SLIDE 21
Resultants
Exact computation of intersections using resultants For P(x), Q(x) ∈ k[x] : res(P, Q) =
- (x,y):P(x)=Q(y)=0
(x − y) If the two polynomials share a root, then this product is zero. The resultant can be computed by the determinant of the Sylvester Matrix. For polynomials in two variables, express as polynomials in x whose coefficients are polynomials in y
SLIDE 22
Example
Let P(x, y) = {(x, y) ∈ R : 1x3 + 0x2 + 1x + (1 − y3) = 0}
SLIDE 23
Example
Let P(x, y) = {(x, y) ∈ R : 1x3 + 0x2 + 1x + (1 − y3) = 0} Let Q(x, y) = {(x, y) ∈ R : −1x3 + 0x2 − 1x + (1 − y3) = 0}
SLIDE 24
Example
SLIDE 25
Example
res(P, Q) =
- 1
1 (1 − y3) 1 1 (1 − y3) 1 1 (1 − y3) −1 −1 (1 − y3) −1 −1 (1 − y3) −1 −1 (1 − y3)
SLIDE 26
Example
res(P, Q) = 8 − 24y3 + 24y6 − 8y9
SLIDE 27
Resultants
The degree of the resulting polynomial is proportional to the product of the degrees of the input polynomials
SLIDE 28
Resultants
The degree of the resulting polynomial is proportional to the product of the degrees of the input polynomials This can easily blow up for curves of reasonable degree
SLIDE 29
Resultants
The degree of the resulting polynomial is proportional to the product of the degrees of the input polynomials This can easily blow up for curves of reasonable degree For 3D NURBS, a common surface represntation, it blows up to degree > 1000
SLIDE 30
Resultants
The degree of the resulting polynomial is proportional to the product of the degrees of the input polynomials This can easily blow up for curves of reasonable degree For 3D NURBS, a common surface represntation, it blows up to degree > 1000 What’s the problem?
SLIDE 31
Resultants
The degree of the resulting polynomial is proportional to the product of the degrees of the input polynomials This can easily blow up for curves of reasonable degree For 3D NURBS, a common surface represntation, it blows up to degree > 1000 What’s the problem? We’re paying for both the complex and the real roots, when we are only interested in the real roots.
SLIDE 32
Resultants
The degree of the resulting polynomial is proportional to the product of the degrees of the input polynomials This can easily blow up for curves of reasonable degree For 3D NURBS, a common surface represntation, it blows up to degree > 1000 What’s the problem? We’re paying for both the complex and the real roots, when we are only interested in the real roots. In this case the polynomial of degree 9 has 1 real root (of multiplicity 3).
SLIDE 33
Overview
SLIDE 34
Curve Tracing
More practical and efficient ”engineering” solution
SLIDE 35
Curve Tracing
More practical and efficient ”engineering” solution
1
Start with a point on the curve
SLIDE 36
Curve Tracing
More practical and efficient ”engineering” solution
1
Start with a point on the curve
2
Compute the tangent line to the curve at that point
SLIDE 37
Curve Tracing
More practical and efficient ”engineering” solution
1
Start with a point on the curve
2
Compute the tangent line to the curve at that point
3
Move some amount along that line
SLIDE 38
Curve Tracing
More practical and efficient ”engineering” solution
1
Start with a point on the curve
2
Compute the tangent line to the curve at that point
3
Move some amount along that line
4
Use a Newton-like method to get back to the curve
SLIDE 39
Curve Tracing
SLIDE 40
Curve Tracing
SLIDE 41
Curve Tracing: Problem
SLIDE 42
Curve Tracing: Problem
SLIDE 43
Curve Tracing: Problem
Each step is very fast, but
SLIDE 44
Curve Tracing: Problem
Each step is very fast, but In general we can’t guarantee correctness.
SLIDE 45
Curve Tracing: Problem
Each step is very fast, but In general we can’t guarantee correctness. We seek a method with running time comparable to the curve tracing method, with the correctness of the mathematical approach.
SLIDE 46
Overview
SLIDE 47
Idea
What do we already know how to do reliably?
SLIDE 48
Arrangements of Lines
L1 : ax + by = e
SLIDE 49
Arrangements of Lines
L1 : ax + by = e L2 : cx + dy = f
SLIDE 50
Arrangements of Lines
L1 : ax + by = e L2 : cx + dy = f Solve the linear system... easy
SLIDE 51
Roots of univariate polynomials
f (x) = a0 + a1x + a2x2 + . . . + anxn = 0
SLIDE 52
Roots of univariate polynomials
f (x) = a0 + a1x + a2x2 + . . . + anxn = 0 Root finding is a well studied area of research
SLIDE 53
Roots of univariate polynomials
f (x) = a0 + a1x + a2x2 + . . . + anxn = 0 Root finding is a well studied area of research Many methods exists, pick your poison
SLIDE 54
Roots of univariate polynomials
f (x) = a0 + a1x + a2x2 + . . . + anxn = 0 Root finding is a well studied area of research Many methods exists, pick your poison Interval Newton’s method will suffice
SLIDE 55
Intersection of Lines and Curves
σ(t) = (x(t), y(t)) = (At + B, Ct + D)
SLIDE 56
Intersection of Lines and Curves
σ(t) = (x(t), y(t)) = (At + B, Ct + D) f (x, y) = (a00) + (a10)x + (a01)y + (a11)xy + ... + (anm)xnym
SLIDE 57
Intersection of Lines and Curves
σ(t) = (x(t), y(t)) = (At + B, Ct + D) f (x, y) = (a00) + (a10)x + (a01)y + (a11)xy + ... + (anm)xnym f (x, y) ◦ σ(t) = f (x(t), y(t)) = 0
SLIDE 58
Intersection of Lines and Curves
σ(t) = (x(t), y(t)) = (At + B, Ct + D) f (x, y) = (a00) + (a10)x + (a01)y + (a11)xy + ... + (anm)xnym f (x, y) ◦ σ(t) = f (x(t), y(t)) = 0 That’s just a univariate polynomial in t, we know how to solve those.
SLIDE 59
Idea
The only thing we don’t know how to do explicitly is intersecting two implicit curves. We won’t ever try to do that. We will just use our existing reliable techniques to compute an arrangement of lines, from which the arrangement of curves can be extracted.
SLIDE 60
Overview
SLIDE 61
Overview
SLIDE 62
What is an Encasement?
A collection of connected convex cells in the plane that isolate the features of the arrangement of curves is an Encasement if:
SLIDE 63
What is an Encasement?
A collection of connected convex cells in the plane that isolate the features of the arrangement of curves is an Encasement if:
1
No vertex of a cell lies on a curve.
SLIDE 64
What is an Encasement?
A collection of connected convex cells in the plane that isolate the features of the arrangement of curves is an Encasement if:
1
No vertex of a cell lies on a curve.
2
A cell edge intersects up to one curve in a single point.
SLIDE 65
What is an Encasement?
A collection of connected convex cells in the plane that isolate the features of the arrangement of curves is an Encasement if:
1
No vertex of a cell lies on a curve.
2
A cell edge intersects up to one curve in a single point.
3
A cell intersects up to two curves as simple segments.
SLIDE 66
What is an Encasement?
A collection of connected convex cells in the plane that isolate the features of the arrangement of curves is an Encasement if:
1
No vertex of a cell lies on a curve.
2
A cell edge intersects up to one curve in a single point.
3
A cell intersects up to two curves as simple segments.
4
If a cell intersects two curves, those curves have one intersection point.
SLIDE 67
Valid Encasement
SLIDE 68
Valid Encasement
SLIDE 69
Invalid Encasement
SLIDE 70
Invalid Encasement
SLIDE 71
Invalid Encasement
SLIDE 72
Full Encasement
SLIDE 73
How does an encasement solve the original problem of finding an arrangement?
SLIDE 74
How does an encasement solve the original problem of finding an arrangement? How can we compute some feature of the arrangement using the Encasement?
SLIDE 75
Full Encasement
SLIDE 76
Full Encasement
SLIDE 77
OK we’ll start out with a single cell, the boundary cell.
SLIDE 78
OK we’ll start out with a single cell, the boundary cell. If no rules are violated, we’re done, we have a valid Encasement.
SLIDE 79
OK we’ll start out with a single cell, the boundary cell. If no rules are violated, we’re done, we have a valid Encasement. If not, how do we fix those violating situations we encountered before?
SLIDE 80
OK we’ll start out with a single cell, the boundary cell. If no rules are violated, we’re done, we have a valid Encasement. If not, how do we fix those violating situations we encountered before? One simple operation: split.
SLIDE 81
Fixing Invalid Encasement
SLIDE 82
Fixing Invalid Encasement
SLIDE 83
Fixing Invalid Encasement
SLIDE 84
Overview
SLIDE 85
Split Edges
SLIDE 86
Split Edges
SLIDE 87
Overview
SLIDE 88
Isolate segments of one curve
SLIDE 89
Isolate segments of one curve
SLIDE 90
Isolate segments of one curve
SLIDE 91
Isolate segments of one curve
SLIDE 92
Overview
SLIDE 93
Isolate segments of two curves
SLIDE 94
Isolate segments of two curves
SLIDE 95
Isolate segments of two curves
SLIDE 96
Isolate segments of two curves
SLIDE 97
Overview
SLIDE 98
Isolate intersections
We know two curves intersect at least once in a cell by looking at the order of the intersections with the boundary.
SLIDE 99
Isolate intersections
But that doesn’t sufficiently tell us that there is only one. There could be an odd number of intersections inside the cell.
SLIDE 100
Isolate intersections
Notice the tangents at the intersections though. If the two curves intersect more than once, then their tangent cones intersect.
SLIDE 101
Isolate intersections
Thus if we can show that their tangent cones do not intersect, then we have shown that the curves intersect only once.
SLIDE 102
Isolate intersections
For implicit curves, the tangents of f (x, y) = 0 are all rotations of ▽f = fx(x, y), fy(x, y). So we can formulate the argument for tangent cones equivalently with gradient cones.
SLIDE 103
Isolate intersections
For implicit curves, the tangents of f (x, y) = 0 are all rotations of ▽f = fx(x, y), fy(x, y). So we can formulate the argument for tangent cones equivalently with gradient cones. We choose a direction v such that every gradient vector of some curve f (x, y) lie on the same side of v within the cell. And on the opposite side for g(x, y). (We hope...)
SLIDE 104
Isolate intersections
For implicit curves, the tangents of f (x, y) = 0 are all rotations of ▽f = fx(x, y), fy(x, y). So we can formulate the argument for tangent cones equivalently with gradient cones. We choose a direction v such that every gradient vector of some curve f (x, y) lie on the same side of v within the cell. And on the opposite side for g(x, y). (We hope...) Verify by checking ▽f × v = 0 inside the cell
SLIDE 105
Isolate intersections
For implicit curves, the tangents of f (x, y) = 0 are all rotations of ▽f = fx(x, y), fy(x, y). So we can formulate the argument for tangent cones equivalently with gradient cones. We choose a direction v such that every gradient vector of some curve f (x, y) lie on the same side of v within the cell. And on the opposite side for g(x, y). (We hope...) Verify by checking ▽f × v = 0 inside the cell How do we do that?
SLIDE 106
Isolate intersections
▽f × v = fx(x, y) vy − fy(x, y) vx
SLIDE 107
Isolate intersections
▽f × v = fx(x, y) vy − fy(x, y) vx fx(x, y) vy − fy(x, y) vx = 0 is just an implicit curve.
SLIDE 108
Isolate intersections
▽f × v = fx(x, y) vy − fy(x, y) vx fx(x, y) vy − fy(x, y) vx = 0 is just an implicit curve. So to show fx(x, y) vy − fy(x, y) vx = 0, just show that fx(x, y) vy − fy(x, y) vx = 0 doesn’t exist in the cell.
SLIDE 109
Isolate intersections
▽f × v = fx(x, y) vy − fy(x, y) vx fx(x, y) vy − fy(x, y) vx = 0 is just an implicit curve. So to show fx(x, y) vy − fy(x, y) vx = 0, just show that fx(x, y) vy − fy(x, y) vx = 0 doesn’t exist in the cell. Check for intersection with the cell’s edges, and also check for loops.
SLIDE 110
Isolate intersections
▽f × v = fx(x, y) vy − fy(x, y) vx fx(x, y) vy − fy(x, y) vx = 0 is just an implicit curve. So to show fx(x, y) vy − fy(x, y) vx = 0, just show that fx(x, y) vy − fy(x, y) vx = 0 doesn’t exist in the cell. Check for intersection with the cell’s edges, and also check for loops. Wait...
SLIDE 111
Overview
SLIDE 112
Eliminate Loops
Let red be f (x, y) > 0 and blue be f (x, y) < 0
SLIDE 113
Eliminate Loops
Let red be f (x, y) > 0 and blue be f (x, y) < 0 Because we’re dealing with smooth polynomial curves, either the region inside the loop is strictly positive or strictly negative.
SLIDE 114
Eliminate Loops
Let red be f (x, y) > 0 and blue be f (x, y) < 0 Because we’re dealing with smooth polynomial curves, either the region inside the loop is strictly positive or strictly negative. Either way, that means that there is a critical point in that region (i.e. there exists some (x, y) such that fx(x, y) = 0 and fy(x, y) = 0)
SLIDE 115
Eliminate Loops
If there is a loop inside this cell, then there must be a critical point of f (x, y) inside this cell. Cutting through the critical point will cut the loop.
SLIDE 116
Eliminate Loops
If there is a loop inside this cell, then there must be a critical point of f (x, y) inside this cell. Cutting through the critical point will cut the loop. How do we find the critical points?
SLIDE 117
Eliminate Loops
If there is a loop inside this cell, then there must be a critical point of f (x, y) inside this cell. Cutting through the critical point will cut the loop. How do we find the critical points? We need to find where fx(x, y) = 0 and fy(x, y) = 0 simultaneously... in other words, detect the intersection points
- f those two curves inside this cell.
SLIDE 118
Eliminate Loops
If there is a loop inside this cell, then there must be a critical point of f (x, y) inside this cell. Cutting through the critical point will cut the loop. How do we find the critical points? We need to find where fx(x, y) = 0 and fy(x, y) = 0 simultaneously... in other words, detect the intersection points
- f those two curves inside this cell.
First answer: Recursion, we are writing an algorithm to compute the intersection of implicit curves, aren’t we?
SLIDE 119
Eliminate Loops
If there is a loop inside this cell, then there must be a critical point of f (x, y) inside this cell. Cutting through the critical point will cut the loop. How do we find the critical points? We need to find where fx(x, y) = 0 and fy(x, y) = 0 simultaneously... in other words, detect the intersection points
- f those two curves inside this cell.
First answer: Recursion, we are writing an algorithm to compute the intersection of implicit curves, aren’t we? But then for each curve induced by a partial derivative, we have to intersect its partials. This ends up exponential in the degree of the original curves.
SLIDE 120
Eliminate Loops
Second answer: Well we don’t really need to precisely find the critical points. We just need to isolate a region where f (x, y) = 0 and has a point (x0, y0) where fx(x0, y0) = 0 and fy(x0, y0) = 0 We know such a region exists because the region surrounded by the loop is non-zero, and must obtain a maximum and a minimum.
SLIDE 121
Eliminate Loops
Second answer: Well we don’t really need to precisely find the critical points. We just need to isolate a region where f (x, y) = 0 and has a point (x0, y0) where fx(x0, y0) = 0 and fy(x0, y0) = 0 We know such a region exists because the region surrounded by the loop is non-zero, and must obtain a maximum and a minimum. How can we tell if a region contains a point that evaluates to zero, without knowing that point itself??
SLIDE 122
Eliminate Loops
Second answer: Well we don’t really need to precisely find the critical points. We just need to isolate a region where f (x, y) = 0 and has a point (x0, y0) where fx(x0, y0) = 0 and fy(x0, y0) = 0 We know such a region exists because the region surrounded by the loop is non-zero, and must obtain a maximum and a minimum. How can we tell if a region contains a point that evaluates to zero, without knowing that point itself?? Well we can’t, but we can tell that a region does not contain a point that evaluates to zero. How?
SLIDE 123
Eliminate Loops
Second answer: Well we don’t really need to precisely find the critical points. We just need to isolate a region where f (x, y) = 0 and has a point (x0, y0) where fx(x0, y0) = 0 and fy(x0, y0) = 0 We know such a region exists because the region surrounded by the loop is non-zero, and must obtain a maximum and a minimum. How can we tell if a region contains a point that evaluates to zero, without knowing that point itself?? Well we can’t, but we can tell that a region does not contain a point that evaluates to zero. How? Answer: Interval Arithmetic
SLIDE 124
Brief primer on interval arithmetic
We can use intervals to represent our coordinates.
SLIDE 125
Brief primer on interval arithmetic
We can use intervals to represent our coordinates. e.x. x = [−1, 1] y = [1, 2]
SLIDE 126
Brief primer on interval arithmetic
We can use intervals to represent our coordinates. e.x. x = [−1, 1] y = [1, 2] xy = [−2, 2], this interval contains the result for any combination of choices of points in the interval x and the interval y, guaranteed. Even in floating point if you round correctly.
SLIDE 127
Brief primer on interval arithmetic
We can use intervals to represent our coordinates. e.x. x = [−1, 1] y = [1, 2] xy = [−2, 2], this interval contains the result for any combination of choices of points in the interval x and the interval y, guaranteed. Even in floating point if you round correctly. Why is this useful? Consider f (x) = x2, does f (x) contain a zero on the interval [1, 2]?
SLIDE 128
Brief primer on interval arithmetic
We can use intervals to represent our coordinates. e.x. x = [−1, 1] y = [1, 2] xy = [−2, 2], this interval contains the result for any combination of choices of points in the interval x and the interval y, guaranteed. Even in floating point if you round correctly. Why is this useful? Consider f (x) = x2, does f (x) contain a zero on the interval [1, 2]? f ([1, 2]) = [1, 2]2 = [1, 2][1, 2] = [1, 4], and [1, 4] does not contain 0, so there cannot be any choice of x ∈ [1, 2] such that f (x) = 0.
SLIDE 129
Eliminate Loops
So we want to find a rectangular region (x, y) where x = [a, b] and y = [c, d] (The Cartesian product of two intervals), where:
SLIDE 130
Eliminate Loops
So we want to find a rectangular region (x, y) where x = [a, b] and y = [c, d] (The Cartesian product of two intervals), where: 0 ∈ f ([a, b], [c, d])
SLIDE 131
Eliminate Loops
So we want to find a rectangular region (x, y) where x = [a, b] and y = [c, d] (The Cartesian product of two intervals), where: 0 ∈ f ([a, b], [c, d]) 0 ∈ fx([a, b], [c, d])
SLIDE 132
Eliminate Loops
So we want to find a rectangular region (x, y) where x = [a, b] and y = [c, d] (The Cartesian product of two intervals), where: 0 ∈ f ([a, b], [c, d]) 0 ∈ fx([a, b], [c, d]) 0 ∈ fy([a, b], [c, d])
SLIDE 133
Eliminate Loops
So we want to find a rectangular region (x, y) where x = [a, b] and y = [c, d] (The Cartesian product of two intervals), where: 0 ∈ f ([a, b], [c, d]) 0 ∈ fx([a, b], [c, d]) 0 ∈ fy([a, b], [c, d]) Start with the original bounding region and subdivide until you can verify that 0 ∈ f (x, y) or [0 ∈ fx(x, y) or 0 ∈ fy(x, y)]
SLIDE 134
Eliminate Loops
(x, y)
SLIDE 135
Eliminate Loops
SLIDE 136
Eliminate Loops
SLIDE 137
Eliminate Loops
SLIDE 138
Eliminate Loops
SLIDE 139
Eliminate Loops
SLIDE 140
Eliminate Loops
SLIDE 141
Overview
SLIDE 142
Refinement
SLIDE 143
Refinement
SLIDE 144
Refinement
SLIDE 145
Overview
SLIDE 146
Demo
SLIDE 147
Overview
SLIDE 148
Conclusion
There is no formal analysis of the run-time of either curve tracing or encasement.
SLIDE 149
Conclusion
There is no formal analysis of the run-time of either curve tracing or encasement. Encasement appears to match the order of the running time
- f curve tracing.
SLIDE 150
Conclusion
There is no formal analysis of the run-time of either curve tracing or encasement. Encasement appears to match the order of the running time
- f curve tracing.
Separating two curves takes an equal number of tracing steps
- vs. cell splits.
SLIDE 151
Conclusion
There is no formal analysis of the run-time of either curve tracing or encasement. Encasement appears to match the order of the running time
- f curve tracing.
Separating two curves takes an equal number of tracing steps
- vs. cell splits.
But splitting a cell also adds to the space
SLIDE 152
Conclusion
There is no formal analysis of the run-time of either curve tracing or encasement. Encasement appears to match the order of the running time
- f curve tracing.
Separating two curves takes an equal number of tracing steps
- vs. cell splits.
But splitting a cell also adds to the space Future work needs to address space cost.
SLIDE 153
Future Work
Relax the constraint on number of non-intersecting curves If you can construct a polygonal chain between two curves, don’t split
SLIDE 154
Future Work
Allow splits with non-linear geometry (i.e. edges that are degree 2 or 3 curves).
SLIDE 155