|
1 | | -Welcome to SofaPython3 ! |
2 | | -======================== |
3 | | - |
4 | | -The project is python3 binding for the Sofa simulation framework. |
5 | | -It is composed of one *Sofa plugin* and several *python modules*. |
6 | | - |
7 | | -*Sofa plugin* embeds a python3 interpreter and a scene loader. This plugins allows you to load |
8 | | -a python interpreter in a sofa simulation to write Sofa scene directly using python. It also |
9 | | -permits to implement in python3 custom sofa component like ForceField, Controllers, Visitors. |
10 | | - |
11 | | -Apart from the SofaPython3 plugin we also provide several *python modules* that exposes python different |
12 | | -parts of Sofa. |
13 | | - |
14 | | -The general guidelines design for these binding was to be as much as possible idiomatic python3 API |
15 | | -and with tight integration for numpy. |
16 | | - |
17 | 1 | General overview |
18 | | ------------------ |
19 | | -The Sofa python module: |
20 | | -^^^^^^^^^^^^^^^^^^^^^^^ |
21 | | -Exposes the base Sofa object to build and manipulate a Sofa simulation. |
22 | | - |
23 | | -- contains 4 submodules : |
24 | | - - Sofa.Core, that contains bindings for scene components, |
25 | | - - Sofa.Simulation, that contains functions to conduct simulation, |
26 | | - - Sofa.Types, that contains default types available in Sofa, |
27 | | - - Sofa.Helper, that contains utility functions. |
28 | | -- provides a copy-less API to access the sofa Data containers |
29 | | -- allows to implement custom sofa object (ForceField, Controller) in python |
30 | | -- has docstring documentation |
31 | | - |
32 | | -Try it: ```python import Sofa``` |
33 | | - |
34 | | -The SofaRuntime python module |
35 | | -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
36 | | -- access the runtime specific stuff (GUI, GLViewers, runSofa internal status) [POC] |
37 | | -- docstring with sphinx content [TBD] |
38 | | - |
39 | | -Try it: ```python import SofaRuntime``` |
| 2 | +================ |
40 | 3 |
|
41 | | -Developer's environment |
42 | | -^^^^^^^^^^^^^^^^^^^^^^^ |
43 | | -- autogenerated documentation using sphinx [DONE] |
44 | | -- automated update the docs from the c++'s docstring: https://sofapython3.readthedocs.io/en/latest/ [WIP] |
45 | | -- code completion with common editor [WIP, some editor are not working with c++ modules] |
| 4 | +The SofaPython3 project brings python bindings for the `SOFA simulation framework <https://www.sofa-framework.org>`_. |
| 5 | +Thereby, it allows users to use most of the components and features found in SOFA directly into their python scripts. |
46 | 6 |
|
| 7 | +This project is composed of two modules: a *SOFA plugin* and several *python modules*. |
47 | 8 |
|
48 | | -Execution environment |
49 | | -^^^^^^^^^^^^^^^^^^^^^ |
50 | | -- SofaPython3 is a plugin to include a python3 environment in a Sofa scene [DONE], |
| 9 | +1. The **SofaPython3 plugin** embeds a python interpreter and a SOFA scene loader. This plugin allows one to load a python |
| 10 | +script as the main simulation scene file. The scene loader will automatically detect the ".py", ".py3", ".py3scn" or |
| 11 | +".pyscn" file extension and load the script into the embedded python interpreter. Whereas traditional XML-based scene |
| 12 | +file would discribe the SOFA scene structure, the python scene script will instead programmatically construct the SOFA |
| 13 | +scene. |
51 | 14 |
|
52 | | -Try it: ```xml <RequiredPlugin='SofaPython3'/>``` |
| 15 | +2. The **SofaPython3 bindings** makes the link between the SOFA API and python. These are compiled (C++) python |
| 16 | +modules compatible with the C-Python ABI and therefore directly accessible from any python interpreter, given |
| 17 | +that the python version is compatible. Hence, the python interpreter embedded inside the *SofaPython3 plugin* will be able |
| 18 | +to load these binding modules. In addition, one could load the binding modules directly inside their own python |
| 19 | +interpreter without requiring the load of the plugin. |
53 | 20 |
|
54 | | - |
55 | | -- Sofa and SofaRuntime are the python module that can be imported in any python interpreter (python3, ipython, jupyter)[DONE], |
56 | | - |
57 | | -Try it: ```python python3 minimalscene.py``` |
58 | | - |
59 | | -- Access to Sofa simulation within the MathLab python interpreter [WIP-POC]. |
60 | | -- Make a full python GUI application (with UI framework like PySide2, pygame) and render an integrated sofa scene in an opengl context [POC] |
61 | | - |
62 | | - |
63 | | -Global diagram of SofaPython3 |
64 | | ------------------------------ |
65 | 21 | .. figure:: images/SP3_global_arch.png |
66 | | - :alt: How SP3 fits in the SOFA usage pipeline |
67 | | - :align: center |
| 22 | + :alt: How SP3 fits in the SOFA usage pipeline |
| 23 | + :align: center |
68 | 24 |
|
69 | 25 | Content |
70 | 26 | ------- |
71 | 27 |
|
72 | | - |
73 | 28 | .. toctree:: |
74 | 29 | :glob: |
75 | 30 | :maxdepth: 1 |
76 | 31 |
|
77 | | - menu/Welcome |
78 | | - menu/install |
| 32 | + menu/Compilation |
79 | 33 | menu/SofaPlugin |
80 | 34 | menu/SofaModule |
81 | 35 | menu/pythonLibraries |
82 | 36 | menu/CustomModule |
83 | 37 | menu/Contributing |
84 | 38 |
|
85 | | - |
86 | | -Contributors |
87 | | ------------- |
88 | | - |
89 | | -- Damien Marchal, Research Engineer CNRS |
90 | | -- Bruno Marques, Research Engineer Inria |
91 | | -- Eve Le Guillou, Enginnering Student |
92 | | - |
93 | 39 |
|
0 commit comments