@solid-labs/fab-one-widget 1.1.8 → 1.1.9
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.
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { createContext as Mo, Component as Fo, useCallback as ce, useMemo as J, useState as E, memo as
|
|
1
|
+
import { jsxs as y, jsx as i, Fragment as Re } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as Mo, Component as Fo, useCallback as ce, useMemo as J, useState as E, memo as Po, useEffect as G, useRef as de, forwardRef as ko, createElement as An } from "react";
|
|
3
3
|
import { useFrame as Rn, useThree as Wn, Canvas as Lo } from "@react-three/fiber";
|
|
4
4
|
import { Html as Xe, Line as ye, OrbitControls as In } from "@react-three/drei";
|
|
5
5
|
import * as Z from "three";
|
|
6
|
-
import { Plane as
|
|
6
|
+
import { Plane as St, Vector3 as M, Box3 as Bn, Line3 as En, Raycaster as Do } from "three";
|
|
7
7
|
import { create as _o } from "zustand";
|
|
8
8
|
import { OBJLoader as Tn } from "three/examples/jsm/loaders/OBJLoader.js";
|
|
9
9
|
import { STLLoader as Ro } from "three/examples/jsm/loaders/STLLoader.js";
|
|
10
|
-
import { MeshBVH as
|
|
11
|
-
let Ur,
|
|
10
|
+
import { MeshBVH as Ct } from "three-mesh-bvh";
|
|
11
|
+
let Ur, yt, Tr, Yn, Zt;
|
|
12
12
|
let __tla = (async () => {
|
|
13
|
-
let Wo, Io, Bo, Eo,
|
|
13
|
+
let Wo, Io, Bo, Eo, At, Yt, wt, To;
|
|
14
14
|
Wo = {
|
|
15
15
|
showDragDrop: true,
|
|
16
16
|
showStartOver: true,
|
|
@@ -32,7 +32,7 @@ let __tla = (async () => {
|
|
|
32
32
|
showSaveButton: false
|
|
33
33
|
};
|
|
34
34
|
Bo = Mo(Wo);
|
|
35
|
-
|
|
35
|
+
Zt = _o((e, r) => ({
|
|
36
36
|
landmarkPoints: [],
|
|
37
37
|
isAligned: false,
|
|
38
38
|
isCut: false,
|
|
@@ -70,9 +70,9 @@ let __tla = (async () => {
|
|
|
70
70
|
})
|
|
71
71
|
}));
|
|
72
72
|
Eo = 0.45;
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
At = 3;
|
|
74
|
+
Yt = 1e-3;
|
|
75
|
+
wt = 25.4;
|
|
76
76
|
To = [
|
|
77
77
|
0.25,
|
|
78
78
|
-0.25,
|
|
@@ -103,17 +103,17 @@ let __tla = (async () => {
|
|
|
103
103
|
const s = e.getAttribute("position"), l = s.count, c = new Float32Array(l * 3), a = r.length / 3;
|
|
104
104
|
let o = 1 / 0, d = 1 / 0, p = 1 / 0, u = -1 / 0, f = -1 / 0, h = -1 / 0;
|
|
105
105
|
for (let I = 0; I < a; I++) {
|
|
106
|
-
const
|
|
107
|
-
|
|
106
|
+
const k = r[I * 3] * n, T = r[I * 3 + 1] * n, j = r[I * 3 + 2] * n;
|
|
107
|
+
k < o && (o = k), k > u && (u = k), T < d && (d = T), T > f && (f = T), j < p && (p = j), j > h && (h = j);
|
|
108
108
|
}
|
|
109
|
-
const v = (o + u) * 0.5, g = (d + f) * 0.5, x = (p + h) * 0.5,
|
|
109
|
+
const v = (o + u) * 0.5, g = (d + f) * 0.5, x = (p + h) * 0.5, w = u - o + 1e-6, A = f - d + 1e-6, b = h - p + 1e-6, P = w * 0.5, S = A * 0.5, C = b * 0.5, z = Math.min(128, Math.max(16, Math.round(Math.cbrt(a)))), _ = w / z, B = A / z, V = b / z, F = /* @__PURE__ */ new Map();
|
|
110
110
|
for (let I = 0; I < a; I++) {
|
|
111
|
-
const
|
|
111
|
+
const k = r[I * 3] * n - v, T = r[I * 3 + 1] * n - g, j = r[I * 3 + 2] * n - x, ee = Math.min(z - 1, Math.max(0, Math.floor((k + P) / _))), ie = Math.min(z - 1, Math.max(0, Math.floor((T + S) / B))), oe = Math.min(z - 1, Math.max(0, Math.floor((j + C) / V))), q = ee * z * z + ie * z + oe;
|
|
112
112
|
let re = F.get(q);
|
|
113
113
|
re || (re = [], F.set(q, re)), re.push(I);
|
|
114
114
|
}
|
|
115
115
|
for (let I = 0; I < l; I++) {
|
|
116
|
-
const
|
|
116
|
+
const k = s.getX(I), T = s.getY(I), j = s.getZ(I), ee = Math.min(z - 1, Math.max(0, Math.floor((k + P) / _))), ie = Math.min(z - 1, Math.max(0, Math.floor((T + S) / B))), oe = Math.min(z - 1, Math.max(0, Math.floor((j + C) / V)));
|
|
117
117
|
let q = 1 / 0, re = 0;
|
|
118
118
|
for (let K = 0; K <= z && q > 0; K++) {
|
|
119
119
|
for (let he = -K; he <= K; he++) for (let te = -K; te <= K; te++) for (let D = -K; D <= K; D++) {
|
|
@@ -122,7 +122,7 @@ let __tla = (async () => {
|
|
|
122
122
|
if (O < 0 || O >= z || Q < 0 || Q >= z || U < 0 || U >= z) continue;
|
|
123
123
|
const N = F.get(O * z * z + Q * z + U);
|
|
124
124
|
if (N) for (const Y of N) {
|
|
125
|
-
const fe = r[Y * 3] * n - v, se = r[Y * 3 + 1] * n - g, ge = r[Y * 3 + 2] * n - x, ue = (
|
|
125
|
+
const fe = r[Y * 3] * n - v, se = r[Y * 3 + 1] * n - g, ge = r[Y * 3 + 2] * n - x, ue = (k - fe) ** 2 + (T - se) ** 2 + (j - ge) ** 2;
|
|
126
126
|
ue < q && (q = ue, re = Y);
|
|
127
127
|
}
|
|
128
128
|
}
|
|
@@ -147,19 +147,19 @@ let __tla = (async () => {
|
|
|
147
147
|
On = e;
|
|
148
148
|
},
|
|
149
149
|
debug(e, r, t) {
|
|
150
|
-
|
|
150
|
+
xt("debug", e, r, t);
|
|
151
151
|
},
|
|
152
152
|
info(e, r, t) {
|
|
153
|
-
|
|
153
|
+
xt("info", e, r, t);
|
|
154
154
|
},
|
|
155
155
|
warn(e, r, t) {
|
|
156
|
-
|
|
156
|
+
xt("warn", e, r, t);
|
|
157
157
|
},
|
|
158
158
|
error(e, r, t) {
|
|
159
|
-
|
|
159
|
+
xt("error", e, r, t);
|
|
160
160
|
}
|
|
161
161
|
};
|
|
162
|
-
function
|
|
162
|
+
function xt(e, r, t, n) {
|
|
163
163
|
if (zn[e] < zn[$n]) return;
|
|
164
164
|
const s = `[${r}]`, l = n !== void 0 ? [
|
|
165
165
|
s,
|
|
@@ -185,7 +185,7 @@ let __tla = (async () => {
|
|
|
185
185
|
}
|
|
186
186
|
On == null ? void 0 : On(e, r, t, n);
|
|
187
187
|
}
|
|
188
|
-
function
|
|
188
|
+
function vt(e) {
|
|
189
189
|
const r = e.getAttribute("position"), t = new Float32Array(r.array), n = e.getIndex();
|
|
190
190
|
if (n) return {
|
|
191
191
|
positions: t,
|
|
@@ -208,22 +208,22 @@ let __tla = (async () => {
|
|
|
208
208
|
t == null ? void 0 : t("Parsing mesh...");
|
|
209
209
|
const l = new Tn().parse(e);
|
|
210
210
|
let c = null;
|
|
211
|
-
if (l.traverse((
|
|
212
|
-
|
|
211
|
+
if (l.traverse((w) => {
|
|
212
|
+
w.isMesh && !c && (c = w.geometry);
|
|
213
213
|
}), !c) return null;
|
|
214
|
-
const { positions: a, indices: o } =
|
|
214
|
+
const { positions: a, indices: o } = vt(c);
|
|
215
215
|
if (a.length < 9 || o.length < 3) return be.warn("wasm", `Mesh too small: positions=${a.length} indices=${o.length}`), null;
|
|
216
|
-
for (let
|
|
216
|
+
for (let w = 0; w < Math.min(a.length, 300); w++) if (!isFinite(a[w])) return be.error("wasm", `Invalid position data: NaN/Infinity at index ${w}`), null;
|
|
217
217
|
const d = a.length / 3;
|
|
218
|
-
for (let
|
|
218
|
+
for (let w = 0; w < Math.min(o.length, 300); w++) if (o[w] >= d) return be.error("wasm", `Out-of-bounds index: ${o[w]} >= ${d}`), null;
|
|
219
219
|
t == null ? void 0 : t("Processing mesh (WASM)...");
|
|
220
220
|
const p = r.preprocess_mesh(a, o, 10, 1e-4, 500), u = p.positions(), f = p.indices(), h = p.unit_converted(), v = p.detected_unit(), g = p.log();
|
|
221
221
|
if (be.debug("wasm", "preprocess result", g), u.length === 0) return null;
|
|
222
222
|
t == null ? void 0 : t("Building geometry...");
|
|
223
223
|
const x = Hn(u, f);
|
|
224
224
|
if (n) {
|
|
225
|
-
const
|
|
226
|
-
Oo(x, n.positions, n.colors,
|
|
225
|
+
const w = h ? 1e3 : 1;
|
|
226
|
+
Oo(x, n.positions, n.colors, w);
|
|
227
227
|
}
|
|
228
228
|
return {
|
|
229
229
|
geometry: x,
|
|
@@ -242,7 +242,7 @@ let __tla = (async () => {
|
|
|
242
242
|
s.isMesh && !n && (n = s.geometry);
|
|
243
243
|
}), n;
|
|
244
244
|
}
|
|
245
|
-
async function
|
|
245
|
+
async function Gt(e) {
|
|
246
246
|
const r = await e.arrayBuffer(), s = new Ro().parse(r).getAttribute("position");
|
|
247
247
|
if (!s || s.count === 0) throw new Error("Empty STL geometry");
|
|
248
248
|
const l = [];
|
|
@@ -261,7 +261,7 @@ let __tla = (async () => {
|
|
|
261
261
|
for (const n of e) (t.length === 0 || t[t.length - 1].distanceTo(n) > r) && t.push(n.clone());
|
|
262
262
|
return t.length > 2 && t[0].distanceTo(t[t.length - 1]) > r && t.push(t[0].clone()), t;
|
|
263
263
|
}
|
|
264
|
-
function
|
|
264
|
+
function qe(e) {
|
|
265
265
|
let r = 0;
|
|
266
266
|
for (let t = 0; t < e.length - 1; t++) r += e[t].distanceTo(e[t + 1]);
|
|
267
267
|
return r;
|
|
@@ -285,11 +285,11 @@ let __tla = (async () => {
|
|
|
285
285
|
for (; h; ) {
|
|
286
286
|
h = false;
|
|
287
287
|
for (let g = l.length - 1; g >= 0; g--) {
|
|
288
|
-
const { a: x, b:
|
|
289
|
-
if (x.equals(f[f.length - 1])) f.push(
|
|
290
|
-
else if (
|
|
291
|
-
else if (x.equals(f[0])) f.unshift(
|
|
292
|
-
else if (
|
|
288
|
+
const { a: x, b: w } = l[g];
|
|
289
|
+
if (x.equals(f[f.length - 1])) f.push(w);
|
|
290
|
+
else if (w.equals(f[f.length - 1])) f.push(x);
|
|
291
|
+
else if (x.equals(f[0])) f.unshift(w);
|
|
292
|
+
else if (w.equals(f[0])) f.unshift(x);
|
|
293
293
|
else continue;
|
|
294
294
|
l.splice(g, 1), h = true;
|
|
295
295
|
}
|
|
@@ -299,8 +299,8 @@ let __tla = (async () => {
|
|
|
299
299
|
}
|
|
300
300
|
if (!c.length) return [];
|
|
301
301
|
if (t) {
|
|
302
|
-
c.sort((h, v) =>
|
|
303
|
-
const u =
|
|
302
|
+
c.sort((h, v) => qe(v) - qe(h));
|
|
303
|
+
const u = qe(c[0]), f = c.filter((h) => qe(h) >= u * 0.3);
|
|
304
304
|
return f[f.length - 1] ?? c[0];
|
|
305
305
|
}
|
|
306
306
|
const a = c.filter((u) => u.length >= 3 && u[0].distanceTo(u[u.length - 1]) < r * 10), o = a.length > 0 ? a : c;
|
|
@@ -316,7 +316,7 @@ let __tla = (async () => {
|
|
|
316
316
|
return d;
|
|
317
317
|
}
|
|
318
318
|
function Mn(e, r, t, n = false) {
|
|
319
|
-
const s = new
|
|
319
|
+
const s = new St(new M(0, 1, 0), -t), l = [], c = new Bn();
|
|
320
320
|
c.setFromBufferAttribute(r.getAttribute("position"));
|
|
321
321
|
const a = {
|
|
322
322
|
linePoints: [],
|
|
@@ -335,12 +335,12 @@ let __tla = (async () => {
|
|
|
335
335
|
});
|
|
336
336
|
}
|
|
337
337
|
});
|
|
338
|
-
const p = Vn(l,
|
|
338
|
+
const p = Vn(l, Yt, n);
|
|
339
339
|
if (p.length < 2) return a;
|
|
340
|
-
const u =
|
|
340
|
+
const u = qe(p);
|
|
341
341
|
let f = -1 / 0, h = new M(0, t, 0);
|
|
342
342
|
for (const g of p) g.x > f && (f = g.x, h = g.clone());
|
|
343
|
-
const v = p.length > 2 && p[0].distanceTo(p[p.length - 1]) <
|
|
343
|
+
const v = p.length > 2 && p[0].distanceTo(p[p.length - 1]) < Yt * 10;
|
|
344
344
|
return {
|
|
345
345
|
linePoints: p,
|
|
346
346
|
lineLength: u,
|
|
@@ -348,7 +348,7 @@ let __tla = (async () => {
|
|
|
348
348
|
isClosed: v
|
|
349
349
|
};
|
|
350
350
|
}
|
|
351
|
-
function
|
|
351
|
+
function je(e, r, t, n = false) {
|
|
352
352
|
const s = Mn(e, r, t, n);
|
|
353
353
|
if (s.isClosed && s.linePoints.length >= 3) return s;
|
|
354
354
|
be.debug("slice", `y=${t.toFixed(2)} failed (pts=${s.linePoints.length}, closed=${s.isClosed}), retrying...`);
|
|
@@ -360,8 +360,8 @@ let __tla = (async () => {
|
|
|
360
360
|
}
|
|
361
361
|
return be.warn("slice", `y=${t.toFixed(2)} all retries exhausted (pts=${l.linePoints.length}, closed=${l.isClosed})`), l;
|
|
362
362
|
}
|
|
363
|
-
function
|
|
364
|
-
const s = new
|
|
363
|
+
function Xo(e, r, t, n) {
|
|
364
|
+
const s = new St().setFromNormalAndCoplanarPoint(n.clone().normalize(), t), l = new Bn();
|
|
365
365
|
if (l.setFromBufferAttribute(r.getAttribute("position")), !s.intersectsBox(l)) return 0;
|
|
366
366
|
const c = [], a = new En(), o = new M();
|
|
367
367
|
e.shapecast({
|
|
@@ -374,15 +374,15 @@ let __tla = (async () => {
|
|
|
374
374
|
});
|
|
375
375
|
}
|
|
376
376
|
});
|
|
377
|
-
const d = Vn(c,
|
|
378
|
-
return
|
|
377
|
+
const d = Vn(c, Yt);
|
|
378
|
+
return qe(d);
|
|
379
379
|
}
|
|
380
|
-
function
|
|
381
|
-
return new
|
|
382
|
-
maxLeafTris:
|
|
380
|
+
function Kt(e) {
|
|
381
|
+
return new Ct(e, {
|
|
382
|
+
maxLeafTris: At
|
|
383
383
|
});
|
|
384
384
|
}
|
|
385
|
-
function
|
|
385
|
+
function Go(e, r, t, n) {
|
|
386
386
|
const s = e.getIndex(), l = s ? s.count / 3 : 0;
|
|
387
387
|
if (l < 10) return {
|
|
388
388
|
valid: false,
|
|
@@ -397,9 +397,9 @@ let __tla = (async () => {
|
|
|
397
397
|
valid: false,
|
|
398
398
|
reason: `Height too large (${c.toFixed(1)}mm > 1000mm)`
|
|
399
399
|
};
|
|
400
|
-
const a = new
|
|
401
|
-
maxLeafTris:
|
|
402
|
-
}), o =
|
|
400
|
+
const a = new Ct(e, {
|
|
401
|
+
maxLeafTris: At
|
|
402
|
+
}), o = je(a, e, r);
|
|
403
403
|
if (o.lineLength === 0) return {
|
|
404
404
|
valid: false,
|
|
405
405
|
reason: "No circumference at green point \u2014 mesh may be empty at that height"
|
|
@@ -409,7 +409,7 @@ let __tla = (async () => {
|
|
|
409
409
|
valid: true,
|
|
410
410
|
reason: ""
|
|
411
411
|
};
|
|
412
|
-
const p =
|
|
412
|
+
const p = je(a, e, d);
|
|
413
413
|
if (o.lineLength > 0 && p.lineLength > 0) {
|
|
414
414
|
const f = o.lineLength / p.lineLength;
|
|
415
415
|
if (f < 0.5) return {
|
|
@@ -419,7 +419,7 @@ let __tla = (async () => {
|
|
|
419
419
|
}
|
|
420
420
|
const u = r - n * 2;
|
|
421
421
|
if (u > t) {
|
|
422
|
-
const f =
|
|
422
|
+
const f = je(a, e, u);
|
|
423
423
|
if (p.lineLength > 0 && f.lineLength > 0) {
|
|
424
424
|
const h = p.lineLength / f.lineLength;
|
|
425
425
|
if (h < 0.5) return {
|
|
@@ -433,7 +433,7 @@ let __tla = (async () => {
|
|
|
433
433
|
reason: ""
|
|
434
434
|
};
|
|
435
435
|
}
|
|
436
|
-
const
|
|
436
|
+
const ke = "pipeline";
|
|
437
437
|
function Yo(e, r, t, n) {
|
|
438
438
|
var _a, _b, _c, _d;
|
|
439
439
|
const s = e.geometry.clone(), l = r.map((a) => ({
|
|
@@ -443,16 +443,16 @@ let __tla = (async () => {
|
|
|
443
443
|
let a = e.geometry, o = l.map((N) => new M(N.position.x, N.position.y, N.position.z));
|
|
444
444
|
const d = o[0], p = o[1];
|
|
445
445
|
if (!c) {
|
|
446
|
-
n.onStatus("Aligning mesh (JS fallback)..."), be.warn(
|
|
446
|
+
n.onStatus("Aligning mesh (JS fallback)..."), be.warn(ke, "WASM not available, using JS fallback alignment");
|
|
447
447
|
const N = new M(0, 1, 0), Y = new M().subVectors(p, d).normalize(), fe = Y.dot(N), se = new M().crossVectors(Y, N);
|
|
448
448
|
if (se.length() > 1e-4) {
|
|
449
449
|
se.normalize();
|
|
450
450
|
const $ = new Z.Quaternion().setFromAxisAngle(se, Math.acos(Math.min(1, Math.max(-1, fe))));
|
|
451
|
-
a.applyMatrix4(new Z.Matrix4().makeRotationFromQuaternion($)), o = o.map((
|
|
451
|
+
a.applyMatrix4(new Z.Matrix4().makeRotationFromQuaternion($)), o = o.map((Pe) => Pe.clone().applyQuaternion($));
|
|
452
452
|
}
|
|
453
453
|
if (o[0].y > o[1].y) {
|
|
454
454
|
const $ = new Z.Quaternion().setFromAxisAngle(new M(1, 0, 0), Math.PI);
|
|
455
|
-
a.applyMatrix4(new Z.Matrix4().makeRotationFromQuaternion($)), o = o.map((
|
|
455
|
+
a.applyMatrix4(new Z.Matrix4().makeRotationFromQuaternion($)), o = o.map((Pe) => Pe.clone().applyQuaternion($));
|
|
456
456
|
}
|
|
457
457
|
const ge = o[0].clone();
|
|
458
458
|
a.translate(-ge.x, -ge.y, -ge.z), o = o.map(($) => new M($.x - ge.x, $.y - ge.y, $.z - ge.z)), a.computeVertexNormals(), a.computeBoundingBox();
|
|
@@ -478,12 +478,12 @@ let __tla = (async () => {
|
|
|
478
478
|
x: $.x,
|
|
479
479
|
y: $.y,
|
|
480
480
|
z: $.z
|
|
481
|
-
}))), n.setAligned(true), n.setCut(true), n.setAdjustedStartY(null), n.setAdjustedEndY(null), n.setOriginalEndY(o[1].y + 2 *
|
|
481
|
+
}))), n.setAligned(true), n.setCut(true), n.setAdjustedStartY(null), n.setAdjustedEndY(null), n.setOriginalEndY(o[1].y + 2 * wt);
|
|
482
482
|
const we = new M();
|
|
483
483
|
a.computeBoundingBox(), a.boundingBox.getSize(we), n.setModelSize(Math.max(we.x, we.y, we.z)), s.dispose();
|
|
484
484
|
return;
|
|
485
485
|
}
|
|
486
|
-
const { positions: u, indices: f } =
|
|
486
|
+
const { positions: u, indices: f } = vt(a), h = new Float32Array([
|
|
487
487
|
d.x,
|
|
488
488
|
d.y,
|
|
489
489
|
d.z
|
|
@@ -493,22 +493,22 @@ let __tla = (async () => {
|
|
|
493
493
|
p.z
|
|
494
494
|
]);
|
|
495
495
|
n.onStatus("Detecting shell type...");
|
|
496
|
-
const g = c.detect_shell(u, f, v, 40), x = g.is_double_shell(),
|
|
497
|
-
be.info(
|
|
496
|
+
const g = c.detect_shell(u, f, v, 40), x = g.is_double_shell(), w = g.surface_normal();
|
|
497
|
+
be.info(ke, `Shell: ${x ? "DOUBLE" : "SINGLE"}`, g.details()), (_a = n.setDoubleShell) == null ? void 0 : _a.call(n, x), n.onStatus("Finding cross-section plane...");
|
|
498
498
|
const A = new Float32Array([
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
]), b = c.find_min_cross_section(u, f, v, A, 10),
|
|
503
|
-
be.info(
|
|
499
|
+
w[0],
|
|
500
|
+
w[1],
|
|
501
|
+
w[2]
|
|
502
|
+
]), b = c.find_min_cross_section(u, f, v, A, 10), P = b.plane_normal();
|
|
503
|
+
be.info(ke, "Cross-section found", b.details()), n.onStatus("Aligning mesh...");
|
|
504
504
|
const S = new Float32Array([
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
505
|
+
P[0],
|
|
506
|
+
P[1],
|
|
507
|
+
P[2]
|
|
508
508
|
]), C = c.align_to_origin(u, h, v, S);
|
|
509
509
|
let z = C.positions(), _ = C.mpt(), B = C.origin();
|
|
510
510
|
const V = C.transform();
|
|
511
|
-
be.info(
|
|
511
|
+
be.info(ke, "Alignment complete", C.details());
|
|
512
512
|
const F = [
|
|
513
513
|
V[3],
|
|
514
514
|
V[4],
|
|
@@ -520,35 +520,35 @@ let __tla = (async () => {
|
|
|
520
520
|
V[10],
|
|
521
521
|
V[11]
|
|
522
522
|
], I = new Float32Array([
|
|
523
|
-
F[0] *
|
|
524
|
-
F[3] *
|
|
525
|
-
F[6] *
|
|
523
|
+
F[0] * P[0] + F[1] * P[1] + F[2] * P[2],
|
|
524
|
+
F[3] * P[0] + F[4] * P[1] + F[5] * P[2],
|
|
525
|
+
F[6] * P[0] + F[7] * P[1] + F[8] * P[2]
|
|
526
526
|
]);
|
|
527
527
|
n.onStatus("Generating measurement points...");
|
|
528
|
-
const
|
|
529
|
-
be.debug(
|
|
530
|
-
const T =
|
|
528
|
+
const k = c.subdivide_origin_to_plane(new Float32Array(B), new Float32Array(_), I);
|
|
529
|
+
be.debug(ke, `Subdivide: ${k.count()} pts, spacing=${k.spacing().toFixed(1)}mm`);
|
|
530
|
+
const T = k.points(), j = k.count(), ee = 2, ie = 1, oe = [];
|
|
531
531
|
for (let N = ee; N < j - ie; N++) oe.push(T[N * 3 + 1]);
|
|
532
532
|
n.onStatus("Computing cross-sections...");
|
|
533
533
|
let q = [];
|
|
534
534
|
if (oe.length >= 2) {
|
|
535
535
|
const Y = (x ? c.batch_cross_sections_y_inner.bind(c) : c.batch_cross_sections_y.bind(c))(z, f, new Float32Array(oe), 10);
|
|
536
|
-
be.debug(
|
|
536
|
+
be.debug(ke, "Batch (subdivision)", Y.details());
|
|
537
537
|
const fe = Y.all_loop_points(), se = Y.offsets(), ge = Y.circumferences();
|
|
538
538
|
for (let ue = 0; ue < se.length - 1; ue++) {
|
|
539
539
|
const we = se[ue], $ = se[ue + 1];
|
|
540
540
|
if ($ <= we || ge[ue] <= 0) continue;
|
|
541
|
-
const
|
|
542
|
-
if (
|
|
541
|
+
const Pe = ($ - we) / 3;
|
|
542
|
+
if (Pe < 3) continue;
|
|
543
543
|
let De = 0, Ie = 0, me = 0;
|
|
544
544
|
for (let Me = we; Me < $; Me += 3) De += fe[Me], Ie += fe[Me + 1], me += fe[Me + 2];
|
|
545
|
-
q.push(De /
|
|
545
|
+
q.push(De / Pe, Ie / Pe, me / Pe);
|
|
546
546
|
}
|
|
547
547
|
}
|
|
548
548
|
if (q.length >= 6) {
|
|
549
549
|
n.onStatus("Refining alignment...");
|
|
550
550
|
const N = c.refine_alignment(new Float32Array(q), z, new Float32Array(B), new Float32Array(_));
|
|
551
|
-
be.info(
|
|
551
|
+
be.info(ke, "Refinement complete", N.details()), z = N.positions(), _ = N.mpt(), B = N.origin();
|
|
552
552
|
}
|
|
553
553
|
const re = a.getAttribute("color"), K = Hn(z, f);
|
|
554
554
|
re && K.setAttribute("color", re), a.dispose(), a = K, e.geometry = a, a.computeVertexNormals(), a.computeBoundingBox(), o[0] = new M(B[0], B[1], B[2]), o[1] = new M(_[0], _[1], _[2]), n.onStatus("Setting blue point...");
|
|
@@ -576,9 +576,9 @@ let __tla = (async () => {
|
|
|
576
576
|
z: N.z
|
|
577
577
|
}))), n.setAligned(true);
|
|
578
578
|
const te = a.boundingBox, D = new M();
|
|
579
|
-
te.getSize(D), n.setModelSize(Math.max(D.x, D.y, D.z)), n.setCut(true), n.setAdjustedStartY(null), n.setAdjustedEndY(null), n.setOriginalEndY(o[1].y + 2 *
|
|
579
|
+
te.getSize(D), n.setModelSize(Math.max(D.x, D.y, D.z)), n.setCut(true), n.setAdjustedStartY(null), n.setAdjustedEndY(null), n.setOriginalEndY(o[1].y + 2 * wt), n.onStatus("Computing final measurements...");
|
|
580
580
|
{
|
|
581
|
-
const N =
|
|
581
|
+
const N = vt(a), Y = o[1].y, fe = o[0].y;
|
|
582
582
|
let se = 1 / 0, ge = -1 / 0;
|
|
583
583
|
const ue = N.positions;
|
|
584
584
|
for (let me = 1; me < ue.length; me += 3) ue[me] < se && (se = ue[me]), ue[me] > ge && (ge = ue[me]);
|
|
@@ -589,9 +589,9 @@ let __tla = (async () => {
|
|
|
589
589
|
Me < ge - 1 && $.push(Me);
|
|
590
590
|
}
|
|
591
591
|
for (let me = Y - we; me > fe; me -= we) $.push(me);
|
|
592
|
-
$.sort((me, Me) => me - Me), be.info(
|
|
592
|
+
$.sort((me, Me) => me - Me), be.info(ke, `Horizontal slices: ${$.length} Y planes, range ${(_b = $[0]) == null ? void 0 : _b.toFixed(1)} \u2192 ${(_c = $[$.length - 1]) == null ? void 0 : _c.toFixed(1)} mm`);
|
|
593
593
|
const De = (x ? c.batch_cross_sections_y_inner.bind(c) : c.batch_cross_sections_y.bind(c))(N.positions, N.indices, new Float32Array($), 10);
|
|
594
|
-
be.info(
|
|
594
|
+
be.info(ke, `Horizontal slices (${x ? "inner" : "outer"}): ${De.count()}/${$.length} valid`), be.debug(ke, "Slice details", De.details());
|
|
595
595
|
const Ie = {
|
|
596
596
|
yValues: $,
|
|
597
597
|
circumferences: Array.from(De.circumferences()),
|
|
@@ -603,10 +603,10 @@ let __tla = (async () => {
|
|
|
603
603
|
(_d = n.setWasmSlices) == null ? void 0 : _d.call(n, Ie);
|
|
604
604
|
}
|
|
605
605
|
n.onStatus("Validating results...");
|
|
606
|
-
const O = o[1].y, Q = o[0].y, U =
|
|
607
|
-
U.valid || be.warn(
|
|
606
|
+
const O = o[1].y, Q = o[0].y, U = Go(a, O, Q, t);
|
|
607
|
+
U.valid || be.warn(ke, `Validation: ${U.reason}`), n.setClippedReferenceGeometry ? (s.computeVertexNormals(), n.setClippedReferenceGeometry(s)) : s.dispose();
|
|
608
608
|
} catch (a) {
|
|
609
|
-
be.error(
|
|
609
|
+
be.error(ke, "Processing failed", a), n.setError(a instanceof Error ? a.message : "Failed to process mesh."), s.dispose();
|
|
610
610
|
}
|
|
611
611
|
}
|
|
612
612
|
class Ko extends Fo {
|
|
@@ -628,7 +628,7 @@ let __tla = (async () => {
|
|
|
628
628
|
console.error("[ErrorBoundary] Caught error:", r, t.componentStack);
|
|
629
629
|
}
|
|
630
630
|
render() {
|
|
631
|
-
return this.state.error ? this.props.fallback ? this.props.fallback(this.state.error, this.reset) :
|
|
631
|
+
return this.state.error ? this.props.fallback ? this.props.fallback(this.state.error, this.reset) : y("div", {
|
|
632
632
|
style: {
|
|
633
633
|
display: "flex",
|
|
634
634
|
flexDirection: "column",
|
|
@@ -676,7 +676,7 @@ let __tla = (async () => {
|
|
|
676
676
|
}) : this.props.children;
|
|
677
677
|
}
|
|
678
678
|
}
|
|
679
|
-
const Zo = ({ message: e, onDismiss: r }) =>
|
|
679
|
+
const Zo = ({ message: e, onDismiss: r }) => y("div", {
|
|
680
680
|
style: {
|
|
681
681
|
position: "absolute",
|
|
682
682
|
top: 16,
|
|
@@ -693,7 +693,7 @@ let __tla = (async () => {
|
|
|
693
693
|
gap: 12
|
|
694
694
|
},
|
|
695
695
|
children: [
|
|
696
|
-
|
|
696
|
+
y("div", {
|
|
697
697
|
style: {
|
|
698
698
|
flex: 1
|
|
699
699
|
},
|
|
@@ -729,7 +729,7 @@ let __tla = (async () => {
|
|
|
729
729
|
children: "x"
|
|
730
730
|
})
|
|
731
731
|
]
|
|
732
|
-
}), Fn = ({ message: e }) =>
|
|
732
|
+
}), Fn = ({ message: e }) => y("div", {
|
|
733
733
|
style: {
|
|
734
734
|
position: "absolute",
|
|
735
735
|
top: 0,
|
|
@@ -776,25 +776,25 @@ let __tla = (async () => {
|
|
|
776
776
|
};
|
|
777
777
|
}
|
|
778
778
|
const Uo = ({ mesh: e, maxPoints: r = 2, meshColor: t = "#c8c8c8", meshOpacity: n = 1, frontFaceOnly: s = false, doubleShellTransparency: l = false }) => {
|
|
779
|
-
const { addLandmarkPoint: c, landmarkPoints: a } =
|
|
779
|
+
const { addLandmarkPoint: c, landmarkPoints: a } = Zt(), o = ce((h) => {
|
|
780
780
|
if (a.length >= r) return;
|
|
781
781
|
h.stopPropagation();
|
|
782
782
|
const v = h.intersections[0], g = v == null ? void 0 : v.faceIndex;
|
|
783
783
|
if (!v || g == null) return;
|
|
784
|
-
const x = e.geometry,
|
|
784
|
+
const x = e.geometry, w = x.index;
|
|
785
785
|
let A;
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
786
|
+
w ? A = [
|
|
787
|
+
w.getX(g * 3),
|
|
788
|
+
w.getX(g * 3 + 1),
|
|
789
|
+
w.getX(g * 3 + 2)
|
|
790
790
|
] : A = [
|
|
791
791
|
g * 3,
|
|
792
792
|
g * 3 + 1,
|
|
793
793
|
g * 3 + 2
|
|
794
794
|
];
|
|
795
|
-
const b = x.getAttribute("position"),
|
|
796
|
-
|
|
797
|
-
const z = v.point, _ = qo(z,
|
|
795
|
+
const b = x.getAttribute("position"), P = new M().fromBufferAttribute(b, A[0]), S = new M().fromBufferAttribute(b, A[1]), C = new M().fromBufferAttribute(b, A[2]);
|
|
796
|
+
P.applyMatrix4(e.matrixWorld), S.applyMatrix4(e.matrixWorld), C.applyMatrix4(e.matrixWorld);
|
|
797
|
+
const z = v.point, _ = qo(z, P, S, C), B = {
|
|
798
798
|
faceIndex: g,
|
|
799
799
|
vertexIndices: A,
|
|
800
800
|
position: {
|
|
@@ -837,7 +837,7 @@ let __tla = (async () => {
|
|
|
837
837
|
});
|
|
838
838
|
}, Jo = ({ point: e, index: r, markerSize: t, color: n, label: s }) => {
|
|
839
839
|
const [l, c] = E(false);
|
|
840
|
-
return
|
|
840
|
+
return y("mesh", {
|
|
841
841
|
position: [
|
|
842
842
|
e.position.x,
|
|
843
843
|
e.position.y,
|
|
@@ -878,7 +878,7 @@ let __tla = (async () => {
|
|
|
878
878
|
]
|
|
879
879
|
}, r);
|
|
880
880
|
}, Qo = ({ modelSize: e, labels: r }) => {
|
|
881
|
-
const { landmarkPoints: t } =
|
|
881
|
+
const { landmarkPoints: t } = Zt(), n = e * 0.02, s = [
|
|
882
882
|
"#44ff44",
|
|
883
883
|
"#ff4444",
|
|
884
884
|
"#4444ff"
|
|
@@ -898,20 +898,20 @@ let __tla = (async () => {
|
|
|
898
898
|
});
|
|
899
899
|
};
|
|
900
900
|
function Nn(e) {
|
|
901
|
-
return J(() => e ? new
|
|
902
|
-
maxLeafTris:
|
|
901
|
+
return J(() => e ? new Ct(e, {
|
|
902
|
+
maxLeafTris: At
|
|
903
903
|
}) : null, [
|
|
904
904
|
e
|
|
905
905
|
]);
|
|
906
906
|
}
|
|
907
|
-
const
|
|
907
|
+
const Pn = (e, r) => {
|
|
908
908
|
const t = Math.abs(e - r);
|
|
909
909
|
return t <= 7 ? "#8BC34A" : t <= 20 ? "#FFC107" : "#FF5722";
|
|
910
|
-
},
|
|
911
|
-
if (e <= 7) return
|
|
910
|
+
}, kn = new Z.Color("#8BC34A"), Ln = new Z.Color("#FFC107"), er = new Z.Color("#FF5722"), tr = (e) => {
|
|
911
|
+
if (e <= 7) return kn.clone();
|
|
912
912
|
if (e <= 20) {
|
|
913
913
|
const t = (e - 7) / 13;
|
|
914
|
-
return
|
|
914
|
+
return kn.clone().lerp(Ln, t);
|
|
915
915
|
}
|
|
916
916
|
const r = Math.min((e - 20) / 20, 1);
|
|
917
917
|
return Ln.clone().lerp(er, r);
|
|
@@ -936,7 +936,7 @@ let __tla = (async () => {
|
|
|
936
936
|
});
|
|
937
937
|
return new Z.Mesh(c, a);
|
|
938
938
|
}, or = ({ bvh: e, geometry: r, yPosition: t, color: n = "#00ff00", labelX: s, onDataChange: l, displayUnit: c = "cm", useInnerSurface: a = false, formValue: o, lineWidth: d = 1.5, wasmLoopPoints: p, wasmCircumference: u }) => {
|
|
939
|
-
const f = J(() => p && u != null ? null :
|
|
939
|
+
const f = J(() => p && u != null ? null : je(e, r, t, a), [
|
|
940
940
|
e,
|
|
941
941
|
r,
|
|
942
942
|
t,
|
|
@@ -945,8 +945,8 @@ let __tla = (async () => {
|
|
|
945
945
|
u
|
|
946
946
|
]), h = p ?? (f == null ? void 0 : f.linePoints) ?? [], v = u ?? (f == null ? void 0 : f.lineLength) ?? 0, g = J(() => {
|
|
947
947
|
if (o == null || o === 0 || v <= 0 || h.length < 2) return null;
|
|
948
|
-
const b = o / v,
|
|
949
|
-
return h.map((C) => new M(
|
|
948
|
+
const b = o / v, P = h.reduce((C, z) => C + z.x, 0) / h.length, S = h.reduce((C, z) => C + z.z, 0) / h.length;
|
|
949
|
+
return h.map((C) => new M(P + (C.x - P) * b, C.y, S + (C.z - S) * b));
|
|
950
950
|
}, [
|
|
951
951
|
h,
|
|
952
952
|
v,
|
|
@@ -955,27 +955,27 @@ let __tla = (async () => {
|
|
|
955
955
|
h,
|
|
956
956
|
g
|
|
957
957
|
]);
|
|
958
|
-
|
|
958
|
+
G(() => () => {
|
|
959
959
|
x && (x.geometry.dispose(), x.material.dispose());
|
|
960
960
|
}, [
|
|
961
961
|
x
|
|
962
962
|
]);
|
|
963
|
-
const
|
|
963
|
+
const w = de(null), A = J(() => {
|
|
964
964
|
const b = new Z.BufferGeometry();
|
|
965
965
|
b.setAttribute("position", new Z.Float32BufferAttribute(new Float32Array(6), 3));
|
|
966
|
-
const
|
|
966
|
+
const P = new Z.LineBasicMaterial({
|
|
967
967
|
color: 6710886,
|
|
968
968
|
depthTest: false,
|
|
969
969
|
depthWrite: false,
|
|
970
970
|
transparent: true
|
|
971
971
|
});
|
|
972
|
-
return new Z.Line(b,
|
|
972
|
+
return new Z.Line(b, P);
|
|
973
973
|
}, []);
|
|
974
|
-
return
|
|
974
|
+
return G(() => () => {
|
|
975
975
|
A.geometry.dispose(), A.material.dispose();
|
|
976
976
|
}, [
|
|
977
977
|
A
|
|
978
|
-
]),
|
|
978
|
+
]), G(() => {
|
|
979
979
|
v > 0 && (l == null ? void 0 : l({
|
|
980
980
|
yPosition: t,
|
|
981
981
|
originalValue: v,
|
|
@@ -986,23 +986,23 @@ let __tla = (async () => {
|
|
|
986
986
|
t,
|
|
987
987
|
l
|
|
988
988
|
]), Rn(({ camera: b }) => {
|
|
989
|
-
if (!
|
|
990
|
-
const
|
|
991
|
-
b.getWorldDirection(
|
|
992
|
-
const S = new M(
|
|
989
|
+
if (!w.current || h.length < 2) return;
|
|
990
|
+
const P = new M();
|
|
991
|
+
b.getWorldDirection(P);
|
|
992
|
+
const S = new M(P.x, 0, P.z);
|
|
993
993
|
if (S.lengthSq() < 1e-8) return;
|
|
994
994
|
S.normalize();
|
|
995
995
|
const C = new M().crossVectors(S, new M(0, 1, 0)).normalize();
|
|
996
996
|
let z = -1 / 0, _ = h[0];
|
|
997
997
|
for (const I of h) {
|
|
998
|
-
const
|
|
999
|
-
|
|
998
|
+
const k = C.x * I.x + C.z * I.z;
|
|
999
|
+
k > z && (z = k, _ = I);
|
|
1000
1000
|
}
|
|
1001
1001
|
const B = s * 0.35, V = new M(_.x + C.x * B, t, _.z + C.z * B);
|
|
1002
|
-
|
|
1002
|
+
w.current.position.copy(V);
|
|
1003
1003
|
const F = A.geometry.getAttribute("position");
|
|
1004
1004
|
F.setXYZ(0, _.x, _.y, _.z), F.setXYZ(1, V.x, V.y, V.z), F.needsUpdate = true;
|
|
1005
|
-
}), h.length < 2 ? null :
|
|
1005
|
+
}), h.length < 2 ? null : y("group", {
|
|
1006
1006
|
renderOrder: 10,
|
|
1007
1007
|
children: [
|
|
1008
1008
|
i(ye, {
|
|
@@ -1020,7 +1020,7 @@ let __tla = (async () => {
|
|
|
1020
1020
|
}),
|
|
1021
1021
|
g && o != null && o !== 0 && i(ye, {
|
|
1022
1022
|
points: g,
|
|
1023
|
-
color:
|
|
1023
|
+
color: Pn(v, o),
|
|
1024
1024
|
lineWidth: 2.5,
|
|
1025
1025
|
dashed: true,
|
|
1026
1026
|
dashSize: 2,
|
|
@@ -1036,7 +1036,7 @@ let __tla = (async () => {
|
|
|
1036
1036
|
renderOrder: 10
|
|
1037
1037
|
}),
|
|
1038
1038
|
i("group", {
|
|
1039
|
-
ref:
|
|
1039
|
+
ref: w,
|
|
1040
1040
|
children: i(Xe, {
|
|
1041
1041
|
zIndexRange: [
|
|
1042
1042
|
100,
|
|
@@ -1046,7 +1046,7 @@ let __tla = (async () => {
|
|
|
1046
1046
|
pointerEvents: "none",
|
|
1047
1047
|
transform: "translateY(-50%)"
|
|
1048
1048
|
},
|
|
1049
|
-
children:
|
|
1049
|
+
children: y("div", {
|
|
1050
1050
|
style: {
|
|
1051
1051
|
display: "flex",
|
|
1052
1052
|
alignItems: "stretch",
|
|
@@ -1056,7 +1056,7 @@ let __tla = (async () => {
|
|
|
1056
1056
|
whiteSpace: "nowrap"
|
|
1057
1057
|
},
|
|
1058
1058
|
children: [
|
|
1059
|
-
|
|
1059
|
+
y("div", {
|
|
1060
1060
|
style: {
|
|
1061
1061
|
display: "flex",
|
|
1062
1062
|
alignItems: "center",
|
|
@@ -1087,8 +1087,8 @@ let __tla = (async () => {
|
|
|
1087
1087
|
]
|
|
1088
1088
|
}),
|
|
1089
1089
|
o != null && o !== 0 && v > 0 && (() => {
|
|
1090
|
-
const b = v - o,
|
|
1091
|
-
return
|
|
1090
|
+
const b = v - o, P = b > 0.5 ? "\u25B2" : b < -0.5 ? "\u25BC" : "", S = Pn(v, o);
|
|
1091
|
+
return y("div", {
|
|
1092
1092
|
style: {
|
|
1093
1093
|
display: "flex",
|
|
1094
1094
|
alignItems: "center",
|
|
@@ -1099,15 +1099,15 @@ let __tla = (async () => {
|
|
|
1099
1099
|
borderLeft: "1px solid rgba(255,255,255,0.12)"
|
|
1100
1100
|
},
|
|
1101
1101
|
children: [
|
|
1102
|
-
|
|
1102
|
+
P && i("span", {
|
|
1103
1103
|
style: {
|
|
1104
1104
|
fontSize: 10,
|
|
1105
1105
|
color: S,
|
|
1106
1106
|
lineHeight: 1
|
|
1107
1107
|
},
|
|
1108
|
-
children:
|
|
1108
|
+
children: P
|
|
1109
1109
|
}),
|
|
1110
|
-
|
|
1110
|
+
y("span", {
|
|
1111
1111
|
style: {
|
|
1112
1112
|
fontSize: 13,
|
|
1113
1113
|
color: S,
|
|
@@ -1119,7 +1119,7 @@ let __tla = (async () => {
|
|
|
1119
1119
|
c === "inch" ? (b / 25.4).toFixed(2) : (b / 10).toFixed(1)
|
|
1120
1120
|
]
|
|
1121
1121
|
}),
|
|
1122
|
-
|
|
1122
|
+
y("span", {
|
|
1123
1123
|
style: {
|
|
1124
1124
|
fontSize: 11,
|
|
1125
1125
|
color: "rgba(255,255,255,0.4)",
|
|
@@ -1139,7 +1139,7 @@ let __tla = (async () => {
|
|
|
1139
1139
|
})
|
|
1140
1140
|
]
|
|
1141
1141
|
});
|
|
1142
|
-
}, rr =
|
|
1142
|
+
}, rr = Po(or), ir = ({ mesh: e, startY: r, endY: t, spacing: n, modelSize: s, onMeasurementsChange: l, reverseOrder: c = false, displayUnit: a = "cm", useInnerSurface: o = false, formMeasurements: d, originY: p, wasmSlices: u }) => {
|
|
1143
1143
|
const f = de(/* @__PURE__ */ new Map()), h = e.geometry, v = Nn(h), g = J(() => {
|
|
1144
1144
|
if (u) {
|
|
1145
1145
|
let z = [
|
|
@@ -1171,13 +1171,13 @@ let __tla = (async () => {
|
|
|
1171
1171
|
const V = z[B], F = z[B + 1];
|
|
1172
1172
|
if (F <= V) continue;
|
|
1173
1173
|
const I = [];
|
|
1174
|
-
for (let
|
|
1174
|
+
for (let k = V; k < F; k += 3) I.push(new M(C[k], C[k + 1], C[k + 2]));
|
|
1175
1175
|
I.length >= 3 && S.set(_[B], I);
|
|
1176
1176
|
}
|
|
1177
1177
|
return S;
|
|
1178
1178
|
}, [
|
|
1179
1179
|
u
|
|
1180
|
-
]),
|
|
1180
|
+
]), w = J(() => {
|
|
1181
1181
|
if (!u) return null;
|
|
1182
1182
|
const S = /* @__PURE__ */ new Map();
|
|
1183
1183
|
for (let C = 0; C < u.yValues.length; C++) S.set(u.yValues[C], u.circumferences[C]);
|
|
@@ -1185,34 +1185,34 @@ let __tla = (async () => {
|
|
|
1185
1185
|
}, [
|
|
1186
1186
|
u
|
|
1187
1187
|
]);
|
|
1188
|
-
|
|
1188
|
+
G(() => {
|
|
1189
1189
|
f.current.clear();
|
|
1190
1190
|
}, [
|
|
1191
1191
|
g
|
|
1192
|
-
]),
|
|
1193
|
-
if (!
|
|
1194
|
-
const S = g.filter((C) => (
|
|
1192
|
+
]), G(() => {
|
|
1193
|
+
if (!w || !l) return;
|
|
1194
|
+
const S = g.filter((C) => (w.get(C) ?? 0) > 0).map((C) => ({
|
|
1195
1195
|
yPosition: C,
|
|
1196
|
-
originalValue:
|
|
1196
|
+
originalValue: w.get(C) ?? 0,
|
|
1197
1197
|
modifiedValue: null
|
|
1198
1198
|
}));
|
|
1199
1199
|
l(S);
|
|
1200
1200
|
}, [
|
|
1201
|
-
|
|
1201
|
+
w,
|
|
1202
1202
|
g,
|
|
1203
1203
|
l
|
|
1204
1204
|
]);
|
|
1205
1205
|
const A = [
|
|
1206
1206
|
"#5B9BD5"
|
|
1207
|
-
], b = s * Eo,
|
|
1208
|
-
if (
|
|
1207
|
+
], b = s * Eo, P = ce((S) => {
|
|
1208
|
+
if (w) return;
|
|
1209
1209
|
f.current.set(S.yPosition, S);
|
|
1210
1210
|
const C = Array.from(f.current.values()).sort((z, _) => c ? _.yPosition - z.yPosition : z.yPosition - _.yPosition);
|
|
1211
1211
|
l == null ? void 0 : l(C);
|
|
1212
1212
|
}, [
|
|
1213
1213
|
l,
|
|
1214
1214
|
c,
|
|
1215
|
-
|
|
1215
|
+
w
|
|
1216
1216
|
]);
|
|
1217
1217
|
return v ? i(Re, {
|
|
1218
1218
|
children: g.map((S, C) => i(rr, {
|
|
@@ -1221,13 +1221,13 @@ let __tla = (async () => {
|
|
|
1221
1221
|
yPosition: S,
|
|
1222
1222
|
color: p != null && Math.abs(S - p) < n * 0.5 ? "#44ff44" : A[C % A.length],
|
|
1223
1223
|
labelX: b,
|
|
1224
|
-
onDataChange:
|
|
1224
|
+
onDataChange: P,
|
|
1225
1225
|
displayUnit: a,
|
|
1226
1226
|
useInnerSurface: o,
|
|
1227
1227
|
formValue: d == null ? void 0 : d[C],
|
|
1228
1228
|
lineWidth: p != null && Math.abs(S - p) < n * 0.5 ? 4 : 1.5,
|
|
1229
1229
|
wasmLoopPoints: x == null ? void 0 : x.get(S),
|
|
1230
|
-
wasmCircumference:
|
|
1230
|
+
wasmCircumference: w == null ? void 0 : w.get(S)
|
|
1231
1231
|
}, S))
|
|
1232
1232
|
}) : null;
|
|
1233
1233
|
}, sr = (e, r) => {
|
|
@@ -1250,8 +1250,8 @@ let __tla = (async () => {
|
|
|
1250
1250
|
const V = C.position.x - u.current.position.x, F = C.position.z - u.current.position.z;
|
|
1251
1251
|
u.current.rotation.y = Math.atan2(V, F);
|
|
1252
1252
|
});
|
|
1253
|
-
const f = new M(0, r, 0), h = new M(0, a, 0), v = new M(0, (r + a) / 2, 0), g = new M(-p, r, 0), x = new M(p, r, 0),
|
|
1254
|
-
return
|
|
1253
|
+
const f = new M(0, r, 0), h = new M(0, a, 0), v = new M(0, (r + a) / 2, 0), g = new M(-p, r, 0), x = new M(p, r, 0), w = new M(-p, a, 0), A = new M(p, a, 0), b = l != null && l > 0, P = b ? o - l : 0, S = b ? sr(o, l) : "#fff";
|
|
1254
|
+
return y("group", {
|
|
1255
1255
|
ref: u,
|
|
1256
1256
|
children: [
|
|
1257
1257
|
i(ye, {
|
|
@@ -1272,7 +1272,7 @@ let __tla = (async () => {
|
|
|
1272
1272
|
}),
|
|
1273
1273
|
i(ye, {
|
|
1274
1274
|
points: [
|
|
1275
|
-
|
|
1275
|
+
w,
|
|
1276
1276
|
A
|
|
1277
1277
|
],
|
|
1278
1278
|
color: "#888888",
|
|
@@ -1289,7 +1289,7 @@ let __tla = (async () => {
|
|
|
1289
1289
|
0,
|
|
1290
1290
|
0
|
|
1291
1291
|
],
|
|
1292
|
-
children:
|
|
1292
|
+
children: y("div", {
|
|
1293
1293
|
style: {
|
|
1294
1294
|
display: "flex",
|
|
1295
1295
|
flexDirection: "column",
|
|
@@ -1300,7 +1300,7 @@ let __tla = (async () => {
|
|
|
1300
1300
|
pointerEvents: "none"
|
|
1301
1301
|
},
|
|
1302
1302
|
children: [
|
|
1303
|
-
|
|
1303
|
+
y("div", {
|
|
1304
1304
|
style: {
|
|
1305
1305
|
padding: "4px 8px",
|
|
1306
1306
|
backgroundColor: "rgba(0, 0, 0, 0.75)",
|
|
@@ -1317,7 +1317,7 @@ let __tla = (async () => {
|
|
|
1317
1317
|
n === "inch" ? "in" : "cm"
|
|
1318
1318
|
]
|
|
1319
1319
|
}),
|
|
1320
|
-
b &&
|
|
1320
|
+
b && y("div", {
|
|
1321
1321
|
style: {
|
|
1322
1322
|
display: "flex",
|
|
1323
1323
|
alignItems: "center",
|
|
@@ -1330,15 +1330,15 @@ let __tla = (async () => {
|
|
|
1330
1330
|
pointerEvents: "none"
|
|
1331
1331
|
},
|
|
1332
1332
|
children: [
|
|
1333
|
-
Math.abs(
|
|
1333
|
+
Math.abs(P) > 0.5 && i("span", {
|
|
1334
1334
|
style: {
|
|
1335
1335
|
fontSize: 10,
|
|
1336
1336
|
color: S,
|
|
1337
1337
|
lineHeight: 1
|
|
1338
1338
|
},
|
|
1339
|
-
children:
|
|
1339
|
+
children: P > 0.5 ? "\u25B2" : "\u25BC"
|
|
1340
1340
|
}),
|
|
1341
|
-
|
|
1341
|
+
y("span", {
|
|
1342
1342
|
style: {
|
|
1343
1343
|
fontSize: 13,
|
|
1344
1344
|
color: S,
|
|
@@ -1346,11 +1346,11 @@ let __tla = (async () => {
|
|
|
1346
1346
|
fontWeight: 600
|
|
1347
1347
|
},
|
|
1348
1348
|
children: [
|
|
1349
|
-
|
|
1350
|
-
n === "inch" ? (
|
|
1349
|
+
P > 0 ? "+" : "",
|
|
1350
|
+
n === "inch" ? (P / 25.4).toFixed(2) : (P / 10).toFixed(1)
|
|
1351
1351
|
]
|
|
1352
1352
|
}),
|
|
1353
|
-
|
|
1353
|
+
y("span", {
|
|
1354
1354
|
style: {
|
|
1355
1355
|
fontSize: 11,
|
|
1356
1356
|
color: "rgba(255,255,255,0.4)",
|
|
@@ -1370,15 +1370,15 @@ let __tla = (async () => {
|
|
|
1370
1370
|
]
|
|
1371
1371
|
});
|
|
1372
1372
|
}, ar = ({ modelSize: e, isAligned: r, isCut: t, mesh: n, viewMode: s, sliceY: l, landmarkCount: c = 0, measurementGeometry: a, fitYMin: o, fitYMax: d, resetCameraToFrontRef: p }) => {
|
|
1373
|
-
const { set: u, size: f, camera: h, invalidate: v } = Wn(), g = de(false), x = de(s),
|
|
1373
|
+
const { set: u, size: f, camera: h, invalidate: v } = Wn(), g = de(false), x = de(s), w = de(new M()), A = de(null), b = de(c), P = de(r), S = de(t), C = de(a), z = de({
|
|
1374
1374
|
min: o,
|
|
1375
1375
|
max: d
|
|
1376
1376
|
}), _ = de(0), B = ce(() => {
|
|
1377
1377
|
if (!n || e <= 0) return null;
|
|
1378
1378
|
const F = a ?? n.geometry;
|
|
1379
1379
|
F.computeBoundingBox();
|
|
1380
|
-
const I = F.boundingBox,
|
|
1381
|
-
I.getCenter(
|
|
1380
|
+
const I = F.boundingBox, k = new M();
|
|
1381
|
+
I.getCenter(k);
|
|
1382
1382
|
const T = new M();
|
|
1383
1383
|
I.getSize(T);
|
|
1384
1384
|
const j = o != null && d != null && d > o;
|
|
@@ -1393,11 +1393,11 @@ let __tla = (async () => {
|
|
|
1393
1393
|
const $ = Q[ue * 3];
|
|
1394
1394
|
$ < N && (N = $), $ > Y && (Y = $), ge = true;
|
|
1395
1395
|
}
|
|
1396
|
-
ge && (
|
|
1396
|
+
ge && (k.set((N + Y) / 2, (fe + se) / 2, 0), T.set(Y - N, se - fe, 0));
|
|
1397
1397
|
}
|
|
1398
1398
|
}
|
|
1399
|
-
|
|
1400
|
-
const ee = f.width / f.height, ie = 1.35, oe = j ? 1.15 : 1.6, q = Math.max(T.y * oe, T.x * ie / ee), re = q * ee, K =
|
|
1399
|
+
w.current.copy(T);
|
|
1400
|
+
const ee = f.width / f.height, ie = 1.35, oe = j ? 1.15 : 1.6, q = Math.max(T.y * oe, T.x * ie / ee), re = q * ee, K = k.y - T.y * 0.05;
|
|
1401
1401
|
_.current = K;
|
|
1402
1402
|
const he = new Z.OrthographicCamera(-re / 2, re / 2, q / 2, -q / 2, 0.1, e * 10);
|
|
1403
1403
|
return he.position.set(0, K, e * 2), he.lookAt(0, K, 0), he;
|
|
@@ -1409,7 +1409,7 @@ let __tla = (async () => {
|
|
|
1409
1409
|
o,
|
|
1410
1410
|
d
|
|
1411
1411
|
]);
|
|
1412
|
-
|
|
1412
|
+
G(() => {
|
|
1413
1413
|
if (p) return p.current = () => {
|
|
1414
1414
|
const F = B();
|
|
1415
1415
|
F && (u({
|
|
@@ -1425,12 +1425,12 @@ let __tla = (async () => {
|
|
|
1425
1425
|
v
|
|
1426
1426
|
]);
|
|
1427
1427
|
const V = ce((F) => {
|
|
1428
|
-
const I = F.position.clone(),
|
|
1429
|
-
F.position.set(
|
|
1428
|
+
const I = F.position.clone(), k = I.length(), T = Math.atan2(I.x, I.z), j = Math.acos(I.y / k), ie = T + 0.02;
|
|
1429
|
+
F.position.set(k * Math.sin(j) * Math.sin(ie), k * Math.cos(j), k * Math.sin(j) * Math.cos(ie)), F.lookAt(0, 0, 0), F.updateMatrixWorld(true), v();
|
|
1430
1430
|
}, [
|
|
1431
1431
|
v
|
|
1432
1432
|
]);
|
|
1433
|
-
return
|
|
1433
|
+
return G(() => {
|
|
1434
1434
|
if (e > 0 && !g.current && !r) {
|
|
1435
1435
|
g.current = true;
|
|
1436
1436
|
const F = new Z.PerspectiveCamera(50, f.width / f.height, 0.1, e * 10);
|
|
@@ -1444,7 +1444,7 @@ let __tla = (async () => {
|
|
|
1444
1444
|
u,
|
|
1445
1445
|
r,
|
|
1446
1446
|
V
|
|
1447
|
-
]),
|
|
1447
|
+
]), G(() => {
|
|
1448
1448
|
const F = b.current;
|
|
1449
1449
|
b.current = c, F === 0 && c === 1 && !r && requestAnimationFrame(() => V(h));
|
|
1450
1450
|
}, [
|
|
@@ -1452,12 +1452,12 @@ let __tla = (async () => {
|
|
|
1452
1452
|
r,
|
|
1453
1453
|
h,
|
|
1454
1454
|
V
|
|
1455
|
-
]),
|
|
1456
|
-
const F =
|
|
1457
|
-
if (
|
|
1455
|
+
]), G(() => {
|
|
1456
|
+
const F = P.current !== r, I = S.current !== t, k = !C.current && !!a, T = (z.current.min == null || z.current.max == null) && o != null && d != null;
|
|
1457
|
+
if (P.current = r, S.current = t, C.current = a, z.current = {
|
|
1458
1458
|
min: o,
|
|
1459
1459
|
max: d
|
|
1460
|
-
}, !F && !I && !
|
|
1460
|
+
}, !F && !I && !k && !T || !r || s !== "3D") return;
|
|
1461
1461
|
const j = B();
|
|
1462
1462
|
j && u({
|
|
1463
1463
|
camera: j
|
|
@@ -1471,15 +1471,15 @@ let __tla = (async () => {
|
|
|
1471
1471
|
d,
|
|
1472
1472
|
B,
|
|
1473
1473
|
u
|
|
1474
|
-
]),
|
|
1474
|
+
]), G(() => {
|
|
1475
1475
|
if (x.current === s) return;
|
|
1476
1476
|
const F = x.current;
|
|
1477
1477
|
if (x.current = s, !(!r || !n || e <= 0)) {
|
|
1478
1478
|
if (s === "2D" && l != null) {
|
|
1479
1479
|
A.current = h;
|
|
1480
|
-
const I = n.geometry,
|
|
1480
|
+
const I = n.geometry, k = I.getAttribute("position"), T = k.array, j = e * 0.15;
|
|
1481
1481
|
let ee = 1 / 0, ie = -1 / 0, oe = 1 / 0, q = -1 / 0, re = false;
|
|
1482
|
-
for (let fe = 0; fe <
|
|
1482
|
+
for (let fe = 0; fe < k.count; fe++) if (Math.abs(T[fe * 3 + 1] - l) < j) {
|
|
1483
1483
|
const se = T[fe * 3], ge = T[fe * 3 + 2];
|
|
1484
1484
|
se < ee && (ee = se), se > ie && (ie = se), ge < oe && (oe = ge), ge > q && (q = ge), re = true;
|
|
1485
1485
|
}
|
|
@@ -1515,14 +1515,14 @@ let __tla = (async () => {
|
|
|
1515
1515
|
u,
|
|
1516
1516
|
h,
|
|
1517
1517
|
B
|
|
1518
|
-
]),
|
|
1518
|
+
]), G(() => {
|
|
1519
1519
|
if (!r || !h || !h.isOrthographicCamera) return;
|
|
1520
1520
|
const F = h;
|
|
1521
1521
|
if (s === "2D") {
|
|
1522
1522
|
if (!n || l == null) return;
|
|
1523
|
-
const I = n.geometry,
|
|
1523
|
+
const I = n.geometry, k = I.getAttribute("position"), T = k.array, j = e * 0.15;
|
|
1524
1524
|
let ee = 1 / 0, ie = -1 / 0, oe = 1 / 0, q = -1 / 0, re = false;
|
|
1525
|
-
for (let U = 0; U <
|
|
1525
|
+
for (let U = 0; U < k.count; U++) if (Math.abs(T[U * 3 + 1] - l) < j) {
|
|
1526
1526
|
const N = T[U * 3], Y = T[U * 3 + 2];
|
|
1527
1527
|
N < ee && (ee = N), N > ie && (ie = N), Y < oe && (oe = Y), Y > q && (q = Y), re = true;
|
|
1528
1528
|
}
|
|
@@ -1535,7 +1535,7 @@ let __tla = (async () => {
|
|
|
1535
1535
|
let O, Q;
|
|
1536
1536
|
te / D > K ? (O = te, Q = te / K) : (Q = D, O = D * K), F.left = -O / 2, F.right = O / 2, F.top = Q / 2, F.bottom = -Q / 2;
|
|
1537
1537
|
} else {
|
|
1538
|
-
const I =
|
|
1538
|
+
const I = w.current, k = f.width / f.height, T = Math.max(I.y, I.x / k) * 1.6, j = T * k;
|
|
1539
1539
|
F.left = -j / 2, F.right = j / 2, F.top = T / 2, F.bottom = -T / 2;
|
|
1540
1540
|
}
|
|
1541
1541
|
F.updateProjectionMatrix();
|
|
@@ -1566,7 +1566,7 @@ let __tla = (async () => {
|
|
|
1566
1566
|
n.z
|
|
1567
1567
|
]
|
|
1568
1568
|
});
|
|
1569
|
-
}, dr = ({ wasAutoScaled: e, onDismiss: r }) =>
|
|
1569
|
+
}, dr = ({ wasAutoScaled: e, onDismiss: r }) => y("div", {
|
|
1570
1570
|
style: {
|
|
1571
1571
|
position: "absolute",
|
|
1572
1572
|
top: 16,
|
|
@@ -1607,10 +1607,10 @@ let __tla = (async () => {
|
|
|
1607
1607
|
children: "X"
|
|
1608
1608
|
})
|
|
1609
1609
|
]
|
|
1610
|
-
}), fr = ({ isDoubleShell: e, onDismiss: r }) => (
|
|
1610
|
+
}), fr = ({ isDoubleShell: e, onDismiss: r }) => (G(() => {
|
|
1611
1611
|
const t = setTimeout(r, 1e4);
|
|
1612
1612
|
return () => clearTimeout(t);
|
|
1613
|
-
}, []),
|
|
1613
|
+
}, []), y("div", {
|
|
1614
1614
|
style: {
|
|
1615
1615
|
position: "absolute",
|
|
1616
1616
|
top: 64,
|
|
@@ -1655,18 +1655,18 @@ let __tla = (async () => {
|
|
|
1655
1655
|
const t = Math.abs(e - r);
|
|
1656
1656
|
return t <= 7 ? "#4caf50" : t <= 15 ? "#ff9800" : "#f44336";
|
|
1657
1657
|
}, ur = ({ mesh: e, upperY: r, originY: t, modelSize: n, meshColor: s = "#c8c8c8", displayUnit: l = "cm", formML: c, formAP: a }) => {
|
|
1658
|
-
const o = e.geometry, d = J(() => new
|
|
1659
|
-
maxLeafTris:
|
|
1658
|
+
const o = e.geometry, d = J(() => new Ct(o, {
|
|
1659
|
+
maxLeafTris: At
|
|
1660
1660
|
}), [
|
|
1661
1661
|
o
|
|
1662
|
-
]), p = J(() =>
|
|
1662
|
+
]), p = J(() => je(d, o, t), [
|
|
1663
1663
|
d,
|
|
1664
1664
|
o,
|
|
1665
1665
|
t
|
|
1666
|
-
]), u = J(() => new
|
|
1666
|
+
]), u = J(() => new St(new M(0, -1, 0), r), [
|
|
1667
1667
|
r
|
|
1668
1668
|
]), { mlLine: f, apLine: h, mlWidth: v, apWidth: g } = J(() => {
|
|
1669
|
-
let A = null, b = null,
|
|
1669
|
+
let A = null, b = null, P = 0, S = 0;
|
|
1670
1670
|
if (p.linePoints.length >= 2) {
|
|
1671
1671
|
let C = p.linePoints[0], z = p.linePoints[0], _ = p.linePoints[0], B = p.linePoints[0];
|
|
1672
1672
|
for (const V of p.linePoints) V.x < C.x && (C = V), V.x > z.x && (z = V), V.z < _.z && (_ = V), V.z > B.z && (B = V);
|
|
@@ -1676,19 +1676,19 @@ let __tla = (async () => {
|
|
|
1676
1676
|
], b = [
|
|
1677
1677
|
new M(_.x, t, _.z),
|
|
1678
1678
|
new M(B.x, t, B.z)
|
|
1679
|
-
],
|
|
1679
|
+
], P = A[0].distanceTo(A[1]), S = b[0].distanceTo(b[1]);
|
|
1680
1680
|
}
|
|
1681
1681
|
return {
|
|
1682
1682
|
mlLine: A,
|
|
1683
1683
|
apLine: b,
|
|
1684
|
-
mlWidth:
|
|
1684
|
+
mlWidth: P,
|
|
1685
1685
|
apWidth: S
|
|
1686
1686
|
};
|
|
1687
1687
|
}, [
|
|
1688
1688
|
p,
|
|
1689
1689
|
t
|
|
1690
|
-
]), x = (A) => l === "inch" ? (A / 25.4).toFixed(2) : (A / 10).toFixed(1),
|
|
1691
|
-
return
|
|
1690
|
+
]), x = (A) => l === "inch" ? (A / 25.4).toFixed(2) : (A / 10).toFixed(1), w = l === "inch" ? "in" : "cm";
|
|
1691
|
+
return y(Re, {
|
|
1692
1692
|
children: [
|
|
1693
1693
|
i("mesh", {
|
|
1694
1694
|
geometry: e.geometry,
|
|
@@ -1711,7 +1711,7 @@ let __tla = (async () => {
|
|
|
1711
1711
|
depthWrite: false,
|
|
1712
1712
|
transparent: true
|
|
1713
1713
|
}),
|
|
1714
|
-
f &&
|
|
1714
|
+
f && y(Re, {
|
|
1715
1715
|
children: [
|
|
1716
1716
|
i(ye, {
|
|
1717
1717
|
points: f,
|
|
@@ -1731,7 +1731,7 @@ let __tla = (async () => {
|
|
|
1731
1731
|
style: {
|
|
1732
1732
|
pointerEvents: "none"
|
|
1733
1733
|
},
|
|
1734
|
-
children:
|
|
1734
|
+
children: y("div", {
|
|
1735
1735
|
style: {
|
|
1736
1736
|
display: "flex",
|
|
1737
1737
|
flexDirection: "column",
|
|
@@ -1745,7 +1745,7 @@ let __tla = (async () => {
|
|
|
1745
1745
|
backgroundColor: "rgba(0,0,0,0.75)",
|
|
1746
1746
|
borderRadius: c != null && c > 0 ? "3px 3px 0 0" : 3
|
|
1747
1747
|
},
|
|
1748
|
-
children:
|
|
1748
|
+
children: y("span", {
|
|
1749
1749
|
style: {
|
|
1750
1750
|
fontSize: 12,
|
|
1751
1751
|
color: "#ff8800",
|
|
@@ -1755,13 +1755,13 @@ let __tla = (async () => {
|
|
|
1755
1755
|
"ML ",
|
|
1756
1756
|
x(v),
|
|
1757
1757
|
" ",
|
|
1758
|
-
|
|
1758
|
+
w
|
|
1759
1759
|
]
|
|
1760
1760
|
})
|
|
1761
1761
|
}),
|
|
1762
1762
|
c != null && c > 0 && (() => {
|
|
1763
|
-
const A = v - c, b = Dn(v, c),
|
|
1764
|
-
return
|
|
1763
|
+
const A = v - c, b = Dn(v, c), P = A > 0.5 ? "\u25B2" : A < -0.5 ? "\u25BC" : "";
|
|
1764
|
+
return y("div", {
|
|
1765
1765
|
style: {
|
|
1766
1766
|
display: "flex",
|
|
1767
1767
|
alignItems: "center",
|
|
@@ -1772,15 +1772,15 @@ let __tla = (async () => {
|
|
|
1772
1772
|
borderTop: "1px solid rgba(255,255,255,0.12)"
|
|
1773
1773
|
},
|
|
1774
1774
|
children: [
|
|
1775
|
-
|
|
1775
|
+
P && i("span", {
|
|
1776
1776
|
style: {
|
|
1777
1777
|
fontSize: 9,
|
|
1778
1778
|
color: b,
|
|
1779
1779
|
lineHeight: 1
|
|
1780
1780
|
},
|
|
1781
|
-
children:
|
|
1781
|
+
children: P
|
|
1782
1782
|
}),
|
|
1783
|
-
|
|
1783
|
+
y("span", {
|
|
1784
1784
|
style: {
|
|
1785
1785
|
fontSize: 11,
|
|
1786
1786
|
color: b,
|
|
@@ -1792,7 +1792,7 @@ let __tla = (async () => {
|
|
|
1792
1792
|
l === "inch" ? (A / 25.4).toFixed(2) : (A / 10).toFixed(1)
|
|
1793
1793
|
]
|
|
1794
1794
|
}),
|
|
1795
|
-
|
|
1795
|
+
y("span", {
|
|
1796
1796
|
style: {
|
|
1797
1797
|
fontSize: 10,
|
|
1798
1798
|
color: "rgba(255,255,255,0.4)",
|
|
@@ -1811,7 +1811,7 @@ let __tla = (async () => {
|
|
|
1811
1811
|
})
|
|
1812
1812
|
]
|
|
1813
1813
|
}),
|
|
1814
|
-
h &&
|
|
1814
|
+
h && y(Re, {
|
|
1815
1815
|
children: [
|
|
1816
1816
|
i(ye, {
|
|
1817
1817
|
points: h,
|
|
@@ -1831,7 +1831,7 @@ let __tla = (async () => {
|
|
|
1831
1831
|
style: {
|
|
1832
1832
|
pointerEvents: "none"
|
|
1833
1833
|
},
|
|
1834
|
-
children:
|
|
1834
|
+
children: y("div", {
|
|
1835
1835
|
style: {
|
|
1836
1836
|
display: "flex",
|
|
1837
1837
|
flexDirection: "column",
|
|
@@ -1845,7 +1845,7 @@ let __tla = (async () => {
|
|
|
1845
1845
|
backgroundColor: "rgba(0,0,0,0.75)",
|
|
1846
1846
|
borderRadius: a != null && a > 0 ? "3px 3px 0 0" : 3
|
|
1847
1847
|
},
|
|
1848
|
-
children:
|
|
1848
|
+
children: y("span", {
|
|
1849
1849
|
style: {
|
|
1850
1850
|
fontSize: 12,
|
|
1851
1851
|
color: "#ff00ff",
|
|
@@ -1855,13 +1855,13 @@ let __tla = (async () => {
|
|
|
1855
1855
|
"AP ",
|
|
1856
1856
|
x(g),
|
|
1857
1857
|
" ",
|
|
1858
|
-
|
|
1858
|
+
w
|
|
1859
1859
|
]
|
|
1860
1860
|
})
|
|
1861
1861
|
}),
|
|
1862
1862
|
a != null && a > 0 && (() => {
|
|
1863
|
-
const A = g - a, b = Dn(g, a),
|
|
1864
|
-
return
|
|
1863
|
+
const A = g - a, b = Dn(g, a), P = A > 0.5 ? "\u25B2" : A < -0.5 ? "\u25BC" : "";
|
|
1864
|
+
return y("div", {
|
|
1865
1865
|
style: {
|
|
1866
1866
|
display: "flex",
|
|
1867
1867
|
alignItems: "center",
|
|
@@ -1872,15 +1872,15 @@ let __tla = (async () => {
|
|
|
1872
1872
|
borderTop: "1px solid rgba(255,255,255,0.12)"
|
|
1873
1873
|
},
|
|
1874
1874
|
children: [
|
|
1875
|
-
|
|
1875
|
+
P && i("span", {
|
|
1876
1876
|
style: {
|
|
1877
1877
|
fontSize: 9,
|
|
1878
1878
|
color: b,
|
|
1879
1879
|
lineHeight: 1
|
|
1880
1880
|
},
|
|
1881
|
-
children:
|
|
1881
|
+
children: P
|
|
1882
1882
|
}),
|
|
1883
|
-
|
|
1883
|
+
y("span", {
|
|
1884
1884
|
style: {
|
|
1885
1885
|
fontSize: 11,
|
|
1886
1886
|
color: b,
|
|
@@ -1892,7 +1892,7 @@ let __tla = (async () => {
|
|
|
1892
1892
|
l === "inch" ? (A / 25.4).toFixed(2) : (A / 10).toFixed(1)
|
|
1893
1893
|
]
|
|
1894
1894
|
}),
|
|
1895
|
-
|
|
1895
|
+
y("span", {
|
|
1896
1896
|
style: {
|
|
1897
1897
|
fontSize: 10,
|
|
1898
1898
|
color: "rgba(255,255,255,0.4)",
|
|
@@ -1914,44 +1914,44 @@ let __tla = (async () => {
|
|
|
1914
1914
|
]
|
|
1915
1915
|
});
|
|
1916
1916
|
}, pr = ({ mesh: e, yPosition: r, onYChange: t, minY: n, maxY: s, modelSize: l, color: c, hoverColor: a, dragColor: o, label: d, onDragStart: p, onDragEnd: u }) => {
|
|
1917
|
-
const [f, h] = E(false), [v, g] = E(false), { camera: x, gl:
|
|
1917
|
+
const [f, h] = E(false), [v, g] = E(false), { camera: x, gl: w } = Wn(), A = de(0), b = de(null), P = e.geometry, S = Nn(P), C = J(() => S ? je(S, P, r) : {
|
|
1918
1918
|
linePoints: [],
|
|
1919
1919
|
lineLength: 0,
|
|
1920
1920
|
rightmostPoint: new M()
|
|
1921
1921
|
}, [
|
|
1922
1922
|
S,
|
|
1923
|
-
|
|
1923
|
+
P,
|
|
1924
1924
|
r
|
|
1925
|
-
]), z = ce((
|
|
1926
|
-
const ee =
|
|
1925
|
+
]), z = ce((k, T, j) => {
|
|
1926
|
+
const ee = w.domElement.getBoundingClientRect(), ie = (k - ee.left) / ee.width * 2 - 1, oe = -((T - ee.top) / ee.height) * 2 + 1, q = new Do();
|
|
1927
1927
|
q.setFromCamera(new Z.Vector2(ie, oe), x);
|
|
1928
1928
|
const re = new M();
|
|
1929
1929
|
return q.ray.intersectPlane(j, re) ? re.y : null;
|
|
1930
1930
|
}, [
|
|
1931
1931
|
x,
|
|
1932
|
-
|
|
1933
|
-
]), _ = ce((
|
|
1932
|
+
w
|
|
1933
|
+
]), _ = ce((k) => {
|
|
1934
1934
|
const T = new M();
|
|
1935
1935
|
x.getWorldDirection(T), T.y = 0, T.lengthSq() < 1e-6 && T.set(0, 0, 1), T.normalize();
|
|
1936
1936
|
const j = T.multiplyScalar(-1);
|
|
1937
|
-
return new
|
|
1937
|
+
return new St().setFromNormalAndCoplanarPoint(j, new M(0, k, 0));
|
|
1938
1938
|
}, [
|
|
1939
1939
|
x
|
|
1940
|
-
]), B = ce((
|
|
1941
|
-
|
|
1940
|
+
]), B = ce((k) => {
|
|
1941
|
+
k.stopPropagation(), h(true), w.domElement.style.cursor = "ns-resize";
|
|
1942
1942
|
const T = _(r);
|
|
1943
1943
|
b.current = T;
|
|
1944
|
-
const j = z(
|
|
1945
|
-
A.current = j != null ? r - j : 0,
|
|
1944
|
+
const j = z(k.clientX, k.clientY, T);
|
|
1945
|
+
A.current = j != null ? r - j : 0, k.target.setPointerCapture(k.pointerId), p == null ? void 0 : p();
|
|
1946
1946
|
}, [
|
|
1947
1947
|
r,
|
|
1948
|
-
|
|
1948
|
+
w,
|
|
1949
1949
|
_,
|
|
1950
1950
|
z,
|
|
1951
1951
|
p
|
|
1952
|
-
]), V = ce((
|
|
1952
|
+
]), V = ce((k) => {
|
|
1953
1953
|
if (!f || !b.current) return;
|
|
1954
|
-
const T = z(
|
|
1954
|
+
const T = z(k.clientX, k.clientY, b.current);
|
|
1955
1955
|
if (T == null) return;
|
|
1956
1956
|
let j = T + A.current;
|
|
1957
1957
|
j = Math.max(n, Math.min(s, j)), t(j);
|
|
@@ -1961,15 +1961,15 @@ let __tla = (async () => {
|
|
|
1961
1961
|
t,
|
|
1962
1962
|
n,
|
|
1963
1963
|
s
|
|
1964
|
-
]), F = ce((
|
|
1965
|
-
h(false),
|
|
1964
|
+
]), F = ce((k) => {
|
|
1965
|
+
h(false), w.domElement.style.cursor = "auto", b.current = null, k.target.releasePointerCapture(k.pointerId), u == null ? void 0 : u();
|
|
1966
1966
|
}, [
|
|
1967
|
-
|
|
1967
|
+
w,
|
|
1968
1968
|
u
|
|
1969
1969
|
]);
|
|
1970
1970
|
if (C.linePoints.length < 2) return null;
|
|
1971
1971
|
const I = f ? o : v ? a : c;
|
|
1972
|
-
return
|
|
1972
|
+
return y("group", {
|
|
1973
1973
|
renderOrder: 10,
|
|
1974
1974
|
children: [
|
|
1975
1975
|
i(ye, {
|
|
@@ -1984,10 +1984,10 @@ let __tla = (async () => {
|
|
|
1984
1984
|
onPointerMove: V,
|
|
1985
1985
|
onPointerUp: F,
|
|
1986
1986
|
onPointerEnter: () => {
|
|
1987
|
-
g(true),
|
|
1987
|
+
g(true), w.domElement.style.cursor = "ns-resize";
|
|
1988
1988
|
},
|
|
1989
1989
|
onPointerLeave: () => {
|
|
1990
|
-
f || (g(false),
|
|
1990
|
+
f || (g(false), w.domElement.style.cursor = "auto");
|
|
1991
1991
|
}
|
|
1992
1992
|
}),
|
|
1993
1993
|
(v || f) && i("mesh", {
|
|
@@ -2023,7 +2023,7 @@ let __tla = (async () => {
|
|
|
2023
2023
|
}
|
|
2024
2024
|
var gr = [
|
|
2025
2025
|
"color"
|
|
2026
|
-
], mr =
|
|
2026
|
+
], mr = ko(function(e, r) {
|
|
2027
2027
|
var t = e.color, n = t === void 0 ? "currentColor" : t, s = hr(e, gr);
|
|
2028
2028
|
return An("svg", Object.assign({
|
|
2029
2029
|
width: "15",
|
|
@@ -2049,7 +2049,7 @@ let __tla = (async () => {
|
|
|
2049
2049
|
fontFamily: "system-ui, sans-serif",
|
|
2050
2050
|
letterSpacing: "0.4px",
|
|
2051
2051
|
lineHeight: "36px"
|
|
2052
|
-
},
|
|
2052
|
+
}, Ze = {
|
|
2053
2053
|
width: "100%",
|
|
2054
2054
|
padding: "10px 12px",
|
|
2055
2055
|
fontSize: 15,
|
|
@@ -2059,7 +2059,7 @@ let __tla = (async () => {
|
|
|
2059
2059
|
boxSizing: "border-box",
|
|
2060
2060
|
fontFamily: "system-ui, sans-serif"
|
|
2061
2061
|
}, xr = ({ amputationType: e, spacingInches: r, scanMeasurements: t, scanFrontalHeight: n, scanTransverseML: s = 0, scanTransverseAP: l = 0, onSave: c, onSkip: a, onFormChange: o, onHeightChange: d, onTransverseMLChange: p, onTransverseAPChange: u, initialValues: f, initialFrontalHeight: h }) => {
|
|
2062
|
-
const v = e === "AK" ? "Perineum" : "MPT", g = r, x = e === "AK" ? 18 : 9,
|
|
2062
|
+
const v = e === "AK" ? "Perineum" : "MPT", g = r, x = e === "AK" ? 18 : 9, w = J(() => {
|
|
2063
2063
|
const D = [];
|
|
2064
2064
|
for (let O = 2; O >= 1; O -= g) D.push(`${O}\u2033 above ${v}`);
|
|
2065
2065
|
D.push(`At ${v}`);
|
|
@@ -2080,39 +2080,39 @@ let __tla = (async () => {
|
|
|
2080
2080
|
]), [
|
|
2081
2081
|
e,
|
|
2082
2082
|
v
|
|
2083
|
-
]), [b,
|
|
2083
|
+
]), [b, P] = E(() => {
|
|
2084
2084
|
if (!f) return {};
|
|
2085
2085
|
const D = {};
|
|
2086
|
-
return
|
|
2086
|
+
return w.forEach((O, Q) => {
|
|
2087
2087
|
f[Q] != null && f[Q] !== 0 && (D[O] = (f[Q] / 10).toFixed(1));
|
|
2088
2088
|
}), D;
|
|
2089
|
-
}), [S, C] = E(h && h > 0 ? (h / 10).toFixed(1) : ""), [z, _] = E(""), [B, V] = E(""), [F, I] = E(""), [
|
|
2089
|
+
}), [S, C] = E(h && h > 0 ? (h / 10).toFixed(1) : ""), [z, _] = E(""), [B, V] = E(""), [F, I] = E(""), [k, T] = E(""), j = e === "AK" ? "Perineum to Distal (Axial)" : "MPT to Distal (Axial)", ee = e === "AK" ? "M/L at Perineum" : "M/L at MPT", ie = e === "AK" ? "A/P at Perineum" : "A/P at MPT", oe = J(() => w.map((D) => {
|
|
2090
2090
|
const O = b[D];
|
|
2091
2091
|
return O != null && O !== "" && !isNaN(parseFloat(O)) ? parseFloat(O) * 10 : 0;
|
|
2092
2092
|
}), [
|
|
2093
|
-
|
|
2093
|
+
w,
|
|
2094
2094
|
b
|
|
2095
2095
|
]);
|
|
2096
|
-
|
|
2096
|
+
G(() => {
|
|
2097
2097
|
o == null ? void 0 : o(oe);
|
|
2098
2098
|
}, [
|
|
2099
2099
|
oe,
|
|
2100
2100
|
o
|
|
2101
|
-
]),
|
|
2101
|
+
]), G(() => {
|
|
2102
2102
|
const D = S !== "" && !isNaN(parseFloat(S)) ? parseFloat(S) * 10 : void 0;
|
|
2103
2103
|
d == null ? void 0 : d(D);
|
|
2104
2104
|
}, [
|
|
2105
2105
|
S,
|
|
2106
2106
|
d
|
|
2107
2107
|
]);
|
|
2108
|
-
const q = e === "AK" ? z : F, re = e === "AK" ? B :
|
|
2109
|
-
|
|
2108
|
+
const q = e === "AK" ? z : F, re = e === "AK" ? B : k;
|
|
2109
|
+
G(() => {
|
|
2110
2110
|
const D = q !== "" && !isNaN(parseFloat(q)) ? parseFloat(q) * 10 : void 0;
|
|
2111
2111
|
p == null ? void 0 : p(D);
|
|
2112
2112
|
}, [
|
|
2113
2113
|
q,
|
|
2114
2114
|
p
|
|
2115
|
-
]),
|
|
2115
|
+
]), G(() => {
|
|
2116
2116
|
const D = re !== "" && !isNaN(parseFloat(re)) ? parseFloat(re) * 10 : void 0;
|
|
2117
2117
|
u == null ? void 0 : u(D);
|
|
2118
2118
|
}, [
|
|
@@ -2121,14 +2121,14 @@ let __tla = (async () => {
|
|
|
2121
2121
|
]);
|
|
2122
2122
|
const K = J(() => {
|
|
2123
2123
|
for (const D of A) {
|
|
2124
|
-
const O =
|
|
2124
|
+
const O = w.indexOf(D);
|
|
2125
2125
|
if (O === -1) continue;
|
|
2126
2126
|
if (oe[O] === 0) return false;
|
|
2127
2127
|
}
|
|
2128
2128
|
return !(!S || isNaN(parseFloat(S)) || parseFloat(S) === 0);
|
|
2129
2129
|
}, [
|
|
2130
2130
|
oe,
|
|
2131
|
-
|
|
2131
|
+
w,
|
|
2132
2132
|
A,
|
|
2133
2133
|
S
|
|
2134
2134
|
]), he = ce(() => {
|
|
@@ -2140,7 +2140,7 @@ let __tla = (async () => {
|
|
|
2140
2140
|
perineumML: e === "AK" ? D(z) : void 0,
|
|
2141
2141
|
perineumAP: e === "AK" ? D(B) : void 0,
|
|
2142
2142
|
mptML: e === "BK" ? D(F) : void 0,
|
|
2143
|
-
mptAP: e === "BK" ? D(
|
|
2143
|
+
mptAP: e === "BK" ? D(k) : void 0
|
|
2144
2144
|
});
|
|
2145
2145
|
}, [
|
|
2146
2146
|
K,
|
|
@@ -2149,18 +2149,18 @@ let __tla = (async () => {
|
|
|
2149
2149
|
z,
|
|
2150
2150
|
B,
|
|
2151
2151
|
F,
|
|
2152
|
-
|
|
2152
|
+
k,
|
|
2153
2153
|
e,
|
|
2154
2154
|
c
|
|
2155
2155
|
]), te = ce(() => {
|
|
2156
2156
|
const D = {};
|
|
2157
|
-
if (
|
|
2157
|
+
if (w.forEach((O, Q) => {
|
|
2158
2158
|
const U = t[Q];
|
|
2159
2159
|
if (U) {
|
|
2160
2160
|
const N = U.modifiedValue ?? U.originalValue;
|
|
2161
2161
|
D[O] = (N / 10).toFixed(1);
|
|
2162
2162
|
}
|
|
2163
|
-
}),
|
|
2163
|
+
}), P(D), n > 0 && C((n / 10).toFixed(1)), s > 0) {
|
|
2164
2164
|
const O = (s / 10).toFixed(1);
|
|
2165
2165
|
e === "AK" ? _(O) : I(O);
|
|
2166
2166
|
}
|
|
@@ -2169,14 +2169,14 @@ let __tla = (async () => {
|
|
|
2169
2169
|
e === "AK" ? V(O) : T(O);
|
|
2170
2170
|
}
|
|
2171
2171
|
}, [
|
|
2172
|
-
|
|
2172
|
+
w,
|
|
2173
2173
|
t,
|
|
2174
2174
|
n,
|
|
2175
2175
|
s,
|
|
2176
2176
|
l,
|
|
2177
2177
|
e
|
|
2178
2178
|
]);
|
|
2179
|
-
return
|
|
2179
|
+
return y("div", {
|
|
2180
2180
|
style: {
|
|
2181
2181
|
display: "flex",
|
|
2182
2182
|
flexDirection: "column",
|
|
@@ -2185,7 +2185,7 @@ let __tla = (async () => {
|
|
|
2185
2185
|
fontFamily: "system-ui, sans-serif"
|
|
2186
2186
|
},
|
|
2187
2187
|
children: [
|
|
2188
|
-
|
|
2188
|
+
y("div", {
|
|
2189
2189
|
style: {
|
|
2190
2190
|
padding: "20px 22px 16px",
|
|
2191
2191
|
backgroundColor: "#fff",
|
|
@@ -2196,7 +2196,7 @@ let __tla = (async () => {
|
|
|
2196
2196
|
flexShrink: 0
|
|
2197
2197
|
},
|
|
2198
2198
|
children: [
|
|
2199
|
-
|
|
2199
|
+
y("div", {
|
|
2200
2200
|
style: {
|
|
2201
2201
|
display: "flex",
|
|
2202
2202
|
alignItems: "center",
|
|
@@ -2230,7 +2230,7 @@ let __tla = (async () => {
|
|
|
2230
2230
|
})
|
|
2231
2231
|
]
|
|
2232
2232
|
}),
|
|
2233
|
-
|
|
2233
|
+
y("div", {
|
|
2234
2234
|
style: {
|
|
2235
2235
|
display: "flex",
|
|
2236
2236
|
alignItems: "center",
|
|
@@ -2247,7 +2247,7 @@ let __tla = (async () => {
|
|
|
2247
2247
|
boxShadow: "0 0 0 3px rgba(12, 67, 173, 0.13)"
|
|
2248
2248
|
}
|
|
2249
2249
|
}),
|
|
2250
|
-
|
|
2250
|
+
y("div", {
|
|
2251
2251
|
style: {
|
|
2252
2252
|
fontSize: 17,
|
|
2253
2253
|
fontWeight: 600,
|
|
@@ -2262,14 +2262,14 @@ let __tla = (async () => {
|
|
|
2262
2262
|
})
|
|
2263
2263
|
]
|
|
2264
2264
|
}),
|
|
2265
|
-
|
|
2265
|
+
y("div", {
|
|
2266
2266
|
style: {
|
|
2267
2267
|
fontSize: 13,
|
|
2268
2268
|
color: "rgba(0,0,0,0.6)",
|
|
2269
2269
|
lineHeight: "19px"
|
|
2270
2270
|
},
|
|
2271
2271
|
children: [
|
|
2272
|
-
"Values in cm, ",
|
|
2272
|
+
"Enter the patient's hand measurements below to compare them against the scan. Values in cm, ",
|
|
2273
2273
|
g,
|
|
2274
2274
|
"\u2033",
|
|
2275
2275
|
" spacing. ",
|
|
@@ -2279,7 +2279,22 @@ let __tla = (async () => {
|
|
|
2279
2279
|
},
|
|
2280
2280
|
children: "*"
|
|
2281
2281
|
}),
|
|
2282
|
-
" required.
|
|
2282
|
+
" required."
|
|
2283
|
+
]
|
|
2284
|
+
}),
|
|
2285
|
+
y("div", {
|
|
2286
|
+
style: {
|
|
2287
|
+
fontSize: 12,
|
|
2288
|
+
color: "rgba(0,0,0,0.55)",
|
|
2289
|
+
lineHeight: "17px",
|
|
2290
|
+
fontStyle: "italic"
|
|
2291
|
+
},
|
|
2292
|
+
children: [
|
|
2293
|
+
"No hand measurements? Tap ",
|
|
2294
|
+
i("strong", {
|
|
2295
|
+
children: "Pull from Scan"
|
|
2296
|
+
}),
|
|
2297
|
+
" to prefill from the 3D scan."
|
|
2283
2298
|
]
|
|
2284
2299
|
}),
|
|
2285
2300
|
i("button", {
|
|
@@ -2294,7 +2309,7 @@ let __tla = (async () => {
|
|
|
2294
2309
|
fontSize: 12,
|
|
2295
2310
|
width: "100%"
|
|
2296
2311
|
},
|
|
2297
|
-
children:
|
|
2312
|
+
children: y("span", {
|
|
2298
2313
|
style: {
|
|
2299
2314
|
display: "flex",
|
|
2300
2315
|
alignItems: "center",
|
|
@@ -2314,7 +2329,7 @@ let __tla = (async () => {
|
|
|
2314
2329
|
})
|
|
2315
2330
|
]
|
|
2316
2331
|
}),
|
|
2317
|
-
|
|
2332
|
+
y("div", {
|
|
2318
2333
|
style: {
|
|
2319
2334
|
flex: 1,
|
|
2320
2335
|
minHeight: 0,
|
|
@@ -2339,9 +2354,9 @@ let __tla = (async () => {
|
|
|
2339
2354
|
gap: 10,
|
|
2340
2355
|
marginBottom: 20
|
|
2341
2356
|
},
|
|
2342
|
-
children:
|
|
2357
|
+
children: w.map((D, O) => {
|
|
2343
2358
|
const Q = A.has(D), U = !!b[D];
|
|
2344
|
-
return
|
|
2359
|
+
return y("div", {
|
|
2345
2360
|
style: {
|
|
2346
2361
|
display: "flex",
|
|
2347
2362
|
flexDirection: "column",
|
|
@@ -2349,7 +2364,7 @@ let __tla = (async () => {
|
|
|
2349
2364
|
minWidth: 0
|
|
2350
2365
|
},
|
|
2351
2366
|
children: [
|
|
2352
|
-
|
|
2367
|
+
y("label", {
|
|
2353
2368
|
style: {
|
|
2354
2369
|
fontSize: 11,
|
|
2355
2370
|
fontWeight: 500,
|
|
@@ -2375,12 +2390,12 @@ let __tla = (async () => {
|
|
|
2375
2390
|
type: "number",
|
|
2376
2391
|
step: "0.1",
|
|
2377
2392
|
value: b[D] ?? "",
|
|
2378
|
-
onChange: (N) =>
|
|
2393
|
+
onChange: (N) => P((Y) => ({
|
|
2379
2394
|
...Y,
|
|
2380
2395
|
[D]: N.target.value
|
|
2381
2396
|
})),
|
|
2382
2397
|
style: {
|
|
2383
|
-
...
|
|
2398
|
+
...Ze,
|
|
2384
2399
|
padding: "6px 8px",
|
|
2385
2400
|
fontSize: 13,
|
|
2386
2401
|
borderColor: U ? "rgb(12, 67, 173)" : "#ccc",
|
|
@@ -2401,14 +2416,14 @@ let __tla = (async () => {
|
|
|
2401
2416
|
},
|
|
2402
2417
|
children: "Lengths"
|
|
2403
2418
|
}),
|
|
2404
|
-
|
|
2419
|
+
y("div", {
|
|
2405
2420
|
style: {
|
|
2406
2421
|
display: "grid",
|
|
2407
2422
|
gridTemplateColumns: "repeat(auto-fill, minmax(180px, 1fr))",
|
|
2408
2423
|
gap: 10
|
|
2409
2424
|
},
|
|
2410
2425
|
children: [
|
|
2411
|
-
|
|
2426
|
+
y("div", {
|
|
2412
2427
|
style: {
|
|
2413
2428
|
display: "flex",
|
|
2414
2429
|
flexDirection: "column",
|
|
@@ -2416,7 +2431,7 @@ let __tla = (async () => {
|
|
|
2416
2431
|
minWidth: 0
|
|
2417
2432
|
},
|
|
2418
2433
|
children: [
|
|
2419
|
-
|
|
2434
|
+
y("label", {
|
|
2420
2435
|
style: {
|
|
2421
2436
|
fontSize: 11,
|
|
2422
2437
|
fontWeight: 500,
|
|
@@ -2444,7 +2459,7 @@ let __tla = (async () => {
|
|
|
2444
2459
|
value: S,
|
|
2445
2460
|
onChange: (D) => C(D.target.value),
|
|
2446
2461
|
style: {
|
|
2447
|
-
...
|
|
2462
|
+
...Ze,
|
|
2448
2463
|
padding: "6px 8px",
|
|
2449
2464
|
fontSize: 13,
|
|
2450
2465
|
borderColor: S ? "rgb(12, 67, 173)" : "#ccc",
|
|
@@ -2454,9 +2469,9 @@ let __tla = (async () => {
|
|
|
2454
2469
|
})
|
|
2455
2470
|
]
|
|
2456
2471
|
}),
|
|
2457
|
-
e === "AK" ?
|
|
2472
|
+
e === "AK" ? y(Re, {
|
|
2458
2473
|
children: [
|
|
2459
|
-
|
|
2474
|
+
y("div", {
|
|
2460
2475
|
style: {
|
|
2461
2476
|
display: "flex",
|
|
2462
2477
|
flexDirection: "column",
|
|
@@ -2483,7 +2498,7 @@ let __tla = (async () => {
|
|
|
2483
2498
|
value: z,
|
|
2484
2499
|
onChange: (D) => _(D.target.value),
|
|
2485
2500
|
style: {
|
|
2486
|
-
...
|
|
2501
|
+
...Ze,
|
|
2487
2502
|
padding: "6px 8px",
|
|
2488
2503
|
fontSize: 13,
|
|
2489
2504
|
borderColor: z ? "rgb(12, 67, 173)" : "#ccc",
|
|
@@ -2493,7 +2508,7 @@ let __tla = (async () => {
|
|
|
2493
2508
|
})
|
|
2494
2509
|
]
|
|
2495
2510
|
}),
|
|
2496
|
-
|
|
2511
|
+
y("div", {
|
|
2497
2512
|
style: {
|
|
2498
2513
|
display: "flex",
|
|
2499
2514
|
flexDirection: "column",
|
|
@@ -2520,7 +2535,7 @@ let __tla = (async () => {
|
|
|
2520
2535
|
value: B,
|
|
2521
2536
|
onChange: (D) => V(D.target.value),
|
|
2522
2537
|
style: {
|
|
2523
|
-
...
|
|
2538
|
+
...Ze,
|
|
2524
2539
|
padding: "6px 8px",
|
|
2525
2540
|
fontSize: 13,
|
|
2526
2541
|
borderColor: B ? "rgb(12, 67, 173)" : "#ccc",
|
|
@@ -2531,9 +2546,9 @@ let __tla = (async () => {
|
|
|
2531
2546
|
]
|
|
2532
2547
|
})
|
|
2533
2548
|
]
|
|
2534
|
-
}) :
|
|
2549
|
+
}) : y(Re, {
|
|
2535
2550
|
children: [
|
|
2536
|
-
|
|
2551
|
+
y("div", {
|
|
2537
2552
|
style: {
|
|
2538
2553
|
display: "flex",
|
|
2539
2554
|
flexDirection: "column",
|
|
@@ -2560,7 +2575,7 @@ let __tla = (async () => {
|
|
|
2560
2575
|
value: F,
|
|
2561
2576
|
onChange: (D) => I(D.target.value),
|
|
2562
2577
|
style: {
|
|
2563
|
-
...
|
|
2578
|
+
...Ze,
|
|
2564
2579
|
padding: "6px 8px",
|
|
2565
2580
|
fontSize: 13,
|
|
2566
2581
|
borderColor: F ? "rgb(12, 67, 173)" : "#ccc",
|
|
@@ -2570,7 +2585,7 @@ let __tla = (async () => {
|
|
|
2570
2585
|
})
|
|
2571
2586
|
]
|
|
2572
2587
|
}),
|
|
2573
|
-
|
|
2588
|
+
y("div", {
|
|
2574
2589
|
style: {
|
|
2575
2590
|
display: "flex",
|
|
2576
2591
|
flexDirection: "column",
|
|
@@ -2594,13 +2609,13 @@ let __tla = (async () => {
|
|
|
2594
2609
|
i("input", {
|
|
2595
2610
|
type: "number",
|
|
2596
2611
|
step: "0.1",
|
|
2597
|
-
value:
|
|
2612
|
+
value: k,
|
|
2598
2613
|
onChange: (D) => T(D.target.value),
|
|
2599
2614
|
style: {
|
|
2600
|
-
...
|
|
2615
|
+
...Ze,
|
|
2601
2616
|
padding: "6px 8px",
|
|
2602
2617
|
fontSize: 13,
|
|
2603
|
-
borderColor:
|
|
2618
|
+
borderColor: k ? "rgb(12, 67, 173)" : "#ccc",
|
|
2604
2619
|
borderWidth: 1
|
|
2605
2620
|
},
|
|
2606
2621
|
placeholder: "0.0"
|
|
@@ -2647,7 +2662,7 @@ let __tla = (async () => {
|
|
|
2647
2662
|
"I don't want to",
|
|
2648
2663
|
"I want a second opinion",
|
|
2649
2664
|
"I measured from Perineum"
|
|
2650
|
-
],
|
|
2665
|
+
], bt = {
|
|
2651
2666
|
padding: "8px 20px",
|
|
2652
2667
|
borderRadius: 4,
|
|
2653
2668
|
fontSize: 14,
|
|
@@ -2694,7 +2709,7 @@ let __tla = (async () => {
|
|
|
2694
2709
|
zIndex: 9999,
|
|
2695
2710
|
fontFamily: "system-ui, sans-serif"
|
|
2696
2711
|
},
|
|
2697
|
-
children:
|
|
2712
|
+
children: y("div", {
|
|
2698
2713
|
style: {
|
|
2699
2714
|
backgroundColor: "#fff",
|
|
2700
2715
|
borderRadius: 12,
|
|
@@ -2702,7 +2717,7 @@ let __tla = (async () => {
|
|
|
2702
2717
|
boxShadow: "0 24px 38px 3px rgba(0,0,0,0.14)"
|
|
2703
2718
|
},
|
|
2704
2719
|
children: [
|
|
2705
|
-
|
|
2720
|
+
y("div", {
|
|
2706
2721
|
style: {
|
|
2707
2722
|
padding: "24px 24px 0"
|
|
2708
2723
|
},
|
|
@@ -2725,7 +2740,7 @@ let __tla = (async () => {
|
|
|
2725
2740
|
})
|
|
2726
2741
|
]
|
|
2727
2742
|
}),
|
|
2728
|
-
|
|
2743
|
+
y("div", {
|
|
2729
2744
|
style: {
|
|
2730
2745
|
padding: "20px 24px",
|
|
2731
2746
|
display: "flex",
|
|
@@ -2736,7 +2751,7 @@ let __tla = (async () => {
|
|
|
2736
2751
|
[
|
|
2737
2752
|
...br,
|
|
2738
2753
|
"Other"
|
|
2739
|
-
].map((f) =>
|
|
2754
|
+
].map((f) => y("label", {
|
|
2740
2755
|
style: {
|
|
2741
2756
|
display: "flex",
|
|
2742
2757
|
alignItems: "center",
|
|
@@ -2790,7 +2805,7 @@ let __tla = (async () => {
|
|
|
2790
2805
|
})
|
|
2791
2806
|
]
|
|
2792
2807
|
}),
|
|
2793
|
-
|
|
2808
|
+
y("div", {
|
|
2794
2809
|
style: {
|
|
2795
2810
|
display: "flex",
|
|
2796
2811
|
justifyContent: "flex-end",
|
|
@@ -2802,7 +2817,7 @@ let __tla = (async () => {
|
|
|
2802
2817
|
i("button", {
|
|
2803
2818
|
onClick: d,
|
|
2804
2819
|
style: {
|
|
2805
|
-
...
|
|
2820
|
+
...bt,
|
|
2806
2821
|
backgroundColor: "#fff",
|
|
2807
2822
|
border: "1px solid #ddd",
|
|
2808
2823
|
color: "#666"
|
|
@@ -2813,7 +2828,7 @@ let __tla = (async () => {
|
|
|
2813
2828
|
onClick: u,
|
|
2814
2829
|
disabled: !p,
|
|
2815
2830
|
style: {
|
|
2816
|
-
...
|
|
2831
|
+
...bt,
|
|
2817
2832
|
backgroundColor: p ? "rgb(12, 67, 173)" : "#e0e0e0",
|
|
2818
2833
|
border: "none",
|
|
2819
2834
|
color: p ? "#fff" : "#9e9e9e",
|
|
@@ -2838,7 +2853,7 @@ let __tla = (async () => {
|
|
|
2838
2853
|
zIndex: 9999,
|
|
2839
2854
|
fontFamily: "system-ui, sans-serif"
|
|
2840
2855
|
},
|
|
2841
|
-
children:
|
|
2856
|
+
children: y("div", {
|
|
2842
2857
|
style: {
|
|
2843
2858
|
backgroundColor: "#fff",
|
|
2844
2859
|
borderRadius: 8,
|
|
@@ -2864,7 +2879,7 @@ let __tla = (async () => {
|
|
|
2864
2879
|
},
|
|
2865
2880
|
children: "Your measurements will be submitted without comparing to the scan. Are you sure?"
|
|
2866
2881
|
}),
|
|
2867
|
-
|
|
2882
|
+
y("div", {
|
|
2868
2883
|
style: {
|
|
2869
2884
|
display: "flex",
|
|
2870
2885
|
justifyContent: "flex-end",
|
|
@@ -2874,7 +2889,7 @@ let __tla = (async () => {
|
|
|
2874
2889
|
i("button", {
|
|
2875
2890
|
onClick: r,
|
|
2876
2891
|
style: {
|
|
2877
|
-
...
|
|
2892
|
+
...bt,
|
|
2878
2893
|
backgroundColor: "#fff",
|
|
2879
2894
|
border: "1px solid #bdbdbd",
|
|
2880
2895
|
color: "#333"
|
|
@@ -2884,7 +2899,7 @@ let __tla = (async () => {
|
|
|
2884
2899
|
i("button", {
|
|
2885
2900
|
onClick: o,
|
|
2886
2901
|
style: {
|
|
2887
|
-
...
|
|
2902
|
+
...bt,
|
|
2888
2903
|
backgroundColor: "rgb(12, 67, 173)",
|
|
2889
2904
|
border: "none",
|
|
2890
2905
|
color: "#fff"
|
|
@@ -2902,13 +2917,13 @@ let __tla = (async () => {
|
|
|
2902
2917
|
if (s < 1) return null;
|
|
2903
2918
|
const l = 30, c = s / l, a = [];
|
|
2904
2919
|
for (let x = 0; x < l; x++) {
|
|
2905
|
-
const
|
|
2906
|
-
let b = 0,
|
|
2920
|
+
const w = r + x * c, A = r + (x + 1) * c;
|
|
2921
|
+
let b = 0, P = 0, S = 0, C = 0;
|
|
2907
2922
|
for (let z = 0; z < n.count; z++) {
|
|
2908
2923
|
const _ = n.getY(z);
|
|
2909
|
-
_ >=
|
|
2924
|
+
_ >= w && _ < A && (b += n.getX(z), P += _, S += n.getZ(z), C++);
|
|
2910
2925
|
}
|
|
2911
|
-
C > 20 && a.push(new M(b / C,
|
|
2926
|
+
C > 20 && a.push(new M(b / C, P / C, S / C));
|
|
2912
2927
|
}
|
|
2913
2928
|
if (a.length < 5) return null;
|
|
2914
2929
|
const o = new M();
|
|
@@ -2916,14 +2931,14 @@ let __tla = (async () => {
|
|
|
2916
2931
|
o.divideScalar(a.length);
|
|
2917
2932
|
let d = 0, p = 0, u = 0, f = 0, h = 0, v = 0;
|
|
2918
2933
|
for (const x of a) {
|
|
2919
|
-
const
|
|
2920
|
-
d +=
|
|
2934
|
+
const w = x.x - o.x, A = x.y - o.y, b = x.z - o.z;
|
|
2935
|
+
d += w * w, p += w * A, u += w * b, f += A * A, h += A * b, v += b * b;
|
|
2921
2936
|
}
|
|
2922
2937
|
let g = new M(0.01, 1, 0.01).normalize();
|
|
2923
2938
|
for (let x = 0; x < 30; x++) {
|
|
2924
|
-
const
|
|
2925
|
-
if (S < 1e-10 || (
|
|
2926
|
-
g =
|
|
2939
|
+
const w = d * g.x + p * g.y + u * g.z, A = p * g.x + f * g.y + h * g.z, b = u * g.x + h * g.y + v * g.z, P = new M(w, A, b), S = P.length();
|
|
2940
|
+
if (S < 1e-10 || (P.divideScalar(S), g.distanceTo(P) < 1e-8)) break;
|
|
2941
|
+
g = P;
|
|
2927
2942
|
}
|
|
2928
2943
|
return g.y < 0 && g.negate(), g;
|
|
2929
2944
|
}
|
|
@@ -2942,14 +2957,14 @@ let __tla = (async () => {
|
|
|
2942
2957
|
"#44cc44",
|
|
2943
2958
|
"#4488ff"
|
|
2944
2959
|
];
|
|
2945
|
-
function
|
|
2960
|
+
function Xn(e) {
|
|
2946
2961
|
const r = e.getAttribute("position"), t = r.count, n = new M();
|
|
2947
2962
|
for (let g = 0; g < t; g++) n.x += r.getX(g), n.y += r.getY(g), n.z += r.getZ(g);
|
|
2948
2963
|
n.divideScalar(t);
|
|
2949
2964
|
let s = 0, l = 0, c = 0, a = 0, o = 0, d = 0;
|
|
2950
2965
|
for (let g = 0; g < t; g++) {
|
|
2951
|
-
const x = r.getX(g) - n.x,
|
|
2952
|
-
s += x * x, l += x *
|
|
2966
|
+
const x = r.getX(g) - n.x, w = r.getY(g) - n.y, A = r.getZ(g) - n.z;
|
|
2967
|
+
s += x * x, l += x * w, c += x * A, a += w * w, o += w * A, d += A * A;
|
|
2953
2968
|
}
|
|
2954
2969
|
s /= t, l /= t, c /= t, a /= t, o /= t, d /= t;
|
|
2955
2970
|
const p = [], u = [], f = [
|
|
@@ -2970,19 +2985,19 @@ let __tla = (async () => {
|
|
|
2970
2985
|
]
|
|
2971
2986
|
];
|
|
2972
2987
|
for (let g = 0; g < 3; g++) {
|
|
2973
|
-
let x = new M(1 + g * 0.1, 1 - g * 0.1, 0.5 + g * 0.3).normalize(),
|
|
2988
|
+
let x = new M(1 + g * 0.1, 1 - g * 0.1, 0.5 + g * 0.3).normalize(), w = 0;
|
|
2974
2989
|
for (let A = 0; A < 100; A++) {
|
|
2975
|
-
const b = f[0][0] * x.x + f[0][1] * x.y + f[0][2] * x.z,
|
|
2976
|
-
if (
|
|
2977
|
-
if (C.divideScalar(
|
|
2990
|
+
const b = f[0][0] * x.x + f[0][1] * x.y + f[0][2] * x.z, P = f[1][0] * x.x + f[1][1] * x.y + f[1][2] * x.z, S = f[2][0] * x.x + f[2][1] * x.y + f[2][2] * x.z, C = new M(b, P, S);
|
|
2991
|
+
if (w = C.length(), w < 1e-12) break;
|
|
2992
|
+
if (C.divideScalar(w), x.distanceTo(C) < 1e-10) {
|
|
2978
2993
|
x = C;
|
|
2979
2994
|
break;
|
|
2980
2995
|
}
|
|
2981
2996
|
x = C;
|
|
2982
2997
|
}
|
|
2983
|
-
p.push(x.clone()), u.push(
|
|
2998
|
+
p.push(x.clone()), u.push(w);
|
|
2984
2999
|
for (let A = 0; A < 3; A++) for (let b = 0; b < 3; b++) {
|
|
2985
|
-
const
|
|
3000
|
+
const P = [
|
|
2986
3001
|
x.x,
|
|
2987
3002
|
x.y,
|
|
2988
3003
|
x.z
|
|
@@ -2991,7 +3006,7 @@ let __tla = (async () => {
|
|
|
2991
3006
|
x.y,
|
|
2992
3007
|
x.z
|
|
2993
3008
|
][b];
|
|
2994
|
-
f[A][b] -=
|
|
3009
|
+
f[A][b] -= w * P * S;
|
|
2995
3010
|
}
|
|
2996
3011
|
}
|
|
2997
3012
|
const h = new M();
|
|
@@ -3003,13 +3018,13 @@ let __tla = (async () => {
|
|
|
3003
3018
|
0
|
|
3004
3019
|
];
|
|
3005
3020
|
for (let g = 0; g < 3; g++) {
|
|
3006
|
-
let x = 1 / 0,
|
|
3021
|
+
let x = 1 / 0, w = -1 / 0;
|
|
3007
3022
|
const A = p[g];
|
|
3008
3023
|
for (let b = 0; b < t; b++) {
|
|
3009
|
-
const
|
|
3010
|
-
z < x && (x = z), z >
|
|
3024
|
+
const P = r.getX(b) - h.x, S = r.getY(b) - h.y, C = r.getZ(b) - h.z, z = P * A.x + S * A.y + C * A.z;
|
|
3025
|
+
z < x && (x = z), z > w && (w = z);
|
|
3011
3026
|
}
|
|
3012
|
-
v[g] = (
|
|
3027
|
+
v[g] = (w - x) / 2;
|
|
3013
3028
|
}
|
|
3014
3029
|
return {
|
|
3015
3030
|
axes: p,
|
|
@@ -3113,7 +3128,7 @@ let __tla = (async () => {
|
|
|
3113
3128
|
}, [
|
|
3114
3129
|
t
|
|
3115
3130
|
]), s = n < 1 ? "#44ff44" : n < 5 ? "#ffcc00" : "#ff4444";
|
|
3116
|
-
return
|
|
3131
|
+
return y("group", {
|
|
3117
3132
|
children: [
|
|
3118
3133
|
i(ye, {
|
|
3119
3134
|
points: [
|
|
@@ -3123,7 +3138,7 @@ let __tla = (async () => {
|
|
|
3123
3138
|
color: s,
|
|
3124
3139
|
lineWidth: 3
|
|
3125
3140
|
}),
|
|
3126
|
-
|
|
3141
|
+
y("mesh", {
|
|
3127
3142
|
position: e,
|
|
3128
3143
|
children: [
|
|
3129
3144
|
i("sphereGeometry", {
|
|
@@ -3138,7 +3153,7 @@ let __tla = (async () => {
|
|
|
3138
3153
|
})
|
|
3139
3154
|
]
|
|
3140
3155
|
}),
|
|
3141
|
-
|
|
3156
|
+
y("mesh", {
|
|
3142
3157
|
position: r,
|
|
3143
3158
|
children: [
|
|
3144
3159
|
i("sphereGeometry", {
|
|
@@ -3183,7 +3198,7 @@ let __tla = (async () => {
|
|
|
3183
3198
|
return i("group", {
|
|
3184
3199
|
children: c.map((a, o) => {
|
|
3185
3200
|
const d = (a.regionMin + a.regionMax) / 2, p = new M(0, d, 0), u = p.clone().addScaledVector(a.axis, l), f = p.clone().addScaledVector(a.axis, -l), h = o / Math.max(1, c.length - 1), v = a.angleDeg < 0.5 ? `hsl(${120 - h * 120}, 80%, 60%)` : `hsl(${40 - a.angleDeg * 2}, 90%, 55%)`;
|
|
3186
|
-
return
|
|
3201
|
+
return y("group", {
|
|
3187
3202
|
children: [
|
|
3188
3203
|
i(ye, {
|
|
3189
3204
|
points: [
|
|
@@ -3240,7 +3255,7 @@ let __tla = (async () => {
|
|
|
3240
3255
|
})
|
|
3241
3256
|
});
|
|
3242
3257
|
}
|
|
3243
|
-
function
|
|
3258
|
+
function Pr({ pca: e, modelSize: r }) {
|
|
3244
3259
|
const t = e.axes[0], n = r * 0.6, s = e.center.clone().addScaledVector(t, n), l = e.center.clone().addScaledVector(t, -n);
|
|
3245
3260
|
return i(ye, {
|
|
3246
3261
|
points: [
|
|
@@ -3254,20 +3269,20 @@ let __tla = (async () => {
|
|
|
3254
3269
|
gapSize: 2
|
|
3255
3270
|
});
|
|
3256
3271
|
}
|
|
3257
|
-
function
|
|
3272
|
+
function kr({ geometry: e, redY: r, greenY: t, modelSize: n, measurementGeometry: s }) {
|
|
3258
3273
|
const l = J(() => {
|
|
3259
|
-
const p = s ?? e, u =
|
|
3274
|
+
const p = s ?? e, u = Kt(p), f = new M(0, 1, 0), h = 5, g = t + 3 * 25.4, x = [];
|
|
3260
3275
|
for (let _ = r + h; _ < g; _ += h) {
|
|
3261
|
-
const B =
|
|
3276
|
+
const B = Xo(u, p, new M(0, _, 0), f);
|
|
3262
3277
|
B > 0 && x.push({
|
|
3263
3278
|
y: _,
|
|
3264
3279
|
circ: B
|
|
3265
3280
|
});
|
|
3266
3281
|
}
|
|
3267
3282
|
if (x.length < 5) return null;
|
|
3268
|
-
const
|
|
3269
|
-
if (
|
|
3270
|
-
const S =
|
|
3283
|
+
const w = t - r, A = r + w * 0.3, b = r + w * 0.7, P = x.filter((_) => _.y >= A && _.y <= b);
|
|
3284
|
+
if (P.length < 3) return null;
|
|
3285
|
+
const S = P.map((_) => _.circ).sort((_, B) => _ - B), C = S[Math.floor(S.length / 2)], z = Math.max(...x.map((_) => _.circ));
|
|
3271
3286
|
return {
|
|
3272
3287
|
circumferences: x,
|
|
3273
3288
|
baseline: C,
|
|
@@ -3280,7 +3295,7 @@ let __tla = (async () => {
|
|
|
3280
3295
|
]);
|
|
3281
3296
|
if (!l) return null;
|
|
3282
3297
|
const { circumferences: c, baseline: a, maxCirc: o } = l, d = n * 0.3 / o;
|
|
3283
|
-
return
|
|
3298
|
+
return y("group", {
|
|
3284
3299
|
children: [
|
|
3285
3300
|
c.map(({ y: p, circ: u }, f) => {
|
|
3286
3301
|
const h = u / a, v = h > 1.6 ? "#ff4444" : h > 1.3 ? "#ffcc00" : "#22cc66", g = u * d;
|
|
@@ -3297,7 +3312,7 @@ let __tla = (async () => {
|
|
|
3297
3312
|
}),
|
|
3298
3313
|
(() => {
|
|
3299
3314
|
const p = a * 1.6 * d, u = c[0].y, f = c[c.length - 1].y;
|
|
3300
|
-
return
|
|
3315
|
+
return y(Re, {
|
|
3301
3316
|
children: [
|
|
3302
3317
|
i(ye, {
|
|
3303
3318
|
points: [
|
|
@@ -3337,7 +3352,7 @@ let __tla = (async () => {
|
|
|
3337
3352
|
const n = e.colors[t] ?? "#888888", s = t === e.innerIdx;
|
|
3338
3353
|
r.computeBoundingBox();
|
|
3339
3354
|
const l = new M();
|
|
3340
|
-
return r.boundingBox.getCenter(l),
|
|
3355
|
+
return r.boundingBox.getCenter(l), y("group", {
|
|
3341
3356
|
children: [
|
|
3342
3357
|
i("mesh", {
|
|
3343
3358
|
geometry: r,
|
|
@@ -3425,7 +3440,7 @@ let __tla = (async () => {
|
|
|
3425
3440
|
});
|
|
3426
3441
|
}
|
|
3427
3442
|
function _r({ mesh: e, layers: r, landmarkPoints: t, componentDebug: n, aoData: s, aoGeometry: l, measurementGeometry: c }) {
|
|
3428
|
-
const a = e.geometry, o = J(() => a.getAttribute("position") ?
|
|
3443
|
+
const a = e.geometry, o = J(() => a.getAttribute("position") ? Xn(a) : null, [
|
|
3429
3444
|
a
|
|
3430
3445
|
]), d = J(() => !t || t.length < 2 ? null : {
|
|
3431
3446
|
red: new M(t[1].position.x, t[1].position.y, t[1].position.z),
|
|
@@ -3433,7 +3448,7 @@ let __tla = (async () => {
|
|
|
3433
3448
|
}, [
|
|
3434
3449
|
t
|
|
3435
3450
|
]);
|
|
3436
|
-
return
|
|
3451
|
+
return y("group", {
|
|
3437
3452
|
children: [
|
|
3438
3453
|
r.pcaAxes && o && i(Cr, {
|
|
3439
3454
|
pca: o
|
|
@@ -3441,7 +3456,7 @@ let __tla = (async () => {
|
|
|
3441
3456
|
r.obb && o && i(Ar, {
|
|
3442
3457
|
pca: o
|
|
3443
3458
|
}),
|
|
3444
|
-
r.obbAxis && o && i(
|
|
3459
|
+
r.obbAxis && o && i(Pr, {
|
|
3445
3460
|
pca: o,
|
|
3446
3461
|
modelSize: o.halfExtents[0] ? Math.max(...o.halfExtents) * 2 : 100
|
|
3447
3462
|
}),
|
|
@@ -3452,7 +3467,7 @@ let __tla = (async () => {
|
|
|
3452
3467
|
geometry: l ?? a,
|
|
3453
3468
|
aoData: s
|
|
3454
3469
|
}),
|
|
3455
|
-
r.circumferenceScan && d && i(
|
|
3470
|
+
r.circumferenceScan && d && i(kr, {
|
|
3456
3471
|
geometry: a,
|
|
3457
3472
|
redY: d.red.y,
|
|
3458
3473
|
greenY: d.green.y,
|
|
@@ -3492,7 +3507,7 @@ let __tla = (async () => {
|
|
|
3492
3507
|
function Rr({ mesh: e }) {
|
|
3493
3508
|
const r = e.geometry, t = J(() => {
|
|
3494
3509
|
if (!r.getAttribute("position")) return null;
|
|
3495
|
-
const l =
|
|
3510
|
+
const l = Xn(r), c = l.axes[0], a = l.halfExtents[0] * 1.3;
|
|
3496
3511
|
return {
|
|
3497
3512
|
axis: c,
|
|
3498
3513
|
center: l.center,
|
|
@@ -3519,7 +3534,7 @@ let __tla = (async () => {
|
|
|
3519
3534
|
renderOrder: 999
|
|
3520
3535
|
});
|
|
3521
3536
|
}
|
|
3522
|
-
const
|
|
3537
|
+
const Gn = [
|
|
3523
3538
|
{
|
|
3524
3539
|
key: "pcaAxes",
|
|
3525
3540
|
label: "PCA Axes (full mesh)",
|
|
@@ -3576,10 +3591,10 @@ let __tla = (async () => {
|
|
|
3576
3591
|
group: "Alignment"
|
|
3577
3592
|
}
|
|
3578
3593
|
], Wr = [
|
|
3579
|
-
...new Set(
|
|
3594
|
+
...new Set(Gn.map((e) => e.group))
|
|
3580
3595
|
];
|
|
3581
3596
|
function Ir({ layers: e, onToggleLayer: r, isDoubleShell: t }) {
|
|
3582
|
-
return
|
|
3597
|
+
return y("div", {
|
|
3583
3598
|
style: {
|
|
3584
3599
|
position: "absolute",
|
|
3585
3600
|
top: 16,
|
|
@@ -3608,8 +3623,8 @@ let __tla = (async () => {
|
|
|
3608
3623
|
children: "Debug Layers"
|
|
3609
3624
|
}),
|
|
3610
3625
|
Wr.map((n) => {
|
|
3611
|
-
const s =
|
|
3612
|
-
return s.length === 0 ? null :
|
|
3626
|
+
const s = Gn.filter((l) => l.group === n && !(l.hideWhenDoubleShell && t));
|
|
3627
|
+
return s.length === 0 ? null : y("div", {
|
|
3613
3628
|
children: [
|
|
3614
3629
|
i("div", {
|
|
3615
3630
|
style: {
|
|
@@ -3623,7 +3638,7 @@ let __tla = (async () => {
|
|
|
3623
3638
|
},
|
|
3624
3639
|
children: n
|
|
3625
3640
|
}),
|
|
3626
|
-
s.map(({ key: l, label: c, color: a }) =>
|
|
3641
|
+
s.map(({ key: l, label: c, color: a }) => y("label", {
|
|
3627
3642
|
style: {
|
|
3628
3643
|
display: "flex",
|
|
3629
3644
|
alignItems: "center",
|
|
@@ -3669,15 +3684,15 @@ let __tla = (async () => {
|
|
|
3669
3684
|
});
|
|
3670
3685
|
}
|
|
3671
3686
|
const Br = ({ config: e, spacingType: r, scanUrl: t, formMeasurements: n, onComplete: s, isDebugUser: l = false, onAnalyticsEvent: c, wasmModule: a, autoProcessOnTwoPoints: o = false }) => {
|
|
3672
|
-
const [d, p] = E(null), [u, f] = E(0), [h, v] = E(false), [g, x] = E(false), [
|
|
3687
|
+
const [d, p] = E(null), [u, f] = E(0), [h, v] = E(false), [g, x] = E(false), [w, A] = E(""), [b, P] = E("3D"), [S, C] = E(r === "AK" ? 2 : 1), [z, _] = E(false), [B, V] = E(null), [F, I] = E(r ?? null), [k, T] = E("cm"), [j, ee] = E(false), [ie, oe] = E(""), [q, re] = E(false), [K, he] = E(false), [te, D] = E(false), [O, Q] = E(false), [U, N] = E(null), [Y, fe] = E(null), [se, ge] = E(null), [ue, we] = E(false), [$, Pe] = E([]), [De, Ie] = E(null), [me, Me] = E(null), [zt, Mt] = E(null), [rt, qt] = E(null), [Kn, Ut] = E(false), [it, Jt] = E(null), [Ft, Le] = E(null), [We, Zn] = E(false), [Qt, qn] = E(vr), [Oe, en] = E("obj"), [Ae, Pt] = E(n), [He, kt] = E(true), [Ge, Ue] = E(false), [Lt, tn] = E(false), [st, lt] = E(false), Ye = de(false), [Un, nn] = E(false), [Dt, on] = E(() => {
|
|
3673
3688
|
try {
|
|
3674
3689
|
return localStorage.getItem("gm_helpTipDismissed") !== "1";
|
|
3675
3690
|
} catch {
|
|
3676
3691
|
return true;
|
|
3677
3692
|
}
|
|
3678
3693
|
});
|
|
3679
|
-
|
|
3680
|
-
if (!
|
|
3694
|
+
G(() => {
|
|
3695
|
+
if (!Dt) return;
|
|
3681
3696
|
const m = setTimeout(() => {
|
|
3682
3697
|
on(false);
|
|
3683
3698
|
try {
|
|
@@ -3687,76 +3702,76 @@ let __tla = (async () => {
|
|
|
3687
3702
|
}, 1e4);
|
|
3688
3703
|
return () => clearTimeout(m);
|
|
3689
3704
|
}, [
|
|
3690
|
-
|
|
3691
|
-
]),
|
|
3705
|
+
Dt
|
|
3706
|
+
]), G(() => {
|
|
3692
3707
|
if (!K) return;
|
|
3693
3708
|
const m = setTimeout(() => he(false), 5e3);
|
|
3694
3709
|
return () => clearTimeout(m);
|
|
3695
3710
|
}, [
|
|
3696
3711
|
K
|
|
3697
3712
|
]);
|
|
3698
|
-
const
|
|
3699
|
-
|
|
3700
|
-
if (!
|
|
3713
|
+
const _t = de(null), [Ve, Jn] = E(0);
|
|
3714
|
+
G(() => {
|
|
3715
|
+
if (!_t.current) return;
|
|
3701
3716
|
const m = new ResizeObserver((L) => {
|
|
3702
3717
|
for (const R of L) Jn(R.contentRect.width);
|
|
3703
3718
|
});
|
|
3704
|
-
return m.observe(
|
|
3719
|
+
return m.observe(_t.current), () => m.disconnect();
|
|
3705
3720
|
}, []);
|
|
3706
|
-
const [ve, Qn] = E(null), [eo, to] = E(void 0), [no, oo] = E(void 0), [ro, io] = E(void 0), [so, lo] = E(void 0), [rn] = E("#c8c8c8"), [ao] = E(1), [
|
|
3707
|
-
if (!
|
|
3721
|
+
const [ve, Qn] = E(null), [eo, to] = E(void 0), [no, oo] = E(void 0), [ro, io] = E(void 0), [so, lo] = E(void 0), [rn] = E("#c8c8c8"), [ao] = E(1), [Be, co] = E(false), [Rt, sn] = E([]), at = de(null), Ne = de(null), ct = de(false), fo = de(null), Wt = de(null), It = de(null), Je = ce(async (m) => {
|
|
3722
|
+
if (!It.current) return;
|
|
3708
3723
|
const L = (m == null ? void 0 : m.restoreView) ?? true;
|
|
3709
3724
|
try {
|
|
3710
|
-
const R =
|
|
3725
|
+
const R = It.current, W = () => {
|
|
3711
3726
|
const ne = R.querySelector("canvas");
|
|
3712
3727
|
if (!ne) return;
|
|
3713
|
-
const ae = R.getBoundingClientRect(), Se = ne.width,
|
|
3714
|
-
|
|
3715
|
-
const Ce =
|
|
3728
|
+
const ae = R.getBoundingClientRect(), Se = ne.width, $e = ne.height, Fe = Se / ae.width, tt = $e / ae.height, pt = document.createElement("canvas");
|
|
3729
|
+
pt.width = Se, pt.height = $e;
|
|
3730
|
+
const Ce = pt.getContext("2d");
|
|
3716
3731
|
return Ce.drawImage(ne, 0, 0), R.querySelectorAll("[style*='pointer-events']").forEach((wo) => {
|
|
3717
3732
|
const mn = wo;
|
|
3718
3733
|
if (mn.hasAttribute("data-finalizing-overlay")) return;
|
|
3719
3734
|
const xn = mn.querySelectorAll("div[style*='background']");
|
|
3720
|
-
xn.length !== 0 && xn.forEach((
|
|
3735
|
+
xn.length !== 0 && xn.forEach((Ke) => {
|
|
3721
3736
|
var _a;
|
|
3722
|
-
const _e =
|
|
3737
|
+
const _e = Ke.getBoundingClientRect();
|
|
3723
3738
|
if (_e.width === 0 || _e.height === 0) return;
|
|
3724
|
-
let
|
|
3725
|
-
for (;
|
|
3726
|
-
const
|
|
3727
|
-
if (
|
|
3728
|
-
|
|
3739
|
+
let Nt = 0, nt = Ke;
|
|
3740
|
+
for (; nt && nt !== R; ) {
|
|
3741
|
+
const mt = (nt.style.transform || "").match(/rotate\((-?\d+)deg\)/);
|
|
3742
|
+
if (mt) {
|
|
3743
|
+
Nt = parseFloat(mt[1]);
|
|
3729
3744
|
break;
|
|
3730
3745
|
}
|
|
3731
|
-
|
|
3746
|
+
nt = nt.parentElement;
|
|
3732
3747
|
}
|
|
3733
|
-
const bn = (_e.left + _e.width / 2 - ae.left) * Fe, yn = (_e.top + _e.height / 2 - ae.top) *
|
|
3734
|
-
Ce.save(), Ce.translate(bn, yn),
|
|
3735
|
-
const vo =
|
|
3748
|
+
const bn = (_e.left + _e.width / 2 - ae.left) * Fe, yn = (_e.top + _e.height / 2 - ae.top) * tt, ht = Math.abs(Nt) > 1, wn = (ht ? _e.height : _e.width) * Fe, vn = (ht ? _e.width : _e.height) * tt;
|
|
3749
|
+
Ce.save(), Ce.translate(bn, yn), ht && Ce.rotate(Nt * Math.PI / 180);
|
|
3750
|
+
const vo = Ke.style.backgroundColor || "rgba(0,0,0,0.75)";
|
|
3736
3751
|
Ce.fillStyle = vo;
|
|
3737
3752
|
const So = 4 * Fe;
|
|
3738
3753
|
Ce.beginPath(), Ce.roundRect(-wn / 2, -vn / 2, wn, vn, So), Ce.fill();
|
|
3739
|
-
const Sn = ((_a =
|
|
3754
|
+
const Sn = ((_a = Ke.textContent) == null ? void 0 : _a.trim()) || "";
|
|
3740
3755
|
if (Sn) {
|
|
3741
|
-
const
|
|
3742
|
-
Ce.font = `${
|
|
3743
|
-
const Cn =
|
|
3744
|
-
Cn.length > 0 && !
|
|
3745
|
-
const
|
|
3746
|
-
if (
|
|
3747
|
-
const Co = (
|
|
3748
|
-
Ce.font = `${Xt.fontWeight || "normal"} ${zo}px monospace`, Ce.fillStyle = Xt.color || "#fff", Ce.fillText(
|
|
3756
|
+
const gt = window.getComputedStyle(Ke), mt = parseFloat(gt.fontSize || "14") * tt;
|
|
3757
|
+
Ce.font = `${gt.fontWeight || "normal"} ${mt}px monospace`, Ce.fillStyle = gt.color || "#fff", Ce.textAlign = "center", Ce.textBaseline = "middle";
|
|
3758
|
+
const Cn = Ke.querySelectorAll("span");
|
|
3759
|
+
Cn.length > 0 && !ht ? Cn.forEach((jt) => {
|
|
3760
|
+
const ot = jt.getBoundingClientRect();
|
|
3761
|
+
if (ot.width === 0) return;
|
|
3762
|
+
const Co = (ot.left + ot.width / 2 - ae.left) * Fe - bn, Ao = (ot.top + ot.height / 2 - ae.top) * tt - yn, Xt = window.getComputedStyle(jt), zo = parseFloat(Xt.fontSize) * tt;
|
|
3763
|
+
Ce.font = `${Xt.fontWeight || "normal"} ${zo}px monospace`, Ce.fillStyle = Xt.color || "#fff", Ce.fillText(jt.textContent || "", Co, Ao);
|
|
3749
3764
|
}) : Ce.fillText(Sn, 0, 0);
|
|
3750
3765
|
}
|
|
3751
3766
|
Ce.restore();
|
|
3752
3767
|
});
|
|
3753
|
-
}),
|
|
3768
|
+
}), pt.toDataURL("image/png");
|
|
3754
3769
|
};
|
|
3755
|
-
|
|
3770
|
+
Wt.current && Wt.current(), await new Promise((ne) => requestAnimationFrame(() => requestAnimationFrame(ne)));
|
|
3756
3771
|
const pe = W();
|
|
3757
|
-
|
|
3772
|
+
P("2D"), await new Promise((ne) => setTimeout(ne, 150)), await new Promise((ne) => requestAnimationFrame(() => requestAnimationFrame(ne)));
|
|
3758
3773
|
const H = W();
|
|
3759
|
-
return L &&
|
|
3774
|
+
return L && P("3D"), !pe || !H ? void 0 : {
|
|
3760
3775
|
frontal_view_png: pe,
|
|
3761
3776
|
side_view_png: H
|
|
3762
3777
|
};
|
|
@@ -3769,75 +3784,75 @@ let __tla = (async () => {
|
|
|
3769
3784
|
...W.slice(-200),
|
|
3770
3785
|
`[${R}] ${m}`
|
|
3771
3786
|
]);
|
|
3772
|
-
}, []), { landmarkPoints:
|
|
3773
|
-
|
|
3774
|
-
|
|
3787
|
+
}, []), { landmarkPoints: X, clearLandmarkPoints: uo, addLandmarkPoint: ln, removeLandmarkPoint: an, updateLandmarkPositions: cn, setAligned: dn, isAligned: le, setCut: fn, isCut: Bt, reset: dt } = Zt();
|
|
3788
|
+
G(() => {
|
|
3789
|
+
dt();
|
|
3775
3790
|
}, [
|
|
3776
|
-
|
|
3791
|
+
dt
|
|
3777
3792
|
]);
|
|
3778
|
-
const
|
|
3779
|
-
|
|
3780
|
-
if (!l ||
|
|
3781
|
-
const m =
|
|
3782
|
-
ze(`LANDMARK[${
|
|
3793
|
+
const ft = S * wt;
|
|
3794
|
+
G(() => {
|
|
3795
|
+
if (!l || X.length === 0) return;
|
|
3796
|
+
const m = X[X.length - 1];
|
|
3797
|
+
ze(`LANDMARK[${X.length - 1}]: placed at (${m.position.x.toFixed(1)}, ${m.position.y.toFixed(1)}, ${m.position.z.toFixed(1)}) face=${m.faceIndex}`);
|
|
3783
3798
|
}, [
|
|
3784
|
-
|
|
3799
|
+
X.length,
|
|
3785
3800
|
l,
|
|
3786
3801
|
ze
|
|
3787
|
-
]),
|
|
3802
|
+
]), G(() => {
|
|
3788
3803
|
l && le && ze("STATE: mesh aligned");
|
|
3789
3804
|
}, [
|
|
3790
3805
|
le,
|
|
3791
3806
|
l,
|
|
3792
3807
|
ze
|
|
3793
|
-
]),
|
|
3794
|
-
l &&
|
|
3808
|
+
]), G(() => {
|
|
3809
|
+
l && Bt && ze("STATE: mesh cut");
|
|
3795
3810
|
}, [
|
|
3796
|
-
|
|
3811
|
+
Bt,
|
|
3797
3812
|
l,
|
|
3798
3813
|
ze
|
|
3799
|
-
]),
|
|
3800
|
-
|
|
3814
|
+
]), G(() => {
|
|
3815
|
+
at.current && (at.current.scrollTop = at.current.scrollHeight);
|
|
3801
3816
|
}, [
|
|
3802
|
-
|
|
3817
|
+
Rt
|
|
3803
3818
|
]);
|
|
3804
|
-
const
|
|
3819
|
+
const Ee = J(() => se ? new Z.Mesh(se) : null, [
|
|
3805
3820
|
se
|
|
3806
3821
|
]);
|
|
3807
|
-
|
|
3822
|
+
G(() => () => {
|
|
3808
3823
|
d && d.geometry.dispose();
|
|
3809
3824
|
}, [
|
|
3810
3825
|
d
|
|
3811
|
-
]),
|
|
3826
|
+
]), G(() => () => {
|
|
3812
3827
|
se && se.dispose();
|
|
3813
3828
|
}, [
|
|
3814
3829
|
se
|
|
3815
|
-
]),
|
|
3830
|
+
]), G(() => () => {
|
|
3816
3831
|
Y && Y.dispose();
|
|
3817
3832
|
}, [
|
|
3818
3833
|
Y
|
|
3819
|
-
]),
|
|
3834
|
+
]), G(() => () => {
|
|
3820
3835
|
B && B.geometry.dispose();
|
|
3821
3836
|
}, [
|
|
3822
3837
|
B
|
|
3823
|
-
]),
|
|
3838
|
+
]), G(() => {
|
|
3824
3839
|
n && Pt(n);
|
|
3825
3840
|
}, [
|
|
3826
3841
|
n
|
|
3827
|
-
]),
|
|
3842
|
+
]), G(() => {
|
|
3828
3843
|
n || Pt(void 0);
|
|
3829
3844
|
}, [
|
|
3830
3845
|
S
|
|
3831
3846
|
]);
|
|
3832
|
-
const
|
|
3833
|
-
|
|
3834
|
-
if (!le || $.length === 0 ||
|
|
3835
|
-
|
|
3836
|
-
const m =
|
|
3847
|
+
const ut = de(false);
|
|
3848
|
+
G(() => {
|
|
3849
|
+
if (!le || $.length === 0 || ut.current || !c) return;
|
|
3850
|
+
ut.current = true;
|
|
3851
|
+
const m = X.length >= 3 ? Math.abs(X[2].position.y - X[0].position.y) : null;
|
|
3837
3852
|
c("dimensions_calculated", {
|
|
3838
3853
|
spacing_type: F,
|
|
3839
3854
|
source_unit: "mm",
|
|
3840
|
-
file_format:
|
|
3855
|
+
file_format: Oe,
|
|
3841
3856
|
measurement_source: "scan_derived",
|
|
3842
3857
|
is_double_wall: te,
|
|
3843
3858
|
is_unit_converted: false,
|
|
@@ -3852,12 +3867,12 @@ let __tla = (async () => {
|
|
|
3852
3867
|
}, [
|
|
3853
3868
|
le,
|
|
3854
3869
|
$
|
|
3855
|
-
]),
|
|
3856
|
-
a !== void 0 && (
|
|
3870
|
+
]), G(() => {
|
|
3871
|
+
a !== void 0 && (Ne.current = a), a !== void 0 && co(true);
|
|
3857
3872
|
}, [
|
|
3858
3873
|
a
|
|
3859
3874
|
]);
|
|
3860
|
-
const
|
|
3875
|
+
const Qe = ce((m, L) => {
|
|
3861
3876
|
m.computeBoundingBox();
|
|
3862
3877
|
const R = m.boundingBox, W = new M();
|
|
3863
3878
|
R.getCenter(W), m.translate(-W.x, -W.y, -W.z), m.computeBoundingBox();
|
|
@@ -3867,44 +3882,44 @@ let __tla = (async () => {
|
|
|
3867
3882
|
color: 8947848,
|
|
3868
3883
|
side: Z.DoubleSide
|
|
3869
3884
|
}));
|
|
3870
|
-
p(ne), re(L), he(true), Q(false),
|
|
3871
|
-
}, []),
|
|
3885
|
+
p(ne), re(L), he(true), Q(false), ct.current = false;
|
|
3886
|
+
}, []), Te = ce(async (m, L) => {
|
|
3872
3887
|
Le(null);
|
|
3873
3888
|
const R = L.toLowerCase(), W = R.endsWith(".stl");
|
|
3874
3889
|
if (!R.endsWith(".obj") && !W) {
|
|
3875
3890
|
Le("Unsupported file format. Please use OBJ or STL.");
|
|
3876
3891
|
return;
|
|
3877
3892
|
}
|
|
3878
|
-
|
|
3893
|
+
en(W ? "stl" : "obj"), x(true), A("Processing file..."), ze(`FILE_LOAD: ${L} (${W ? "STL" : "OBJ"})`);
|
|
3879
3894
|
try {
|
|
3880
3895
|
let H;
|
|
3881
3896
|
if (W) if (A("Converting STL..."), m instanceof ArrayBuffer) {
|
|
3882
3897
|
const Se = new Blob([
|
|
3883
3898
|
m
|
|
3884
|
-
]),
|
|
3899
|
+
]), $e = new File([
|
|
3885
3900
|
Se
|
|
3886
3901
|
], L);
|
|
3887
|
-
H = await
|
|
3902
|
+
H = await Gt($e);
|
|
3888
3903
|
} else {
|
|
3889
3904
|
const Se = new Blob([
|
|
3890
3905
|
m
|
|
3891
|
-
]),
|
|
3906
|
+
]), $e = new File([
|
|
3892
3907
|
Se
|
|
3893
3908
|
], L);
|
|
3894
|
-
H = await
|
|
3909
|
+
H = await Gt($e);
|
|
3895
3910
|
}
|
|
3896
3911
|
else H = typeof m == "string" ? m : new TextDecoder().decode(m);
|
|
3897
|
-
const ne = performance.now(), ae =
|
|
3912
|
+
const ne = performance.now(), ae = Ne.current ? await Ho(H, Ne.current, (Se) => {
|
|
3898
3913
|
A(Se), ze(`PREPROCESS: ${Se}`);
|
|
3899
3914
|
}) : null;
|
|
3900
|
-
if (ae) ze(`PREPROCESS: done in ${(performance.now() - ne).toFixed(0)}ms \u2014 unit=${ae.detectedUnit}, scaled=${ae.wasScaled}`), e.showAmputationModal && !r ? (V(ae), _(true)) :
|
|
3915
|
+
if (ae) ze(`PREPROCESS: done in ${(performance.now() - ne).toFixed(0)}ms \u2014 unit=${ae.detectedUnit}, scaled=${ae.wasScaled}`), e.showAmputationModal && !r ? (V(ae), _(true)) : Qe(ae.geometry, ae.wasScaled);
|
|
3901
3916
|
else {
|
|
3902
3917
|
A("Using fallback loader...");
|
|
3903
3918
|
const Se = Vo(H);
|
|
3904
3919
|
Se ? e.showAmputationModal && !r ? (V({
|
|
3905
3920
|
geometry: Se,
|
|
3906
3921
|
wasScaled: false
|
|
3907
|
-
}), _(true)) :
|
|
3922
|
+
}), _(true)) : Qe(Se, false) : Le("Failed to parse the mesh.");
|
|
3908
3923
|
}
|
|
3909
3924
|
} catch (H) {
|
|
3910
3925
|
Le(H instanceof Error ? H.message : "Failed to process the mesh file.");
|
|
@@ -3912,13 +3927,13 @@ let __tla = (async () => {
|
|
|
3912
3927
|
x(false), A("");
|
|
3913
3928
|
}
|
|
3914
3929
|
}, [
|
|
3915
|
-
|
|
3930
|
+
Be,
|
|
3916
3931
|
e.showAmputationModal,
|
|
3917
3932
|
r,
|
|
3918
|
-
|
|
3933
|
+
Qe
|
|
3919
3934
|
]);
|
|
3920
|
-
|
|
3921
|
-
if (!t || !
|
|
3935
|
+
G(() => {
|
|
3936
|
+
if (!t || !Be) return;
|
|
3922
3937
|
(async () => {
|
|
3923
3938
|
x(true), A("Loading scan...");
|
|
3924
3939
|
try {
|
|
@@ -3927,10 +3942,10 @@ let __tla = (async () => {
|
|
|
3927
3942
|
const W = new URL(t).pathname.split("/").pop() || "scan.obj";
|
|
3928
3943
|
if (W.toLowerCase().endsWith(".stl")) {
|
|
3929
3944
|
const H = await L.arrayBuffer();
|
|
3930
|
-
await
|
|
3945
|
+
await Te(H, W);
|
|
3931
3946
|
} else {
|
|
3932
3947
|
const H = await L.text();
|
|
3933
|
-
await
|
|
3948
|
+
await Te(H, W);
|
|
3934
3949
|
}
|
|
3935
3950
|
} catch (L) {
|
|
3936
3951
|
Le(L instanceof Error ? L.message : "Failed to load scan from URL."), x(false), A("");
|
|
@@ -3938,14 +3953,14 @@ let __tla = (async () => {
|
|
|
3938
3953
|
})();
|
|
3939
3954
|
}, [
|
|
3940
3955
|
t,
|
|
3941
|
-
|
|
3956
|
+
Be
|
|
3942
3957
|
]);
|
|
3943
3958
|
const po = ce((m) => {
|
|
3944
3959
|
m.preventDefault(), v(true);
|
|
3945
3960
|
}, []), ho = ce((m) => {
|
|
3946
3961
|
m.preventDefault(), v(false);
|
|
3947
3962
|
}, []), go = ce(async (m) => {
|
|
3948
|
-
if (m.preventDefault(), v(false), !
|
|
3963
|
+
if (m.preventDefault(), v(false), !Be) {
|
|
3949
3964
|
Le("WASM module is still loading. Please wait.");
|
|
3950
3965
|
return;
|
|
3951
3966
|
}
|
|
@@ -3957,36 +3972,36 @@ let __tla = (async () => {
|
|
|
3957
3972
|
return;
|
|
3958
3973
|
}
|
|
3959
3974
|
if (R.endsWith(".stl")) {
|
|
3960
|
-
|
|
3975
|
+
en("stl"), x(true), A("Converting STL...");
|
|
3961
3976
|
try {
|
|
3962
|
-
const W = await
|
|
3963
|
-
await
|
|
3977
|
+
const W = await Gt(L);
|
|
3978
|
+
await Te(W, L.name.replace(/\.stl$/i, ".obj"));
|
|
3964
3979
|
} catch (W) {
|
|
3965
3980
|
Le(W instanceof Error ? W.message : "Failed to process STL file."), x(false), A("");
|
|
3966
3981
|
}
|
|
3967
3982
|
} else {
|
|
3968
3983
|
const W = await L.text();
|
|
3969
|
-
await
|
|
3984
|
+
await Te(W, L.name);
|
|
3970
3985
|
}
|
|
3971
3986
|
}, [
|
|
3972
|
-
|
|
3973
|
-
|
|
3987
|
+
Be,
|
|
3988
|
+
Te
|
|
3974
3989
|
]), mo = ce((m) => {
|
|
3975
|
-
I(m), C(m === "AK" ? 2 : 1), _(false), B && (
|
|
3990
|
+
I(m), C(m === "AK" ? 2 : 1), _(false), B && (Qe(B.geometry, B.wasScaled), V(null)), c == null ? void 0 : c("file_loaded", {
|
|
3976
3991
|
spacing_type: m,
|
|
3977
|
-
file_format:
|
|
3992
|
+
file_format: Oe,
|
|
3978
3993
|
is_double_wall: false
|
|
3979
3994
|
});
|
|
3980
3995
|
}, [
|
|
3981
3996
|
B,
|
|
3982
|
-
|
|
3997
|
+
Qe,
|
|
3983
3998
|
c,
|
|
3984
|
-
|
|
3999
|
+
Oe
|
|
3985
4000
|
]);
|
|
3986
|
-
|
|
3987
|
-
if (!d ||
|
|
3988
|
-
|
|
3989
|
-
const m =
|
|
4001
|
+
G(() => {
|
|
4002
|
+
if (!d || X.length !== 1 || !Ne.current || ct.current) return;
|
|
4003
|
+
ct.current = true;
|
|
4004
|
+
const m = X[0], L = Ne.current, R = d.geometry, { positions: W, indices: pe } = vt(R), H = new Float32Array([
|
|
3990
4005
|
m.position.x,
|
|
3991
4006
|
m.position.y,
|
|
3992
4007
|
m.position.z
|
|
@@ -3994,20 +4009,20 @@ let __tla = (async () => {
|
|
|
3994
4009
|
ze(`SHELL_DETECT: ${Se ? "DOUBLE" : "SINGLE"} \u2014 ${ae}`), Se && (D(true), we(true), ze(`SHELL_DETECT: double shell, thickness=${ne.thickness().toFixed(1)}mm`));
|
|
3995
4010
|
}, [
|
|
3996
4011
|
d,
|
|
3997
|
-
|
|
4012
|
+
X,
|
|
3998
4013
|
ze
|
|
3999
4014
|
]);
|
|
4000
|
-
const
|
|
4001
|
-
if (!d ||
|
|
4015
|
+
const Et = ce(() => {
|
|
4016
|
+
if (!d || X.length < 2) return;
|
|
4002
4017
|
ee(true), oe("Please wait..."), ze("PIPELINE: starting processing pipeline...");
|
|
4003
4018
|
const m = performance.now();
|
|
4004
4019
|
setTimeout(() => {
|
|
4005
4020
|
const L = [
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
...
|
|
4021
|
+
X[1],
|
|
4022
|
+
X[0],
|
|
4023
|
+
...X.slice(2)
|
|
4009
4024
|
];
|
|
4010
|
-
Yo(d, L,
|
|
4025
|
+
Yo(d, L, wt, {
|
|
4011
4026
|
onStatus: (R) => {
|
|
4012
4027
|
oe(R), ze(`PIPELINE: ${R}`);
|
|
4013
4028
|
},
|
|
@@ -4024,9 +4039,9 @@ let __tla = (async () => {
|
|
|
4024
4039
|
setAligned: dn,
|
|
4025
4040
|
setCut: fn,
|
|
4026
4041
|
setModelSize: f,
|
|
4027
|
-
setOriginalEndY:
|
|
4042
|
+
setOriginalEndY: qt,
|
|
4028
4043
|
setAdjustedStartY: Me,
|
|
4029
|
-
setAdjustedEndY:
|
|
4044
|
+
setAdjustedEndY: Mt,
|
|
4030
4045
|
setError: Le,
|
|
4031
4046
|
setDoubleShell: (R) => {
|
|
4032
4047
|
D(R), we(true);
|
|
@@ -4037,74 +4052,74 @@ let __tla = (async () => {
|
|
|
4037
4052
|
setInnerShellExtracted: Q,
|
|
4038
4053
|
setMeasurementGeometry: ge,
|
|
4039
4054
|
setWasmSlices: Ie,
|
|
4040
|
-
wasmModule:
|
|
4041
|
-
}), ze(`PIPELINE: completed in ${(performance.now() - m).toFixed(0)}ms`),
|
|
4055
|
+
wasmModule: Ne.current ?? void 0
|
|
4056
|
+
}), ze(`PIPELINE: completed in ${(performance.now() - m).toFixed(0)}ms`), ut.current = false, ee(false);
|
|
4042
4057
|
}, 50);
|
|
4043
4058
|
}, [
|
|
4044
4059
|
d,
|
|
4045
|
-
|
|
4060
|
+
X,
|
|
4046
4061
|
cn,
|
|
4047
4062
|
dn,
|
|
4048
4063
|
ln,
|
|
4049
4064
|
an,
|
|
4050
4065
|
fn,
|
|
4051
4066
|
O
|
|
4052
|
-
]),
|
|
4053
|
-
|
|
4054
|
-
o && (
|
|
4067
|
+
]), Tt = de(false);
|
|
4068
|
+
G(() => {
|
|
4069
|
+
o && (Tt.current || !d || le || j || X.length < 2 || (Tt.current = true, Et()));
|
|
4055
4070
|
}, [
|
|
4056
4071
|
o,
|
|
4057
4072
|
d,
|
|
4058
|
-
|
|
4073
|
+
X.length,
|
|
4059
4074
|
le,
|
|
4060
4075
|
j,
|
|
4061
|
-
|
|
4062
|
-
]),
|
|
4063
|
-
|
|
4076
|
+
Et
|
|
4077
|
+
]), G(() => {
|
|
4078
|
+
X.length < 2 && (Tt.current = false);
|
|
4064
4079
|
}, [
|
|
4065
|
-
|
|
4080
|
+
X.length
|
|
4066
4081
|
]);
|
|
4067
|
-
const
|
|
4068
|
-
if (
|
|
4082
|
+
const $t = de(false), xo = ce(async () => {
|
|
4083
|
+
if (dt(), Pe([]), Ie(null), ge(null), Me(null), Mt(null), Jt(null), qt(null), Ue(false), tn(false), kt(true), D(false), Q(false), ct.current = false, $t.current = false, ut.current = false, P("3D"), t && Be) {
|
|
4069
4084
|
p(null);
|
|
4070
4085
|
try {
|
|
4071
4086
|
const m = await fetch(t);
|
|
4072
4087
|
if (!m.ok) throw new Error(`Failed to download scan: ${m.status}`);
|
|
4073
4088
|
const R = new URL(t).pathname.split("/").pop() || "scan.obj";
|
|
4074
|
-
R.toLowerCase().endsWith(".stl") ? await
|
|
4089
|
+
R.toLowerCase().endsWith(".stl") ? await Te(await m.arrayBuffer(), R) : await Te(await m.text(), R);
|
|
4075
4090
|
} catch (m) {
|
|
4076
4091
|
Le(m instanceof Error ? m.message : "Failed to reload scan.");
|
|
4077
4092
|
}
|
|
4078
4093
|
}
|
|
4079
4094
|
}, [
|
|
4080
4095
|
t,
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4096
|
+
Be,
|
|
4097
|
+
Te,
|
|
4098
|
+
dt
|
|
4084
4099
|
]);
|
|
4085
|
-
|
|
4086
|
-
le && $.length > 0 &&
|
|
4100
|
+
G(() => {
|
|
4101
|
+
le && $.length > 0 && !$t.current && ($t.current = true, Ue(true));
|
|
4087
4102
|
}, [
|
|
4088
4103
|
le,
|
|
4089
4104
|
$.length
|
|
4090
4105
|
]);
|
|
4091
|
-
const { scanTransverseML:
|
|
4092
|
-
if (!d || !le ||
|
|
4106
|
+
const { scanTransverseML: Ot, scanTransverseAP: Ht } = J(() => {
|
|
4107
|
+
if (!d || !le || X.length < 1) return {
|
|
4093
4108
|
scanTransverseML: 0,
|
|
4094
4109
|
scanTransverseAP: 0
|
|
4095
4110
|
};
|
|
4096
4111
|
try {
|
|
4097
|
-
const m = (
|
|
4112
|
+
const m = (Ee ?? d).geometry, L = X[0].position.y, R = Kt(m), W = je(R, m, L);
|
|
4098
4113
|
if (W.linePoints.length < 2) return {
|
|
4099
4114
|
scanTransverseML: 0,
|
|
4100
4115
|
scanTransverseAP: 0
|
|
4101
4116
|
};
|
|
4102
4117
|
let pe = W.linePoints[0], H = W.linePoints[0], ne = W.linePoints[0], ae = W.linePoints[0];
|
|
4103
4118
|
for (const Fe of W.linePoints) Fe.x < pe.x && (pe = Fe), Fe.x > H.x && (H = Fe), Fe.z < ne.z && (ne = Fe), Fe.z > ae.z && (ae = Fe);
|
|
4104
|
-
const Se = new M(pe.x, L, pe.z).distanceTo(new M(H.x, L, H.z)),
|
|
4119
|
+
const Se = new M(pe.x, L, pe.z).distanceTo(new M(H.x, L, H.z)), $e = new M(ne.x, L, ne.z).distanceTo(new M(ae.x, L, ae.z));
|
|
4105
4120
|
return {
|
|
4106
4121
|
scanTransverseML: Se,
|
|
4107
|
-
scanTransverseAP:
|
|
4122
|
+
scanTransverseAP: $e
|
|
4108
4123
|
};
|
|
4109
4124
|
} catch {
|
|
4110
4125
|
return {
|
|
@@ -4114,30 +4129,30 @@ let __tla = (async () => {
|
|
|
4114
4129
|
}
|
|
4115
4130
|
}, [
|
|
4116
4131
|
d,
|
|
4117
|
-
|
|
4132
|
+
Ee,
|
|
4118
4133
|
le,
|
|
4119
|
-
|
|
4120
|
-
]),
|
|
4134
|
+
X
|
|
4135
|
+
]), et = J(() => {
|
|
4121
4136
|
var _a;
|
|
4122
|
-
if (!d ||
|
|
4137
|
+
if (!d || X.length < 1) return 0;
|
|
4123
4138
|
const m = d.geometry;
|
|
4124
4139
|
m.computeBoundingBox();
|
|
4125
|
-
const L = ((_a = m.boundingBox) == null ? void 0 : _a.min.y) ?? 0, R =
|
|
4126
|
-
if (te &&
|
|
4127
|
-
const W = Math.abs(R -
|
|
4140
|
+
const L = ((_a = m.boundingBox) == null ? void 0 : _a.min.y) ?? 0, R = X[0].position.y;
|
|
4141
|
+
if (te && X.length >= 3) {
|
|
4142
|
+
const W = Math.abs(R - X[2].position.y);
|
|
4128
4143
|
if (W > 0.5) return W;
|
|
4129
4144
|
}
|
|
4130
4145
|
return Math.abs(R - L);
|
|
4131
4146
|
}, [
|
|
4132
4147
|
d,
|
|
4133
|
-
|
|
4148
|
+
X,
|
|
4134
4149
|
te
|
|
4135
4150
|
]), bo = ce((m) => {
|
|
4136
|
-
Qn(m), Pt(m.circumferences),
|
|
4151
|
+
Qn(m), Pt(m.circumferences), kt(true), tn(true), Ue(false);
|
|
4137
4152
|
}, []), xe = (m) => m == null ? m : +(m / 10).toFixed(2), un = ce(async (m) => {
|
|
4138
|
-
if (!s ||
|
|
4139
|
-
|
|
4140
|
-
const L = d ? await
|
|
4153
|
+
if (!s || Ye.current) return;
|
|
4154
|
+
Ye.current = true, Ue(false), nn(false), lt(true), await new Promise((R) => requestAnimationFrame(() => requestAnimationFrame(() => R())));
|
|
4155
|
+
const L = d ? await Je({
|
|
4141
4156
|
restoreView: false
|
|
4142
4157
|
}).catch(() => {
|
|
4143
4158
|
}) : void 0;
|
|
@@ -4145,7 +4160,7 @@ let __tla = (async () => {
|
|
|
4145
4160
|
s({
|
|
4146
4161
|
spacingType: F ?? "BK",
|
|
4147
4162
|
sourceUnit: "cm",
|
|
4148
|
-
fileFormat:
|
|
4163
|
+
fileFormat: Oe,
|
|
4149
4164
|
measurementSource: "form_provided",
|
|
4150
4165
|
isDoubleWall: te,
|
|
4151
4166
|
isUnitConverted: false,
|
|
@@ -4155,7 +4170,7 @@ let __tla = (async () => {
|
|
|
4155
4170
|
originalValue: xe(R.originalValue),
|
|
4156
4171
|
modifiedValue: R.modifiedValue == null ? null : xe(R.modifiedValue)
|
|
4157
4172
|
})),
|
|
4158
|
-
frontalHeight: xe(
|
|
4173
|
+
frontalHeight: xe(et),
|
|
4159
4174
|
transverseML: 0,
|
|
4160
4175
|
transverseAP: 0,
|
|
4161
4176
|
scanUrl: t,
|
|
@@ -4165,41 +4180,41 @@ let __tla = (async () => {
|
|
|
4165
4180
|
alignedGeometry: d == null ? void 0 : d.geometry
|
|
4166
4181
|
});
|
|
4167
4182
|
} finally {
|
|
4168
|
-
|
|
4183
|
+
Ye.current = false, lt(false);
|
|
4169
4184
|
}
|
|
4170
4185
|
}, [
|
|
4171
4186
|
s,
|
|
4172
4187
|
d,
|
|
4173
4188
|
F,
|
|
4174
|
-
|
|
4189
|
+
Oe,
|
|
4175
4190
|
te,
|
|
4176
4191
|
Ae,
|
|
4177
4192
|
$,
|
|
4178
|
-
|
|
4193
|
+
et,
|
|
4179
4194
|
t,
|
|
4180
|
-
|
|
4195
|
+
Je
|
|
4181
4196
|
]), pn = de(null);
|
|
4182
|
-
|
|
4197
|
+
G(() => {
|
|
4183
4198
|
if (!d || !le) {
|
|
4184
4199
|
pn.current = null;
|
|
4185
4200
|
return;
|
|
4186
4201
|
}
|
|
4187
|
-
const m = (
|
|
4188
|
-
pn.current =
|
|
4202
|
+
const m = (Ee ?? d).geometry;
|
|
4203
|
+
pn.current = Kt(m);
|
|
4189
4204
|
}, [
|
|
4190
4205
|
d,
|
|
4191
4206
|
le,
|
|
4192
|
-
|
|
4207
|
+
Ee
|
|
4193
4208
|
]);
|
|
4194
|
-
const
|
|
4195
|
-
if (!s || !d || $.length === 0 || !F ||
|
|
4196
|
-
|
|
4197
|
-
const L = await
|
|
4209
|
+
const Vt = ce(async (m) => {
|
|
4210
|
+
if (!s || !d || $.length === 0 || !F || Ye.current) return;
|
|
4211
|
+
Ye.current = true, lt(true), await new Promise((R) => requestAnimationFrame(() => requestAnimationFrame(() => R())));
|
|
4212
|
+
const L = await Je({
|
|
4198
4213
|
restoreView: false
|
|
4199
4214
|
}).catch(() => {
|
|
4200
4215
|
});
|
|
4201
4216
|
try {
|
|
4202
|
-
const R =
|
|
4217
|
+
const R = Ot, W = Ht, pe = ve ? {
|
|
4203
4218
|
circumferences: ve.circumferences.map((H) => xe(H)),
|
|
4204
4219
|
frontalHeight: xe(ve.frontalHeight),
|
|
4205
4220
|
perineumML: xe(ve.perineumML),
|
|
@@ -4210,7 +4225,7 @@ let __tla = (async () => {
|
|
|
4210
4225
|
s({
|
|
4211
4226
|
spacingType: F,
|
|
4212
4227
|
sourceUnit: "cm",
|
|
4213
|
-
fileFormat:
|
|
4228
|
+
fileFormat: Oe,
|
|
4214
4229
|
measurementSource: m === "use_form_measurements" ? "form_provided" : "scan_derived",
|
|
4215
4230
|
isDoubleWall: te,
|
|
4216
4231
|
isUnitConverted: false,
|
|
@@ -4220,7 +4235,7 @@ let __tla = (async () => {
|
|
|
4220
4235
|
originalValue: xe(H.originalValue),
|
|
4221
4236
|
modifiedValue: H.modifiedValue == null ? null : xe(H.modifiedValue)
|
|
4222
4237
|
})),
|
|
4223
|
-
frontalHeight: xe((ve == null ? void 0 : ve.frontalHeight) ??
|
|
4238
|
+
frontalHeight: xe((ve == null ? void 0 : ve.frontalHeight) ?? et),
|
|
4224
4239
|
transverseML: xe(R),
|
|
4225
4240
|
transverseAP: xe(W),
|
|
4226
4241
|
perineumML: xe(ve == null ? void 0 : ve.perineumML),
|
|
@@ -4231,27 +4246,27 @@ let __tla = (async () => {
|
|
|
4231
4246
|
decision: m,
|
|
4232
4247
|
userEnteredMeasurements: pe,
|
|
4233
4248
|
screenshots: L,
|
|
4234
|
-
alignedGeometry: (
|
|
4249
|
+
alignedGeometry: (Ee ?? d).geometry
|
|
4235
4250
|
});
|
|
4236
4251
|
} finally {
|
|
4237
|
-
|
|
4252
|
+
Ye.current = false, lt(false);
|
|
4238
4253
|
}
|
|
4239
4254
|
}, [
|
|
4240
4255
|
s,
|
|
4241
4256
|
d,
|
|
4242
|
-
|
|
4257
|
+
Ee,
|
|
4243
4258
|
$,
|
|
4244
4259
|
F,
|
|
4245
|
-
|
|
4246
|
-
|
|
4260
|
+
X,
|
|
4261
|
+
Oe,
|
|
4247
4262
|
te,
|
|
4248
4263
|
Ae,
|
|
4249
4264
|
t,
|
|
4250
4265
|
ve,
|
|
4251
|
-
|
|
4266
|
+
et,
|
|
4267
|
+
Ot,
|
|
4252
4268
|
Ht,
|
|
4253
|
-
|
|
4254
|
-
Qe
|
|
4269
|
+
Je
|
|
4255
4270
|
]), yo = J(() => {
|
|
4256
4271
|
if (!Ae || $.length === 0) return false;
|
|
4257
4272
|
const m = Math.min(Ae.length, $.length);
|
|
@@ -4266,11 +4281,11 @@ let __tla = (async () => {
|
|
|
4266
4281
|
}, [
|
|
4267
4282
|
Ae,
|
|
4268
4283
|
$
|
|
4269
|
-
]), hn =
|
|
4270
|
-
return
|
|
4284
|
+
]), hn = Ve === 0 ? 320 : Ve < 520 ? Math.max(200, Math.round(Ve * 0.42)) : Ve < 900 ? 280 : Ve < 1400 ? 340 : 400, gn = Ve < 520 ? 16 : Ve < 900 ? 20 : 24;
|
|
4285
|
+
return y(Bo.Provider, {
|
|
4271
4286
|
value: e,
|
|
4272
4287
|
children: [
|
|
4273
|
-
|
|
4288
|
+
y("div", {
|
|
4274
4289
|
style: {
|
|
4275
4290
|
flex: 1,
|
|
4276
4291
|
display: "flex",
|
|
@@ -4299,7 +4314,7 @@ let __tla = (async () => {
|
|
|
4299
4314
|
}
|
|
4300
4315
|
})
|
|
4301
4316
|
}),
|
|
4302
|
-
|
|
4317
|
+
y("div", {
|
|
4303
4318
|
style: {
|
|
4304
4319
|
flex: 1,
|
|
4305
4320
|
display: "flex",
|
|
@@ -4307,8 +4322,8 @@ let __tla = (async () => {
|
|
|
4307
4322
|
minHeight: 0
|
|
4308
4323
|
},
|
|
4309
4324
|
children: [
|
|
4310
|
-
|
|
4311
|
-
ref:
|
|
4325
|
+
y("div", {
|
|
4326
|
+
ref: _t,
|
|
4312
4327
|
style: {
|
|
4313
4328
|
flex: 1,
|
|
4314
4329
|
display: "flex",
|
|
@@ -4317,8 +4332,8 @@ let __tla = (async () => {
|
|
|
4317
4332
|
},
|
|
4318
4333
|
children: [
|
|
4319
4334
|
d && !le && (() => {
|
|
4320
|
-
const m =
|
|
4321
|
-
return
|
|
4335
|
+
const m = X.length === 0 ? 1 : X.length === 1 ? 2 : 3, L = F === "AK" ? "Perineum" : "MPT", R = m === 1 ? `Place Point at ${L}` : m === 2 ? "Place Point at Distal Most Point" : "Ready to Continue", W = m === 1 ? `Click on the model to mark the ${L}.` : m === 2 ? "Click on the model to mark the Distal Most Point." : "Both points are placed. Click Continue to process the scan.", pe = m === 1 ? "#2fbf4a" : m === 2 ? "#e53935" : "#2fbf4a", H = X.length >= 2;
|
|
4336
|
+
return y("div", {
|
|
4322
4337
|
style: {
|
|
4323
4338
|
width: hn,
|
|
4324
4339
|
flexShrink: 0,
|
|
@@ -4334,7 +4349,7 @@ let __tla = (async () => {
|
|
|
4334
4349
|
i("style", {
|
|
4335
4350
|
children: "@keyframes gm-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(12, 67, 173, 0.45) } 50% { box-shadow: 0 0 0 6px rgba(12, 67, 173, 0) } }"
|
|
4336
4351
|
}),
|
|
4337
|
-
|
|
4352
|
+
y("div", {
|
|
4338
4353
|
style: {
|
|
4339
4354
|
position: "relative",
|
|
4340
4355
|
display: "flex",
|
|
@@ -4382,7 +4397,7 @@ let __tla = (async () => {
|
|
|
4382
4397
|
},
|
|
4383
4398
|
children: "i"
|
|
4384
4399
|
}),
|
|
4385
|
-
|
|
4400
|
+
Dt && y("div", {
|
|
4386
4401
|
role: "tooltip",
|
|
4387
4402
|
style: {
|
|
4388
4403
|
position: "absolute",
|
|
@@ -4422,7 +4437,7 @@ let __tla = (async () => {
|
|
|
4422
4437
|
})
|
|
4423
4438
|
]
|
|
4424
4439
|
}),
|
|
4425
|
-
|
|
4440
|
+
y("div", {
|
|
4426
4441
|
style: {
|
|
4427
4442
|
display: "flex",
|
|
4428
4443
|
alignItems: "center",
|
|
@@ -4445,7 +4460,7 @@ let __tla = (async () => {
|
|
|
4445
4460
|
transition: "background-color 200ms"
|
|
4446
4461
|
}
|
|
4447
4462
|
}, ne)),
|
|
4448
|
-
|
|
4463
|
+
y("div", {
|
|
4449
4464
|
style: {
|
|
4450
4465
|
fontSize: 11,
|
|
4451
4466
|
fontWeight: 500,
|
|
@@ -4460,7 +4475,7 @@ let __tla = (async () => {
|
|
|
4460
4475
|
})
|
|
4461
4476
|
]
|
|
4462
4477
|
}),
|
|
4463
|
-
|
|
4478
|
+
y("div", {
|
|
4464
4479
|
style: {
|
|
4465
4480
|
display: "flex",
|
|
4466
4481
|
alignItems: "center",
|
|
@@ -4499,7 +4514,7 @@ let __tla = (async () => {
|
|
|
4499
4514
|
}),
|
|
4500
4515
|
i("button", {
|
|
4501
4516
|
disabled: !H,
|
|
4502
|
-
onClick:
|
|
4517
|
+
onClick: Et,
|
|
4503
4518
|
style: {
|
|
4504
4519
|
marginTop: 4,
|
|
4505
4520
|
padding: "11px 14px",
|
|
@@ -4516,25 +4531,6 @@ let __tla = (async () => {
|
|
|
4516
4531
|
animation: H ? "gm-pulse 1.8s ease-in-out infinite" : "none"
|
|
4517
4532
|
},
|
|
4518
4533
|
children: "Continue"
|
|
4519
|
-
}),
|
|
4520
|
-
s && i("button", {
|
|
4521
|
-
disabled: Be,
|
|
4522
|
-
onClick: () => at(true),
|
|
4523
|
-
style: {
|
|
4524
|
-
alignSelf: "center",
|
|
4525
|
-
backgroundColor: "#fff",
|
|
4526
|
-
border: "1px solid #d0d7de",
|
|
4527
|
-
color: Be ? "#999" : "#2d333a",
|
|
4528
|
-
fontSize: 14,
|
|
4529
|
-
fontWeight: 600,
|
|
4530
|
-
cursor: Be ? "not-allowed" : "pointer",
|
|
4531
|
-
fontFamily: "system-ui, sans-serif",
|
|
4532
|
-
padding: "10px 16px",
|
|
4533
|
-
borderRadius: 8,
|
|
4534
|
-
boxShadow: "0 1px 3px rgba(0,0,0,0.06)",
|
|
4535
|
-
letterSpacing: "0.3px"
|
|
4536
|
-
},
|
|
4537
|
-
children: "Have Galileo Check My Measurements"
|
|
4538
4534
|
})
|
|
4539
4535
|
]
|
|
4540
4536
|
}),
|
|
@@ -4556,7 +4552,7 @@ let __tla = (async () => {
|
|
|
4556
4552
|
]
|
|
4557
4553
|
});
|
|
4558
4554
|
})(),
|
|
4559
|
-
le &&
|
|
4555
|
+
le && Ge && F && i("div", {
|
|
4560
4556
|
style: {
|
|
4561
4557
|
width: hn,
|
|
4562
4558
|
flexShrink: 0,
|
|
@@ -4584,9 +4580,9 @@ let __tla = (async () => {
|
|
|
4584
4580
|
amputationType: F,
|
|
4585
4581
|
spacingInches: S,
|
|
4586
4582
|
scanMeasurements: $,
|
|
4587
|
-
scanFrontalHeight:
|
|
4588
|
-
scanTransverseML:
|
|
4589
|
-
scanTransverseAP:
|
|
4583
|
+
scanFrontalHeight: et,
|
|
4584
|
+
scanTransverseML: Ot,
|
|
4585
|
+
scanTransverseAP: Ht,
|
|
4590
4586
|
onSave: bo,
|
|
4591
4587
|
onSkip: un,
|
|
4592
4588
|
onFormChange: to,
|
|
@@ -4598,8 +4594,8 @@ let __tla = (async () => {
|
|
|
4598
4594
|
})
|
|
4599
4595
|
})
|
|
4600
4596
|
}),
|
|
4601
|
-
|
|
4602
|
-
ref:
|
|
4597
|
+
y("div", {
|
|
4598
|
+
ref: It,
|
|
4603
4599
|
style: {
|
|
4604
4600
|
flex: 1,
|
|
4605
4601
|
position: "relative",
|
|
@@ -4621,7 +4617,7 @@ let __tla = (async () => {
|
|
|
4621
4617
|
justifyContent: "center",
|
|
4622
4618
|
pointerEvents: "none"
|
|
4623
4619
|
},
|
|
4624
|
-
children:
|
|
4620
|
+
children: Be ? i("div", {
|
|
4625
4621
|
style: {
|
|
4626
4622
|
fontSize: 18,
|
|
4627
4623
|
color: "#aaa",
|
|
@@ -4629,7 +4625,7 @@ let __tla = (async () => {
|
|
|
4629
4625
|
fontFamily: "system-ui, sans-serif"
|
|
4630
4626
|
},
|
|
4631
4627
|
children: "Drag & Drop Files Here"
|
|
4632
|
-
}) :
|
|
4628
|
+
}) : y("div", {
|
|
4633
4629
|
style: {
|
|
4634
4630
|
textAlign: "center"
|
|
4635
4631
|
},
|
|
@@ -4659,7 +4655,7 @@ let __tla = (async () => {
|
|
|
4659
4655
|
]
|
|
4660
4656
|
})
|
|
4661
4657
|
}),
|
|
4662
|
-
!e.showDragDrop && !d && !g && !
|
|
4658
|
+
!e.showDragDrop && !d && !g && !Ft && i("div", {
|
|
4663
4659
|
style: {
|
|
4664
4660
|
position: "absolute",
|
|
4665
4661
|
inset: 0,
|
|
@@ -4667,7 +4663,7 @@ let __tla = (async () => {
|
|
|
4667
4663
|
alignItems: "center",
|
|
4668
4664
|
justifyContent: "center"
|
|
4669
4665
|
},
|
|
4670
|
-
children:
|
|
4666
|
+
children: y("div", {
|
|
4671
4667
|
style: {
|
|
4672
4668
|
textAlign: "center"
|
|
4673
4669
|
},
|
|
@@ -4698,13 +4694,13 @@ let __tla = (async () => {
|
|
|
4698
4694
|
})
|
|
4699
4695
|
}),
|
|
4700
4696
|
g && i(Fn, {
|
|
4701
|
-
message:
|
|
4697
|
+
message: w || "Processing mesh..."
|
|
4702
4698
|
}),
|
|
4703
4699
|
j && i(Fn, {
|
|
4704
4700
|
message: ie
|
|
4705
4701
|
}),
|
|
4706
|
-
|
|
4707
|
-
message:
|
|
4702
|
+
Ft && i(Zo, {
|
|
4703
|
+
message: Ft,
|
|
4708
4704
|
onDismiss: () => Le(null)
|
|
4709
4705
|
}),
|
|
4710
4706
|
e.showAmputationModal && z && i("div", {
|
|
@@ -4719,7 +4715,7 @@ let __tla = (async () => {
|
|
|
4719
4715
|
justifyContent: "center",
|
|
4720
4716
|
zIndex: 20
|
|
4721
4717
|
},
|
|
4722
|
-
children:
|
|
4718
|
+
children: y("div", {
|
|
4723
4719
|
style: {
|
|
4724
4720
|
backgroundColor: "#fff",
|
|
4725
4721
|
borderRadius: 4,
|
|
@@ -4728,7 +4724,7 @@ let __tla = (async () => {
|
|
|
4728
4724
|
fontFamily: "system-ui, sans-serif"
|
|
4729
4725
|
},
|
|
4730
4726
|
children: [
|
|
4731
|
-
|
|
4727
|
+
y("div", {
|
|
4732
4728
|
style: {
|
|
4733
4729
|
padding: "24px 24px 20px"
|
|
4734
4730
|
},
|
|
@@ -4758,7 +4754,7 @@ let __tla = (async () => {
|
|
|
4758
4754
|
children: [
|
|
4759
4755
|
"AK",
|
|
4760
4756
|
"BK"
|
|
4761
|
-
].map((m) =>
|
|
4757
|
+
].map((m) => y("label", {
|
|
4762
4758
|
onClick: () => I(m),
|
|
4763
4759
|
style: {
|
|
4764
4760
|
flex: 1,
|
|
@@ -4794,7 +4790,7 @@ let __tla = (async () => {
|
|
|
4794
4790
|
},
|
|
4795
4791
|
children: m
|
|
4796
4792
|
}),
|
|
4797
|
-
|
|
4793
|
+
y("span", {
|
|
4798
4794
|
style: {
|
|
4799
4795
|
fontSize: 13,
|
|
4800
4796
|
color: "rgba(0,0,0,0.54)"
|
|
@@ -4809,7 +4805,7 @@ let __tla = (async () => {
|
|
|
4809
4805
|
})
|
|
4810
4806
|
]
|
|
4811
4807
|
}),
|
|
4812
|
-
|
|
4808
|
+
y("div", {
|
|
4813
4809
|
style: {
|
|
4814
4810
|
display: "flex",
|
|
4815
4811
|
justifyContent: "flex-end",
|
|
@@ -4871,7 +4867,7 @@ let __tla = (async () => {
|
|
|
4871
4867
|
}
|
|
4872
4868
|
}),
|
|
4873
4869
|
i(Ko, {
|
|
4874
|
-
children:
|
|
4870
|
+
children: y(Lo, {
|
|
4875
4871
|
camera: {
|
|
4876
4872
|
position: [
|
|
4877
4873
|
0,
|
|
@@ -4937,15 +4933,15 @@ let __tla = (async () => {
|
|
|
4937
4933
|
i(ar, {
|
|
4938
4934
|
modelSize: u,
|
|
4939
4935
|
isAligned: le,
|
|
4940
|
-
isCut:
|
|
4936
|
+
isCut: Bt,
|
|
4941
4937
|
mesh: d,
|
|
4942
4938
|
viewMode: b,
|
|
4943
|
-
sliceY: le &&
|
|
4944
|
-
landmarkCount:
|
|
4939
|
+
sliceY: le && X.length >= 2 ? zt ?? rt ?? X[0].position.y : void 0,
|
|
4940
|
+
landmarkCount: X.length,
|
|
4945
4941
|
measurementGeometry: se,
|
|
4946
|
-
fitYMin: le &&
|
|
4947
|
-
fitYMax: le &&
|
|
4948
|
-
resetCameraToFrontRef:
|
|
4942
|
+
fitYMin: le && X.length >= 2 ? zt ?? rt ?? void 0 : void 0,
|
|
4943
|
+
fitYMax: le && X.length >= 2 ? it ?? X[0].position.y : void 0,
|
|
4944
|
+
resetCameraToFrontRef: Wt
|
|
4949
4945
|
}),
|
|
4950
4946
|
!le && i(In, {
|
|
4951
4947
|
enableDamping: false
|
|
@@ -4954,64 +4950,64 @@ let __tla = (async () => {
|
|
|
4954
4950
|
mesh: d,
|
|
4955
4951
|
isDragging: Kn
|
|
4956
4952
|
}),
|
|
4957
|
-
d && le &&
|
|
4953
|
+
d && le && X.length >= 3 && (() => {
|
|
4958
4954
|
const L = d.geometry.getIndex();
|
|
4959
4955
|
if (!L || L.count < 30) return null;
|
|
4960
|
-
const R =
|
|
4956
|
+
const R = X[2], W = X[0], pe = me ?? R.position.y, H = zt ?? rt ?? W.position.y;
|
|
4961
4957
|
if (b === "2D") {
|
|
4962
|
-
const ne =
|
|
4958
|
+
const ne = Ge ? ro : He ? F === "AK" ? ve == null ? void 0 : ve.perineumML : ve == null ? void 0 : ve.mptML : void 0, ae = Ge ? so : He ? F === "AK" ? ve == null ? void 0 : ve.perineumAP : ve == null ? void 0 : ve.mptAP : void 0;
|
|
4963
4959
|
return i(ur, {
|
|
4964
|
-
mesh:
|
|
4960
|
+
mesh: Ee ?? d,
|
|
4965
4961
|
upperY: H,
|
|
4966
4962
|
originY: W.position.y,
|
|
4967
4963
|
modelSize: u,
|
|
4968
4964
|
meshColor: rn,
|
|
4969
|
-
displayUnit:
|
|
4965
|
+
displayUnit: k,
|
|
4970
4966
|
formML: ne,
|
|
4971
4967
|
formAP: ae
|
|
4972
4968
|
});
|
|
4973
4969
|
}
|
|
4974
|
-
return
|
|
4970
|
+
return y(Re, {
|
|
4975
4971
|
children: [
|
|
4976
4972
|
i(ir, {
|
|
4977
|
-
mesh:
|
|
4973
|
+
mesh: Ee ?? d,
|
|
4978
4974
|
startY: pe,
|
|
4979
4975
|
endY: H,
|
|
4980
|
-
spacing:
|
|
4976
|
+
spacing: ft,
|
|
4981
4977
|
modelSize: u,
|
|
4982
|
-
onMeasurementsChange:
|
|
4978
|
+
onMeasurementsChange: Pe,
|
|
4983
4979
|
reverseOrder: true,
|
|
4984
|
-
displayUnit:
|
|
4980
|
+
displayUnit: k,
|
|
4985
4981
|
useInnerSurface: te && !O,
|
|
4986
|
-
formMeasurements:
|
|
4987
|
-
originY:
|
|
4982
|
+
formMeasurements: Ge ? eo ?? Ae : He ? Ae : void 0,
|
|
4983
|
+
originY: it ?? W.position.y,
|
|
4988
4984
|
wasmSlices: De
|
|
4989
4985
|
}),
|
|
4990
4986
|
i(lr, {
|
|
4991
4987
|
mesh: d,
|
|
4992
|
-
greenY:
|
|
4988
|
+
greenY: it ?? W.position.y,
|
|
4993
4989
|
modelSize: u,
|
|
4994
|
-
displayUnit:
|
|
4990
|
+
displayUnit: k,
|
|
4995
4991
|
bottomY: te ? R.position.y : void 0,
|
|
4996
|
-
formHeight:
|
|
4992
|
+
formHeight: Ge ? no : He ? ve == null ? void 0 : ve.frontalHeight : void 0
|
|
4997
4993
|
}),
|
|
4998
4994
|
i(pr, {
|
|
4999
4995
|
mesh: d,
|
|
5000
|
-
yPosition:
|
|
4996
|
+
yPosition: it ?? W.position.y,
|
|
5001
4997
|
onYChange: (ne) => {
|
|
5002
|
-
|
|
4998
|
+
Jt(ne), Ie(null);
|
|
5003
4999
|
const ae = ne - W.position.y;
|
|
5004
|
-
|
|
5000
|
+
Mt((rt ?? W.position.y + ft * 2) + ae);
|
|
5005
5001
|
},
|
|
5006
|
-
minY: W.position.y -
|
|
5007
|
-
maxY: W.position.y +
|
|
5002
|
+
minY: W.position.y - ft,
|
|
5003
|
+
maxY: W.position.y + ft,
|
|
5008
5004
|
modelSize: u,
|
|
5009
5005
|
color: "#44ff44",
|
|
5010
5006
|
hoverColor: "#88ff88",
|
|
5011
5007
|
dragColor: "#ffffff",
|
|
5012
5008
|
label: F === "AK" ? "Perineum" : "MPT",
|
|
5013
|
-
onDragStart: () =>
|
|
5014
|
-
onDragEnd: () =>
|
|
5009
|
+
onDragStart: () => Ut(true),
|
|
5010
|
+
onDragEnd: () => Ut(false)
|
|
5015
5011
|
})
|
|
5016
5012
|
]
|
|
5017
5013
|
});
|
|
@@ -5022,8 +5018,8 @@ let __tla = (async () => {
|
|
|
5022
5018
|
d && e.showDebug && We && b === "3D" && i(_r, {
|
|
5023
5019
|
mesh: d,
|
|
5024
5020
|
modelSize: u,
|
|
5025
|
-
layers:
|
|
5026
|
-
landmarkPoints:
|
|
5021
|
+
layers: Qt,
|
|
5022
|
+
landmarkPoints: X,
|
|
5027
5023
|
componentDebug: null,
|
|
5028
5024
|
aoData: U,
|
|
5029
5025
|
aoGeometry: Y,
|
|
@@ -5038,7 +5034,7 @@ let __tla = (async () => {
|
|
|
5038
5034
|
]
|
|
5039
5035
|
})
|
|
5040
5036
|
}),
|
|
5041
|
-
d &&
|
|
5037
|
+
d && y("div", {
|
|
5042
5038
|
style: {
|
|
5043
5039
|
position: "absolute",
|
|
5044
5040
|
top: 16,
|
|
@@ -5065,7 +5061,7 @@ let __tla = (async () => {
|
|
|
5065
5061
|
},
|
|
5066
5062
|
children: "Start Over"
|
|
5067
5063
|
}),
|
|
5068
|
-
!le &&
|
|
5064
|
+
!le && X.length >= 1 && i("button", {
|
|
5069
5065
|
onClick: uo,
|
|
5070
5066
|
style: {
|
|
5071
5067
|
padding: "6px 16px",
|
|
@@ -5082,7 +5078,7 @@ let __tla = (async () => {
|
|
|
5082
5078
|
},
|
|
5083
5079
|
children: "Reset Points"
|
|
5084
5080
|
}),
|
|
5085
|
-
le && !
|
|
5081
|
+
le && !Lt && i("button", {
|
|
5086
5082
|
onClick: xo,
|
|
5087
5083
|
style: {
|
|
5088
5084
|
padding: "6px 16px",
|
|
@@ -5102,14 +5098,14 @@ let __tla = (async () => {
|
|
|
5102
5098
|
]
|
|
5103
5099
|
}),
|
|
5104
5100
|
e.showDebug && We && d && b === "3D" && i(Ir, {
|
|
5105
|
-
layers:
|
|
5101
|
+
layers: Qt,
|
|
5106
5102
|
onToggleLayer: (m) => qn((L) => ({
|
|
5107
5103
|
...L,
|
|
5108
5104
|
[m]: !L[m]
|
|
5109
5105
|
})),
|
|
5110
5106
|
isDoubleShell: te
|
|
5111
5107
|
}),
|
|
5112
|
-
le && $.length > 0 &&
|
|
5108
|
+
le && $.length > 0 && y("div", {
|
|
5113
5109
|
style: {
|
|
5114
5110
|
position: "absolute",
|
|
5115
5111
|
top: 16,
|
|
@@ -5119,7 +5115,7 @@ let __tla = (async () => {
|
|
|
5119
5115
|
zIndex: 10
|
|
5120
5116
|
},
|
|
5121
5117
|
children: [
|
|
5122
|
-
|
|
5118
|
+
y("div", {
|
|
5123
5119
|
style: {
|
|
5124
5120
|
display: "flex",
|
|
5125
5121
|
borderRadius: 6,
|
|
@@ -5129,7 +5125,7 @@ let __tla = (async () => {
|
|
|
5129
5125
|
},
|
|
5130
5126
|
children: [
|
|
5131
5127
|
i("button", {
|
|
5132
|
-
onClick: () =>
|
|
5128
|
+
onClick: () => P("3D"),
|
|
5133
5129
|
style: {
|
|
5134
5130
|
padding: "6px 14px",
|
|
5135
5131
|
fontSize: 13,
|
|
@@ -5143,7 +5139,7 @@ let __tla = (async () => {
|
|
|
5143
5139
|
children: "Orbital"
|
|
5144
5140
|
}),
|
|
5145
5141
|
i("button", {
|
|
5146
|
-
onClick: () =>
|
|
5142
|
+
onClick: () => P("2D"),
|
|
5147
5143
|
style: {
|
|
5148
5144
|
padding: "6px 14px",
|
|
5149
5145
|
fontSize: 13,
|
|
@@ -5159,7 +5155,7 @@ let __tla = (async () => {
|
|
|
5159
5155
|
})
|
|
5160
5156
|
]
|
|
5161
5157
|
}),
|
|
5162
|
-
|
|
5158
|
+
y("div", {
|
|
5163
5159
|
style: {
|
|
5164
5160
|
display: "flex",
|
|
5165
5161
|
borderRadius: 6,
|
|
@@ -5173,9 +5169,9 @@ let __tla = (async () => {
|
|
|
5173
5169
|
style: {
|
|
5174
5170
|
padding: "6px 14px",
|
|
5175
5171
|
fontSize: 13,
|
|
5176
|
-
fontWeight:
|
|
5177
|
-
backgroundColor:
|
|
5178
|
-
color:
|
|
5172
|
+
fontWeight: k === "cm" ? 600 : 400,
|
|
5173
|
+
backgroundColor: k === "cm" ? "rgb(12, 67, 173)" : "#fff",
|
|
5174
|
+
color: k === "cm" ? "#fff" : "#666",
|
|
5179
5175
|
border: "none",
|
|
5180
5176
|
cursor: "pointer",
|
|
5181
5177
|
fontFamily: "system-ui, sans-serif"
|
|
@@ -5187,9 +5183,9 @@ let __tla = (async () => {
|
|
|
5187
5183
|
style: {
|
|
5188
5184
|
padding: "6px 14px",
|
|
5189
5185
|
fontSize: 13,
|
|
5190
|
-
fontWeight:
|
|
5191
|
-
backgroundColor:
|
|
5192
|
-
color:
|
|
5186
|
+
fontWeight: k === "inch" ? 600 : 400,
|
|
5187
|
+
backgroundColor: k === "inch" ? "rgb(12, 67, 173)" : "#fff",
|
|
5188
|
+
color: k === "inch" ? "#fff" : "#666",
|
|
5193
5189
|
border: "none",
|
|
5194
5190
|
borderLeft: "1px solid #ccc",
|
|
5195
5191
|
cursor: "pointer",
|
|
@@ -5199,7 +5195,7 @@ let __tla = (async () => {
|
|
|
5199
5195
|
})
|
|
5200
5196
|
]
|
|
5201
5197
|
}),
|
|
5202
|
-
e.showSpacingToggle && b === "3D" &&
|
|
5198
|
+
e.showSpacingToggle && b === "3D" && y("div", {
|
|
5203
5199
|
style: {
|
|
5204
5200
|
display: "flex",
|
|
5205
5201
|
borderRadius: 6,
|
|
@@ -5248,13 +5244,13 @@ let __tla = (async () => {
|
|
|
5248
5244
|
boxShadow: "0 2px 8px rgba(0,0,0,0.1)"
|
|
5249
5245
|
},
|
|
5250
5246
|
children: i("button", {
|
|
5251
|
-
onClick: () =>
|
|
5247
|
+
onClick: () => kt((m) => !m),
|
|
5252
5248
|
style: {
|
|
5253
5249
|
padding: "6px 14px",
|
|
5254
5250
|
fontSize: 13,
|
|
5255
|
-
fontWeight:
|
|
5256
|
-
backgroundColor:
|
|
5257
|
-
color:
|
|
5251
|
+
fontWeight: He ? 600 : 400,
|
|
5252
|
+
backgroundColor: He ? "rgb(12, 67, 173)" : "#fff",
|
|
5253
|
+
color: He ? "#fff" : "#666",
|
|
5258
5254
|
border: "none",
|
|
5259
5255
|
cursor: "pointer",
|
|
5260
5256
|
fontFamily: "system-ui, sans-serif"
|
|
@@ -5272,7 +5268,7 @@ let __tla = (async () => {
|
|
|
5272
5268
|
},
|
|
5273
5269
|
children: i("button", {
|
|
5274
5270
|
onClick: async () => {
|
|
5275
|
-
const m = await
|
|
5271
|
+
const m = await Je();
|
|
5276
5272
|
if (!m) return;
|
|
5277
5273
|
const L = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), R = (W, pe) => {
|
|
5278
5274
|
const H = document.createElement("a");
|
|
@@ -5337,7 +5333,7 @@ let __tla = (async () => {
|
|
|
5337
5333
|
containerType: "inline-size",
|
|
5338
5334
|
pointerEvents: "none"
|
|
5339
5335
|
},
|
|
5340
|
-
children:
|
|
5336
|
+
children: y("div", {
|
|
5341
5337
|
className: "gm-action-row",
|
|
5342
5338
|
style: {
|
|
5343
5339
|
display: "flex",
|
|
@@ -5373,37 +5369,31 @@ let __tla = (async () => {
|
|
|
5373
5369
|
}
|
|
5374
5370
|
`
|
|
5375
5371
|
}),
|
|
5376
|
-
|
|
5372
|
+
y("div", {
|
|
5377
5373
|
className: "gm-btn-group",
|
|
5378
5374
|
children: [
|
|
5379
|
-
i("button", {
|
|
5380
|
-
className: "gm-btn gm-btn-secondary",
|
|
5381
|
-
disabled: Be,
|
|
5382
|
-
onClick: () => at(true),
|
|
5383
|
-
children: "Have Galileo Check My Measurements"
|
|
5384
|
-
}),
|
|
5385
|
-
Dt && !Ye && i("button", {
|
|
5375
|
+
Lt && !Ge && i("button", {
|
|
5386
5376
|
className: "gm-btn gm-btn-secondary",
|
|
5387
|
-
onClick: () =>
|
|
5377
|
+
onClick: () => Ue(true),
|
|
5388
5378
|
children: "Edit Measurements"
|
|
5389
5379
|
}),
|
|
5390
|
-
|
|
5380
|
+
Lt && (yo ? i("button", {
|
|
5391
5381
|
className: "gm-btn gm-btn-primary",
|
|
5392
|
-
disabled:
|
|
5393
|
-
onClick: () =>
|
|
5382
|
+
disabled: st,
|
|
5383
|
+
onClick: () => Vt("continue"),
|
|
5394
5384
|
children: "Continue \u2192"
|
|
5395
|
-
}) :
|
|
5385
|
+
}) : y(Re, {
|
|
5396
5386
|
children: [
|
|
5397
5387
|
i("button", {
|
|
5398
5388
|
className: "gm-btn gm-btn-primary",
|
|
5399
|
-
disabled:
|
|
5400
|
-
onClick: () =>
|
|
5389
|
+
disabled: st,
|
|
5390
|
+
onClick: () => Vt("use_scan"),
|
|
5401
5391
|
children: "Go with Scan"
|
|
5402
5392
|
}),
|
|
5403
5393
|
i("button", {
|
|
5404
5394
|
className: "gm-btn gm-btn-primary",
|
|
5405
|
-
disabled:
|
|
5406
|
-
onClick: () =>
|
|
5395
|
+
disabled: st,
|
|
5396
|
+
onClick: () => Vt("use_form_measurements"),
|
|
5407
5397
|
children: "Go with Measurements"
|
|
5408
5398
|
})
|
|
5409
5399
|
]
|
|
@@ -5417,7 +5407,7 @@ let __tla = (async () => {
|
|
|
5417
5407
|
})
|
|
5418
5408
|
]
|
|
5419
5409
|
}),
|
|
5420
|
-
|
|
5410
|
+
st && y("div", {
|
|
5421
5411
|
"data-finalizing-overlay": true,
|
|
5422
5412
|
style: {
|
|
5423
5413
|
position: "absolute",
|
|
@@ -5456,7 +5446,7 @@ let __tla = (async () => {
|
|
|
5456
5446
|
})
|
|
5457
5447
|
]
|
|
5458
5448
|
}),
|
|
5459
|
-
l &&
|
|
5449
|
+
l && Rt.length > 0 && y("div", {
|
|
5460
5450
|
style: {
|
|
5461
5451
|
height: 120,
|
|
5462
5452
|
flexShrink: 0,
|
|
@@ -5469,7 +5459,7 @@ let __tla = (async () => {
|
|
|
5469
5459
|
flexDirection: "column"
|
|
5470
5460
|
},
|
|
5471
5461
|
children: [
|
|
5472
|
-
|
|
5462
|
+
y("div", {
|
|
5473
5463
|
style: {
|
|
5474
5464
|
display: "flex",
|
|
5475
5465
|
alignItems: "center",
|
|
@@ -5489,23 +5479,23 @@ let __tla = (async () => {
|
|
|
5489
5479
|
},
|
|
5490
5480
|
children: "GALILEO DEBUG"
|
|
5491
5481
|
}),
|
|
5492
|
-
|
|
5482
|
+
y("div", {
|
|
5493
5483
|
style: {
|
|
5494
5484
|
display: "flex",
|
|
5495
5485
|
gap: 8,
|
|
5496
5486
|
alignItems: "center"
|
|
5497
5487
|
},
|
|
5498
5488
|
children: [
|
|
5499
|
-
|
|
5489
|
+
y("span", {
|
|
5500
5490
|
style: {
|
|
5501
5491
|
color: "#484f58",
|
|
5502
5492
|
fontSize: 9
|
|
5503
5493
|
},
|
|
5504
5494
|
children: [
|
|
5505
5495
|
"WASM ",
|
|
5506
|
-
|
|
5496
|
+
Ne.current ? "v2" : "N/A",
|
|
5507
5497
|
" | ",
|
|
5508
|
-
|
|
5498
|
+
X.length,
|
|
5509
5499
|
" pts | ",
|
|
5510
5500
|
le ? "aligned" : "unaligned",
|
|
5511
5501
|
" | ",
|
|
@@ -5531,14 +5521,14 @@ let __tla = (async () => {
|
|
|
5531
5521
|
]
|
|
5532
5522
|
}),
|
|
5533
5523
|
i("div", {
|
|
5534
|
-
ref:
|
|
5524
|
+
ref: at,
|
|
5535
5525
|
style: {
|
|
5536
5526
|
flex: 1,
|
|
5537
5527
|
overflowY: "auto",
|
|
5538
5528
|
padding: "4px 10px",
|
|
5539
5529
|
lineHeight: 1.6
|
|
5540
5530
|
},
|
|
5541
|
-
children:
|
|
5531
|
+
children: Rt.map((m, L) => {
|
|
5542
5532
|
const R = m.includes("ERROR") || m.includes("failed"), W = m.includes("warning") || m.includes("WARN"), pe = m.includes("PIPELINE:"), H = m.includes("STATE:");
|
|
5543
5533
|
return i("div", {
|
|
5544
5534
|
style: {
|
|
@@ -5555,13 +5545,13 @@ let __tla = (async () => {
|
|
|
5555
5545
|
}),
|
|
5556
5546
|
Un && i(wr, {
|
|
5557
5547
|
onSkip: un,
|
|
5558
|
-
onCancel: () =>
|
|
5548
|
+
onCancel: () => nn(false)
|
|
5559
5549
|
})
|
|
5560
5550
|
]
|
|
5561
5551
|
});
|
|
5562
5552
|
};
|
|
5563
5553
|
function Er({ screenshotFnRef: e }) {
|
|
5564
|
-
return
|
|
5554
|
+
return G(() => {
|
|
5565
5555
|
e.current = null;
|
|
5566
5556
|
}, [
|
|
5567
5557
|
e
|
|
@@ -5586,7 +5576,7 @@ let __tla = (async () => {
|
|
|
5586
5576
|
]) t.push(`${n}_below`);
|
|
5587
5577
|
return t;
|
|
5588
5578
|
};
|
|
5589
|
-
|
|
5579
|
+
yt = function(e, r) {
|
|
5590
5580
|
const t = Yn(r), n = {};
|
|
5591
5581
|
for (let s = 0; s < Math.min(e.length, t.length); s++) {
|
|
5592
5582
|
const l = e[s];
|
|
@@ -5664,7 +5654,7 @@ let __tla = (async () => {
|
|
|
5664
5654
|
}
|
|
5665
5655
|
Ur = ({ request: e, onComplete: r, wasmModule: t }) => {
|
|
5666
5656
|
const [n, s] = E(null);
|
|
5667
|
-
|
|
5657
|
+
G(() => {
|
|
5668
5658
|
if (t != null) return;
|
|
5669
5659
|
let o = false;
|
|
5670
5660
|
const d = async (p) => {
|
|
@@ -5689,35 +5679,35 @@ let __tla = (async () => {
|
|
|
5689
5679
|
e.spacing_type
|
|
5690
5680
|
]), a = async (o) => {
|
|
5691
5681
|
var _a, _b;
|
|
5692
|
-
const d = o.scanMeasurements.map((b) => +(b.modifiedValue ?? b.originalValue).toFixed(1)), p =
|
|
5682
|
+
const d = o.scanMeasurements.map((b) => +(b.modifiedValue ?? b.originalValue).toFixed(1)), p = yt(d, e.spacing_type);
|
|
5693
5683
|
let u, f;
|
|
5694
5684
|
if (o.formMeasurements) {
|
|
5695
|
-
u =
|
|
5696
|
-
const b = o.scanMeasurements.map((
|
|
5685
|
+
u = yt(o.formMeasurements, e.spacing_type);
|
|
5686
|
+
const b = o.scanMeasurements.map((P, S) => {
|
|
5697
5687
|
var _a2;
|
|
5698
5688
|
const C = (_a2 = o.formMeasurements) == null ? void 0 : _a2[S];
|
|
5699
|
-
return C == null || isNaN(C) ? null : +((
|
|
5689
|
+
return C == null || isNaN(C) ? null : +((P.modifiedValue ?? P.originalValue) - C).toFixed(1);
|
|
5700
5690
|
});
|
|
5701
|
-
f =
|
|
5691
|
+
f = yt(b, e.spacing_type);
|
|
5702
5692
|
}
|
|
5703
|
-
const h = o.userEnteredMeasurements ?
|
|
5704
|
-
let
|
|
5705
|
-
if (e.upload_url) if (!o.alignedGeometry)
|
|
5693
|
+
const h = o.userEnteredMeasurements ? yt(o.userEnteredMeasurements.circumferences, e.spacing_type) : void 0, v = o.decision === "use_scan" || o.decision === "continue", g = v ? p : h ?? u ?? p, x = v ? +o.frontalHeight.toFixed(1) : +(((_a = o.userEnteredMeasurements) == null ? void 0 : _a.frontalHeight) ?? o.frontalHeight).toFixed(1);
|
|
5694
|
+
let w;
|
|
5695
|
+
if (e.upload_url) if (!o.alignedGeometry) w = {
|
|
5706
5696
|
success: false,
|
|
5707
5697
|
url: e.upload_url,
|
|
5708
5698
|
message: "No aligned geometry available \u2014 mesh processing may not have completed."
|
|
5709
5699
|
};
|
|
5710
5700
|
else try {
|
|
5711
|
-
const b = $r(o.alignedGeometry),
|
|
5701
|
+
const b = $r(o.alignedGeometry), P = new Blob([
|
|
5712
5702
|
b
|
|
5713
|
-
]), S = await Or(e.upload_url,
|
|
5714
|
-
|
|
5703
|
+
]), S = await Or(e.upload_url, P);
|
|
5704
|
+
w = {
|
|
5715
5705
|
...S,
|
|
5716
5706
|
url: e.upload_url,
|
|
5717
5707
|
message: S.success ? "Cleaned mesh uploaded successfully." : `Upload failed: ${S.error ?? "unknown error"}`
|
|
5718
5708
|
};
|
|
5719
5709
|
} catch (b) {
|
|
5720
|
-
|
|
5710
|
+
w = {
|
|
5721
5711
|
success: false,
|
|
5722
5712
|
url: e.upload_url,
|
|
5723
5713
|
message: `Upload failed: ${b instanceof Error ? b.message : String(b)}`,
|
|
@@ -5751,7 +5741,7 @@ let __tla = (async () => {
|
|
|
5751
5741
|
mpt_ml: o.mptML,
|
|
5752
5742
|
mpt_ap: o.mptAP,
|
|
5753
5743
|
screenshots: o.screenshots,
|
|
5754
|
-
upload:
|
|
5744
|
+
upload: w
|
|
5755
5745
|
};
|
|
5756
5746
|
r == null ? void 0 : r(A);
|
|
5757
5747
|
};
|
|
@@ -5775,8 +5765,8 @@ let __tla = (async () => {
|
|
|
5775
5765
|
export {
|
|
5776
5766
|
Ur as G,
|
|
5777
5767
|
__tla,
|
|
5778
|
-
|
|
5768
|
+
yt as a,
|
|
5779
5769
|
Tr as c,
|
|
5780
5770
|
Yn as g,
|
|
5781
|
-
|
|
5771
|
+
Zt as u
|
|
5782
5772
|
};
|