iMSTK
Interactive Medical Simulation Toolkit
|
Needles have physics approximations in iMSTK. There are currently many examples within iMSTK that do implement needles to check out. Amongst others, PBDTissueSurfaceNeedleContact
, PBDTissueVolumeNeedleContact
.
iMSTK currently contains two types of needle definitions.
To setup a PBD simulated StraightNeedle
that is also controlled with a PbdObjectController
one can do:
Add the needle component:
Needles work in junction with Puncturables. Puncturable exists to keep track of the punctures on a tissue. To define something as puncturable add the component to the toolObj
.
Both Needle and Puncturable contain a PunctureMap which is a map of the objects punctures. It's assumed:
A puncture is defined as having a state REMOVED
, TOUCHING
, or INSERTED
. This holds true for all needles. Though sometimes instant puncture needles are desirable, in which case TOUCHING
would not be used. A puncture also contains a UserData
. This is not used by iMSTK but tends to be useful in user code. It contains the ids of the puncturable, ids of the cell punctured, and barycentric weights. When puncture occurs a Puncture
is added to both the Puncturable
and the Needle
's PunctureMap
. This way each can keep track of what punctures it has. ie: PunctureMap
is not shared, but individual Puncture
's are shared.
As mentioned NeedleInteraction
is not yet available in iMSTK but is defined in many iMSTK examples. See PBDTissueVolumeNeedleContact for one such example. Though the internals differ the user facing API is mostly the same.
Suturing is not yet in iMSTK but has been prototyped in an example.