Skip to content

MinProximityIntersection

This proximity method for intersection detection:

  • detects a possible contact as soon as pair of collision elements are close to each other (distance smaller than the alarmDistance)
  • and creates contact (aka DetectionOutput) when the distance is lower than contactDistance.

This method is optimized for meshes. The intersection is implemented for the following primitives: Triangle/Point, Line/Point, Line/Line, so that it covers all Triangle/Triangle intersections. To get a proper detection, the TriangleModel, LineModel and PointModel must be simultaneously used in the scene.

In the figure below, we describe the detection of the contacts for Object 1 due to an Object 2. It assumes here that a PointCollisionModel and a LineCollisionModel are defined. The detection gives: - 2 Point-Point contacts (yellow) - 1 Point-Line contact (blue) - 1 Line-Line contact (pink)

Although the method is working properly, the intersection might result in a high number of contacts. This works just fine for Penalty method (many springs will be generated). However, using a response method based on Lagrange multipliers, many constraints will be generated which might rapidly become computationally-demanding.

Moreover, the contacts can be a bit degenerated: many contacts with different orientations. Again, using Penalty, it might only create some numerical friction but, using the Lagrange multiplier resolution, this can lead to contradictory constraints (worsening the convergence).

Data

The intersection methods include the following data:

  • alarmDistance: threshold distance below which the collision pipeline detects the models as getting in proximity. This distance can be increased for objects with high curvatures
  • contactDistance : threshold distance below which a contact will be created (in DetectionOutput) to generate a contact response

and it allows for activating tests in the primitive checks:

  • useSphereTriangle
  • usePointPoint
  • useLineLine
  • useLinePoint
  • useSurfaceNormals

Usage

The MinProximityIntersection must be placed right after the CollisionPipeline and the associated Detection methods (usually BruteForceBroadPhase and BVHNarrowPhase) on top the scene graph.

Additional information

  • collision models in the scene will have the data proximity corresponding to an enlargement of the collision model, i.e., value added to the alarmDistance and the contactDistance and also when building AABBs in the broad phase
  • a different alarmDistance and contactDistance can be specified for each CollisionModel by setting alarmDistance and contactDistance to zero and changing the proximity parameter

Example of Usage

This component is used as follows in XML format:

<MinProximityIntersection name="Proximity" alarmDistance=".5" contactDistance=".3" useLinePoint="false" />

or using SofaPython3:

node.addObject('MinProximityIntersection', name='Proximity', alarmDistance='.5', contactDistance='.3', useLinePoint='false')

An example scene involving a MinProximityIntersection is available in examples/Component/Collision/Geometry/TriangleModel.scn

Target: Sofa.Component.Collision.Detection.Intersection

namespace: sofa::component::collision::detection::intersection

parents:

  • BaseProximityIntersection

Data:

Name Description Default value
name object name unnamed
printLog if true, emits extra messages at runtime. 0
tags list of the subsets the objet belongs to
bbox this object bounding box
componentState The state of the component among (Dirty, Valid, Undefined, Loading, Invalid). Undefined
listening if true, handle the events, otherwise ignore the events 0
alarmDistance Proximity detection distance 1
contactDistance Distance below which a contact is created 0.5
useSphereTriangle activate Sphere-Triangle intersection tests 1
usePointPoint activate Point-Point intersection tests 1
useSurfaceNormals Compute the norms of the Detection Outputs by considering the normals of the surfaces involved. 0
useLinePoint activate Line-Point intersection tests 1
useLineLine activate Line-Line intersection tests 1

Links:

Name Description
context Graph Node containing this object (or BaseContext::getDefault() if no graph is used)
slaves Sub-objects used internally by this object
master nullptr for regular objects, or master object for which this object is one sub-objects