plotboilerplate 1.21.0 → 1.22.0
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.
- package/dist/index.esm.js +30 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +1 -1
- package/dist/index.esm.min.js.map +1 -1
- package/dist/plotboilerplate.browser.min.js +1 -1
- package/dist/plotboilerplate.browser.min.js.map +1 -1
- package/dist/plotboilerplate.js +30 -1
- package/dist/plotboilerplate.min.js +1 -1
- package/package.json +3 -2
- package/src/cjs/Polygon.d.ts +13 -1
- package/src/cjs/Polygon.js +30 -1
- package/src/cjs/Polygon.js.map +1 -1
- package/src/cjs/utils/Params.d.ts +15 -0
- package/src/cjs/utils/Params.js +49 -0
- package/src/cjs/utils/Params.js.map +1 -0
- package/src/cjs/utils/algorithms/ContourLineDetection.d.ts +150 -0
- package/src/cjs/utils/algorithms/ContourLineDetection.js +367 -0
- package/src/cjs/utils/algorithms/ContourLineDetection.js.map +1 -0
- package/src/cjs/utils/algorithms/clearDuplicateVertices.d.ts +21 -0
- package/src/cjs/utils/algorithms/clearDuplicateVertices.js +48 -0
- package/src/cjs/utils/algorithms/clearDuplicateVertices.js.map +1 -0
- package/src/cjs/utils/datastructures/DataGrid2d.d.ts +47 -0
- package/src/cjs/utils/datastructures/DataGrid2d.js +20 -0
- package/src/cjs/utils/datastructures/DataGrid2d.js.map +1 -0
- package/src/cjs/utils/datastructures/DataGrid2dListAdapter.d.ts +65 -0
- package/src/cjs/utils/datastructures/DataGrid2dListAdapter.js +84 -0
- package/src/cjs/utils/datastructures/DataGrid2dListAdapter.js.map +1 -0
- package/src/cjs/utils/datastructures/GenericPath.d.ts +14 -3
- package/src/cjs/utils/datastructures/GenericPath.js +20 -3
- package/src/cjs/utils/datastructures/GenericPath.js.map +1 -1
- package/src/esm/Polygon.d.ts +13 -1
- package/src/esm/Polygon.js +30 -1
- package/src/esm/Polygon.js.map +1 -1
- package/src/esm/utils/Params.d.ts +15 -0
- package/src/esm/utils/Params.js +44 -0
- package/src/esm/utils/Params.js.map +1 -0
- package/src/esm/utils/algorithms/ContourLineDetection.d.ts +150 -0
- package/src/esm/utils/algorithms/ContourLineDetection.js +362 -0
- package/src/esm/utils/algorithms/ContourLineDetection.js.map +1 -0
- package/src/esm/utils/algorithms/clearDuplicateVertices.d.ts +21 -0
- package/src/esm/utils/algorithms/clearDuplicateVertices.js +44 -0
- package/src/esm/utils/algorithms/clearDuplicateVertices.js.map +1 -0
- package/src/esm/utils/datastructures/DataGrid2d.d.ts +47 -0
- package/src/esm/utils/datastructures/DataGrid2d.js +19 -0
- package/src/esm/utils/datastructures/DataGrid2d.js.map +1 -0
- package/src/esm/utils/datastructures/DataGrid2dListAdapter.d.ts +65 -0
- package/src/esm/utils/datastructures/DataGrid2dListAdapter.js +79 -0
- package/src/esm/utils/datastructures/DataGrid2dListAdapter.js.map +1 -0
- package/src/esm/utils/datastructures/GenericPath.d.ts +14 -3
- package/src/esm/utils/datastructures/GenericPath.js +20 -3
- package/src/esm/utils/datastructures/GenericPath.js.map +1 -1
- package/src/ts/Polygon.ts +31 -1
- package/src/ts/utils/Params.ts +47 -0
- package/src/ts/utils/algorithms/ContourLineDetection.ts +485 -0
- package/src/ts/utils/algorithms/clearDuplicateVertices.ts +49 -0
- package/src/ts/utils/datastructures/DataGrid2d.ts +54 -0
- package/src/ts/utils/datastructures/DataGrid2dListAdapter.ts +121 -0
- package/src/ts/utils/datastructures/GenericPath.ts +21 -3
package/dist/plotboilerplate.js
CHANGED
|
@@ -6371,7 +6371,8 @@ __webpack_unused_export__ = PlotBoilerplate;
|
|
|
6371
6371
|
* @modified 2023-09-25 Added the `Polygon.getInterpolationPolygon(number)` function.
|
|
6372
6372
|
* @modified 2023-09-25 Added the `Polygon.lineIntersections(Line,boolean)` function.
|
|
6373
6373
|
* @modified 2023-09-29 Added the `Polygon.closestLineIntersection(Line,boolean)` function.
|
|
6374
|
-
* @
|
|
6374
|
+
* @modified 2023-11-24 Added the `Polygon.containsPolygon(Polygon)' function.
|
|
6375
|
+
* @version 1.12.0
|
|
6375
6376
|
*
|
|
6376
6377
|
* @file Polygon
|
|
6377
6378
|
* @public
|
|
@@ -6487,6 +6488,34 @@ var Polygon = /** @class */ (function () {
|
|
|
6487
6488
|
}
|
|
6488
6489
|
return inside;
|
|
6489
6490
|
};
|
|
6491
|
+
/**
|
|
6492
|
+
* Check if the passed polygon is completly contained inside this polygon.
|
|
6493
|
+
*
|
|
6494
|
+
* This means:
|
|
6495
|
+
* - all polygon's vertices must be inside this polygon.
|
|
6496
|
+
* - the polygon has no edge intersections with this polygon.
|
|
6497
|
+
*
|
|
6498
|
+
* @param {Polygon} polygon - The polygon to check if contained.
|
|
6499
|
+
* @return {boolean}
|
|
6500
|
+
*/
|
|
6501
|
+
Polygon.prototype.containsPolygon = function (polygon) {
|
|
6502
|
+
for (var i = 0; i < polygon.vertices.length; i++) {
|
|
6503
|
+
if (!this.containsVert(polygon.vertices[i])) {
|
|
6504
|
+
return false;
|
|
6505
|
+
}
|
|
6506
|
+
}
|
|
6507
|
+
// All vertices are inside; check for intersections
|
|
6508
|
+
var lineSegment = new Line_1.Line(new Vertex_1.Vertex(), new Vertex_1.Vertex());
|
|
6509
|
+
for (var i = 0; i < polygon.vertices.length; i++) {
|
|
6510
|
+
lineSegment.a.set(polygon.vertices[i]);
|
|
6511
|
+
lineSegment.b.set(polygon.vertices[(i + 1) % polygon.vertices.length]);
|
|
6512
|
+
if (this.lineIntersections(lineSegment, true).length > 0) {
|
|
6513
|
+
// Current segment has intersection(s) with this polygon.
|
|
6514
|
+
return false;
|
|
6515
|
+
}
|
|
6516
|
+
}
|
|
6517
|
+
return true;
|
|
6518
|
+
};
|
|
6490
6519
|
/**
|
|
6491
6520
|
* Calculate the area of the given polygon (unsigned).
|
|
6492
6521
|
*
|