From 5d55cae92a25c43092a666d8e8eae786e17d4b63 Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Fri, 2 Aug 2024 18:35:36 -0400 Subject: [PATCH] replace center average with geometric center. fixed #284 --- src/geo/polygon.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/geo/polygon.js b/src/geo/polygon.js index a4334a26..75c87fde 100644 --- a/src/geo/polygon.js +++ b/src/geo/polygon.js @@ -615,7 +615,8 @@ class Polygon { * @returns {Polygon|Point} a new polygon centered on x=0, y=0, z=0 */ center(point) { - throw "does not work"; + return this.bounds.center(this.getZ()); + // throw "does not work"; let ap = newPoint(0, 0, 0, null), np = newPolygon(), pa = this.points;