@immugio/three-math-extensions 0.3.4 → 0.3.6

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 (43) hide show
  1. package/CHANGELOG.md +17 -1
  2. package/cjs/Line2D.js +90 -13
  3. package/docs/classes/BoundingBox.md +121 -121
  4. package/docs/classes/Line2D.md +1366 -1366
  5. package/docs/classes/Line3D.md +831 -831
  6. package/docs/classes/Polygon.md +297 -297
  7. package/docs/classes/Rectangle.md +291 -291
  8. package/docs/classes/Size2.md +55 -55
  9. package/docs/classes/Vec2.md +282 -282
  10. package/docs/classes/Vec3.md +338 -338
  11. package/docs/interfaces/Point2.md +30 -30
  12. package/docs/interfaces/Point3.md +41 -41
  13. package/docs/modules.md +209 -209
  14. package/eslint.config.mjs +111 -111
  15. package/esm/Line2D.js +90 -13
  16. package/package.json +62 -62
  17. package/src/BoundingBox.ts +13 -13
  18. package/src/Line2D.ts +951 -857
  19. package/src/Line3D.ts +586 -586
  20. package/src/MathConstants.ts +1 -1
  21. package/src/Point2.ts +3 -3
  22. package/src/Point3.ts +4 -4
  23. package/src/Polygon.ts +286 -286
  24. package/src/Rectangle.ts +92 -92
  25. package/src/Size2.ts +3 -3
  26. package/src/Vec2.ts +124 -124
  27. package/src/Vec3.ts +167 -167
  28. package/src/containsPoint.ts +65 -65
  29. package/src/directions.ts +9 -9
  30. package/src/directions2d.ts +7 -7
  31. package/src/ensurePolygonClockwise.ts +9 -9
  32. package/src/extendOrTrimPolylinesAtIntersections.ts +10 -10
  33. package/src/getPolygonArea.ts +21 -21
  34. package/src/index.ts +24 -24
  35. package/src/isContinuousClosedShape.ts +24 -24
  36. package/src/isPointInPolygon.ts +23 -23
  37. package/src/isPolygonClockwise.ts +15 -15
  38. package/src/normalizeAngleDegrees.ts +6 -6
  39. package/src/normalizeAngleRadians.ts +14 -14
  40. package/src/offsetPolyline.ts +26 -26
  41. package/src/polygonPerimeter.ts +13 -13
  42. package/src/sortLinesByConnections.ts +45 -45
  43. package/types/Line2D.d.ts +12 -5
