@woosh/meep-engine 2.113.9 → 2.113.11
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/build/meep.cjs +13 -3
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +13 -3
- package/package.json +1 -1
- package/src/core/geom/3d/plane/plane3_compute_line_segment_intersection.d.ts +12 -12
- package/src/core/geom/3d/plane/plane3_compute_line_segment_intersection.d.ts.map +1 -1
- package/src/core/geom/3d/plane/plane3_compute_line_segment_intersection.js +14 -14
- package/src/core/geom/3d/tetrahedra/tetrahedron_compute_signed_volume.d.ts.map +1 -1
- package/src/core/geom/3d/tetrahedra/tetrahedron_compute_signed_volume.js +1 -32
- package/src/core/geom/3d/triangle/triangle_compute_signed_volume.d.ts +17 -0
- package/src/core/geom/3d/triangle/triangle_compute_signed_volume.d.ts.map +1 -0
- package/src/core/geom/3d/triangle/triangle_compute_signed_volume.js +33 -0
- package/src/core/geom/Vector2.d.ts.map +1 -1
- package/src/core/geom/Vector2.js +12 -2
package/build/meep.module.js
CHANGED
|
@@ -47394,7 +47394,7 @@ class Vector2 {
|
|
|
47394
47394
|
* @param {number[]} array
|
|
47395
47395
|
* @param {number} offset
|
|
47396
47396
|
*/
|
|
47397
|
-
|
|
47397
|
+
fromArray(array, offset = 0) {
|
|
47398
47398
|
this.set(
|
|
47399
47399
|
array[offset],
|
|
47400
47400
|
array[offset + 1]
|
|
@@ -47406,7 +47406,7 @@ class Vector2 {
|
|
|
47406
47406
|
* @param {number[]} array
|
|
47407
47407
|
* @param {number} offset
|
|
47408
47408
|
*/
|
|
47409
|
-
|
|
47409
|
+
toArray(array, offset = 0) {
|
|
47410
47410
|
array[offset] = this.x;
|
|
47411
47411
|
array[offset + 1] = this.y;
|
|
47412
47412
|
}
|
|
@@ -48019,7 +48019,17 @@ Vector2.one = Object.freeze(new Vector2(1, 1));
|
|
|
48019
48019
|
*/
|
|
48020
48020
|
Vector2.prototype.isVector2 = true;
|
|
48021
48021
|
|
|
48022
|
-
Vector2._distance = v2_distance;
|
|
48022
|
+
Vector2._distance = v2_distance;
|
|
48023
|
+
|
|
48024
|
+
/**
|
|
48025
|
+
* @deprecated use {@link Vector2#toArray} instead
|
|
48026
|
+
*/
|
|
48027
|
+
Vector2.prototype.writeToArray = Vector2.prototype.toArray;
|
|
48028
|
+
|
|
48029
|
+
/**
|
|
48030
|
+
* @deprecated use {@link Vector2#fromArray} instead
|
|
48031
|
+
*/
|
|
48032
|
+
Vector2.prototype.readFromArray = Vector2.prototype.fromArray;
|
|
48023
48033
|
|
|
48024
48034
|
/**
|
|
48025
48035
|
* NOTE, trying to keep to IANA registry: https://www.iana.org/assignments/media-types/media-types.xhtml
|
package/package.json
CHANGED
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
*
|
|
3
3
|
* @param {Float32Array|number[]|vec3} result
|
|
4
4
|
* @param {number} result_offset
|
|
5
|
-
* @param {number} x0
|
|
6
|
-
* @param {number} y0
|
|
7
|
-
* @param {number} z0
|
|
8
|
-
* @param {number} x1
|
|
9
|
-
* @param {number} y1
|
|
10
|
-
* @param {number} z1
|
|
11
|
-
* @param {number}
|
|
12
|
-
* @param {number}
|
|
13
|
-
* @param {number}
|
|
14
|
-
* @param {number}
|
|
15
|
-
* @returns {boolean}
|
|
5
|
+
* @param {number} x0 first point defining line
|
|
6
|
+
* @param {number} y0 first point defining line
|
|
7
|
+
* @param {number} z0 first point defining line
|
|
8
|
+
* @param {number} x1 second point defining line
|
|
9
|
+
* @param {number} y1 second point defining line
|
|
10
|
+
* @param {number} z1 second point defining line
|
|
11
|
+
* @param {number} plane_normal_x
|
|
12
|
+
* @param {number} plane_normal_y
|
|
13
|
+
* @param {number} plane_normal_z
|
|
14
|
+
* @param {number} plane_offset
|
|
15
|
+
* @returns {boolean} if intersection exists, false if line is parallel to the plane
|
|
16
16
|
*/
|
|
17
|
-
export function plane3_compute_line_segment_intersection(result: Float32Array | number[] | vec3, result_offset: number, x0: number, y0: number, z0: number, x1: number, y1: number, z1: number,
|
|
17
|
+
export function plane3_compute_line_segment_intersection(result: Float32Array | number[] | vec3, result_offset: number, x0: number, y0: number, z0: number, x1: number, y1: number, z1: number, plane_normal_x: number, plane_normal_y: number, plane_normal_z: number, plane_offset: number): boolean;
|
|
18
18
|
//# sourceMappingURL=plane3_compute_line_segment_intersection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plane3_compute_line_segment_intersection.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/plane/plane3_compute_line_segment_intersection.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;GAeG;AACH,iEAdW,YAAY,GAAC,MAAM,EAAE,OAAK,iBAC1B,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,
|
|
1
|
+
{"version":3,"file":"plane3_compute_line_segment_intersection.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/plane/plane3_compute_line_segment_intersection.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;GAeG;AACH,iEAdW,YAAY,GAAC,MAAM,EAAE,OAAK,iBAC1B,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,kBACN,MAAM,kBACN,MAAM,kBACN,MAAM,gBACN,MAAM,GACJ,OAAO,CAiCnB"}
|
|
@@ -4,36 +4,36 @@ import { v3_dot } from "../../vec3/v3_dot.js";
|
|
|
4
4
|
*
|
|
5
5
|
* @param {Float32Array|number[]|vec3} result
|
|
6
6
|
* @param {number} result_offset
|
|
7
|
-
* @param {number} x0
|
|
8
|
-
* @param {number} y0
|
|
9
|
-
* @param {number} z0
|
|
10
|
-
* @param {number} x1
|
|
11
|
-
* @param {number} y1
|
|
12
|
-
* @param {number} z1
|
|
13
|
-
* @param {number}
|
|
14
|
-
* @param {number}
|
|
15
|
-
* @param {number}
|
|
16
|
-
* @param {number}
|
|
17
|
-
* @returns {boolean}
|
|
7
|
+
* @param {number} x0 first point defining line
|
|
8
|
+
* @param {number} y0 first point defining line
|
|
9
|
+
* @param {number} z0 first point defining line
|
|
10
|
+
* @param {number} x1 second point defining line
|
|
11
|
+
* @param {number} y1 second point defining line
|
|
12
|
+
* @param {number} z1 second point defining line
|
|
13
|
+
* @param {number} plane_normal_x
|
|
14
|
+
* @param {number} plane_normal_y
|
|
15
|
+
* @param {number} plane_normal_z
|
|
16
|
+
* @param {number} plane_offset
|
|
17
|
+
* @returns {boolean} if intersection exists, false if line is parallel to the plane
|
|
18
18
|
*/
|
|
19
19
|
export function plane3_compute_line_segment_intersection(
|
|
20
20
|
result, result_offset,
|
|
21
21
|
x0, y0, z0,
|
|
22
22
|
x1, y1, z1,
|
|
23
|
-
|
|
23
|
+
plane_normal_x, plane_normal_y, plane_normal_z, plane_offset
|
|
24
24
|
) {
|
|
25
25
|
|
|
26
26
|
const directionX = x1 - x0;
|
|
27
27
|
const directionY = y1 - y0;
|
|
28
28
|
const directionZ = z1 - z0;
|
|
29
29
|
|
|
30
|
-
const denom = v3_dot(directionX, directionY, directionZ,
|
|
30
|
+
const denom = v3_dot(directionX, directionY, directionZ, plane_normal_x, plane_normal_y, plane_normal_z);
|
|
31
31
|
|
|
32
32
|
if (denom === 0) {
|
|
33
33
|
return false;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
const p = v3_dot(
|
|
36
|
+
const p = v3_dot(plane_normal_x, plane_normal_y, plane_normal_z, x0, y0, z0) + plane_offset;
|
|
37
37
|
|
|
38
38
|
const t = -p / denom;
|
|
39
39
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tetrahedron_compute_signed_volume.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/tetrahedra/tetrahedron_compute_signed_volume.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tetrahedron_compute_signed_volume.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/tetrahedra/tetrahedron_compute_signed_volume.js"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AACH,0DAPW,UAAU,MAAM,CAAC,GAAC,MAAM,EAAE,GAAC,YAAY,KACvC,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,GACJ,MAAM,CA0ClB"}
|
|
@@ -1,35 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Compute signed volume of a tetrahedron with the last point at the origin
|
|
5
|
-
* @see "EFFICIENT FEATURE EXTRACTION FOR 2D/3D OBJECTS IN MESH REPRESENTATION" by Cha Zhang and Tsuhan Chen
|
|
6
|
-
* @param {number} ax
|
|
7
|
-
* @param {number} ay
|
|
8
|
-
* @param {number} az
|
|
9
|
-
* @param {number} bx
|
|
10
|
-
* @param {number} by
|
|
11
|
-
* @param {number} bz
|
|
12
|
-
* @param {number} cx
|
|
13
|
-
* @param {number} cy
|
|
14
|
-
* @param {number} cz
|
|
15
|
-
* @return {number}
|
|
16
|
-
*/
|
|
17
|
-
function triangle_compute_signed_volume(
|
|
18
|
-
ax, ay, az,
|
|
19
|
-
bx, by, bz,
|
|
20
|
-
cx, cy, cz
|
|
21
|
-
) {
|
|
22
|
-
|
|
23
|
-
const v321 = cx * by * az;
|
|
24
|
-
const v231 = bx * cy * az;
|
|
25
|
-
const v312 = cx * ay * bz;
|
|
26
|
-
const v132 = ax * cy * bz;
|
|
27
|
-
const v213 = bx * ay * cz;
|
|
28
|
-
const v123 = ax * by * cz;
|
|
29
|
-
|
|
30
|
-
return ONE_OVER_SIX * (-v321 + v231 + v312 - v132 - v213 + v123);
|
|
31
|
-
|
|
32
|
-
}
|
|
1
|
+
import { triangle_compute_signed_volume } from "../triangle/triangle_compute_signed_volume.js";
|
|
33
2
|
|
|
34
3
|
|
|
35
4
|
/**
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compute signed volume of a tetrahedron with the last point at the origin
|
|
3
|
+
* Triangle is defined by points A,B,C
|
|
4
|
+
* @see "EFFICIENT FEATURE EXTRACTION FOR 2D/3D OBJECTS IN MESH REPRESENTATION" by Cha Zhang and Tsuhan Chen
|
|
5
|
+
* @param {number} ax
|
|
6
|
+
* @param {number} ay
|
|
7
|
+
* @param {number} az
|
|
8
|
+
* @param {number} bx
|
|
9
|
+
* @param {number} by
|
|
10
|
+
* @param {number} bz
|
|
11
|
+
* @param {number} cx
|
|
12
|
+
* @param {number} cy
|
|
13
|
+
* @param {number} cz
|
|
14
|
+
* @return {number}
|
|
15
|
+
*/
|
|
16
|
+
export function triangle_compute_signed_volume(ax: number, ay: number, az: number, bx: number, by: number, bz: number, cx: number, cy: number, cz: number): number;
|
|
17
|
+
//# sourceMappingURL=triangle_compute_signed_volume.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"triangle_compute_signed_volume.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/triangle/triangle_compute_signed_volume.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AACH,mDAXW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,GACL,MAAM,CAiBjB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const ONE_OVER_SIX = 1.0 / 6.0;
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Compute signed volume of a tetrahedron with the last point at the origin
|
|
5
|
+
* Triangle is defined by points A,B,C
|
|
6
|
+
* @see "EFFICIENT FEATURE EXTRACTION FOR 2D/3D OBJECTS IN MESH REPRESENTATION" by Cha Zhang and Tsuhan Chen
|
|
7
|
+
* @param {number} ax
|
|
8
|
+
* @param {number} ay
|
|
9
|
+
* @param {number} az
|
|
10
|
+
* @param {number} bx
|
|
11
|
+
* @param {number} by
|
|
12
|
+
* @param {number} bz
|
|
13
|
+
* @param {number} cx
|
|
14
|
+
* @param {number} cy
|
|
15
|
+
* @param {number} cz
|
|
16
|
+
* @return {number}
|
|
17
|
+
*/
|
|
18
|
+
export function triangle_compute_signed_volume(
|
|
19
|
+
ax, ay, az,
|
|
20
|
+
bx, by, bz,
|
|
21
|
+
cx, cy, cz
|
|
22
|
+
) {
|
|
23
|
+
|
|
24
|
+
const v321 = cx * by * az;
|
|
25
|
+
const v231 = bx * cy * az;
|
|
26
|
+
const v312 = cx * ay * bz;
|
|
27
|
+
const v132 = ax * cy * bz;
|
|
28
|
+
const v213 = bx * ay * cz;
|
|
29
|
+
const v123 = ax * by * cz;
|
|
30
|
+
|
|
31
|
+
return ONE_OVER_SIX * (-v321 + v231 + v312 - v132 - v213 + v123);
|
|
32
|
+
|
|
33
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Vector2.d.ts","sourceRoot":"","sources":["../../../../src/core/geom/Vector2.js"],"names":[],"mappings":";AAmBA;IACI;;;;;OAKG;IACH,gBAJW,MAAM,MACN,MAAM,EAuBhB;IAbG;;;OAGG;IACH,GAFU,MAAM,CAEN;IAEV;;;OAGG;IACH,GAFU,MAAM,CAEN;IAEV,0DAA6B;IAGjC;;;;OAIG;IACH,
|
|
1
|
+
{"version":3,"file":"Vector2.d.ts","sourceRoot":"","sources":["../../../../src/core/geom/Vector2.js"],"names":[],"mappings":";AAmBA;IACI;;;;;OAKG;IACH,gBAJW,MAAM,MACN,MAAM,EAuBhB;IAbG;;;OAGG;IACH,GAFU,MAAM,CAEN;IAEV;;;OAGG;IACH,GAFU,MAAM,CAEN;IAEV,0DAA6B;IAGjC;;;;OAIG;IACH,iBAHW,MAAM,EAAE,WACR,MAAM,QAOhB;IAED;;;;OAIG;IACH,eAHW,MAAM,EAAE,WACR,MAAM,QAKhB;IAED,iBAMC;IAED;;;;;OAKG;IACH,OAJW,MAAM,KACN,MAAM,GACJ,OAAO,CAqBnB;IAED;;;;OAIG;IACH,aAHW,MAAM,KACN,MAAM,QAYhB;IAED;;;;OAI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"}
|
package/src/core/geom/Vector2.js
CHANGED
|
@@ -51,7 +51,7 @@ class Vector2 {
|
|
|
51
51
|
* @param {number[]} array
|
|
52
52
|
* @param {number} offset
|
|
53
53
|
*/
|
|
54
|
-
|
|
54
|
+
fromArray(array, offset = 0) {
|
|
55
55
|
this.set(
|
|
56
56
|
array[offset],
|
|
57
57
|
array[offset + 1]
|
|
@@ -63,7 +63,7 @@ class Vector2 {
|
|
|
63
63
|
* @param {number[]} array
|
|
64
64
|
* @param {number} offset
|
|
65
65
|
*/
|
|
66
|
-
|
|
66
|
+
toArray(array, offset = 0) {
|
|
67
67
|
array[offset] = this.x;
|
|
68
68
|
array[offset + 1] = this.y;
|
|
69
69
|
}
|
|
@@ -690,4 +690,14 @@ Vector2.prototype.isVector2 = true;
|
|
|
690
690
|
|
|
691
691
|
Vector2._distance = v2_distance;
|
|
692
692
|
|
|
693
|
+
/**
|
|
694
|
+
* @deprecated use {@link Vector2#toArray} instead
|
|
695
|
+
*/
|
|
696
|
+
Vector2.prototype.writeToArray = Vector2.prototype.toArray;
|
|
697
|
+
|
|
698
|
+
/**
|
|
699
|
+
* @deprecated use {@link Vector2#fromArray} instead
|
|
700
|
+
*/
|
|
701
|
+
Vector2.prototype.readFromArray = Vector2.prototype.fromArray;
|
|
702
|
+
|
|
693
703
|
export default Vector2;
|