Sofa Template LibraryΒΆ
Utility functions and scene templates for the real-time simulation framework Sofa. The different templates are organized in types and abstract the complexity of object creation with Sofa.
The library is hosted on github https://github.com/SofaDefrost/STLIB/ and it can be used with scenes written in python and PSL.
Example:
from stlib3.scene import MainHeader
from stlib3.solver import DefaultSolver
from stlib3.physics.rigid import Cube, Sphere, Floor
from stlib3.physics.deformable import ElasticMaterialObject
def createScene(rootNode):
MainHeader(rootNode)
DefaultSolver(rootNode)
Sphere(rootNode, name="sphere", translation=[-5.0, 0.0, 0.0])
Cube(rootNode, name="cube", translation=[5.0,0.0,0.0])
ElasticMaterialObject(rootNode, name="dragon",
volumeMeshFileName="mesh/liver.msh",
surfaceMeshFileName="mesh/dragon.stl"
translation=[0.0,0.0,0.0])
Floor(rootNode, name="plane", translation=[0.0, -1.0, 0.0])
Content:
stlib.physics |
Templates for physical simulation. |
stlib.visuals |
Templates for rendering. |
stlib.solver |
Templates for most of the common time integration setups. |
stlib.scene |
Templates for most of the common scene setups. |
stlib.tools |