Skip to content

mimesis-inria/STLIB

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

STLIB

Sofa Template Library

This library should contains sofa scene template. It should contains common scene template used regularly to make the writing of scene with Sofa easy. The templates should be compatible with .pyscn and PSL scenes. The library also contains cool utilitary function we should always consider to use.

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])

The API documentation is available at readthedocs

Releases

No releases published

Packages

No packages published

Languages

  • Python 98.3%
  • CMake 1.7%