package/src/Vec3.ts CHANGED
@@ -1,168 +1,168 @@
1
- import { Vector3 } from "three";
2
- import { Vec2 } from "./Vec2";
3
- import { Point3 } from "./Point3";
4
-
5
- /**
6
- * Vec3 represents a 3D vector. It extends `Vector3` from the `threejs` library.
7
- */
8
- export class Vec3 extends Vector3 {
9
-
10
- #target: Vector3;
11
-
12
- /**
13
- * Creates a new Vec3 instance from an {x, y, z} object.
14
- * @param point - The {x, y, z} instance.
15
- * @returns A new Vec3 instance.
16
- */
17
- public static fromPoint(point: Point3): Vec3 {
18
- return new Vec3(point?.x, point?.y, point?.z);
19
- }
20
-
21
- /**
22
- * Creates a new Vec3[] array from arguments of {x, y, z} objects.
23
- * @param points - The ...{x, y, z} instances.
24
- */
25
- public static fromPoints(...points: Point3[]): Vec3[] {
26
- return points?.map(p => Vec3.fromPoint(p)) ?? [];
27
- }
28
-
29
- /**
30
- * Moves this Vec3 instance towards the target Vec3 by the given amount.
31
- * @param target - The target Vec3.
32
- * @param amount - The distance to move.
33
- * @returns This Vec3 instance.
34
- */
35
- public moveTowards(target: Vector3, amount: number): this {
36
- if (this.#target === undefined) {
37
- this.#target = new Vector3();
38
- }
39
-
40
- this.#target.copy(target);
41
- this.add(this.#target.sub(this).normalize().multiplyScalar(amount));
42
-
43
- return this;
44
- }
45
-
46
- /**
47
- * Moves this Vec3 instance halfway towards the target Vec3 by the given amount.
48
- * @param target - The target Vec3.
49
- * @returns This Vec3 instance.
50
- */
51
- public moveHalfWayTowards(target: Vector3): this {
52
- if (this.#target === undefined) {
53
- this.#target = new Vector3();
54
- }
55
-
56
- return this.moveTowards(target, this.distanceTo(target) / 2);
57
- }
58
-
59
- /**
60
- * Adds y amount to this Vec3 instance and return this
61
- * @param y
62
- */
63
- public addY(y: number): this {
64
- this.y += y;
65
- return this;
66
- }
67
-
68
- /**
69
- * Adds x amount to this Vec3 instance and return this
70
- * @param x
71
- */
72
- public addX(x: number): this {
73
- this.x += x;
74
- return this;
75
- }
76
-
77
- /**
78
- * Adds z amount to this Vec3 instance and return this
79
- * @param z
80
- */
81
- public addZ(z: number): this {
82
- this.z += z;
83
- return this;
84
- }
85
-
86
- /**
87
- * Returns a clone of the point closest to this from the given points.
88
- * @param points
89
- */
90
- public closest(...points: Vector3[]): Vec3 {
91
- const withDistances = points.map(p => ({ point: p, distance: this.distanceTo(p) }));
92
- const closest = withDistances.reduce((a, b) => a.distance < b.distance ? a : b);
93
- return Vec3.fromPoint(closest.point);
94
- }
95
-
96
- public applyAxisAngleAroundCenter(axis: Vector3, angle: number, center: Vector3): this {
97
- // Translate the vector to the origin
98
- this.sub(center);
99
-
100
- // Apply the axis-angle rotation
101
- this.applyAxisAngle(axis, angle);
102
-
103
- // Translate the vector back to the original position
104
- this.add(center);
105
-
106
- return this;
107
- }
108
-
109
- public roundIfCloseToInteger(max: number = 0.000000000001): this {
110
- if (Math.abs(this.x - Math.round(this.x)) < max) {
111
- this.x = Math.round(this.x);
112
- }
113
- if (Math.abs(this.y - Math.round(this.y)) < max) {
114
- this.y = Math.round(this.y);
115
- }
116
- if (Math.abs(this.z - Math.round(this.z)) < max) {
117
- this.z = Math.round(this.z);
118
- }
119
- if (Object.is(this.x, -0)) {
120
- this.x = 0;
121
- }
122
- if (Object.is(this.y, -0)) {
123
- this.y = 0;
124
- }
125
- if (Object.is(this.z, -0)) {
126
- this.z = 0;
127
- }
128
- return this;
129
- }
130
-
131
- /**
132
- * Returns a clone of this Vec3 instance with y and z swapped.
133
- */
134
- public toPointWithFlippedYZ(): Vec3 {
135
- return new Vec3(this.x, this.z, this.y);
136
- }
137
-
138
- /**
139
- * Projects this Vec3 instance onto 2d plan. Vec3.z becomes Vec2.y and Vec3.y is ignored.
140
- */
141
- public onPlan(): Vec2 {
142
- return new Vec2(this.x, this.z);
143
- }
144
-
145
- /**
146
- * Get distance to another vector while ignoring the y-axis.
147
- * @param point
148
- */
149
- public horizontalDistanceTo(point: Vector3): number {
150
- return new Vector3(this.x, 0, this.z).distanceTo(new Vector3(point.x, 0, point.z));
151
- }
152
-
153
- /**
154
- * Determines if this Vec2 instance is near the target Vec2.
155
- * maxDistance is the maximum distance between the two vectors within which they are considered `near`.
156
- */
157
- public isNear(v: Vector3, maxDistance: number = undefined): boolean {
158
- if (maxDistance === undefined) {
159
- return this.equals(v);
160
- }
161
-
162
- return this.distanceTo(v) <= maxDistance;
163
- }
164
-
165
- public clone(): this {
166
- return super.clone();
167
- }
1
+ import { Vector3 } from "three";
2
+ import { Vec2 } from "./Vec2";
3
+ import { Point3 } from "./Point3";
4
+
5
+ /**
6
+ * Vec3 represents a 3D vector. It extends `Vector3` from the `threejs` library.
7
+ */
8
+ export class Vec3 extends Vector3 {
9
+
10
+ #target: Vector3;
11
+
12
+ /**
13
+ * Creates a new Vec3 instance from an {x, y, z} object.
14
+ * @param point - The {x, y, z} instance.
15
+ * @returns A new Vec3 instance.
16
+ */
17
+ public static fromPoint(point: Point3): Vec3 {
18
+ return new Vec3(point?.x, point?.y, point?.z);
19
+ }
20
+
21
+ /**
22
+ * Creates a new Vec3[] array from arguments of {x, y, z} objects.
23
+ * @param points - The ...{x, y, z} instances.
24
+ */
25
+ public static fromPoints(...points: Point3[]): Vec3[] {
26
+ return points?.map(p => Vec3.fromPoint(p)) ?? [];
27
+ }
28
+
29
+ /**
30
+ * Moves this Vec3 instance towards the target Vec3 by the given amount.
31
+ * @param target - The target Vec3.
32
+ * @param amount - The distance to move.
33
+ * @returns This Vec3 instance.
34
+ */
35
+ public moveTowards(target: Vector3, amount: number): this {
36
+ if (this.#target === undefined) {
37
+ this.#target = new Vector3();
38
+ }
39
+
40
+ this.#target.copy(target);
41
+ this.add(this.#target.sub(this).normalize().multiplyScalar(amount));
42
+
43
+ return this;
44
+ }
45
+
46
+ /**
47
+ * Moves this Vec3 instance halfway towards the target Vec3 by the given amount.
48
+ * @param target - The target Vec3.
49
+ * @returns This Vec3 instance.
50
+ */
51
+ public moveHalfWayTowards(target: Vector3): this {
52
+ if (this.#target === undefined) {
53
+ this.#target = new Vector3();
54
+ }
55
+
56
+ return this.moveTowards(target, this.distanceTo(target) / 2);
57
+ }
58
+
59
+ /**
60
+ * Adds y amount to this Vec3 instance and return this
61
+ * @param y
62
+ */
63
+ public addY(y: number): this {
64
+ this.y += y;
65
+ return this;
66
+ }
67
+
68
+ /**
69
+ * Adds x amount to this Vec3 instance and return this
70
+ * @param x
71
+ */
72
+ public addX(x: number): this {
73
+ this.x += x;
74
+ return this;
75
+ }
76
+
77
+ /**
78
+ * Adds z amount to this Vec3 instance and return this
79
+ * @param z
80
+ */
81
+ public addZ(z: number): this {
82
+ this.z += z;
83
+ return this;
84
+ }
85
+
86
+ /**
87
+ * Returns a clone of the point closest to this from the given points.
88
+ * @param points
89
+ */
90
+ public closest(...points: Vector3[]): Vec3 {
91
+ const withDistances = points.map(p => ({ point: p, distance: this.distanceTo(p) }));
92
+ const closest = withDistances.reduce((a, b) => a.distance < b.distance ? a : b);
93
+ return Vec3.fromPoint(closest.point);
94
+ }
95
+
96
+ public applyAxisAngleAroundCenter(axis: Vector3, angle: number, center: Vector3): this {
97
+ // Translate the vector to the origin
98
+ this.sub(center);
99
+
100
+ // Apply the axis-angle rotation
101
+ this.applyAxisAngle(axis, angle);
102
+
103
+ // Translate the vector back to the original position
104
+ this.add(center);
105
+
106
+ return this;
107
+ }
108
+
109
+ public roundIfCloseToInteger(max: number = 0.000000000001): this {
110
+ if (Math.abs(this.x - Math.round(this.x)) < max) {
111
+ this.x = Math.round(this.x);
112
+ }
113
+ if (Math.abs(this.y - Math.round(this.y)) < max) {
114
+ this.y = Math.round(this.y);
115
+ }
116
+ if (Math.abs(this.z - Math.round(this.z)) < max) {
117
+ this.z = Math.round(this.z);
118
+ }
119
+ if (Object.is(this.x, -0)) {
120
+ this.x = 0;
121
+ }
122
+ if (Object.is(this.y, -0)) {
123
+ this.y = 0;
124
+ }
125
+ if (Object.is(this.z, -0)) {
126
+ this.z = 0;
127
+ }
128
+ return this;
129
+ }
130
+
131
+ /**
132
+ * Returns a clone of this Vec3 instance with y and z swapped.
133
+ */
134
+ public toPointWithFlippedYZ(): Vec3 {
135
+ return new Vec3(this.x, this.z, this.y);
136
+ }
137
+
138
+ /**
139
+ * Projects this Vec3 instance onto 2d plan. Vec3.z becomes Vec2.y and Vec3.y is ignored.
140
+ */
141
+ public onPlan(): Vec2 {
142
+ return new Vec2(this.x, this.z);
143
+ }
144
+
145
+ /**
146
+ * Get distance to another vector while ignoring the y-axis.
147
+ * @param point
148
+ */
149
+ public horizontalDistanceTo(point: Vector3): number {
150
+ return new Vector3(this.x, 0, this.z).distanceTo(new Vector3(point.x, 0, point.z));
151
+ }
152
+
153
+ /**
154
+ * Determines if this Vec2 instance is near the target Vec2.
155
+ * maxDistance is the maximum distance between the two vectors within which they are considered `near`.
156
+ */
157
+ public isNear(v: Vector3, maxDistance: number = undefined): boolean {
158
+ if (maxDistance === undefined) {
159
+ return this.equals(v);
160
+ }
161
+
162
+ return this.distanceTo(v) <= maxDistance;
163
+ }
164
+
165
+ public clone(): this {
166
+ return super.clone();
167
+ }
168
168
  }
@@ -1,66 +1,66 @@
1
- import { Point2 } from "./Point2";
2
-
3
- /**
4
- * Return if polygon contains @point or when the point is on the polygon boundary.
5
- * Works consistently with points on the boundary.
6
- * Works with simple polygons only.
7
- * The code is copied from PolyK library.
8
- * @returns {boolean} depth
9
- * @param polygon
10
- * @param point
11
- */
12
- export function containsPoint(polygon: Point2[], point: Point2): boolean {
13
- const p: number[] = [];
14
- for (let i = 0; i < polygon.length; i++) {
15
- p.push(polygon[i].x);
16
- p.push(polygon[i].y);
17
- }
18
-
19
- const px = point.x;
20
- const py = point.y;
21
- const n = p.length >> 1;
22
-
23
- let ax: number;
24
-
25
- let ay = p[2 * n - 3] - py;
26
- let bx = p[2 * n - 2] - px;
27
- let by = p[2 * n - 1] - py;
28
- let lup: boolean;
29
-
30
- // var lup = by > ay;
31
- for (let i = 0; i < n; i++) {
32
- ax = bx;
33
- ay = by;
34
- bx = p[2 * i] - px;
35
- by = p[2 * i + 1] - py;
36
- if (ay === by) continue;
37
- lup = by > ay;
38
- }
39
-
40
- let depth = 0;
41
- for (let i = 0; i < n; i++) {
42
- ax = bx;
43
- ay = by;
44
- bx = p[2 * i] - px;
45
- by = p[2 * i + 1] - py;
46
- if (ay < 0 && by < 0) continue; // both "up" or both "down"
47
- if (ay > 0 && by > 0) continue; // both "up" or both "down"
48
- if (ax < 0 && bx < 0) continue; // both points on the left
49
-
50
- if (ay === by && Math.min(ax, bx) <= 0) return true;
51
- if (ay === by) continue;
52
-
53
- const lx = ax + (bx - ax) * (-ay) / (by - ay);
54
- if (lx === 0) return true; // point on edge
55
- if (lx > 0) depth++;
56
- if (ay === 0 && lup && by > ay) depth--; // hit vertex, both up
57
- if (ay === 0 && !lup && by < ay) depth--; // hit vertex, both down(x < (p[j].x - p[i].x) * (y - p[i].y) / (p[j].y - p[i].y) + p[i].x)) {
58
- lup = by > ay;
59
- }
60
-
61
- return (depth & 1) === 1;
62
- }
63
-
64
- export function containsPoints(polygon: Point2[], points: Point2[]): boolean {
65
- return points.every(p => containsPoint(polygon, p));
1
+ import { Point2 } from "./Point2";
2
+
3
+ /**
4
+ * Return if polygon contains @point or when the point is on the polygon boundary.
5
+ * Works consistently with points on the boundary.
6
+ * Works with simple polygons only.
7
+ * The code is copied from PolyK library.
8
+ * @returns {boolean} depth
9
+ * @param polygon
10
+ * @param point
11
+ */
12
+ export function containsPoint(polygon: Point2[], point: Point2): boolean {
13
+ const p: number[] = [];
14
+ for (let i = 0; i < polygon.length; i++) {
15
+ p.push(polygon[i].x);
16
+ p.push(polygon[i].y);
17
+ }
18
+
19
+ const px = point.x;
20
+ const py = point.y;
21
+ const n = p.length >> 1;
22
+
23
+ let ax: number;
24
+
25
+ let ay = p[2 * n - 3] - py;
26
+ let bx = p[2 * n - 2] - px;
27
+ let by = p[2 * n - 1] - py;
28
+ let lup: boolean;
29
+
30
+ // var lup = by > ay;
31
+ for (let i = 0; i < n; i++) {
32
+ ax = bx;
33
+ ay = by;
34
+ bx = p[2 * i] - px;
35
+ by = p[2 * i + 1] - py;
36
+ if (ay === by) continue;
37
+ lup = by > ay;
38
+ }
39
+
40
+ let depth = 0;
41
+ for (let i = 0; i < n; i++) {
42
+ ax = bx;
43
+ ay = by;
44
+ bx = p[2 * i] - px;
45
+ by = p[2 * i + 1] - py;
46
+ if (ay < 0 && by < 0) continue; // both "up" or both "down"
47
+ if (ay > 0 && by > 0) continue; // both "up" or both "down"
48
+ if (ax < 0 && bx < 0) continue; // both points on the left
49
+
50
+ if (ay === by && Math.min(ax, bx) <= 0) return true;
51
+ if (ay === by) continue;
52
+
53
+ const lx = ax + (bx - ax) * (-ay) / (by - ay);
54
+ if (lx === 0) return true; // point on edge
55
+ if (lx > 0) depth++;
56
+ if (ay === 0 && lup && by > ay) depth--; // hit vertex, both up
57
+ if (ay === 0 && !lup && by < ay) depth--; // hit vertex, both down(x < (p[j].x - p[i].x) * (y - p[i].y) / (p[j].y - p[i].y) + p[i].x)) {
58
+ lup = by > ay;
59
+ }
60
+
61
+ return (depth & 1) === 1;
62
+ }
63
+
64
+ export function containsPoints(polygon: Point2[], points: Point2[]): boolean {
65
+ return points.every(p => containsPoint(polygon, p));
66
66
  }
package/src/directions.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { Vec3 } from "./Vec3";
2
-
3
- export const directions = {
4
- North: new Vec3(0, 0, -1),
5
- South: new Vec3(0, 0, 1),
6
- East: new Vec3(1, 0, 0),
7
- West: new Vec3(-1, 0, 0),
8
- Up: new Vec3(0, 1, 0),
9
- Down: new Vec3(0, -1, 0)
1
+ import { Vec3 } from "./Vec3";
2
+
3
+ export const directions = {
4
+ North: new Vec3(0, 0, -1),
5
+ South: new Vec3(0, 0, 1),
6
+ East: new Vec3(1, 0, 0),
7
+ West: new Vec3(-1, 0, 0),
8
+ Up: new Vec3(0, 1, 0),
9
+ Down: new Vec3(0, -1, 0)
10
10
  };
@@ -1,8 +1,8 @@
1
- import { Vec2 } from "./Vec2";
2
-
3
- export const directions2d = {
4
- Up: new Vec2(0, -1),
5
- Down: new Vec2(0, 1),
6
- Left: new Vec2(-1, 0),
7
- Right: new Vec2(1, 0)
1
+ import { Vec2 } from "./Vec2";
2
+
3
+ export const directions2d = {
4
+ Up: new Vec2(0, -1),
5
+ Down: new Vec2(0, 1),
6
+ Left: new Vec2(-1, 0),
7
+ Right: new Vec2(1, 0)
8
8
  };
@@ -1,10 +1,10 @@
1
- import { Point2 } from "./Point2";
2
- import { isPolygonClockwise } from "./isPolygonClockwise";
3
-
4
- export function ensurePolygonClockwise<T extends Point2>(poly: T[]): T[] {
5
- if (!isPolygonClockwise(poly)) {
6
- return poly.reverse();
7
- }
8
-
9
- return poly;
1
+ import { Point2 } from "./Point2";
2
+ import { isPolygonClockwise } from "./isPolygonClockwise";
3
+
4
+ export function ensurePolygonClockwise<T extends Point2>(poly: T[]): T[] {
5
+ if (!isPolygonClockwise(poly)) {
6
+ return poly.reverse();
7
+ }
8
+
9
+ return poly;
10
10
  }
@@ -1,11 +1,11 @@
1
- import { Line2D } from "./Line2D";
2
-
3
- export function extendOrTrimPolylinesAtIntersections(lines: Line2D[]): void {
4
- for (let i = 0; i < lines.length; i++) {
5
- const current = lines[i];
6
- const next = lines[(i + 1) % lines.length];
7
-
8
- current.extendToOrTrimAtIntersection(next);
9
- next.extendToOrTrimAtIntersection(current);
10
- }
1
+ import { Line2D } from "./Line2D";
2
+
3
+ export function extendOrTrimPolylinesAtIntersections(lines: Line2D[]): void {
4
+ for (let i = 0; i < lines.length; i++) {
5
+ const current = lines[i];
6
+ const next = lines[(i + 1) % lines.length];
7
+
8
+ current.extendToOrTrimAtIntersection(next);
9
+ next.extendToOrTrimAtIntersection(current);
10
+ }
11
11
  }
@@ -1,22 +1,22 @@
1
- import { Point2 } from "./Point2";
2
-
3
- /**
4
- * Returns the area of polygon.
5
- * @returns {number}
6
- * @param polygon {Point2[]}
7
- */
8
- export function getPolygonArea(polygon: Point2[]): number {
9
- const p: number[] = [];
10
- for (const point of polygon) {
11
- p.push(point.x, point.y);
12
- }
13
-
14
- if (p.length < 6) return 0;
15
- const l = p.length - 2;
16
- let sum = 0;
17
- for (let i = 0; i < l; i += 2) {
18
- sum += (p[i + 2] - p[i]) * (p[i + 1] + p[i + 3]);
19
- }
20
- sum += (p[0] - p[l]) * (p[l + 1] + p[1]);
21
- return Math.abs(-sum * 0.5); // Handles -0
1
+ import { Point2 } from "./Point2";
2
+
3
+ /**
4
+ * Returns the area of polygon.
5
+ * @returns {number}
6
+ * @param polygon {Point2[]}
7
+ */
8
+ export function getPolygonArea(polygon: Point2[]): number {
9
+ const p: number[] = [];
10
+ for (const point of polygon) {
11
+ p.push(point.x, point.y);
12
+ }
13
+
14
+ if (p.length < 6) return 0;
15
+ const l = p.length - 2;
16
+ let sum = 0;
17
+ for (let i = 0; i < l; i += 2) {
18
+ sum += (p[i + 2] - p[i]) * (p[i + 1] + p[i + 3]);
19
+ }
20
+ sum += (p[0] - p[l]) * (p[l + 1] + p[1]);
21
+ return Math.abs(-sum * 0.5); // Handles -0
22
22
  }
package/src/index.ts CHANGED
@@ -1,25 +1,25 @@
1
- export { Vec2 } from "./Vec2";
2
- export { Vec3 } from "./Vec3";
3
- export { Line2D } from "./Line2D";
4
- export { Line3D } from "./Line3D";
5
- export { Size2 } from "./Size2";
6
- export { Polygon } from "./Polygon";
7
- export { BoundingBox } from "./BoundingBox";
8
- export { Rectangle } from "./Rectangle";
9
- export { normalizeAngleDegrees } from "./normalizeAngleDegrees";
10
- export { normalizeAngleRadians } from "./normalizeAngleRadians";
11
- export { TwoPI, HalfPI } from "./MathConstants";
12
- export { Point2 } from "./Point2";
13
- export { Point3 } from "./Point3";
14
- export { isPointInPolygon } from "./isPointInPolygon";
15
- export { directions } from "./directions";
16
- export { directions2d } from "./directions2d";
17
- export { isContinuousClosedShape } from "./isContinuousClosedShape";
18
- export { polygonPerimeter } from "./polygonPerimeter";
19
- export { offsetPolyline } from "./offsetPolyline";
20
- export { extendOrTrimPolylinesAtIntersections } from "./extendOrTrimPolylinesAtIntersections";
21
- export { sortLinesByConnections } from "./sortLinesByConnections";
22
- export { isPolygonClockwise } from "./isPolygonClockwise";
23
- export { ensurePolygonClockwise } from "./ensurePolygonClockwise";
24
- export { containsPoint, containsPoints } from "./containsPoint";
1
+ export { Vec2 } from "./Vec2";
2
+ export { Vec3 } from "./Vec3";
3
+ export { Line2D } from "./Line2D";
4
+ export { Line3D } from "./Line3D";
5
+ export { Size2 } from "./Size2";
6
+ export { Polygon } from "./Polygon";
7
+ export { BoundingBox } from "./BoundingBox";
8
+ export { Rectangle } from "./Rectangle";
9
+ export { normalizeAngleDegrees } from "./normalizeAngleDegrees";
10
+ export { normalizeAngleRadians } from "./normalizeAngleRadians";
11
+ export { TwoPI, HalfPI } from "./MathConstants";
12
+ export { Point2 } from "./Point2";
13
+ export { Point3 } from "./Point3";
14
+ export { isPointInPolygon } from "./isPointInPolygon";
15
+ export { directions } from "./directions";
16
+ export { directions2d } from "./directions2d";
17
+ export { isContinuousClosedShape } from "./isContinuousClosedShape";
18
+ export { polygonPerimeter } from "./polygonPerimeter";
19
+ export { offsetPolyline } from "./offsetPolyline";
20
+ export { extendOrTrimPolylinesAtIntersections } from "./extendOrTrimPolylinesAtIntersections";
21
+ export { sortLinesByConnections } from "./sortLinesByConnections";
22
+ export { isPolygonClockwise } from "./isPolygonClockwise";
23
+ export { ensurePolygonClockwise } from "./ensurePolygonClockwise";
24
+ export { containsPoint, containsPoints } from "./containsPoint";
25
25
  export { getPolygonArea } from "./getPolygonArea";