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

Scene Graph Editor

Information

This API is still work in progress. It correspond to the deeper level of API where all edition between SofaUnity components will be possible. It can be seen as an alternative to the scene file or the python scripts usually used by SOFA users.

For the moment those features should only be used to finalise the simulation graph of a loaded scene. Several components, described below, are already available and it is also possible to manually add new SofaDAGNode in the simulation graph.

SofaComponent specialization

As explain earlier in the SOFA Scene Parsing section. Several categories of component from SOFA are mapped as Unity3D specialized GameObject. The others are created as SofaComponent generic GameObject.
Those specialized implementation allows for example to see the multi-model representation of a 3D object. In the Liver scene it is possible to see the visual
Classic visual rendering of the object using MeshFilter inside the compnent SofaVisualModel.
FEM element can be displayed inside the SofaFEMForceField by activating the Mesh Renderer.
Note that it can slow down the simulation as for example the tetrahedron in this case need to be updated at each frame.
Collision model can also be displayed in the SofaCollisionModel by activating the option Draw collision elements.
Note that same as for FEM, this can slow down the simulation as the element need to be updated at each frame.


Specific SofaComponent

Several very specific components can be created on top of the simulation scene graph using the hierarchy panel.

SofaBeamModel

This component is used to create a visual rendering in Unity3D of a Beam simulation in SOFA. It should be created inside a node having a SofaMesh with a Edge topology. Check the demo scene BeamDemo.

This component has 3 parameters:
  • SofaMesh: Link to the corresponding SofaMesh with the beam structure.
  • Discretisation: Number of face wanted for this beam.
  • Radius: Radius of the visual beam around the simulated structure.

Example of a beam with a high dicretisation value of 10
Same beam with a discretisation value of 2


SofaParticlesModel

This component is used to create a visual rendering in Unity3D of a SPHFluid simulation in SOFA. It should be created inside a node having a SofaMesh with a Point topology. Check the demo scene SPHFluid.
This component has 4 parameters:
  • SofaMesh: Link to the corresponding SofaMesh with the particles structure.
  • Particle Size: The size of each particle.
  • Particle Material: The Unity3D material to use for rendering.
  • Nbr Max: The max number of particles. This parameter need to be manually augmented if needed.
  • P System: This is the Unity3D particle system. It is possible to set an already created one. Otherwise it will be automatially created with the other input paramters.


SofaCollisionPipeline

This component will create the default collision pipeline used in SOFA. See this IntersectionMethod on the SOFA webiste documentation for more information. This Will automatically create a GameObject embedding. It is not yet possible to change the type of algorithm used :