Sofa.Core

General description

The general object hierarchy and data structures.

General description

A Sofa simulation is refered as a “Scene”. A scene contains several object. Each objcet is implemented as the aggregation of component. Groups of component are grouped and organized logically using a specific container called Node. Nodes are hierarchically organized in a scene graph.

Commonly used classes:

Node

Overloaded function.

Object

The class object is a base class for simulation components.

ObjectFactory

Main class used to register and dynamically create objects.

Controller

Camera

Camera is an API dedicated to the control of the Camera in SOFA.

Data

The purpose of a data is to store the attributs of your component.

Example of use

import Sofa.Core

# Create a new node
n = Sofa.Core.Node("MyNode")

# Create a new node
n = Sofa.Core.Node("MyNode"")
# Add a child node name 'Node2'
n.addChild("Node2")

# Add a mechanical component to MyNode
n.addObject("MechanicalObject", name="dofs")

Sofa.Simulation.init(root)
Sofa.Simulation.print(root)

API Table of Content

Classes

Base

Root class of the scene graph hierarchy

BaseContext

BaseMeshTopology

BaseNode

BasePrefab

Camera

Camera is an API dedicated to the control of the Camera in SOFA.

ClassEntry

Record storing information about a class

ContactListener

ContactListener is an API dedicated to the monitoring of two collision models.

Context

Controller

Data

The purpose of a data is to store the attributs of your component.

DataContainer

Classic python container implemented for SOFA data fields.

DataContainerContextManager

DataDict

DataDict exposes the data of a sofa object in a way similar to a normal python dictionnary.

DataDictIterator

Iterator reimplemented to fit dataDict.

DataEngine

DataLink

DataString

DataVectorString

ForceFieldRigid2d

ForceFieldRigid3d

ForceFieldVec1d

ForceFieldVec2d

ForceFieldVec3d

ForceFieldVec6d

Link

A Link allows you to access a sofa component from another one anywhere in the simulation graph.

LinkPath

Hold a linkpath to an object or a data.

MassRigid2d

Mass is an API dedicated to the control of a mass in SOFA.

MassRigid3d

Mass is an API dedicated to the control of a mass in SOFA.

MassVec1d

Mass is an API dedicated to the control of a mass in SOFA.

MassVec2d

Mass is an API dedicated to the control of a mass in SOFA.

MassVec3d

Mass is an API dedicated to the control of a mass in SOFA.

MassVec6d

Mass is an API dedicated to the control of a mass in SOFA.

Node

Overloaded function.

NodeIterator

Object

The class object is a base class for simulation components.

ObjectFactory

Main class used to register and dynamically create objects.

PointSetTopologyModifier

PrefabLink

Overloaded function.

RawPrefab

Topology