stlib.physics.rigid

This package is focused on implementing a standard rigid object for sofa. The object is made described by its surface mesh.

Content:

RigidObject(node[, name, …]) Creates and adds rigid body from a surface mesh.
Cube(node, **kwargs) Create a rigid cube of unit dimension
Sphere(node, **kwargs) Create a rigid sphere of unit dimension
Floor(node, **kwargs) Create a rigid floor of unit dimension

stlib.physics.rigid.RigidObject

stlib.physics.rigid.RigidObject(node, name='RigidObject', surfaceMeshFileName=None, translation=[0.0, 0.0, 0.0], rotation=[0.0, 0.0, 0.0], uniformScale=1.0, totalMass=1.0, volume=1.0, inertiaMatrix=[1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0], color=[1.0, 1.0, 0.0], isAStaticObject=False)[source]

Creates and adds rigid body from a surface mesh.

Args:

surfaceMeshFileName (str): The path or filename pointing to surface mesh file.

totalMass (float): The mass is distributed according to the geometry of the object.

color (vec3f): The default color used for the rendering of the object.

translation (vec3f): Apply a 3D translation to the object.

rotation (vec3f): Apply a 3D rotation to the object in Euler angles.

uniformScale (vec3f): Apply a uniform scaling to the object.

isAStaticObject (bool): The object does not move in the scene (e.g. floor, wall) but react to collision.

Structure:
Node : {
    name : "rigidobject"
    MechanicalObject,
    UniformMass,
    UncoupledConstraintCorrection,
    *EulerImplicit,
    *SparseLDLSolver,

    Node : {
        name : "collision",
        Mesh,
        MechanicalObject,
        Triangle,
        Line,
        Point,
        RigidMapping
    }
    Node : {
       name : "visual"
       OglModel,
       RigidMapping
    }
}

stlib.physics.rigid.Cube

stlib.physics.rigid.Cube(node, **kwargs)[source]

Create a rigid cube of unit dimension

stlib.physics.rigid.Sphere

stlib.physics.rigid.Sphere(node, **kwargs)[source]

Create a rigid sphere of unit dimension

stlib.physics.rigid.Floor

stlib.physics.rigid.Floor(node, **kwargs)[source]

Create a rigid floor of unit dimension