Back

AffineMovementProjectiveConstraint

The `AffineMovementProjectiveConstraint` is a SOFA component designed to constrain the movement of specific points in a mesh by applying an affine transformation (rigid motion). This constraint imposes predefined motions on boundary points, with intermediate values computed through linear interpolation based on given corner movements. The component can be configured to apply constraints within a specified time interval, from `beginConstraintTime` to `endConstraintTime`. It supports both rotation and translation transformations, applicable to border points defined in the mesh indices. This component interacts primarily with the mechanical state of the simulation through its base class `ProjectiveConstraintSet`, enabling it to modify response (forces), velocities, positions, and Jacobian matrices. Additionally, it links to a topology container (`l_topology`) for retrieving necessary topological information about the mesh. Usage involves setting up the indices of constrained points (`d_indices`), specifying rotation (`d_rotation`), quaternion (`d_quaternion`), and translation (`d_translation`) values, and defining the constraint time interval. The component can also visualize the constrained points by enabling `d_drawConstrainedPoints`. Methods such as `addConstraint`, `removeConstraint`, and `clearConstraints` allow for dynamic management of the constrained indices.

abstract
The `AffineMovementProjectiveConstraint` imposes rigid motion on specific mesh points by applying affine transformations (rotation and translation) within a specified time interval, enforcing kinematic constraints through linear interpolation.
sheet
# AffineMovementProjectiveConstraint ## Overview The `AffineMovementProjectiveConstraint` is a SOFA component that enforces rigid motion on selected boundary points of a mesh by applying affine transformations (rotation and translation) within a specified time interval. It inherits from the `ProjectiveConstraintSet` class, enabling it to modify response forces, velocities, positions, and Jacobian matrices. ## Mathematical Model The primary role of this component is to enforce bilinear constraints on selected boundary points by applying an affine transformation defined by rotation matrix \( R \) or quaternion \( q \), and translation vector \( t \). The motion enforcement can be mathematically described as follows: 1. **Initial Position Initialization:** - For each point indexed in `d_indices`, the initial position \( x_0[i] \) is set during initialization. 2. **Final Position Computation:* - The final positions of constrained points are computed by applying the affine transformation to their respective initial positions: For non-rigid types: \[ x_f[i] = R \cdot x_0[i] + t \] For rigid types (including orientation): \[ x_f[i].center = R \cdot x_0[i].center + t \] \[ x_f[i].orientation = q + x_0[i].orientation \] 3. **Linear Interpolation:** - Between `beginConstraintTime` and `endConstraintTime`, the intermediate positions of the points are linearly interpolated between their initial and final positions: \[ x(t) = x_0[i] + (x_f[i] - x_0[i]) \cdot \frac{t - beginConstraintTime}{endConstraintTime - beginConstraintTime} \] 4. **Projection Methods:** - The component ensures that the response forces, velocities, and positions are adjusted to reflect this constrained motion: \[ projectResponse \implies dx[i] = 0 \quad \forall i \in d_indices\] \[ projectVelocity \implies v[i] = 0 \quad \forall i \in d_indices\] \[ projectPosition \implies x[i] = x_f[i] \quad \text{for} \quad t > endConstraintTime\] ## Parameters and Data - **beginConstraintTime (SReal):** Begin time of the bilinear constraint. - **endConstraintTime (SReal):** End time of the bilinear constraint. - **rotation (RotationMatrix):** Rotation matrix applied to border points. - **quaternion (Quat):** Quaternion applied to border points. - **translation (Vec3):** Translation vector applied to border points. - **drawConstrainedPoints (bool):** Flag to draw constrained points. ## Dependencies and Connections The component requires a link to the topology container (`l_topology`) for retrieving necessary topological information about the mesh. It interacts with the mechanical state through its base class `ProjectiveConstraintSet`, modifying response forces, velocities, positions, and Jacobian matrices.
description
The `AffineMovementProjectiveConstraint` is a SOFA component designed to constrain the movement of specific points in a mesh by applying an affine transformation (rigid motion). This constraint imposes predefined motions on boundary points, with intermediate values computed through linear interpolation based on given corner movements. The component can be configured to apply constraints within a specified time interval, from `beginConstraintTime` to `endConstraintTime`. It supports both rotation and translation transformations, applicable to border points defined in the mesh indices. This component interacts primarily with the mechanical state of the simulation through its base class `ProjectiveConstraintSet`, enabling it to modify response (forces), velocities, positions, and Jacobian matrices. Additionally, it links to a topology container (`l_topology`) for retrieving necessary topological information about the mesh. Usage involves setting up the indices of constrained points (`d_indices`), specifying rotation (`d_rotation`), quaternion (`d_quaternion`), and translation (`d_translation`) values, and defining the constraint time interval. The component can also visualize the constrained points by enabling `d_drawConstrainedPoints`. Methods such as `addConstraint`, `removeConstraint`, and `clearConstraints` allow for dynamic management of the constrained indices.
maths
The `AffineMovementProjectiveConstraint` component in the SOFA framework is designed to enforce a rigid motion on specific points within a mesh by applying an affine transformation, which includes both rotation and translation. The constraint operates by linearly interpolating the movement of boundary points based on specified corner movements over a given time interval from `beginConstraintTime` to `endConstraintTime`. This component plays a crucial role in the FEM simulation pipeline, particularly within the context of constraints and mappings, ensuring that specific mechanical behaviors are enforced upon particular regions of the mesh. ### Governing Equations and Operators: The primary role of this component is to enforce a bilinear constraint on selected boundary points. Specifically, it imposes a rigid transformation defined by a rotation matrix \( R \) or quaternion \( q \), and translation vector \( t \). The motion enforcement can be mathematically described as follows: 1. **Initial Position Initialization: ** - For each point indexed in `d_indices`, the initial position \( x_0[i] \) is set during initialization. 2. **Final Position Computation:** - The final positions of constrained points are computed by applying the affine transformation to their respective initial positions: For non-rigid types: \[ x_f[i] = R \cdot x_0[i] + t \] For rigid types (including orientation): \[ x_f[i].center = R \cdot x_0[i].center + t \] \[ x_f[i].orientation = q + x_0[i].orientation \] 3. **Linear Interpolation:** - Between `beginConstraintTime` and `endConstraintTime`, the intermediate positions of the points are linearly interpolated between their initial and final positions: \[ x(t) = x_0[i] + (x_f[i] - x_0[i]) \cdot \frac{t - beginConstraintTime}{endConstraintTime - beginConstraintTime} \] 4. **Projection Methods:** - The component ensures that the response forces, velocities, and positions are adjusted to reflect this constrained motion: \[ projectResponse \implies dx[i] = 0 \quad \forall i \in d_indices\] \[ projectVelocity \implies v[i] = 0 \quad \forall i \in d_indices\] \[ projectPosition \implies x[i] = x_f[i] \quad \text{for} \quad t > endConstraintTime\] ### Constitutive or Kinematic Laws: The component does not define new constitutive laws but rather enforces kinematic constraints by directly modifying the positions, velocities, and forces of selected boundary points. The key kinematic laws involve linear interpolation between initial and final positions over time. ### Role in the Global FEM Pipeline: In the broader context of the FEM simulation pipeline, this component contributes to the constraint handling phase, ensuring that specified boundary conditions are met. It interacts with the mechanical state by modifying response forces, velocities, and positions as necessary to enforce the imposed rigid motion constraints. ### Numerical Methods or Discretization Choices: The numerical methods employed include linear interpolation for computing intermediate positions between initial and final states based on time. The component uses direct assignment of transformations without explicit discretization schemes beyond simple bilinear time interpolation. ### Variational / Lagrangian Mechanics Framework Fit: This constraint component fits into the variational mechanics framework by enforcing specific kinematic constraints directly, which implicitly modifies the equations of motion through constraints. This ensures that any variations or displacements must comply with the imposed rigid transformations on specified points within the mesh.
{
  "name": "AffineMovementProjectiveConstraint",
  "main": {
    "name": "AffineMovementProjectiveConstraint",
    "namespace": "sofa::component::constraint::projective",
    "module": "Sofa.Component.Constraint.Projective",
    "include": "sofa/component/constraint/projective/AffineMovementProjectiveConstraint.h",
    "doc": "Constraint the movement by a rigid transform.\n\nImpose a motion to all the boundary points of a mesh. The motion of the 4 corners are given in the data m_cornerMovements and the movements of the edge points are computed by linear interpolation.",
    "inherits": [
      "ProjectiveConstraintSet"
    ],
    "templates": [
      "sofa::defaulttype::Rigid3Types",
      "sofa::defaulttype::Vec3Types"
    ],
    "data_fields": [
      {
        "name": "d_beginConstraintTime",
        "type": "SReal",
        "xmlname": "beginConstraintTime",
        "help": "Begin time of the bilinear constraint"
      },
      {
        "name": "d_endConstraintTime",
        "type": "SReal",
        "xmlname": "endConstraintTime",
        "help": "End time of the bilinear constraint"
      },
      {
        "name": "d_rotation",
        "type": "RotationMatrix",
        "xmlname": "rotation",
        "help": "rotation applied to border points"
      },
      {
        "name": "d_quaternion",
        "type": "Quat",
        "xmlname": "quaternion",
        "help": "quaternion applied to border points"
      },
      {
        "name": "d_translation",
        "type": "Vec3",
        "xmlname": "translation",
        "help": "translation applied to border points"
      },
      {
        "name": "d_drawConstrainedPoints",
        "type": "bool",
        "xmlname": "drawConstrainedPoints",
        "help": "draw constrained points"
      }
    ],
    "links": [
      {
        "name": "l_topology",
        "target": "BaseMeshTopology",
        "kind": "single",
        "xmlname": "topology",
        "help": "link to the topology container"
      }
    ],
    "methods": [
      {
        "name": "clearConstraints",
        "return_type": "void",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "addConstraint",
        "return_type": "void",
        "params": [
          {
            "name": "index",
            "type": "int"
          }
        ],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "removeConstraint",
        "return_type": "void",
        "params": [
          {
            "name": "index",
            "type": "int"
          }
        ],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "init",
        "return_type": "void",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "projectResponse",
        "return_type": "void",
        "params": [
          {
            "name": "mparams",
            "type": "const core::MechanicalParams *"
          },
          {
            "name": "resData",
            "type": "DataVecDeriv &"
          }
        ],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "projectVelocity",
        "return_type": "void",
        "params": [
          {
            "name": "mparams",
            "type": "const core::MechanicalParams *"
          },
          {
            "name": "vData",
            "type": "DataVecDeriv &"
          }
        ],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "projectPosition",
        "return_type": "void",
        "params": [
          {
            "name": "mparams",
            "type": "const core::MechanicalParams *"
          },
          {
            "name": "xData",
            "type": "DataVecCoord &"
          }
        ],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "projectJacobianMatrix",
        "return_type": "void",
        "params": [
          {
            "name": "",
            "type": "const core::MechanicalParams *"
          },
          {
            "name": "",
            "type": "DataMatrixDeriv &"
          }
        ],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getFinalPositions",
        "return_type": "void",
        "params": [
          {
            "name": "finalPos",
            "type": "VecCoord &"
          },
          {
            "name": "xData",
            "type": "DataVecCoord &"
          }
        ],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "projectMatrix",
        "return_type": "void",
        "params": [
          {
            "name": "",
            "type": "sofa::linearalgebra::BaseMatrix *"
          },
          {
            "name": "",
            "type": "unsigned int"
          }
        ],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "draw",
        "return_type": "void",
        "params": [
          {
            "name": "vparams",
            "type": "const core::visual::VisualParams *"
          }
        ],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "projectResponseImpl",
        "return_type": "void",
        "params": [
          {
            "name": "dx",
            "type": "VecDeriv &"
          }
        ],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "protected"
      }
    ]
  },
  "desc": {
    "description": "The `AffineMovementProjectiveConstraint` is a SOFA component designed to constrain the movement of specific points in a mesh by applying an affine transformation (rigid motion). This constraint imposes predefined motions on boundary points, with intermediate values computed through linear interpolation based on given corner movements. The component can be configured to apply constraints within a specified time interval, from `beginConstraintTime` to `endConstraintTime`. It supports both rotation and translation transformations, applicable to border points defined in the mesh indices.\n\nThis component interacts primarily with the mechanical state of the simulation through its base class `ProjectiveConstraintSet`, enabling it to modify response (forces), velocities, positions, and Jacobian matrices. Additionally, it links to a topology container (`l_topology`) for retrieving necessary topological information about the mesh.\n\nUsage involves setting up the indices of constrained points (`d_indices`), specifying rotation (`d_rotation`), quaternion (`d_quaternion`), and translation (`d_translation`) values, and defining the constraint time interval. The component can also visualize the constrained points by enabling `d_drawConstrainedPoints`. Methods such as `addConstraint`, `removeConstraint`, and `clearConstraints` allow for dynamic management of the constrained indices."
  },
  "maths": {
    "maths": "The `AffineMovementProjectiveConstraint` component in the SOFA framework is designed to enforce a rigid motion on specific points within a mesh by applying an affine transformation, which includes both rotation and translation. The constraint operates by linearly interpolating the movement of boundary points based on specified corner movements over a given time interval from `beginConstraintTime` to `endConstraintTime`. This component plays a crucial role in the FEM simulation pipeline, particularly within the context of constraints and mappings, ensuring that specific mechanical behaviors are enforced upon particular regions of the mesh.\n\n### Governing Equations and Operators:\n\nThe primary role of this component is to enforce a bilinear constraint on selected boundary points. Specifically, it imposes a rigid transformation defined by a rotation matrix \\( R \\) or quaternion \\( q \\), and translation vector \\( t \\). The motion enforcement can be mathematically described as follows:\n\n1. **Initial Position Initialization: **\n   - For each point indexed in `d_indices`, the initial position \\( x_0[i] \\) is set during initialization.\n2. **Final Position Computation:**\n   - The final positions of constrained points are computed by applying the affine transformation to their respective initial positions:\n     \n     For non-rigid types:\n     \n     \n     \\[ x_f[i] = R \\cdot x_0[i] + t \\]\n     \n     For rigid types (including orientation):\n     \n     \\[ x_f[i].center = R \\cdot x_0[i].center + t \\]\n     \\[ x_f[i].orientation = q + x_0[i].orientation \\]\n3. **Linear Interpolation:**\n   - Between `beginConstraintTime` and `endConstraintTime`, the intermediate positions of the points are linearly interpolated between their initial and final positions:\n     \n     \\[ x(t) = x_0[i] + (x_f[i] - x_0[i]) \\cdot \\frac{t - beginConstraintTime}{endConstraintTime - beginConstraintTime} \\]\n4. **Projection Methods:**\n   - The component ensures that the response forces, velocities, and positions are adjusted to reflect this constrained motion:\n     \n     \\[ projectResponse \\implies dx[i] = 0 \\quad \\forall i \\in d_indices\\]\n     \\[ projectVelocity \\implies v[i] = 0 \\quad \\forall i \\in d_indices\\]\n     \\[ projectPosition \\implies x[i] = x_f[i] \\quad \\text{for} \\quad t > endConstraintTime\\]\n\n### Constitutive or Kinematic Laws:\n\nThe component does not define new constitutive laws but rather enforces kinematic constraints by directly modifying the positions, velocities, and forces of selected boundary points. The key kinematic laws involve linear interpolation between initial and final positions over time.\n\n### Role in the Global FEM Pipeline:\n\nIn the broader context of the FEM simulation pipeline, this component contributes to the constraint handling phase, ensuring that specified boundary conditions are met. It interacts with the mechanical state by modifying response forces, velocities, and positions as necessary to enforce the imposed rigid motion constraints.\n\n### Numerical Methods or Discretization Choices:\n\nThe numerical methods employed include linear interpolation for computing intermediate positions between initial and final states based on time. The component uses direct assignment of transformations without explicit discretization schemes beyond simple bilinear time interpolation.\n\n### Variational / Lagrangian Mechanics Framework Fit:\n\nThis constraint component fits into the variational mechanics framework by enforcing specific kinematic constraints directly, which implicitly modifies the equations of motion through constraints. This ensures that any variations or displacements must comply with the imposed rigid transformations on specified points within the mesh."
  },
  "summary": {
    "abstract": "The `AffineMovementProjectiveConstraint` imposes rigid motion on specific mesh points by applying affine transformations (rotation and translation) within a specified time interval, enforcing kinematic constraints through linear interpolation.",
    "sheet": "# AffineMovementProjectiveConstraint\n\n## Overview\n\nThe `AffineMovementProjectiveConstraint` is a SOFA component that enforces rigid motion on selected boundary points of a mesh by applying affine transformations (rotation and translation) within a specified time interval. It inherits from the `ProjectiveConstraintSet` class, enabling it to modify response forces, velocities, positions, and Jacobian matrices.\n\n## Mathematical Model\n\nThe primary role of this component is to enforce bilinear constraints on selected boundary points by applying an affine transformation defined by rotation matrix \\( R \\) or quaternion \\( q \\), and translation vector \\( t \\). The motion enforcement can be mathematically described as follows:\n\n1. **Initial Position Initialization:**\n   - For each point indexed in `d_indices`, the initial position \\( x_0[i] \\) is set during initialization.\n2. **Final Position Computation:*\n   - The final positions of constrained points are computed by applying the affine transformation to their respective initial positions:\n     \n     For non-rigid types:\n     \n     \\[ x_f[i] = R \\cdot x_0[i] + t \\]\n     \n     For rigid types (including orientation):\n     \n     \\[ x_f[i].center = R \\cdot x_0[i].center + t \\]\n     \\[ x_f[i].orientation = q + x_0[i].orientation \\]\n3. **Linear Interpolation:**\n   - Between `beginConstraintTime` and `endConstraintTime`, the intermediate positions of the points are linearly interpolated between their initial and final positions:\n     \n     \\[ x(t) = x_0[i] + (x_f[i] - x_0[i]) \\cdot \\frac{t - beginConstraintTime}{endConstraintTime - beginConstraintTime} \\]\n4. **Projection Methods:**\n   - The component ensures that the response forces, velocities, and positions are adjusted to reflect this constrained motion:\n     \n     \\[ projectResponse \\implies dx[i] = 0 \\quad \\forall i \\in d_indices\\]\n     \\[ projectVelocity \\implies v[i] = 0 \\quad \\forall i \\in d_indices\\]\n     \\[ projectPosition \\implies x[i] = x_f[i] \\quad \\text{for} \\quad t > endConstraintTime\\]\n\n## Parameters and Data\n\n- **beginConstraintTime (SReal):** Begin time of the bilinear constraint.\n- **endConstraintTime (SReal):** End time of the bilinear constraint.\n- **rotation (RotationMatrix):** Rotation matrix applied to border points.\n- **quaternion (Quat):** Quaternion applied to border points.\n- **translation (Vec3):** Translation vector applied to border points.\n- **drawConstrainedPoints (bool):** Flag to draw constrained points.\n\n## Dependencies and Connections\n\nThe component requires a link to the topology container (`l_topology`) for retrieving necessary topological information about the mesh. It interacts with the mechanical state through its base class `ProjectiveConstraintSet`, modifying response forces, velocities, positions, and Jacobian matrices."
  }
}