@solid-labs/fab-one-widget 1.1.0 → 1.1.2
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,14 +1,14 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { createContext as mo, Component as xo, useCallback as
|
|
3
|
-
import { useFrame as
|
|
4
|
-
import { Html as
|
|
1
|
+
import { jsxs as S, jsx as i, Fragment as Ie } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as mo, Component as xo, useCallback as re, useMemo as Y, useState as I, memo as bo, useEffect as q, useRef as ae, forwardRef as yo, createElement as bn } from "react";
|
|
3
|
+
import { useFrame as Mn, useThree as kn, Canvas as wo } from "@react-three/fiber";
|
|
4
|
+
import { Html as Ge, Line as we, OrbitControls as Fn } from "@react-three/drei";
|
|
5
5
|
import * as j from "three";
|
|
6
|
-
import { Plane as
|
|
7
|
-
import { create as
|
|
8
|
-
import { OBJLoader as
|
|
6
|
+
import { Plane as vt, Vector3 as k, Box3 as Pn, Line3 as Ln, Raycaster as So } from "three";
|
|
7
|
+
import { create as vo } from "zustand";
|
|
8
|
+
import { OBJLoader as Dn } from "three/examples/jsm/loaders/OBJLoader.js";
|
|
9
9
|
import { STLLoader as Co } from "three/examples/jsm/loaders/STLLoader.js";
|
|
10
10
|
import { MeshBVH as Ct } from "three-mesh-bvh";
|
|
11
|
-
let Hr, yt, Fr,
|
|
11
|
+
let Hr, yt, Fr, On;
|
|
12
12
|
let __tla = (async () => {
|
|
13
13
|
const zo = {
|
|
14
14
|
showDragDrop: true,
|
|
@@ -28,7 +28,7 @@ let __tla = (async () => {
|
|
|
28
28
|
showNavigation: false,
|
|
29
29
|
showToolbar: false,
|
|
30
30
|
showSaveButton: false
|
|
31
|
-
},
|
|
31
|
+
}, Mo = mo(zo), Gt = vo((t, r) => ({
|
|
32
32
|
landmarkPoints: [],
|
|
33
33
|
isAligned: false,
|
|
34
34
|
isCut: false,
|
|
@@ -64,7 +64,7 @@ let __tla = (async () => {
|
|
|
64
64
|
isAligned: false,
|
|
65
65
|
isCut: false
|
|
66
66
|
})
|
|
67
|
-
})),
|
|
67
|
+
})), ko = 0.45, zt = 3, Vt = 1e-3, wt = 25.4, Fo = [
|
|
68
68
|
0.25,
|
|
69
69
|
-0.25,
|
|
70
70
|
0.5,
|
|
@@ -97,45 +97,45 @@ let __tla = (async () => {
|
|
|
97
97
|
const D = r[z * 3] * o, B = r[z * 3 + 1] * o, $ = r[z * 3 + 2] * o;
|
|
98
98
|
D < e && (e = D), D > f && (f = D), B < h && (h = B), B > u && (u = B), $ < d && (d = $), $ > g && (g = $);
|
|
99
99
|
}
|
|
100
|
-
const
|
|
100
|
+
const M = (e + f) * 0.5, p = (h + u) * 0.5, b = (d + g) * 0.5, m = f - e + 1e-6, P = u - h + 1e-6, y = g - d + 1e-6, F = m * 0.5, A = P * 0.5, v = y * 0.5, C = Math.min(128, Math.max(16, Math.round(Math.cbrt(a)))), L = m / C, T = P / C, E = y / C, w = /* @__PURE__ */ new Map();
|
|
101
101
|
for (let z = 0; z < a; z++) {
|
|
102
|
-
const D = r[z * 3] * o -
|
|
103
|
-
let
|
|
104
|
-
|
|
102
|
+
const D = r[z * 3] * o - M, B = r[z * 3 + 1] * o - p, $ = r[z * 3 + 2] * o - b, ee = Math.min(C - 1, Math.max(0, Math.floor((D + F) / L))), ie = Math.min(C - 1, Math.max(0, Math.floor((B + A) / T))), ce = Math.min(C - 1, Math.max(0, Math.floor(($ + v) / E))), U = ee * C * C + ie * C + ce;
|
|
103
|
+
let ne = w.get(U);
|
|
104
|
+
ne || (ne = [], w.set(U, ne)), ne.push(z);
|
|
105
105
|
}
|
|
106
106
|
for (let z = 0; z < l; z++) {
|
|
107
|
-
const D = s.getX(z), B = s.getY(z), $ = s.getZ(z), ee = Math.min(C - 1, Math.max(0, Math.floor((D + F) / L))),
|
|
108
|
-
let U = 1 / 0,
|
|
107
|
+
const D = s.getX(z), B = s.getY(z), $ = s.getZ(z), ee = Math.min(C - 1, Math.max(0, Math.floor((D + F) / L))), ie = Math.min(C - 1, Math.max(0, Math.floor((B + A) / T))), ce = Math.min(C - 1, Math.max(0, Math.floor(($ + v) / E)));
|
|
108
|
+
let U = 1 / 0, ne = 0;
|
|
109
109
|
for (let J = 0; J <= C && U > 0; J++) {
|
|
110
110
|
for (let Z = -J; Z <= J; Z++) for (let ge = -J; ge <= J; ge++) for (let de = -J; de <= J; de++) {
|
|
111
111
|
if (J > 0 && Math.abs(Z) < J && Math.abs(ge) < J && Math.abs(de) < J) continue;
|
|
112
|
-
const he = ee + Z,
|
|
113
|
-
if (he < 0 || he >= C ||
|
|
114
|
-
const O = w.get(he * C * C +
|
|
112
|
+
const he = ee + Z, Se = ie + ge, te = ce + de;
|
|
113
|
+
if (he < 0 || he >= C || Se < 0 || Se >= C || te < 0 || te >= C) continue;
|
|
114
|
+
const O = w.get(he * C * C + Se * C + te);
|
|
115
115
|
if (O) for (const X of O) {
|
|
116
|
-
const Q = r[X * 3] * o -
|
|
117
|
-
|
|
116
|
+
const Q = r[X * 3] * o - M, ue = r[X * 3 + 1] * o - p, fe = r[X * 3 + 2] * o - b, oe = (D - Q) ** 2 + (B - ue) ** 2 + ($ - fe) ** 2;
|
|
117
|
+
oe < U && (U = oe, ne = X);
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
if (U < 1 / 0) break;
|
|
121
121
|
}
|
|
122
|
-
c[z * 3] = n[
|
|
122
|
+
c[z * 3] = n[ne * 3], c[z * 3 + 1] = n[ne * 3 + 1], c[z * 3 + 2] = n[ne * 3 + 2];
|
|
123
123
|
}
|
|
124
124
|
t.setAttribute("color", new j.Float32BufferAttribute(c, 3));
|
|
125
125
|
}
|
|
126
|
-
const
|
|
126
|
+
const yn = {
|
|
127
127
|
debug: 0,
|
|
128
128
|
info: 1,
|
|
129
129
|
warn: 2,
|
|
130
130
|
error: 3
|
|
131
131
|
};
|
|
132
|
-
let
|
|
132
|
+
let _n = "warn", Rn = null;
|
|
133
133
|
const ye = {
|
|
134
134
|
setLevel(t) {
|
|
135
|
-
|
|
135
|
+
_n = t;
|
|
136
136
|
},
|
|
137
137
|
setHandler(t) {
|
|
138
|
-
|
|
138
|
+
Rn = t;
|
|
139
139
|
},
|
|
140
140
|
debug(t, r, n) {
|
|
141
141
|
mt("debug", t, r, n);
|
|
@@ -151,7 +151,7 @@ let __tla = (async () => {
|
|
|
151
151
|
}
|
|
152
152
|
};
|
|
153
153
|
function mt(t, r, n, o) {
|
|
154
|
-
if (
|
|
154
|
+
if (yn[t] < yn[_n]) return;
|
|
155
155
|
const s = `[${r}]`, l = o !== void 0 ? [
|
|
156
156
|
s,
|
|
157
157
|
n,
|
|
@@ -174,9 +174,9 @@ let __tla = (async () => {
|
|
|
174
174
|
console.error(...l);
|
|
175
175
|
break;
|
|
176
176
|
}
|
|
177
|
-
|
|
177
|
+
Rn == null ? void 0 : Rn(t, r, n, o);
|
|
178
178
|
}
|
|
179
|
-
function
|
|
179
|
+
function St(t) {
|
|
180
180
|
const r = t.getAttribute("position"), n = new Float32Array(r.array), o = t.getIndex();
|
|
181
181
|
if (o) return {
|
|
182
182
|
positions: n,
|
|
@@ -189,7 +189,7 @@ let __tla = (async () => {
|
|
|
189
189
|
indices: l
|
|
190
190
|
};
|
|
191
191
|
}
|
|
192
|
-
function
|
|
192
|
+
function Wn(t, r) {
|
|
193
193
|
const n = new j.BufferGeometry();
|
|
194
194
|
return n.setAttribute("position", new j.Float32BufferAttribute(t, 3)), n.setIndex(new j.BufferAttribute(r, 1)), n.computeVertexNormals(), n;
|
|
195
195
|
}
|
|
@@ -197,21 +197,21 @@ let __tla = (async () => {
|
|
|
197
197
|
try {
|
|
198
198
|
const o = Po(t);
|
|
199
199
|
n == null ? void 0 : n("Parsing mesh...");
|
|
200
|
-
const l = new
|
|
200
|
+
const l = new Dn().parse(t);
|
|
201
201
|
let c = null;
|
|
202
202
|
if (l.traverse((m) => {
|
|
203
203
|
m.isMesh && !c && (c = m.geometry);
|
|
204
204
|
}), !c) return null;
|
|
205
|
-
const { positions: a, indices: e } =
|
|
205
|
+
const { positions: a, indices: e } = St(c);
|
|
206
206
|
if (a.length < 9 || e.length < 3) return ye.warn("wasm", `Mesh too small: positions=${a.length} indices=${e.length}`), null;
|
|
207
207
|
for (let m = 0; m < Math.min(a.length, 300); m++) if (!isFinite(a[m])) return ye.error("wasm", `Invalid position data: NaN/Infinity at index ${m}`), null;
|
|
208
208
|
const h = a.length / 3;
|
|
209
209
|
for (let m = 0; m < Math.min(e.length, 300); m++) if (e[m] >= h) return ye.error("wasm", `Out-of-bounds index: ${e[m]} >= ${h}`), null;
|
|
210
210
|
n == null ? void 0 : n("Processing mesh (WASM)...");
|
|
211
|
-
const d = r.preprocess_mesh(a, e, 10, 1e-4, 500), f = d.positions(), u = d.indices(), g = d.unit_converted(),
|
|
211
|
+
const d = r.preprocess_mesh(a, e, 10, 1e-4, 500), f = d.positions(), u = d.indices(), g = d.unit_converted(), M = d.detected_unit(), p = d.log();
|
|
212
212
|
if (ye.debug("wasm", "preprocess result", p), f.length === 0) return null;
|
|
213
213
|
n == null ? void 0 : n("Building geometry...");
|
|
214
|
-
const b =
|
|
214
|
+
const b = Wn(f, u);
|
|
215
215
|
if (o) {
|
|
216
216
|
const m = g ? 1e3 : 1;
|
|
217
217
|
Lo(b, o.positions, o.colors, m);
|
|
@@ -220,14 +220,14 @@ let __tla = (async () => {
|
|
|
220
220
|
geometry: b,
|
|
221
221
|
wasScaled: g,
|
|
222
222
|
unitConverted: g,
|
|
223
|
-
detectedUnit:
|
|
223
|
+
detectedUnit: M
|
|
224
224
|
};
|
|
225
225
|
} catch (o) {
|
|
226
226
|
return ye.error("wasm", "Processing failed", o), null;
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
229
|
function _o(t) {
|
|
230
|
-
const n = new
|
|
230
|
+
const n = new Dn().parse(t);
|
|
231
231
|
let o = null;
|
|
232
232
|
return n.traverse((s) => {
|
|
233
233
|
s.isMesh && !o && (o = s.geometry);
|
|
@@ -252,12 +252,12 @@ let __tla = (async () => {
|
|
|
252
252
|
for (const o of t) (n.length === 0 || n[n.length - 1].distanceTo(o) > r) && n.push(o.clone());
|
|
253
253
|
return n.length > 2 && n[0].distanceTo(n[n.length - 1]) > r && n.push(n[0].clone()), n;
|
|
254
254
|
}
|
|
255
|
-
function
|
|
255
|
+
function Ke(t) {
|
|
256
256
|
let r = 0;
|
|
257
257
|
for (let n = 0; n < t.length - 1; n++) r += t[n].distanceTo(t[n + 1]);
|
|
258
258
|
return r;
|
|
259
259
|
}
|
|
260
|
-
function
|
|
260
|
+
function In(t, r = 1e-3, n = false) {
|
|
261
261
|
if (!t.length) return [];
|
|
262
262
|
const o = /* @__PURE__ */ new Map(), s = (f) => {
|
|
263
263
|
const u = Ro(f, r);
|
|
@@ -285,13 +285,13 @@ let __tla = (async () => {
|
|
|
285
285
|
l.splice(p, 1), g = true;
|
|
286
286
|
}
|
|
287
287
|
}
|
|
288
|
-
const
|
|
289
|
-
|
|
288
|
+
const M = Wo(u, r);
|
|
289
|
+
M.length > 1 && c.push(M);
|
|
290
290
|
}
|
|
291
291
|
if (!c.length) return [];
|
|
292
292
|
if (n) {
|
|
293
|
-
c.sort((g,
|
|
294
|
-
const f =
|
|
293
|
+
c.sort((g, M) => Ke(M) - Ke(g));
|
|
294
|
+
const f = Ke(c[0]), u = c.filter((g) => Ke(g) >= f * 0.3);
|
|
295
295
|
return u[u.length - 1] ?? c[0];
|
|
296
296
|
}
|
|
297
297
|
const a = c.filter((f) => f.length >= 3 && f[0].distanceTo(f[f.length - 1]) < r * 10), e = a.length > 0 ? a : c;
|
|
@@ -301,21 +301,21 @@ let __tla = (async () => {
|
|
|
301
301
|
let u = 0, g = 0;
|
|
302
302
|
for (const p of f) u += p.x, g += p.z;
|
|
303
303
|
u /= f.length, g /= f.length;
|
|
304
|
-
const
|
|
305
|
-
|
|
304
|
+
const M = Math.sqrt(u * u + g * g);
|
|
305
|
+
M < d && (d = M, h = f);
|
|
306
306
|
}
|
|
307
307
|
return h;
|
|
308
308
|
}
|
|
309
|
-
function
|
|
310
|
-
const s = new
|
|
309
|
+
function wn(t, r, n, o = false) {
|
|
310
|
+
const s = new vt(new k(0, 1, 0), -n), l = [], c = new Pn();
|
|
311
311
|
c.setFromBufferAttribute(r.getAttribute("position"));
|
|
312
312
|
const a = {
|
|
313
313
|
linePoints: [],
|
|
314
314
|
lineLength: 0,
|
|
315
|
-
rightmostPoint: new
|
|
315
|
+
rightmostPoint: new k(0, n, 0)
|
|
316
316
|
};
|
|
317
317
|
if (!s.intersectsBox(c)) return a;
|
|
318
|
-
const e = new
|
|
318
|
+
const e = new Ln(), h = new k();
|
|
319
319
|
t.shapecast({
|
|
320
320
|
intersectsBounds: (p) => s.intersectsBox(p),
|
|
321
321
|
intersectsTriangle: (p) => {
|
|
@@ -326,35 +326,35 @@ let __tla = (async () => {
|
|
|
326
326
|
});
|
|
327
327
|
}
|
|
328
328
|
});
|
|
329
|
-
const d =
|
|
329
|
+
const d = In(l, Vt, o);
|
|
330
330
|
if (d.length < 2) return a;
|
|
331
|
-
const f =
|
|
332
|
-
let u = -1 / 0, g = new
|
|
331
|
+
const f = Ke(d);
|
|
332
|
+
let u = -1 / 0, g = new k(0, n, 0);
|
|
333
333
|
for (const p of d) p.x > u && (u = p.x, g = p.clone());
|
|
334
|
-
const
|
|
334
|
+
const M = d.length > 2 && d[0].distanceTo(d[d.length - 1]) < Vt * 10;
|
|
335
335
|
return {
|
|
336
336
|
linePoints: d,
|
|
337
337
|
lineLength: f,
|
|
338
338
|
rightmostPoint: g,
|
|
339
|
-
isClosed:
|
|
339
|
+
isClosed: M
|
|
340
340
|
};
|
|
341
341
|
}
|
|
342
|
-
function
|
|
343
|
-
const s =
|
|
342
|
+
function je(t, r, n, o = false) {
|
|
343
|
+
const s = wn(t, r, n, o);
|
|
344
344
|
if (s.isClosed && s.linePoints.length >= 3) return s;
|
|
345
345
|
ye.debug("slice", `y=${n.toFixed(2)} failed (pts=${s.linePoints.length}, closed=${s.isClosed}), retrying...`);
|
|
346
346
|
let l = s;
|
|
347
347
|
for (const c of Fo) {
|
|
348
|
-
const a =
|
|
348
|
+
const a = wn(t, r, n + c, o);
|
|
349
349
|
if (a.isClosed && a.linePoints.length >= 3) return ye.debug("slice", `y=${n.toFixed(2)} recovered with offset ${c > 0 ? "+" : ""}${c}mm (pts=${a.linePoints.length}, len=${a.lineLength.toFixed(1)}mm)`), a;
|
|
350
350
|
a.linePoints.length > l.linePoints.length && (l = a);
|
|
351
351
|
}
|
|
352
352
|
return ye.warn("slice", `y=${n.toFixed(2)} all retries exhausted (pts=${l.linePoints.length}, closed=${l.isClosed})`), l;
|
|
353
353
|
}
|
|
354
354
|
function Io(t, r, n, o) {
|
|
355
|
-
const s = new
|
|
355
|
+
const s = new vt().setFromNormalAndCoplanarPoint(o.clone().normalize(), n), l = new Pn();
|
|
356
356
|
if (l.setFromBufferAttribute(r.getAttribute("position")), !s.intersectsBox(l)) return 0;
|
|
357
|
-
const c = [], a = new
|
|
357
|
+
const c = [], a = new Ln(), e = new k();
|
|
358
358
|
t.shapecast({
|
|
359
359
|
intersectsBounds: (d) => s.intersectsBox(d),
|
|
360
360
|
intersectsTriangle: (d) => {
|
|
@@ -365,8 +365,8 @@ let __tla = (async () => {
|
|
|
365
365
|
});
|
|
366
366
|
}
|
|
367
367
|
});
|
|
368
|
-
const h =
|
|
369
|
-
return
|
|
368
|
+
const h = In(c, Vt);
|
|
369
|
+
return Ke(h);
|
|
370
370
|
}
|
|
371
371
|
function jt(t) {
|
|
372
372
|
return new Ct(t, {
|
|
@@ -390,7 +390,7 @@ let __tla = (async () => {
|
|
|
390
390
|
};
|
|
391
391
|
const a = new Ct(t, {
|
|
392
392
|
maxLeafTris: zt
|
|
393
|
-
}), e =
|
|
393
|
+
}), e = je(a, t, r);
|
|
394
394
|
if (e.lineLength === 0) return {
|
|
395
395
|
valid: false,
|
|
396
396
|
reason: "No circumference at green point \u2014 mesh may be empty at that height"
|
|
@@ -400,7 +400,7 @@ let __tla = (async () => {
|
|
|
400
400
|
valid: true,
|
|
401
401
|
reason: ""
|
|
402
402
|
};
|
|
403
|
-
const d =
|
|
403
|
+
const d = je(a, t, h);
|
|
404
404
|
if (e.lineLength > 0 && d.lineLength > 0) {
|
|
405
405
|
const u = e.lineLength / d.lineLength;
|
|
406
406
|
if (u < 0.5) return {
|
|
@@ -410,7 +410,7 @@ let __tla = (async () => {
|
|
|
410
410
|
}
|
|
411
411
|
const f = r - o * 2;
|
|
412
412
|
if (f > n) {
|
|
413
|
-
const u =
|
|
413
|
+
const u = je(a, t, f);
|
|
414
414
|
if (d.lineLength > 0 && u.lineLength > 0) {
|
|
415
415
|
const g = d.lineLength / u.lineLength;
|
|
416
416
|
if (g < 0.5) return {
|
|
@@ -424,31 +424,31 @@ let __tla = (async () => {
|
|
|
424
424
|
reason: ""
|
|
425
425
|
};
|
|
426
426
|
}
|
|
427
|
-
const
|
|
427
|
+
const Me = "pipeline";
|
|
428
428
|
function Eo(t, r, n, o) {
|
|
429
429
|
var _a, _b, _c, _d;
|
|
430
430
|
const s = t.geometry.clone(), l = r.map((a) => ({
|
|
431
431
|
...a
|
|
432
432
|
})), c = o.wasmModule;
|
|
433
433
|
try {
|
|
434
|
-
let a = t.geometry, e = l.map((O) => new
|
|
434
|
+
let a = t.geometry, e = l.map((O) => new k(O.position.x, O.position.y, O.position.z));
|
|
435
435
|
const h = e[0], d = e[1];
|
|
436
436
|
if (!c) {
|
|
437
|
-
o.onStatus("Aligning mesh (JS fallback)..."), ye.warn(
|
|
438
|
-
const O = new
|
|
437
|
+
o.onStatus("Aligning mesh (JS fallback)..."), ye.warn(Me, "WASM not available, using JS fallback alignment");
|
|
438
|
+
const O = new k(0, 1, 0), X = new k().subVectors(d, h).normalize(), Q = X.dot(O), ue = new k().crossVectors(X, O);
|
|
439
439
|
if (ue.length() > 1e-4) {
|
|
440
440
|
ue.normalize();
|
|
441
441
|
const V = new j.Quaternion().setFromAxisAngle(ue, Math.acos(Math.min(1, Math.max(-1, Q))));
|
|
442
|
-
a.applyMatrix4(new j.Matrix4().makeRotationFromQuaternion(V)), e = e.map((
|
|
442
|
+
a.applyMatrix4(new j.Matrix4().makeRotationFromQuaternion(V)), e = e.map((ke) => ke.clone().applyQuaternion(V));
|
|
443
443
|
}
|
|
444
444
|
if (e[0].y > e[1].y) {
|
|
445
|
-
const V = new j.Quaternion().setFromAxisAngle(new
|
|
446
|
-
a.applyMatrix4(new j.Matrix4().makeRotationFromQuaternion(V)), e = e.map((
|
|
445
|
+
const V = new j.Quaternion().setFromAxisAngle(new k(1, 0, 0), Math.PI);
|
|
446
|
+
a.applyMatrix4(new j.Matrix4().makeRotationFromQuaternion(V)), e = e.map((ke) => ke.clone().applyQuaternion(V));
|
|
447
447
|
}
|
|
448
448
|
const fe = e[0].clone();
|
|
449
|
-
a.translate(-fe.x, -fe.y, -fe.z), e = e.map((V) => new
|
|
450
|
-
const
|
|
451
|
-
e.push(
|
|
449
|
+
a.translate(-fe.x, -fe.y, -fe.z), e = e.map((V) => new k(V.x - fe.x, V.y - fe.y, V.z - fe.z)), a.computeVertexNormals(), a.computeBoundingBox();
|
|
450
|
+
const oe = new k(e[0].x, e[0].y, e[0].z);
|
|
451
|
+
e.push(oe), o.addLandmarkPoint({
|
|
452
452
|
faceIndex: -1,
|
|
453
453
|
vertexIndices: [
|
|
454
454
|
0,
|
|
@@ -456,9 +456,9 @@ let __tla = (async () => {
|
|
|
456
456
|
2
|
|
457
457
|
],
|
|
458
458
|
position: {
|
|
459
|
-
x:
|
|
460
|
-
y:
|
|
461
|
-
z:
|
|
459
|
+
x: oe.x,
|
|
460
|
+
y: oe.y,
|
|
461
|
+
z: oe.z
|
|
462
462
|
},
|
|
463
463
|
barycentricCoords: {
|
|
464
464
|
u: 0.33,
|
|
@@ -470,36 +470,36 @@ let __tla = (async () => {
|
|
|
470
470
|
y: V.y,
|
|
471
471
|
z: V.z
|
|
472
472
|
}))), o.setAligned(true), o.setCut(true), o.setAdjustedStartY(null), o.setAdjustedEndY(null), o.setOriginalEndY(e[1].y + 2 * wt);
|
|
473
|
-
const G = new
|
|
473
|
+
const G = new k();
|
|
474
474
|
a.computeBoundingBox(), a.boundingBox.getSize(G), o.setModelSize(Math.max(G.x, G.y, G.z)), s.dispose();
|
|
475
475
|
return;
|
|
476
476
|
}
|
|
477
|
-
const { positions: f, indices: u } =
|
|
477
|
+
const { positions: f, indices: u } = St(a), g = new Float32Array([
|
|
478
478
|
h.x,
|
|
479
479
|
h.y,
|
|
480
480
|
h.z
|
|
481
|
-
]),
|
|
481
|
+
]), M = new Float32Array([
|
|
482
482
|
d.x,
|
|
483
483
|
d.y,
|
|
484
484
|
d.z
|
|
485
485
|
]);
|
|
486
486
|
o.onStatus("Detecting shell type...");
|
|
487
|
-
const p = c.detect_shell(f, u,
|
|
488
|
-
ye.info(
|
|
487
|
+
const p = c.detect_shell(f, u, M, 40), b = p.is_double_shell(), m = p.surface_normal();
|
|
488
|
+
ye.info(Me, `Shell: ${b ? "DOUBLE" : "SINGLE"}`, p.details()), (_a = o.setDoubleShell) == null ? void 0 : _a.call(o, b), o.onStatus("Finding cross-section plane...");
|
|
489
489
|
const P = new Float32Array([
|
|
490
490
|
m[0],
|
|
491
491
|
m[1],
|
|
492
492
|
m[2]
|
|
493
|
-
]), y = c.find_min_cross_section(f, u,
|
|
494
|
-
ye.info(
|
|
493
|
+
]), y = c.find_min_cross_section(f, u, M, P, 10), F = y.plane_normal();
|
|
494
|
+
ye.info(Me, "Cross-section found", y.details()), o.onStatus("Aligning mesh...");
|
|
495
495
|
const A = new Float32Array([
|
|
496
496
|
F[0],
|
|
497
497
|
F[1],
|
|
498
498
|
F[2]
|
|
499
|
-
]),
|
|
500
|
-
let C =
|
|
501
|
-
const E =
|
|
502
|
-
ye.info(
|
|
499
|
+
]), v = c.align_to_origin(f, g, M, A);
|
|
500
|
+
let C = v.positions(), L = v.mpt(), T = v.origin();
|
|
501
|
+
const E = v.transform();
|
|
502
|
+
ye.info(Me, "Alignment complete", v.details());
|
|
503
503
|
const w = [
|
|
504
504
|
E[3],
|
|
505
505
|
E[4],
|
|
@@ -517,33 +517,33 @@ let __tla = (async () => {
|
|
|
517
517
|
]);
|
|
518
518
|
o.onStatus("Generating measurement points...");
|
|
519
519
|
const D = c.subdivide_origin_to_plane(new Float32Array(T), new Float32Array(L), z);
|
|
520
|
-
ye.debug(
|
|
521
|
-
const B = D.points(), $ = D.count(), ee = 2,
|
|
522
|
-
for (let O = ee; O < $ -
|
|
520
|
+
ye.debug(Me, `Subdivide: ${D.count()} pts, spacing=${D.spacing().toFixed(1)}mm`);
|
|
521
|
+
const B = D.points(), $ = D.count(), ee = 2, ie = 1, ce = [];
|
|
522
|
+
for (let O = ee; O < $ - ie; O++) ce.push(B[O * 3 + 1]);
|
|
523
523
|
o.onStatus("Computing cross-sections...");
|
|
524
524
|
let U = [];
|
|
525
525
|
if (ce.length >= 2) {
|
|
526
526
|
const X = (b ? c.batch_cross_sections_y_inner.bind(c) : c.batch_cross_sections_y.bind(c))(C, u, new Float32Array(ce), 10);
|
|
527
|
-
ye.debug(
|
|
527
|
+
ye.debug(Me, "Batch (subdivision)", X.details());
|
|
528
528
|
const Q = X.all_loop_points(), ue = X.offsets(), fe = X.circumferences();
|
|
529
|
-
for (let
|
|
530
|
-
const G = ue[
|
|
531
|
-
if (V <= G || fe[
|
|
532
|
-
const
|
|
533
|
-
if (
|
|
534
|
-
let Ae = 0,
|
|
535
|
-
for (let ze = G; ze < V; ze += 3) Ae += Q[ze],
|
|
536
|
-
U.push(Ae /
|
|
529
|
+
for (let oe = 0; oe < ue.length - 1; oe++) {
|
|
530
|
+
const G = ue[oe], V = ue[oe + 1];
|
|
531
|
+
if (V <= G || fe[oe] <= 0) continue;
|
|
532
|
+
const ke = (V - G) / 3;
|
|
533
|
+
if (ke < 3) continue;
|
|
534
|
+
let Ae = 0, Xe = 0, me = 0;
|
|
535
|
+
for (let ze = G; ze < V; ze += 3) Ae += Q[ze], Xe += Q[ze + 1], me += Q[ze + 2];
|
|
536
|
+
U.push(Ae / ke, Xe / ke, me / ke);
|
|
537
537
|
}
|
|
538
538
|
}
|
|
539
539
|
if (U.length >= 6) {
|
|
540
540
|
o.onStatus("Refining alignment...");
|
|
541
541
|
const O = c.refine_alignment(new Float32Array(U), C, new Float32Array(T), new Float32Array(L));
|
|
542
|
-
ye.info(
|
|
542
|
+
ye.info(Me, "Refinement complete", O.details()), C = O.positions(), L = O.mpt(), T = O.origin();
|
|
543
543
|
}
|
|
544
|
-
const
|
|
545
|
-
|
|
546
|
-
const Z = new
|
|
544
|
+
const ne = a.getAttribute("color"), J = Wn(C, u);
|
|
545
|
+
ne && J.setAttribute("color", ne), a.dispose(), a = J, t.geometry = a, a.computeVertexNormals(), a.computeBoundingBox(), e[0] = new k(T[0], T[1], T[2]), e[1] = new k(L[0], L[1], L[2]), o.onStatus("Setting blue point...");
|
|
546
|
+
const Z = new k(e[0].x, e[0].y, e[0].z);
|
|
547
547
|
e.push(Z), o.addLandmarkPoint({
|
|
548
548
|
faceIndex: -1,
|
|
549
549
|
vertexIndices: [
|
|
@@ -566,13 +566,13 @@ let __tla = (async () => {
|
|
|
566
566
|
y: O.y,
|
|
567
567
|
z: O.z
|
|
568
568
|
}))), o.setAligned(true);
|
|
569
|
-
const ge = a.boundingBox, de = new
|
|
569
|
+
const ge = a.boundingBox, de = new k();
|
|
570
570
|
ge.getSize(de), o.setModelSize(Math.max(de.x, de.y, de.z)), o.setCut(true), o.setAdjustedStartY(null), o.setAdjustedEndY(null), o.setOriginalEndY(e[1].y + 2 * wt), o.onStatus("Computing final measurements...");
|
|
571
571
|
{
|
|
572
|
-
const O =
|
|
572
|
+
const O = St(a), X = e[1].y, Q = e[0].y;
|
|
573
573
|
let ue = 1 / 0, fe = -1 / 0;
|
|
574
|
-
const
|
|
575
|
-
for (let me = 1; me <
|
|
574
|
+
const oe = O.positions;
|
|
575
|
+
for (let me = 1; me < oe.length; me += 3) oe[me] < ue && (ue = oe[me]), oe[me] > fe && (fe = oe[me]);
|
|
576
576
|
const G = 25.4, V = [];
|
|
577
577
|
V.push(X);
|
|
578
578
|
for (let me = 1; me <= 2; me++) {
|
|
@@ -580,10 +580,10 @@ let __tla = (async () => {
|
|
|
580
580
|
ze < fe - 1 && V.push(ze);
|
|
581
581
|
}
|
|
582
582
|
for (let me = X - G; me > Q; me -= G) V.push(me);
|
|
583
|
-
V.sort((me, ze) => me - ze), ye.info(
|
|
583
|
+
V.sort((me, ze) => me - ze), ye.info(Me, `Horizontal slices: ${V.length} Y planes, range ${(_b = V[0]) == null ? void 0 : _b.toFixed(1)} \u2192 ${(_c = V[V.length - 1]) == null ? void 0 : _c.toFixed(1)} mm`);
|
|
584
584
|
const Ae = (b ? c.batch_cross_sections_y_inner.bind(c) : c.batch_cross_sections_y.bind(c))(O.positions, O.indices, new Float32Array(V), 10);
|
|
585
|
-
ye.info(
|
|
586
|
-
const
|
|
585
|
+
ye.info(Me, `Horizontal slices (${b ? "inner" : "outer"}): ${Ae.count()}/${V.length} valid`), ye.debug(Me, "Slice details", Ae.details());
|
|
586
|
+
const Xe = {
|
|
587
587
|
yValues: V,
|
|
588
588
|
circumferences: Array.from(Ae.circumferences()),
|
|
589
589
|
allLoopPoints: new Float32Array(Ae.all_loop_points()),
|
|
@@ -591,13 +591,13 @@ let __tla = (async () => {
|
|
|
591
591
|
mptY: X,
|
|
592
592
|
originY: Q
|
|
593
593
|
};
|
|
594
|
-
(_d = o.setWasmSlices) == null ? void 0 : _d.call(o,
|
|
594
|
+
(_d = o.setWasmSlices) == null ? void 0 : _d.call(o, Xe);
|
|
595
595
|
}
|
|
596
596
|
o.onStatus("Validating results...");
|
|
597
|
-
const he = e[1].y,
|
|
598
|
-
te.valid || ye.warn(
|
|
597
|
+
const he = e[1].y, Se = e[0].y, te = Bo(a, he, Se, n);
|
|
598
|
+
te.valid || ye.warn(Me, `Validation: ${te.reason}`), o.setClippedReferenceGeometry ? (s.computeVertexNormals(), o.setClippedReferenceGeometry(s)) : s.dispose();
|
|
599
599
|
} catch (a) {
|
|
600
|
-
ye.error(
|
|
600
|
+
ye.error(Me, "Processing failed", a), o.setError(a instanceof Error ? a.message : "Failed to process mesh."), s.dispose();
|
|
601
601
|
}
|
|
602
602
|
}
|
|
603
603
|
class To extends xo {
|
|
@@ -619,7 +619,7 @@ let __tla = (async () => {
|
|
|
619
619
|
console.error("[ErrorBoundary] Caught error:", r, n.componentStack);
|
|
620
620
|
}
|
|
621
621
|
render() {
|
|
622
|
-
return this.state.error ? this.props.fallback ? this.props.fallback(this.state.error, this.reset) :
|
|
622
|
+
return this.state.error ? this.props.fallback ? this.props.fallback(this.state.error, this.reset) : S("div", {
|
|
623
623
|
style: {
|
|
624
624
|
display: "flex",
|
|
625
625
|
flexDirection: "column",
|
|
@@ -667,7 +667,7 @@ let __tla = (async () => {
|
|
|
667
667
|
}) : this.props.children;
|
|
668
668
|
}
|
|
669
669
|
}
|
|
670
|
-
const $o = ({ message: t, onDismiss: r }) =>
|
|
670
|
+
const $o = ({ message: t, onDismiss: r }) => S("div", {
|
|
671
671
|
style: {
|
|
672
672
|
position: "absolute",
|
|
673
673
|
top: 16,
|
|
@@ -684,7 +684,7 @@ let __tla = (async () => {
|
|
|
684
684
|
gap: 12
|
|
685
685
|
},
|
|
686
686
|
children: [
|
|
687
|
-
|
|
687
|
+
S("div", {
|
|
688
688
|
style: {
|
|
689
689
|
flex: 1
|
|
690
690
|
},
|
|
@@ -720,7 +720,7 @@ let __tla = (async () => {
|
|
|
720
720
|
children: "x"
|
|
721
721
|
})
|
|
722
722
|
]
|
|
723
|
-
}),
|
|
723
|
+
}), Sn = ({ message: t }) => S("div", {
|
|
724
724
|
style: {
|
|
725
725
|
position: "absolute",
|
|
726
726
|
top: 0,
|
|
@@ -759,19 +759,19 @@ let __tla = (async () => {
|
|
|
759
759
|
]
|
|
760
760
|
});
|
|
761
761
|
function Oo(t, r, n, o) {
|
|
762
|
-
const s = new
|
|
762
|
+
const s = new k().subVectors(n, r), l = new k().subVectors(o, r), c = new k().subVectors(t, r), a = s.dot(s), e = s.dot(l), h = s.dot(c), d = l.dot(l), f = l.dot(c), u = 1 / (a * d - e * e), g = (d * h - e * f) * u, M = (a * f - e * h) * u;
|
|
763
763
|
return {
|
|
764
|
-
u: 1 - g -
|
|
764
|
+
u: 1 - g - M,
|
|
765
765
|
v: g,
|
|
766
|
-
w:
|
|
766
|
+
w: M
|
|
767
767
|
};
|
|
768
768
|
}
|
|
769
769
|
const Ho = ({ mesh: t, maxPoints: r = 2, meshColor: n = "#c8c8c8", meshOpacity: o = 1, frontFaceOnly: s = false, doubleShellTransparency: l = false }) => {
|
|
770
|
-
const { addLandmarkPoint: c, landmarkPoints: a } = Gt(), e =
|
|
770
|
+
const { addLandmarkPoint: c, landmarkPoints: a } = Gt(), e = re((g) => {
|
|
771
771
|
if (a.length >= r) return;
|
|
772
772
|
g.stopPropagation();
|
|
773
|
-
const
|
|
774
|
-
if (!
|
|
773
|
+
const M = g.intersections[0], p = M == null ? void 0 : M.faceIndex;
|
|
774
|
+
if (!M || p == null) return;
|
|
775
775
|
const b = t.geometry, m = b.index;
|
|
776
776
|
let P;
|
|
777
777
|
m ? P = [
|
|
@@ -783,9 +783,9 @@ let __tla = (async () => {
|
|
|
783
783
|
p * 3 + 1,
|
|
784
784
|
p * 3 + 2
|
|
785
785
|
];
|
|
786
|
-
const y = b.getAttribute("position"), F = new
|
|
787
|
-
F.applyMatrix4(t.matrixWorld), A.applyMatrix4(t.matrixWorld),
|
|
788
|
-
const C =
|
|
786
|
+
const y = b.getAttribute("position"), F = new k().fromBufferAttribute(y, P[0]), A = new k().fromBufferAttribute(y, P[1]), v = new k().fromBufferAttribute(y, P[2]);
|
|
787
|
+
F.applyMatrix4(t.matrixWorld), A.applyMatrix4(t.matrixWorld), v.applyMatrix4(t.matrixWorld);
|
|
788
|
+
const C = M.point, L = Oo(C, F, A, v), T = {
|
|
789
789
|
faceIndex: p,
|
|
790
790
|
vertexIndices: P,
|
|
791
791
|
position: {
|
|
@@ -828,7 +828,7 @@ let __tla = (async () => {
|
|
|
828
828
|
});
|
|
829
829
|
}, No = ({ point: t, index: r, markerSize: n, color: o, label: s }) => {
|
|
830
830
|
const [l, c] = I(false);
|
|
831
|
-
return
|
|
831
|
+
return S("mesh", {
|
|
832
832
|
position: [
|
|
833
833
|
t.position.x,
|
|
834
834
|
t.position.y,
|
|
@@ -847,7 +847,7 @@ let __tla = (async () => {
|
|
|
847
847
|
i("meshBasicMaterial", {
|
|
848
848
|
color: o
|
|
849
849
|
}),
|
|
850
|
-
l && i(
|
|
850
|
+
l && i(Ge, {
|
|
851
851
|
center: true,
|
|
852
852
|
style: {
|
|
853
853
|
pointerEvents: "none"
|
|
@@ -875,7 +875,7 @@ let __tla = (async () => {
|
|
|
875
875
|
"#4444ff"
|
|
876
876
|
], c = r ?? [
|
|
877
877
|
"MPT",
|
|
878
|
-
"
|
|
878
|
+
"Distal Most Point",
|
|
879
879
|
"Cut Plane"
|
|
880
880
|
];
|
|
881
881
|
return i(Ie, {
|
|
@@ -888,7 +888,7 @@ let __tla = (async () => {
|
|
|
888
888
|
}, e))
|
|
889
889
|
});
|
|
890
890
|
};
|
|
891
|
-
function
|
|
891
|
+
function Bn(t) {
|
|
892
892
|
return Y(() => t ? new Ct(t, {
|
|
893
893
|
maxLeafTris: zt
|
|
894
894
|
}) : null, [
|
|
@@ -898,21 +898,21 @@ let __tla = (async () => {
|
|
|
898
898
|
const vn = (t, r) => {
|
|
899
899
|
const n = Math.abs(t - r);
|
|
900
900
|
return n <= 7 ? "#8BC34A" : n <= 20 ? "#FFC107" : "#FF5722";
|
|
901
|
-
},
|
|
902
|
-
if (t <= 7) return
|
|
901
|
+
}, Cn = new j.Color("#8BC34A"), zn = new j.Color("#FFC107"), jo = new j.Color("#FF5722"), Go = (t) => {
|
|
902
|
+
if (t <= 7) return Cn.clone();
|
|
903
903
|
if (t <= 20) {
|
|
904
904
|
const n = (t - 7) / 13;
|
|
905
|
-
return
|
|
905
|
+
return Cn.clone().lerp(zn, n);
|
|
906
906
|
}
|
|
907
907
|
const r = Math.min((t - 20) / 20, 1);
|
|
908
|
-
return
|
|
908
|
+
return zn.clone().lerp(jo, r);
|
|
909
909
|
}, Xo = (t, r) => {
|
|
910
910
|
const n = t.length, o = new Float32Array(n * 2 * 3), s = new Float32Array(n * 2 * 3), l = [];
|
|
911
911
|
for (let e = 0; e < n; e++) {
|
|
912
912
|
const h = t[e], d = r[e], f = h.distanceTo(d), u = Go(f);
|
|
913
913
|
if (o[e * 6] = h.x, o[e * 6 + 1] = h.y, o[e * 6 + 2] = h.z, s[e * 6] = u.r, s[e * 6 + 1] = u.g, s[e * 6 + 2] = u.b, o[e * 6 + 3] = d.x, o[e * 6 + 4] = d.y, o[e * 6 + 5] = d.z, s[e * 6 + 3] = u.r, s[e * 6 + 4] = u.g, s[e * 6 + 5] = u.b, e < n - 1) {
|
|
914
|
-
const g = e * 2,
|
|
915
|
-
l.push(g,
|
|
914
|
+
const g = e * 2, M = g + 1, p = (e + 1) * 2, b = p + 1;
|
|
915
|
+
l.push(g, M, p, M, b, p);
|
|
916
916
|
}
|
|
917
917
|
}
|
|
918
918
|
const c = new j.BufferGeometry();
|
|
@@ -927,20 +927,20 @@ let __tla = (async () => {
|
|
|
927
927
|
});
|
|
928
928
|
return new j.Mesh(c, a);
|
|
929
929
|
}, Yo = ({ bvh: t, geometry: r, yPosition: n, color: o = "#00ff00", labelX: s, onDataChange: l, displayUnit: c = "mm", useInnerSurface: a = false, formValue: e, lineWidth: h = 1.5, wasmLoopPoints: d, wasmCircumference: f }) => {
|
|
930
|
-
const u = Y(() => d && f != null ? null :
|
|
930
|
+
const u = Y(() => d && f != null ? null : je(t, r, n, a), [
|
|
931
931
|
t,
|
|
932
932
|
r,
|
|
933
933
|
n,
|
|
934
934
|
a,
|
|
935
935
|
d,
|
|
936
936
|
f
|
|
937
|
-
]), g = d ?? (u == null ? void 0 : u.linePoints) ?? [],
|
|
938
|
-
if (e == null || e === 0 ||
|
|
939
|
-
const y = e /
|
|
940
|
-
return g.map((
|
|
937
|
+
]), g = d ?? (u == null ? void 0 : u.linePoints) ?? [], M = f ?? (u == null ? void 0 : u.lineLength) ?? 0, p = Y(() => {
|
|
938
|
+
if (e == null || e === 0 || M <= 0 || g.length < 2) return null;
|
|
939
|
+
const y = e / M, F = g.reduce((v, C) => v + C.x, 0) / g.length, A = g.reduce((v, C) => v + C.z, 0) / g.length;
|
|
940
|
+
return g.map((v) => new k(F + (v.x - F) * y, v.y, A + (v.z - A) * y));
|
|
941
941
|
}, [
|
|
942
942
|
g,
|
|
943
|
-
|
|
943
|
+
M,
|
|
944
944
|
e
|
|
945
945
|
]), b = Y(() => !p || g.length < 2 ? null : Xo(g, p), [
|
|
946
946
|
g,
|
|
@@ -967,33 +967,33 @@ let __tla = (async () => {
|
|
|
967
967
|
}, [
|
|
968
968
|
P
|
|
969
969
|
]), q(() => {
|
|
970
|
-
|
|
970
|
+
M > 0 && (l == null ? void 0 : l({
|
|
971
971
|
yPosition: n,
|
|
972
|
-
originalValue:
|
|
972
|
+
originalValue: M,
|
|
973
973
|
modifiedValue: null
|
|
974
974
|
}));
|
|
975
975
|
}, [
|
|
976
|
-
|
|
976
|
+
M,
|
|
977
977
|
n,
|
|
978
978
|
l
|
|
979
|
-
]),
|
|
979
|
+
]), Mn(({ camera: y }) => {
|
|
980
980
|
if (!m.current || g.length < 2) return;
|
|
981
|
-
const F = new
|
|
981
|
+
const F = new k();
|
|
982
982
|
y.getWorldDirection(F);
|
|
983
|
-
const A = new
|
|
983
|
+
const A = new k(F.x, 0, F.z);
|
|
984
984
|
if (A.lengthSq() < 1e-8) return;
|
|
985
985
|
A.normalize();
|
|
986
|
-
const
|
|
986
|
+
const v = new k().crossVectors(A, new k(0, 1, 0)).normalize();
|
|
987
987
|
let C = -1 / 0, L = g[0];
|
|
988
988
|
for (const z of g) {
|
|
989
|
-
const D =
|
|
989
|
+
const D = v.x * z.x + v.z * z.z;
|
|
990
990
|
D > C && (C = D, L = z);
|
|
991
991
|
}
|
|
992
|
-
const T = s * 0.35, E = new
|
|
992
|
+
const T = s * 0.35, E = new k(L.x + v.x * T, n, L.z + v.z * T);
|
|
993
993
|
m.current.position.copy(E);
|
|
994
994
|
const w = P.geometry.getAttribute("position");
|
|
995
995
|
w.setXYZ(0, L.x, L.y, L.z), w.setXYZ(1, E.x, E.y, E.z), w.needsUpdate = true;
|
|
996
|
-
}), g.length < 2 ? null :
|
|
996
|
+
}), g.length < 2 ? null : S("group", {
|
|
997
997
|
renderOrder: 10,
|
|
998
998
|
children: [
|
|
999
999
|
i(we, {
|
|
@@ -1011,7 +1011,7 @@ let __tla = (async () => {
|
|
|
1011
1011
|
}),
|
|
1012
1012
|
p && e != null && e !== 0 && i(we, {
|
|
1013
1013
|
points: p,
|
|
1014
|
-
color: vn(
|
|
1014
|
+
color: vn(M, e),
|
|
1015
1015
|
lineWidth: 2.5,
|
|
1016
1016
|
dashed: true,
|
|
1017
1017
|
dashSize: 2,
|
|
@@ -1028,7 +1028,7 @@ let __tla = (async () => {
|
|
|
1028
1028
|
}),
|
|
1029
1029
|
i("group", {
|
|
1030
1030
|
ref: m,
|
|
1031
|
-
children: i(
|
|
1031
|
+
children: i(Ge, {
|
|
1032
1032
|
zIndexRange: [
|
|
1033
1033
|
100,
|
|
1034
1034
|
0
|
|
@@ -1037,7 +1037,7 @@ let __tla = (async () => {
|
|
|
1037
1037
|
pointerEvents: "none",
|
|
1038
1038
|
transform: "translateY(-50%)"
|
|
1039
1039
|
},
|
|
1040
|
-
children:
|
|
1040
|
+
children: S("div", {
|
|
1041
1041
|
style: {
|
|
1042
1042
|
display: "flex",
|
|
1043
1043
|
alignItems: "stretch",
|
|
@@ -1047,7 +1047,7 @@ let __tla = (async () => {
|
|
|
1047
1047
|
whiteSpace: "nowrap"
|
|
1048
1048
|
},
|
|
1049
1049
|
children: [
|
|
1050
|
-
|
|
1050
|
+
S("div", {
|
|
1051
1051
|
style: {
|
|
1052
1052
|
display: "flex",
|
|
1053
1053
|
alignItems: "center",
|
|
@@ -1065,7 +1065,7 @@ let __tla = (async () => {
|
|
|
1065
1065
|
minWidth: 52,
|
|
1066
1066
|
textAlign: "right"
|
|
1067
1067
|
},
|
|
1068
|
-
children: c === "inch" ? (
|
|
1068
|
+
children: c === "inch" ? (M / 25.4).toFixed(2) : M.toFixed(1)
|
|
1069
1069
|
}),
|
|
1070
1070
|
i("span", {
|
|
1071
1071
|
style: {
|
|
@@ -1077,9 +1077,9 @@ let __tla = (async () => {
|
|
|
1077
1077
|
})
|
|
1078
1078
|
]
|
|
1079
1079
|
}),
|
|
1080
|
-
e != null && e !== 0 &&
|
|
1081
|
-
const y =
|
|
1082
|
-
return
|
|
1080
|
+
e != null && e !== 0 && M > 0 && (() => {
|
|
1081
|
+
const y = M - e, F = y > 0.5 ? "\u25B2" : y < -0.5 ? "\u25BC" : "", A = vn(M, e);
|
|
1082
|
+
return S("div", {
|
|
1083
1083
|
style: {
|
|
1084
1084
|
display: "flex",
|
|
1085
1085
|
alignItems: "center",
|
|
@@ -1098,7 +1098,7 @@ let __tla = (async () => {
|
|
|
1098
1098
|
},
|
|
1099
1099
|
children: F
|
|
1100
1100
|
}),
|
|
1101
|
-
|
|
1101
|
+
S("span", {
|
|
1102
1102
|
style: {
|
|
1103
1103
|
fontSize: 13,
|
|
1104
1104
|
color: A,
|
|
@@ -1110,7 +1110,7 @@ let __tla = (async () => {
|
|
|
1110
1110
|
c === "inch" ? (y / 25.4).toFixed(2) : y.toFixed(1)
|
|
1111
1111
|
]
|
|
1112
1112
|
}),
|
|
1113
|
-
|
|
1113
|
+
S("span", {
|
|
1114
1114
|
style: {
|
|
1115
1115
|
fontSize: 11,
|
|
1116
1116
|
color: "rgba(255,255,255,0.4)",
|
|
@@ -1131,7 +1131,7 @@ let __tla = (async () => {
|
|
|
1131
1131
|
]
|
|
1132
1132
|
});
|
|
1133
1133
|
}, Zo = bo(Yo), Ko = ({ mesh: t, startY: r, endY: n, spacing: o, modelSize: s, onMeasurementsChange: l, reverseOrder: c = false, displayUnit: a = "mm", useInnerSurface: e = false, formMeasurements: h, originY: d, wasmSlices: f }) => {
|
|
1134
|
-
const u = ae(/* @__PURE__ */ new Map()), g = t.geometry,
|
|
1134
|
+
const u = ae(/* @__PURE__ */ new Map()), g = t.geometry, M = Bn(g), p = Y(() => {
|
|
1135
1135
|
if (f) {
|
|
1136
1136
|
let C = [
|
|
1137
1137
|
...f.yValues
|
|
@@ -1146,8 +1146,8 @@ let __tla = (async () => {
|
|
|
1146
1146
|
return c ? C.sort((L, T) => T - L) : C.sort((L, T) => L - T), C;
|
|
1147
1147
|
}
|
|
1148
1148
|
const A = [];
|
|
1149
|
-
if (c) for (let
|
|
1150
|
-
else for (let
|
|
1149
|
+
if (c) for (let v = n; v >= r; v -= o) A.push(v);
|
|
1150
|
+
else for (let v = r; v <= n; v += o) A.push(v);
|
|
1151
1151
|
return A;
|
|
1152
1152
|
}, [
|
|
1153
1153
|
r,
|
|
@@ -1157,12 +1157,12 @@ let __tla = (async () => {
|
|
|
1157
1157
|
f
|
|
1158
1158
|
]), b = Y(() => {
|
|
1159
1159
|
if (!f) return null;
|
|
1160
|
-
const A = /* @__PURE__ */ new Map(), { allLoopPoints:
|
|
1160
|
+
const A = /* @__PURE__ */ new Map(), { allLoopPoints: v, offsets: C, yValues: L } = f;
|
|
1161
1161
|
for (let T = 0; T < C.length - 1; T++) {
|
|
1162
1162
|
const E = C[T], w = C[T + 1];
|
|
1163
1163
|
if (w <= E) continue;
|
|
1164
1164
|
const z = [];
|
|
1165
|
-
for (let D = E; D < w; D += 3) z.push(new
|
|
1165
|
+
for (let D = E; D < w; D += 3) z.push(new k(v[D], v[D + 1], v[D + 2]));
|
|
1166
1166
|
z.length >= 3 && A.set(L[T], z);
|
|
1167
1167
|
}
|
|
1168
1168
|
return A;
|
|
@@ -1171,7 +1171,7 @@ let __tla = (async () => {
|
|
|
1171
1171
|
]), m = Y(() => {
|
|
1172
1172
|
if (!f) return null;
|
|
1173
1173
|
const A = /* @__PURE__ */ new Map();
|
|
1174
|
-
for (let
|
|
1174
|
+
for (let v = 0; v < f.yValues.length; v++) A.set(f.yValues[v], f.circumferences[v]);
|
|
1175
1175
|
return A;
|
|
1176
1176
|
}, [
|
|
1177
1177
|
f
|
|
@@ -1182,9 +1182,9 @@ let __tla = (async () => {
|
|
|
1182
1182
|
p
|
|
1183
1183
|
]), q(() => {
|
|
1184
1184
|
if (!m || !l) return;
|
|
1185
|
-
const A = p.filter((
|
|
1186
|
-
yPosition:
|
|
1187
|
-
originalValue: m.get(
|
|
1185
|
+
const A = p.filter((v) => (m.get(v) ?? 0) > 0).map((v) => ({
|
|
1186
|
+
yPosition: v,
|
|
1187
|
+
originalValue: m.get(v) ?? 0,
|
|
1188
1188
|
modifiedValue: null
|
|
1189
1189
|
}));
|
|
1190
1190
|
l(A);
|
|
@@ -1195,27 +1195,27 @@ let __tla = (async () => {
|
|
|
1195
1195
|
]);
|
|
1196
1196
|
const P = [
|
|
1197
1197
|
"#5B9BD5"
|
|
1198
|
-
], y = s *
|
|
1198
|
+
], y = s * ko, F = re((A) => {
|
|
1199
1199
|
if (m) return;
|
|
1200
1200
|
u.current.set(A.yPosition, A);
|
|
1201
|
-
const
|
|
1202
|
-
l == null ? void 0 : l(
|
|
1201
|
+
const v = Array.from(u.current.values()).sort((C, L) => c ? L.yPosition - C.yPosition : C.yPosition - L.yPosition);
|
|
1202
|
+
l == null ? void 0 : l(v);
|
|
1203
1203
|
}, [
|
|
1204
1204
|
l,
|
|
1205
1205
|
c,
|
|
1206
1206
|
m
|
|
1207
1207
|
]);
|
|
1208
|
-
return
|
|
1209
|
-
children: p.map((A,
|
|
1210
|
-
bvh:
|
|
1208
|
+
return M ? i(Ie, {
|
|
1209
|
+
children: p.map((A, v) => i(Zo, {
|
|
1210
|
+
bvh: M,
|
|
1211
1211
|
geometry: g,
|
|
1212
1212
|
yPosition: A,
|
|
1213
|
-
color: d != null && Math.abs(A - d) < o * 0.5 ? "#44ff44" : P[
|
|
1213
|
+
color: d != null && Math.abs(A - d) < o * 0.5 ? "#44ff44" : P[v % P.length],
|
|
1214
1214
|
labelX: y,
|
|
1215
1215
|
onDataChange: F,
|
|
1216
1216
|
displayUnit: a,
|
|
1217
1217
|
useInnerSurface: e,
|
|
1218
|
-
formValue: h == null ? void 0 : h[
|
|
1218
|
+
formValue: h == null ? void 0 : h[v],
|
|
1219
1219
|
lineWidth: d != null && Math.abs(A - d) < o * 0.5 ? 4 : 1.5,
|
|
1220
1220
|
wasmLoopPoints: b == null ? void 0 : b.get(A),
|
|
1221
1221
|
wasmCircumference: m == null ? void 0 : m.get(A)
|
|
@@ -1229,20 +1229,20 @@ let __tla = (async () => {
|
|
|
1229
1229
|
const c = t.geometry;
|
|
1230
1230
|
c.computeBoundingBox();
|
|
1231
1231
|
const a = s ?? ((_a = c.boundingBox) == null ? void 0 : _a.min.y) ?? 0, e = r - a, h = n * 0.4, d = n * 0.03, f = ae(null);
|
|
1232
|
-
|
|
1232
|
+
Mn(({ camera: v }) => {
|
|
1233
1233
|
if (!f.current) return;
|
|
1234
|
-
const C = new
|
|
1235
|
-
|
|
1236
|
-
const L = new
|
|
1234
|
+
const C = new k();
|
|
1235
|
+
v.getWorldDirection(C);
|
|
1236
|
+
const L = new k(C.x, 0, C.z);
|
|
1237
1237
|
if (L.lengthSq() < 1e-8) return;
|
|
1238
1238
|
L.normalize();
|
|
1239
|
-
const T = new
|
|
1239
|
+
const T = new k().crossVectors(new k(0, 1, 0), L).normalize();
|
|
1240
1240
|
f.current.position.set(T.x * h, 0, T.z * h);
|
|
1241
|
-
const E =
|
|
1241
|
+
const E = v.position.x - f.current.position.x, w = v.position.z - f.current.position.z;
|
|
1242
1242
|
f.current.rotation.y = Math.atan2(E, w);
|
|
1243
1243
|
});
|
|
1244
|
-
const u = new
|
|
1245
|
-
return
|
|
1244
|
+
const u = new k(0, r, 0), g = new k(0, a, 0), M = new k(0, (r + a) / 2, 0), p = new k(-d, r, 0), b = new k(d, r, 0), m = new k(-d, a, 0), P = new k(d, a, 0), y = l != null && l > 0, F = y ? e - l : 0, A = y ? qo(e, l) : "#fff";
|
|
1245
|
+
return S("group", {
|
|
1246
1246
|
ref: f,
|
|
1247
1247
|
children: [
|
|
1248
1248
|
i(we, {
|
|
@@ -1270,8 +1270,8 @@ let __tla = (async () => {
|
|
|
1270
1270
|
lineWidth: 1.5
|
|
1271
1271
|
}),
|
|
1272
1272
|
i("mesh", {
|
|
1273
|
-
position:
|
|
1274
|
-
children: i(
|
|
1273
|
+
position: M,
|
|
1274
|
+
children: i(Ge, {
|
|
1275
1275
|
center: true,
|
|
1276
1276
|
style: {
|
|
1277
1277
|
pointerEvents: "none"
|
|
@@ -1280,7 +1280,7 @@ let __tla = (async () => {
|
|
|
1280
1280
|
0,
|
|
1281
1281
|
0
|
|
1282
1282
|
],
|
|
1283
|
-
children:
|
|
1283
|
+
children: S("div", {
|
|
1284
1284
|
style: {
|
|
1285
1285
|
display: "flex",
|
|
1286
1286
|
flexDirection: "column",
|
|
@@ -1291,7 +1291,7 @@ let __tla = (async () => {
|
|
|
1291
1291
|
pointerEvents: "none"
|
|
1292
1292
|
},
|
|
1293
1293
|
children: [
|
|
1294
|
-
|
|
1294
|
+
S("div", {
|
|
1295
1295
|
style: {
|
|
1296
1296
|
padding: "4px 8px",
|
|
1297
1297
|
backgroundColor: "rgba(0, 0, 0, 0.75)",
|
|
@@ -1308,7 +1308,7 @@ let __tla = (async () => {
|
|
|
1308
1308
|
o === "inch" ? "in" : "mm"
|
|
1309
1309
|
]
|
|
1310
1310
|
}),
|
|
1311
|
-
y &&
|
|
1311
|
+
y && S("div", {
|
|
1312
1312
|
style: {
|
|
1313
1313
|
display: "flex",
|
|
1314
1314
|
alignItems: "center",
|
|
@@ -1329,7 +1329,7 @@ let __tla = (async () => {
|
|
|
1329
1329
|
},
|
|
1330
1330
|
children: F > 0.5 ? "\u25B2" : "\u25BC"
|
|
1331
1331
|
}),
|
|
1332
|
-
|
|
1332
|
+
S("span", {
|
|
1333
1333
|
style: {
|
|
1334
1334
|
fontSize: 13,
|
|
1335
1335
|
color: A,
|
|
@@ -1341,7 +1341,7 @@ let __tla = (async () => {
|
|
|
1341
1341
|
o === "inch" ? (F / 25.4).toFixed(2) : F.toFixed(1)
|
|
1342
1342
|
]
|
|
1343
1343
|
}),
|
|
1344
|
-
|
|
1344
|
+
S("span", {
|
|
1345
1345
|
style: {
|
|
1346
1346
|
fontSize: 11,
|
|
1347
1347
|
color: "rgba(255,255,255,0.4)",
|
|
@@ -1361,36 +1361,36 @@ let __tla = (async () => {
|
|
|
1361
1361
|
]
|
|
1362
1362
|
});
|
|
1363
1363
|
}, Jo = ({ modelSize: t, isAligned: r, isCut: n, mesh: o, viewMode: s, sliceY: l, landmarkCount: c = 0, measurementGeometry: a, fitYMin: e, fitYMax: h, resetCameraToFrontRef: d }) => {
|
|
1364
|
-
const { set: f, size: u, camera: g, invalidate:
|
|
1364
|
+
const { set: f, size: u, camera: g, invalidate: M } = kn(), p = ae(false), b = ae(s), m = ae(new k()), P = ae(null), y = ae(c), F = ae(r), A = ae(n), v = ae(a), C = ae({
|
|
1365
1365
|
min: e,
|
|
1366
1366
|
max: h
|
|
1367
|
-
}), L = ae(0), T =
|
|
1367
|
+
}), L = ae(0), T = re(() => {
|
|
1368
1368
|
if (!o || t <= 0) return null;
|
|
1369
1369
|
const w = a ?? o.geometry;
|
|
1370
1370
|
w.computeBoundingBox();
|
|
1371
|
-
const z = w.boundingBox, D = new
|
|
1371
|
+
const z = w.boundingBox, D = new k();
|
|
1372
1372
|
z.getCenter(D);
|
|
1373
|
-
const B = new
|
|
1373
|
+
const B = new k();
|
|
1374
1374
|
z.getSize(B);
|
|
1375
1375
|
const $ = e != null && h != null && h > e;
|
|
1376
1376
|
if ($) {
|
|
1377
1377
|
const ge = e, de = h, he = w.getAttribute("position");
|
|
1378
1378
|
if (he) {
|
|
1379
|
-
const
|
|
1379
|
+
const Se = he.array, te = (de - ge) * 0.08;
|
|
1380
1380
|
let O = 1 / 0, X = -1 / 0, Q = ge - te, ue = de + te, fe = false;
|
|
1381
|
-
for (let
|
|
1382
|
-
const G =
|
|
1381
|
+
for (let oe = 0; oe < he.count; oe++) {
|
|
1382
|
+
const G = Se[oe * 3 + 1];
|
|
1383
1383
|
if (G < ge - te || G > de + te) continue;
|
|
1384
|
-
const V =
|
|
1384
|
+
const V = Se[oe * 3];
|
|
1385
1385
|
V < O && (O = V), V > X && (X = V), fe = true;
|
|
1386
1386
|
}
|
|
1387
1387
|
fe && (D.set((O + X) / 2, (Q + ue) / 2, 0), B.set(X - O, ue - Q, 0));
|
|
1388
1388
|
}
|
|
1389
1389
|
}
|
|
1390
1390
|
m.current.copy(B);
|
|
1391
|
-
const ee = u.width / u.height,
|
|
1391
|
+
const ee = u.width / u.height, ie = 1.35, ce = $ ? 1.15 : 1.6, U = Math.max(B.y * ce, B.x * ie / ee), ne = U * ee, J = D.y - B.y * 0.05;
|
|
1392
1392
|
L.current = J;
|
|
1393
|
-
const Z = new j.OrthographicCamera(-
|
|
1393
|
+
const Z = new j.OrthographicCamera(-ne / 2, ne / 2, U / 2, -U / 2, 0.1, t * 10);
|
|
1394
1394
|
return Z.position.set(0, J, t * 2), Z.lookAt(0, J, 0), Z;
|
|
1395
1395
|
}, [
|
|
1396
1396
|
o,
|
|
@@ -1405,7 +1405,7 @@ let __tla = (async () => {
|
|
|
1405
1405
|
const w = T();
|
|
1406
1406
|
w && (f({
|
|
1407
1407
|
camera: w
|
|
1408
|
-
}),
|
|
1408
|
+
}), M());
|
|
1409
1409
|
}, () => {
|
|
1410
1410
|
d && (d.current = null);
|
|
1411
1411
|
};
|
|
@@ -1413,13 +1413,13 @@ let __tla = (async () => {
|
|
|
1413
1413
|
d,
|
|
1414
1414
|
T,
|
|
1415
1415
|
f,
|
|
1416
|
-
|
|
1416
|
+
M
|
|
1417
1417
|
]);
|
|
1418
|
-
const E =
|
|
1419
|
-
const z = w.position.clone(), D = z.length(), B = Math.atan2(z.x, z.z), $ = Math.acos(z.y / D),
|
|
1420
|
-
w.position.set(D * Math.sin($) * Math.sin(
|
|
1418
|
+
const E = re((w) => {
|
|
1419
|
+
const z = w.position.clone(), D = z.length(), B = Math.atan2(z.x, z.z), $ = Math.acos(z.y / D), ie = B + 0.02;
|
|
1420
|
+
w.position.set(D * Math.sin($) * Math.sin(ie), D * Math.cos($), D * Math.sin($) * Math.cos(ie)), w.lookAt(0, 0, 0), w.updateMatrixWorld(true), M();
|
|
1421
1421
|
}, [
|
|
1422
|
-
|
|
1422
|
+
M
|
|
1423
1423
|
]);
|
|
1424
1424
|
return q(() => {
|
|
1425
1425
|
if (t > 0 && !p.current && !r) {
|
|
@@ -1444,8 +1444,8 @@ let __tla = (async () => {
|
|
|
1444
1444
|
g,
|
|
1445
1445
|
E
|
|
1446
1446
|
]), q(() => {
|
|
1447
|
-
const w = F.current !== r, z = A.current !== n, D = !
|
|
1448
|
-
if (F.current = r, A.current = n,
|
|
1447
|
+
const w = F.current !== r, z = A.current !== n, D = !v.current && !!a, B = (C.current.min == null || C.current.max == null) && e != null && h != null;
|
|
1448
|
+
if (F.current = r, A.current = n, v.current = a, C.current = {
|
|
1449
1449
|
min: e,
|
|
1450
1450
|
max: h
|
|
1451
1451
|
}, !w && !z && !D && !B || !r || s !== "3D") return;
|
|
@@ -1469,19 +1469,19 @@ let __tla = (async () => {
|
|
|
1469
1469
|
if (s === "2D" && l != null) {
|
|
1470
1470
|
P.current = g;
|
|
1471
1471
|
const z = o.geometry, D = z.getAttribute("position"), B = D.array, $ = t * 0.15;
|
|
1472
|
-
let ee = 1 / 0,
|
|
1472
|
+
let ee = 1 / 0, ie = -1 / 0, ce = 1 / 0, U = -1 / 0, ne = false;
|
|
1473
1473
|
for (let Q = 0; Q < D.count; Q++) if (Math.abs(B[Q * 3 + 1] - l) < $) {
|
|
1474
1474
|
const ue = B[Q * 3], fe = B[Q * 3 + 2];
|
|
1475
|
-
ue < ee && (ee = ue), ue >
|
|
1475
|
+
ue < ee && (ee = ue), ue > ie && (ie = ue), fe < ce && (ce = fe), fe > U && (U = fe), ne = true;
|
|
1476
1476
|
}
|
|
1477
|
-
if (!
|
|
1477
|
+
if (!ne) {
|
|
1478
1478
|
z.computeBoundingBox();
|
|
1479
1479
|
const Q = z.boundingBox;
|
|
1480
|
-
ee = Q.min.x,
|
|
1480
|
+
ee = Q.min.x, ie = Q.max.x, ce = Q.min.z, U = Q.max.z;
|
|
1481
1481
|
}
|
|
1482
|
-
const J = (ee +
|
|
1482
|
+
const J = (ee + ie) / 2, Z = (ce + U) / 2, ge = u.width / u.height, de = 1.4, he = (ie - ee) * de, Se = (U - ce) * de;
|
|
1483
1483
|
let te, O;
|
|
1484
|
-
he /
|
|
1484
|
+
he / Se > ge ? (te = he, O = he / ge) : (O = Se, te = Se * ge);
|
|
1485
1485
|
const X = new j.OrthographicCamera(-te / 2, te / 2, O / 2, -O / 2, 0.1, t * 10);
|
|
1486
1486
|
X.position.set(J, l + t * 2, Z), X.up.set(0, 0, -1), X.lookAt(J, l, Z), f({
|
|
1487
1487
|
camera: X
|
|
@@ -1512,19 +1512,19 @@ let __tla = (async () => {
|
|
|
1512
1512
|
if (s === "2D") {
|
|
1513
1513
|
if (!o || l == null) return;
|
|
1514
1514
|
const z = o.geometry, D = z.getAttribute("position"), B = D.array, $ = t * 0.15;
|
|
1515
|
-
let ee = 1 / 0,
|
|
1515
|
+
let ee = 1 / 0, ie = -1 / 0, ce = 1 / 0, U = -1 / 0, ne = false;
|
|
1516
1516
|
for (let te = 0; te < D.count; te++) if (Math.abs(B[te * 3 + 1] - l) < $) {
|
|
1517
1517
|
const O = B[te * 3], X = B[te * 3 + 2];
|
|
1518
|
-
O < ee && (ee = O), O >
|
|
1518
|
+
O < ee && (ee = O), O > ie && (ie = O), X < ce && (ce = X), X > U && (U = X), ne = true;
|
|
1519
1519
|
}
|
|
1520
|
-
if (!
|
|
1520
|
+
if (!ne) {
|
|
1521
1521
|
z.computeBoundingBox();
|
|
1522
1522
|
const te = z.boundingBox;
|
|
1523
|
-
ee = te.min.x,
|
|
1523
|
+
ee = te.min.x, ie = te.max.x, ce = te.min.z, U = te.max.z;
|
|
1524
1524
|
}
|
|
1525
|
-
const J = u.width / u.height, Z = 1.4, ge = (
|
|
1526
|
-
let he,
|
|
1527
|
-
ge / de > J ? (he = ge,
|
|
1525
|
+
const J = u.width / u.height, Z = 1.4, ge = (ie - ee) * Z, de = (U - ce) * Z;
|
|
1526
|
+
let he, Se;
|
|
1527
|
+
ge / de > J ? (he = ge, Se = ge / J) : (Se = de, he = de * J), w.left = -he / 2, w.right = he / 2, w.top = Se / 2, w.bottom = -Se / 2;
|
|
1528
1528
|
} else {
|
|
1529
1529
|
const z = m.current, D = u.width / u.height, B = Math.max(z.y, z.x / D) * 1.6, $ = B * D;
|
|
1530
1530
|
w.left = -$ / 2, w.right = $ / 2, w.top = B / 2, w.bottom = -B / 2;
|
|
@@ -1542,8 +1542,8 @@ let __tla = (async () => {
|
|
|
1542
1542
|
var _a;
|
|
1543
1543
|
const n = t.geometry;
|
|
1544
1544
|
n.computeBoundingBox();
|
|
1545
|
-
const o = new
|
|
1546
|
-
return (_a = n.boundingBox) == null ? void 0 : _a.getCenter(o), i(
|
|
1545
|
+
const o = new k();
|
|
1546
|
+
return (_a = n.boundingBox) == null ? void 0 : _a.getCenter(o), i(Fn, {
|
|
1547
1547
|
enableDamping: false,
|
|
1548
1548
|
enablePan: false,
|
|
1549
1549
|
minPolarAngle: Math.PI * 0.15,
|
|
@@ -1557,7 +1557,7 @@ let __tla = (async () => {
|
|
|
1557
1557
|
o.z
|
|
1558
1558
|
]
|
|
1559
1559
|
});
|
|
1560
|
-
}, er = ({ wasAutoScaled: t, onDismiss: r }) =>
|
|
1560
|
+
}, er = ({ wasAutoScaled: t, onDismiss: r }) => S("div", {
|
|
1561
1561
|
style: {
|
|
1562
1562
|
position: "absolute",
|
|
1563
1563
|
top: 16,
|
|
@@ -1601,7 +1601,7 @@ let __tla = (async () => {
|
|
|
1601
1601
|
}), tr = ({ isDoubleShell: t, onDismiss: r }) => (q(() => {
|
|
1602
1602
|
const n = setTimeout(r, 1e4);
|
|
1603
1603
|
return () => clearTimeout(n);
|
|
1604
|
-
}, []),
|
|
1604
|
+
}, []), S("div", {
|
|
1605
1605
|
style: {
|
|
1606
1606
|
position: "absolute",
|
|
1607
1607
|
top: 64,
|
|
@@ -1647,23 +1647,23 @@ let __tla = (async () => {
|
|
|
1647
1647
|
maxLeafTris: zt
|
|
1648
1648
|
}), [
|
|
1649
1649
|
c
|
|
1650
|
-
]), e = Y(() =>
|
|
1650
|
+
]), e = Y(() => je(a, c, n), [
|
|
1651
1651
|
a,
|
|
1652
1652
|
c,
|
|
1653
1653
|
n
|
|
1654
|
-
]), h = Y(() => new
|
|
1654
|
+
]), h = Y(() => new vt(new k(0, -1, 0), r), [
|
|
1655
1655
|
r
|
|
1656
1656
|
]), { mlLine: d, apLine: f, mlWidth: u, apWidth: g } = Y(() => {
|
|
1657
1657
|
let b = null, m = null, P = 0, y = 0;
|
|
1658
1658
|
if (e.linePoints.length >= 2) {
|
|
1659
|
-
let F = e.linePoints[0], A = e.linePoints[0],
|
|
1660
|
-
for (const L of e.linePoints) L.x < F.x && (F = L), L.x > A.x && (A = L), L.z <
|
|
1659
|
+
let F = e.linePoints[0], A = e.linePoints[0], v = e.linePoints[0], C = e.linePoints[0];
|
|
1660
|
+
for (const L of e.linePoints) L.x < F.x && (F = L), L.x > A.x && (A = L), L.z < v.z && (v = L), L.z > C.z && (C = L);
|
|
1661
1661
|
b = [
|
|
1662
|
-
new
|
|
1663
|
-
new
|
|
1662
|
+
new k(F.x, n, F.z),
|
|
1663
|
+
new k(A.x, n, A.z)
|
|
1664
1664
|
], m = [
|
|
1665
|
-
new
|
|
1666
|
-
new
|
|
1665
|
+
new k(v.x, n, v.z),
|
|
1666
|
+
new k(C.x, n, C.z)
|
|
1667
1667
|
], P = b[0].distanceTo(b[1]), y = m[0].distanceTo(m[1]);
|
|
1668
1668
|
}
|
|
1669
1669
|
return {
|
|
@@ -1675,8 +1675,8 @@ let __tla = (async () => {
|
|
|
1675
1675
|
}, [
|
|
1676
1676
|
e,
|
|
1677
1677
|
n
|
|
1678
|
-
]),
|
|
1679
|
-
return
|
|
1678
|
+
]), M = (b) => l === "inch" ? (b / 25.4).toFixed(2) : b.toFixed(1), p = l === "inch" ? "in" : "mm";
|
|
1679
|
+
return S(Ie, {
|
|
1680
1680
|
children: [
|
|
1681
1681
|
i("mesh", {
|
|
1682
1682
|
geometry: t.geometry,
|
|
@@ -1699,7 +1699,7 @@ let __tla = (async () => {
|
|
|
1699
1699
|
depthWrite: false,
|
|
1700
1700
|
transparent: true
|
|
1701
1701
|
}),
|
|
1702
|
-
d &&
|
|
1702
|
+
d && S(Ie, {
|
|
1703
1703
|
children: [
|
|
1704
1704
|
i(we, {
|
|
1705
1705
|
points: d,
|
|
@@ -1709,7 +1709,7 @@ let __tla = (async () => {
|
|
|
1709
1709
|
depthWrite: false,
|
|
1710
1710
|
transparent: true
|
|
1711
1711
|
}),
|
|
1712
|
-
i(
|
|
1712
|
+
i(Ge, {
|
|
1713
1713
|
position: [
|
|
1714
1714
|
d[0].x,
|
|
1715
1715
|
n,
|
|
@@ -1726,7 +1726,7 @@ let __tla = (async () => {
|
|
|
1726
1726
|
backgroundColor: "rgba(0,0,0,0.75)",
|
|
1727
1727
|
borderRadius: 3
|
|
1728
1728
|
},
|
|
1729
|
-
children:
|
|
1729
|
+
children: S("span", {
|
|
1730
1730
|
style: {
|
|
1731
1731
|
fontSize: 12,
|
|
1732
1732
|
color: "#ff8800",
|
|
@@ -1734,7 +1734,7 @@ let __tla = (async () => {
|
|
|
1734
1734
|
},
|
|
1735
1735
|
children: [
|
|
1736
1736
|
"ML ",
|
|
1737
|
-
|
|
1737
|
+
M(u),
|
|
1738
1738
|
" ",
|
|
1739
1739
|
p
|
|
1740
1740
|
]
|
|
@@ -1743,7 +1743,7 @@ let __tla = (async () => {
|
|
|
1743
1743
|
})
|
|
1744
1744
|
]
|
|
1745
1745
|
}),
|
|
1746
|
-
f &&
|
|
1746
|
+
f && S(Ie, {
|
|
1747
1747
|
children: [
|
|
1748
1748
|
i(we, {
|
|
1749
1749
|
points: f,
|
|
@@ -1753,7 +1753,7 @@ let __tla = (async () => {
|
|
|
1753
1753
|
depthWrite: false,
|
|
1754
1754
|
transparent: true
|
|
1755
1755
|
}),
|
|
1756
|
-
i(
|
|
1756
|
+
i(Ge, {
|
|
1757
1757
|
position: [
|
|
1758
1758
|
Math.max(f[0].x, f[1].x) + o * 0.02,
|
|
1759
1759
|
n,
|
|
@@ -1770,7 +1770,7 @@ let __tla = (async () => {
|
|
|
1770
1770
|
backgroundColor: "rgba(0,0,0,0.75)",
|
|
1771
1771
|
borderRadius: 3
|
|
1772
1772
|
},
|
|
1773
|
-
children:
|
|
1773
|
+
children: S("span", {
|
|
1774
1774
|
style: {
|
|
1775
1775
|
fontSize: 12,
|
|
1776
1776
|
color: "#ff00ff",
|
|
@@ -1778,7 +1778,7 @@ let __tla = (async () => {
|
|
|
1778
1778
|
},
|
|
1779
1779
|
children: [
|
|
1780
1780
|
"AP ",
|
|
1781
|
-
|
|
1781
|
+
M(g),
|
|
1782
1782
|
" ",
|
|
1783
1783
|
p
|
|
1784
1784
|
]
|
|
@@ -1790,30 +1790,30 @@ let __tla = (async () => {
|
|
|
1790
1790
|
]
|
|
1791
1791
|
});
|
|
1792
1792
|
}, or = ({ mesh: t, yPosition: r, onYChange: n, minY: o, maxY: s, modelSize: l, color: c, hoverColor: a, dragColor: e, label: h, onDragStart: d, onDragEnd: f }) => {
|
|
1793
|
-
const [u, g] = I(false), [
|
|
1793
|
+
const [u, g] = I(false), [M, p] = I(false), { camera: b, gl: m } = kn(), P = ae(0), y = ae(null), F = t.geometry, A = Bn(F), v = Y(() => A ? je(A, F, r) : {
|
|
1794
1794
|
linePoints: [],
|
|
1795
1795
|
lineLength: 0,
|
|
1796
|
-
rightmostPoint: new
|
|
1796
|
+
rightmostPoint: new k()
|
|
1797
1797
|
}, [
|
|
1798
1798
|
A,
|
|
1799
1799
|
F,
|
|
1800
1800
|
r
|
|
1801
|
-
]), C =
|
|
1802
|
-
const ee = m.domElement.getBoundingClientRect(),
|
|
1803
|
-
U.setFromCamera(new j.Vector2(
|
|
1804
|
-
const
|
|
1805
|
-
return U.ray.intersectPlane($,
|
|
1801
|
+
]), C = re((D, B, $) => {
|
|
1802
|
+
const ee = m.domElement.getBoundingClientRect(), ie = (D - ee.left) / ee.width * 2 - 1, ce = -((B - ee.top) / ee.height) * 2 + 1, U = new So();
|
|
1803
|
+
U.setFromCamera(new j.Vector2(ie, ce), b);
|
|
1804
|
+
const ne = new k();
|
|
1805
|
+
return U.ray.intersectPlane($, ne) ? ne.y : null;
|
|
1806
1806
|
}, [
|
|
1807
1807
|
b,
|
|
1808
1808
|
m
|
|
1809
|
-
]), L =
|
|
1810
|
-
const B = new
|
|
1809
|
+
]), L = re((D) => {
|
|
1810
|
+
const B = new k();
|
|
1811
1811
|
b.getWorldDirection(B), B.y = 0, B.lengthSq() < 1e-6 && B.set(0, 0, 1), B.normalize();
|
|
1812
1812
|
const $ = B.multiplyScalar(-1);
|
|
1813
|
-
return new
|
|
1813
|
+
return new vt().setFromNormalAndCoplanarPoint($, new k(0, D, 0));
|
|
1814
1814
|
}, [
|
|
1815
1815
|
b
|
|
1816
|
-
]), T =
|
|
1816
|
+
]), T = re((D) => {
|
|
1817
1817
|
D.stopPropagation(), g(true), m.domElement.style.cursor = "ns-resize";
|
|
1818
1818
|
const B = L(r);
|
|
1819
1819
|
y.current = B;
|
|
@@ -1825,7 +1825,7 @@ let __tla = (async () => {
|
|
|
1825
1825
|
L,
|
|
1826
1826
|
C,
|
|
1827
1827
|
d
|
|
1828
|
-
]), E =
|
|
1828
|
+
]), E = re((D) => {
|
|
1829
1829
|
if (!u || !y.current) return;
|
|
1830
1830
|
const B = C(D.clientX, D.clientY, y.current);
|
|
1831
1831
|
if (B == null) return;
|
|
@@ -1837,21 +1837,21 @@ let __tla = (async () => {
|
|
|
1837
1837
|
n,
|
|
1838
1838
|
o,
|
|
1839
1839
|
s
|
|
1840
|
-
]), w =
|
|
1840
|
+
]), w = re((D) => {
|
|
1841
1841
|
g(false), m.domElement.style.cursor = "auto", y.current = null, D.target.releasePointerCapture(D.pointerId), f == null ? void 0 : f();
|
|
1842
1842
|
}, [
|
|
1843
1843
|
m,
|
|
1844
1844
|
f
|
|
1845
1845
|
]);
|
|
1846
|
-
if (
|
|
1847
|
-
const z = u ? e :
|
|
1848
|
-
return
|
|
1846
|
+
if (v.linePoints.length < 2) return null;
|
|
1847
|
+
const z = u ? e : M ? a : c;
|
|
1848
|
+
return S("group", {
|
|
1849
1849
|
renderOrder: 10,
|
|
1850
1850
|
children: [
|
|
1851
1851
|
i(we, {
|
|
1852
|
-
points:
|
|
1852
|
+
points: v.linePoints,
|
|
1853
1853
|
color: z,
|
|
1854
|
-
lineWidth: u ? 6 :
|
|
1854
|
+
lineWidth: u ? 6 : M ? 5 : 4,
|
|
1855
1855
|
depthTest: false,
|
|
1856
1856
|
depthWrite: false,
|
|
1857
1857
|
transparent: true,
|
|
@@ -1866,13 +1866,13 @@ let __tla = (async () => {
|
|
|
1866
1866
|
u || (p(false), m.domElement.style.cursor = "auto");
|
|
1867
1867
|
}
|
|
1868
1868
|
}),
|
|
1869
|
-
(
|
|
1869
|
+
(M || u) && i("mesh", {
|
|
1870
1870
|
position: [
|
|
1871
|
-
|
|
1871
|
+
v.rightmostPoint.x + l * 0.15,
|
|
1872
1872
|
r,
|
|
1873
1873
|
0
|
|
1874
1874
|
],
|
|
1875
|
-
children: i(
|
|
1875
|
+
children: i(Ge, {
|
|
1876
1876
|
center: true,
|
|
1877
1877
|
children: i("div", {
|
|
1878
1878
|
style: {
|
|
@@ -1901,7 +1901,7 @@ let __tla = (async () => {
|
|
|
1901
1901
|
"color"
|
|
1902
1902
|
], sr = yo(function(t, r) {
|
|
1903
1903
|
var n = t.color, o = n === void 0 ? "currentColor" : n, s = rr(t, ir);
|
|
1904
|
-
return
|
|
1904
|
+
return bn("svg", Object.assign({
|
|
1905
1905
|
width: "15",
|
|
1906
1906
|
height: "15",
|
|
1907
1907
|
viewBox: "0 0 15 15",
|
|
@@ -1909,14 +1909,14 @@ let __tla = (async () => {
|
|
|
1909
1909
|
xmlns: "http://www.w3.org/2000/svg"
|
|
1910
1910
|
}, s, {
|
|
1911
1911
|
ref: r
|
|
1912
|
-
}),
|
|
1912
|
+
}), bn("path", {
|
|
1913
1913
|
d: "M7.5 2C7.77614 2 8 2.22386 8 2.5L8 11.2929L11.1464 8.14645C11.3417 7.95118 11.6583 7.95118 11.8536 8.14645C12.0488 8.34171 12.0488 8.65829 11.8536 8.85355L7.85355 12.8536C7.75979 12.9473 7.63261 13 7.5 13C7.36739 13 7.24021 12.9473 7.14645 12.8536L3.14645 8.85355C2.95118 8.65829 2.95118 8.34171 3.14645 8.14645C3.34171 7.95118 3.65829 7.95118 3.85355 8.14645L7 11.2929L7 2.5C7 2.22386 7.22386 2 7.5 2Z",
|
|
1914
1914
|
fill: o,
|
|
1915
1915
|
fillRule: "evenodd",
|
|
1916
1916
|
clipRule: "evenodd"
|
|
1917
1917
|
}));
|
|
1918
1918
|
});
|
|
1919
|
-
const
|
|
1919
|
+
const An = {
|
|
1920
1920
|
padding: "8px 20px",
|
|
1921
1921
|
borderRadius: 4,
|
|
1922
1922
|
fontSize: 14,
|
|
@@ -1945,7 +1945,7 @@ let __tla = (async () => {
|
|
|
1945
1945
|
f,
|
|
1946
1946
|
d,
|
|
1947
1947
|
u
|
|
1948
|
-
]),
|
|
1948
|
+
]), M = Y(() => t === "BK" ? /* @__PURE__ */ new Set([
|
|
1949
1949
|
`At ${d}`,
|
|
1950
1950
|
`2\u2033 below ${d}`,
|
|
1951
1951
|
`4\u2033 below ${d}`
|
|
@@ -1962,7 +1962,7 @@ let __tla = (async () => {
|
|
|
1962
1962
|
return g.forEach((z, D) => {
|
|
1963
1963
|
e[D] != null && e[D] !== 0 && (w[z] = e[D].toFixed(1));
|
|
1964
1964
|
}), w;
|
|
1965
|
-
}), [m, P] = I(h && h > 0 ? h.toFixed(1) : ""), [y, F] = I(""), [A,
|
|
1965
|
+
}), [m, P] = I(h && h > 0 ? h.toFixed(1) : ""), [y, F] = I(""), [A, v] = I(""), C = Y(() => g.map((w) => {
|
|
1966
1966
|
const z = p[w];
|
|
1967
1967
|
return z != null && z !== "" && !isNaN(parseFloat(z)) ? parseFloat(z) : 0;
|
|
1968
1968
|
}), [
|
|
@@ -1982,7 +1982,7 @@ let __tla = (async () => {
|
|
|
1982
1982
|
a
|
|
1983
1983
|
]);
|
|
1984
1984
|
const L = Y(() => {
|
|
1985
|
-
for (const w of
|
|
1985
|
+
for (const w of M) {
|
|
1986
1986
|
const z = g.indexOf(w);
|
|
1987
1987
|
if (z === -1) continue;
|
|
1988
1988
|
if (C[z] === 0) return false;
|
|
@@ -1991,11 +1991,11 @@ let __tla = (async () => {
|
|
|
1991
1991
|
}, [
|
|
1992
1992
|
C,
|
|
1993
1993
|
g,
|
|
1994
|
-
|
|
1994
|
+
M,
|
|
1995
1995
|
t,
|
|
1996
1996
|
y,
|
|
1997
1997
|
A
|
|
1998
|
-
]), T =
|
|
1998
|
+
]), T = re(() => {
|
|
1999
1999
|
if (!L) return;
|
|
2000
2000
|
const w = m !== "" && !isNaN(parseFloat(m)) ? parseFloat(m) : 0, z = y !== "" && !isNaN(parseFloat(y)) ? parseFloat(y) : void 0, D = A !== "" && !isNaN(parseFloat(A)) ? parseFloat(A) : void 0;
|
|
2001
2001
|
s({
|
|
@@ -2011,7 +2011,7 @@ let __tla = (async () => {
|
|
|
2011
2011
|
y,
|
|
2012
2012
|
A,
|
|
2013
2013
|
s
|
|
2014
|
-
]), E =
|
|
2014
|
+
]), E = re(() => {
|
|
2015
2015
|
const w = {};
|
|
2016
2016
|
g.forEach((z, D) => {
|
|
2017
2017
|
const B = n[D];
|
|
@@ -2025,7 +2025,7 @@ let __tla = (async () => {
|
|
|
2025
2025
|
n,
|
|
2026
2026
|
o
|
|
2027
2027
|
]);
|
|
2028
|
-
return
|
|
2028
|
+
return S("div", {
|
|
2029
2029
|
style: {
|
|
2030
2030
|
display: "flex",
|
|
2031
2031
|
flexDirection: "column",
|
|
@@ -2034,7 +2034,7 @@ let __tla = (async () => {
|
|
|
2034
2034
|
fontFamily: "system-ui, sans-serif"
|
|
2035
2035
|
},
|
|
2036
2036
|
children: [
|
|
2037
|
-
|
|
2037
|
+
S("div", {
|
|
2038
2038
|
style: {
|
|
2039
2039
|
padding: "20px 22px 16px",
|
|
2040
2040
|
backgroundColor: "#fff",
|
|
@@ -2045,7 +2045,7 @@ let __tla = (async () => {
|
|
|
2045
2045
|
flexShrink: 0
|
|
2046
2046
|
},
|
|
2047
2047
|
children: [
|
|
2048
|
-
|
|
2048
|
+
S("div", {
|
|
2049
2049
|
style: {
|
|
2050
2050
|
display: "flex",
|
|
2051
2051
|
alignItems: "center",
|
|
@@ -2079,7 +2079,7 @@ let __tla = (async () => {
|
|
|
2079
2079
|
})
|
|
2080
2080
|
]
|
|
2081
2081
|
}),
|
|
2082
|
-
|
|
2082
|
+
S("div", {
|
|
2083
2083
|
style: {
|
|
2084
2084
|
display: "flex",
|
|
2085
2085
|
alignItems: "center",
|
|
@@ -2096,7 +2096,7 @@ let __tla = (async () => {
|
|
|
2096
2096
|
boxShadow: "0 0 0 3px rgba(12, 67, 173, 0.13)"
|
|
2097
2097
|
}
|
|
2098
2098
|
}),
|
|
2099
|
-
|
|
2099
|
+
S("div", {
|
|
2100
2100
|
style: {
|
|
2101
2101
|
fontSize: 17,
|
|
2102
2102
|
fontWeight: 600,
|
|
@@ -2111,7 +2111,7 @@ let __tla = (async () => {
|
|
|
2111
2111
|
})
|
|
2112
2112
|
]
|
|
2113
2113
|
}),
|
|
2114
|
-
|
|
2114
|
+
S("div", {
|
|
2115
2115
|
style: {
|
|
2116
2116
|
fontSize: 13,
|
|
2117
2117
|
color: "rgba(0,0,0,0.6)",
|
|
@@ -2134,7 +2134,7 @@ let __tla = (async () => {
|
|
|
2134
2134
|
i("button", {
|
|
2135
2135
|
onClick: E,
|
|
2136
2136
|
style: {
|
|
2137
|
-
...
|
|
2137
|
+
...An,
|
|
2138
2138
|
backgroundColor: "#fff",
|
|
2139
2139
|
border: "2px solid rgb(12, 67, 173)",
|
|
2140
2140
|
color: "rgb(12, 67, 173)",
|
|
@@ -2143,7 +2143,7 @@ let __tla = (async () => {
|
|
|
2143
2143
|
fontSize: 12,
|
|
2144
2144
|
width: "100%"
|
|
2145
2145
|
},
|
|
2146
|
-
children:
|
|
2146
|
+
children: S("span", {
|
|
2147
2147
|
style: {
|
|
2148
2148
|
display: "flex",
|
|
2149
2149
|
alignItems: "center",
|
|
@@ -2163,7 +2163,7 @@ let __tla = (async () => {
|
|
|
2163
2163
|
})
|
|
2164
2164
|
]
|
|
2165
2165
|
}),
|
|
2166
|
-
|
|
2166
|
+
S("div", {
|
|
2167
2167
|
style: {
|
|
2168
2168
|
flex: 1,
|
|
2169
2169
|
minHeight: 0,
|
|
@@ -2189,8 +2189,8 @@ let __tla = (async () => {
|
|
|
2189
2189
|
marginBottom: 20
|
|
2190
2190
|
},
|
|
2191
2191
|
children: g.map((w, z) => {
|
|
2192
|
-
const D =
|
|
2193
|
-
return
|
|
2192
|
+
const D = M.has(w), B = !!p[w];
|
|
2193
|
+
return S("div", {
|
|
2194
2194
|
style: {
|
|
2195
2195
|
display: "flex",
|
|
2196
2196
|
flexDirection: "column",
|
|
@@ -2198,7 +2198,7 @@ let __tla = (async () => {
|
|
|
2198
2198
|
minWidth: 0
|
|
2199
2199
|
},
|
|
2200
2200
|
children: [
|
|
2201
|
-
|
|
2201
|
+
S("label", {
|
|
2202
2202
|
style: {
|
|
2203
2203
|
fontSize: 11,
|
|
2204
2204
|
fontWeight: 500,
|
|
@@ -2241,7 +2241,7 @@ let __tla = (async () => {
|
|
|
2241
2241
|
}, z);
|
|
2242
2242
|
})
|
|
2243
2243
|
}),
|
|
2244
|
-
t === "AK" &&
|
|
2244
|
+
t === "AK" && S(Ie, {
|
|
2245
2245
|
children: [
|
|
2246
2246
|
i("div", {
|
|
2247
2247
|
style: {
|
|
@@ -2252,7 +2252,7 @@ let __tla = (async () => {
|
|
|
2252
2252
|
},
|
|
2253
2253
|
children: "Perineum"
|
|
2254
2254
|
}),
|
|
2255
|
-
|
|
2255
|
+
S("div", {
|
|
2256
2256
|
style: {
|
|
2257
2257
|
display: "grid",
|
|
2258
2258
|
gridTemplateColumns: "repeat(auto-fill, minmax(180px, 1fr))",
|
|
@@ -2260,7 +2260,7 @@ let __tla = (async () => {
|
|
|
2260
2260
|
marginBottom: 20
|
|
2261
2261
|
},
|
|
2262
2262
|
children: [
|
|
2263
|
-
|
|
2263
|
+
S("div", {
|
|
2264
2264
|
style: {
|
|
2265
2265
|
display: "flex",
|
|
2266
2266
|
flexDirection: "column",
|
|
@@ -2268,7 +2268,7 @@ let __tla = (async () => {
|
|
|
2268
2268
|
minWidth: 0
|
|
2269
2269
|
},
|
|
2270
2270
|
children: [
|
|
2271
|
-
|
|
2271
|
+
S("label", {
|
|
2272
2272
|
style: {
|
|
2273
2273
|
fontSize: 11,
|
|
2274
2274
|
fontWeight: 500,
|
|
@@ -2302,7 +2302,7 @@ let __tla = (async () => {
|
|
|
2302
2302
|
})
|
|
2303
2303
|
]
|
|
2304
2304
|
}),
|
|
2305
|
-
|
|
2305
|
+
S("div", {
|
|
2306
2306
|
style: {
|
|
2307
2307
|
display: "flex",
|
|
2308
2308
|
flexDirection: "column",
|
|
@@ -2310,7 +2310,7 @@ let __tla = (async () => {
|
|
|
2310
2310
|
minWidth: 0
|
|
2311
2311
|
},
|
|
2312
2312
|
children: [
|
|
2313
|
-
|
|
2313
|
+
S("label", {
|
|
2314
2314
|
style: {
|
|
2315
2315
|
fontSize: 11,
|
|
2316
2316
|
fontWeight: 500,
|
|
@@ -2332,7 +2332,7 @@ let __tla = (async () => {
|
|
|
2332
2332
|
type: "number",
|
|
2333
2333
|
step: "0.1",
|
|
2334
2334
|
value: A,
|
|
2335
|
-
onChange: (w) =>
|
|
2335
|
+
onChange: (w) => v(w.target.value),
|
|
2336
2336
|
style: {
|
|
2337
2337
|
...xt,
|
|
2338
2338
|
padding: "6px 8px",
|
|
@@ -2363,7 +2363,7 @@ let __tla = (async () => {
|
|
|
2363
2363
|
gridTemplateColumns: "repeat(auto-fill, minmax(180px, 1fr))",
|
|
2364
2364
|
gap: 10
|
|
2365
2365
|
},
|
|
2366
|
-
children:
|
|
2366
|
+
children: S("div", {
|
|
2367
2367
|
style: {
|
|
2368
2368
|
display: "flex",
|
|
2369
2369
|
flexDirection: "column",
|
|
@@ -2413,7 +2413,7 @@ let __tla = (async () => {
|
|
|
2413
2413
|
onClick: T,
|
|
2414
2414
|
disabled: !L,
|
|
2415
2415
|
style: {
|
|
2416
|
-
...
|
|
2416
|
+
...An,
|
|
2417
2417
|
backgroundColor: L ? "rgb(12, 67, 173)" : "#e0e0e0",
|
|
2418
2418
|
border: "none",
|
|
2419
2419
|
color: L ? "#fff" : "#9e9e9e",
|
|
@@ -2452,14 +2452,14 @@ let __tla = (async () => {
|
|
|
2452
2452
|
boxSizing: "border-box",
|
|
2453
2453
|
fontFamily: "system-ui, sans-serif"
|
|
2454
2454
|
}, dr = ({ onSkip: t, onCancel: r }) => {
|
|
2455
|
-
const [n, o] = I("confirm"), [s, l] = I(null), [c, a] = I(""), e =
|
|
2455
|
+
const [n, o] = I("confirm"), [s, l] = I(null), [c, a] = I(""), e = re(() => {
|
|
2456
2456
|
o("reasons");
|
|
2457
|
-
}, []), h =
|
|
2457
|
+
}, []), h = re(() => {
|
|
2458
2458
|
n === "reasons" ? (o("confirm"), l(null), a("")) : r();
|
|
2459
2459
|
}, [
|
|
2460
2460
|
n,
|
|
2461
2461
|
r
|
|
2462
|
-
]), d = s != null && (s !== "Other" || c.trim() !== ""), f =
|
|
2462
|
+
]), d = s != null && (s !== "Other" || c.trim() !== ""), f = re(() => {
|
|
2463
2463
|
!d || !s || t(s === "Other" ? `Other: ${c.trim()}` : s);
|
|
2464
2464
|
}, [
|
|
2465
2465
|
d,
|
|
@@ -2480,7 +2480,7 @@ let __tla = (async () => {
|
|
|
2480
2480
|
zIndex: 9999,
|
|
2481
2481
|
fontFamily: "system-ui, sans-serif"
|
|
2482
2482
|
},
|
|
2483
|
-
children:
|
|
2483
|
+
children: S("div", {
|
|
2484
2484
|
style: {
|
|
2485
2485
|
backgroundColor: "#fff",
|
|
2486
2486
|
borderRadius: 12,
|
|
@@ -2488,7 +2488,7 @@ let __tla = (async () => {
|
|
|
2488
2488
|
boxShadow: "0 24px 38px 3px rgba(0,0,0,0.14)"
|
|
2489
2489
|
},
|
|
2490
2490
|
children: [
|
|
2491
|
-
|
|
2491
|
+
S("div", {
|
|
2492
2492
|
style: {
|
|
2493
2493
|
padding: "24px 24px 0"
|
|
2494
2494
|
},
|
|
@@ -2511,7 +2511,7 @@ let __tla = (async () => {
|
|
|
2511
2511
|
})
|
|
2512
2512
|
]
|
|
2513
2513
|
}),
|
|
2514
|
-
|
|
2514
|
+
S("div", {
|
|
2515
2515
|
style: {
|
|
2516
2516
|
padding: "20px 24px",
|
|
2517
2517
|
display: "flex",
|
|
@@ -2522,7 +2522,7 @@ let __tla = (async () => {
|
|
|
2522
2522
|
[
|
|
2523
2523
|
...ar,
|
|
2524
2524
|
"Other"
|
|
2525
|
-
].map((u) =>
|
|
2525
|
+
].map((u) => S("label", {
|
|
2526
2526
|
style: {
|
|
2527
2527
|
display: "flex",
|
|
2528
2528
|
alignItems: "center",
|
|
@@ -2576,7 +2576,7 @@ let __tla = (async () => {
|
|
|
2576
2576
|
})
|
|
2577
2577
|
]
|
|
2578
2578
|
}),
|
|
2579
|
-
|
|
2579
|
+
S("div", {
|
|
2580
2580
|
style: {
|
|
2581
2581
|
display: "flex",
|
|
2582
2582
|
justifyContent: "flex-end",
|
|
@@ -2624,7 +2624,7 @@ let __tla = (async () => {
|
|
|
2624
2624
|
zIndex: 9999,
|
|
2625
2625
|
fontFamily: "system-ui, sans-serif"
|
|
2626
2626
|
},
|
|
2627
|
-
children:
|
|
2627
|
+
children: S("div", {
|
|
2628
2628
|
style: {
|
|
2629
2629
|
backgroundColor: "#fff",
|
|
2630
2630
|
borderRadius: 8,
|
|
@@ -2650,7 +2650,7 @@ let __tla = (async () => {
|
|
|
2650
2650
|
},
|
|
2651
2651
|
children: "Your measurements will be submitted without comparing to the scan. Are you sure?"
|
|
2652
2652
|
}),
|
|
2653
|
-
|
|
2653
|
+
S("div", {
|
|
2654
2654
|
style: {
|
|
2655
2655
|
display: "flex",
|
|
2656
2656
|
justifyContent: "flex-end",
|
|
@@ -2683,31 +2683,31 @@ let __tla = (async () => {
|
|
|
2683
2683
|
})
|
|
2684
2684
|
});
|
|
2685
2685
|
};
|
|
2686
|
-
function
|
|
2686
|
+
function En(t, r, n) {
|
|
2687
2687
|
const o = t.getAttribute("position"), s = n - r;
|
|
2688
2688
|
if (s < 1) return null;
|
|
2689
2689
|
const l = 30, c = s / l, a = [];
|
|
2690
2690
|
for (let b = 0; b < l; b++) {
|
|
2691
2691
|
const m = r + b * c, P = r + (b + 1) * c;
|
|
2692
|
-
let y = 0, F = 0, A = 0,
|
|
2692
|
+
let y = 0, F = 0, A = 0, v = 0;
|
|
2693
2693
|
for (let C = 0; C < o.count; C++) {
|
|
2694
2694
|
const L = o.getY(C);
|
|
2695
|
-
L >= m && L < P && (y += o.getX(C), F += L, A += o.getZ(C),
|
|
2695
|
+
L >= m && L < P && (y += o.getX(C), F += L, A += o.getZ(C), v++);
|
|
2696
2696
|
}
|
|
2697
|
-
|
|
2697
|
+
v > 20 && a.push(new k(y / v, F / v, A / v));
|
|
2698
2698
|
}
|
|
2699
2699
|
if (a.length < 5) return null;
|
|
2700
|
-
const e = new
|
|
2700
|
+
const e = new k();
|
|
2701
2701
|
for (const b of a) e.add(b);
|
|
2702
2702
|
e.divideScalar(a.length);
|
|
2703
|
-
let h = 0, d = 0, f = 0, u = 0, g = 0,
|
|
2703
|
+
let h = 0, d = 0, f = 0, u = 0, g = 0, M = 0;
|
|
2704
2704
|
for (const b of a) {
|
|
2705
2705
|
const m = b.x - e.x, P = b.y - e.y, y = b.z - e.z;
|
|
2706
|
-
h += m * m, d += m * P, f += m * y, u += P * P, g += P * y,
|
|
2706
|
+
h += m * m, d += m * P, f += m * y, u += P * P, g += P * y, M += y * y;
|
|
2707
2707
|
}
|
|
2708
|
-
let p = new
|
|
2708
|
+
let p = new k(0.01, 1, 0.01).normalize();
|
|
2709
2709
|
for (let b = 0; b < 30; b++) {
|
|
2710
|
-
const m = h * p.x + d * p.y + f * p.z, P = d * p.x + u * p.y + g * p.z, y = f * p.x + g * p.y +
|
|
2710
|
+
const m = h * p.x + d * p.y + f * p.z, P = d * p.x + u * p.y + g * p.z, y = f * p.x + g * p.y + M * p.z, F = new k(m, P, y), A = F.length();
|
|
2711
2711
|
if (A < 1e-10 || (F.divideScalar(A), p.distanceTo(F) < 1e-8)) break;
|
|
2712
2712
|
p = F;
|
|
2713
2713
|
}
|
|
@@ -2728,8 +2728,8 @@ let __tla = (async () => {
|
|
|
2728
2728
|
"#44cc44",
|
|
2729
2729
|
"#4488ff"
|
|
2730
2730
|
];
|
|
2731
|
-
function
|
|
2732
|
-
const r = t.getAttribute("position"), n = r.count, o = new
|
|
2731
|
+
function Tn(t) {
|
|
2732
|
+
const r = t.getAttribute("position"), n = r.count, o = new k();
|
|
2733
2733
|
for (let p = 0; p < n; p++) o.x += r.getX(p), o.y += r.getY(p), o.z += r.getZ(p);
|
|
2734
2734
|
o.divideScalar(n);
|
|
2735
2735
|
let s = 0, l = 0, c = 0, a = 0, e = 0, h = 0;
|
|
@@ -2756,15 +2756,15 @@ let __tla = (async () => {
|
|
|
2756
2756
|
]
|
|
2757
2757
|
];
|
|
2758
2758
|
for (let p = 0; p < 3; p++) {
|
|
2759
|
-
let b = new
|
|
2759
|
+
let b = new k(1 + p * 0.1, 1 - p * 0.1, 0.5 + p * 0.3).normalize(), m = 0;
|
|
2760
2760
|
for (let P = 0; P < 100; P++) {
|
|
2761
|
-
const y = u[0][0] * b.x + u[0][1] * b.y + u[0][2] * b.z, F = u[1][0] * b.x + u[1][1] * b.y + u[1][2] * b.z, A = u[2][0] * b.x + u[2][1] * b.y + u[2][2] * b.z,
|
|
2762
|
-
if (m =
|
|
2763
|
-
if (
|
|
2764
|
-
b =
|
|
2761
|
+
const y = u[0][0] * b.x + u[0][1] * b.y + u[0][2] * b.z, F = u[1][0] * b.x + u[1][1] * b.y + u[1][2] * b.z, A = u[2][0] * b.x + u[2][1] * b.y + u[2][2] * b.z, v = new k(y, F, A);
|
|
2762
|
+
if (m = v.length(), m < 1e-12) break;
|
|
2763
|
+
if (v.divideScalar(m), b.distanceTo(v) < 1e-10) {
|
|
2764
|
+
b = v;
|
|
2765
2765
|
break;
|
|
2766
2766
|
}
|
|
2767
|
-
b =
|
|
2767
|
+
b = v;
|
|
2768
2768
|
}
|
|
2769
2769
|
d.push(b.clone()), f.push(m);
|
|
2770
2770
|
for (let P = 0; P < 3; P++) for (let y = 0; y < 3; y++) {
|
|
@@ -2780,10 +2780,10 @@ let __tla = (async () => {
|
|
|
2780
2780
|
u[P][y] -= m * F * A;
|
|
2781
2781
|
}
|
|
2782
2782
|
}
|
|
2783
|
-
const g = new
|
|
2783
|
+
const g = new k();
|
|
2784
2784
|
for (let p = 0; p < n; p++) g.x += r.getX(p), g.y += r.getY(p), g.z += r.getZ(p);
|
|
2785
2785
|
g.divideScalar(n);
|
|
2786
|
-
const
|
|
2786
|
+
const M = [
|
|
2787
2787
|
0,
|
|
2788
2788
|
0,
|
|
2789
2789
|
0
|
|
@@ -2792,16 +2792,16 @@ let __tla = (async () => {
|
|
|
2792
2792
|
let b = 1 / 0, m = -1 / 0;
|
|
2793
2793
|
const P = d[p];
|
|
2794
2794
|
for (let y = 0; y < n; y++) {
|
|
2795
|
-
const F = r.getX(y) - g.x, A = r.getY(y) - g.y,
|
|
2795
|
+
const F = r.getX(y) - g.x, A = r.getY(y) - g.y, v = r.getZ(y) - g.z, C = F * P.x + A * P.y + v * P.z;
|
|
2796
2796
|
C < b && (b = C), C > m && (m = C);
|
|
2797
2797
|
}
|
|
2798
|
-
|
|
2798
|
+
M[p] = (m - b) / 2;
|
|
2799
2799
|
}
|
|
2800
2800
|
return {
|
|
2801
2801
|
axes: d,
|
|
2802
2802
|
eigenvalues: f,
|
|
2803
2803
|
center: g,
|
|
2804
|
-
halfExtents:
|
|
2804
|
+
halfExtents: M
|
|
2805
2805
|
};
|
|
2806
2806
|
}
|
|
2807
2807
|
function pr({ pca: t }) {
|
|
@@ -2890,16 +2890,16 @@ let __tla = (async () => {
|
|
|
2890
2890
|
});
|
|
2891
2891
|
}
|
|
2892
2892
|
function hr({ redPoint: t, greenPoint: r }) {
|
|
2893
|
-
const n = Y(() => new
|
|
2893
|
+
const n = Y(() => new k().subVectors(r, t).normalize(), [
|
|
2894
2894
|
t,
|
|
2895
2895
|
r
|
|
2896
2896
|
]), o = Y(() => {
|
|
2897
|
-
const l = n.dot(new
|
|
2897
|
+
const l = n.dot(new k(0, 1, 0));
|
|
2898
2898
|
return Math.acos(Math.min(1, Math.abs(l))) * 180 / Math.PI;
|
|
2899
2899
|
}, [
|
|
2900
2900
|
n
|
|
2901
2901
|
]), s = o < 1 ? "#44ff44" : o < 5 ? "#ffcc00" : "#ff4444";
|
|
2902
|
-
return
|
|
2902
|
+
return S("group", {
|
|
2903
2903
|
children: [
|
|
2904
2904
|
i(we, {
|
|
2905
2905
|
points: [
|
|
@@ -2909,7 +2909,7 @@ let __tla = (async () => {
|
|
|
2909
2909
|
color: s,
|
|
2910
2910
|
lineWidth: 3
|
|
2911
2911
|
}),
|
|
2912
|
-
|
|
2912
|
+
S("mesh", {
|
|
2913
2913
|
position: t,
|
|
2914
2914
|
children: [
|
|
2915
2915
|
i("sphereGeometry", {
|
|
@@ -2924,7 +2924,7 @@ let __tla = (async () => {
|
|
|
2924
2924
|
})
|
|
2925
2925
|
]
|
|
2926
2926
|
}),
|
|
2927
|
-
|
|
2927
|
+
S("mesh", {
|
|
2928
2928
|
position: r,
|
|
2929
2929
|
children: [
|
|
2930
2930
|
i("sphereGeometry", {
|
|
@@ -2946,16 +2946,16 @@ let __tla = (async () => {
|
|
|
2946
2946
|
const l = o * 0.15, c = Y(() => {
|
|
2947
2947
|
const a = [];
|
|
2948
2948
|
let e = n - 10;
|
|
2949
|
-
const h = new
|
|
2949
|
+
const h = new k(0, 1, 0);
|
|
2950
2950
|
for (; e > r; ) {
|
|
2951
|
-
const d = Math.min(e, n), f = Math.max(e, n), u =
|
|
2951
|
+
const d = Math.min(e, n), f = Math.max(e, n), u = En(t, d, f);
|
|
2952
2952
|
if (u) {
|
|
2953
|
-
const g = u.dot(h),
|
|
2953
|
+
const g = u.dot(h), M = Math.acos(Math.min(1, Math.abs(g))) * 180 / Math.PI;
|
|
2954
2954
|
a.push({
|
|
2955
2955
|
axis: u,
|
|
2956
2956
|
regionMin: d,
|
|
2957
2957
|
regionMax: f,
|
|
2958
|
-
angleDeg:
|
|
2958
|
+
angleDeg: M
|
|
2959
2959
|
});
|
|
2960
2960
|
}
|
|
2961
2961
|
e -= 10;
|
|
@@ -2968,25 +2968,25 @@ let __tla = (async () => {
|
|
|
2968
2968
|
]);
|
|
2969
2969
|
return i("group", {
|
|
2970
2970
|
children: c.map((a, e) => {
|
|
2971
|
-
const h = (a.regionMin + a.regionMax) / 2, d = new
|
|
2972
|
-
return
|
|
2971
|
+
const h = (a.regionMin + a.regionMax) / 2, d = new k(0, h, 0), f = d.clone().addScaledVector(a.axis, l), u = d.clone().addScaledVector(a.axis, -l), g = e / Math.max(1, c.length - 1), M = a.angleDeg < 0.5 ? `hsl(${120 - g * 120}, 80%, 60%)` : `hsl(${40 - a.angleDeg * 2}, 90%, 55%)`;
|
|
2972
|
+
return S("group", {
|
|
2973
2973
|
children: [
|
|
2974
2974
|
i(we, {
|
|
2975
2975
|
points: [
|
|
2976
2976
|
u,
|
|
2977
2977
|
f
|
|
2978
2978
|
],
|
|
2979
|
-
color:
|
|
2979
|
+
color: M,
|
|
2980
2980
|
lineWidth: 1.5,
|
|
2981
2981
|
transparent: true,
|
|
2982
2982
|
opacity: 0.7
|
|
2983
2983
|
}),
|
|
2984
2984
|
i(we, {
|
|
2985
2985
|
points: [
|
|
2986
|
-
new
|
|
2987
|
-
new
|
|
2986
|
+
new k(-l * 0.3, a.regionMin, 0),
|
|
2987
|
+
new k(l * 0.3, a.regionMin, 0)
|
|
2988
2988
|
],
|
|
2989
|
-
color:
|
|
2989
|
+
color: M,
|
|
2990
2990
|
lineWidth: 0.5,
|
|
2991
2991
|
transparent: true,
|
|
2992
2992
|
opacity: 0.3
|
|
@@ -2998,9 +2998,9 @@ let __tla = (async () => {
|
|
|
2998
2998
|
}
|
|
2999
2999
|
function xr({ geometry: t, redY: r, greenY: n, modelSize: o }) {
|
|
3000
3000
|
const s = Y(() => {
|
|
3001
|
-
const f =
|
|
3001
|
+
const f = En(t, r, n);
|
|
3002
3002
|
if (!f) return null;
|
|
3003
|
-
const u = f.dot(new
|
|
3003
|
+
const u = f.dot(new k(0, 1, 0)), g = Math.acos(Math.min(1, Math.abs(u))) * 180 / Math.PI;
|
|
3004
3004
|
return {
|
|
3005
3005
|
axis: f,
|
|
3006
3006
|
angleDeg: g
|
|
@@ -3011,7 +3011,7 @@ let __tla = (async () => {
|
|
|
3011
3011
|
n
|
|
3012
3012
|
]);
|
|
3013
3013
|
if (!s) return null;
|
|
3014
|
-
const l = (r + n) / 2, c = new
|
|
3014
|
+
const l = (r + n) / 2, c = new k(0, l, 0), a = o * 0.4, e = c.clone().addScaledVector(s.axis, a), h = c.clone().addScaledVector(s.axis, -a), d = s.angleDeg < 0.5 ? "#00ffff" : s.angleDeg < 2 ? "#ffcc00" : "#ff6600";
|
|
3015
3015
|
return i("group", {
|
|
3016
3016
|
children: i(we, {
|
|
3017
3017
|
points: [
|
|
@@ -3042,9 +3042,9 @@ let __tla = (async () => {
|
|
|
3042
3042
|
}
|
|
3043
3043
|
function yr({ geometry: t, redY: r, greenY: n, modelSize: o, measurementGeometry: s }) {
|
|
3044
3044
|
const l = Y(() => {
|
|
3045
|
-
const d = s ?? t, f = jt(d), u = new
|
|
3045
|
+
const d = s ?? t, f = jt(d), u = new k(0, 1, 0), g = 5, p = n + 3 * 25.4, b = [];
|
|
3046
3046
|
for (let L = r + g; L < p; L += g) {
|
|
3047
|
-
const T = Io(f, d, new
|
|
3047
|
+
const T = Io(f, d, new k(0, L, 0), u);
|
|
3048
3048
|
T > 0 && b.push({
|
|
3049
3049
|
y: L,
|
|
3050
3050
|
circ: T
|
|
@@ -3053,10 +3053,10 @@ let __tla = (async () => {
|
|
|
3053
3053
|
if (b.length < 5) return null;
|
|
3054
3054
|
const m = n - r, P = r + m * 0.3, y = r + m * 0.7, F = b.filter((L) => L.y >= P && L.y <= y);
|
|
3055
3055
|
if (F.length < 3) return null;
|
|
3056
|
-
const A = F.map((L) => L.circ).sort((L, T) => L - T),
|
|
3056
|
+
const A = F.map((L) => L.circ).sort((L, T) => L - T), v = A[Math.floor(A.length / 2)], C = Math.max(...b.map((L) => L.circ));
|
|
3057
3057
|
return {
|
|
3058
3058
|
circumferences: b,
|
|
3059
|
-
baseline:
|
|
3059
|
+
baseline: v,
|
|
3060
3060
|
maxCirc: C
|
|
3061
3061
|
};
|
|
3062
3062
|
}, [
|
|
@@ -3066,16 +3066,16 @@ let __tla = (async () => {
|
|
|
3066
3066
|
]);
|
|
3067
3067
|
if (!l) return null;
|
|
3068
3068
|
const { circumferences: c, baseline: a, maxCirc: e } = l, h = o * 0.3 / e;
|
|
3069
|
-
return
|
|
3069
|
+
return S("group", {
|
|
3070
3070
|
children: [
|
|
3071
3071
|
c.map(({ y: d, circ: f }, u) => {
|
|
3072
|
-
const g = f / a,
|
|
3072
|
+
const g = f / a, M = g > 1.6 ? "#ff4444" : g > 1.3 ? "#ffcc00" : "#22cc66", p = f * h;
|
|
3073
3073
|
return i(we, {
|
|
3074
3074
|
points: [
|
|
3075
|
-
new
|
|
3076
|
-
new
|
|
3075
|
+
new k(-p, d, 0),
|
|
3076
|
+
new k(p, d, 0)
|
|
3077
3077
|
],
|
|
3078
|
-
color:
|
|
3078
|
+
color: M,
|
|
3079
3079
|
lineWidth: 1.5,
|
|
3080
3080
|
transparent: true,
|
|
3081
3081
|
opacity: 0.6
|
|
@@ -3083,12 +3083,12 @@ let __tla = (async () => {
|
|
|
3083
3083
|
}),
|
|
3084
3084
|
(() => {
|
|
3085
3085
|
const d = a * 1.6 * h, f = c[0].y, u = c[c.length - 1].y;
|
|
3086
|
-
return
|
|
3086
|
+
return S(Ie, {
|
|
3087
3087
|
children: [
|
|
3088
3088
|
i(we, {
|
|
3089
3089
|
points: [
|
|
3090
|
-
new
|
|
3091
|
-
new
|
|
3090
|
+
new k(-d, f, 0),
|
|
3091
|
+
new k(-d, u, 0)
|
|
3092
3092
|
],
|
|
3093
3093
|
color: "#ff4444",
|
|
3094
3094
|
lineWidth: 1,
|
|
@@ -3100,8 +3100,8 @@ let __tla = (async () => {
|
|
|
3100
3100
|
}),
|
|
3101
3101
|
i(we, {
|
|
3102
3102
|
points: [
|
|
3103
|
-
new
|
|
3104
|
-
new
|
|
3103
|
+
new k(d, f, 0),
|
|
3104
|
+
new k(d, u, 0)
|
|
3105
3105
|
],
|
|
3106
3106
|
color: "#ff4444",
|
|
3107
3107
|
lineWidth: 1,
|
|
@@ -3122,8 +3122,8 @@ let __tla = (async () => {
|
|
|
3122
3122
|
children: t.geometries.map((r, n) => {
|
|
3123
3123
|
const o = t.colors[n] ?? "#888888", s = n === t.innerIdx;
|
|
3124
3124
|
r.computeBoundingBox();
|
|
3125
|
-
const l = new
|
|
3126
|
-
return r.boundingBox.getCenter(l),
|
|
3125
|
+
const l = new k();
|
|
3126
|
+
return r.boundingBox.getCenter(l), S("group", {
|
|
3127
3127
|
children: [
|
|
3128
3128
|
i("mesh", {
|
|
3129
3129
|
geometry: r,
|
|
@@ -3151,7 +3151,7 @@ let __tla = (async () => {
|
|
|
3151
3151
|
}),
|
|
3152
3152
|
i("group", {
|
|
3153
3153
|
position: l,
|
|
3154
|
-
children: i(
|
|
3154
|
+
children: i(Ge, {
|
|
3155
3155
|
center: true,
|
|
3156
3156
|
style: {
|
|
3157
3157
|
pointerEvents: "none"
|
|
@@ -3181,14 +3181,14 @@ let __tla = (async () => {
|
|
|
3181
3181
|
})
|
|
3182
3182
|
});
|
|
3183
3183
|
}
|
|
3184
|
-
function
|
|
3184
|
+
function Sr({ geometry: t, aoData: r }) {
|
|
3185
3185
|
const n = Y(() => {
|
|
3186
3186
|
const o = t.toNonIndexed(), s = o.getAttribute("position"), l = r.length, c = s.count, a = new Float32Array(c * 3);
|
|
3187
3187
|
for (let e = 0; e < l && e * 3 + 2 < c; e++) {
|
|
3188
3188
|
const h = r[e], d = h, f = h < 0.5 ? 0.8 - h * 1.2 : 0.2 * (1 - h), u = 1 - h;
|
|
3189
3189
|
for (let g = 0; g < 3; g++) {
|
|
3190
|
-
const
|
|
3191
|
-
a[
|
|
3190
|
+
const M = (e * 3 + g) * 3;
|
|
3191
|
+
a[M] = d, a[M + 1] = f, a[M + 2] = u;
|
|
3192
3192
|
}
|
|
3193
3193
|
}
|
|
3194
3194
|
return o.setAttribute("color", new j.Float32BufferAttribute(a, 3)), o;
|
|
@@ -3210,16 +3210,16 @@ let __tla = (async () => {
|
|
|
3210
3210
|
})
|
|
3211
3211
|
});
|
|
3212
3212
|
}
|
|
3213
|
-
function
|
|
3214
|
-
const a = t.geometry, e = Y(() => a.getAttribute("position") ?
|
|
3213
|
+
function vr({ mesh: t, layers: r, landmarkPoints: n, componentDebug: o, aoData: s, aoGeometry: l, measurementGeometry: c }) {
|
|
3214
|
+
const a = t.geometry, e = Y(() => a.getAttribute("position") ? Tn(a) : null, [
|
|
3215
3215
|
a
|
|
3216
3216
|
]), h = Y(() => !n || n.length < 2 ? null : {
|
|
3217
|
-
red: new
|
|
3218
|
-
green: new
|
|
3217
|
+
red: new k(n[1].position.x, n[1].position.y, n[1].position.z),
|
|
3218
|
+
green: new k(n[0].position.x, n[0].position.y, n[0].position.z)
|
|
3219
3219
|
}, [
|
|
3220
3220
|
n
|
|
3221
3221
|
]);
|
|
3222
|
-
return
|
|
3222
|
+
return S("group", {
|
|
3223
3223
|
children: [
|
|
3224
3224
|
r.pcaAxes && e && i(pr, {
|
|
3225
3225
|
pca: e
|
|
@@ -3234,7 +3234,7 @@ let __tla = (async () => {
|
|
|
3234
3234
|
r.shellComponents && o && i(wr, {
|
|
3235
3235
|
componentDebug: o
|
|
3236
3236
|
}),
|
|
3237
|
-
r.ambientOcclusion && s && s.length > 0 && i(
|
|
3237
|
+
r.ambientOcclusion && s && s.length > 0 && i(Sr, {
|
|
3238
3238
|
geometry: l ?? a,
|
|
3239
3239
|
aoData: s
|
|
3240
3240
|
}),
|
|
@@ -3278,7 +3278,7 @@ let __tla = (async () => {
|
|
|
3278
3278
|
function Cr({ mesh: t }) {
|
|
3279
3279
|
const r = t.geometry, n = Y(() => {
|
|
3280
3280
|
if (!r.getAttribute("position")) return null;
|
|
3281
|
-
const l =
|
|
3281
|
+
const l = Tn(r), c = l.axes[0], a = l.halfExtents[0] * 1.3;
|
|
3282
3282
|
return {
|
|
3283
3283
|
axis: c,
|
|
3284
3284
|
center: l.center,
|
|
@@ -3305,7 +3305,7 @@ let __tla = (async () => {
|
|
|
3305
3305
|
renderOrder: 999
|
|
3306
3306
|
});
|
|
3307
3307
|
}
|
|
3308
|
-
const
|
|
3308
|
+
const $n = [
|
|
3309
3309
|
{
|
|
3310
3310
|
key: "pcaAxes",
|
|
3311
3311
|
label: "PCA Axes (full mesh)",
|
|
@@ -3362,10 +3362,10 @@ let __tla = (async () => {
|
|
|
3362
3362
|
group: "Alignment"
|
|
3363
3363
|
}
|
|
3364
3364
|
], zr = [
|
|
3365
|
-
...new Set(
|
|
3365
|
+
...new Set($n.map((t) => t.group))
|
|
3366
3366
|
];
|
|
3367
3367
|
function Ar({ layers: t, onToggleLayer: r, isDoubleShell: n }) {
|
|
3368
|
-
return
|
|
3368
|
+
return S("div", {
|
|
3369
3369
|
style: {
|
|
3370
3370
|
position: "absolute",
|
|
3371
3371
|
top: 16,
|
|
@@ -3394,8 +3394,8 @@ let __tla = (async () => {
|
|
|
3394
3394
|
children: "Debug Layers"
|
|
3395
3395
|
}),
|
|
3396
3396
|
zr.map((o) => {
|
|
3397
|
-
const s =
|
|
3398
|
-
return s.length === 0 ? null :
|
|
3397
|
+
const s = $n.filter((l) => l.group === o && !(l.hideWhenDoubleShell && n));
|
|
3398
|
+
return s.length === 0 ? null : S("div", {
|
|
3399
3399
|
children: [
|
|
3400
3400
|
i("div", {
|
|
3401
3401
|
style: {
|
|
@@ -3409,7 +3409,7 @@ let __tla = (async () => {
|
|
|
3409
3409
|
},
|
|
3410
3410
|
children: o
|
|
3411
3411
|
}),
|
|
3412
|
-
s.map(({ key: l, label: c, color: a }) =>
|
|
3412
|
+
s.map(({ key: l, label: c, color: a }) => S("label", {
|
|
3413
3413
|
style: {
|
|
3414
3414
|
display: "flex",
|
|
3415
3415
|
alignItems: "center",
|
|
@@ -3454,8 +3454,8 @@ let __tla = (async () => {
|
|
|
3454
3454
|
]
|
|
3455
3455
|
});
|
|
3456
3456
|
}
|
|
3457
|
-
const
|
|
3458
|
-
const [e, h] = I(null), [d, f] = I(0), [u, g] = I(false), [
|
|
3457
|
+
const Mr = ({ config: t, spacingType: r, scanUrl: n, formMeasurements: o, onComplete: s, isDebugUser: l = false, onAnalyticsEvent: c, wasmModule: a }) => {
|
|
3458
|
+
const [e, h] = I(null), [d, f] = I(0), [u, g] = I(false), [M, p] = I(false), [b, m] = I(""), [P, y] = I("3D"), [F, A] = I(r === "AK" ? 2 : 1), [v, C] = I(false), [L, T] = I(null), [E, w] = I(r ?? null), [z, D] = I("mm"), [B, $] = I(false), [ee, ie] = I(""), [ce, U] = I(false), [ne, J] = I(false), [Z, ge] = I(false), [de, he] = I(false), [Se, te] = I(null), [O, X] = I(null), [Q, ue] = I(null), [fe, oe] = I(false), [G, V] = I([]), [ke, Ae] = I(null), [Xe, me] = I(null), [ze, At] = I(null), [ot, Xt] = I(null), [Hn, Yt] = I(false), [rt, Zt] = I(null), [Mt, Fe] = I(null), [_e, Nn] = I(false), [Kt, Vn] = I(fr), [$e, qt] = I("obj"), [ve, kt] = I(o), [qe, Ft] = I(true), [it, Ue] = I(false), [Pt, Ut] = I(false), [Be, st] = I(false), Ye = ae(false), [jn, lt] = I(false), [Lt, Jt] = I(() => {
|
|
3459
3459
|
try {
|
|
3460
3460
|
return localStorage.getItem("gm_helpTipDismissed") !== "1";
|
|
3461
3461
|
} catch {
|
|
@@ -3475,21 +3475,21 @@ let __tla = (async () => {
|
|
|
3475
3475
|
}, [
|
|
3476
3476
|
Lt
|
|
3477
3477
|
]), q(() => {
|
|
3478
|
-
if (!
|
|
3478
|
+
if (!ne) return;
|
|
3479
3479
|
const x = setTimeout(() => J(false), 5e3);
|
|
3480
3480
|
return () => clearTimeout(x);
|
|
3481
3481
|
}, [
|
|
3482
|
-
|
|
3482
|
+
ne
|
|
3483
3483
|
]);
|
|
3484
|
-
const Dt = ae(null), [
|
|
3484
|
+
const Dt = ae(null), [Oe, Gn] = I(0);
|
|
3485
3485
|
q(() => {
|
|
3486
3486
|
if (!Dt.current) return;
|
|
3487
3487
|
const x = new ResizeObserver((_) => {
|
|
3488
|
-
for (const W of _)
|
|
3488
|
+
for (const W of _) Gn(W.contentRect.width);
|
|
3489
3489
|
});
|
|
3490
3490
|
return x.observe(Dt.current), () => x.disconnect();
|
|
3491
3491
|
}, []);
|
|
3492
|
-
const [
|
|
3492
|
+
const [He, Xn] = I(null), [Yn, Zn] = I(void 0), [Kn, qn] = I(void 0), [Qt] = I("#c8c8c8"), [Un] = I(1), [Ee, Jn] = I(false), [_t, en] = I([]), at = ae(null), Ne = ae(null), ct = ae(false), Qn = ae(null), Rt = ae(null), Wt = ae(null), Je = re(async (x) => {
|
|
3493
3493
|
if (!Wt.current) return;
|
|
3494
3494
|
const _ = (x == null ? void 0 : x.restoreView) ?? true;
|
|
3495
3495
|
try {
|
|
@@ -3500,39 +3500,39 @@ let __tla = (async () => {
|
|
|
3500
3500
|
We.width = pe, We.height = Pe;
|
|
3501
3501
|
const le = We.getContext("2d");
|
|
3502
3502
|
return le.drawImage(K, 0, 0), W.querySelectorAll("[style*='pointer-events']").forEach((co) => {
|
|
3503
|
-
const
|
|
3504
|
-
if (
|
|
3505
|
-
const
|
|
3506
|
-
|
|
3503
|
+
const dn = co;
|
|
3504
|
+
if (dn.hasAttribute("data-finalizing-overlay")) return;
|
|
3505
|
+
const fn = dn.querySelectorAll("div[style*='background']");
|
|
3506
|
+
fn.length !== 0 && fn.forEach((Ze) => {
|
|
3507
3507
|
var _a;
|
|
3508
|
-
const De =
|
|
3508
|
+
const De = Ze.getBoundingClientRect();
|
|
3509
3509
|
if (De.width === 0 || De.height === 0) return;
|
|
3510
|
-
let $t = 0,
|
|
3511
|
-
for (;
|
|
3512
|
-
const ht = (
|
|
3510
|
+
let $t = 0, tt = Ze;
|
|
3511
|
+
for (; tt && tt !== W; ) {
|
|
3512
|
+
const ht = (tt.style.transform || "").match(/rotate\((-?\d+)deg\)/);
|
|
3513
3513
|
if (ht) {
|
|
3514
3514
|
$t = parseFloat(ht[1]);
|
|
3515
3515
|
break;
|
|
3516
3516
|
}
|
|
3517
|
-
|
|
3517
|
+
tt = tt.parentElement;
|
|
3518
3518
|
}
|
|
3519
|
-
const
|
|
3520
|
-
le.save(), le.translate(
|
|
3521
|
-
const fo =
|
|
3519
|
+
const un = (De.left + De.width / 2 - be.left) * Re, pn = (De.top + De.height / 2 - be.top) * Le, pt = Math.abs($t) > 1, gn = (pt ? De.height : De.width) * Re, hn = (pt ? De.width : De.height) * Le;
|
|
3520
|
+
le.save(), le.translate(un, pn), pt && le.rotate($t * Math.PI / 180);
|
|
3521
|
+
const fo = Ze.style.backgroundColor || "rgba(0,0,0,0.75)";
|
|
3522
3522
|
le.fillStyle = fo;
|
|
3523
3523
|
const uo = 4 * Re;
|
|
3524
|
-
le.beginPath(), le.roundRect(-
|
|
3525
|
-
const
|
|
3526
|
-
if (
|
|
3527
|
-
const gt = window.getComputedStyle(
|
|
3524
|
+
le.beginPath(), le.roundRect(-gn / 2, -hn / 2, gn, hn, uo), le.fill();
|
|
3525
|
+
const mn = ((_a = Ze.textContent) == null ? void 0 : _a.trim()) || "";
|
|
3526
|
+
if (mn) {
|
|
3527
|
+
const gt = window.getComputedStyle(Ze), ht = parseFloat(gt.fontSize || "14") * Le;
|
|
3528
3528
|
le.font = `${gt.fontWeight || "normal"} ${ht}px monospace`, le.fillStyle = gt.color || "#fff", le.textAlign = "center", le.textBaseline = "middle";
|
|
3529
|
-
const
|
|
3530
|
-
|
|
3531
|
-
const
|
|
3532
|
-
if (
|
|
3533
|
-
const po = (
|
|
3529
|
+
const xn = Ze.querySelectorAll("span");
|
|
3530
|
+
xn.length > 0 && !pt ? xn.forEach((Ot) => {
|
|
3531
|
+
const nt = Ot.getBoundingClientRect();
|
|
3532
|
+
if (nt.width === 0) return;
|
|
3533
|
+
const po = (nt.left + nt.width / 2 - be.left) * Re - un, go = (nt.top + nt.height / 2 - be.top) * Le - pn, Ht = window.getComputedStyle(Ot), ho = parseFloat(Ht.fontSize) * Le;
|
|
3534
3534
|
le.font = `${Ht.fontWeight || "normal"} ${ho}px monospace`, le.fillStyle = Ht.color || "#fff", le.fillText(Ot.textContent || "", po, go);
|
|
3535
|
-
}) : le.fillText(
|
|
3535
|
+
}) : le.fillText(mn, 0, 0);
|
|
3536
3536
|
}
|
|
3537
3537
|
le.restore();
|
|
3538
3538
|
});
|
|
@@ -3549,13 +3549,13 @@ let __tla = (async () => {
|
|
|
3549
3549
|
} catch {
|
|
3550
3550
|
return;
|
|
3551
3551
|
}
|
|
3552
|
-
}, []), Ce =
|
|
3552
|
+
}, []), Ce = re((x) => {
|
|
3553
3553
|
const _ = /* @__PURE__ */ new Date(), W = `${String(_.getHours()).padStart(2, "0")}:${String(_.getMinutes()).padStart(2, "0")}:${String(_.getSeconds()).padStart(2, "0")}.${String(_.getMilliseconds()).padStart(3, "0")}`;
|
|
3554
3554
|
en((R) => [
|
|
3555
3555
|
...R.slice(-200),
|
|
3556
3556
|
`[${W}] ${x}`
|
|
3557
3557
|
]);
|
|
3558
|
-
}, []), { landmarkPoints: H, clearLandmarkPoints:
|
|
3558
|
+
}, []), { landmarkPoints: H, clearLandmarkPoints: eo, addLandmarkPoint: tn, removeLandmarkPoint: nn, updateLandmarkPositions: on, setAligned: rn, isAligned: se, setCut: sn, isCut: It, reset: dt } = Gt();
|
|
3559
3559
|
q(() => {
|
|
3560
3560
|
dt();
|
|
3561
3561
|
}, [
|
|
@@ -3571,9 +3571,9 @@ let __tla = (async () => {
|
|
|
3571
3571
|
l,
|
|
3572
3572
|
Ce
|
|
3573
3573
|
]), q(() => {
|
|
3574
|
-
l &&
|
|
3574
|
+
l && se && Ce("STATE: mesh aligned");
|
|
3575
3575
|
}, [
|
|
3576
|
-
|
|
3576
|
+
se,
|
|
3577
3577
|
l,
|
|
3578
3578
|
Ce
|
|
3579
3579
|
]), q(() => {
|
|
@@ -3587,21 +3587,21 @@ let __tla = (async () => {
|
|
|
3587
3587
|
}, [
|
|
3588
3588
|
_t
|
|
3589
3589
|
]);
|
|
3590
|
-
const
|
|
3590
|
+
const Ve = Y(() => Q ? new j.Mesh(Q) : null, [
|
|
3591
3591
|
Q
|
|
3592
3592
|
]);
|
|
3593
3593
|
q(() => {
|
|
3594
|
-
o &&
|
|
3594
|
+
o && kt(o);
|
|
3595
3595
|
}, [
|
|
3596
3596
|
o
|
|
3597
3597
|
]), q(() => {
|
|
3598
|
-
o ||
|
|
3598
|
+
o || kt(void 0);
|
|
3599
3599
|
}, [
|
|
3600
3600
|
F
|
|
3601
3601
|
]);
|
|
3602
3602
|
const ut = ae(false);
|
|
3603
3603
|
q(() => {
|
|
3604
|
-
if (!
|
|
3604
|
+
if (!se || G.length === 0 || ut.current || !c) return;
|
|
3605
3605
|
ut.current = true;
|
|
3606
3606
|
const x = H.length >= 3 ? Math.abs(H[2].position.y - H[0].position.y) : null;
|
|
3607
3607
|
c("dimensions_calculated", {
|
|
@@ -3611,34 +3611,34 @@ let __tla = (async () => {
|
|
|
3611
3611
|
measurement_source: "scan_derived",
|
|
3612
3612
|
is_double_wall: Z,
|
|
3613
3613
|
is_unit_converted: false,
|
|
3614
|
-
form_measurements: (
|
|
3614
|
+
form_measurements: (ve == null ? void 0 : ve.filter((_) => _ != null)) ?? null,
|
|
3615
3615
|
scan_measurements: G.map((_) => +(_.modifiedValue ?? _.originalValue).toFixed(1)),
|
|
3616
|
-
measurement_variance:
|
|
3617
|
-
const R =
|
|
3616
|
+
measurement_variance: ve ? G.map((_, W) => {
|
|
3617
|
+
const R = ve[W];
|
|
3618
3618
|
return R == null ? null : +((_.modifiedValue ?? _.originalValue) - R).toFixed(1);
|
|
3619
3619
|
}) : null,
|
|
3620
3620
|
frontal_height: x !== null ? +x.toFixed(1) : null
|
|
3621
3621
|
});
|
|
3622
3622
|
}, [
|
|
3623
|
-
|
|
3623
|
+
se,
|
|
3624
3624
|
G
|
|
3625
3625
|
]), q(() => {
|
|
3626
|
-
a !== void 0 && (
|
|
3626
|
+
a !== void 0 && (Ne.current = a), a !== void 0 && Jn(true);
|
|
3627
3627
|
}, [
|
|
3628
3628
|
a
|
|
3629
3629
|
]);
|
|
3630
|
-
const
|
|
3630
|
+
const Qe = re((x, _) => {
|
|
3631
3631
|
x.computeBoundingBox();
|
|
3632
|
-
const W = x.boundingBox, R = new
|
|
3632
|
+
const W = x.boundingBox, R = new k();
|
|
3633
3633
|
W.getCenter(R), x.translate(-R.x, -R.y, -R.z), x.computeBoundingBox();
|
|
3634
|
-
const xe = x.boundingBox, N = new
|
|
3634
|
+
const xe = x.boundingBox, N = new k();
|
|
3635
3635
|
xe.getSize(N), f(Math.max(N.x, N.y, N.z));
|
|
3636
3636
|
const K = new j.Mesh(x, new j.MeshStandardMaterial({
|
|
3637
3637
|
color: 8947848,
|
|
3638
3638
|
side: j.DoubleSide
|
|
3639
3639
|
}));
|
|
3640
3640
|
h(K), U(_), J(true), he(false), ct.current = false;
|
|
3641
|
-
}, []), Te =
|
|
3641
|
+
}, []), Te = re(async (x, _) => {
|
|
3642
3642
|
Fe(null);
|
|
3643
3643
|
const W = _.toLowerCase(), R = W.endsWith(".stl");
|
|
3644
3644
|
if (!W.endsWith(".obj") && !R) {
|
|
@@ -3664,17 +3664,17 @@ let __tla = (async () => {
|
|
|
3664
3664
|
N = await Nt(Pe);
|
|
3665
3665
|
}
|
|
3666
3666
|
else N = typeof x == "string" ? x : new TextDecoder().decode(x);
|
|
3667
|
-
const K = performance.now(), be =
|
|
3667
|
+
const K = performance.now(), be = Ne.current ? await Do(N, Ne.current, (pe) => {
|
|
3668
3668
|
m(pe), Ce(`PREPROCESS: ${pe}`);
|
|
3669
3669
|
}) : null;
|
|
3670
|
-
if (be) Ce(`PREPROCESS: done in ${(performance.now() - K).toFixed(0)}ms \u2014 unit=${be.detectedUnit}, scaled=${be.wasScaled}`), t.showAmputationModal && !r ? (T(be), C(true)) :
|
|
3670
|
+
if (be) Ce(`PREPROCESS: done in ${(performance.now() - K).toFixed(0)}ms \u2014 unit=${be.detectedUnit}, scaled=${be.wasScaled}`), t.showAmputationModal && !r ? (T(be), C(true)) : Qe(be.geometry, be.wasScaled);
|
|
3671
3671
|
else {
|
|
3672
3672
|
m("Using fallback loader...");
|
|
3673
3673
|
const pe = _o(N);
|
|
3674
3674
|
pe ? t.showAmputationModal && !r ? (T({
|
|
3675
3675
|
geometry: pe,
|
|
3676
3676
|
wasScaled: false
|
|
3677
|
-
}), C(true)) :
|
|
3677
|
+
}), C(true)) : Qe(pe, false) : Fe("Failed to parse the mesh.");
|
|
3678
3678
|
}
|
|
3679
3679
|
} catch (N) {
|
|
3680
3680
|
Fe(N instanceof Error ? N.message : "Failed to process the mesh file.");
|
|
@@ -3685,7 +3685,7 @@ let __tla = (async () => {
|
|
|
3685
3685
|
Ee,
|
|
3686
3686
|
t.showAmputationModal,
|
|
3687
3687
|
r,
|
|
3688
|
-
|
|
3688
|
+
Qe
|
|
3689
3689
|
]);
|
|
3690
3690
|
q(() => {
|
|
3691
3691
|
if (!n || !Ee) return;
|
|
@@ -3710,11 +3710,11 @@ let __tla = (async () => {
|
|
|
3710
3710
|
n,
|
|
3711
3711
|
Ee
|
|
3712
3712
|
]);
|
|
3713
|
-
const
|
|
3713
|
+
const to = re((x) => {
|
|
3714
3714
|
x.preventDefault(), g(true);
|
|
3715
|
-
}, []),
|
|
3715
|
+
}, []), no = re((x) => {
|
|
3716
3716
|
x.preventDefault(), g(false);
|
|
3717
|
-
}, []),
|
|
3717
|
+
}, []), oo = re(async (x) => {
|
|
3718
3718
|
if (x.preventDefault(), g(false), !Ee) {
|
|
3719
3719
|
Fe("WASM module is still loading. Please wait.");
|
|
3720
3720
|
return;
|
|
@@ -3741,35 +3741,35 @@ let __tla = (async () => {
|
|
|
3741
3741
|
}, [
|
|
3742
3742
|
Ee,
|
|
3743
3743
|
Te
|
|
3744
|
-
]),
|
|
3745
|
-
w(x), A(x === "AK" ? 2 : 1), C(false), L && (
|
|
3744
|
+
]), ro = re((x) => {
|
|
3745
|
+
w(x), A(x === "AK" ? 2 : 1), C(false), L && (Qe(L.geometry, L.wasScaled), T(null)), c == null ? void 0 : c("file_loaded", {
|
|
3746
3746
|
spacing_type: x,
|
|
3747
3747
|
file_format: $e,
|
|
3748
3748
|
is_double_wall: false
|
|
3749
3749
|
});
|
|
3750
3750
|
}, [
|
|
3751
3751
|
L,
|
|
3752
|
-
|
|
3752
|
+
Qe,
|
|
3753
3753
|
c,
|
|
3754
3754
|
$e
|
|
3755
3755
|
]);
|
|
3756
3756
|
q(() => {
|
|
3757
|
-
if (!e || H.length !== 1 || !
|
|
3757
|
+
if (!e || H.length !== 1 || !Ne.current || ct.current) return;
|
|
3758
3758
|
ct.current = true;
|
|
3759
|
-
const x = H[0], _ =
|
|
3759
|
+
const x = H[0], _ = Ne.current, W = e.geometry, { positions: R, indices: xe } = St(W), N = new Float32Array([
|
|
3760
3760
|
x.position.x,
|
|
3761
3761
|
x.position.y,
|
|
3762
3762
|
x.position.z
|
|
3763
3763
|
]), K = _.detect_shell(R, xe, N, 40), be = K.details(), pe = K.is_double_shell();
|
|
3764
|
-
Ce(`SHELL_DETECT: ${pe ? "DOUBLE" : "SINGLE"} \u2014 ${be}`), pe && (ge(true),
|
|
3764
|
+
Ce(`SHELL_DETECT: ${pe ? "DOUBLE" : "SINGLE"} \u2014 ${be}`), pe && (ge(true), oe(true), Ce(`SHELL_DETECT: double shell, thickness=${K.thickness().toFixed(1)}mm`));
|
|
3765
3765
|
}, [
|
|
3766
3766
|
e,
|
|
3767
3767
|
H,
|
|
3768
3768
|
Ce
|
|
3769
3769
|
]);
|
|
3770
|
-
const
|
|
3770
|
+
const io = re(() => {
|
|
3771
3771
|
if (!e || H.length < 2) return;
|
|
3772
|
-
$(true),
|
|
3772
|
+
$(true), ie("Please wait..."), Ce("PIPELINE: starting processing pipeline...");
|
|
3773
3773
|
const x = performance.now();
|
|
3774
3774
|
setTimeout(() => {
|
|
3775
3775
|
const _ = [
|
|
@@ -3779,7 +3779,7 @@ let __tla = (async () => {
|
|
|
3779
3779
|
];
|
|
3780
3780
|
Eo(e, _, wt, {
|
|
3781
3781
|
onStatus: (W) => {
|
|
3782
|
-
|
|
3782
|
+
ie(W), Ce(`PIPELINE: ${W}`);
|
|
3783
3783
|
},
|
|
3784
3784
|
addLandmarkPoint: tn,
|
|
3785
3785
|
removeLandmarkPoint: nn,
|
|
@@ -3799,7 +3799,7 @@ let __tla = (async () => {
|
|
|
3799
3799
|
setAdjustedEndY: At,
|
|
3800
3800
|
setError: Fe,
|
|
3801
3801
|
setDoubleShell: (W) => {
|
|
3802
|
-
ge(W),
|
|
3802
|
+
ge(W), oe(true);
|
|
3803
3803
|
},
|
|
3804
3804
|
setAoData: (W, R) => {
|
|
3805
3805
|
te(W), X(R ?? null);
|
|
@@ -3807,7 +3807,7 @@ let __tla = (async () => {
|
|
|
3807
3807
|
setInnerShellExtracted: he,
|
|
3808
3808
|
setMeasurementGeometry: ue,
|
|
3809
3809
|
setWasmSlices: Ae,
|
|
3810
|
-
wasmModule:
|
|
3810
|
+
wasmModule: Ne.current ?? void 0
|
|
3811
3811
|
}), Ce(`PIPELINE: completed in ${(performance.now() - x).toFixed(0)}ms`), ut.current = false, $(false);
|
|
3812
3812
|
}, 50);
|
|
3813
3813
|
}, [
|
|
@@ -3819,8 +3819,8 @@ let __tla = (async () => {
|
|
|
3819
3819
|
nn,
|
|
3820
3820
|
sn,
|
|
3821
3821
|
de
|
|
3822
|
-
]), Bt = ae(false),
|
|
3823
|
-
if (dt(), V([]), Ae(null), ue(null), me(null), At(null), Zt(null), Xt(null),
|
|
3822
|
+
]), Bt = ae(false), so = re(async () => {
|
|
3823
|
+
if (dt(), V([]), Ae(null), ue(null), me(null), At(null), Zt(null), Xt(null), Ue(false), Ut(false), Ft(true), ge(false), he(false), ct.current = false, Bt.current = false, ut.current = false, y("3D"), n && Ee) {
|
|
3824
3824
|
h(null);
|
|
3825
3825
|
try {
|
|
3826
3826
|
const x = await fetch(n);
|
|
@@ -3838,12 +3838,12 @@ let __tla = (async () => {
|
|
|
3838
3838
|
dt
|
|
3839
3839
|
]);
|
|
3840
3840
|
q(() => {
|
|
3841
|
-
|
|
3841
|
+
se && G.length > 0 && !Bt.current && (Bt.current = true, Ue(true));
|
|
3842
3842
|
}, [
|
|
3843
|
-
|
|
3843
|
+
se,
|
|
3844
3844
|
G.length
|
|
3845
3845
|
]);
|
|
3846
|
-
const
|
|
3846
|
+
const et = Y(() => {
|
|
3847
3847
|
var _a;
|
|
3848
3848
|
if (!e || H.length < 3) return 0;
|
|
3849
3849
|
if (Z) return Math.abs(H[0].position.y - H[2].position.y);
|
|
@@ -3855,12 +3855,12 @@ let __tla = (async () => {
|
|
|
3855
3855
|
e,
|
|
3856
3856
|
H,
|
|
3857
3857
|
Z
|
|
3858
|
-
]),
|
|
3859
|
-
|
|
3860
|
-
}, []), ln =
|
|
3861
|
-
if (!s ||
|
|
3862
|
-
|
|
3863
|
-
const _ = e ? await
|
|
3858
|
+
]), lo = re((x) => {
|
|
3859
|
+
Xn(x), kt(x.circumferences), Ft(true), Ut(true), Ue(false);
|
|
3860
|
+
}, []), ln = re(async (x) => {
|
|
3861
|
+
if (!s || Ye.current) return;
|
|
3862
|
+
Ye.current = true, Ue(false), lt(false), st(true), await new Promise((W) => requestAnimationFrame(() => requestAnimationFrame(() => W())));
|
|
3863
|
+
const _ = e ? await Je({
|
|
3864
3864
|
restoreView: false
|
|
3865
3865
|
}).catch(() => {
|
|
3866
3866
|
}) : void 0;
|
|
@@ -3872,9 +3872,9 @@ let __tla = (async () => {
|
|
|
3872
3872
|
measurementSource: "form_provided",
|
|
3873
3873
|
isDoubleWall: Z,
|
|
3874
3874
|
isUnitConverted: false,
|
|
3875
|
-
formMeasurements:
|
|
3875
|
+
formMeasurements: ve,
|
|
3876
3876
|
scanMeasurements: G,
|
|
3877
|
-
frontalHeight:
|
|
3877
|
+
frontalHeight: et,
|
|
3878
3878
|
transverseML: 0,
|
|
3879
3879
|
transverseAP: 0,
|
|
3880
3880
|
scanUrl: n,
|
|
@@ -3884,7 +3884,7 @@ let __tla = (async () => {
|
|
|
3884
3884
|
alignedGeometry: e == null ? void 0 : e.geometry
|
|
3885
3885
|
});
|
|
3886
3886
|
} finally {
|
|
3887
|
-
|
|
3887
|
+
Ye.current = false, st(false);
|
|
3888
3888
|
}
|
|
3889
3889
|
}, [
|
|
3890
3890
|
s,
|
|
@@ -3892,41 +3892,41 @@ let __tla = (async () => {
|
|
|
3892
3892
|
E,
|
|
3893
3893
|
$e,
|
|
3894
3894
|
Z,
|
|
3895
|
-
|
|
3895
|
+
ve,
|
|
3896
3896
|
G,
|
|
3897
|
-
|
|
3897
|
+
et,
|
|
3898
3898
|
n,
|
|
3899
|
-
|
|
3899
|
+
Je
|
|
3900
3900
|
]), Et = ae(null);
|
|
3901
3901
|
q(() => {
|
|
3902
|
-
if (!e || !
|
|
3902
|
+
if (!e || !se) {
|
|
3903
3903
|
Et.current = null;
|
|
3904
3904
|
return;
|
|
3905
3905
|
}
|
|
3906
|
-
const x = (
|
|
3906
|
+
const x = (Ve ?? e).geometry;
|
|
3907
3907
|
Et.current = jt(x);
|
|
3908
3908
|
}, [
|
|
3909
3909
|
e,
|
|
3910
|
-
|
|
3911
|
-
|
|
3910
|
+
se,
|
|
3911
|
+
Ve
|
|
3912
3912
|
]);
|
|
3913
|
-
const Tt =
|
|
3914
|
-
if (!s || !e || G.length === 0 || !E ||
|
|
3915
|
-
|
|
3916
|
-
const _ = await
|
|
3913
|
+
const Tt = re(async (x) => {
|
|
3914
|
+
if (!s || !e || G.length === 0 || !E || Ye.current) return;
|
|
3915
|
+
Ye.current = true, st(true), await new Promise((W) => requestAnimationFrame(() => requestAnimationFrame(() => W())));
|
|
3916
|
+
const _ = await Je({
|
|
3917
3917
|
restoreView: false
|
|
3918
3918
|
}).catch(() => {
|
|
3919
3919
|
});
|
|
3920
3920
|
try {
|
|
3921
3921
|
let W = 0, R = 0;
|
|
3922
3922
|
if (H.length >= 2) {
|
|
3923
|
-
const xe = (
|
|
3923
|
+
const xe = (Ve ?? e).geometry, K = H[0].position.y;
|
|
3924
3924
|
try {
|
|
3925
|
-
const be = Et.current ?? jt(xe), pe =
|
|
3925
|
+
const be = Et.current ?? jt(xe), pe = je(be, xe, K);
|
|
3926
3926
|
if (pe.linePoints.length >= 2) {
|
|
3927
3927
|
let Pe = pe.linePoints[0], Re = pe.linePoints[0], Le = pe.linePoints[0], We = pe.linePoints[0];
|
|
3928
3928
|
for (const le of pe.linePoints) le.x < Pe.x && (Pe = le), le.x > Re.x && (Re = le), le.z < Le.z && (Le = le), le.z > We.z && (We = le);
|
|
3929
|
-
W = new
|
|
3929
|
+
W = new k(Pe.x, K, Pe.z).distanceTo(new k(Re.x, K, Re.z)), R = new k(Le.x, K, Le.z).distanceTo(new k(We.x, K, We.z));
|
|
3930
3930
|
}
|
|
3931
3931
|
} catch {
|
|
3932
3932
|
}
|
|
@@ -3938,55 +3938,55 @@ let __tla = (async () => {
|
|
|
3938
3938
|
measurementSource: x === "use_form_measurements" ? "form_provided" : "scan_derived",
|
|
3939
3939
|
isDoubleWall: Z,
|
|
3940
3940
|
isUnitConverted: false,
|
|
3941
|
-
formMeasurements:
|
|
3941
|
+
formMeasurements: ve,
|
|
3942
3942
|
scanMeasurements: G,
|
|
3943
|
-
frontalHeight: (
|
|
3943
|
+
frontalHeight: (He == null ? void 0 : He.frontalHeight) ?? et,
|
|
3944
3944
|
transverseML: W,
|
|
3945
3945
|
transverseAP: R,
|
|
3946
|
-
perineumML:
|
|
3947
|
-
perineumAP:
|
|
3946
|
+
perineumML: He == null ? void 0 : He.perineumML,
|
|
3947
|
+
perineumAP: He == null ? void 0 : He.perineumAP,
|
|
3948
3948
|
scanUrl: n,
|
|
3949
3949
|
decision: x,
|
|
3950
|
-
userEnteredMeasurements:
|
|
3950
|
+
userEnteredMeasurements: He ?? void 0,
|
|
3951
3951
|
screenshots: _,
|
|
3952
|
-
alignedGeometry: (
|
|
3952
|
+
alignedGeometry: (Ve ?? e).geometry
|
|
3953
3953
|
});
|
|
3954
3954
|
} finally {
|
|
3955
|
-
|
|
3955
|
+
Ye.current = false, st(false);
|
|
3956
3956
|
}
|
|
3957
3957
|
}, [
|
|
3958
3958
|
s,
|
|
3959
3959
|
e,
|
|
3960
|
-
|
|
3960
|
+
Ve,
|
|
3961
3961
|
G,
|
|
3962
3962
|
E,
|
|
3963
3963
|
H,
|
|
3964
3964
|
$e,
|
|
3965
3965
|
Z,
|
|
3966
|
-
|
|
3966
|
+
ve,
|
|
3967
3967
|
n,
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
]),
|
|
3972
|
-
if (!
|
|
3973
|
-
const x = Math.min(
|
|
3968
|
+
He,
|
|
3969
|
+
et,
|
|
3970
|
+
Je
|
|
3971
|
+
]), ao = Y(() => {
|
|
3972
|
+
if (!ve || G.length === 0) return false;
|
|
3973
|
+
const x = Math.min(ve.length, G.length);
|
|
3974
3974
|
if (x === 0) return false;
|
|
3975
3975
|
for (let _ = 0; _ < x; _++) {
|
|
3976
|
-
const W =
|
|
3976
|
+
const W = ve[_], R = G[_];
|
|
3977
3977
|
if (!R || W == null || W === 0) continue;
|
|
3978
3978
|
const xe = R.modifiedValue ?? R.originalValue;
|
|
3979
3979
|
if (Math.abs(xe - W) > 7) return false;
|
|
3980
3980
|
}
|
|
3981
3981
|
return true;
|
|
3982
3982
|
}, [
|
|
3983
|
-
|
|
3983
|
+
ve,
|
|
3984
3984
|
G
|
|
3985
|
-
]),
|
|
3986
|
-
return
|
|
3985
|
+
]), an = Oe === 0 ? 320 : Oe < 520 ? Math.max(200, Math.round(Oe * 0.42)) : Oe < 900 ? 280 : Oe < 1400 ? 340 : 400, cn = Oe < 520 ? 16 : Oe < 900 ? 20 : 24;
|
|
3986
|
+
return S(Mo.Provider, {
|
|
3987
3987
|
value: t,
|
|
3988
3988
|
children: [
|
|
3989
|
-
|
|
3989
|
+
S("div", {
|
|
3990
3990
|
style: {
|
|
3991
3991
|
flex: 1,
|
|
3992
3992
|
display: "flex",
|
|
@@ -4015,7 +4015,7 @@ let __tla = (async () => {
|
|
|
4015
4015
|
}
|
|
4016
4016
|
})
|
|
4017
4017
|
}),
|
|
4018
|
-
|
|
4018
|
+
S("div", {
|
|
4019
4019
|
style: {
|
|
4020
4020
|
flex: 1,
|
|
4021
4021
|
display: "flex",
|
|
@@ -4023,7 +4023,7 @@ let __tla = (async () => {
|
|
|
4023
4023
|
minHeight: 0
|
|
4024
4024
|
},
|
|
4025
4025
|
children: [
|
|
4026
|
-
|
|
4026
|
+
S("div", {
|
|
4027
4027
|
ref: Dt,
|
|
4028
4028
|
style: {
|
|
4029
4029
|
flex: 1,
|
|
@@ -4032,15 +4032,15 @@ let __tla = (async () => {
|
|
|
4032
4032
|
minHeight: 0
|
|
4033
4033
|
},
|
|
4034
4034
|
children: [
|
|
4035
|
-
e && !
|
|
4036
|
-
const x = H.length === 0 ? 1 : H.length === 1 ? 2 : 3, _ = E === "AK" ? "Perineum" : "MPT", W = x === 1 ? `Place Point at ${_}` : x === 2 ? "Place Point at
|
|
4037
|
-
return
|
|
4035
|
+
e && !se && (() => {
|
|
4036
|
+
const x = H.length === 0 ? 1 : H.length === 1 ? 2 : 3, _ = E === "AK" ? "Perineum" : "MPT", W = x === 1 ? `Place Point at ${_}` : x === 2 ? "Place Point at Distal Most Point" : "Ready to Continue", R = x === 1 ? `Click on the model to mark the ${_}.` : x === 2 ? "Click on the model to mark the Distal Most Point." : "Both points are placed. Click Continue to process the scan.", xe = x === 1 ? "#2fbf4a" : x === 2 ? "#e53935" : "#2fbf4a", N = H.length >= 2;
|
|
4037
|
+
return S("div", {
|
|
4038
4038
|
style: {
|
|
4039
|
-
width:
|
|
4039
|
+
width: an,
|
|
4040
4040
|
flexShrink: 0,
|
|
4041
4041
|
display: "flex",
|
|
4042
4042
|
flexDirection: "column",
|
|
4043
|
-
padding:
|
|
4043
|
+
padding: cn,
|
|
4044
4044
|
gap: 20,
|
|
4045
4045
|
fontFamily: "system-ui, sans-serif",
|
|
4046
4046
|
boxSizing: "border-box",
|
|
@@ -4050,7 +4050,7 @@ let __tla = (async () => {
|
|
|
4050
4050
|
i("style", {
|
|
4051
4051
|
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) } }"
|
|
4052
4052
|
}),
|
|
4053
|
-
|
|
4053
|
+
S("div", {
|
|
4054
4054
|
style: {
|
|
4055
4055
|
position: "relative",
|
|
4056
4056
|
display: "flex",
|
|
@@ -4098,7 +4098,7 @@ let __tla = (async () => {
|
|
|
4098
4098
|
},
|
|
4099
4099
|
children: "i"
|
|
4100
4100
|
}),
|
|
4101
|
-
Lt &&
|
|
4101
|
+
Lt && S("div", {
|
|
4102
4102
|
role: "tooltip",
|
|
4103
4103
|
style: {
|
|
4104
4104
|
position: "absolute",
|
|
@@ -4138,7 +4138,7 @@ let __tla = (async () => {
|
|
|
4138
4138
|
})
|
|
4139
4139
|
]
|
|
4140
4140
|
}),
|
|
4141
|
-
|
|
4141
|
+
S("div", {
|
|
4142
4142
|
style: {
|
|
4143
4143
|
display: "flex",
|
|
4144
4144
|
alignItems: "center",
|
|
@@ -4161,7 +4161,7 @@ let __tla = (async () => {
|
|
|
4161
4161
|
transition: "background-color 200ms"
|
|
4162
4162
|
}
|
|
4163
4163
|
}, K)),
|
|
4164
|
-
|
|
4164
|
+
S("div", {
|
|
4165
4165
|
style: {
|
|
4166
4166
|
fontSize: 11,
|
|
4167
4167
|
fontWeight: 500,
|
|
@@ -4176,7 +4176,7 @@ let __tla = (async () => {
|
|
|
4176
4176
|
})
|
|
4177
4177
|
]
|
|
4178
4178
|
}),
|
|
4179
|
-
|
|
4179
|
+
S("div", {
|
|
4180
4180
|
style: {
|
|
4181
4181
|
display: "flex",
|
|
4182
4182
|
alignItems: "center",
|
|
@@ -4215,7 +4215,7 @@ let __tla = (async () => {
|
|
|
4215
4215
|
}),
|
|
4216
4216
|
i("button", {
|
|
4217
4217
|
disabled: !N,
|
|
4218
|
-
onClick:
|
|
4218
|
+
onClick: io,
|
|
4219
4219
|
style: {
|
|
4220
4220
|
marginTop: 4,
|
|
4221
4221
|
padding: "11px 14px",
|
|
@@ -4270,12 +4270,13 @@ let __tla = (async () => {
|
|
|
4270
4270
|
]
|
|
4271
4271
|
});
|
|
4272
4272
|
})(),
|
|
4273
|
-
|
|
4273
|
+
se && it && E && i("div", {
|
|
4274
4274
|
style: {
|
|
4275
|
-
|
|
4275
|
+
width: an,
|
|
4276
|
+
flexShrink: 0,
|
|
4276
4277
|
display: "flex",
|
|
4277
4278
|
flexDirection: "column",
|
|
4278
|
-
padding:
|
|
4279
|
+
padding: cn,
|
|
4279
4280
|
boxSizing: "border-box",
|
|
4280
4281
|
minHeight: 0,
|
|
4281
4282
|
fontFamily: "system-ui, sans-serif"
|
|
@@ -4297,31 +4298,29 @@ let __tla = (async () => {
|
|
|
4297
4298
|
amputationType: E,
|
|
4298
4299
|
spacingInches: F,
|
|
4299
4300
|
scanMeasurements: G,
|
|
4300
|
-
scanFrontalHeight:
|
|
4301
|
-
onSave:
|
|
4301
|
+
scanFrontalHeight: et,
|
|
4302
|
+
onSave: lo,
|
|
4302
4303
|
onSkip: ln,
|
|
4303
|
-
onFormChange:
|
|
4304
|
-
onHeightChange:
|
|
4305
|
-
initialValues:
|
|
4306
|
-
initialFrontalHeight:
|
|
4304
|
+
onFormChange: Zn,
|
|
4305
|
+
onHeightChange: qn,
|
|
4306
|
+
initialValues: ve,
|
|
4307
|
+
initialFrontalHeight: He == null ? void 0 : He.frontalHeight
|
|
4307
4308
|
})
|
|
4308
4309
|
})
|
|
4309
4310
|
}),
|
|
4310
|
-
|
|
4311
|
+
S("div", {
|
|
4311
4312
|
ref: Wt,
|
|
4312
4313
|
style: {
|
|
4313
|
-
flex:
|
|
4314
|
-
width: ne && Oe ? 0 : void 0,
|
|
4315
|
-
visibility: ne && Oe ? "hidden" : "visible",
|
|
4314
|
+
flex: 1,
|
|
4316
4315
|
position: "relative",
|
|
4317
4316
|
minHeight: 0,
|
|
4318
4317
|
overflow: "hidden"
|
|
4319
4318
|
},
|
|
4320
|
-
onDragOver: t.showDragDrop ?
|
|
4321
|
-
onDragLeave: t.showDragDrop ?
|
|
4322
|
-
onDrop: t.showDragDrop ?
|
|
4319
|
+
onDragOver: t.showDragDrop ? to : void 0,
|
|
4320
|
+
onDragLeave: t.showDragDrop ? no : void 0,
|
|
4321
|
+
onDrop: t.showDragDrop ? oo : void 0,
|
|
4323
4322
|
children: [
|
|
4324
|
-
t.showDragDrop && !e && !
|
|
4323
|
+
t.showDragDrop && !e && !M && i("div", {
|
|
4325
4324
|
style: {
|
|
4326
4325
|
position: "absolute",
|
|
4327
4326
|
inset: 16,
|
|
@@ -4340,7 +4339,7 @@ let __tla = (async () => {
|
|
|
4340
4339
|
fontFamily: "system-ui, sans-serif"
|
|
4341
4340
|
},
|
|
4342
4341
|
children: "Drag & Drop Files Here"
|
|
4343
|
-
}) :
|
|
4342
|
+
}) : S("div", {
|
|
4344
4343
|
style: {
|
|
4345
4344
|
textAlign: "center"
|
|
4346
4345
|
},
|
|
@@ -4370,7 +4369,7 @@ let __tla = (async () => {
|
|
|
4370
4369
|
]
|
|
4371
4370
|
})
|
|
4372
4371
|
}),
|
|
4373
|
-
!t.showDragDrop && !e && !
|
|
4372
|
+
!t.showDragDrop && !e && !M && !Mt && i("div", {
|
|
4374
4373
|
style: {
|
|
4375
4374
|
position: "absolute",
|
|
4376
4375
|
inset: 0,
|
|
@@ -4378,7 +4377,7 @@ let __tla = (async () => {
|
|
|
4378
4377
|
alignItems: "center",
|
|
4379
4378
|
justifyContent: "center"
|
|
4380
4379
|
},
|
|
4381
|
-
children:
|
|
4380
|
+
children: S("div", {
|
|
4382
4381
|
style: {
|
|
4383
4382
|
textAlign: "center"
|
|
4384
4383
|
},
|
|
@@ -4408,17 +4407,17 @@ let __tla = (async () => {
|
|
|
4408
4407
|
]
|
|
4409
4408
|
})
|
|
4410
4409
|
}),
|
|
4411
|
-
|
|
4410
|
+
M && i(Sn, {
|
|
4412
4411
|
message: b || "Processing mesh..."
|
|
4413
4412
|
}),
|
|
4414
|
-
B && i(
|
|
4413
|
+
B && i(Sn, {
|
|
4415
4414
|
message: ee
|
|
4416
4415
|
}),
|
|
4417
|
-
|
|
4418
|
-
message:
|
|
4416
|
+
Mt && i($o, {
|
|
4417
|
+
message: Mt,
|
|
4419
4418
|
onDismiss: () => Fe(null)
|
|
4420
4419
|
}),
|
|
4421
|
-
t.showAmputationModal &&
|
|
4420
|
+
t.showAmputationModal && v && i("div", {
|
|
4422
4421
|
style: {
|
|
4423
4422
|
position: "absolute",
|
|
4424
4423
|
inset: 0,
|
|
@@ -4430,7 +4429,7 @@ let __tla = (async () => {
|
|
|
4430
4429
|
justifyContent: "center",
|
|
4431
4430
|
zIndex: 20
|
|
4432
4431
|
},
|
|
4433
|
-
children:
|
|
4432
|
+
children: S("div", {
|
|
4434
4433
|
style: {
|
|
4435
4434
|
backgroundColor: "#fff",
|
|
4436
4435
|
borderRadius: 4,
|
|
@@ -4439,7 +4438,7 @@ let __tla = (async () => {
|
|
|
4439
4438
|
fontFamily: "system-ui, sans-serif"
|
|
4440
4439
|
},
|
|
4441
4440
|
children: [
|
|
4442
|
-
|
|
4441
|
+
S("div", {
|
|
4443
4442
|
style: {
|
|
4444
4443
|
padding: "24px 24px 20px"
|
|
4445
4444
|
},
|
|
@@ -4469,7 +4468,7 @@ let __tla = (async () => {
|
|
|
4469
4468
|
children: [
|
|
4470
4469
|
"AK",
|
|
4471
4470
|
"BK"
|
|
4472
|
-
].map((x) =>
|
|
4471
|
+
].map((x) => S("label", {
|
|
4473
4472
|
onClick: () => w(x),
|
|
4474
4473
|
style: {
|
|
4475
4474
|
flex: 1,
|
|
@@ -4505,7 +4504,7 @@ let __tla = (async () => {
|
|
|
4505
4504
|
},
|
|
4506
4505
|
children: x
|
|
4507
4506
|
}),
|
|
4508
|
-
|
|
4507
|
+
S("span", {
|
|
4509
4508
|
style: {
|
|
4510
4509
|
fontSize: 13,
|
|
4511
4510
|
color: "rgba(0,0,0,0.54)"
|
|
@@ -4520,7 +4519,7 @@ let __tla = (async () => {
|
|
|
4520
4519
|
})
|
|
4521
4520
|
]
|
|
4522
4521
|
}),
|
|
4523
|
-
|
|
4522
|
+
S("div", {
|
|
4524
4523
|
style: {
|
|
4525
4524
|
display: "flex",
|
|
4526
4525
|
justifyContent: "flex-end",
|
|
@@ -4549,7 +4548,7 @@ let __tla = (async () => {
|
|
|
4549
4548
|
children: "Cancel"
|
|
4550
4549
|
}),
|
|
4551
4550
|
i("button", {
|
|
4552
|
-
onClick: () => E &&
|
|
4551
|
+
onClick: () => E && ro(E),
|
|
4553
4552
|
disabled: !E,
|
|
4554
4553
|
style: {
|
|
4555
4554
|
padding: "6px 16px",
|
|
@@ -4582,7 +4581,7 @@ let __tla = (async () => {
|
|
|
4582
4581
|
}
|
|
4583
4582
|
}),
|
|
4584
4583
|
i(To, {
|
|
4585
|
-
children:
|
|
4584
|
+
children: S(wo, {
|
|
4586
4585
|
camera: {
|
|
4587
4586
|
position: [
|
|
4588
4587
|
0,
|
|
@@ -4633,53 +4632,53 @@ let __tla = (async () => {
|
|
|
4633
4632
|
mesh: e,
|
|
4634
4633
|
maxPoints: 2,
|
|
4635
4634
|
meshColor: Qt,
|
|
4636
|
-
meshOpacity: _e ? 0.3 :
|
|
4635
|
+
meshOpacity: _e ? 0.3 : Un,
|
|
4637
4636
|
frontFaceOnly: de,
|
|
4638
|
-
doubleShellTransparency: Z &&
|
|
4637
|
+
doubleShellTransparency: Z && se
|
|
4639
4638
|
}),
|
|
4640
4639
|
e && P === "3D" && i(Vo, {
|
|
4641
4640
|
modelSize: d,
|
|
4642
4641
|
labels: [
|
|
4643
4642
|
E === "AK" ? "Perineum" : "MPT",
|
|
4644
|
-
"
|
|
4643
|
+
"Distal Most Point",
|
|
4645
4644
|
"Cut Plane"
|
|
4646
4645
|
]
|
|
4647
4646
|
}),
|
|
4648
4647
|
i(Jo, {
|
|
4649
4648
|
modelSize: d,
|
|
4650
|
-
isAligned:
|
|
4649
|
+
isAligned: se,
|
|
4651
4650
|
isCut: It,
|
|
4652
4651
|
mesh: e,
|
|
4653
4652
|
viewMode: P,
|
|
4654
|
-
sliceY:
|
|
4653
|
+
sliceY: se && H.length >= 2 ? ze ?? ot ?? H[0].position.y : void 0,
|
|
4655
4654
|
landmarkCount: H.length,
|
|
4656
4655
|
measurementGeometry: Q,
|
|
4657
|
-
fitYMin:
|
|
4658
|
-
fitYMax:
|
|
4656
|
+
fitYMin: se && H.length >= 2 ? ze ?? ot ?? void 0 : void 0,
|
|
4657
|
+
fitYMax: se && H.length >= 2 ? rt ?? H[0].position.y : void 0,
|
|
4659
4658
|
resetCameraToFrontRef: Rt
|
|
4660
4659
|
}),
|
|
4661
|
-
!
|
|
4660
|
+
!se && i(Fn, {
|
|
4662
4661
|
enableDamping: false
|
|
4663
4662
|
}),
|
|
4664
|
-
|
|
4663
|
+
se && G.length > 0 && e && P === "3D" && i(Qo, {
|
|
4665
4664
|
mesh: e,
|
|
4666
|
-
isDragging:
|
|
4665
|
+
isDragging: Hn
|
|
4667
4666
|
}),
|
|
4668
|
-
e &&
|
|
4667
|
+
e && se && H.length >= 3 && (() => {
|
|
4669
4668
|
const _ = e.geometry.getIndex();
|
|
4670
4669
|
if (!_ || _.count < 30) return null;
|
|
4671
|
-
const W = H[2], R = H[0], xe =
|
|
4670
|
+
const W = H[2], R = H[0], xe = Xe ?? W.position.y, N = ze ?? ot ?? R.position.y;
|
|
4672
4671
|
return P === "2D" ? i(nr, {
|
|
4673
|
-
mesh:
|
|
4672
|
+
mesh: Ve ?? e,
|
|
4674
4673
|
upperY: N,
|
|
4675
4674
|
originY: R.position.y,
|
|
4676
4675
|
modelSize: d,
|
|
4677
4676
|
meshColor: Qt,
|
|
4678
4677
|
displayUnit: z
|
|
4679
|
-
}) :
|
|
4678
|
+
}) : S(Ie, {
|
|
4680
4679
|
children: [
|
|
4681
4680
|
i(Ko, {
|
|
4682
|
-
mesh:
|
|
4681
|
+
mesh: Ve ?? e,
|
|
4683
4682
|
startY: xe,
|
|
4684
4683
|
endY: N,
|
|
4685
4684
|
spacing: ft,
|
|
@@ -4688,25 +4687,25 @@ let __tla = (async () => {
|
|
|
4688
4687
|
reverseOrder: true,
|
|
4689
4688
|
displayUnit: z,
|
|
4690
4689
|
useInnerSurface: Z && !de,
|
|
4691
|
-
formMeasurements:
|
|
4692
|
-
originY:
|
|
4693
|
-
wasmSlices:
|
|
4690
|
+
formMeasurements: it ? Yn ?? ve : qe ? ve : void 0,
|
|
4691
|
+
originY: rt ?? R.position.y,
|
|
4692
|
+
wasmSlices: ke
|
|
4694
4693
|
}),
|
|
4695
4694
|
i(Uo, {
|
|
4696
4695
|
mesh: e,
|
|
4697
|
-
greenY:
|
|
4696
|
+
greenY: rt ?? R.position.y,
|
|
4698
4697
|
modelSize: d,
|
|
4699
4698
|
displayUnit: z,
|
|
4700
4699
|
bottomY: Z ? W.position.y : void 0,
|
|
4701
|
-
formHeight:
|
|
4700
|
+
formHeight: it ? Kn : qe ? He == null ? void 0 : He.frontalHeight : void 0
|
|
4702
4701
|
}),
|
|
4703
4702
|
i(or, {
|
|
4704
4703
|
mesh: e,
|
|
4705
|
-
yPosition:
|
|
4704
|
+
yPosition: rt ?? R.position.y,
|
|
4706
4705
|
onYChange: (K) => {
|
|
4707
4706
|
Zt(K), Ae(null);
|
|
4708
4707
|
const be = K - R.position.y;
|
|
4709
|
-
At((
|
|
4708
|
+
At((ot ?? R.position.y + ft * 2) + be);
|
|
4710
4709
|
},
|
|
4711
4710
|
minY: R.position.y - ft,
|
|
4712
4711
|
maxY: R.position.y + ft,
|
|
@@ -4721,21 +4720,21 @@ let __tla = (async () => {
|
|
|
4721
4720
|
]
|
|
4722
4721
|
});
|
|
4723
4722
|
})(),
|
|
4724
|
-
e &&
|
|
4723
|
+
e && se && P === "3D" && _e && i(Cr, {
|
|
4725
4724
|
mesh: e
|
|
4726
4725
|
}),
|
|
4727
|
-
e && t.showDebug && _e && P === "3D" && i(
|
|
4726
|
+
e && t.showDebug && _e && P === "3D" && i(vr, {
|
|
4728
4727
|
mesh: e,
|
|
4729
4728
|
modelSize: d,
|
|
4730
4729
|
layers: Kt,
|
|
4731
4730
|
landmarkPoints: H,
|
|
4732
4731
|
componentDebug: null,
|
|
4733
|
-
aoData:
|
|
4732
|
+
aoData: Se,
|
|
4734
4733
|
aoGeometry: O,
|
|
4735
4734
|
measurementGeometry: Q
|
|
4736
4735
|
}),
|
|
4737
|
-
i(
|
|
4738
|
-
screenshotFnRef:
|
|
4736
|
+
i(kr, {
|
|
4737
|
+
screenshotFnRef: Qn,
|
|
4739
4738
|
mesh: e,
|
|
4740
4739
|
modelSize: d,
|
|
4741
4740
|
measurementGeometry: Q
|
|
@@ -4743,7 +4742,7 @@ let __tla = (async () => {
|
|
|
4743
4742
|
]
|
|
4744
4743
|
})
|
|
4745
4744
|
}),
|
|
4746
|
-
e &&
|
|
4745
|
+
e && S("div", {
|
|
4747
4746
|
style: {
|
|
4748
4747
|
position: "absolute",
|
|
4749
4748
|
top: 16,
|
|
@@ -4753,7 +4752,7 @@ let __tla = (async () => {
|
|
|
4753
4752
|
gap: 8
|
|
4754
4753
|
},
|
|
4755
4754
|
children: [
|
|
4756
|
-
t.showStartOver &&
|
|
4755
|
+
t.showStartOver && se && i("button", {
|
|
4757
4756
|
onClick: () => window.location.reload(),
|
|
4758
4757
|
style: {
|
|
4759
4758
|
padding: "6px 16px",
|
|
@@ -4770,8 +4769,8 @@ let __tla = (async () => {
|
|
|
4770
4769
|
},
|
|
4771
4770
|
children: "Start Over"
|
|
4772
4771
|
}),
|
|
4773
|
-
!
|
|
4774
|
-
onClick:
|
|
4772
|
+
!se && H.length >= 1 && i("button", {
|
|
4773
|
+
onClick: eo,
|
|
4775
4774
|
style: {
|
|
4776
4775
|
padding: "6px 16px",
|
|
4777
4776
|
borderRadius: 4,
|
|
@@ -4787,8 +4786,8 @@ let __tla = (async () => {
|
|
|
4787
4786
|
},
|
|
4788
4787
|
children: "Reset Points"
|
|
4789
4788
|
}),
|
|
4790
|
-
|
|
4791
|
-
onClick:
|
|
4789
|
+
se && !Pt && i("button", {
|
|
4790
|
+
onClick: so,
|
|
4792
4791
|
style: {
|
|
4793
4792
|
padding: "6px 16px",
|
|
4794
4793
|
borderRadius: 4,
|
|
@@ -4808,13 +4807,13 @@ let __tla = (async () => {
|
|
|
4808
4807
|
}),
|
|
4809
4808
|
t.showDebug && _e && e && P === "3D" && i(Ar, {
|
|
4810
4809
|
layers: Kt,
|
|
4811
|
-
onToggleLayer: (x) =>
|
|
4810
|
+
onToggleLayer: (x) => Vn((_) => ({
|
|
4812
4811
|
..._,
|
|
4813
4812
|
[x]: !_[x]
|
|
4814
4813
|
})),
|
|
4815
4814
|
isDoubleShell: Z
|
|
4816
4815
|
}),
|
|
4817
|
-
|
|
4816
|
+
se && G.length > 0 && S("div", {
|
|
4818
4817
|
style: {
|
|
4819
4818
|
position: "absolute",
|
|
4820
4819
|
top: 16,
|
|
@@ -4824,7 +4823,7 @@ let __tla = (async () => {
|
|
|
4824
4823
|
zIndex: 10
|
|
4825
4824
|
},
|
|
4826
4825
|
children: [
|
|
4827
|
-
|
|
4826
|
+
S("div", {
|
|
4828
4827
|
style: {
|
|
4829
4828
|
display: "flex",
|
|
4830
4829
|
borderRadius: 6,
|
|
@@ -4864,7 +4863,7 @@ let __tla = (async () => {
|
|
|
4864
4863
|
})
|
|
4865
4864
|
]
|
|
4866
4865
|
}),
|
|
4867
|
-
|
|
4866
|
+
S("div", {
|
|
4868
4867
|
style: {
|
|
4869
4868
|
display: "flex",
|
|
4870
4869
|
borderRadius: 6,
|
|
@@ -4904,7 +4903,7 @@ let __tla = (async () => {
|
|
|
4904
4903
|
})
|
|
4905
4904
|
]
|
|
4906
4905
|
}),
|
|
4907
|
-
t.showSpacingToggle && P === "3D" &&
|
|
4906
|
+
t.showSpacingToggle && P === "3D" && S("div", {
|
|
4908
4907
|
style: {
|
|
4909
4908
|
display: "flex",
|
|
4910
4909
|
borderRadius: 6,
|
|
@@ -4944,7 +4943,7 @@ let __tla = (async () => {
|
|
|
4944
4943
|
})
|
|
4945
4944
|
]
|
|
4946
4945
|
}),
|
|
4947
|
-
P === "3D" &&
|
|
4946
|
+
P === "3D" && ve && i("div", {
|
|
4948
4947
|
style: {
|
|
4949
4948
|
display: "flex",
|
|
4950
4949
|
borderRadius: 6,
|
|
@@ -4957,9 +4956,9 @@ let __tla = (async () => {
|
|
|
4957
4956
|
style: {
|
|
4958
4957
|
padding: "6px 14px",
|
|
4959
4958
|
fontSize: 13,
|
|
4960
|
-
fontWeight:
|
|
4961
|
-
backgroundColor:
|
|
4962
|
-
color:
|
|
4959
|
+
fontWeight: qe ? 600 : 400,
|
|
4960
|
+
backgroundColor: qe ? "rgb(12, 67, 173)" : "#fff",
|
|
4961
|
+
color: qe ? "#fff" : "#666",
|
|
4963
4962
|
border: "none",
|
|
4964
4963
|
cursor: "pointer",
|
|
4965
4964
|
fontFamily: "system-ui, sans-serif"
|
|
@@ -4977,7 +4976,7 @@ let __tla = (async () => {
|
|
|
4977
4976
|
},
|
|
4978
4977
|
children: i("button", {
|
|
4979
4978
|
onClick: async () => {
|
|
4980
|
-
const x = await
|
|
4979
|
+
const x = await Je();
|
|
4981
4980
|
if (!x) return;
|
|
4982
4981
|
const _ = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), W = (R, xe) => {
|
|
4983
4982
|
const N = document.createElement("a");
|
|
@@ -5007,7 +5006,7 @@ let __tla = (async () => {
|
|
|
5007
5006
|
boxShadow: "0 2px 8px rgba(0,0,0,0.1)"
|
|
5008
5007
|
},
|
|
5009
5008
|
children: i("button", {
|
|
5010
|
-
onClick: () =>
|
|
5009
|
+
onClick: () => Nn((x) => !x),
|
|
5011
5010
|
style: {
|
|
5012
5011
|
padding: "6px 14px",
|
|
5013
5012
|
fontSize: 13,
|
|
@@ -5023,15 +5022,15 @@ let __tla = (async () => {
|
|
|
5023
5022
|
})
|
|
5024
5023
|
]
|
|
5025
5024
|
}),
|
|
5026
|
-
e &&
|
|
5025
|
+
e && ne && i(er, {
|
|
5027
5026
|
wasAutoScaled: ce,
|
|
5028
5027
|
onDismiss: () => J(false)
|
|
5029
5028
|
}),
|
|
5030
|
-
e && fe &&
|
|
5029
|
+
e && fe && se && i(tr, {
|
|
5031
5030
|
isDoubleShell: Z,
|
|
5032
|
-
onDismiss: () =>
|
|
5031
|
+
onDismiss: () => oe(false)
|
|
5033
5032
|
}),
|
|
5034
|
-
s &&
|
|
5033
|
+
s && se && i("div", {
|
|
5035
5034
|
className: "gm-action-row-container",
|
|
5036
5035
|
style: {
|
|
5037
5036
|
position: "absolute",
|
|
@@ -5042,7 +5041,7 @@ let __tla = (async () => {
|
|
|
5042
5041
|
containerType: "inline-size",
|
|
5043
5042
|
pointerEvents: "none"
|
|
5044
5043
|
},
|
|
5045
|
-
children:
|
|
5044
|
+
children: S("div", {
|
|
5046
5045
|
className: "gm-action-row",
|
|
5047
5046
|
style: {
|
|
5048
5047
|
display: "flex",
|
|
@@ -5085,20 +5084,20 @@ let __tla = (async () => {
|
|
|
5085
5084
|
onClick: () => lt(true),
|
|
5086
5085
|
children: "Have Galileo Check My Measurements"
|
|
5087
5086
|
}),
|
|
5088
|
-
|
|
5087
|
+
S("div", {
|
|
5089
5088
|
className: "gm-btn-group",
|
|
5090
5089
|
children: [
|
|
5091
|
-
Pt && !
|
|
5090
|
+
Pt && !it && i("button", {
|
|
5092
5091
|
className: "gm-btn gm-btn-secondary",
|
|
5093
|
-
onClick: () =>
|
|
5092
|
+
onClick: () => Ue(true),
|
|
5094
5093
|
children: "Edit Measurements"
|
|
5095
5094
|
}),
|
|
5096
|
-
Pt && (
|
|
5095
|
+
Pt && (ao ? i("button", {
|
|
5097
5096
|
className: "gm-btn gm-btn-primary",
|
|
5098
5097
|
disabled: Be,
|
|
5099
5098
|
onClick: () => Tt("continue"),
|
|
5100
5099
|
children: "Continue \u2192"
|
|
5101
|
-
}) :
|
|
5100
|
+
}) : S(Ie, {
|
|
5102
5101
|
children: [
|
|
5103
5102
|
i("button", {
|
|
5104
5103
|
className: "gm-btn gm-btn-secondary",
|
|
@@ -5123,7 +5122,7 @@ let __tla = (async () => {
|
|
|
5123
5122
|
})
|
|
5124
5123
|
]
|
|
5125
5124
|
}),
|
|
5126
|
-
Be &&
|
|
5125
|
+
Be && S("div", {
|
|
5127
5126
|
"data-finalizing-overlay": true,
|
|
5128
5127
|
style: {
|
|
5129
5128
|
position: "absolute",
|
|
@@ -5162,7 +5161,7 @@ let __tla = (async () => {
|
|
|
5162
5161
|
})
|
|
5163
5162
|
]
|
|
5164
5163
|
}),
|
|
5165
|
-
l && _t.length > 0 &&
|
|
5164
|
+
l && _t.length > 0 && S("div", {
|
|
5166
5165
|
style: {
|
|
5167
5166
|
height: 120,
|
|
5168
5167
|
flexShrink: 0,
|
|
@@ -5175,7 +5174,7 @@ let __tla = (async () => {
|
|
|
5175
5174
|
flexDirection: "column"
|
|
5176
5175
|
},
|
|
5177
5176
|
children: [
|
|
5178
|
-
|
|
5177
|
+
S("div", {
|
|
5179
5178
|
style: {
|
|
5180
5179
|
display: "flex",
|
|
5181
5180
|
alignItems: "center",
|
|
@@ -5195,25 +5194,25 @@ let __tla = (async () => {
|
|
|
5195
5194
|
},
|
|
5196
5195
|
children: "GALILEO DEBUG"
|
|
5197
5196
|
}),
|
|
5198
|
-
|
|
5197
|
+
S("div", {
|
|
5199
5198
|
style: {
|
|
5200
5199
|
display: "flex",
|
|
5201
5200
|
gap: 8,
|
|
5202
5201
|
alignItems: "center"
|
|
5203
5202
|
},
|
|
5204
5203
|
children: [
|
|
5205
|
-
|
|
5204
|
+
S("span", {
|
|
5206
5205
|
style: {
|
|
5207
5206
|
color: "#484f58",
|
|
5208
5207
|
fontSize: 9
|
|
5209
5208
|
},
|
|
5210
5209
|
children: [
|
|
5211
5210
|
"WASM ",
|
|
5212
|
-
|
|
5211
|
+
Ne.current ? "v2" : "N/A",
|
|
5213
5212
|
" | ",
|
|
5214
5213
|
H.length,
|
|
5215
5214
|
" pts | ",
|
|
5216
|
-
|
|
5215
|
+
se ? "aligned" : "unaligned",
|
|
5217
5216
|
" | ",
|
|
5218
5217
|
G.length,
|
|
5219
5218
|
" slices"
|
|
@@ -5259,21 +5258,21 @@ let __tla = (async () => {
|
|
|
5259
5258
|
})
|
|
5260
5259
|
]
|
|
5261
5260
|
}),
|
|
5262
|
-
|
|
5261
|
+
jn && i(dr, {
|
|
5263
5262
|
onSkip: ln,
|
|
5264
5263
|
onCancel: () => lt(false)
|
|
5265
5264
|
})
|
|
5266
5265
|
]
|
|
5267
5266
|
});
|
|
5268
5267
|
};
|
|
5269
|
-
function
|
|
5268
|
+
function kr({ screenshotFnRef: t }) {
|
|
5270
5269
|
return q(() => {
|
|
5271
5270
|
t.current = null;
|
|
5272
5271
|
}, [
|
|
5273
5272
|
t
|
|
5274
5273
|
]), null;
|
|
5275
5274
|
}
|
|
5276
|
-
|
|
5275
|
+
On = function(t) {
|
|
5277
5276
|
const r = t === "AK" ? 2 : 1, n = [];
|
|
5278
5277
|
for (let o = 2; o >= 1; o -= r) n.push(`${o}_above`);
|
|
5279
5278
|
n.push("at_ref");
|
|
@@ -5293,7 +5292,7 @@ let __tla = (async () => {
|
|
|
5293
5292
|
return n;
|
|
5294
5293
|
};
|
|
5295
5294
|
yt = function(t, r) {
|
|
5296
|
-
const n =
|
|
5295
|
+
const n = On(r), o = {};
|
|
5297
5296
|
for (let s = 0; s < Math.min(t.length, n.length); s++) {
|
|
5298
5297
|
const l = t[s];
|
|
5299
5298
|
l != null && !isNaN(l) && (o[n[s]] = l);
|
|
@@ -5302,7 +5301,7 @@ let __tla = (async () => {
|
|
|
5302
5301
|
};
|
|
5303
5302
|
Fr = function(t, r) {
|
|
5304
5303
|
if (!t) return;
|
|
5305
|
-
const o =
|
|
5304
|
+
const o = On(r).map((s) => {
|
|
5306
5305
|
const l = t[s];
|
|
5307
5306
|
return l ?? void 0;
|
|
5308
5307
|
});
|
|
@@ -5401,12 +5400,12 @@ let __tla = (async () => {
|
|
|
5401
5400
|
f = yt(e.formMeasurements, t.spacing_type);
|
|
5402
5401
|
const y = e.scanMeasurements.map((F, A) => {
|
|
5403
5402
|
var _a2;
|
|
5404
|
-
const
|
|
5405
|
-
return
|
|
5403
|
+
const v = (_a2 = e.formMeasurements) == null ? void 0 : _a2[A];
|
|
5404
|
+
return v == null || isNaN(v) ? null : +((F.modifiedValue ?? F.originalValue) - v).toFixed(1);
|
|
5406
5405
|
});
|
|
5407
5406
|
u = yt(y, t.spacing_type);
|
|
5408
5407
|
}
|
|
5409
|
-
const g = e.userEnteredMeasurements ? yt(e.userEnteredMeasurements.circumferences, t.spacing_type) : void 0,
|
|
5408
|
+
const g = e.userEnteredMeasurements ? yt(e.userEnteredMeasurements.circumferences, t.spacing_type) : void 0, M = e.decision === "use_scan" || e.decision === "continue", p = M ? d : g ?? f ?? d, b = M ? +e.frontalHeight.toFixed(1) : +(((_a = e.userEnteredMeasurements) == null ? void 0 : _a.frontalHeight) ?? e.frontalHeight).toFixed(1);
|
|
5410
5409
|
let m;
|
|
5411
5410
|
if (t.upload_url) if (!e.alignedGeometry) m = {
|
|
5412
5411
|
success: false,
|
|
@@ -5465,7 +5464,7 @@ let __tla = (async () => {
|
|
|
5465
5464
|
height: "100%",
|
|
5466
5465
|
display: "flex"
|
|
5467
5466
|
},
|
|
5468
|
-
children: i(
|
|
5467
|
+
children: i(Mr, {
|
|
5469
5468
|
config: Ao,
|
|
5470
5469
|
spacingType: t.spacing_type,
|
|
5471
5470
|
scanUrl: t.scan_url,
|
|
@@ -5481,5 +5480,5 @@ export {
|
|
|
5481
5480
|
__tla,
|
|
5482
5481
|
yt as a,
|
|
5483
5482
|
Fr as c,
|
|
5484
|
-
|
|
5483
|
+
On as g
|
|
5485
5484
|
};
|