@solid-labs/fab-one-widget 1.1.11 → 1.1.12
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.
|
@@ -111,19 +111,19 @@ let __tla = (async () => {
|
|
|
111
111
|
const W = o[I * 3] * n, $ = o[I * 3 + 1] * n, G = o[I * 3 + 2] * n;
|
|
112
112
|
W < r && (r = W), W > p && (p = W), $ < c && (c = $), $ > f && (f = $), G < u && (u = G), G > m && (m = G);
|
|
113
113
|
}
|
|
114
|
-
const v = (r + p) * 0.5, h = (c + f) * 0.5, x = (u + m) * 0.5, w = p - r + 1e-6, C = f - c + 1e-6, b = m - u + 1e-6, F = w * 0.5, S = C * 0.5, A = b * 0.5, z = Math.min(128, Math.max(16, Math.round(Math.cbrt(a)))),
|
|
114
|
+
const v = (r + p) * 0.5, h = (c + f) * 0.5, x = (u + m) * 0.5, w = p - r + 1e-6, C = f - c + 1e-6, b = m - u + 1e-6, F = w * 0.5, S = C * 0.5, A = b * 0.5, z = Math.min(128, Math.max(16, Math.round(Math.cbrt(a)))), _ = w / z, B = C / z, N = b / z, k = /* @__PURE__ */ new Map();
|
|
115
115
|
for (let I = 0; I < a; I++) {
|
|
116
|
-
const W = o[I * 3] * n - v, $ = o[I * 3 + 1] * n - h, G = o[I * 3 + 2] * n - x, oe = Math.min(z - 1, Math.max(0, Math.floor((W + F) /
|
|
116
|
+
const W = o[I * 3] * n - v, $ = o[I * 3 + 1] * n - h, G = o[I * 3 + 2] * n - x, oe = Math.min(z - 1, Math.max(0, Math.floor((W + F) / _))), ce = Math.min(z - 1, Math.max(0, Math.floor(($ + S) / B))), se = Math.min(z - 1, Math.max(0, Math.floor((G + A) / N))), J = oe * z * z + ce * z + se;
|
|
117
117
|
let ae = k.get(J);
|
|
118
118
|
ae || (ae = [], k.set(J, ae)), ae.push(I);
|
|
119
119
|
}
|
|
120
120
|
for (let I = 0; I < l; I++) {
|
|
121
|
-
const W = s.getX(I), $ = s.getY(I), G = s.getZ(I), oe = Math.min(z - 1, Math.max(0, Math.floor((W + F) /
|
|
121
|
+
const W = s.getX(I), $ = s.getY(I), G = s.getZ(I), oe = Math.min(z - 1, Math.max(0, Math.floor((W + F) / _))), ce = Math.min(z - 1, Math.max(0, Math.floor(($ + S) / B))), se = Math.min(z - 1, Math.max(0, Math.floor((G + A) / N)));
|
|
122
122
|
let J = 1 / 0, ae = 0;
|
|
123
123
|
for (let U = 0; U <= z && J > 0; U++) {
|
|
124
|
-
for (let ge = -U; ge <= U; ge++) for (let re = -U; re <= U; re++) for (let
|
|
125
|
-
if (U > 0 && Math.abs(ge) < U && Math.abs(re) < U && Math.abs(
|
|
126
|
-
const H = oe + ge, ne = ce + re, Q = se +
|
|
124
|
+
for (let ge = -U; ge <= U; ge++) for (let re = -U; re <= U; re++) for (let R = -U; R <= U; R++) {
|
|
125
|
+
if (U > 0 && Math.abs(ge) < U && Math.abs(re) < U && Math.abs(R) < U) continue;
|
|
126
|
+
const H = oe + ge, ne = ce + re, Q = se + R;
|
|
127
127
|
if (H < 0 || H >= z || ne < 0 || ne >= z || Q < 0 || Q >= z) continue;
|
|
128
128
|
const j = k.get(H * z * z + ne * z + Q);
|
|
129
129
|
if (j) for (const K of j) {
|
|
@@ -553,7 +553,7 @@ let __tla = (async () => {
|
|
|
553
553
|
F[1],
|
|
554
554
|
F[2]
|
|
555
555
|
]), A = d.align_to_origin(p, m, v, S);
|
|
556
|
-
let z = A.positions(),
|
|
556
|
+
let z = A.positions(), _ = A.mpt(), B = A.origin();
|
|
557
557
|
const N = A.transform();
|
|
558
558
|
xe.info(De, "Alignment complete", A.details());
|
|
559
559
|
const k = [
|
|
@@ -572,7 +572,7 @@ let __tla = (async () => {
|
|
|
572
572
|
k[6] * F[0] + k[7] * F[1] + k[8] * F[2]
|
|
573
573
|
]);
|
|
574
574
|
n.onStatus("Generating measurement points...");
|
|
575
|
-
const W = d.subdivide_origin_to_plane(new Float32Array(B), new Float32Array(
|
|
575
|
+
const W = d.subdivide_origin_to_plane(new Float32Array(B), new Float32Array(_), I);
|
|
576
576
|
xe.debug(De, `Subdivide: ${W.count()} pts, spacing=${W.spacing().toFixed(1)}mm`);
|
|
577
577
|
const $ = W.points(), G = W.count(), oe = 2, ce = 1, se = [];
|
|
578
578
|
for (let j = oe; j < G - ce; j++) se.push($[j * 3 + 1]);
|
|
@@ -594,11 +594,11 @@ let __tla = (async () => {
|
|
|
594
594
|
}
|
|
595
595
|
if (J.length >= 6) {
|
|
596
596
|
n.onStatus("Refining alignment...");
|
|
597
|
-
const j = d.refine_alignment(new Float32Array(J), z, new Float32Array(B), new Float32Array(
|
|
598
|
-
xe.info(De, "Refinement complete", j.details()), z = j.positions(),
|
|
597
|
+
const j = d.refine_alignment(new Float32Array(J), z, new Float32Array(B), new Float32Array(_));
|
|
598
|
+
xe.info(De, "Refinement complete", j.details()), z = j.positions(), _ = j.mpt(), B = j.origin();
|
|
599
599
|
}
|
|
600
600
|
const ae = a.getAttribute("color"), U = Xn(z, f);
|
|
601
|
-
ae && U.setAttribute("color", ae), a.dispose(), a = U, e.geometry = a, a.computeVertexNormals(), a.computeBoundingBox(), r[0] = new P(B[0], B[1], B[2]), r[1] = new P(
|
|
601
|
+
ae && U.setAttribute("color", ae), a.dispose(), a = U, e.geometry = a, a.computeVertexNormals(), a.computeBoundingBox(), r[0] = new P(B[0], B[1], B[2]), r[1] = new P(_[0], _[1], _[2]), n.onStatus("Setting blue point...");
|
|
602
602
|
const ge = new P(r[0].x, r[0].y, r[0].z);
|
|
603
603
|
r.push(ge), n.addLandmarkPoint({
|
|
604
604
|
faceIndex: -1,
|
|
@@ -622,8 +622,8 @@ let __tla = (async () => {
|
|
|
622
622
|
y: j.y,
|
|
623
623
|
z: j.z
|
|
624
624
|
}))), n.setAligned(true);
|
|
625
|
-
const re = a.boundingBox,
|
|
626
|
-
re.getSize(
|
|
625
|
+
const re = a.boundingBox, R = new P();
|
|
626
|
+
re.getSize(R), n.setModelSize(Math.max(R.x, R.y, R.z)), n.setCut(true), n.setAdjustedStartY(null), n.setAdjustedEndY(null), n.setOriginalEndY(r[1].y + 2 * vt), n.onStatus("Computing final measurements...");
|
|
627
627
|
{
|
|
628
628
|
const j = St(a), K = r[1].y, fe = r[0].y;
|
|
629
629
|
let ie = 1 / 0, pe = -1 / 0;
|
|
@@ -841,7 +841,7 @@ let __tla = (async () => {
|
|
|
841
841
|
];
|
|
842
842
|
const b = x.getAttribute("position"), F = new P().fromBufferAttribute(b, C[0]), S = new P().fromBufferAttribute(b, C[1]), A = new P().fromBufferAttribute(b, C[2]);
|
|
843
843
|
F.applyMatrix4(e.matrixWorld), S.applyMatrix4(e.matrixWorld), A.applyMatrix4(e.matrixWorld);
|
|
844
|
-
const z = v.point,
|
|
844
|
+
const z = v.point, _ = ir(z, F, S, A), B = {
|
|
845
845
|
faceIndex: h,
|
|
846
846
|
vertexIndices: C,
|
|
847
847
|
position: {
|
|
@@ -849,7 +849,7 @@ let __tla = (async () => {
|
|
|
849
849
|
y: z.y,
|
|
850
850
|
z: z.z
|
|
851
851
|
},
|
|
852
|
-
barycentricCoords:
|
|
852
|
+
barycentricCoords: _
|
|
853
853
|
};
|
|
854
854
|
d(B);
|
|
855
855
|
}, [
|
|
@@ -1040,15 +1040,15 @@ let __tla = (async () => {
|
|
|
1040
1040
|
if (S.lengthSq() < 1e-8) return;
|
|
1041
1041
|
S.normalize();
|
|
1042
1042
|
const A = new P().crossVectors(S, new P(0, 1, 0)).normalize();
|
|
1043
|
-
let z = -1 / 0,
|
|
1043
|
+
let z = -1 / 0, _ = m[0];
|
|
1044
1044
|
for (const I of m) {
|
|
1045
1045
|
const W = A.x * I.x + A.z * I.z;
|
|
1046
|
-
W > z && (z = W,
|
|
1046
|
+
W > z && (z = W, _ = I);
|
|
1047
1047
|
}
|
|
1048
|
-
const B = s * 0.35, N = new P(
|
|
1048
|
+
const B = s * 0.35, N = new P(_.x + A.x * B, t, _.z + A.z * B);
|
|
1049
1049
|
w.current.position.copy(N);
|
|
1050
1050
|
const k = C.geometry.getAttribute("position");
|
|
1051
|
-
k.setXYZ(0,
|
|
1051
|
+
k.setXYZ(0, _.x, _.y, _.z), k.setXYZ(1, N.x, N.y, N.z), k.needsUpdate = true;
|
|
1052
1052
|
}), m.length < 2 ? null : y("group", {
|
|
1053
1053
|
renderOrder: 10,
|
|
1054
1054
|
children: [
|
|
@@ -1193,13 +1193,13 @@ let __tla = (async () => {
|
|
|
1193
1193
|
...p.yValues
|
|
1194
1194
|
];
|
|
1195
1195
|
if (n > 25.4 + 0.1) {
|
|
1196
|
-
const
|
|
1196
|
+
const _ = p.mptY;
|
|
1197
1197
|
z = z.filter((B) => {
|
|
1198
|
-
const N = Math.abs(B -
|
|
1199
|
-
return
|
|
1198
|
+
const N = Math.abs(B - _);
|
|
1199
|
+
return N < 0.5 || Math.abs(Math.round(N / n) * n - N) < 0.5;
|
|
1200
1200
|
});
|
|
1201
1201
|
}
|
|
1202
|
-
return d ? z.sort((
|
|
1202
|
+
return d ? z.sort((_, B) => B - _) : z.sort((_, B) => _ - B), z;
|
|
1203
1203
|
}
|
|
1204
1204
|
const S = [];
|
|
1205
1205
|
if (d) for (let A = t; A >= o; A -= n) S.push(A);
|
|
@@ -1213,13 +1213,13 @@ let __tla = (async () => {
|
|
|
1213
1213
|
p
|
|
1214
1214
|
]), x = te(() => {
|
|
1215
1215
|
if (!p) return null;
|
|
1216
|
-
const S = /* @__PURE__ */ new Map(), { allLoopPoints: A, offsets: z, yValues:
|
|
1216
|
+
const S = /* @__PURE__ */ new Map(), { allLoopPoints: A, offsets: z, yValues: _ } = p;
|
|
1217
1217
|
for (let B = 0; B < z.length - 1; B++) {
|
|
1218
1218
|
const N = z[B], k = z[B + 1];
|
|
1219
1219
|
if (k <= N) continue;
|
|
1220
1220
|
const I = [];
|
|
1221
1221
|
for (let W = N; W < k; W += 3) I.push(new P(A[W], A[W + 1], A[W + 2]));
|
|
1222
|
-
I.length >= 3 && S.set(
|
|
1222
|
+
I.length >= 3 && S.set(_[B], I);
|
|
1223
1223
|
}
|
|
1224
1224
|
return S;
|
|
1225
1225
|
}, [
|
|
@@ -1254,7 +1254,7 @@ let __tla = (async () => {
|
|
|
1254
1254
|
], b = s * jo, F = de((S) => {
|
|
1255
1255
|
if (w) return;
|
|
1256
1256
|
f.current.set(S.yPosition, S);
|
|
1257
|
-
const A = Array.from(f.current.values()).sort((z,
|
|
1257
|
+
const A = Array.from(f.current.values()).sort((z, _) => d ? _.yPosition - z.yPosition : z.yPosition - _.yPosition);
|
|
1258
1258
|
l == null ? void 0 : l(A);
|
|
1259
1259
|
}, [
|
|
1260
1260
|
l,
|
|
@@ -1289,10 +1289,10 @@ let __tla = (async () => {
|
|
|
1289
1289
|
if (!p.current) return;
|
|
1290
1290
|
const z = new P();
|
|
1291
1291
|
A.getWorldDirection(z);
|
|
1292
|
-
const
|
|
1293
|
-
if (
|
|
1294
|
-
|
|
1295
|
-
const B = new P().crossVectors(new P(0, 1, 0),
|
|
1292
|
+
const _ = new P(z.x, 0, z.z);
|
|
1293
|
+
if (_.lengthSq() < 1e-8) return;
|
|
1294
|
+
_.normalize();
|
|
1295
|
+
const B = new P().crossVectors(new P(0, 1, 0), _).normalize();
|
|
1296
1296
|
p.current.position.set(B.x * c, 0, B.z * c);
|
|
1297
1297
|
const N = A.position.x - p.current.position.x, k = A.position.z - p.current.position.z;
|
|
1298
1298
|
p.current.rotation.y = Math.atan2(N, k);
|
|
@@ -1420,7 +1420,7 @@ let __tla = (async () => {
|
|
|
1420
1420
|
const { set: p, size: f, camera: m, invalidate: v } = En(), h = ue(false), x = ue(s), w = ue(new P()), C = ue(null), b = ue(d), F = ue(o), S = ue(t), A = ue(a), z = ue({
|
|
1421
1421
|
min: r,
|
|
1422
1422
|
max: c
|
|
1423
|
-
}),
|
|
1423
|
+
}), _ = ue(0), B = de(() => {
|
|
1424
1424
|
if (!n || e <= 0) return null;
|
|
1425
1425
|
const k = a ?? n.geometry;
|
|
1426
1426
|
k.computeBoundingBox();
|
|
@@ -1430,13 +1430,13 @@ let __tla = (async () => {
|
|
|
1430
1430
|
I.getSize($);
|
|
1431
1431
|
const G = r != null && c != null && c > r;
|
|
1432
1432
|
if (G) {
|
|
1433
|
-
const re = r,
|
|
1433
|
+
const re = r, R = c, H = k.getAttribute("position");
|
|
1434
1434
|
if (H) {
|
|
1435
|
-
const ne = H.array, Q = (
|
|
1436
|
-
let j = 1 / 0, K = -1 / 0, fe = re - Q, ie =
|
|
1435
|
+
const ne = H.array, Q = (R - re) * 0.08;
|
|
1436
|
+
let j = 1 / 0, K = -1 / 0, fe = re - Q, ie = R + Q, pe = false;
|
|
1437
1437
|
for (let he = 0; he < H.count; he++) {
|
|
1438
1438
|
const Se = ne[he * 3 + 1];
|
|
1439
|
-
if (Se < re - Q || Se >
|
|
1439
|
+
if (Se < re - Q || Se > R + Q) continue;
|
|
1440
1440
|
const T = ne[he * 3];
|
|
1441
1441
|
T < j && (j = T), T > K && (K = T), pe = true;
|
|
1442
1442
|
}
|
|
@@ -1445,7 +1445,7 @@ let __tla = (async () => {
|
|
|
1445
1445
|
}
|
|
1446
1446
|
w.current.copy($);
|
|
1447
1447
|
const oe = f.width / f.height, ce = 1.35, se = G ? 1.15 : 1.6, J = Math.max($.y * se, $.x * ce / oe), ae = J * oe, U = W.y - $.y * 0.05;
|
|
1448
|
-
|
|
1448
|
+
_.current = U;
|
|
1449
1449
|
const ge = new q.OrthographicCamera(-ae / 2, ae / 2, J / 2, -J / 2, 0.1, e * 10);
|
|
1450
1450
|
return ge.position.set(0, U, e * 2), ge.lookAt(0, U, 0), ge;
|
|
1451
1451
|
}, [
|
|
@@ -1535,7 +1535,7 @@ let __tla = (async () => {
|
|
|
1535
1535
|
const fe = I.boundingBox;
|
|
1536
1536
|
oe = fe.min.x, ce = fe.max.x, se = fe.min.z, J = fe.max.z;
|
|
1537
1537
|
}
|
|
1538
|
-
const U = (oe + ce) / 2, ge = (se + J) / 2, re = f.width / f.height,
|
|
1538
|
+
const U = (oe + ce) / 2, ge = (se + J) / 2, re = f.width / f.height, R = 1.4, H = (ce - oe) * R, ne = (J - se) * R;
|
|
1539
1539
|
let Q, j;
|
|
1540
1540
|
H / ne > re ? (Q = H, j = H / re) : (j = ne, Q = ne * re);
|
|
1541
1541
|
const K = new q.OrthographicCamera(-Q / 2, Q / 2, j / 2, -j / 2, 0.1, e * 10);
|
|
@@ -1578,9 +1578,9 @@ let __tla = (async () => {
|
|
|
1578
1578
|
const Q = I.boundingBox;
|
|
1579
1579
|
oe = Q.min.x, ce = Q.max.x, se = Q.min.z, J = Q.max.z;
|
|
1580
1580
|
}
|
|
1581
|
-
const U = f.width / f.height, ge = 1.4, re = (ce - oe) * ge,
|
|
1581
|
+
const U = f.width / f.height, ge = 1.4, re = (ce - oe) * ge, R = (J - se) * ge;
|
|
1582
1582
|
let H, ne;
|
|
1583
|
-
re /
|
|
1583
|
+
re / R > U ? (H = re, ne = re / U) : (ne = R, H = R * U), k.left = -H / 2, k.right = H / 2, k.top = ne / 2, k.bottom = -ne / 2;
|
|
1584
1584
|
} else {
|
|
1585
1585
|
const I = w.current, W = f.width / f.height, $ = Math.max(I.y, I.x / W) * 1.6, G = $ * W;
|
|
1586
1586
|
k.left = -G / 2, k.right = G / 2, k.top = $ / 2, k.bottom = -$ / 2;
|
|
@@ -1722,13 +1722,13 @@ let __tla = (async () => {
|
|
|
1722
1722
|
]), { mlLine: f, apLine: m, mlWidth: v, apWidth: h } = te(() => {
|
|
1723
1723
|
let C = null, b = null, F = 0, S = 0;
|
|
1724
1724
|
if (u.linePoints.length >= 2) {
|
|
1725
|
-
let A = u.linePoints[0], z = u.linePoints[0],
|
|
1726
|
-
for (const N of u.linePoints) N.x < A.x && (A = N), N.x > z.x && (z = N), N.z <
|
|
1725
|
+
let A = u.linePoints[0], z = u.linePoints[0], _ = u.linePoints[0], B = u.linePoints[0];
|
|
1726
|
+
for (const N of u.linePoints) N.x < A.x && (A = N), N.x > z.x && (z = N), N.z < _.z && (_ = N), N.z > B.z && (B = N);
|
|
1727
1727
|
C = [
|
|
1728
1728
|
new P(A.x, t, A.z),
|
|
1729
1729
|
new P(z.x, t, z.z)
|
|
1730
1730
|
], b = [
|
|
1731
|
-
new P(
|
|
1731
|
+
new P(_.x, t, _.z),
|
|
1732
1732
|
new P(B.x, t, B.z)
|
|
1733
1733
|
], F = C[0].distanceTo(C[1]), S = b[0].distanceTo(b[1]);
|
|
1734
1734
|
}
|
|
@@ -1984,7 +1984,7 @@ let __tla = (async () => {
|
|
|
1984
1984
|
}, [
|
|
1985
1985
|
x,
|
|
1986
1986
|
w
|
|
1987
|
-
]),
|
|
1987
|
+
]), _ = de((W) => {
|
|
1988
1988
|
const $ = new P();
|
|
1989
1989
|
x.getWorldDirection($), $.y = 0, $.lengthSq() < 1e-6 && $.set(0, 0, 1), $.normalize();
|
|
1990
1990
|
const G = $.multiplyScalar(-1);
|
|
@@ -1993,14 +1993,14 @@ let __tla = (async () => {
|
|
|
1993
1993
|
x
|
|
1994
1994
|
]), B = de((W) => {
|
|
1995
1995
|
W.stopPropagation(), m(true), w.domElement.style.cursor = "ns-resize";
|
|
1996
|
-
const $ =
|
|
1996
|
+
const $ = _(o);
|
|
1997
1997
|
b.current = $;
|
|
1998
1998
|
const G = z(W.clientX, W.clientY, $);
|
|
1999
1999
|
C.current = G != null ? o - G : 0, W.target.setPointerCapture(W.pointerId), u == null ? void 0 : u();
|
|
2000
2000
|
}, [
|
|
2001
2001
|
o,
|
|
2002
2002
|
w,
|
|
2003
|
-
|
|
2003
|
+
_,
|
|
2004
2004
|
z,
|
|
2005
2005
|
u
|
|
2006
2006
|
]), N = de((W) => {
|
|
@@ -2114,11 +2114,11 @@ let __tla = (async () => {
|
|
|
2114
2114
|
fontFamily: "system-ui, sans-serif"
|
|
2115
2115
|
}, Pr = ({ amputationType: e, spacingInches: o, scanMeasurements: t, scanFrontalHeight: n, scanTransverseML: s = 0, scanTransverseAP: l = 0, onSave: d, onSkip: a, onFormChange: r, onHeightChange: c, onTransverseMLChange: u, onTransverseAPChange: p, initialValues: f, initialFrontalHeight: m }) => {
|
|
2116
2116
|
const v = e === "AK" ? "Perineum" : "MPT", h = o, x = e === "AK" ? 18 : 9, w = te(() => {
|
|
2117
|
-
const
|
|
2118
|
-
if (e !== "AK") for (let H = 2; H >= 1; H -= h)
|
|
2119
|
-
|
|
2120
|
-
for (let H = h; H <= x; H += h)
|
|
2121
|
-
return
|
|
2117
|
+
const R = [];
|
|
2118
|
+
if (e !== "AK") for (let H = 2; H >= 1; H -= h) R.push(`${H}\u2033 above ${v}`);
|
|
2119
|
+
R.push(`At ${v}`);
|
|
2120
|
+
for (let H = h; H <= x; H += h) R.push(`${H}\u2033 below ${v}`);
|
|
2121
|
+
return R;
|
|
2122
2122
|
}, [
|
|
2123
2123
|
h,
|
|
2124
2124
|
v,
|
|
@@ -2137,12 +2137,12 @@ let __tla = (async () => {
|
|
|
2137
2137
|
v
|
|
2138
2138
|
]), [b, F] = E(() => {
|
|
2139
2139
|
if (!f) return {};
|
|
2140
|
-
const
|
|
2140
|
+
const R = {};
|
|
2141
2141
|
return w.forEach((H, ne) => {
|
|
2142
|
-
f[ne] != null && f[ne] !== 0 && (
|
|
2143
|
-
}),
|
|
2144
|
-
}), [S, A] = E(m && m > 0 ? (m / 10).toFixed(1) : ""), [z,
|
|
2145
|
-
const H = b[
|
|
2142
|
+
f[ne] != null && f[ne] !== 0 && (R[H] = (f[ne] / 10).toFixed(1));
|
|
2143
|
+
}), R;
|
|
2144
|
+
}), [S, A] = E(m && m > 0 ? (m / 10).toFixed(1) : ""), [z, _] = E(""), [B, N] = E(""), [k, I] = E(""), [W, $] = E(""), G = e === "AK" ? "Perineum to Distal (Axial)" : "MPT to Distal (Axial)", oe = e === "AK" ? "M/L at Perineum" : "M/L at MPT", ce = e === "AK" ? "A/P at Perineum" : "A/P at MPT", se = te(() => w.map((R) => {
|
|
2145
|
+
const H = b[R];
|
|
2146
2146
|
return H != null && H !== "" && !isNaN(parseFloat(H)) ? parseFloat(H) * 10 : 0;
|
|
2147
2147
|
}), [
|
|
2148
2148
|
w,
|
|
@@ -2154,29 +2154,29 @@ let __tla = (async () => {
|
|
|
2154
2154
|
se,
|
|
2155
2155
|
r
|
|
2156
2156
|
]), Z(() => {
|
|
2157
|
-
const
|
|
2158
|
-
c == null ? void 0 : c(
|
|
2157
|
+
const R = S !== "" && !isNaN(parseFloat(S)) ? parseFloat(S) * 10 : void 0;
|
|
2158
|
+
c == null ? void 0 : c(R);
|
|
2159
2159
|
}, [
|
|
2160
2160
|
S,
|
|
2161
2161
|
c
|
|
2162
2162
|
]);
|
|
2163
2163
|
const J = e === "AK" ? z : k, ae = e === "AK" ? B : W;
|
|
2164
2164
|
Z(() => {
|
|
2165
|
-
const
|
|
2166
|
-
u == null ? void 0 : u(
|
|
2165
|
+
const R = J !== "" && !isNaN(parseFloat(J)) ? parseFloat(J) * 10 : void 0;
|
|
2166
|
+
u == null ? void 0 : u(R);
|
|
2167
2167
|
}, [
|
|
2168
2168
|
J,
|
|
2169
2169
|
u
|
|
2170
2170
|
]), Z(() => {
|
|
2171
|
-
const
|
|
2172
|
-
p == null ? void 0 : p(
|
|
2171
|
+
const R = ae !== "" && !isNaN(parseFloat(ae)) ? parseFloat(ae) * 10 : void 0;
|
|
2172
|
+
p == null ? void 0 : p(R);
|
|
2173
2173
|
}, [
|
|
2174
2174
|
ae,
|
|
2175
2175
|
p
|
|
2176
2176
|
]);
|
|
2177
2177
|
const U = te(() => {
|
|
2178
|
-
for (const
|
|
2179
|
-
const H = w.indexOf(
|
|
2178
|
+
for (const R of C) {
|
|
2179
|
+
const H = w.indexOf(R);
|
|
2180
2180
|
if (H === -1) continue;
|
|
2181
2181
|
if (se[H] === 0) return false;
|
|
2182
2182
|
}
|
|
@@ -2188,14 +2188,14 @@ let __tla = (async () => {
|
|
|
2188
2188
|
S
|
|
2189
2189
|
]), ge = de(() => {
|
|
2190
2190
|
if (!U) return;
|
|
2191
|
-
const
|
|
2191
|
+
const R = (ne) => ne !== "" && !isNaN(parseFloat(ne)) ? parseFloat(ne) * 10 : void 0, H = R(S) ?? 0;
|
|
2192
2192
|
d({
|
|
2193
2193
|
circumferences: se,
|
|
2194
2194
|
frontalHeight: H,
|
|
2195
|
-
perineumML: e === "AK" ?
|
|
2196
|
-
perineumAP: e === "AK" ?
|
|
2197
|
-
mptML: e === "BK" ?
|
|
2198
|
-
mptAP: e === "BK" ?
|
|
2195
|
+
perineumML: e === "AK" ? R(z) : void 0,
|
|
2196
|
+
perineumAP: e === "AK" ? R(B) : void 0,
|
|
2197
|
+
mptML: e === "BK" ? R(k) : void 0,
|
|
2198
|
+
mptAP: e === "BK" ? R(W) : void 0
|
|
2199
2199
|
});
|
|
2200
2200
|
}, [
|
|
2201
2201
|
U,
|
|
@@ -2208,16 +2208,16 @@ let __tla = (async () => {
|
|
|
2208
2208
|
e,
|
|
2209
2209
|
d
|
|
2210
2210
|
]), re = de(() => {
|
|
2211
|
-
const
|
|
2211
|
+
const R = {};
|
|
2212
2212
|
if (w.forEach((H, ne) => {
|
|
2213
2213
|
const Q = t[ne];
|
|
2214
2214
|
if (Q) {
|
|
2215
2215
|
const j = Q.modifiedValue ?? Q.originalValue;
|
|
2216
|
-
|
|
2216
|
+
R[H] = (j / 10).toFixed(1);
|
|
2217
2217
|
}
|
|
2218
|
-
}), F(
|
|
2218
|
+
}), F(R), n > 0 && A((n / 10).toFixed(1)), s > 0) {
|
|
2219
2219
|
const H = (s / 10).toFixed(1);
|
|
2220
|
-
e === "AK" ?
|
|
2220
|
+
e === "AK" ? _(H) : I(H);
|
|
2221
2221
|
}
|
|
2222
2222
|
if (l > 0) {
|
|
2223
2223
|
const H = (l / 10).toFixed(1);
|
|
@@ -2264,7 +2264,7 @@ let __tla = (async () => {
|
|
|
2264
2264
|
2,
|
|
2265
2265
|
3,
|
|
2266
2266
|
4
|
|
2267
|
-
].map((
|
|
2267
|
+
].map((R) => i("div", {
|
|
2268
2268
|
style: {
|
|
2269
2269
|
height: 4,
|
|
2270
2270
|
flex: 1,
|
|
@@ -2272,7 +2272,7 @@ let __tla = (async () => {
|
|
|
2272
2272
|
borderRadius: 2,
|
|
2273
2273
|
backgroundColor: "rgb(12, 67, 173)"
|
|
2274
2274
|
}
|
|
2275
|
-
},
|
|
2275
|
+
}, R)),
|
|
2276
2276
|
i("div", {
|
|
2277
2277
|
style: {
|
|
2278
2278
|
fontSize: 11,
|
|
@@ -2409,8 +2409,8 @@ let __tla = (async () => {
|
|
|
2409
2409
|
gap: 10,
|
|
2410
2410
|
marginBottom: 20
|
|
2411
2411
|
},
|
|
2412
|
-
children: w.map((
|
|
2413
|
-
const ne = C.has(
|
|
2412
|
+
children: w.map((R, H) => {
|
|
2413
|
+
const ne = C.has(R), Q = !!b[R];
|
|
2414
2414
|
return y("div", {
|
|
2415
2415
|
style: {
|
|
2416
2416
|
display: "flex",
|
|
@@ -2429,9 +2429,9 @@ let __tla = (async () => {
|
|
|
2429
2429
|
overflow: "hidden",
|
|
2430
2430
|
textOverflow: "ellipsis"
|
|
2431
2431
|
},
|
|
2432
|
-
title:
|
|
2432
|
+
title: R,
|
|
2433
2433
|
children: [
|
|
2434
|
-
|
|
2434
|
+
R,
|
|
2435
2435
|
ne && i("span", {
|
|
2436
2436
|
style: {
|
|
2437
2437
|
color: "#e53935",
|
|
@@ -2444,10 +2444,10 @@ let __tla = (async () => {
|
|
|
2444
2444
|
i("input", {
|
|
2445
2445
|
type: "number",
|
|
2446
2446
|
step: "0.1",
|
|
2447
|
-
value: b[
|
|
2447
|
+
value: b[R] ?? "",
|
|
2448
2448
|
onChange: (j) => F((K) => ({
|
|
2449
2449
|
...K,
|
|
2450
|
-
[
|
|
2450
|
+
[R]: j.target.value
|
|
2451
2451
|
})),
|
|
2452
2452
|
style: {
|
|
2453
2453
|
...Ze,
|
|
@@ -2512,7 +2512,7 @@ let __tla = (async () => {
|
|
|
2512
2512
|
type: "number",
|
|
2513
2513
|
step: "0.1",
|
|
2514
2514
|
value: S,
|
|
2515
|
-
onChange: (
|
|
2515
|
+
onChange: (R) => A(R.target.value),
|
|
2516
2516
|
style: {
|
|
2517
2517
|
...Ze,
|
|
2518
2518
|
padding: "6px 8px",
|
|
@@ -2551,7 +2551,7 @@ let __tla = (async () => {
|
|
|
2551
2551
|
type: "number",
|
|
2552
2552
|
step: "0.1",
|
|
2553
2553
|
value: z,
|
|
2554
|
-
onChange: (
|
|
2554
|
+
onChange: (R) => _(R.target.value),
|
|
2555
2555
|
style: {
|
|
2556
2556
|
...Ze,
|
|
2557
2557
|
padding: "6px 8px",
|
|
@@ -2588,7 +2588,7 @@ let __tla = (async () => {
|
|
|
2588
2588
|
type: "number",
|
|
2589
2589
|
step: "0.1",
|
|
2590
2590
|
value: B,
|
|
2591
|
-
onChange: (
|
|
2591
|
+
onChange: (R) => N(R.target.value),
|
|
2592
2592
|
style: {
|
|
2593
2593
|
...Ze,
|
|
2594
2594
|
padding: "6px 8px",
|
|
@@ -2628,7 +2628,7 @@ let __tla = (async () => {
|
|
|
2628
2628
|
type: "number",
|
|
2629
2629
|
step: "0.1",
|
|
2630
2630
|
value: k,
|
|
2631
|
-
onChange: (
|
|
2631
|
+
onChange: (R) => I(R.target.value),
|
|
2632
2632
|
style: {
|
|
2633
2633
|
...Ze,
|
|
2634
2634
|
padding: "6px 8px",
|
|
@@ -2665,7 +2665,7 @@ let __tla = (async () => {
|
|
|
2665
2665
|
type: "number",
|
|
2666
2666
|
step: "0.1",
|
|
2667
2667
|
value: W,
|
|
2668
|
-
onChange: (
|
|
2668
|
+
onChange: (R) => $(R.target.value),
|
|
2669
2669
|
style: {
|
|
2670
2670
|
...Ze,
|
|
2671
2671
|
padding: "6px 8px",
|
|
@@ -2975,8 +2975,8 @@ let __tla = (async () => {
|
|
|
2975
2975
|
const w = o + x * d, C = o + (x + 1) * d;
|
|
2976
2976
|
let b = 0, F = 0, S = 0, A = 0;
|
|
2977
2977
|
for (let z = 0; z < n.count; z++) {
|
|
2978
|
-
const
|
|
2979
|
-
|
|
2978
|
+
const _ = n.getY(z);
|
|
2979
|
+
_ >= w && _ < C && (b += n.getX(z), F += _, S += n.getZ(z), A++);
|
|
2980
2980
|
}
|
|
2981
2981
|
A > 20 && a.push(new P(b / A, F / A, S / A));
|
|
2982
2982
|
}
|
|
@@ -3327,17 +3327,17 @@ let __tla = (async () => {
|
|
|
3327
3327
|
function Tr({ geometry: e, redY: o, greenY: t, modelSize: n, measurementGeometry: s }) {
|
|
3328
3328
|
const l = te(() => {
|
|
3329
3329
|
const u = s ?? e, p = qt(u), f = new P(0, 1, 0), m = 5, h = t + 3 * 25.4, x = [];
|
|
3330
|
-
for (let
|
|
3331
|
-
const B = er(p, u, new P(0,
|
|
3330
|
+
for (let _ = o + m; _ < h; _ += m) {
|
|
3331
|
+
const B = er(p, u, new P(0, _, 0), f);
|
|
3332
3332
|
B > 0 && x.push({
|
|
3333
|
-
y:
|
|
3333
|
+
y: _,
|
|
3334
3334
|
circ: B
|
|
3335
3335
|
});
|
|
3336
3336
|
}
|
|
3337
3337
|
if (x.length < 5) return null;
|
|
3338
|
-
const w = t - o, C = o + w * 0.3, b = o + w * 0.7, F = x.filter((
|
|
3338
|
+
const w = t - o, C = o + w * 0.3, b = o + w * 0.7, F = x.filter((_) => _.y >= C && _.y <= b);
|
|
3339
3339
|
if (F.length < 3) return null;
|
|
3340
|
-
const S = F.map((
|
|
3340
|
+
const S = F.map((_) => _.circ).sort((_, B) => _ - B), A = S[Math.floor(S.length / 2)], z = Math.max(...x.map((_) => _.circ));
|
|
3341
3341
|
return {
|
|
3342
3342
|
circumferences: x,
|
|
3343
3343
|
baseline: A,
|
|
@@ -3739,7 +3739,7 @@ let __tla = (async () => {
|
|
|
3739
3739
|
});
|
|
3740
3740
|
}
|
|
3741
3741
|
const Gr = ({ config: e, spacingType: o, scanUrl: t, formMeasurements: n, onComplete: s, isDebugUser: l = false, onAnalyticsEvent: d, wasmModule: a, autoProcessOnTwoPoints: r = false }) => {
|
|
3742
|
-
const [c, u] = E(null), [p, f] = E(0), [m, v] = E(false), [h, x] = E(false), [w, C] = E(""), [b, F] = E("3D"), [S, A] = E(o === "AK" ? 2 : 1), [z,
|
|
3742
|
+
const [c, u] = E(null), [p, f] = E(0), [m, v] = E(false), [h, x] = E(false), [w, C] = E(""), [b, F] = E("3D"), [S, A] = E(o === "AK" ? 2 : 1), [z, _] = E(false), [B, N] = E(null), [k, I] = E(o ?? null), [W, $] = E("cm"), [G, oe] = E(false), [ce, se] = E(""), [J, ae] = E("mm"), [U, ge] = E(false), [re, R] = E(false), [H, ne] = E(false), [Q, j] = E(null), [K, fe] = E(null), [ie, pe] = E(null), [he, Se] = E(false), [T, Le] = E([]), [ke, Ie] = E(null), [ye, Fe] = E(null), [Mt, Pt] = E(null), [rt, Qt] = E(null), [Qn, en] = E(false), [it, tn] = E(null), [kt, Re] = E(null), [Be, eo] = E(false), [nn, to] = E(Dr), [Oe, on] = E("obj"), [Pe, Ft] = E(n), [He, Lt] = E(true), [Ge, qe] = E(false), [Dt, rn] = E(false), [st, lt] = E(false), Ye = ue(false), [no, sn] = E(false), [Wt, ln] = E(() => {
|
|
3743
3743
|
try {
|
|
3744
3744
|
return localStorage.getItem("gm_helpTipDismissed") !== "1";
|
|
3745
3745
|
} catch {
|
|
@@ -4028,14 +4028,14 @@ let __tla = (async () => {
|
|
|
4028
4028
|
const ee = performance.now(), me = Ve.current ? await Ko(O, Ve.current, (be) => {
|
|
4029
4029
|
C(be), Ae(`PREPROCESS: ${be}`);
|
|
4030
4030
|
}) : null;
|
|
4031
|
-
if (me) Ae(`PREPROCESS: done in ${(performance.now() - ee).toFixed(0)}ms \u2014 unit=${me.detectedUnit}, scaled=${me.wasScaled}`), e.showAmputationModal && !o ? (N(me),
|
|
4031
|
+
if (me) Ae(`PREPROCESS: done in ${(performance.now() - ee).toFixed(0)}ms \u2014 unit=${me.detectedUnit}, scaled=${me.wasScaled}`), e.showAmputationModal && !o ? (N(me), _(true)) : Qe(me.geometry, me.detectedUnit);
|
|
4032
4032
|
else {
|
|
4033
4033
|
C("Using fallback loader...");
|
|
4034
4034
|
const be = Zo(O);
|
|
4035
4035
|
be ? e.showAmputationModal && !o ? (N({
|
|
4036
4036
|
geometry: be,
|
|
4037
4037
|
detectedUnit: "mm"
|
|
4038
|
-
}),
|
|
4038
|
+
}), _(true)) : Qe(be, "mm") : Re("Failed to parse the mesh.");
|
|
4039
4039
|
}
|
|
4040
4040
|
} catch (O) {
|
|
4041
4041
|
Re(O instanceof Error ? O.message : "Failed to process the mesh file.");
|
|
@@ -4104,7 +4104,7 @@ let __tla = (async () => {
|
|
|
4104
4104
|
$e,
|
|
4105
4105
|
Ee
|
|
4106
4106
|
]), So = de((g) => {
|
|
4107
|
-
I(g), A(g === "AK" ? 2 : 1),
|
|
4107
|
+
I(g), A(g === "AK" ? 2 : 1), _(false), B && (Qe(B.geometry, B.detectedUnit), N(null)), d == null ? void 0 : d("file_loaded", {
|
|
4108
4108
|
spacing_type: g,
|
|
4109
4109
|
file_format: Oe,
|
|
4110
4110
|
is_double_wall: false
|
|
@@ -4123,7 +4123,7 @@ let __tla = (async () => {
|
|
|
4123
4123
|
g.position.y,
|
|
4124
4124
|
g.position.z
|
|
4125
4125
|
]), O = M.detect_shell(L, Y, X, 40), ee = O.details(), me = O.is_double_shell();
|
|
4126
|
-
Ae(`SHELL_DETECT: ${me ? "DOUBLE" : "SINGLE"} \u2014 ${ee}`), me && (
|
|
4126
|
+
Ae(`SHELL_DETECT: ${me ? "DOUBLE" : "SINGLE"} \u2014 ${ee}`), me && (R(true), Se(true), Ae(`SHELL_DETECT: double shell, thickness=${O.thickness().toFixed(1)}mm`));
|
|
4127
4127
|
}, [
|
|
4128
4128
|
c,
|
|
4129
4129
|
V,
|
|
@@ -4161,7 +4161,7 @@ let __tla = (async () => {
|
|
|
4161
4161
|
setAdjustedEndY: Pt,
|
|
4162
4162
|
setError: Re,
|
|
4163
4163
|
setDoubleShell: (D) => {
|
|
4164
|
-
|
|
4164
|
+
R(D), Se(true);
|
|
4165
4165
|
},
|
|
4166
4166
|
setAoData: (D, L) => {
|
|
4167
4167
|
j(D), fe(L ?? null);
|
|
@@ -4197,7 +4197,7 @@ let __tla = (async () => {
|
|
|
4197
4197
|
V.length
|
|
4198
4198
|
]);
|
|
4199
4199
|
const Ht = ue(false), Co = de(async () => {
|
|
4200
|
-
if (ft(), Le([]), Ie(null), pe(null), Fe(null), Pt(null), tn(null), Qt(null), qe(false), rn(false), Lt(true),
|
|
4200
|
+
if (ft(), Le([]), Ie(null), pe(null), Fe(null), Pt(null), tn(null), Qt(null), qe(false), rn(false), Lt(true), R(false), ne(false), ct.current = false, Ht.current = false, pt.current = false, F("3D"), t && $e) {
|
|
4201
4201
|
u(null);
|
|
4202
4202
|
try {
|
|
4203
4203
|
const g = await fetch(t);
|
|
@@ -4933,7 +4933,7 @@ let __tla = (async () => {
|
|
|
4933
4933
|
children: [
|
|
4934
4934
|
i("button", {
|
|
4935
4935
|
onClick: () => {
|
|
4936
|
-
|
|
4936
|
+
_(false), N(null);
|
|
4937
4937
|
},
|
|
4938
4938
|
style: {
|
|
4939
4939
|
padding: "6px 16px",
|