QuatToRigidEngine
Transform a vector of Rigids into two independent vectors for positions (Vec3) and orientations (Quat).
The `QuatToRigidEngine` transforms vectors of rigid bodies from separate position (Vec3) and orientation (Quat) representations into a single vector of combined rigid body representations.
- module
- Sofa.Component.Engine.Transform
- namespace
- sofa::component::engine::transform
- include
- sofa/component/engine/transform/QuatToRigidEngine.h
- inherits
-
- DataEngine
- templates
-
- sofa::sofa::defaulttype::Vec3Types
- description
The QuatToRigidEngine component in the SOFA framework is designed to convert vectors representing rigid body configurations from a separate representation of positions and orientations (quaternions) into a combined rigid body format. This transformation does not involve any physical governing equations, constitutive laws, or numerical methods directly related to the Finite Element Method (FEM). Instead, it facilitates the manipulation and conversion of data structures in simulations involving rigid bodies.
Mathematical Description:
Input Data Structures
- Positions (
f_positions): A vector of 3-dimensional positions represented as $ extbf{p} = [p_x, p_y, p_z] $. - Orientations (
f_orientations): A vector of orientations represented by quaternions $ q = (w, x, y, z) $, where $ w $ is the scalar part and $ (x, y, z) $ are the vector components. - Colinear Positions (
f_colinearPositions): Optional positions that restrict the output to be colinear in the quaternion Z direction. This is used for additional alignment constraints during transformation.
Output Data Structure
- Rigid Bodies (
f_rigids): A vector of combined rigid body representations, where each element consists of a position $ extbf{p} $ and an orientation represented by a quaternion $ q $.
Transformation Process:
The component performs the following steps to convert input vectors into the output format:
1. Input Retrieval: It retrieves the input positions, orientations, and optional colinear positions.
2. Initialization and Allocation: It initializes an empty vector for storing the transformed rigid bodies (f_rigids).
3. Transformation Loop:
- For each position $ extbf{p}_i $ in f_positions:
- Retrieve the corresponding orientation quaternion $ q_i $.
- If colinear positions are provided and within bounds, adjust the position to be aligned with the Z axis of the orientation.
- Combine the position and orientation into a rigid body representation $ extbf{r}_i = ( extbf{p}_i, q_i) $.
4. Output Update: After transformation, update f_rigids with the new rigid body configurations.
Role in the Global FEM Pipeline:
This component primarily serves as a utility for data conversion and does not directly contribute to any of the core steps in the FEM pipeline such as spatial discretization, time integration, nonlinear solve, or linear solve. Its role is to ensure that rigid body configurations are correctly formatted and ready for use by other components in the simulation scene graph.
Numerical Methods and Discretization Choices:
The QuatToRigidEngine does not employ any specific numerical methods related to FEM. It simply performs data transformations based on given inputs without involving spatial or temporal discretizations typically found in FEM simulations.
Methods
void
doUpdate
()
virtual
void
init
()
virtual
void
reinit
()
virtual
{
"name": "QuatToRigidEngine",
"namespace": "sofa::component::engine::transform",
"module": "Sofa.Component.Engine.Transform",
"include": "sofa/component/engine/transform/QuatToRigidEngine.h",
"doc": "Transform a vector of Rigids into two independent vectors for positions (Vec3) and orientations (Quat).",
"inherits": [
"DataEngine"
],
"templates": [
"sofa::sofa::defaulttype::Vec3Types"
],
"data_fields": [],
"links": [],
"methods": [
{
"name": "doUpdate",
"return_type": "void",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "init",
"return_type": "void",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "reinit",
"return_type": "void",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
}
],
"description": "The `QuatToRigidEngine` is an engine in the SOFA framework that transforms vectors of rigid bodies (positions and orientations) from their representation as vectors of positions (`Vec3`) and quaternions (`Quat`) into a single vector of rigid body representations (`Rigid`). It inherits from `DataEngine`, which means it processes data and manages input/output dependencies. The engine converts the positions and orientations provided as inputs into rigid body objects, which are then outputted for further use in simulations or other components.\n\nThe component interacts with other SOFA components through its API by accepting position vectors (`Vec3`), orientation quaternions (`Quat`), and optional colinear positions. It outputs a vector of `Rigid` types, representing the combined position and orientation information. The methods `doUpdate`, `init`, and `reinit` are overridden to ensure proper data processing and initialization within the SOFA framework.\n\nPractical usage involves setting up the engine with appropriate input data fields (`f_positions`, `f_orientations`, `f_colinearPositions`) and configuring it in a scene graph. The component is particularly useful for converting between different representations of rigid body configurations, enabling compatibility across various simulation stages or components.",
"maths": "The `QuatToRigidEngine` component in the SOFA framework is designed to convert vectors representing rigid body configurations from a separate representation of positions and orientations (quaternions) into a combined rigid body format. This transformation does not involve any physical governing equations, constitutive laws, or numerical methods directly related to the Finite Element Method (FEM). Instead, it facilitates the manipulation and conversion of data structures in simulations involving rigid bodies.\n\n### Mathematical Description:\n\n#### Input Data Structures\n- **Positions (`f_positions`)**: A vector of 3-dimensional positions represented as \\( \textbf{p} = [p_x, p_y, p_z] \\).\n- **Orientations (`f_orientations`)**: A vector of orientations represented by quaternions \\( q = (w, x, y, z) \\), where \\( w \\) is the scalar part and \\( (x, y, z) \\) are the vector components.\n- **Colinear Positions (`f_colinearPositions`)**: Optional positions that restrict the output to be colinear in the quaternion Z direction. This is used for additional alignment constraints during transformation.\n\n#### Output Data Structure\n- **Rigid Bodies (`f_rigids`)**: A vector of combined rigid body representations, where each element consists of a position \\( \textbf{p} \\) and an orientation represented by a quaternion \\( q \\).\n\n### Transformation Process:\n\nThe component performs the following steps to convert input vectors into the output format:\n1. **Input Retrieval**: It retrieves the input positions, orientations, and optional colinear positions.\n2. **Initialization and Allocation**: It initializes an empty vector for storing the transformed rigid bodies (`f_rigids`).\n3. **Transformation Loop**:\n - For each position \\( \textbf{p}_i \\) in `f_positions`:\n - Retrieve the corresponding orientation quaternion \\( q_i \\).\n - If colinear positions are provided and within bounds, adjust the position to be aligned with the Z axis of the orientation.\n - Combine the position and orientation into a rigid body representation \\( \textbf{r}_i = (\textbf{p}_i, q_i) \\).\n4. **Output Update**: After transformation, update `f_rigids` with the new rigid body configurations.\n\n### Role in the Global FEM Pipeline:\n\nThis component primarily serves as a utility for data conversion and does not directly contribute to any of the core steps in the FEM pipeline such as spatial discretization, time integration, nonlinear solve, or linear solve. Its role is to ensure that rigid body configurations are correctly formatted and ready for use by other components in the simulation scene graph.\n\n### Numerical Methods and Discretization Choices:\n\nThe `QuatToRigidEngine` does not employ any specific numerical methods related to FEM. It simply performs data transformations based on given inputs without involving spatial or temporal discretizations typically found in FEM simulations.",
"abstract": "The `QuatToRigidEngine` transforms vectors of rigid bodies from separate position (Vec3) and orientation (Quat) representations into a single vector of combined rigid body representations.",
"sheet": "\\# QuatToRigidEngine\\n\\n## Overview\\nThe `QuatToRigidEngine` is an engine component in the SOFA framework that transforms vectors of rigid bodies from separate position (`Vec3`) and orientation (`Quat`) representations into a single vector of combined rigid body representations. It inherits from `DataEngine`, which means it processes data and manages input/output dependencies.\\n\\n## Parameters and Data\\nThe significant Data fields exposed by the component are:\\n- **f_positions**: A vector of 3-dimensional positions represented as \\(\\textbf{p} = [p_x, p_y, p_z]\\).\\n- **f_orientations**: A vector of orientations represented by quaternions \\(q = (w, x, y, z)\\), where \\(w\\) is the scalar part and \\((x, y, z)\\) are the vector components.\\n- **f_colinearPositions** (optional): Positions that restrict the output to be colinear in the quaternion Z direction. This is used for additional alignment constraints during transformation.\\nThe component outputs a vector of combined rigid body representations (`f_rigids`), where each element consists of a position \\(\\textbf{p}\\) and an orientation represented by a quaternion \\(q\\)."
}