Contact Trees: Adaptive Contact Sampling for Robust Dynamicsfharhad/ganbatte/siggraph2007/... ·...

1
Contact Trees: Adaptive Contact Sampling for Robust Dynamics Danny M. Kaufman *Shinjiro Sueda * Dinesh K. Pai ** University of British Columbia Rutgers University Introduction Algorithms for rigid body dynamics with contact are well known, but challenging to implement due to the interplay between large time steps, general purpose collision detection packages and prag- matic approximations of the underlying inequality constrained con- tact problems. While research on rigid body simulation has focused heavily both on contact resolution and collision detection, contact generation has essentially been ignored. Most contact resolution al- gorithms presume that an ideal set of contacts, fully characterizing system constraints, are available, while collision detection methods generally presume that their task is finished once a set of intersect- ing primitives has been identified. Bridging the gap between these domains, by generating representative contact samples, contact point locations and their associated normals, is crucial for the accuracy, robustness and speed of simulation. This is highlighted by two ob- servations: A contact resolution method, no matter how robust and accu- rate, is restricted by the quality of constraints it has been pro- vided with. Narrow phase collision detection algorithms, although in some senses highly optimized, often perform too much and the wrong kind of work because they do not consider the form of input desired by the physical solver. We address these issues by developing an accurate and adaptive con- tact generation approach that tightly integrates hierarchical collision detection with the generation of well sampled contact constraints. Overview We augment an adaptively sampled distance field [Frisken et al. 2000], stored on an octree grid, with a Bounding-Volume Hierarchy (BVH), local error terms, and surface cell half-spaces. This generates an efficient contact tree structure for both narrow-phase collision de- tection, and accurate distance field evaluation. We precompute a contact tree starting with an input mesh, a max- imum error tolerance, ε s , and a maximum allowed tree depth. The error term guides the distance field’s refinement, while the maximum depth term provides a hard limit for recursion depth. Given an exact signed distance function on our mesh [Baerentzen 2005], we refine our octree until each cell’s local trilinear interpolation of the distance field has an error less than ε s . Adaptive sampling allows asperities, such as sharp corners, and other high frequency features to be well represented by the octree, both on the surface of, and inside each body up to the pre-determined requirements given by ε s . Likewise, simple trilinear interpolation is sufficient for evaluating the distance field within each cell, since the refinement has already considered the second order error terms. For collision detection we construct a BVH on the octree by wrap- ping each cell associated with an octree node using a tight bounding sphere. Leaf nodes in the hierarchy then correspond to the most re- fined cells with the least interpolation error, while branch nodes mov- ing towards the root correspond to coarser cells with increasing error. We store the error associated with each cell at its corresponding node to guide graceful degradation during narrow phase recursion. Each surface spanning cell is also assigned a pre-computed half- space whose boundary spans the locally defined zero-level set. Half- spaces are efficiently stored in local coordinates by normal vectors and their offsets. Within the boundary of the cell, the bounding plane of this half-space is acceptable as a first order surface proxy up to the locally stored error term, and so is suitable for contact point sam- pling. Figure 1: A base mesh, contact tree model and simulations. Because surface spanning cells and their associated wrapping spheres may not closely conform to the actual geometry in large flat regions, we also use the stored half-spaces for collision detection. Whenever a leaf cell is reached by tree traversal during a collision check, we use its half-space to continue checking spheres against it with a half-plane test. Once completed, collision detection generates a list of intersecting sphere pairs from two bodies. For each sphere wrapping a surface spanning cell, we compute a distribution of sample points along the cell’s half-plane boundary. Each such sample point is tested against the cell wrapped by the other sphere and, if inside, against the cell’s distance field. If both tests indicate contact or interpenetration, a final trilinear interpolation returns the constraint normal approximated by the gradient at that point. Conclusion Our approach allows us to produce accurate contact samples, online, from arbitrary triangulated meshes. We efficiently sample both low and high frequency regions of geometries, thus avoiding redundant contacts that lead to poorly conditioned constraint systems. Addi- tionally, by extending our sampling away from the mesh, we enable constraint generation for interpenetrating objects. Finally, our system allows for graceful degradation with local feature awareness. In simulations, this generates an accurate depiction of contact con- straints on a wide range of scales. We can simulate contacts between large flat polygonal regions in a time and memory efficient manner, while simultaneously reproducing the non-linear effects caused by small-scale surface features during collisions [Barzel et al. 1996]. Stable, accurate behavior is thus obtained, even during interpenetra- tion due to large time steps. References BAERENTZEN, J. A. 2005. Signed distance computation using the angle weighted pseudonormal. IEEE Transactions on Visualization and Computer Graphics 11, 3, 243–253. BARZEL, R., HUGHES, J. F., AND WOOD, D. N. 1996. Plausible motion simulation for computer graphics animation. In Computer Animation and Simulation 96, 183–197. FRISKEN, S. F., PERRY, R. N., ROCKWOOD, A. P., AND JONES, T. R. 2000. Adap- tively sampled distance fields: a general representation of shape for computer graph- ics. In Proceedings of ACM SIGGRAPH 00, 249–254.

Transcript of Contact Trees: Adaptive Contact Sampling for Robust Dynamicsfharhad/ganbatte/siggraph2007/... ·...

