dgeoutils 2.2.15 → 2.2.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/DPolygon.js +4 -3
  2. package/package.json +1 -1
package/dist/DPolygon.js CHANGED
@@ -7,6 +7,7 @@ const DCircle_1 = require("./DCircle");
7
7
  const DNumbers_1 = require("./DNumbers");
8
8
  const jsts_1 = require("jsts");
9
9
  const DPolygonLoop_1 = require("./DPolygonLoop");
10
+ const utils_1 = require("./utils");
10
11
  const { buffer: { BufferParameters: { CAP_ROUND, CAP_FLAT, CAP_SQUARE } } } = jsts_1.operation;
11
12
  exports.MIN_POINTS_IN_VALID_POLYGON = 3;
12
13
  const APPROXIMATION_VALUE = 0.1;
@@ -19,11 +20,11 @@ class DPolygon {
19
20
  this.holes = [];
20
21
  this.searchStore = {};
21
22
  }
22
- static arrayOfTrianglesToVertices(triangles, height = 0) {
23
- return triangles.map((v) => v
23
+ static arrayOfTrianglesToVertices(triangles, height) {
24
+ return triangles.map((v) => ((0, utils_1.isDefAndNotNull)(height) ? v
24
25
  .loop()
25
26
  .height(height)
26
- .run()
27
+ .run() : v)
27
28
  .toArrayOfCoords())
28
29
  .flat(2);
29
30
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dgeoutils",
3
- "version": "2.2.15",
3
+ "version": "2.2.16",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "build": "node_modules/.bin/tsc",