Needle Interactions and Suturing with Two Pbd Objects

I was trying to create a simulation similar to PbdDynamicSuture where the needle is a pbd object instead of a rigid one, however when converting the NeedleInteraction and NeedlePbdCH classes to use PbdObjects instead, the needle does not puncture into the tissue properly. Is there a simple way to get this to function similarly to the rigid needle?

Thanks,
Justin

Hi Justin,

Let me test the needle interaction on my end to make sure its behaving. In the meantime, can you give a few more details on what you mean by properly? The expected behavior is that constraints will be added to the tissue such that the tissue follows the motion of the needle, but still allows the needle to pass through the surface.

Thanks,
Jacob

Hi Jacob,

Sorry, I should have been more descriptive. The needle pushes the tissue, but does not actually puncture it and acts as a regular collision interaction.

Thanks,
Justin

Ah. That is odd. I just ran the PBDTissueVolumeNeedleContact example and the PBDDynamicSuture example and the needle behaves as expected. Make sure you are using the current version of iMST on master and try those examples out. I would focus on the PBDTissueVolumeNeedleContact example since it most closely matches your application.

Let me know if those don’t work for you.

Best,
Jacob

Hi Jacob,

I am on the most recent version of iMSTK. The examples work when unedited, however I’m trying to use the PBDDynamicSutureExample with a PBD needle in order to have the stitching from this example while also being able to grasp and control the needle similarly to the PBDRigidBodyGrasping example (including a two way constraint between the needle and thread). To achieve this I tried changing the needle interaction for this example to take a PbdObject for the needle rather than a RigidObject2. Additionally, in NeedlePbdCH::Handle() I changed the cast for the needle into a PbdObject. From what I could tell there were no other parts of the constraints or collision that referenced rigid objects, however the result is as follows:
suturing_pbdneedle

Also, occasionally the mesh and needle seem to disappear on collision.

Thanks,
Justin

Hi Justin,

Ok. I see what you are doing now. Currently that example only works with a RigidObject2 and not a PbdObject. There is a bit of work to be done to handle curved needles as PbdObjects. Its much easier for straight needles, because it can be a single segment line mesh. Those changes are planned, but there are a few projects ahead of it. Ill notify you once its been updated. If you need it sooner, we can discuss that during our meeting on Friday.

Best,
Jacob

Hi Jacob,

On a separate topic from the post, during the meeting we had you mentioned that I could use a cylinder attached to the tori I was using to simulate collision between them while still using the collision of the torus to interact with the rest of the scene. However when trying this out there appears to be no cylinder to cylinder collision type present in iMSTK. Also, I was unsure of how to create an object that has two different collision geometries.

Thanks,
Justin

HI Justin Jacob might be out for a couple of days. You are right there is not cylinder/cylinder CD at the moment. And yea are currently planning on enabling multiple collision geometries for one object, but it’s not implemented yet. So I am not sure what he was planning there. (Sorry for not being very helpful)

Imstk.NeedleInteraction is not working in the build for Unity. I’ve used the last iMSTK version and NeedleInteraction is only in Examples folder. I have used iMSTK_BUILD_EXAMPLES but still not working in Unity. NeedleInteraction doesn’t exist in the C# build.

Yes, we are actually working on this right now, there is a working branch in imstkUnity called suturing suturing that depends on imstk stitching-update that implements some of the suturing functionality and fixes imstk issues. This is current work in progress though so interfaces may change

Okay, so the iMSTK branch that I have to build is stitching-update. Okay, I’m sorry, thank you!

The Unity repository has a subdirectory ImstkSource~ it’s set up as a submodule to imstk, it (should) barring me messing up the checkin refer to the correct imstk source to go with that version of the asset. if you set up your build to pull the source from that directory, and make sure it’s up to date after a check out. git submodule update will update the source after a pull or using --recurse-submodules with git pull see (Git - Submodules)

Okay, I will see. Thank you so much :smile:. I will work on it after finishing some basic exercises that I want to prepare for my project.