Collision Detector

Introduction

Collision detector is a tool, that is able to find collisions between a set of objects and show them if required. There are several levels of precision for detection:

  • Bounding box - checks if boxes enveloping objects and having all sides parallel to XY, YZ and ZX planes intersect.
  • Shape distance - checks if closest distance between two objects is 0. However distance 0 may signal intersection or just touching.
  • Intersection volume - checks if two objects have nonzero intersection volume. Detects precisely but may take longer time.

Also Collision detector always checks if there is a collision between each pair of objects. Number of object pairs grows quickly with size of an object set. Hence, it may be advisable to use multiple instances of collision detector tool, if some objects are bound not to get close to each other by physical constraints, rather than one collision detector with enormous set of objects.

Usage

Collision detector tool's position
inside an example Animate tool tree.
  1. Install Animate workbench if you haven't done so already.
  2. Open a file in FreeCAD.
  3. Select Animate workbench on the workbench toolbar.
  4. Click on collision detector's icon on Animate toolbar or select collision detector in Animate menu.
  5. Open a Combo View ( View > Panels > Combo View ).
  6. Select collision detector tool in a tree view on a Model Tab inside the Combo View.
  7. Go to General properties on a Data Tab inside the Combo View.
  8. Select Observed Objects and choose and objects to be checked for mutual collisions
  9. Check for collisions by double-clicking the collision detector tool in the tree view on a Model Tab inside the Combo View.
  10. Return highlighted objects and remove shown intersections by right-clicking collision detector and selecting Reset collision display from a context menu.
  11. Change more properties according to your preferences, their meanings are explained in the next section.

Properties

Property / Property Group Description
Base FreeCAD properties necessary for correct display in the tree view.
Label Name of this collision detector tool shown in the tree view.
Group A list of intersections to be shown in the tree view.
Collided Style Style used to highlight objects which have collided.
Collided Line Color Color used to paint lines belonging to an object which has collided.
Collided Line Width Width of lines belonging to an object which has collided.
Collided Shape Color Color used to paint shape (e.g. sides of a cube) belonging to an object which has collided.
Collided Transparency Transparency of lines, shape and points of an object which has collided.
General Main properties controlling overall behavior.
Checking Level Levels of checking Bounding box, Shape distance, Intersection volume and Intersection volume visualizations from coarse and fast to slow but precise. Bounding box checks only if bounding boxes overlap. Shape distance also checks distance between shapes themselves. Intersection volume tests that there is an intersection with nonzero volume in addition to previous conditions. Intersections volume visualizations does all checks and shows the intersection.
Observed Objects A list of object among which we check for collisions. If we have $n$ objects, the we will get $\begin{pmatrix} n\\2 \end{pmatrix}$ couples which we need to check for collisions. Hence, it may be better to use multiple collision detectors to check for collision only among those objects that can physically touch.
Remember Collisions Remember which objects had collided and highlight them with Collided style.
In-Collision Style Style used to highlight objects which are currently in collision.
In Collision Line Color Color used to paint lines belonging to an object which is in collision.
In Collision Line Width Width of lines belonging to an object which is in collision.
In Collision Shape Color Color used to paint shape (e.g. sides of a cube) belonging to an object in collision.
In Collision Transparency Transparency of lines, shape and points of an object which is in collision.
Intersection Style Style used for highlighting itersections between objects
Intersection Color Color used to paint a shape, lines and points of an object used for highlighting intersection volume.