Skip to content

maxime-tournier/sofa-tutorial

Repository files navigation

This repository contains a tutorial series of SOFA python scenes for basic rigid body simulation.

Requirements

You need an up-to-date build of the SOFA framework, compiled with the SofaPython and Compliant plugins. To enable these, copy the custom_options.cmake file to the SOFA root folder (or add its content to the existing one, if any), then re-run cmake:

git clone https://scm.gforge.inria.fr/anonscm/git/sofa/sofa.git
# cat /path/to/your/sofa-tutorial/custom_options.cmake >> sofa/custom_options.cmake
cd sofa
mkdir build
cd build
cmake ..
make
# time for a coffee :)

You also need to enable the SofaPython plugin in the plugin manager:

cd sofa/build/bin
./runSofa

then go to Edit/Plugin Manager and add the libSofaPython.* library. You should be all set.

Scenes

Each scene file is pretty-much self-documented, here is the index:

  • scene1.py: an empty scene
  • scene2.py: node/object creation, mechanical objects, mass
  • scene3.py: ode and numerical solvers, time step, gravity, visual flags for display
  • scene4.py: mapping a visual model from rigid degrees of freedom
  • scene5.py: mapping collision models
  • scene6.py: refactoring
  • scene7.py: enabling plugins
  • scene8.py: a rigid -> rigid mapping
  • scene9.py: refactoring rigid mappings
  • scene10.py: rigid joint, exponential coordinates, compliance
  • scene11.py: refactoring joints, translation constraints
  • scene12.py: python script controllers, dynamic scene modification
  • scene13.py: a simple PID controller
  • scene14.py: frictional contacts, contact groups

About

tutorial for sofa rigid bodies

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors