SceneLoaderPY3
The scene loader for python3 scene files
The `SceneLoaderPY3` loads simulation scenes defined using Python3 scripts into SOFA, translating them into the framework's internal data structures.
- module
- SofaPython3.SceneLoaderPY3.cpp
- namespace
- sofapython3
- include
- SofaPython3/SceneLoaderPY3.h
- inherits
-
- SceneLoader
- description
The SceneLoaderPY3 is a scene loader in the SOFA framework designed specifically for loading simulation scenes defined using Python3 scripts. This component does not directly contribute to any governing equations, constitutive laws, or numerical methods involved in FEM simulations. Instead, it serves as an interface that translates Python-defined configurations into the internal data structures used by SOFA's simulation engine.
Governing Equations and Operators:
- No Contribution: The
SceneLoaderPY3does not implement any specific governing equations, stiffness matrices ((K"]), mass matrices ((M"]), internal forces ((f_{int}"]), or residuals ((R")). These are defined within the simulation scene itself using Python scripts and then loaded into SOFA's simulation framework.
Constitutive or Kinematic Laws:
- No Contribution: The component does not define any constitutive or kinematic laws, strain measures, stress tensors, hyperelastic potentials, or constraint Jacobians. These are typically defined within the scene files that
SceneLoaderPY3loads and are part of the broader simulation setup.
Role in FEM Pipeline:
- Loading Scenes: The primary role of
SceneLoaderPY3is to load Python-based scene configurations into SOFA, translating them into a form that can be used for further assembly, time integration, nonlinear solving, linear solving, constraint handling, and mapping within the simulation pipeline.
Numerical Methods or Discretization Choices:
- No Contribution:
SceneLoaderPY3does not encode any specific numerical methods or discretization choices. These are defined within the scene files that it loads and are part of the configuration for the FEM solvers, mappings, constraints, and other components within SOFA.
Integration into Variational / Lagrangian Mechanics Framework:
- Interface Role: The component acts as an interface between Python scripts and SOFA's internal simulation framework. It ensures that scenes defined in Python can be seamlessly integrated into the broader variational and Lagrangian mechanics framework of SOFA, enabling users to leverage Python for defining complex simulations.
In summary, SceneLoaderPY3 is a utility component designed to facilitate the loading of Python-defined scene configurations into SOFA's simulation environment. It does not contribute directly to the mathematical or physical aspects of FEM simulations but instead provides an essential interface for integrating scripting-based setup definitions.
Methods
bool
canLoadFileExtension
(const char * extension)
virtual
bool
canWriteFileExtension
(const char * extension)
virtual
int
doLoad
(const int & filename, const int & sceneArgs)
void
loadSceneWithArguments
(const char * filename, const int & arguments, int root_out)
int
getFileTypeDesc
()
void
getExtensionList
(ExtensionList * list)
virtual
bool
syntaxForAddingRequiredPlugin
(const int & pluginName, const int & listComponents, int & ss, sofa::simulation::Node * nodeWhereAdded)
{
"name": "SceneLoaderPY3",
"namespace": "sofapython3",
"module": "SofaPython3.SceneLoaderPY3.cpp",
"include": "SofaPython3/SceneLoaderPY3.h",
"doc": "The scene loader for python3 scene files",
"inherits": [
"SceneLoader"
],
"templates": [],
"data_fields": [],
"links": [],
"methods": [
{
"name": "canLoadFileExtension",
"return_type": "bool",
"params": [
{
"name": "extension",
"type": "const char *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "canWriteFileExtension",
"return_type": "bool",
"params": [
{
"name": "extension",
"type": "const char *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "doLoad",
"return_type": "int",
"params": [
{
"name": "filename",
"type": "const int &"
},
{
"name": "sceneArgs",
"type": "const int &"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "loadSceneWithArguments",
"return_type": "void",
"params": [
{
"name": "filename",
"type": "const char *"
},
{
"name": "arguments",
"type": "const int &"
},
{
"name": "root_out",
"type": "int"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getFileTypeDesc",
"return_type": "int",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getExtensionList",
"return_type": "void",
"params": [
{
"name": "list",
"type": "ExtensionList *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "syntaxForAddingRequiredPlugin",
"return_type": "bool",
"params": [
{
"name": "pluginName",
"type": "const int &"
},
{
"name": "listComponents",
"type": "const int &"
},
{
"name": "ss",
"type": "int &"
},
{
"name": "nodeWhereAdded",
"type": "sofa::simulation::Node *"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
}
],
"description": "The `SceneLoaderPY3` is a scene loader in the SOFA ecosystem specifically designed for Python3 scene files. It inherits from the `SceneLoader` class and provides functionality to load scenes written in Python3, extending the flexibility of defining simulation setups through scripting.\n\n### Interactions with Other Components:\n- **canLoadFileExtension**: Checks if a file extension is supported (e.g., `.py`, `.py3`, `.pyscn`, etc.).\n- **doLoad**: Loads the specified Python scene file and creates a new node hierarchy from it, using the `loadSceneWithArguments` method.\n- **getFileTypeDesc**: Returns a description of the file type as 'Python3 Scenes'.\n- **getExtensionList**: Provides a list of supported file extensions for this loader.\n\n### Practical Usage Guidance:\n- This component allows users to define and load complex simulation scenes using Python scripts, leveraging the full power of Python in SOFA simulations.\n- It is particularly useful for those who prefer scripting over XML-based configuration or need dynamic scene generation based on user inputs or external conditions.",
"maths": "The `SceneLoaderPY3` is a scene loader in the SOFA framework designed specifically for loading simulation scenes defined using Python3 scripts. This component does not directly contribute to any governing equations, constitutive laws, or numerical methods involved in FEM simulations. Instead, it serves as an interface that translates Python-defined configurations into the internal data structures used by SOFA's simulation engine.\n\n### Governing Equations and Operators:\n- **No Contribution:** The `SceneLoaderPY3` does not implement any specific governing equations, stiffness matrices (\\(K\"]), mass matrices (\\(M\"]), internal forces (\\(f_{int}\"]), or residuals (\\(R\")). These are defined within the simulation scene itself using Python scripts and then loaded into SOFA's simulation framework.\n\n### Constitutive or Kinematic Laws:\n- **No Contribution:** The component does not define any constitutive or kinematic laws, strain measures, stress tensors, hyperelastic potentials, or constraint Jacobians. These are typically defined within the scene files that `SceneLoaderPY3` loads and are part of the broader simulation setup.\n\n### Role in FEM Pipeline:\n- **Loading Scenes:** The primary role of `SceneLoaderPY3` is to load Python-based scene configurations into SOFA, translating them into a form that can be used for further assembly, time integration, nonlinear solving, linear solving, constraint handling, and mapping within the simulation pipeline.\n\n### Numerical Methods or Discretization Choices:\n- **No Contribution:** `SceneLoaderPY3` does not encode any specific numerical methods or discretization choices. These are defined within the scene files that it loads and are part of the configuration for the FEM solvers, mappings, constraints, and other components within SOFA.\n\n### Integration into Variational / Lagrangian Mechanics Framework:\n- **Interface Role:** The component acts as an interface between Python scripts and SOFA's internal simulation framework. It ensures that scenes defined in Python can be seamlessly integrated into the broader variational and Lagrangian mechanics framework of SOFA, enabling users to leverage Python for defining complex simulations.\n\nIn summary, `SceneLoaderPY3` is a utility component designed to facilitate the loading of Python-defined scene configurations into SOFA's simulation environment. It does not contribute directly to the mathematical or physical aspects of FEM simulations but instead provides an essential interface for integrating scripting-based setup definitions.",
"abstract": "The `SceneLoaderPY3` loads simulation scenes defined using Python3 scripts into SOFA, translating them into the framework's internal data structures.",
"sheet": "# SceneLoaderPY3\n\n## Overview\n\nThe `SceneLoaderPY3` is a utility component in the SOFA ecosystem designed to load and interpret simulation scenes that are defined using Python3 scripts. It inherits from the `SceneLoader` class, extending the flexibility of defining complex simulation setups through scripting.\n\n## Dependencies and Connections\n\nThis component typically requires no specific dependencies but interacts with other components by loading scene configurations into the SOFA framework's internal data structures. The loaded scenes can include various mechanical states, topologies, mappings, solvers, collision models, and visual representations defined in Python scripts."
}