UnilateralPlaneConstraint

General description

This component is a simple point plane collision model. By providing 4 points to the component, the first point will be constrained to stay in one side of the plane described by the three other points (in the direction of the plane normal). All the four points, the triangle and the normal can be seen by allowing the “Collision Model” in the “View” tab.

articulatedtentacle_1 articulatedtentacle_2 articulatedtentacle_3articulatedtentacle_00000001

 

 

 

 

 

 

Methods description

Requirement: Constraint resolution method

Method

Here, the constraint matrix J will contain the normal of the plane on the row corresponding to the first point of the model given by the user. And the normal inverse divided by 3 on the row corresponding to the three other points.

How to use the component

To learn how to create a SOFA scene, please refer to the tutorial provided by the SOFA Modeler or this documentation.

The above pictures show a simulated tentacle articulated with one cable. The “UnilateralPlaneConstraint” is use to set a simple collision model in the articulations:

tentacleContact = tentacle.createChild('contact') 
tentacleContact.createObject('MechanicalObject', 
position="64 0 11 69 7 8 69 -7 8 71 0 17 "+
"107 0 -23 111 7 -27 111 -7 -27 117 0 -17 "+
"93 0 -7.5 97 7 -11 97 -7 -11 102 0 -0.5 "+
"138 0 -73 141 7 -77 141 -7 -77 146 0 -72 "+
"78 0 3 83 7 0 83 -7 0 86 0 9 "+
"118 0 -38 122 6.7 -42 122 -7 -42 129 -0.2 -35 "+
"129.5 0 -55.5 132 7 -60 132.5 -7 -59.6 138 0 -53.5")
tentacleContact.createObject('UnilateralPlaneConstraint', indices="0 1 2 3")
tentacleContact.createObject('UnilateralPlaneConstraint', indices="4 5 6 7")
tentacleContact.createObject('UnilateralPlaneConstraint', indices="8 9 10 11")
tentacleContact.createObject('UnilateralPlaneConstraint', indices="12 13 14 15")
tentacleContact.createObject('UnilateralPlaneConstraint', indices="16 17 18 19")
tentacleContact.createObject('UnilateralPlaneConstraint', indices="20 21 22 23")
tentacleContact.createObject('UnilateralPlaneConstraint', indices="24 25 26 27")
tentacleContact.createObject('BarycentricMapping')

You will need to add a constraint solver to your scene (for instance GenericConstraintSolver) and put it on the top of the scene graph.

Examples are provided in the “examples” directory of the plugin.

Data field 

Input data

indices : Four indices: first one for the constrained point, the others to describe the plane.

flipNormal : If true, flip the normal (the normal must be in the direction of the constrained point)

Output data

no output data

Comments are closed.