SofaAPAPI-Unity3D Getting Started Features Available SOFA Scene Parsing Object Creation Scene Graph edition Examples Assets Available Release Notes License
     

SOFA simulation scene parsing

SOFA Object creation

Like in the SOFA simulation scene parsing. The first step to do is to create the SofaContext GameObject.
From that step, it is now possible to create several SOFA Objects through the UI Hierarchy panel. It can be seen as a higher API level which will create all the SOFA DAGNode and components to create the object.
The first type of objects are simple primitive like cubes, cylinders or planes. The second type are specific SOFA objects like collision objects.

Primitive Object

It is possible to create several types of geometry directly as GameObjects in Unity3D using the interface.
Here is the list of primitive Object:
  • SofaSphere / SofaRigidSphere:

  • SofaBox / SofaRigidBox:

  • SofaCylinder / SofaRigidCylinder:

  • SofaRigidPlane / SofaPlane:
3D Sphere, available in Rigid or Deformable mode.

3D Box, available in Rigid or Deformable mode.

3D Cylinder, available in Rigid or Deformable mode.

2D Plane, available only in Rigid or Deformable mode.
Rigid mode means the object will be simulated in the scene and will collide but won’t move or deform.
Whereas the deformable objects will collide and are modelized using Tetrahedral Finite Element Method. It is thus possible to set their mass, resolution and FEM parameters.
They can be placed and transformed in 3D using internal parameters and not the unity Transform values.


The creation of a SofaPrimitiveObject will result into the creation of SofaDAGNode owning all the SOFA components needed for the simulation of such 3D object. Like the mesh, the mass, FEM and Collision models. But it will also add a Solver to that node. Finally a second SofaDAGNode will be created to add a SofaVisualModel to render the 3D object.


SofaObject Creation

In addition to the SofaPrimitiveObject, some specific objects will be provided. For the moment this section is very limited.
The first noticeable object is the possibility to create a sphere collision model on top of Unity3D objects.

The SofaSphereCollisionModel will create spheres that can be seen as gizmos on the Unity side which are mapped to collision sphere inside the Sofa simulation scene.

The demo scene Tissue_fall is an example of that feature.

Several parameters can be set: