Skip to content

ENH: PbdObjectGrasping, Picking, & PbdBaryPointToPointConstraint

Andrew Wilson requested to merge andrew.wilson/iMSTK:PbdElementPicking into master


  • Removes PbdPickingCH, CH is now reserved only for those doing contact responses. Additionally the linkage/dependencies prevents solid implementation of picking within a CH.
  • PbdObjectPicking is now PbdObjectGrasping. There is a delineation between the two. Picking is the act of selection whereas grasping involves the physics to take the picking & move it according to Pbd. Picking has been abstracted into CollisionDetection for now. Picking can now be used for selection in other parts of code as it has been often used.
  • The previous PbdPickingCH is equivalent to the "GraspMode::Vertex". Here are the provided modes at the moment:
    • GraspMode::Vertex: Grasps any vertices within provided picking shape.
    • GraspMode::Cell: Grasps any cells intersecting picking shape (Grasps vertices of the cell, good for coarse meshes).
    • GraspMode::RayPoint: Grasps an individual point on a cell using a ray (good for coarse but precise grasping).
    • GraspMode::RayCell: Grasps an individual cell using a ray.
    • GraspMode::Nearest: Grasps nearest point on a cell using a point.
  • Provides the hashable Triangle that keeps getting used in SurfaceMesh.
  • Decreases times and cloth size of mesh in SceneSwitchTest to make it more lightweight/faster (to avoid timeouts).
  • Some unneeded virtuals removed.
  • Bug fix in ray to plane test. Edge case of ray pointing out of the plane wasn't handled before. Test added.
  • Support arbitrary one to one mappings in PbdObjectGrasping. (You can supply it any other geometry and a mapping to perform picking). Neat if you only want to pick a small portion of a simulated geometry.


  • PbdThinTissueGrasping: Grasping of a surface mesh tissue.
  • PbdTissueGrasping: Grasping of a tetrahedral tissue.
Edited by Andrew Wilson

Merge request reports