As described in Section 4.5, collisions can be enabled for any class that implements the Collidable interface. Both FemModel3d and FemMeshComp implement Collidable. FemModel3d will use its surface mesh as the collision surface. A FemMeshComp will use its underlying mesh structure. At present, only meshes of type PolygonalMesh are supported.
Since FemMeshComp is also a Collidable, this means we can enable collisions with any embedded mesh inside an FEM. Any forces resulting from the collision are then automatically transferred back to the underlying nodes of the model using Equation (6.5).
Note: Collisions involving shell elements are not yet fully supported. This relates to the fact that shells are thin and can therefore pass through each other easily in a single time step. However, collisions should work properly if
Collisions result in closed intersection contours between the colliding surfaces. This is more likely to occur if one of the surfaces encloses a volume.
An example of FEM collisions is shown in Figure 6.17. The full source code can be found in the ArtiSynth repository under artisynth.demos.tutorial.FemCollisions. The collision-enabling code is as follows:
Notice in the figure that the surface of the green block passes through the table and ellipsoid; only the embedded sphere has collisions enabled.