Skip to content

LocalMinDistance

This proximity method is an intersection detection close to the previous MinProximityIntersection but in addition, it filters the list of DetectionOutput to keep only the contacts with the local minimal distance.

To find an optimal number of contact points, the LocalMinDistance computes cones on all nodes of the collision model. A cone is the combination of the orthogonal directions/planes of the neighboring lines/surfaces.

All contact outputs which are outside these cones will be invalidated (even if they are below the contactDistance). Thus, only the geometrically closest contacts remain: for convex surfaces, this method even ensures to find one and only one contact point.

Degenerated cases can occur when, for instance, surfaces are perfectly parallel. If we think about configuration described below:

The cones on the sides (no 1 and 3) are open with an 90 degree angle, while the middle cone (2) is closed. No contact will therefore be detected from the cone 2.

  • In case our object is rigid, having the two cones exactly equal to 90 degrees may lead to instabilities: a small rotation would lead to the invalidation of one of the two corner contacts, and the object would start to oscillate. To prevent such cases, a data is available to open the cone: "coneFactor"
  • In case of a soft body, the LocalMinDistance would not detect the middle point as a contact since the cone is closed. The method would therefore fail to keep the object over the surface. To solve such a generated case, a data aiming at opening all existing cones is defined: "angleCone"

Usage

The MinProximityIntersection must be placed right after the CollisionPipeline and the associated Detection method (usually BruteForce) 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

A set of methods to compute (for constraint methods) if two primitives are close enough to consider they collide

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 object 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 Distance above which the intersection computations ignores the proximity pair. This distance can also be used in some broad phase algorithms to reduce the search area 1
contactDistance Distance below which a contact is created 0.5
filterIntersection Activate LMD filter 1
angleCone Filtering cone extension angle 0
coneFactor Factor for filtering cone angle computation 0.5
useLMDFilters Use external cone computation 0
Name Description Destination type name
context Graph Node containing this object (or BaseContext::getDefault() if no graph is used) BaseContext
slaves Sub-objects used internally by this object BaseObject
master nullptr for regular objects, or master object for which this object is one sub-objects BaseObject