@woosh/meep-engine 2.135.1 → 2.138.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/package.json +1 -1
- package/src/core/geom/2d/aabb/aabb2_intersects_ray.d.ts.map +1 -1
- package/src/core/geom/2d/aabb/aabb2_intersects_ray.js +5 -7
- package/src/core/geom/2d/hash-grid/shg_query_elements_circle.d.ts.map +1 -1
- package/src/core/geom/2d/hash-grid/shg_query_elements_circle.js +2 -3
- package/src/core/geom/3d/aabb/aabb3_intersects_line_segment.d.ts.map +1 -1
- package/src/core/geom/3d/aabb/aabb3_intersects_line_segment.js +9 -11
- package/src/core/geom/3d/tetrahedra/tetrahedron_compute_circumsphere.d.ts.map +1 -1
- package/src/core/geom/3d/tetrahedra/tetrahedron_compute_circumsphere.js +6 -4
- package/src/core/geom/3d/topology/simplify/quadratic/Quadric3.d.ts.map +1 -1
- package/src/core/geom/3d/topology/simplify/quadratic/Quadric3.js +1 -2
- package/src/core/geom/packing/miniball/Miniball.d.ts.map +1 -1
- package/src/core/geom/packing/miniball/Miniball.js +4 -11
- package/src/core/geom/packing/miniball/Subspan.d.ts +14 -39
- package/src/core/geom/packing/miniball/Subspan.d.ts.map +1 -1
- package/src/core/geom/packing/miniball/Subspan.js +105 -158
- package/src/core/geom/packing/miniball/miniball_compute_quality.d.ts.map +1 -1
- package/src/core/geom/packing/miniball/miniball_compute_quality.js +2 -6
- package/src/core/geom/vec/vector_axpy.d.ts +12 -0
- package/src/core/geom/vec/vector_axpy.d.ts.map +1 -0
- package/src/core/geom/vec/vector_axpy.js +15 -0
- package/src/core/geom/vec/vector_axpy_offset.d.ts +17 -0
- package/src/core/geom/vec/vector_axpy_offset.d.ts.map +1 -0
- package/src/core/geom/vec/vector_axpy_offset.js +20 -0
- package/src/core/geom/vec/vector_dot_offset.d.ts +18 -0
- package/src/core/geom/vec/vector_dot_offset.d.ts.map +1 -0
- package/src/core/geom/vec/vector_dot_offset.js +25 -0
- package/src/core/math/complex/complex_horner_eval.d.ts +2 -2
- package/src/core/math/complex/complex_horner_eval.d.ts.map +1 -1
- package/src/core/math/complex/complex_horner_eval.js +4 -1
- package/src/core/math/fabsf.d.ts +2 -3
- package/src/core/math/fabsf.d.ts.map +1 -1
- package/src/core/math/fabsf.js +3 -5
- package/src/core/math/linalg/cubic_residual_times_derivative_accumulate.d.ts +26 -0
- package/src/core/math/linalg/cubic_residual_times_derivative_accumulate.d.ts.map +1 -0
- package/src/core/math/linalg/cubic_residual_times_derivative_accumulate.js +43 -0
- package/src/core/math/linalg/eigen/matrix_eigenvalues_in_place.d.ts +2 -1
- package/src/core/math/linalg/eigen/matrix_eigenvalues_in_place.d.ts.map +1 -1
- package/src/core/math/linalg/eigen/matrix_eigenvalues_in_place.js +2 -1
- package/src/core/math/linalg/eigen/matrix_householder_in_place.d.ts +10 -4
- package/src/core/math/linalg/eigen/matrix_householder_in_place.d.ts.map +1 -1
- package/src/core/math/linalg/eigen/matrix_householder_in_place.js +122 -98
- package/src/core/math/linalg/eigen/matrix_qr_in_place.d.ts +2 -2
- package/src/core/math/linalg/eigen/matrix_qr_in_place.d.ts.map +1 -1
- package/src/core/math/linalg/eigen/matrix_qr_in_place.js +144 -124
- package/src/core/math/linalg/givens/givens_apply_rows.d.ts +22 -0
- package/src/core/math/linalg/givens/givens_apply_rows.d.ts.map +1 -0
- package/src/core/math/linalg/givens/givens_apply_rows.js +28 -0
- package/src/core/math/linalg/givens/givens_apply_rows_offset.d.ts +24 -0
- package/src/core/math/linalg/givens/givens_apply_rows_offset.d.ts.map +1 -0
- package/src/core/math/linalg/givens/givens_apply_rows_offset.js +30 -0
- package/src/core/math/linalg/givens/givens_rotation_coefficients.d.ts +25 -0
- package/src/core/math/linalg/givens/givens_rotation_coefficients.d.ts.map +1 -0
- package/src/core/math/linalg/givens/givens_rotation_coefficients.js +39 -0
- package/src/core/math/linalg/lu_factor_linear_system.d.ts +1 -1
- package/src/core/math/linalg/lu_factor_linear_system.d.ts.map +1 -1
- package/src/core/math/linalg/lu_factor_linear_system.js +108 -117
- package/src/core/math/linalg/lu_solve_linear_system.d.ts +1 -1
- package/src/core/math/linalg/lu_solve_linear_system.js +53 -53
- package/src/core/math/linalg/polynomial_add_into.d.ts +18 -0
- package/src/core/math/linalg/polynomial_add_into.d.ts.map +1 -0
- package/src/core/math/linalg/polynomial_add_into.js +29 -0
- package/src/core/math/linalg/polynomial_complex_roots_aberth_ehrlich.d.ts +6 -1
- package/src/core/math/linalg/polynomial_complex_roots_aberth_ehrlich.d.ts.map +1 -1
- package/src/core/math/linalg/polynomial_complex_roots_aberth_ehrlich.js +19 -12
- package/src/core/math/linalg/polynomial_cubic_derivative_eval.d.ts +15 -0
- package/src/core/math/linalg/polynomial_cubic_derivative_eval.d.ts.map +1 -0
- package/src/core/math/linalg/polynomial_cubic_derivative_eval.js +16 -0
- package/src/core/math/linalg/polynomial_cubic_horner_eval.d.ts +18 -0
- package/src/core/math/linalg/polynomial_cubic_horner_eval.d.ts.map +1 -0
- package/src/core/math/linalg/polynomial_cubic_horner_eval.js +19 -0
- package/src/core/math/linalg/polynomial_cubic_second_derivative_eval.d.ts +13 -0
- package/src/core/math/linalg/polynomial_cubic_second_derivative_eval.d.ts.map +1 -0
- package/src/core/math/linalg/polynomial_cubic_second_derivative_eval.js +14 -0
- package/src/core/math/linalg/polynomial_multiply.d.ts +21 -0
- package/src/core/math/linalg/polynomial_multiply.d.ts.map +1 -0
- package/src/core/math/linalg/polynomial_multiply.js +41 -0
- package/src/core/math/linalg/polynomial_real_roots_in_interval.d.ts +6 -1
- package/src/core/math/linalg/polynomial_real_roots_in_interval.d.ts.map +1 -1
- package/src/core/math/linalg/polynomial_real_roots_in_interval.js +9 -2
- package/src/core/math/linalg/polynomial_scale_into.d.ts +14 -0
- package/src/core/math/linalg/polynomial_scale_into.d.ts.map +1 -0
- package/src/core/math/linalg/polynomial_scale_into.js +17 -0
- package/src/core/math/linalg/polynomial_sub_into.d.ts +18 -0
- package/src/core/math/linalg/polynomial_sub_into.d.ts.map +1 -0
- package/src/core/math/linalg/polynomial_sub_into.js +29 -0
- package/src/core/math/linalg/solve_linear_system.d.ts +1 -1
- package/src/core/math/linalg/solve_linear_system.js +1 -1
- package/src/core/math/linalg/solve_linear_system_GEPP_2x2.d.ts +4 -4
- package/src/core/math/linalg/solve_linear_system_GEPP_2x2.d.ts.map +1 -1
- package/src/core/math/linalg/solve_linear_system_GEPP_2x2.js +96 -91
- package/src/core/math/spline/spline3_hermite_intersection_spline3_hermite.d.ts +18 -10
- package/src/core/math/spline/spline3_hermite_intersection_spline3_hermite.d.ts.map +1 -1
- package/src/core/math/spline/spline3_hermite_intersection_spline3_hermite.js +18 -10
- package/src/core/math/spline/spline3_hermite_intersection_spline3_hermite_1d.d.ts +13 -6
- package/src/core/math/spline/spline3_hermite_intersection_spline3_hermite_1d.d.ts.map +1 -1
- package/src/core/math/spline/spline3_hermite_intersection_spline3_hermite_1d.js +16 -11
- package/src/core/math/spline/spline3_hermite_intersection_spline3_hermite_2d.d.ts +25 -3
- package/src/core/math/spline/spline3_hermite_intersection_spline3_hermite_2d.d.ts.map +1 -1
- package/src/core/math/spline/spline3_hermite_intersection_spline3_hermite_2d.js +78 -135
- package/src/core/math/spline/spline3_hermite_intersection_spline3_hermite_nd.d.ts +30 -4
- package/src/core/math/spline/spline3_hermite_intersection_spline3_hermite_nd.d.ts.map +1 -1
- package/src/core/math/spline/spline3_hermite_intersection_spline3_hermite_nd.js +188 -132
- package/src/core/math/spline/spline3_hermite_intersects_spline3_hermite.d.ts +7 -3
- package/src/core/math/spline/spline3_hermite_intersects_spline3_hermite.d.ts.map +1 -1
- package/src/core/math/spline/spline3_hermite_intersects_spline3_hermite.js +35 -6
- package/src/engine/graphics/geometry/MikkT/CalcTexArea.d.ts.map +1 -1
- package/src/engine/graphics/geometry/MikkT/CalcTexArea.js +1 -2
- package/src/engine/graphics/geometry/MikkT/InitTriInfo.d.ts.map +1 -1
- package/src/engine/graphics/geometry/MikkT/InitTriInfo.js +6 -7
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"description": "Pure JavaScript game engine. Fully featured and production ready.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"author": "Alexander Goldring",
|
|
8
|
-
"version": "2.
|
|
8
|
+
"version": "2.138.0",
|
|
9
9
|
"main": "build/meep.module.js",
|
|
10
10
|
"module": "build/meep.module.js",
|
|
11
11
|
"exports": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aabb2_intersects_ray.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/2d/aabb/aabb2_intersects_ray.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"aabb2_intersects_ray.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/2d/aabb/aabb2_intersects_ray.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,yCAVW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,YACN,MAAM,YACN,MAAM,eACN,MAAM,eACN,MAAM,GACL,OAAO,CAqClB"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { fabsf } from "../../../math/fabsf.js";
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
2
|
*
|
|
5
3
|
* @param {number} x0
|
|
@@ -25,7 +23,7 @@ export function aabb2_intersects_ray(
|
|
|
25
23
|
|
|
26
24
|
const diff_x = origin_x - center_x;
|
|
27
25
|
|
|
28
|
-
if (diff_x * direction_x >= 0.0 &&
|
|
26
|
+
if (diff_x * direction_x >= 0.0 && Math.abs(diff_x) > extents_x) {
|
|
29
27
|
return false;
|
|
30
28
|
}
|
|
31
29
|
|
|
@@ -36,15 +34,15 @@ export function aabb2_intersects_ray(
|
|
|
36
34
|
|
|
37
35
|
const diff_y = origin_y - center_y;
|
|
38
36
|
|
|
39
|
-
if (diff_y * direction_y >= 0.0 &&
|
|
37
|
+
if (diff_y * direction_y >= 0.0 && Math.abs(diff_y) > extents_y) {
|
|
40
38
|
return false;
|
|
41
39
|
}
|
|
42
40
|
|
|
43
|
-
const abs_direction_y =
|
|
41
|
+
const abs_direction_y = Math.abs(direction_y);
|
|
44
42
|
|
|
45
|
-
const abs_direction_x =
|
|
43
|
+
const abs_direction_x = Math.abs(direction_x);
|
|
46
44
|
|
|
47
|
-
const f2 =
|
|
45
|
+
const f2 = Math.abs(direction_x * diff_y - direction_y * diff_x);
|
|
48
46
|
|
|
49
47
|
return f2 <= extents_x * abs_direction_y + extents_y * abs_direction_x;
|
|
50
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shg_query_elements_circle.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/2d/hash-grid/shg_query_elements_circle.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shg_query_elements_circle.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/2d/hash-grid/shg_query_elements_circle.js"],"names":[],"mappings":"AA2CA;;;;;;;;;GASG;AACH,kDARW,MAAM,EAAE,iBACR,MAAM,mCAEN,MAAM,YACN,MAAM,UACN,MAAM,GACJ,MAAM,CAyGlB"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { fabsf } from "../../../math/fabsf.js";
|
|
2
1
|
import { max2 } from "../../../math/max2.js";
|
|
3
2
|
import { min2 } from "../../../math/min2.js";
|
|
4
3
|
import { aabb2_distance_sqr_to_point } from "../aabb/aabb2_distance_sqr_to_point.js";
|
|
@@ -27,8 +26,8 @@ function unit_square_intersects_circle(
|
|
|
27
26
|
circle_radius
|
|
28
27
|
) {
|
|
29
28
|
|
|
30
|
-
const x =
|
|
31
|
-
const y =
|
|
29
|
+
const x = Math.abs(circle_center_x - square_center_x) - 0.5;
|
|
30
|
+
const y = Math.abs(circle_center_y - square_center_y) - 0.5;
|
|
32
31
|
|
|
33
32
|
if (x > 0) {
|
|
34
33
|
if (y > 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aabb3_intersects_line_segment.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/aabb/aabb3_intersects_line_segment.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"aabb3_intersects_line_segment.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/aabb/aabb3_intersects_line_segment.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,kDAdW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,UACN,MAAM,UACN,MAAM,UACN,MAAM,QACN,MAAM,QACN,MAAM,QACN,MAAM,GACJ,OAAO,CA4DnB"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { fabsf } from "../../../math/fabsf.js";
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
2
|
* http://stackoverflow.com/questions/3106666/intersection-of-line-segment-with-axis-aligned-box-in-c-sharp
|
|
5
3
|
* @param {number} x0
|
|
@@ -42,22 +40,22 @@ function aabb3_intersects_line_segment(
|
|
|
42
40
|
boxExtentsX = (x1 - x0) / 2;
|
|
43
41
|
centerX = x0 + boxExtentsX;
|
|
44
42
|
diffX = (0.5 * (endX + startX)) - centerX;
|
|
45
|
-
a =
|
|
46
|
-
if (
|
|
43
|
+
a = Math.abs(dirX);
|
|
44
|
+
if (Math.abs(diffX) > boxExtentsX + a) return false;
|
|
47
45
|
//
|
|
48
46
|
dirY = 0.5 * (endY - startY);
|
|
49
47
|
boxExtentsY = (y1 - y0) / 2;
|
|
50
48
|
centerY = y0 + boxExtentsY;
|
|
51
49
|
diffY = (0.5 * (endY + startY)) - centerY;
|
|
52
|
-
b =
|
|
53
|
-
if (
|
|
50
|
+
b = Math.abs(dirY);
|
|
51
|
+
if (Math.abs(diffY) > boxExtentsY + b) return false;
|
|
54
52
|
//
|
|
55
53
|
dirZ = 0.5 * (endZ - startZ);
|
|
56
54
|
boxExtentsZ = (z1 - z0) / 2;
|
|
57
55
|
centerZ = z0 + boxExtentsZ;
|
|
58
56
|
diffZ = (0.5 * (endZ + startZ)) - centerZ;
|
|
59
|
-
c =
|
|
60
|
-
if (
|
|
57
|
+
c = Math.abs(dirZ);
|
|
58
|
+
if (Math.abs(diffZ) > boxExtentsZ + c) return false;
|
|
61
59
|
|
|
62
60
|
//Dir.y = 0.5f * (segment.mP1.y - segment.mP0.y);
|
|
63
61
|
//BoxExtents.y = aabb.GetExtents(1);
|
|
@@ -67,11 +65,11 @@ function aabb3_intersects_line_segment(
|
|
|
67
65
|
|
|
68
66
|
let f;
|
|
69
67
|
f = dirY * diffZ - dirZ * diffY;
|
|
70
|
-
if (
|
|
68
|
+
if (Math.abs(f) > boxExtentsY * c + boxExtentsZ * b) return false;
|
|
71
69
|
f = dirZ * diffX - dirX * diffZ;
|
|
72
|
-
if (
|
|
70
|
+
if (Math.abs(f) > boxExtentsX * c + boxExtentsZ * a) return false;
|
|
73
71
|
f = dirX * diffY - dirY * diffX;
|
|
74
|
-
if (
|
|
72
|
+
if (Math.abs(f) > boxExtentsX * b + boxExtentsY * a) return false;
|
|
75
73
|
|
|
76
74
|
return true;
|
|
77
75
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tetrahedron_compute_circumsphere.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/tetrahedra/tetrahedron_compute_circumsphere.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tetrahedron_compute_circumsphere.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/tetrahedra/tetrahedron_compute_circumsphere.js"],"names":[],"mappings":"AAiBA;;;;;;;;;;GAUG;AACH,yDAPW,MAAM,EAAE,UACR,MAAM,EAAE,KACR,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,QA8EhB"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { array_copy } from "../../../collection/array/array_copy.js";
|
|
2
1
|
import { solve_linear_system } from "../../../math/linalg/solve_linear_system.js";
|
|
3
2
|
import { v3_dot } from "../../vec3/v3_dot.js";
|
|
4
3
|
|
|
@@ -49,9 +48,12 @@ export function tetrahedron_compute_circumsphere(
|
|
|
49
48
|
x14[i] = (v_d + v_a) * 0.5;
|
|
50
49
|
}
|
|
51
50
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
// Pack A column-major (solve_linear_system expects column-major). The
|
|
52
|
+
// math matrix rows are n12, n13, n14, so column j of A holds the j-th
|
|
53
|
+
// component of each normal: [n12[j], n13[j], n14[j]].
|
|
54
|
+
A[0] = n12[0]; A[1] = n13[0]; A[2] = n14[0];
|
|
55
|
+
A[3] = n12[1]; A[4] = n13[1]; A[5] = n14[1];
|
|
56
|
+
A[6] = n12[2]; A[7] = n13[2]; A[8] = n14[2];
|
|
55
57
|
|
|
56
58
|
rhs[0] = v3_dot(n12[0], n12[1], n12[2], x12[0], x12[1], x12[2]);
|
|
57
59
|
rhs[1] = v3_dot(n13[0], n13[1], n13[2], x13[0], x13[1], x13[2]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Quadric3.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/geom/3d/topology/simplify/quadratic/Quadric3.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Quadric3.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/geom/3d/topology/simplify/quadratic/Quadric3.js"],"names":[],"mappings":"AAKA;;;;;;;;;GASG;AACH;IACI,cAEC;IAMD,iBAEC;IAND,cAEC;IAGG,OAAW;IAOf,iBAEC;IAND,cAEC;IAGG,OAAW;IAOf,iBAEC;IAND,cAEC;IAGG,OAAW;IAOf,iBAEC;IAND,cAEC;IAGG,OAAW;IAOf,iBAEC;IAND,cAEC;IAGG,OAAW;IAOf,iBAEC;IAND,cAEC;IAGG,OAAW;IAOf,iBAEC;IAND,cAEC;IAGG,OAAW;IAOf,iBAEC;IAND,cAEC;IAGG,OAAW;IAOf,iBAEC;IAND,cAEC;IAGG,OAAW;IAOf,iBAEC;IAND,cAEC;IAGG,OAAW;IAGf;;;OAGG;IACH,kBAFW,UAAU,MAAM,CAAC,GAAC,MAAM,EAAE,GAAC,YAAY,QAMjD;IAED;;;OAGG;IACH,eAFW,UAAU,MAAM,CAAC,GAAC,MAAM,EAAE,GAAC,YAAY,QAkBjD;IAED;;;;;OAKG;IACH,sBAJW,UAAU,MAAM,CAAC,GAAC,MAAM,EAAE,GAAC,YAAY,WACvC,MAAM,GACJ,OAAO,CAqCnB;IAED;;;;;;OAMG;IACH,kBALW,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,QAgBhB;IAED;;;;;;OAMG;IACH,YALW,MAAM,KACN,MAAM,KACN,MAAM,GACJ,MAAM,CASlB;IAED;;;;;OAKG;IACH,cAHW,MAAM,EAAE,GACN,OAAO,CAkBnB;IAED;;;OAGG;IACH,OAFW,QAAQ,QAalB;IAED;;;OAGG;IACH,kBAFW,MAAM,QAahB;IAED;;;OAGG;IACH,SAFa,QAAQ,CAQpB;IAED;;;OAGG;IACH,YAFW,QAAQ,QAIlB;IAED;;OAEG;IACH,cAEC;IAGL;;;;OAIG;IACH,qBAFU,OAAO,CAEY;CAP5B"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { vec3 } from "gl-matrix";
|
|
2
2
|
import { EPSILON } from "../../../../../math/EPSILON.js";
|
|
3
|
-
import { fabsf } from "../../../../../math/fabsf.js";
|
|
4
3
|
|
|
5
4
|
const scratch_m3 = new Float32Array(9);
|
|
6
5
|
|
|
@@ -149,7 +148,7 @@ export class Quadric3 extends Float64Array {
|
|
|
149
148
|
ab * (ab * c2 - ac * bc) +
|
|
150
149
|
ac * (ab * bc - ac * b2);
|
|
151
150
|
|
|
152
|
-
if (
|
|
151
|
+
if (Math.abs(det) > epsilon) {
|
|
153
152
|
// avoid division by zero
|
|
154
153
|
|
|
155
154
|
const invdet = 1.0 / det;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Miniball.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/packing/miniball/Miniball.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Miniball.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/packing/miniball/Miniball.js"],"names":[],"mappings":"AAyBA;;;;;GAKG;AACH;IA8CI;;;;;OAKG;IACH,8BA4DC;IA9GD;;;OAGG;IACH,WAFU,MAAM,CAEF;IAEd;;;OAGG;IACH,WAFU,MAAM,CAEF;IAEd;;;OAGG;IACH,iBAFU,MAAM,CAEI;IAEpB;;;;;;;;;;OAUG;IACH,wBAAoB;IAEpB;;;;OAIG;IACH,iBAAa;IAEb;;;OAGG;IACH,SAFU,MAAM,CAEJ;IAYR;;OAEG;IACH,YAAe;IAEf;;;;OAIG;IACH,eAA2B;IAI3B;;;OAGG;IACH,KAFU,MAAM,CAEU;IAM1B;;;;OAIG;IACH,iBAA4D;IAE5D;;;OAGG;IACH,aAFU,MAAM,EAAE,GAAC,YAAY,CAEkD;IAEjF;;;OAGG;IACH,eAFU,MAAM,EAAE,GAAC,YAAY,CAEwD;IAEvF;;;OAGG;IACH,SAFU,MAAM,EAAE,GAAC,YAAY,CAEsD;IAErF;;;;OAIG;IACH,kBAAgC;IAIpC;;;;;;;OAOG;IACH,WAFY,OAAO,CAIlB;IAED;;;;;;OAMG;IACH,UAFY,MAAM,CAIjB;IAED;;;;;;OAMG;IACH,UAFY,MAAM,EAAE,CAInB;IAED;;;OAGG;IACH,uBAEC;IAED;;;;;;OAMG;IACH,QAJY,MAAM,CAMjB;IAED;;;;;;;;OAQG;IACH,iBAkCC;IAED;;OAEG;IACH,yBAGC;IAED;;OAEG;IACH,qBAcC;IAED;;;;;;;;;;;OAWG;IACH,gBA4CC;IAED;;;;;;;;OAQG;IACH,kBAFY,OAAO,CA4BlB;IAED;;;;;;;;OAQG;IACH,yBAsDC;IAGD;;;OAGG;IACH,YAFY,MAAM,CA0BjB;CACJ;wBAjcuB,cAAc"}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import { assert } from "../../../assert.js";
|
|
10
10
|
import { sqr } from "../../../math/sqr.js";
|
|
11
|
+
import { vector_dot } from "../../vec/vector_dot.js";
|
|
11
12
|
import { Subspan } from "./Subspan.js";
|
|
12
13
|
|
|
13
14
|
/**
|
|
@@ -405,23 +406,15 @@ export class Miniball {
|
|
|
405
406
|
centerToPoint[i] = pointSet.coord(j, i) - center[i];
|
|
406
407
|
}
|
|
407
408
|
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
for (i = 0; i < dim; ++i) {
|
|
411
|
-
dirPointProd += centerToAff[i] * centerToPoint[i];
|
|
412
|
-
}
|
|
409
|
+
const dirPointProd = vector_dot(centerToAff, centerToPoint, dim);
|
|
413
410
|
|
|
414
411
|
if ((distToAffSquare - dirPointProd) < distance_error) {
|
|
415
412
|
continue;
|
|
416
413
|
}
|
|
417
414
|
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
for (i = 0; i < dim; ++i) {
|
|
421
|
-
bound += centerToPoint[i] * centerToPoint[i];
|
|
422
|
-
}
|
|
415
|
+
const bound_sq = vector_dot(centerToPoint, centerToPoint, dim);
|
|
423
416
|
|
|
424
|
-
bound = (squaredRadius -
|
|
417
|
+
const bound = (squaredRadius - bound_sq) / 2 / (distToAffSquare - dirPointProd);
|
|
425
418
|
|
|
426
419
|
if (bound > 0 && bound < scale) {
|
|
427
420
|
//if (com.dreizak.miniball.highdim.Logging.log)
|
|
@@ -26,36 +26,31 @@ export class Subspan {
|
|
|
26
26
|
*/
|
|
27
27
|
members: Int32Array;
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
30
|
-
* @type {number[][]}
|
|
29
|
+
* @type {SquareMatrix}
|
|
31
30
|
*/
|
|
32
|
-
Q:
|
|
31
|
+
Q: SquareMatrix;
|
|
33
32
|
/**
|
|
34
|
-
*
|
|
35
|
-
* @type {number[][]}
|
|
33
|
+
* @type {SquareMatrix}
|
|
36
34
|
*/
|
|
37
|
-
R:
|
|
35
|
+
R: SquareMatrix;
|
|
38
36
|
/**
|
|
39
37
|
* D sized vector
|
|
40
|
-
* @type {
|
|
38
|
+
* @type {Float64Array}
|
|
41
39
|
*/
|
|
42
|
-
u:
|
|
40
|
+
u: Float64Array;
|
|
43
41
|
/**
|
|
44
42
|
* D sized vector
|
|
45
|
-
* @type {
|
|
43
|
+
* @type {Float64Array}
|
|
46
44
|
*/
|
|
47
|
-
w:
|
|
45
|
+
w: Float64Array;
|
|
48
46
|
r: number;
|
|
49
47
|
/**
|
|
50
|
-
* Givens
|
|
51
|
-
*
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Givens S coefficient
|
|
56
|
-
* @type {number}
|
|
48
|
+
* Givens rotation coefficients scratch: cs[0] = c, cs[1] = s.
|
|
49
|
+
* Holding this as an instance field avoids per-call allocation of a
|
|
50
|
+
* fresh 2-element array — see givens_rotation_coefficients's contract.
|
|
51
|
+
* @type {Float64Array}
|
|
57
52
|
*/
|
|
58
|
-
|
|
53
|
+
cs: Float64Array;
|
|
59
54
|
dimension(): number;
|
|
60
55
|
/**
|
|
61
56
|
* The size of the instance's set <i>M</i>, a number between 0 and `dim+1`.
|
|
@@ -116,27 +111,6 @@ export class Subspan {
|
|
|
116
111
|
* @private
|
|
117
112
|
*/
|
|
118
113
|
private origin;
|
|
119
|
-
/**
|
|
120
|
-
* Determine the Givens coefficients <i>(c,s)</i> satisfying
|
|
121
|
-
*
|
|
122
|
-
* <pre>
|
|
123
|
-
* c * a + s * b = +/- (a^2 + b^2) c * b - s * a = 0
|
|
124
|
-
* </pre>
|
|
125
|
-
*
|
|
126
|
-
* We don't care about the signs here, for efficiency, so make sure not to rely on them anywhere.
|
|
127
|
-
*
|
|
128
|
-
* <i>Source:</i> "Matrix Computations" (2nd edition) by Gene H. B. Golub & Charles F. B. Van Loan
|
|
129
|
-
* (Johns Hopkins University Press, 1989), p. 216.
|
|
130
|
-
*
|
|
131
|
-
* Note that the code of this class sometimes does not call this method but only mentions it in a
|
|
132
|
-
* comment. The reason for this is performance; Java does not allow an efficient way of returning
|
|
133
|
-
* a pair of doubles, so we sometimes manually "inline" `givens()` for the sake of
|
|
134
|
-
* performance.
|
|
135
|
-
* @param {number} a
|
|
136
|
-
* @param {number} b
|
|
137
|
-
* @private
|
|
138
|
-
*/
|
|
139
|
-
private givens;
|
|
140
114
|
/**
|
|
141
115
|
* Appends the new column <i>u</i> (which is a member field of this instance) to the right of <i>A
|
|
142
116
|
* = QR</i>, updating <i>Q</i> and <i>R</i>. It assumes <i>r</i> to still be the old value, i.e.,
|
|
@@ -213,4 +187,5 @@ export class Subspan {
|
|
|
213
187
|
remove(index: number): void;
|
|
214
188
|
}
|
|
215
189
|
import { BitSet } from "../../../binary/BitSet.js";
|
|
190
|
+
import { SquareMatrix } from "../../../math/matrix/SquareMatrix.js";
|
|
216
191
|
//# sourceMappingURL=Subspan.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Subspan.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/packing/miniball/Subspan.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Subspan.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/packing/miniball/Subspan.js"],"names":[],"mappings":"AAgBA;IACI;;;;;OAKG;IACH,iBAJW,MAAM,kBAEN,MAAM,EAuEhB;IAhEG;;OAEG;IACH,YAAU;IAEV;;;OAGG;IACH,YAFU,MAAM,CAE4B;IAE5C;;;OAGG;IACH,KAFU,MAAM,CAEF;IAEd;;;OAGG;IACH,SAFU,UAAU,CAEkB;IAQtC;;OAEG;IACH,GAFU,YAAY,CAEgC;IAGtD;;OAEG;IACH,GAFU,YAAY,CAEgC;IAEtD;;;OAGG;IACH,GAFU,YAAY,CAEQ;IAC9B;;;OAGG;IACH,GAFU,YAAY,CAEQ;IAE9B,UAAU;IAEV;;;;;OAKG;IACH,IAFU,YAAY,CAEO;IAOjC,oBAEC;IAED;;;;;;OAMG;IACH,YAEC;IAED;;;;;;;;OAQG;IACH,kBAFa,OAAO,CAInB;IAED;;;;;;;OAOG;IACH,aAFa,MAAM,CAIlB;IAED;;;;;;;;;;OAUG;IACH,eAJW,MAAM,GAEL,MAAM,CAIjB;IAED;;;;;;;;;;;OAWG;IACH,YAEC;IAED;;;;;OAKG;IACH,eAEC;IAED;;;;;;;;OAQG;IACH,qBAyBC;IAED;;;;;;;;OAQG;IACH,WAFW,MAAM,QAsBhB;IAED;;;;;;;;;;;OAWG;IACH,wBAJW,MAAM,EAAE,KACR,MAAM,EAAE,GACP,MAAM,CA4BjB;IAED;;;;OAIG;IACH,uBAFY,MAAM,CA8CjB;IAED;;;;;;;;;;;;OAYG;IACH,0BAHW,MAAM,EAAE,GAAC,YAAY,WACrB,MAAM,EAAE,GAAC,YAAY,QAuC/B;IAED;;;;;OAKG;IACH,yBAkCC;IAED;;;;;;;OAOG;IACH,8BA4CC;IAED;;;OAGG;IACH,cAFW,MAAM,QA4ChB;CACJ;uBAxgBsB,2BAA2B;6BAErB,sCAAsC"}
|