Page 1: Contact Trees: Adaptive Contact Sampling for Robust Dynamicsfharhad/ganbatte/siggraph2007/... · 2007. 6. 5. · Contact Trees: Adaptive Contact Sampling for Robust Dynamics Danny

Contact Trees: Adaptive Contact Sampling for Robust Dynamics

Danny M. Kaufman∗‡ Shinjiro Sueda∗ Dinesh K. Pai∗‡

∗University of British Columbia ‡Rutgers University

IntroductionAlgorithms for rigid body dynamics with contact are well known,but challenging to implement due to the interplay between largetime steps, general purpose collision detection packages and prag-matic approximations of the underlying inequality constrained con-tact problems. While research on rigid body simulation has focusedheavily both on contact resolution and collision detection, contactgeneration has essentially been ignored. Most contact resolution al-gorithms presume that an ideal set of contacts, fully characterizingsystem constraints, are available, while collision detection methodsgenerally presume that their task is finished once a set of intersect-ing primitives has been identified. Bridging the gap between thesedomains, by generating representative contact samples, contact pointlocations and their associated normals, is crucial for the accuracy,robustness and speed of simulation. This is highlighted by two ob-servations:

• A contact resolution method, no matter how robust and accu-rate, is restricted by the quality of constraints it has been pro-vided with.

• Narrow phase collision detection algorithms, although in somesenses highly optimized, often perform too much and the wrongkind of work because they do not consider the form of inputdesired by the physical solver.

We address these issues by developing an accurate and adaptive con-tact generation approach that tightly integrates hierarchical collisiondetection with the generation of well sampled contact constraints.

OverviewWe augment an adaptively sampled distance field [Frisken et al.2000], stored on an octree grid, with a Bounding-Volume Hierarchy(BVH), local error terms, and surface cell half-spaces. This generatesan efficient contact tree structure for both narrow-phase collision de-tection, and accurate distance field evaluation.

We precompute a contact tree starting with an input mesh, a max-imum error tolerance, εs, and a maximum allowed tree depth. Theerror term guides the distance field’s refinement, while the maximumdepth term provides a hard limit for recursion depth. Given an exactsigned distance function on our mesh [Baerentzen 2005], we refineour octree until each cell’s local trilinear interpolation of the distancefield has an error less than εs.

Adaptive sampling allows asperities, such as sharp corners, andother high frequency features to be well represented by the octree,both on the surface of, and inside each body up to the pre-determinedrequirements given by εs. Likewise, simple trilinear interpolation issufficient for evaluating the distance field within each cell, since therefinement has already considered the second order error terms.

For collision detection we construct a BVH on the octree by wrap-ping each cell associated with an octree node using a tight boundingsphere. Leaf nodes in the hierarchy then correspond to the most re-fined cells with the least interpolation error, while branch nodes mov-ing towards the root correspond to coarser cells with increasing error.We store the error associated with each cell at its corresponding nodeto guide graceful degradation during narrow phase recursion.

Each surface spanning cell is also assigned a pre-computed half-space whose boundary spans the locally defined zero-level set. Half-spaces are efficiently stored in local coordinates by normal vectorsand their offsets. Within the boundary of the cell, the bounding planeof this half-space is acceptable as a first order surface proxy up tothe locally stored error term, and so is suitable for contact point sam-pling.

Figure 1: A base mesh, contact tree model and simulations.

Because surface spanning cells and their associated wrappingspheres may not closely conform to the actual geometry in large flatregions, we also use the stored half-spaces for collision detection.Whenever a leaf cell is reached by tree traversal during a collisioncheck, we use its half-space to continue checking spheres against itwith a half-plane test.

Once completed, collision detection generates a list of intersectingsphere pairs from two bodies. For each sphere wrapping a surfacespanning cell, we compute a distribution of sample points along thecell’s half-plane boundary. Each such sample point is tested againstthe cell wrapped by the other sphere and, if inside, against the cell’sdistance field. If both tests indicate contact or interpenetration, a finaltrilinear interpolation returns the constraint normal approximated bythe gradient at that point.

ConclusionOur approach allows us to produce accurate contact samples, online,from arbitrary triangulated meshes. We efficiently sample both lowand high frequency regions of geometries, thus avoiding redundantcontacts that lead to poorly conditioned constraint systems. Addi-tionally, by extending our sampling away from the mesh, we enableconstraint generation for interpenetrating objects. Finally, our systemallows for graceful degradation with local feature awareness.

In simulations, this generates an accurate depiction of contact con-straints on a wide range of scales. We can simulate contacts betweenlarge flat polygonal regions in a time and memory efficient manner,while simultaneously reproducing the non-linear effects caused bysmall-scale surface features during collisions [Barzel et al. 1996].Stable, accurate behavior is thus obtained, even during interpenetra-tion due to large time steps.

References

BAERENTZEN, J. A. 2005. Signed distance computation using the angle weightedpseudonormal. IEEE Transactions on Visualization and Computer Graphics 11, 3,243–253.

BARZEL, R., HUGHES, J. F., AND WOOD, D. N. 1996. Plausible motion simulation forcomputer graphics animation. In Computer Animation and Simulation 96, 183–197.

FRISKEN, S. F., PERRY, R. N., ROCKWOOD, A. P., AND JONES, T. R. 2000. Adap-tively sampled distance fields: a general representation of shape for computer graph-ics. In Proceedings of ACM SIGGRAPH 00, 249–254.