Hi! Happy to be here again.
Does iMSTK allow to use a SUPERFICIAL mesh with different resolution for visuals and collision than the SUPERFICIAL resolution of the tetrahedral mesh used as physics? Let me explain
LEFT: VISUAL | RIGHT: PHYSICS
(Example image just to seee the different resolutions)
I know there is a “DeformableMap” that allows to modificate “Force One One”, but the only case where I can use the mesh in a normal way and collide other objects with it without breaking them is:
Visual and collision: Surface mesh of .vtk
Physical: tetrahedral mesh of .vtk
Is this a bug or it’s about my scene setup?
THANKS! @Harald_Scheirich
There are two kinds of mappings available, in imstk they’re called PointwiseMap
and PointToTetMap
, the “Force One On One” option in unity forces a PointwiseMap
. This map expects the points of the parent and chiled to coincide with each other. If you leave that off it should use a PointToTetMap
whenever there is an underlying Tetrahedral mesh as a parent. This should modify the child mesh in relation to the modifications of the parent mesh without needing any points to be coincidental. Caveat, i haven’t used this in a while so i don’t know how well it’s working, if you tried leaving off the “force…” option and it did not work it could be it’s not set up correctly in unity, or there is something wrong in the PointToTetMap
class
Hope this helps
I think it is about ‘PointToTetMap’, it’s not working. Even so,there is a picture of my setup.
This is not working when there are collisions. This is an example where the vertex are the same for both meshes, so it works with “Force one one” but doesn’t without it (using ‘PointToTetMap’).
Everything is in the same gameobject, I don’t know if this is not valid.
Yea everything on one gameobject is fine, but you are walking down a path that is not well (or even at all tested) usually a high resolution visual mesh is sufficient where the collision and physics meshes would be lower. Thinking about it again i don’t think you would be able to sued the PointToTet map on the collision mesh. I don’t see that working with regards to collision handling. The visual mesh should be fine
I just got it to not freeze or result in any errors. Now I am going to try to make it collide, because at the moment the mesh does not react to the collision. I will be updating. I leave photo of the new setup:
The “PointToTetMapper” relies on the parent structure being tetrahedra try the following setup
Pointwise
Physics Parent
Collision Child
PointToTet
Physics Parent
Visual Child
Simplified PointToTetMap
will calcualate a baricentric coordinate of the original point in relation to the closest tetrahedron of the original mesh. Then when the tetrhedron gets deformed, the new point is calculated by appying the baricentric parameters to deformed tet
I think it is working!! Thank you!