This component belongs to the category of Projective Constraint. The AttachConstraint 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).
The AttachConstraint 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)
- if true, this boolean projects the constraint vertices of both object1 and object2 towards their average degrees of freedom and derivatives:
- if false, the position of the object1 are projected onto the object2. Therefore, object2 only follows object1 without affecting the motion of object1
The AttachConstraint 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.
This component is used as follows in XML format:
or using SofaPython3:
An example scene involving a AttachConstraint is available in examples/Components/constraint/AttachConstraint.scn
Last modified: 9 April 2021