Hide menu
Loading...
Searching...
No Matches
Distance

Computes the distance between two objects represented as:

  • part bodies;
  • B-Rep shapes;
  • mesh shapes.

Returns the minimum distance. If the distance cannot be computed, returns -1. When requested, anchor points on the measured objects are written to the output tuple. The tuple is left unchanged when the distance cannot be computed.

Methods

compute()

Call Signature

static compute(first, second, points?): number

Computes the distance between two supported objects.

Parameters

first

Body | MeshShape | Shape

First object.

second

Body | MeshShape | Shape

Second object.

points?

[Point, Point]

Optional output tuple receiving the closest points on the measured objects.

Returns

number

Call Signature

static compute(first, second, firstTransformation, secondTransformation, points?): number

Computes the distance between two supported objects.

Parameters

first

Body | MeshShape | Shape

First object.

second

Body | MeshShape | Shape

Second object.

firstTransformation

Transformation | null

Transformation applied to the first object.

secondTransformation

Transformation | null

Transformation applied to the second object.

points?

[Point, Point]

Optional output tuple receiving the closest points on the measured objects.

Returns

number