3.1. Sofa

All SOFA key components supported by the SOFA consortium

Example

import Sofa.Core
import Sofa.Simulation
import SofaRuntime
SofaRuntime.importPlugin("Sofa.Component")

n = Sofa.Core.Node("MyNode")
n.addChild("Node2")
n.addObject("MechanicalObject", name="dofs")

Sofa.Simulation.init(n)
Sofa.Simulation.print(n)

Sub-modules

Simulation

Defines how the scene is inited at the beginning, and updated at each time step

Core

Contains the general object hierarchy and data structures

Gui

Controls the graphical user interface

Helper

Manages the message API

Types

Defines SOFA types (BoundingBox)

SofaTypes

Defines all DataTypes for vector and matrices (Vec and Mat)

prefab

Prefabs are python templates for a SOFA scene

constants

Constant library for an easier keyboard interaction.

Utility Functions

msg_error(target, message)

API emitting error messages

msg_info(target, message)

API emitting information messages

msg_warning(target, message)

API emitting warning messages

msg_deprecated(target, message)

API emitting deprecation messages

Additional modules

SofaBaseTopology

Implements some topology component (Regular and SparseGridTopology)

SofaConstraintSolver

Implements the solver for constraint problems

SofaDeformable

Implements linear springs between objects

SofaGL

Exposes the rendering API using OpenGL