Sofa Python Library

Python side of the framework Sofa.

Example:

TODO
splib.algorithms Algorithms we often use.
splib.animation Animation framework focusing in ease of use.
splib.debug
splib.geometric Utility to create mesh derictly via python code with pygmsh
splib.loaders Utilitary function to ease the writing of scenes.
splib.numerics Numerics components we often use.
splib.objectmodel Sofa Prefab
splib.scenegraph Algorithms we often use.
splib.units Toolbox to manipulats units (time, mechanics, material)

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 stlib.scene import MainHeader
from stlib.solver import DefaultSolver
from stlib.physics.rigid import Cube, Sphere, Floor
from stlib.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