BilateralInteractionConstraint
This component belongs to the category of Constraint Laws used for the Lagrange constraint resolution and inherits from the PairInteractionConstraint. The BilateralInteractionConstraint defines an holonomic constraint law between a pair of simulated body, i.e. the constraint defined between the pair of objects must have an equality form:
Such a constraint is suited for attachment cases or sliding joints. For an attachment case, if the vertex i of object 1 and the vertex j of object 2 are attached, the holonomic constraint law can be written as .
For a BilateralInteractionConstraint, the constraint matrix (derivative of the constraint law) corresponds to:
for object 1
for object 2
As all constraint laws, the BilateralInteractionConstraint will be called in the following functions and for the following steps:
getConstraintViolation()
: project the free velocity in the constraint space and compute the free interpenetrationbuildConstraintMatrix()
: build the compliance made up ofand
Data
As a PairInteractionConstraint, the BilateralInteractionConstraint requires the following Data:
- object1: link towards the object 1 to constraint
- object2: link towards the object 2 to constraint
- first_point: index of the constraint on the first model (object 1)
- second_point: index of the constraint on the second model (object 2)
Usage
The BilateralInteractionConstraint can only be used in the context of Lagrange constraint resolution. The scene must therefore contain:
- a FreeMotionAnimationLoop
- a ConstraintSolver
Moreover, each constrained object must define in its node a ConstraintCorrection so that the corrective motion can be applied.
Example
This component is used as follows in XML format:
<BilateralInteractionConstraint template="Vec3d" object1="@CUBE_2/Constraints/points" object2="@CUBE_4/Constraints/points" first_point="1" second_point="0" />
or using SofaPython3:
'BilateralInteractionConstraint', template='Vec3d' object1='@CUBE_2/Constraints/points' object2='@CUBE_4/Constraints/points' first_point='1' second_point='0') node.addObject(
An example scene involving a BilateralInteractionConstraint is available in examples/Components/constraint/BilateralInteractionConstraint.scn
Last modified: 15 May 2023