Polygon.compare() method

Suitable for use in Array.sort.

Signature:

static compare(a: Polygon, b: Polygon): (-1 | 0 | 1);

Parameters

Parameter

Type

Description

a

Polygon

b

Polygon

**Returns:**

(-1 | 0 | 1)

Remarks

Polygons are sorted largest first (by area), falling back to the combined X+Y position of the min/min corner of the bounding box sorted min/min to max/max.

Get in touch

We'd love to learn more about your vision and how we can help.

PressPrivacyTermsSupportCopyright © 2024 Core3D, Inc. All Rights Reserved.