polygon2.toJSON
The polygon as plain JSON: its flat ring.
Usage
polygon.toJSON(): { xy: number[] }Returns
{ xy } with the corners as a plain number array, not closed.
Example
JSON.stringify(Polygon2.rectangle(2, 2).value) // → '{"xy":[-1,-1,1,-1,1,1,-1,1]}'