Grasping¶
Grasping constrains a physics simulated object through contact by another. The object doing grasping must be a rigid tool such as shown in the DynamicalModel's section. The object being grasping can be a deformable (such as a tissue) or a rigid (such as a needle or tool).
It is expected a user would link this up with a button, or some other trigger. Activating it with:
To release the grasp:
Two-Way or One-Way Grasping¶
iMSTK supports both two-way and one way grasping
Two-Way¶
With two-way grasping there must be two physics enabled PbdObjects. When the grasp occurs forces will be felt on both objects.
As shown earlier this can be setup like so:
This can be used together with PbdObjectController
to feel forces on objects in two-way.
One-Way¶
With one-way grasping one can grasp a physics simulated PbdObject with a non-physics simulated one or even an object using a different DynamicalModel
.
Setup with:
Perform the grasp with:
In the instance of one-way the grasped particles will deform with the myCapsuleGeometry
as it transforms.
Mapping¶
The grasping class supports mapping of geometries. One can supply it a GeometryMap
to map back to another geometry. For example, if the user sets up a TetrahedralMesh with a SurfaceMesh mapped onto it. They can then supply that GeometryMap
to the PbdObjectGrasping
. This can be used to grasp only a specific portion of a simulated object. Or to grasp using differing topologies.
Multi Point Grasping¶
Two graspings may be setup on the same objects.
Multiple graspings can occur on the same object (needle in this example). Works with two-way as well.
Grasp Tools in VR¶
Grasping tools in VR is common use case. In these instances one can model a pair of hands with Sphere
geometry, controlled by VR controllers using PbdObjectController
.
Then grasping can be setup between a rigid tool and hand.
With two-way pbdHands and the controller should "feel" the forces from grasping the tool.
Grasp with Dilated Geometry¶
Often it is usefult to use collision and grasping. In these instances it's recommended to use a slightly dilated geometry to grasp.