Skip to content

Latest commit

 

History

History
50 lines (27 loc) · 4.99 KB

50_UnilateralLagrangianConstraint.md

File metadata and controls

50 lines (27 loc) · 4.99 KB

UnilateralLagrangianConstraint

This component belongs to the category of Constraint Laws used for the Lagrange constraint resolution and inherits from the PairInteractionConstraint. The UnilateralLagrangianConstraint defines an non-holonomic constraint law between a pair of simulated body, i.e. the constraint defined between the pair of objects must have an inequality form:

Such a constraint are used for friction-less and friction contact modeling (it can even be used as a starting point for puncture modeling). For a UnilateralLagrangianConstraint, the constraint matrix (derivative of the constraint law) corresponds to:

  • for object 1
  • for object 2

We can see from these matrices that the UnilateralLagrangianConstraint is a transformation towards the constraint space, by building a projection of any field against the contact direction (normal here, and possibly tangential directions as well if friction is defined).

As all constraint laws, the UnilateralLagrangianConstraint 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 interpenetration
  • buildConstraintMatrix(): build the compliance made up of and

Data

As a PairInteractionConstraint, the UnilateralLagrangianConstraint 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 UnilateralLagrangianConstraint 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. Unlike other constraints, the UnilateralLagrangianConstraint is mostly used in SOFA for contact modeling. UnilateralLagrangianConstraint are therefore dynamically and automatically created within the scene graph when two objects are colliding: when the CollisionPipeline defines new DetectionOutput with ContactResponse using Lagrange multipliers, each DetectionOutput generates a new UnilateralLagrangianConstraint.

Example

An example scene involving a UnilateralLagrangianConstraint is available in examples/Component/Constraint/Lagrangian/FrictionContact_LCP_without_friction.scn. Note that in this example, the UnilateralLagrangianConstraint will be created as soon as a contact point is outputed from the collision detection phase.