This repository contains a tutorial series of SOFA python scenes for basic rigid body simulation.
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
./runSofathen go to Edit/Plugin Manager and add the libSofaPython.*
library. You should be all set.
Each scene file is pretty-much self-documented, here is the index:
scene1.py: an empty scenescene2.py: node/object creation, mechanical objects, massscene3.py: ode and numerical solvers, time step, gravity, visual flags for displayscene4.py: mapping a visual model from rigid degrees of freedomscene5.py: mapping collision modelsscene6.py: refactoringscene7.py: enabling pluginsscene8.py: a rigid -> rigid mappingscene9.py: refactoring rigid mappingsscene10.py: rigid joint, exponential coordinates, compliancescene11.py: refactoring joints, translation constraintsscene12.py: python script controllers, dynamic scene modificationscene13.py: a simple PID controllerscene14.py: frictional contacts, contact groups