Download presentation
Presentation is loading. Please wait.
Published byAndrew Warner Modified over 8 years ago
1
Minkowski Sums and Distance Computation Eric Larsen COMP 290-72 11-24-98
2
Minkowski Sums and Differences n n Minkowski Sum (A, B) = { a + b | a A, b B } n n Minkowski Difference (A,B) = { a - b | a A, b B } = Minkowski Sum (A, -B) n n A and B collide iff Minkowski Difference(A,B) contains the point 0.
3
AB A B Some Minkowski Differences
4
n n Minkowski Diff.(Translated(A,t1), Translated(B, t2)) = Translated (Minkowski Diff.(A,B), t1 - t2) n n Translated(A, t1) and Translated(B, t2) intersect iff Minkowski Diff(A,B) contains point t2 - t1. n n An example seen last time: – –Robot translated from origin by x intersects Environment iff x Minkowski Diff(Environment, Robot) Minkowski Difference and Translation
5
n n Distance: – –distance(A,B) = min a A, b B || a - b || 2 – –distance(A,B) = min c Minkowski-Difference(A,B) || c || 2 – –if A and B disjoint, c is point on boundary of Minkowski difference n n Intersection-Depth: – –intersection-depth(A,B) = min{ || t || 2 | A Translated(B,t) = } – –intersection-depth(A,B) = min t Minkowski-Difference(A,B) || t || 2 – –if A and B intersecting, t is point on boundary of Minkowski difference Other Properties
6
Practicality n n Expensive to compute boundary of Minkowski difference: – –For convex polyhedra, Minkowski difference may take O(n 2 ) – –For general polyhedra, no known algorithm of complexity less than O(n 6 ) is known n n Yet, no better approach is known for true intersection depth n n Distance is more promising. Minkowski differences are not the only theory applied to this problem.
7
GJK Method for Convex Polyhedra n n GJK-DistanceToOrigin ( P ) // dimension is m n n 1. Initialize P 0 with m+1 or fewer points. n n 2. k = 0 n n 3.while (TRUE) { n n 4. if origin is within CH( P k ), return 0 n n 5. else { n n 6. find x CH(P k ) closest to origin, and S k P k s.t. x CH(S k ) n n 7. see if any point p -x in P more extremal in direction -x n n 8. if no such point is found, return |x| n n 9. else { n n 10. P k+1 = S k {p -x } n n 11. k = k + 1 n n 12. } n n 13. } n n 14.}
8
GJK - Example
9
n n Each iteration of the while loop requires O(n) time. n n O(n) iterations possible, but authors claim between 3 and 6 iterations on average for any problem size, making this “expected” linear. n Trivial O(n) algorithms exist if we are given the boundary representation of a convex object, but GJK will work on point sets - computes CH lazily. GJK - Running Time
10
n n A = CH(A’) A’ = { a 1, a 2,..., a n } n n B = CH(B’) B’ = { b 1, b 2,..., b m } n n Minkowski-Diff(A,B) = CH(P), P = {a - b | a A’, b B’} n n Thus, GJK-DistanceToOrigin(P) will find distance(A, B), but P has m*n points. n n Can compute points of P on demand: – –p -x = a -x - b x where a -x is the point of A’ extremal in direction -x, and b x is the point of B’ extremal in direction x. n n The loop body would now take O(n + m) time, producing the same “expected” linear performance overall. GJK - Two Convex Objects
11
n Observations: –for “smoothly” transforming convex objects, closest points may change little in successive frames - notion of coherence. –it is possible to confirm that two features (edges, vertices, faces) are the closest points of two convex objects in constant time, given some preprocessing of the polyhedra. n Method: –track closest points –after each transformation, make expected constant time adjustment of closest points Lin-Canny Method for Convex Polyhedra
12
Voronoi Regions n n Localized verification of closest features made possible by precomputing an external Voronoi diagram for the polyhedron n n External Voronoi diagram - divide space outside polyhedron into regions, such that points inside each region are closest to a corresponding “feature” - a face, edge, or vertex - of the polyhedron.
13
Voronoi Regions
14
Lin-Canny Algorithm n n Given one feature from each polyhedron, find the closest points of the two features. If each point is in the Voronoi region of the other feature, closest features have been found. (more on this later)
15
Lin-Canny Algorithm n n Otherwise, one of the points (call its feature F) is in the Voronoi region of another feature F’, and therefore closer to it. Can select F and F’ as next candidate feature pair.
16
Lin-Canny Running Time n n Distance strictly decreases with each change of feature pair, and no pair of features can be selected twice. n n Worst case O(n 2 ) pairs checked. n n Convergence to closest pair typically better: – –O(1) achievable in simulations with coherence. – –Closer to O(n) even without coherence.
17
n n Definition: for two points a and b, slab(a,b) is the slab bounded by parallel planes, one through a and another through b, both with normal a - b Proof of Local Verification a b slab(a,b)
18
n n Claim: for two convex point sets A and B, points a A and b B are closest slab(a,b) has empty interior. Proof of Local Verification a b slab(a,b) c
19
Proof of Local Verification n n Proof: n n : – –suppose a and b are closest, but that slab(a, b) has nonempty interior. – –Pick an arbitrary point inside slab(a,b), c which belongs to one of the point sets. Suppose it belongs to A. By convexity of A, line segment ca is inside A. Some point on ca is closer to b than a. Contradiction. n n : given all points of A and B outside or on surface of slab, length || a - b || 2 is a lower bound.
20
Proof of Local Verification n n Local verification steps: – –step 1: find closest points a, b on two features f a, f b. – –step 2: verify each point is inside other feature’s Voronoi region - i.e. each point not in the Voronoi region of another feature. n n Need to show this is sufficient to verify closest points on polyhedra A and B are a and b.
21
Proof of Local Verification n n By above claim, could do this by showing all points of polyhedra A and B are outside or on slab(a,b). n first f a and f b are convex and therefore on or outside slab(a,b). n n What if some point, from A for example, inside the slab(a,b)? Provided A and B do not overlap, there would be some boundary point of A closer to b than a, implying b closer to some other feature f than f a, and inside Voronoi(f). Contradiction.
22
n n Many local minima make distance more complicated for non-convex models: – –Discontinuous change of closest features with transformations – –When a local minimum is found, no longer able to disregard rest of the model Distance for General Models
23
n n Decompose into convex pieces, and take minimum over all pairs of pieces: – –Optimal (minimal) model decomposition is NP-hard. – –Approximation algorithms exist for closed solids, but what about a list of triangles? n n Decompose into triangles: – –n*m pairs of triangles - brute force expensive – –Bounding volume hierarchies used to accelerate minimum finding Methods for General Models
24
n n Model Hierarchy: – –each node has a simple volume that bounds a set of triangles. – –children contain volumes that each bound a different portion of the parent’s triangles. – –The leaves of the hierarchy usually contain individual triangles. n n A binary bounding volume hierarchy: Hierarchical Collision Detection
25
n n 1. Recursive-Collide(BV a, BV b) { n n 2. if (! bv-overlap(a,b)) return; n n 3. if (leaf(a) && leaf(b)) { n n 4. tri-overlap(tri(a), tri(b)) n n 5. } n n 6. else if (!leaf(a)) { n n 7. Recursive-Collide(lchild(a), b) n n 8. Recursive-Collide(rchild(a), b) n n 9. } n n 10. else { n n 11. Recursive-Collide(a, lchild(b)) n n 12. Recursive-Collide(a, rchild(b)) n n 13. } n n 14.} Hierarchical Collision Detection
27
n n Test at least one pair of triangles to get a “candidate” minimum distance. n n Recursion terminates when distance between bounding volumes > candidate minimum distance. n n Differences from collision detection: – –mandatory visitation of leaf nodes – –wider search tree – –BV distance generally more expensive than overlap Hierarchical Distance Computation
28
n n Hierarchy building: – –Uses spheres as bounding volume – –First tiles surface of triangles with many small spheres, so that many leaf nodes may have a pointer to the same triangle. – –Builds a hierarchy top down that bounds these spheres, instead of triangles. Quinlan’s Approach
30
n n Distance Computation: – –Same method as previously outlined, except that many leaf node pairs may correspond to same triangle. – –Triangle pair distances are hashed to avoid redundant computations. n n Quinlan’s code is currently the fastest in practice for general models. n n Tiling may be most critical factor. Quinlan’s Approach
31
n n Distance Computation: – –Same method as previously outlined, except that many leaf node pairs may correspond to same triangle. – –Triangle pair distances are hashed to avoid redundant computations. n n Quinlan’s code is currently the fastest in practice for general models. n n Tiling may be most critical factor. Quinlan’s Approach
32
n n Distance Computation: – –Same method as previously outlined, except that many leaf node pairs may correspond to same triangle. – –Triangle pair distances are hashed to avoid redundant computations. n n Quinlan’s code is currently the fastest in practice for general models. n n Tiling may be most critical factor. Quinlan’s Approach
33
n n Distance Computation: – –Same method as previously outlined, except that many leaf node pairs may correspond to same triangle. – –Triangle pair distances are hashed to avoid redundant computations. n n Quinlan’s code is currently the fastest in practice for general models. n n Tiling may be most critical factor. Quinlan’s Approach
34
n n Minkowski Difference is useful theory but costly to compute explicitly. n n Not only applicable theory to distance computation, as evidenced by Lin-Canny and hierarchical methods n n Coherence not yet exploited for non-convex models - hierarchical methods currently most useful. Conclusions
35
n n Computing the Intersection-Depth of Polyhedra - Dobkin, Hershberger, Kirkpatrick, Suri n n A Fast Procedure for Computing the Distance Between Complex Objects in Three-Dimensional Space - Gilbert, Johnson, Keerthi 1988 n n Efficient Collision Detection for Animation and Robotics - Ming Lin 1994 n n Efficient Distance Computation between Non-Convex Objects - Sean Quinlan 1994 References
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.