Skip to content

Latest commit

 

History

History
53 lines (36 loc) · 2.6 KB

10_AttachProjectiveConstraint.md

File metadata and controls

53 lines (36 loc) · 2.6 KB

AttachProjectiveConstraint

This component belongs to the category of Projective Constraint. The AttachProjectiveConstraint works with a pair of objects and it projects the degrees of freedom (e.g. position) and their derivatives (e.g. velocity), so that both objects are attached. As being a projective constraint, this projective constraints ensures a geometrical connection between both objects at the end of the time step but it does not integrate the physics of both object (contrary to Lagrange based constraints).

Data

The AttachProjectiveConstraint can be initialized using three input data:

  • object1: link to the first model (MechanicalModel)
  • object2: link to the second model (MechanicalModel)
  • indices1: corresponding to the indices of the source points on the first model
  • indices2: corresponding to the indices of the fixed points on the second model
  • constraintFactor: allows for the partial application of the constraint using this factor per pair of points constrained (0=the constraint is released. 1=the constraint is fully constrained)
  • twoWay:
    • if true, this boolean projects the constraint vertices of both object1 and object2 towards their average degrees of freedom and derivatives:
    Deriv corr = (dx2-dx1)*0.5*responseFactor*getConstraintFactor(index);
          dx1 += corr;
          dx2 -= corr;
    • if false, the position of the object1 are projected onto the object2. Therefore, object2 only follows object1 without affecting the motion of object1
    dx2 = Deriv();

Usage

The AttachProjectiveConstraint requires two MechanicalObjects so that both degrees of freedom can be accessed and projected to the attached configuration. An integration scheme and a solver are also necessary to solve the linear system at each time step.

Example

This component is used as follows in XML format:

<AttachProjectiveConstraint name="AttachProjectiveConstraint" object1="@M1" object2="@M2" indices1="0 1 2" indices2="10 11 12" constraintFactor="1 1 1"/>

or using SofaPython3:

node.addObject('AttachProjectiveConstraint', object1="@M1", object2="@M2", indices1="0 1 2", indices2="10 11 12", constraintFactor="1 1 1")

An example scene involving a AttachProjectiveConstraint is available in examples/Component/Constraint/Projective/AttachProjectiveConstraint.scn