1. Introduction

SofaComponentWrapper is a tools to automatically generates python classes from the description of Sofa objects.

1.1. Example of use:

import Sofa
from Sofa.Component.StateContainer.MechanicalObject import *

root = Sofa.Core.Node("root")

params = MechanicalObject.Parameters()
params.size = 3
c = root.addObject(MechanicalObject, params)

1.2. Installation

Unzip the content of https://github.com/SofaDefrost/SofaComponents/releases/download/v24.06.beta/Sofa.Component_v24.06_beta.zip file into your Sofa python installation.

1.3. Generate a new wrap

WARNING: This is not working

Let’s imagine you want to generate a python wrap for the plugin “Sofa.Component” you simply needs to type

gen_sofa_wrapper Sofa.Component