closestApproach MethodStatic
Find smallest distance between polygons.
- For efficiency, input polygons should include closure edge.
- If searching interiors for close approaches, the polygons are assumed to be convex.
closestApproach(polygonA: IndexedXYZCollection | Point3d[], polygonB: IndexedXYZCollection | Point3d[], dMax: number = Number.MAX_VALUE, _searchInterior: boolean = false): undefined | PolygonLocationDetailPair
@returns pair of details, one per polygon. The a field of each detail stores the closest approach distance.
| Parameter | Type | Description |
|---|---|---|
| polygonA | IndexedXYZCollection | Point3d[] | first polygon |
| polygonB | IndexedXYZCollection | Point3d[] | second polygon |
| dMax | number | optional largest approach distance to consider |
| _searchInterior | boolean | If true, include (convex) polygon interiors in computations (currently unimplemented). If false (default): return closest approach between polygon boundaries only, using closestApproach. |
Returns - undefined | PolygonLocationDetailPair
pair of details, one per polygon. The a field of each detail stores the closest approach distance.
Defined in
- geometry3d/PolygonOps.ts Line 1490
Last Updated: 24 October, 2025
Found something wrong, missing, or unclear on this page? Raise an issue in our repo.