@immugio/three-math-extensions 0.2.34 → 0.2.36

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/CHANGELOG.md CHANGED
@@ -7,7 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
9
9
 
10
- ## [0.2.34](https://github.com/Immugio/three-math-extensions/compare/0.2.33...0.2.34)
10
+ ## [0.2.36](https://github.com/Immugio/three-math-extensions/compare/0.2.35...0.2.36)
11
+
12
+ ### Commits
13
+
14
+ - Polygon.containsPoint should accept Point2 [`73e766c`](https://github.com/Immugio/three-math-extensions/commit/73e766c9f03903224c0634947b116aa3e0f6f9bd)
15
+
16
+ ## [0.2.35](https://github.com/Immugio/three-math-extensions/compare/0.2.34...0.2.35) - 2024-10-24
17
+
18
+ ### Commits
19
+
20
+ - Export containsPoints [`6214646`](https://github.com/Immugio/three-math-extensions/commit/62146467b9e0350ecd9b6a9839c55ec62b163aa2)
21
+
22
+ ## [0.2.34](https://github.com/Immugio/three-math-extensions/compare/0.2.33...0.2.34) - 2024-10-24
11
23
 
12
24
  ### Commits
13
25
 
package/cjs/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getPolygonArea = exports.containsPoint = exports.ensurePolygonClockwise = exports.isPolygonClockwise = exports.sortLinesByConnections = exports.extendOrTrimPolylinesAtIntersections = exports.offsetPolyline = exports.polygonPerimeter = exports.isContinuousClosedShape = exports.directions2d = exports.directions = exports.isPointInPolygon = exports.HalfPI = exports.TwoPI = exports.normalizeAngleRadians = exports.normalizeAngleDegrees = exports.Rectangle = exports.BoundingBox = exports.Polygon = exports.Size2 = exports.Line3D = exports.Line2D = exports.Vec3 = exports.Vec2 = void 0;
3
+ exports.getPolygonArea = exports.containsPoints = exports.containsPoint = exports.ensurePolygonClockwise = exports.isPolygonClockwise = exports.sortLinesByConnections = exports.extendOrTrimPolylinesAtIntersections = exports.offsetPolyline = exports.polygonPerimeter = exports.isContinuousClosedShape = exports.directions2d = exports.directions = exports.isPointInPolygon = exports.HalfPI = exports.TwoPI = exports.normalizeAngleRadians = exports.normalizeAngleDegrees = exports.Rectangle = exports.BoundingBox = exports.Polygon = exports.Size2 = exports.Line3D = exports.Line2D = exports.Vec3 = exports.Vec2 = void 0;
4
4
  var Vec2_1 = require("./Vec2");
5
5
  Object.defineProperty(exports, "Vec2", { enumerable: true, get: function () { return Vec2_1.Vec2; } });
6
6
  var Vec3_1 = require("./Vec3");
@@ -46,5 +46,6 @@ var ensurePolygonClockwise_1 = require("./ensurePolygonClockwise");
46
46
  Object.defineProperty(exports, "ensurePolygonClockwise", { enumerable: true, get: function () { return ensurePolygonClockwise_1.ensurePolygonClockwise; } });
47
47
  var containsPoint_1 = require("./containsPoint");
48
48
  Object.defineProperty(exports, "containsPoint", { enumerable: true, get: function () { return containsPoint_1.containsPoint; } });
49
+ Object.defineProperty(exports, "containsPoints", { enumerable: true, get: function () { return containsPoint_1.containsPoints; } });
49
50
  var getPolygonArea_1 = require("./getPolygonArea");
50
51
  Object.defineProperty(exports, "getPolygonArea", { enumerable: true, get: function () { return getPolygonArea_1.getPolygonArea; } });
package/esm/index.js CHANGED
@@ -19,5 +19,5 @@ export { extendOrTrimPolylinesAtIntersections } from "./extendOrTrimPolylinesAtI
19
19
  export { sortLinesByConnections } from "./sortLinesByConnections";
20
20
  export { isPolygonClockwise } from "./isPolygonClockwise";
21
21
  export { ensurePolygonClockwise } from "./ensurePolygonClockwise";
22
- export { containsPoint } from "./containsPoint";
22
+ export { containsPoint, containsPoints } from "./containsPoint";
23
23
  export { getPolygonArea } from "./getPolygonArea";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@immugio/three-math-extensions",
3
- "version": "0.2.34",
3
+ "version": "0.2.36",
4
4
  "description": "Set of utilities for 2d and 3d line math built on top of three.js",
5
5
  "author": "Jan Mikeska <janmikeska@gmail.com>",
6
6
  "license": "ISC",
package/src/Polygon.ts CHANGED
@@ -139,7 +139,7 @@ export class Polygon {
139
139
  return this;
140
140
  }
141
141
 
142
- public containsPoint(...points: Vec2[]): boolean {
142
+ public containsPoint(...points: Point2[]): boolean {
143
143
  return points.every(point => containsPoint(this.contour, point)) &&
144
144
  (this.holes || []).every(hole => !points.some(point => containsPoint(hole, point)));
145
145
  }
package/src/index.ts CHANGED
@@ -21,5 +21,5 @@ export { extendOrTrimPolylinesAtIntersections } from "./extendOrTrimPolylinesAtI
21
21
  export { sortLinesByConnections } from "./sortLinesByConnections";
22
22
  export { isPolygonClockwise } from "./isPolygonClockwise";
23
23
  export { ensurePolygonClockwise } from "./ensurePolygonClockwise";
24
- export { containsPoint } from "./containsPoint";
24
+ export { containsPoint, containsPoints } from "./containsPoint";
25
25
  export { getPolygonArea } from "./getPolygonArea";
@@ -20,7 +20,7 @@ export declare class Polygon {
20
20
  perimeter(): number;
21
21
  get isClockwise(): boolean;
22
22
  ensureClockwise(): this;
23
- containsPoint(...points: Vec2[]): boolean;
23
+ containsPoint(...points: Point2[]): boolean;
24
24
  private flipSingle;
25
25
  translate(translate: Vec2): this;
26
26
  /**
package/types/index.d.ts CHANGED
@@ -21,5 +21,5 @@ export { extendOrTrimPolylinesAtIntersections } from "./extendOrTrimPolylinesAtI
21
21
  export { sortLinesByConnections } from "./sortLinesByConnections";
22
22
  export { isPolygonClockwise } from "./isPolygonClockwise";
23
23
  export { ensurePolygonClockwise } from "./ensurePolygonClockwise";
24
- export { containsPoint } from "./containsPoint";
24
+ export { containsPoint, containsPoints } from "./containsPoint";
25
25
  export { getPolygonArea } from "./getPolygonArea";