@solid-labs/fab-one-widget 0.1.9 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{GirthManagerWidget-CaXgi08X.js → GirthManagerWidget-BSCoqEUD.js} +661 -610
- package/dist/GirthManagerWidget-BSCoqEUD.js.map +1 -0
- package/dist/girth-manager-ui/src/store.d.ts +2 -0
- package/dist/girth-manager-web-widget/src/web-component.d.ts +10 -0
- package/dist/index.js +1 -1
- package/dist/web-component.js +33 -17
- package/dist/web-component.js.map +1 -1
- package/package.json +1 -1
- package/dist/GirthManagerWidget-CaXgi08X.js.map +0 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { useFrame as
|
|
4
|
-
import { Html as
|
|
1
|
+
import { jsxs as F, jsx as i, Fragment as Oe } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as Zn, Component as Kn, useCallback as re, useMemo as j, useState as E, memo as Un, useEffect as ne, useRef as le, forwardRef as Jn, createElement as en } from "react";
|
|
3
|
+
import { useFrame as an, useThree as cn, Canvas as Qn } from "@react-three/fiber";
|
|
4
|
+
import { Html as Xe, Line as de, OrbitControls as dn } from "@react-three/drei";
|
|
5
5
|
import * as O from "three";
|
|
6
|
-
import { Plane as
|
|
7
|
-
import { create as
|
|
8
|
-
import { OBJLoader as
|
|
9
|
-
import { STLLoader as
|
|
10
|
-
import { MeshBVH as
|
|
11
|
-
let
|
|
6
|
+
import { Plane as ft, Vector3 as C, Box3 as fn, Line3 as un, Raycaster as qn } from "three";
|
|
7
|
+
import { create as eo } from "zustand";
|
|
8
|
+
import { OBJLoader as pn } from "three/examples/jsm/loaders/OBJLoader.js";
|
|
9
|
+
import { STLLoader as to } from "three/examples/jsm/loaders/STLLoader.js";
|
|
10
|
+
import { MeshBVH as ut } from "three-mesh-bvh";
|
|
11
|
+
let mr, at, ir, Cn;
|
|
12
12
|
let __tla = (async () => {
|
|
13
|
-
const
|
|
13
|
+
const no = {
|
|
14
14
|
showDragDrop: true,
|
|
15
15
|
showStartOver: true,
|
|
16
16
|
showDebug: true,
|
|
@@ -19,7 +19,7 @@ let __tla = (async () => {
|
|
|
19
19
|
showNavigation: true,
|
|
20
20
|
showToolbar: false,
|
|
21
21
|
showSaveButton: true
|
|
22
|
-
},
|
|
22
|
+
}, oo = {
|
|
23
23
|
showDragDrop: false,
|
|
24
24
|
showStartOver: false,
|
|
25
25
|
showDebug: false,
|
|
@@ -28,7 +28,7 @@ let __tla = (async () => {
|
|
|
28
28
|
showNavigation: false,
|
|
29
29
|
showToolbar: false,
|
|
30
30
|
showSaveButton: false
|
|
31
|
-
},
|
|
31
|
+
}, ro = Zn(no), _t = eo((e, r) => ({
|
|
32
32
|
landmarkPoints: [],
|
|
33
33
|
isAligned: false,
|
|
34
34
|
isCut: false,
|
|
@@ -58,14 +58,19 @@ let __tla = (async () => {
|
|
|
58
58
|
setCut: (t) => e({
|
|
59
59
|
isCut: t
|
|
60
60
|
}),
|
|
61
|
-
isSelectionComplete: () => r().landmarkPoints.length === 3
|
|
62
|
-
|
|
61
|
+
isSelectionComplete: () => r().landmarkPoints.length === 3,
|
|
62
|
+
reset: () => e({
|
|
63
|
+
landmarkPoints: [],
|
|
64
|
+
isAligned: false,
|
|
65
|
+
isCut: false
|
|
66
|
+
})
|
|
67
|
+
})), io = 0.45, pt = 3, It = 1e-3, ct = 25.4, so = [
|
|
63
68
|
0.25,
|
|
64
69
|
-0.25,
|
|
65
70
|
0.5,
|
|
66
71
|
-0.5
|
|
67
72
|
];
|
|
68
|
-
function
|
|
73
|
+
function lo(e) {
|
|
69
74
|
var _a;
|
|
70
75
|
const r = e.match(/^v\s+\S+\s+\S+\s+\S+(.*)$/m);
|
|
71
76
|
if (!r || !((_a = r[1]) == null ? void 0 : _a.trim().includes(" "))) return null;
|
|
@@ -85,21 +90,21 @@ let __tla = (async () => {
|
|
|
85
90
|
colors: new Float32Array(l)
|
|
86
91
|
} : null;
|
|
87
92
|
}
|
|
88
|
-
function
|
|
93
|
+
function ao(e, r, t, o) {
|
|
89
94
|
const l = e.getAttribute("position"), s = l.count, c = new Float32Array(s * 3), a = r.length / 3;
|
|
90
95
|
let n = 1 / 0, h = 1 / 0, d = 1 / 0, u = -1 / 0, p = -1 / 0, g = -1 / 0;
|
|
91
96
|
for (let k = 0; k < a; k++) {
|
|
92
97
|
const B = r[k * 3] * o, $ = r[k * 3 + 1] * o, N = r[k * 3 + 2] * o;
|
|
93
98
|
B < n && (n = B), B > u && (u = B), $ < h && (h = $), $ > p && (p = $), N < d && (d = N), N > g && (g = N);
|
|
94
99
|
}
|
|
95
|
-
const M = (n + u) * 0.5, f = (h + p) * 0.5, m = (d + g) * 0.5, x = u - n + 1e-6, S = p - h + 1e-6, I = g - d + 1e-6,
|
|
100
|
+
const M = (n + u) * 0.5, f = (h + p) * 0.5, m = (d + g) * 0.5, x = u - n + 1e-6, S = p - h + 1e-6, I = g - d + 1e-6, L = x * 0.5, P = S * 0.5, b = I * 0.5, z = Math.min(128, Math.max(16, Math.round(Math.cbrt(a)))), y = x / z, D = S / z, w = I / z, A = /* @__PURE__ */ new Map();
|
|
96
101
|
for (let k = 0; k < a; k++) {
|
|
97
|
-
const B = r[k * 3] * o - M, $ = r[k * 3 + 1] * o - f, N = r[k * 3 + 2] * o - m, U = Math.min(z - 1, Math.max(0, Math.floor((B +
|
|
102
|
+
const B = r[k * 3] * o - M, $ = r[k * 3 + 1] * o - f, N = r[k * 3 + 2] * o - m, U = Math.min(z - 1, Math.max(0, Math.floor((B + L) / y))), be = Math.min(z - 1, Math.max(0, Math.floor(($ + P) / D))), ae = Math.min(z - 1, Math.max(0, Math.floor((N + b) / w))), fe = U * z * z + be * z + ae;
|
|
98
103
|
let ie = A.get(fe);
|
|
99
104
|
ie || (ie = [], A.set(fe, ie)), ie.push(k);
|
|
100
105
|
}
|
|
101
106
|
for (let k = 0; k < s; k++) {
|
|
102
|
-
const B = l.getX(k), $ = l.getY(k), N = l.getZ(k), U = Math.min(z - 1, Math.max(0, Math.floor((B +
|
|
107
|
+
const B = l.getX(k), $ = l.getY(k), N = l.getZ(k), U = Math.min(z - 1, Math.max(0, Math.floor((B + L) / y))), be = Math.min(z - 1, Math.max(0, Math.floor(($ + P) / D))), ae = Math.min(z - 1, Math.max(0, Math.floor((N + b) / w)));
|
|
103
108
|
let fe = 1 / 0, ie = 0;
|
|
104
109
|
for (let J = 0; J <= z && fe > 0; J++) {
|
|
105
110
|
for (let Y = -J; Y <= J; Y++) for (let pe = -J; pe <= J; pe++) for (let Z = -J; Z <= J; Z++) {
|
|
@@ -108,8 +113,8 @@ let __tla = (async () => {
|
|
|
108
113
|
if (he < 0 || he >= z || me < 0 || me >= z || ue < 0 || ue >= z) continue;
|
|
109
114
|
const H = A.get(he * z * z + me * z + ue);
|
|
110
115
|
if (H) for (const q of H) {
|
|
111
|
-
const xe = r[q * 3] * o - M, Ce = r[q * 3 + 1] * o - f, we = r[q * 3 + 2] * o - m,
|
|
112
|
-
|
|
116
|
+
const xe = r[q * 3] * o - M, Ce = r[q * 3 + 1] * o - f, we = r[q * 3 + 2] * o - m, oe = (B - xe) ** 2 + ($ - Ce) ** 2 + (N - we) ** 2;
|
|
117
|
+
oe < fe && (fe = oe, ie = q);
|
|
113
118
|
}
|
|
114
119
|
}
|
|
115
120
|
if (fe < 1 / 0) break;
|
|
@@ -118,35 +123,35 @@ let __tla = (async () => {
|
|
|
118
123
|
}
|
|
119
124
|
e.setAttribute("color", new O.Float32BufferAttribute(c, 3));
|
|
120
125
|
}
|
|
121
|
-
const
|
|
126
|
+
const tn = {
|
|
122
127
|
debug: 0,
|
|
123
128
|
info: 1,
|
|
124
129
|
warn: 2,
|
|
125
130
|
error: 3
|
|
126
131
|
};
|
|
127
|
-
let
|
|
132
|
+
let hn = "warn", gn = null;
|
|
128
133
|
const ce = {
|
|
129
134
|
setLevel(e) {
|
|
130
|
-
|
|
135
|
+
hn = e;
|
|
131
136
|
},
|
|
132
137
|
setHandler(e) {
|
|
133
|
-
|
|
138
|
+
gn = e;
|
|
134
139
|
},
|
|
135
140
|
debug(e, r, t) {
|
|
136
|
-
|
|
141
|
+
lt("debug", e, r, t);
|
|
137
142
|
},
|
|
138
143
|
info(e, r, t) {
|
|
139
|
-
|
|
144
|
+
lt("info", e, r, t);
|
|
140
145
|
},
|
|
141
146
|
warn(e, r, t) {
|
|
142
|
-
|
|
147
|
+
lt("warn", e, r, t);
|
|
143
148
|
},
|
|
144
149
|
error(e, r, t) {
|
|
145
|
-
|
|
150
|
+
lt("error", e, r, t);
|
|
146
151
|
}
|
|
147
152
|
};
|
|
148
|
-
function
|
|
149
|
-
if (
|
|
153
|
+
function lt(e, r, t, o) {
|
|
154
|
+
if (tn[e] < tn[hn]) return;
|
|
150
155
|
const l = `[${r}]`, s = o !== void 0 ? [
|
|
151
156
|
l,
|
|
152
157
|
t,
|
|
@@ -169,9 +174,9 @@ let __tla = (async () => {
|
|
|
169
174
|
console.error(...s);
|
|
170
175
|
break;
|
|
171
176
|
}
|
|
172
|
-
|
|
177
|
+
gn == null ? void 0 : gn(e, r, t, o);
|
|
173
178
|
}
|
|
174
|
-
function
|
|
179
|
+
function dt(e) {
|
|
175
180
|
const r = e.getAttribute("position"), t = new Float32Array(r.array), o = e.getIndex();
|
|
176
181
|
if (o) return {
|
|
177
182
|
positions: t,
|
|
@@ -184,20 +189,20 @@ let __tla = (async () => {
|
|
|
184
189
|
indices: s
|
|
185
190
|
};
|
|
186
191
|
}
|
|
187
|
-
function
|
|
192
|
+
function mn(e, r) {
|
|
188
193
|
const t = new O.BufferGeometry();
|
|
189
194
|
return t.setAttribute("position", new O.Float32BufferAttribute(e, 3)), t.setIndex(new O.BufferAttribute(r, 1)), t.computeVertexNormals(), t;
|
|
190
195
|
}
|
|
191
|
-
async function
|
|
196
|
+
async function co(e, r, t) {
|
|
192
197
|
try {
|
|
193
|
-
const o =
|
|
198
|
+
const o = lo(e);
|
|
194
199
|
t == null ? void 0 : t("Parsing mesh...");
|
|
195
|
-
const s = new
|
|
200
|
+
const s = new pn().parse(e);
|
|
196
201
|
let c = null;
|
|
197
202
|
if (s.traverse((x) => {
|
|
198
203
|
x.isMesh && !c && (c = x.geometry);
|
|
199
204
|
}), !c) return null;
|
|
200
|
-
const { positions: a, indices: n } =
|
|
205
|
+
const { positions: a, indices: n } = dt(c);
|
|
201
206
|
if (a.length < 9 || n.length < 3) return ce.warn("wasm", `Mesh too small: positions=${a.length} indices=${n.length}`), null;
|
|
202
207
|
for (let x = 0; x < Math.min(a.length, 300); x++) if (!isFinite(a[x])) return ce.error("wasm", `Invalid position data: NaN/Infinity at index ${x}`), null;
|
|
203
208
|
const h = a.length / 3;
|
|
@@ -206,10 +211,10 @@ let __tla = (async () => {
|
|
|
206
211
|
const d = r.preprocess_mesh(a, n, 10, 1e-4, 500), u = d.positions(), p = d.indices(), g = d.unit_converted(), M = d.detected_unit(), f = d.log();
|
|
207
212
|
if (ce.debug("wasm", "preprocess result", f), u.length === 0) return null;
|
|
208
213
|
t == null ? void 0 : t("Building geometry...");
|
|
209
|
-
const m =
|
|
214
|
+
const m = mn(u, p);
|
|
210
215
|
if (o) {
|
|
211
216
|
const x = g ? 1e3 : 1;
|
|
212
|
-
|
|
217
|
+
ao(m, o.positions, o.colors, x);
|
|
213
218
|
}
|
|
214
219
|
return {
|
|
215
220
|
geometry: m,
|
|
@@ -221,15 +226,15 @@ let __tla = (async () => {
|
|
|
221
226
|
return ce.error("wasm", "Processing failed", o), null;
|
|
222
227
|
}
|
|
223
228
|
}
|
|
224
|
-
function
|
|
225
|
-
const t = new
|
|
229
|
+
function fo(e) {
|
|
230
|
+
const t = new pn().parse(e);
|
|
226
231
|
let o = null;
|
|
227
232
|
return t.traverse((l) => {
|
|
228
233
|
l.isMesh && !o && (o = l.geometry);
|
|
229
234
|
}), o;
|
|
230
235
|
}
|
|
231
|
-
async function
|
|
232
|
-
const r = await e.arrayBuffer(), l = new
|
|
236
|
+
async function Lt(e) {
|
|
237
|
+
const r = await e.arrayBuffer(), l = new to().parse(r).getAttribute("position");
|
|
233
238
|
if (!l || l.count === 0) throw new Error("Empty STL geometry");
|
|
234
239
|
const s = [];
|
|
235
240
|
for (let c = 0; c < l.count; c++) s.push(`v ${l.getX(c)} ${l.getY(c)} ${l.getZ(c)}`);
|
|
@@ -237,25 +242,25 @@ let __tla = (async () => {
|
|
|
237
242
|
return s.join(`
|
|
238
243
|
`);
|
|
239
244
|
}
|
|
240
|
-
function
|
|
245
|
+
function uo(e, r) {
|
|
241
246
|
const t = 1 / r;
|
|
242
247
|
return `${Math.round(e.x * t)}_${Math.round(e.y * t)}_${Math.round(e.z * t)}`;
|
|
243
248
|
}
|
|
244
|
-
function
|
|
249
|
+
function po(e, r) {
|
|
245
250
|
if (!e.length) return [];
|
|
246
251
|
const t = [];
|
|
247
252
|
for (const o of e) (t.length === 0 || t[t.length - 1].distanceTo(o) > r) && t.push(o.clone());
|
|
248
253
|
return t.length > 2 && t[0].distanceTo(t[t.length - 1]) > r && t.push(t[0].clone()), t;
|
|
249
254
|
}
|
|
250
|
-
function
|
|
255
|
+
function Ke(e) {
|
|
251
256
|
let r = 0;
|
|
252
257
|
for (let t = 0; t < e.length - 1; t++) r += e[t].distanceTo(e[t + 1]);
|
|
253
258
|
return r;
|
|
254
259
|
}
|
|
255
|
-
function
|
|
260
|
+
function xn(e, r = 1e-3, t = false) {
|
|
256
261
|
if (!e.length) return [];
|
|
257
262
|
const o = /* @__PURE__ */ new Map(), l = (u) => {
|
|
258
|
-
const p =
|
|
263
|
+
const p = uo(u, r);
|
|
259
264
|
let g = o.get(p);
|
|
260
265
|
return g || (g = u.clone(), o.set(p, g)), g;
|
|
261
266
|
}, s = e.map((u) => ({
|
|
@@ -280,13 +285,13 @@ let __tla = (async () => {
|
|
|
280
285
|
s.splice(f, 1), g = true;
|
|
281
286
|
}
|
|
282
287
|
}
|
|
283
|
-
const M =
|
|
288
|
+
const M = po(p, r);
|
|
284
289
|
M.length > 1 && c.push(M);
|
|
285
290
|
}
|
|
286
291
|
if (!c.length) return [];
|
|
287
292
|
if (t) {
|
|
288
|
-
c.sort((g, M) =>
|
|
289
|
-
const u =
|
|
293
|
+
c.sort((g, M) => Ke(M) - Ke(g));
|
|
294
|
+
const u = Ke(c[0]), p = c.filter((g) => Ke(g) >= u * 0.3);
|
|
290
295
|
return p[p.length - 1] ?? c[0];
|
|
291
296
|
}
|
|
292
297
|
const a = c.filter((u) => u.length >= 3 && u[0].distanceTo(u[u.length - 1]) < r * 10), n = a.length > 0 ? a : c;
|
|
@@ -301,8 +306,8 @@ let __tla = (async () => {
|
|
|
301
306
|
}
|
|
302
307
|
return h;
|
|
303
308
|
}
|
|
304
|
-
function
|
|
305
|
-
const l = new
|
|
309
|
+
function nn(e, r, t, o = false) {
|
|
310
|
+
const l = new ft(new C(0, 1, 0), -t), s = [], c = new fn();
|
|
306
311
|
c.setFromBufferAttribute(r.getAttribute("position"));
|
|
307
312
|
const a = {
|
|
308
313
|
linePoints: [],
|
|
@@ -310,7 +315,7 @@ let __tla = (async () => {
|
|
|
310
315
|
rightmostPoint: new C(0, t, 0)
|
|
311
316
|
};
|
|
312
317
|
if (!l.intersectsBox(c)) return a;
|
|
313
|
-
const n = new
|
|
318
|
+
const n = new un(), h = new C();
|
|
314
319
|
e.shapecast({
|
|
315
320
|
intersectsBounds: (f) => l.intersectsBox(f),
|
|
316
321
|
intersectsTriangle: (f) => {
|
|
@@ -321,12 +326,12 @@ let __tla = (async () => {
|
|
|
321
326
|
});
|
|
322
327
|
}
|
|
323
328
|
});
|
|
324
|
-
const d =
|
|
329
|
+
const d = xn(s, It, o);
|
|
325
330
|
if (d.length < 2) return a;
|
|
326
|
-
const u =
|
|
331
|
+
const u = Ke(d);
|
|
327
332
|
let p = -1 / 0, g = new C(0, t, 0);
|
|
328
333
|
for (const f of d) f.x > p && (p = f.x, g = f.clone());
|
|
329
|
-
const M = d.length > 2 && d[0].distanceTo(d[d.length - 1]) <
|
|
334
|
+
const M = d.length > 2 && d[0].distanceTo(d[d.length - 1]) < It * 10;
|
|
330
335
|
return {
|
|
331
336
|
linePoints: d,
|
|
332
337
|
lineLength: u,
|
|
@@ -334,22 +339,22 @@ let __tla = (async () => {
|
|
|
334
339
|
isClosed: M
|
|
335
340
|
};
|
|
336
341
|
}
|
|
337
|
-
function
|
|
338
|
-
const l =
|
|
342
|
+
function Ye(e, r, t, o = false) {
|
|
343
|
+
const l = nn(e, r, t, o);
|
|
339
344
|
if (l.isClosed && l.linePoints.length >= 3) return l;
|
|
340
345
|
ce.debug("slice", `y=${t.toFixed(2)} failed (pts=${l.linePoints.length}, closed=${l.isClosed}), retrying...`);
|
|
341
346
|
let s = l;
|
|
342
|
-
for (const c of
|
|
343
|
-
const a =
|
|
347
|
+
for (const c of so) {
|
|
348
|
+
const a = nn(e, r, t + c, o);
|
|
344
349
|
if (a.isClosed && a.linePoints.length >= 3) return ce.debug("slice", `y=${t.toFixed(2)} recovered with offset ${c > 0 ? "+" : ""}${c}mm (pts=${a.linePoints.length}, len=${a.lineLength.toFixed(1)}mm)`), a;
|
|
345
350
|
a.linePoints.length > s.linePoints.length && (s = a);
|
|
346
351
|
}
|
|
347
352
|
return ce.warn("slice", `y=${t.toFixed(2)} all retries exhausted (pts=${s.linePoints.length}, closed=${s.isClosed})`), s;
|
|
348
353
|
}
|
|
349
|
-
function
|
|
350
|
-
const l = new
|
|
354
|
+
function ho(e, r, t, o) {
|
|
355
|
+
const l = new ft().setFromNormalAndCoplanarPoint(o.clone().normalize(), t), s = new fn();
|
|
351
356
|
if (s.setFromBufferAttribute(r.getAttribute("position")), !l.intersectsBox(s)) return 0;
|
|
352
|
-
const c = [], a = new
|
|
357
|
+
const c = [], a = new un(), n = new C();
|
|
353
358
|
e.shapecast({
|
|
354
359
|
intersectsBounds: (d) => l.intersectsBox(d),
|
|
355
360
|
intersectsTriangle: (d) => {
|
|
@@ -360,15 +365,15 @@ let __tla = (async () => {
|
|
|
360
365
|
});
|
|
361
366
|
}
|
|
362
367
|
});
|
|
363
|
-
const h =
|
|
364
|
-
return
|
|
368
|
+
const h = xn(c, It);
|
|
369
|
+
return Ke(h);
|
|
365
370
|
}
|
|
366
|
-
function
|
|
367
|
-
return new
|
|
368
|
-
maxLeafTris:
|
|
371
|
+
function yn(e) {
|
|
372
|
+
return new ut(e, {
|
|
373
|
+
maxLeafTris: pt
|
|
369
374
|
});
|
|
370
375
|
}
|
|
371
|
-
function
|
|
376
|
+
function go(e, r, t, o) {
|
|
372
377
|
const l = e.getIndex(), s = l ? l.count / 3 : 0;
|
|
373
378
|
if (s < 10) return {
|
|
374
379
|
valid: false,
|
|
@@ -383,9 +388,9 @@ let __tla = (async () => {
|
|
|
383
388
|
valid: false,
|
|
384
389
|
reason: `Height too large (${c.toFixed(1)}mm > 1000mm)`
|
|
385
390
|
};
|
|
386
|
-
const a = new
|
|
387
|
-
maxLeafTris:
|
|
388
|
-
}), n =
|
|
391
|
+
const a = new ut(e, {
|
|
392
|
+
maxLeafTris: pt
|
|
393
|
+
}), n = Ye(a, e, r);
|
|
389
394
|
if (n.lineLength === 0) return {
|
|
390
395
|
valid: false,
|
|
391
396
|
reason: "No circumference at green point \u2014 mesh may be empty at that height"
|
|
@@ -395,7 +400,7 @@ let __tla = (async () => {
|
|
|
395
400
|
valid: true,
|
|
396
401
|
reason: ""
|
|
397
402
|
};
|
|
398
|
-
const d =
|
|
403
|
+
const d = Ye(a, e, h);
|
|
399
404
|
if (n.lineLength > 0 && d.lineLength > 0) {
|
|
400
405
|
const p = n.lineLength / d.lineLength;
|
|
401
406
|
if (p < 0.5) return {
|
|
@@ -405,7 +410,7 @@ let __tla = (async () => {
|
|
|
405
410
|
}
|
|
406
411
|
const u = r - o * 2;
|
|
407
412
|
if (u > t) {
|
|
408
|
-
const p =
|
|
413
|
+
const p = Ye(a, e, u);
|
|
409
414
|
if (d.lineLength > 0 && p.lineLength > 0) {
|
|
410
415
|
const g = d.lineLength / p.lineLength;
|
|
411
416
|
if (g < 0.5) return {
|
|
@@ -420,7 +425,7 @@ let __tla = (async () => {
|
|
|
420
425
|
};
|
|
421
426
|
}
|
|
422
427
|
const Fe = "pipeline";
|
|
423
|
-
function
|
|
428
|
+
function mo(e, r, t, o) {
|
|
424
429
|
var _a, _b, _c, _d;
|
|
425
430
|
const l = e.geometry.clone(), s = r.map((a) => ({
|
|
426
431
|
...a
|
|
@@ -442,8 +447,8 @@ let __tla = (async () => {
|
|
|
442
447
|
}
|
|
443
448
|
const we = n[0].clone();
|
|
444
449
|
a.translate(-we.x, -we.y, -we.z), n = n.map((X) => new C(X.x - we.x, X.y - we.y, X.z - we.z)), a.computeVertexNormals(), a.computeBoundingBox();
|
|
445
|
-
const
|
|
446
|
-
n.push(
|
|
450
|
+
const oe = new C(n[0].x, n[0].y, n[0].z);
|
|
451
|
+
n.push(oe), o.addLandmarkPoint({
|
|
447
452
|
faceIndex: -1,
|
|
448
453
|
vertexIndices: [
|
|
449
454
|
0,
|
|
@@ -451,9 +456,9 @@ let __tla = (async () => {
|
|
|
451
456
|
2
|
|
452
457
|
],
|
|
453
458
|
position: {
|
|
454
|
-
x:
|
|
455
|
-
y:
|
|
456
|
-
z:
|
|
459
|
+
x: oe.x,
|
|
460
|
+
y: oe.y,
|
|
461
|
+
z: oe.z
|
|
457
462
|
},
|
|
458
463
|
barycentricCoords: {
|
|
459
464
|
u: 0.33,
|
|
@@ -464,12 +469,12 @@ let __tla = (async () => {
|
|
|
464
469
|
x: X.x,
|
|
465
470
|
y: X.y,
|
|
466
471
|
z: X.z
|
|
467
|
-
}))), o.setAligned(true), o.setCut(true), o.setAdjustedStartY(null), o.setAdjustedEndY(null), o.setOriginalEndY(n[1].y + 2 *
|
|
472
|
+
}))), o.setAligned(true), o.setCut(true), o.setAdjustedStartY(null), o.setAdjustedEndY(null), o.setOriginalEndY(n[1].y + 2 * ct);
|
|
468
473
|
const V = new C();
|
|
469
474
|
a.computeBoundingBox(), a.boundingBox.getSize(V), o.setModelSize(Math.max(V.x, V.y, V.z)), l.dispose();
|
|
470
475
|
return;
|
|
471
476
|
}
|
|
472
|
-
const { positions: u, indices: p } =
|
|
477
|
+
const { positions: u, indices: p } = dt(a), g = new Float32Array([
|
|
473
478
|
h.x,
|
|
474
479
|
h.y,
|
|
475
480
|
h.z
|
|
@@ -485,12 +490,12 @@ let __tla = (async () => {
|
|
|
485
490
|
x[0],
|
|
486
491
|
x[1],
|
|
487
492
|
x[2]
|
|
488
|
-
]), I = c.find_min_cross_section(u, p, M, S, 10),
|
|
493
|
+
]), I = c.find_min_cross_section(u, p, M, S, 10), L = I.plane_normal();
|
|
489
494
|
ce.info(Fe, "Cross-section found", I.details()), o.onStatus("Aligning mesh...");
|
|
490
495
|
const P = new Float32Array([
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
496
|
+
L[0],
|
|
497
|
+
L[1],
|
|
498
|
+
L[2]
|
|
494
499
|
]), b = c.align_to_origin(u, g, M, P);
|
|
495
500
|
let z = b.positions(), y = b.mpt(), D = b.origin();
|
|
496
501
|
const w = b.transform();
|
|
@@ -506,9 +511,9 @@ let __tla = (async () => {
|
|
|
506
511
|
w[10],
|
|
507
512
|
w[11]
|
|
508
513
|
], k = new Float32Array([
|
|
509
|
-
A[0] *
|
|
510
|
-
A[3] *
|
|
511
|
-
A[6] *
|
|
514
|
+
A[0] * L[0] + A[1] * L[1] + A[2] * L[2],
|
|
515
|
+
A[3] * L[0] + A[4] * L[1] + A[5] * L[2],
|
|
516
|
+
A[6] * L[0] + A[7] * L[1] + A[8] * L[2]
|
|
512
517
|
]);
|
|
513
518
|
o.onStatus("Generating measurement points...");
|
|
514
519
|
const B = c.subdivide_origin_to_plane(new Float32Array(D), new Float32Array(y), k);
|
|
@@ -521,14 +526,14 @@ let __tla = (async () => {
|
|
|
521
526
|
const q = (m ? c.batch_cross_sections_y_inner.bind(c) : c.batch_cross_sections_y.bind(c))(z, p, new Float32Array(ae), 10);
|
|
522
527
|
ce.debug(Fe, "Batch (subdivision)", q.details());
|
|
523
528
|
const xe = q.all_loop_points(), Ce = q.offsets(), we = q.circumferences();
|
|
524
|
-
for (let
|
|
525
|
-
const V = Ce[
|
|
526
|
-
if (X <= V || we[
|
|
529
|
+
for (let oe = 0; oe < Ce.length - 1; oe++) {
|
|
530
|
+
const V = Ce[oe], X = Ce[oe + 1];
|
|
531
|
+
if (X <= V || we[oe] <= 0) continue;
|
|
527
532
|
const Le = (X - V) / 3;
|
|
528
533
|
if (Le < 3) continue;
|
|
529
|
-
let Pe = 0,
|
|
530
|
-
for (let ze = V; ze < X; ze += 3) Pe += xe[ze],
|
|
531
|
-
fe.push(Pe / Le,
|
|
534
|
+
let Pe = 0, Ge = 0, se = 0;
|
|
535
|
+
for (let ze = V; ze < X; ze += 3) Pe += xe[ze], Ge += xe[ze + 1], se += xe[ze + 2];
|
|
536
|
+
fe.push(Pe / Le, Ge / Le, se / Le);
|
|
532
537
|
}
|
|
533
538
|
}
|
|
534
539
|
if (fe.length >= 6) {
|
|
@@ -536,7 +541,7 @@ let __tla = (async () => {
|
|
|
536
541
|
const H = c.refine_alignment(new Float32Array(fe), z, new Float32Array(D), new Float32Array(y));
|
|
537
542
|
ce.info(Fe, "Refinement complete", H.details()), z = H.positions(), y = H.mpt(), D = H.origin();
|
|
538
543
|
}
|
|
539
|
-
const ie = a.getAttribute("color"), J =
|
|
544
|
+
const ie = a.getAttribute("color"), J = mn(z, p);
|
|
540
545
|
ie && J.setAttribute("color", ie), a.dispose(), a = J, e.geometry = a, a.computeVertexNormals(), a.computeBoundingBox(), n[0] = new C(D[0], D[1], D[2]), n[1] = new C(y[0], y[1], y[2]), o.onStatus("Setting blue point...");
|
|
541
546
|
const Y = new C(n[0].x, n[0].y, n[0].z);
|
|
542
547
|
n.push(Y), o.addLandmarkPoint({
|
|
@@ -562,12 +567,12 @@ let __tla = (async () => {
|
|
|
562
567
|
z: H.z
|
|
563
568
|
}))), o.setAligned(true);
|
|
564
569
|
const pe = a.boundingBox, Z = new C();
|
|
565
|
-
pe.getSize(Z), o.setModelSize(Math.max(Z.x, Z.y, Z.z)), o.setCut(true), o.setAdjustedStartY(null), o.setAdjustedEndY(null), o.setOriginalEndY(n[1].y + 2 *
|
|
570
|
+
pe.getSize(Z), o.setModelSize(Math.max(Z.x, Z.y, Z.z)), o.setCut(true), o.setAdjustedStartY(null), o.setAdjustedEndY(null), o.setOriginalEndY(n[1].y + 2 * ct), o.onStatus("Computing final measurements...");
|
|
566
571
|
{
|
|
567
|
-
const H =
|
|
572
|
+
const H = dt(a), q = n[1].y, xe = n[0].y;
|
|
568
573
|
let Ce = 1 / 0, we = -1 / 0;
|
|
569
|
-
const
|
|
570
|
-
for (let se = 1; se <
|
|
574
|
+
const oe = H.positions;
|
|
575
|
+
for (let se = 1; se < oe.length; se += 3) oe[se] < Ce && (Ce = oe[se]), oe[se] > we && (we = oe[se]);
|
|
571
576
|
const V = 25.4, X = [];
|
|
572
577
|
X.push(q);
|
|
573
578
|
for (let se = 1; se <= 2; se++) {
|
|
@@ -578,7 +583,7 @@ let __tla = (async () => {
|
|
|
578
583
|
X.sort((se, ze) => se - ze), ce.info(Fe, `Horizontal slices: ${X.length} Y planes, range ${(_b = X[0]) == null ? void 0 : _b.toFixed(1)} \u2192 ${(_c = X[X.length - 1]) == null ? void 0 : _c.toFixed(1)} mm`);
|
|
579
584
|
const Pe = (m ? c.batch_cross_sections_y_inner.bind(c) : c.batch_cross_sections_y.bind(c))(H.positions, H.indices, new Float32Array(X), 10);
|
|
580
585
|
ce.info(Fe, `Horizontal slices (${m ? "inner" : "outer"}): ${Pe.count()}/${X.length} valid`), ce.debug(Fe, "Slice details", Pe.details());
|
|
581
|
-
const
|
|
586
|
+
const Ge = {
|
|
582
587
|
yValues: X,
|
|
583
588
|
circumferences: Array.from(Pe.circumferences()),
|
|
584
589
|
allLoopPoints: new Float32Array(Pe.all_loop_points()),
|
|
@@ -586,16 +591,16 @@ let __tla = (async () => {
|
|
|
586
591
|
mptY: q,
|
|
587
592
|
originY: xe
|
|
588
593
|
};
|
|
589
|
-
(_d = o.setWasmSlices) == null ? void 0 : _d.call(o,
|
|
594
|
+
(_d = o.setWasmSlices) == null ? void 0 : _d.call(o, Ge);
|
|
590
595
|
}
|
|
591
596
|
o.onStatus("Validating results...");
|
|
592
|
-
const he = n[1].y, me = n[0].y, ue =
|
|
597
|
+
const he = n[1].y, me = n[0].y, ue = go(a, he, me, t);
|
|
593
598
|
ue.valid || ce.warn(Fe, `Validation: ${ue.reason}`), o.setClippedReferenceGeometry ? (l.computeVertexNormals(), o.setClippedReferenceGeometry(l)) : l.dispose();
|
|
594
599
|
} catch (a) {
|
|
595
600
|
ce.error(Fe, "Processing failed", a), o.setError(a instanceof Error ? a.message : "Failed to process mesh."), l.dispose();
|
|
596
601
|
}
|
|
597
602
|
}
|
|
598
|
-
class
|
|
603
|
+
class xo extends Kn {
|
|
599
604
|
constructor() {
|
|
600
605
|
super(...arguments), this.state = {
|
|
601
606
|
error: null
|
|
@@ -614,7 +619,7 @@ let __tla = (async () => {
|
|
|
614
619
|
console.error("[ErrorBoundary] Caught error:", r, t.componentStack);
|
|
615
620
|
}
|
|
616
621
|
render() {
|
|
617
|
-
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) : F("div", {
|
|
618
623
|
style: {
|
|
619
624
|
display: "flex",
|
|
620
625
|
flexDirection: "column",
|
|
@@ -662,7 +667,7 @@ let __tla = (async () => {
|
|
|
662
667
|
}) : this.props.children;
|
|
663
668
|
}
|
|
664
669
|
}
|
|
665
|
-
const
|
|
670
|
+
const yo = ({ message: e, onDismiss: r }) => F("div", {
|
|
666
671
|
style: {
|
|
667
672
|
position: "absolute",
|
|
668
673
|
top: 16,
|
|
@@ -679,7 +684,7 @@ let __tla = (async () => {
|
|
|
679
684
|
gap: 12
|
|
680
685
|
},
|
|
681
686
|
children: [
|
|
682
|
-
|
|
687
|
+
F("div", {
|
|
683
688
|
style: {
|
|
684
689
|
flex: 1
|
|
685
690
|
},
|
|
@@ -715,7 +720,7 @@ let __tla = (async () => {
|
|
|
715
720
|
children: "x"
|
|
716
721
|
})
|
|
717
722
|
]
|
|
718
|
-
}),
|
|
723
|
+
}), on = ({ message: e }) => F("div", {
|
|
719
724
|
style: {
|
|
720
725
|
position: "absolute",
|
|
721
726
|
top: 0,
|
|
@@ -753,7 +758,7 @@ let __tla = (async () => {
|
|
|
753
758
|
})
|
|
754
759
|
]
|
|
755
760
|
});
|
|
756
|
-
function
|
|
761
|
+
function bo(e, r, t, o) {
|
|
757
762
|
const l = new C().subVectors(t, r), s = new C().subVectors(o, r), c = new C().subVectors(e, r), a = l.dot(l), n = l.dot(s), h = l.dot(c), d = s.dot(s), u = s.dot(c), p = 1 / (a * d - n * n), g = (d * h - n * u) * p, M = (a * u - n * h) * p;
|
|
758
763
|
return {
|
|
759
764
|
u: 1 - g - M,
|
|
@@ -761,8 +766,8 @@ let __tla = (async () => {
|
|
|
761
766
|
w: M
|
|
762
767
|
};
|
|
763
768
|
}
|
|
764
|
-
const
|
|
765
|
-
const { addLandmarkPoint: c, landmarkPoints: a } =
|
|
769
|
+
const wo = ({ mesh: e, maxPoints: r = 2, meshColor: t = "#c8c8c8", meshOpacity: o = 1, frontFaceOnly: l = false, doubleShellTransparency: s = false }) => {
|
|
770
|
+
const { addLandmarkPoint: c, landmarkPoints: a } = _t(), n = re((g) => {
|
|
766
771
|
if (a.length >= r) return;
|
|
767
772
|
g.stopPropagation();
|
|
768
773
|
const M = g.intersections[0], f = M == null ? void 0 : M.faceIndex;
|
|
@@ -778,9 +783,9 @@ let __tla = (async () => {
|
|
|
778
783
|
f * 3 + 1,
|
|
779
784
|
f * 3 + 2
|
|
780
785
|
];
|
|
781
|
-
const I = m.getAttribute("position"),
|
|
782
|
-
|
|
783
|
-
const z = M.point, y =
|
|
786
|
+
const I = m.getAttribute("position"), L = new C().fromBufferAttribute(I, S[0]), P = new C().fromBufferAttribute(I, S[1]), b = new C().fromBufferAttribute(I, S[2]);
|
|
787
|
+
L.applyMatrix4(e.matrixWorld), P.applyMatrix4(e.matrixWorld), b.applyMatrix4(e.matrixWorld);
|
|
788
|
+
const z = M.point, y = bo(z, L, P, b), D = {
|
|
784
789
|
faceIndex: f,
|
|
785
790
|
vertexIndices: S,
|
|
786
791
|
position: {
|
|
@@ -821,9 +826,9 @@ let __tla = (async () => {
|
|
|
821
826
|
material: p,
|
|
822
827
|
renderOrder: s ? 0 : void 0
|
|
823
828
|
});
|
|
824
|
-
},
|
|
829
|
+
}, So = ({ point: e, index: r, markerSize: t, color: o, label: l }) => {
|
|
825
830
|
const [s, c] = E(false);
|
|
826
|
-
return
|
|
831
|
+
return F("mesh", {
|
|
827
832
|
position: [
|
|
828
833
|
e.position.x,
|
|
829
834
|
e.position.y,
|
|
@@ -842,7 +847,7 @@ let __tla = (async () => {
|
|
|
842
847
|
i("meshBasicMaterial", {
|
|
843
848
|
color: o
|
|
844
849
|
}),
|
|
845
|
-
s && i(
|
|
850
|
+
s && i(Xe, {
|
|
846
851
|
center: true,
|
|
847
852
|
style: {
|
|
848
853
|
pointerEvents: "none"
|
|
@@ -863,8 +868,8 @@ let __tla = (async () => {
|
|
|
863
868
|
})
|
|
864
869
|
]
|
|
865
870
|
}, r);
|
|
866
|
-
},
|
|
867
|
-
const { landmarkPoints: t } =
|
|
871
|
+
}, vo = ({ modelSize: e, labels: r }) => {
|
|
872
|
+
const { landmarkPoints: t } = _t(), o = e * 0.02, l = [
|
|
868
873
|
"#44ff44",
|
|
869
874
|
"#ff4444",
|
|
870
875
|
"#4444ff"
|
|
@@ -873,8 +878,8 @@ let __tla = (async () => {
|
|
|
873
878
|
"Origin",
|
|
874
879
|
"Cut Plane"
|
|
875
880
|
];
|
|
876
|
-
return i(
|
|
877
|
-
children: t.map((a, n) => i(
|
|
881
|
+
return i(Oe, {
|
|
882
|
+
children: t.map((a, n) => i(So, {
|
|
878
883
|
point: a,
|
|
879
884
|
index: n,
|
|
880
885
|
markerSize: o,
|
|
@@ -883,28 +888,28 @@ let __tla = (async () => {
|
|
|
883
888
|
}, n))
|
|
884
889
|
});
|
|
885
890
|
};
|
|
886
|
-
function
|
|
887
|
-
return j(() => e ? new
|
|
888
|
-
maxLeafTris:
|
|
891
|
+
function bn(e) {
|
|
892
|
+
return j(() => e ? new ut(e, {
|
|
893
|
+
maxLeafTris: pt
|
|
889
894
|
}) : null, [
|
|
890
895
|
e
|
|
891
896
|
]);
|
|
892
897
|
}
|
|
893
|
-
const
|
|
898
|
+
const rn = (e, r) => {
|
|
894
899
|
const t = Math.abs(e - r);
|
|
895
900
|
return t <= 7 ? "#8BC34A" : t <= 20 ? "#FFC107" : "#FF5722";
|
|
896
|
-
},
|
|
897
|
-
if (e <= 7) return
|
|
901
|
+
}, sn = new O.Color("#8BC34A"), ln = new O.Color("#FFC107"), Co = new O.Color("#FF5722"), Mo = (e) => {
|
|
902
|
+
if (e <= 7) return sn.clone();
|
|
898
903
|
if (e <= 20) {
|
|
899
904
|
const t = (e - 7) / 13;
|
|
900
|
-
return
|
|
905
|
+
return sn.clone().lerp(ln, t);
|
|
901
906
|
}
|
|
902
907
|
const r = Math.min((e - 20) / 20, 1);
|
|
903
|
-
return
|
|
904
|
-
},
|
|
908
|
+
return ln.clone().lerp(Co, r);
|
|
909
|
+
}, zo = (e, r) => {
|
|
905
910
|
const t = e.length, o = new Float32Array(t * 2 * 3), l = new Float32Array(t * 2 * 3), s = [];
|
|
906
911
|
for (let n = 0; n < t; n++) {
|
|
907
|
-
const h = e[n], d = r[n], u = h.distanceTo(d), p =
|
|
912
|
+
const h = e[n], d = r[n], u = h.distanceTo(d), p = Mo(u);
|
|
908
913
|
if (o[n * 6] = h.x, o[n * 6 + 1] = h.y, o[n * 6 + 2] = h.z, l[n * 6] = p.r, l[n * 6 + 1] = p.g, l[n * 6 + 2] = p.b, o[n * 6 + 3] = d.x, o[n * 6 + 4] = d.y, o[n * 6 + 5] = d.z, l[n * 6 + 3] = p.r, l[n * 6 + 4] = p.g, l[n * 6 + 5] = p.b, n < t - 1) {
|
|
909
914
|
const g = n * 2, M = g + 1, f = (n + 1) * 2, m = f + 1;
|
|
910
915
|
s.push(g, M, f, M, m, f);
|
|
@@ -921,8 +926,8 @@ let __tla = (async () => {
|
|
|
921
926
|
depthWrite: false
|
|
922
927
|
});
|
|
923
928
|
return new O.Mesh(c, a);
|
|
924
|
-
},
|
|
925
|
-
const p = j(() => d && u != null ? null :
|
|
929
|
+
}, Ao = ({ bvh: e, geometry: r, yPosition: t, color: o = "#00ff00", labelX: l, onDataChange: s, displayUnit: c = "mm", useInnerSurface: a = false, formValue: n, lineWidth: h = 1.5, wasmLoopPoints: d, wasmCircumference: u }) => {
|
|
930
|
+
const p = j(() => d && u != null ? null : Ye(e, r, t, a), [
|
|
926
931
|
e,
|
|
927
932
|
r,
|
|
928
933
|
t,
|
|
@@ -931,17 +936,17 @@ let __tla = (async () => {
|
|
|
931
936
|
u
|
|
932
937
|
]), g = d ?? (p == null ? void 0 : p.linePoints) ?? [], M = u ?? (p == null ? void 0 : p.lineLength) ?? 0, f = j(() => {
|
|
933
938
|
if (n == null || M <= 0 || g.length < 2) return null;
|
|
934
|
-
const I = n / M,
|
|
935
|
-
return g.map((b) => new C(
|
|
939
|
+
const I = n / M, L = g.reduce((b, z) => b + z.x, 0) / g.length, P = g.reduce((b, z) => b + z.z, 0) / g.length;
|
|
940
|
+
return g.map((b) => new C(L + (b.x - L) * I, b.y, P + (b.z - P) * I));
|
|
936
941
|
}, [
|
|
937
942
|
g,
|
|
938
943
|
M,
|
|
939
944
|
n
|
|
940
|
-
]), m = j(() => !f || g.length < 2 ? null :
|
|
945
|
+
]), m = j(() => !f || g.length < 2 ? null : zo(g, f), [
|
|
941
946
|
g,
|
|
942
947
|
f
|
|
943
948
|
]);
|
|
944
|
-
|
|
949
|
+
ne(() => () => {
|
|
945
950
|
m && (m.geometry.dispose(), m.material.dispose());
|
|
946
951
|
}, [
|
|
947
952
|
m
|
|
@@ -949,19 +954,19 @@ let __tla = (async () => {
|
|
|
949
954
|
const x = le(null), S = j(() => {
|
|
950
955
|
const I = new O.BufferGeometry();
|
|
951
956
|
I.setAttribute("position", new O.Float32BufferAttribute(new Float32Array(6), 3));
|
|
952
|
-
const
|
|
957
|
+
const L = new O.LineBasicMaterial({
|
|
953
958
|
color: 6710886,
|
|
954
959
|
depthTest: false,
|
|
955
960
|
depthWrite: false,
|
|
956
961
|
transparent: true
|
|
957
962
|
});
|
|
958
|
-
return new O.Line(I,
|
|
963
|
+
return new O.Line(I, L);
|
|
959
964
|
}, []);
|
|
960
|
-
return
|
|
965
|
+
return ne(() => () => {
|
|
961
966
|
S.geometry.dispose(), S.material.dispose();
|
|
962
967
|
}, [
|
|
963
968
|
S
|
|
964
|
-
]),
|
|
969
|
+
]), ne(() => {
|
|
965
970
|
M > 0 && (s == null ? void 0 : s({
|
|
966
971
|
yPosition: t,
|
|
967
972
|
originalValue: M,
|
|
@@ -971,11 +976,11 @@ let __tla = (async () => {
|
|
|
971
976
|
M,
|
|
972
977
|
t,
|
|
973
978
|
s
|
|
974
|
-
]),
|
|
979
|
+
]), an(({ camera: I }) => {
|
|
975
980
|
if (!x.current || g.length < 2) return;
|
|
976
|
-
const
|
|
977
|
-
I.getWorldDirection(
|
|
978
|
-
const P = new C(
|
|
981
|
+
const L = new C();
|
|
982
|
+
I.getWorldDirection(L);
|
|
983
|
+
const P = new C(L.x, 0, L.z);
|
|
979
984
|
if (P.lengthSq() < 1e-8) return;
|
|
980
985
|
P.normalize();
|
|
981
986
|
const b = new C().crossVectors(P, new C(0, 1, 0)).normalize();
|
|
@@ -988,7 +993,7 @@ let __tla = (async () => {
|
|
|
988
993
|
x.current.position.copy(w);
|
|
989
994
|
const A = S.geometry.getAttribute("position");
|
|
990
995
|
A.setXYZ(0, y.x, y.y, y.z), A.setXYZ(1, w.x, w.y, w.z), A.needsUpdate = true;
|
|
991
|
-
}), g.length < 2 ? null :
|
|
996
|
+
}), g.length < 2 ? null : F("group", {
|
|
992
997
|
renderOrder: 10,
|
|
993
998
|
children: [
|
|
994
999
|
i(de, {
|
|
@@ -1006,7 +1011,7 @@ let __tla = (async () => {
|
|
|
1006
1011
|
}),
|
|
1007
1012
|
f && n != null && i(de, {
|
|
1008
1013
|
points: f,
|
|
1009
|
-
color:
|
|
1014
|
+
color: rn(M, n),
|
|
1010
1015
|
lineWidth: 2.5,
|
|
1011
1016
|
dashed: true,
|
|
1012
1017
|
dashSize: 2,
|
|
@@ -1023,7 +1028,7 @@ let __tla = (async () => {
|
|
|
1023
1028
|
}),
|
|
1024
1029
|
i("group", {
|
|
1025
1030
|
ref: x,
|
|
1026
|
-
children: i(
|
|
1031
|
+
children: i(Xe, {
|
|
1027
1032
|
zIndexRange: [
|
|
1028
1033
|
100,
|
|
1029
1034
|
0
|
|
@@ -1032,7 +1037,7 @@ let __tla = (async () => {
|
|
|
1032
1037
|
pointerEvents: "none",
|
|
1033
1038
|
transform: "translateY(-50%)"
|
|
1034
1039
|
},
|
|
1035
|
-
children:
|
|
1040
|
+
children: F("div", {
|
|
1036
1041
|
style: {
|
|
1037
1042
|
display: "flex",
|
|
1038
1043
|
alignItems: "stretch",
|
|
@@ -1042,7 +1047,7 @@ let __tla = (async () => {
|
|
|
1042
1047
|
whiteSpace: "nowrap"
|
|
1043
1048
|
},
|
|
1044
1049
|
children: [
|
|
1045
|
-
|
|
1050
|
+
F("div", {
|
|
1046
1051
|
style: {
|
|
1047
1052
|
display: "flex",
|
|
1048
1053
|
alignItems: "center",
|
|
@@ -1073,8 +1078,8 @@ let __tla = (async () => {
|
|
|
1073
1078
|
]
|
|
1074
1079
|
}),
|
|
1075
1080
|
n != null && M > 0 && (() => {
|
|
1076
|
-
const I = M - n,
|
|
1077
|
-
return
|
|
1081
|
+
const I = M - n, L = I > 0.5 ? "\u25B2" : I < -0.5 ? "\u25BC" : "", P = rn(M, n);
|
|
1082
|
+
return F("div", {
|
|
1078
1083
|
style: {
|
|
1079
1084
|
display: "flex",
|
|
1080
1085
|
alignItems: "center",
|
|
@@ -1085,15 +1090,15 @@ let __tla = (async () => {
|
|
|
1085
1090
|
borderLeft: "1px solid rgba(255,255,255,0.12)"
|
|
1086
1091
|
},
|
|
1087
1092
|
children: [
|
|
1088
|
-
|
|
1093
|
+
L && i("span", {
|
|
1089
1094
|
style: {
|
|
1090
1095
|
fontSize: 10,
|
|
1091
1096
|
color: P,
|
|
1092
1097
|
lineHeight: 1
|
|
1093
1098
|
},
|
|
1094
|
-
children:
|
|
1099
|
+
children: L
|
|
1095
1100
|
}),
|
|
1096
|
-
|
|
1101
|
+
F("span", {
|
|
1097
1102
|
style: {
|
|
1098
1103
|
fontSize: 13,
|
|
1099
1104
|
color: P,
|
|
@@ -1105,7 +1110,7 @@ let __tla = (async () => {
|
|
|
1105
1110
|
c === "inch" ? (I / 25.4).toFixed(2) : I.toFixed(1)
|
|
1106
1111
|
]
|
|
1107
1112
|
}),
|
|
1108
|
-
|
|
1113
|
+
F("span", {
|
|
1109
1114
|
style: {
|
|
1110
1115
|
fontSize: 11,
|
|
1111
1116
|
color: "rgba(255,255,255,0.4)",
|
|
@@ -1125,8 +1130,8 @@ let __tla = (async () => {
|
|
|
1125
1130
|
})
|
|
1126
1131
|
]
|
|
1127
1132
|
});
|
|
1128
|
-
},
|
|
1129
|
-
const p = le(/* @__PURE__ */ new Map()), g = e.geometry, M =
|
|
1133
|
+
}, ko = Un(Ao), Fo = ({ mesh: e, startY: r, endY: t, spacing: o, modelSize: l, onMeasurementsChange: s, reverseOrder: c = false, displayUnit: a = "mm", useInnerSurface: n = false, formMeasurements: h, originY: d, wasmSlices: u }) => {
|
|
1134
|
+
const p = le(/* @__PURE__ */ new Map()), g = e.geometry, M = bn(g), f = j(() => {
|
|
1130
1135
|
if (u) {
|
|
1131
1136
|
let z = [
|
|
1132
1137
|
...u.yValues
|
|
@@ -1171,11 +1176,11 @@ let __tla = (async () => {
|
|
|
1171
1176
|
}, [
|
|
1172
1177
|
u
|
|
1173
1178
|
]);
|
|
1174
|
-
|
|
1179
|
+
ne(() => {
|
|
1175
1180
|
p.current.clear();
|
|
1176
1181
|
}, [
|
|
1177
1182
|
f
|
|
1178
|
-
]),
|
|
1183
|
+
]), ne(() => {
|
|
1179
1184
|
if (!x || !s) return;
|
|
1180
1185
|
const P = f.filter((b) => (x.get(b) ?? 0) > 0).map((b) => ({
|
|
1181
1186
|
yPosition: b,
|
|
@@ -1190,7 +1195,7 @@ let __tla = (async () => {
|
|
|
1190
1195
|
]);
|
|
1191
1196
|
const S = [
|
|
1192
1197
|
"#5B9BD5"
|
|
1193
|
-
], I = l *
|
|
1198
|
+
], I = l * io, L = re((P) => {
|
|
1194
1199
|
if (x) return;
|
|
1195
1200
|
p.current.set(P.yPosition, P);
|
|
1196
1201
|
const b = Array.from(p.current.values()).sort((z, y) => c ? y.yPosition - z.yPosition : z.yPosition - y.yPosition);
|
|
@@ -1200,14 +1205,14 @@ let __tla = (async () => {
|
|
|
1200
1205
|
c,
|
|
1201
1206
|
x
|
|
1202
1207
|
]);
|
|
1203
|
-
return M ? i(
|
|
1204
|
-
children: f.map((P, b) => i(
|
|
1208
|
+
return M ? i(Oe, {
|
|
1209
|
+
children: f.map((P, b) => i(ko, {
|
|
1205
1210
|
bvh: M,
|
|
1206
1211
|
geometry: g,
|
|
1207
1212
|
yPosition: P,
|
|
1208
1213
|
color: d != null && Math.abs(P - d) < o * 0.5 ? "#44ff44" : S[b % S.length],
|
|
1209
1214
|
labelX: I,
|
|
1210
|
-
onDataChange:
|
|
1215
|
+
onDataChange: L,
|
|
1211
1216
|
displayUnit: a,
|
|
1212
1217
|
useInnerSurface: n,
|
|
1213
1218
|
formValue: h == null ? void 0 : h[b],
|
|
@@ -1216,25 +1221,25 @@ let __tla = (async () => {
|
|
|
1216
1221
|
wasmCircumference: x == null ? void 0 : x.get(P)
|
|
1217
1222
|
}, P))
|
|
1218
1223
|
}) : null;
|
|
1219
|
-
},
|
|
1224
|
+
}, Lo = ({ mesh: e, greenY: r, modelSize: t, displayUnit: o = "mm", bottomY: l }) => {
|
|
1220
1225
|
var _a;
|
|
1221
1226
|
const s = e.geometry;
|
|
1222
1227
|
s.computeBoundingBox();
|
|
1223
1228
|
const c = l ?? ((_a = s.boundingBox) == null ? void 0 : _a.min.y) ?? 0, a = r - c, n = t * 0.4, h = t * 0.03, d = le(null);
|
|
1224
|
-
|
|
1229
|
+
an(({ camera: S }) => {
|
|
1225
1230
|
if (!d.current) return;
|
|
1226
1231
|
const I = new C();
|
|
1227
1232
|
S.getWorldDirection(I);
|
|
1228
|
-
const
|
|
1229
|
-
if (
|
|
1230
|
-
|
|
1231
|
-
const P = new C().crossVectors(new C(0, 1, 0),
|
|
1233
|
+
const L = new C(I.x, 0, I.z);
|
|
1234
|
+
if (L.lengthSq() < 1e-8) return;
|
|
1235
|
+
L.normalize();
|
|
1236
|
+
const P = new C().crossVectors(new C(0, 1, 0), L).normalize();
|
|
1232
1237
|
d.current.position.set(P.x * n, 0, P.z * n);
|
|
1233
1238
|
const b = S.position.x - d.current.position.x, z = S.position.z - d.current.position.z;
|
|
1234
1239
|
d.current.rotation.y = Math.atan2(b, z);
|
|
1235
1240
|
});
|
|
1236
1241
|
const u = new C(0, r, 0), p = new C(0, c, 0), g = new C(0, (r + c) / 2, 0), M = new C(-h, r, 0), f = new C(h, r, 0), m = new C(-h, c, 0), x = new C(h, c, 0);
|
|
1237
|
-
return
|
|
1242
|
+
return F("group", {
|
|
1238
1243
|
ref: d,
|
|
1239
1244
|
children: [
|
|
1240
1245
|
i(de, {
|
|
@@ -1263,7 +1268,7 @@ let __tla = (async () => {
|
|
|
1263
1268
|
}),
|
|
1264
1269
|
i("mesh", {
|
|
1265
1270
|
position: g,
|
|
1266
|
-
children: i(
|
|
1271
|
+
children: i(Xe, {
|
|
1267
1272
|
center: true,
|
|
1268
1273
|
style: {
|
|
1269
1274
|
pointerEvents: "none"
|
|
@@ -1272,7 +1277,7 @@ let __tla = (async () => {
|
|
|
1272
1277
|
0,
|
|
1273
1278
|
0
|
|
1274
1279
|
],
|
|
1275
|
-
children:
|
|
1280
|
+
children: F("div", {
|
|
1276
1281
|
style: {
|
|
1277
1282
|
padding: "4px 8px",
|
|
1278
1283
|
backgroundColor: "rgba(0, 0, 0, 0.7)",
|
|
@@ -1295,8 +1300,8 @@ let __tla = (async () => {
|
|
|
1295
1300
|
})
|
|
1296
1301
|
]
|
|
1297
1302
|
});
|
|
1298
|
-
},
|
|
1299
|
-
const { set: h, size: d, camera: u, invalidate: p } =
|
|
1303
|
+
}, Po = ({ modelSize: e, isAligned: r, isCut: t, mesh: o, viewMode: l, sliceY: s, landmarkCount: c = 0, measurementGeometry: a, resetCameraToFrontRef: n }) => {
|
|
1304
|
+
const { set: h, size: d, camera: u, invalidate: p } = cn(), g = le(false), M = le(l), f = le(new C()), m = le(null), x = le(c), S = le(r), I = le(t), L = le(a), P = le(0), b = re(() => {
|
|
1300
1305
|
if (!o || e <= 0) return null;
|
|
1301
1306
|
const y = a ?? o.geometry;
|
|
1302
1307
|
y.computeBoundingBox();
|
|
@@ -1314,7 +1319,7 @@ let __tla = (async () => {
|
|
|
1314
1319
|
d,
|
|
1315
1320
|
a
|
|
1316
1321
|
]);
|
|
1317
|
-
|
|
1322
|
+
ne(() => {
|
|
1318
1323
|
if (n) return n.current = () => {
|
|
1319
1324
|
const y = b();
|
|
1320
1325
|
y && (h({
|
|
@@ -1329,13 +1334,13 @@ let __tla = (async () => {
|
|
|
1329
1334
|
h,
|
|
1330
1335
|
p
|
|
1331
1336
|
]);
|
|
1332
|
-
const z =
|
|
1337
|
+
const z = re((y) => {
|
|
1333
1338
|
const D = y.position.clone(), w = D.length(), A = Math.atan2(D.x, D.z), k = Math.acos(D.y / w), $ = A + 0.02;
|
|
1334
1339
|
y.position.set(w * Math.sin(k) * Math.sin($), w * Math.cos(k), w * Math.sin(k) * Math.cos($)), y.lookAt(0, 0, 0), y.updateMatrixWorld(true), p();
|
|
1335
1340
|
}, [
|
|
1336
1341
|
p
|
|
1337
1342
|
]);
|
|
1338
|
-
return
|
|
1343
|
+
return ne(() => {
|
|
1339
1344
|
if (e > 0 && !g.current && !r) {
|
|
1340
1345
|
g.current = true;
|
|
1341
1346
|
const y = new O.PerspectiveCamera(50, d.width / d.height, 0.1, e * 10);
|
|
@@ -1349,7 +1354,7 @@ let __tla = (async () => {
|
|
|
1349
1354
|
h,
|
|
1350
1355
|
r,
|
|
1351
1356
|
z
|
|
1352
|
-
]),
|
|
1357
|
+
]), ne(() => {
|
|
1353
1358
|
const y = x.current;
|
|
1354
1359
|
x.current = c, y === 0 && c === 1 && !r && requestAnimationFrame(() => z(u));
|
|
1355
1360
|
}, [
|
|
@@ -1357,9 +1362,9 @@ let __tla = (async () => {
|
|
|
1357
1362
|
r,
|
|
1358
1363
|
u,
|
|
1359
1364
|
z
|
|
1360
|
-
]),
|
|
1361
|
-
const y = S.current !== r, D = I.current !== t, w = !
|
|
1362
|
-
if (S.current = r, I.current = t,
|
|
1365
|
+
]), ne(() => {
|
|
1366
|
+
const y = S.current !== r, D = I.current !== t, w = !L.current && !!a;
|
|
1367
|
+
if (S.current = r, I.current = t, L.current = a, !y && !D && !w || !r || l !== "3D") return;
|
|
1363
1368
|
const A = b();
|
|
1364
1369
|
A && h({
|
|
1365
1370
|
camera: A
|
|
@@ -1371,7 +1376,7 @@ let __tla = (async () => {
|
|
|
1371
1376
|
a,
|
|
1372
1377
|
b,
|
|
1373
1378
|
h
|
|
1374
|
-
]),
|
|
1379
|
+
]), ne(() => {
|
|
1375
1380
|
if (M.current === l) return;
|
|
1376
1381
|
const y = M.current;
|
|
1377
1382
|
if (M.current = l, !(!r || !o || e <= 0)) {
|
|
@@ -1415,7 +1420,7 @@ let __tla = (async () => {
|
|
|
1415
1420
|
h,
|
|
1416
1421
|
u,
|
|
1417
1422
|
b
|
|
1418
|
-
]),
|
|
1423
|
+
]), ne(() => {
|
|
1419
1424
|
if (!r || !u || !u.isOrthographicCamera) return;
|
|
1420
1425
|
const y = u;
|
|
1421
1426
|
if (l === "2D") {
|
|
@@ -1447,12 +1452,12 @@ let __tla = (async () => {
|
|
|
1447
1452
|
l,
|
|
1448
1453
|
o
|
|
1449
1454
|
]), null;
|
|
1450
|
-
},
|
|
1455
|
+
}, Io = ({ mesh: e, isDragging: r }) => {
|
|
1451
1456
|
var _a;
|
|
1452
1457
|
const t = e.geometry;
|
|
1453
1458
|
t.computeBoundingBox();
|
|
1454
1459
|
const o = new C();
|
|
1455
|
-
return (_a = t.boundingBox) == null ? void 0 : _a.getCenter(o), i(
|
|
1460
|
+
return (_a = t.boundingBox) == null ? void 0 : _a.getCenter(o), i(dn, {
|
|
1456
1461
|
enableDamping: false,
|
|
1457
1462
|
enablePan: false,
|
|
1458
1463
|
minPolarAngle: Math.PI * 0.15,
|
|
@@ -1466,7 +1471,7 @@ let __tla = (async () => {
|
|
|
1466
1471
|
o.z
|
|
1467
1472
|
]
|
|
1468
1473
|
});
|
|
1469
|
-
},
|
|
1474
|
+
}, _o = ({ wasAutoScaled: e, onDismiss: r }) => F("div", {
|
|
1470
1475
|
style: {
|
|
1471
1476
|
position: "absolute",
|
|
1472
1477
|
bottom: 16,
|
|
@@ -1507,7 +1512,7 @@ let __tla = (async () => {
|
|
|
1507
1512
|
children: "X"
|
|
1508
1513
|
})
|
|
1509
1514
|
]
|
|
1510
|
-
}),
|
|
1515
|
+
}), Do = ({ isDoubleShell: e, onDismiss: r }) => F("div", {
|
|
1511
1516
|
style: {
|
|
1512
1517
|
position: "absolute",
|
|
1513
1518
|
bottom: 68,
|
|
@@ -1548,7 +1553,7 @@ let __tla = (async () => {
|
|
|
1548
1553
|
children: "X"
|
|
1549
1554
|
})
|
|
1550
1555
|
]
|
|
1551
|
-
}),
|
|
1556
|
+
}), Bo = ({ steps: e, currentStep: r, accentColor: t = "rgb(12, 67, 173)" }) => i("div", {
|
|
1552
1557
|
style: {
|
|
1553
1558
|
backgroundColor: "#fff",
|
|
1554
1559
|
borderBottom: "1px solid #e0e0e0",
|
|
@@ -1559,12 +1564,12 @@ let __tla = (async () => {
|
|
|
1559
1564
|
},
|
|
1560
1565
|
children: e.map((o, l) => {
|
|
1561
1566
|
const s = o.number < r, c = o.number === r;
|
|
1562
|
-
return
|
|
1567
|
+
return F("div", {
|
|
1563
1568
|
style: {
|
|
1564
1569
|
display: "contents"
|
|
1565
1570
|
},
|
|
1566
1571
|
children: [
|
|
1567
|
-
|
|
1572
|
+
F("div", {
|
|
1568
1573
|
style: {
|
|
1569
1574
|
display: "flex",
|
|
1570
1575
|
alignItems: "center",
|
|
@@ -1612,24 +1617,24 @@ let __tla = (async () => {
|
|
|
1612
1617
|
]
|
|
1613
1618
|
}, o.number);
|
|
1614
1619
|
})
|
|
1615
|
-
}),
|
|
1616
|
-
const c = e.geometry, a = j(() => new
|
|
1617
|
-
maxLeafTris:
|
|
1620
|
+
}), Ro = ({ mesh: e, upperY: r, originY: t, modelSize: o, meshColor: l = "#c8c8c8", displayUnit: s = "mm" }) => {
|
|
1621
|
+
const c = e.geometry, a = j(() => new ut(c, {
|
|
1622
|
+
maxLeafTris: pt
|
|
1618
1623
|
}), [
|
|
1619
1624
|
c
|
|
1620
|
-
]), n = j(() =>
|
|
1625
|
+
]), n = j(() => Ye(a, c, t), [
|
|
1621
1626
|
a,
|
|
1622
1627
|
c,
|
|
1623
1628
|
t
|
|
1624
|
-
]), h = j(() => new
|
|
1629
|
+
]), h = j(() => new ft(new C(0, -1, 0), r), [
|
|
1625
1630
|
r
|
|
1626
1631
|
]), { mlLine: d, apLine: u, mlWidth: p, apWidth: g } = j(() => {
|
|
1627
1632
|
let m = null, x = null, S = 0, I = 0;
|
|
1628
1633
|
if (n.linePoints.length >= 2) {
|
|
1629
|
-
let
|
|
1630
|
-
for (const y of n.linePoints) y.x <
|
|
1634
|
+
let L = n.linePoints[0], P = n.linePoints[0], b = n.linePoints[0], z = n.linePoints[0];
|
|
1635
|
+
for (const y of n.linePoints) y.x < L.x && (L = y), y.x > P.x && (P = y), y.z < b.z && (b = y), y.z > z.z && (z = y);
|
|
1631
1636
|
m = [
|
|
1632
|
-
new C(
|
|
1637
|
+
new C(L.x, t, L.z),
|
|
1633
1638
|
new C(P.x, t, P.z)
|
|
1634
1639
|
], x = [
|
|
1635
1640
|
new C(b.x, t, b.z),
|
|
@@ -1646,7 +1651,7 @@ let __tla = (async () => {
|
|
|
1646
1651
|
n,
|
|
1647
1652
|
t
|
|
1648
1653
|
]), M = (m) => s === "inch" ? (m / 25.4).toFixed(2) : m.toFixed(1), f = s === "inch" ? "in" : "mm";
|
|
1649
|
-
return
|
|
1654
|
+
return F(Oe, {
|
|
1650
1655
|
children: [
|
|
1651
1656
|
i("mesh", {
|
|
1652
1657
|
geometry: e.geometry,
|
|
@@ -1669,7 +1674,7 @@ let __tla = (async () => {
|
|
|
1669
1674
|
depthWrite: false,
|
|
1670
1675
|
transparent: true
|
|
1671
1676
|
}),
|
|
1672
|
-
d &&
|
|
1677
|
+
d && F(Oe, {
|
|
1673
1678
|
children: [
|
|
1674
1679
|
i(de, {
|
|
1675
1680
|
points: d,
|
|
@@ -1679,7 +1684,7 @@ let __tla = (async () => {
|
|
|
1679
1684
|
depthWrite: false,
|
|
1680
1685
|
transparent: true
|
|
1681
1686
|
}),
|
|
1682
|
-
i(
|
|
1687
|
+
i(Xe, {
|
|
1683
1688
|
position: [
|
|
1684
1689
|
d[0].x,
|
|
1685
1690
|
t,
|
|
@@ -1696,7 +1701,7 @@ let __tla = (async () => {
|
|
|
1696
1701
|
backgroundColor: "rgba(0,0,0,0.75)",
|
|
1697
1702
|
borderRadius: 3
|
|
1698
1703
|
},
|
|
1699
|
-
children:
|
|
1704
|
+
children: F("span", {
|
|
1700
1705
|
style: {
|
|
1701
1706
|
fontSize: 12,
|
|
1702
1707
|
color: "#ff8800",
|
|
@@ -1713,7 +1718,7 @@ let __tla = (async () => {
|
|
|
1713
1718
|
})
|
|
1714
1719
|
]
|
|
1715
1720
|
}),
|
|
1716
|
-
u &&
|
|
1721
|
+
u && F(Oe, {
|
|
1717
1722
|
children: [
|
|
1718
1723
|
i(de, {
|
|
1719
1724
|
points: u,
|
|
@@ -1723,7 +1728,7 @@ let __tla = (async () => {
|
|
|
1723
1728
|
depthWrite: false,
|
|
1724
1729
|
transparent: true
|
|
1725
1730
|
}),
|
|
1726
|
-
i(
|
|
1731
|
+
i(Xe, {
|
|
1727
1732
|
position: [
|
|
1728
1733
|
Math.max(u[0].x, u[1].x) + o * 0.02,
|
|
1729
1734
|
t,
|
|
@@ -1740,7 +1745,7 @@ let __tla = (async () => {
|
|
|
1740
1745
|
backgroundColor: "rgba(0,0,0,0.75)",
|
|
1741
1746
|
borderRadius: 3
|
|
1742
1747
|
},
|
|
1743
|
-
children:
|
|
1748
|
+
children: F("span", {
|
|
1744
1749
|
style: {
|
|
1745
1750
|
fontSize: 12,
|
|
1746
1751
|
color: "#ff00ff",
|
|
@@ -1759,32 +1764,32 @@ let __tla = (async () => {
|
|
|
1759
1764
|
})
|
|
1760
1765
|
]
|
|
1761
1766
|
});
|
|
1762
|
-
},
|
|
1763
|
-
const [p, g] = E(false), [M, f] = E(false), { camera: m, gl: x } =
|
|
1767
|
+
}, Wo = ({ mesh: e, yPosition: r, onYChange: t, minY: o, maxY: l, modelSize: s, color: c, hoverColor: a, dragColor: n, label: h, onDragStart: d, onDragEnd: u }) => {
|
|
1768
|
+
const [p, g] = E(false), [M, f] = E(false), { camera: m, gl: x } = cn(), S = le(0), I = e.geometry, L = bn(I), P = j(() => L ? Ye(L, I, r) : {
|
|
1764
1769
|
linePoints: [],
|
|
1765
1770
|
lineLength: 0,
|
|
1766
1771
|
rightmostPoint: new C()
|
|
1767
1772
|
}, [
|
|
1768
|
-
|
|
1773
|
+
L,
|
|
1769
1774
|
I,
|
|
1770
1775
|
r
|
|
1771
|
-
]), b =
|
|
1772
|
-
const B = x.domElement.getBoundingClientRect(), $ = (A - B.left) / B.width * 2 - 1, N = -((k - B.top) / B.height) * 2 + 1, U = new
|
|
1776
|
+
]), b = re((A, k) => {
|
|
1777
|
+
const B = x.domElement.getBoundingClientRect(), $ = (A - B.left) / B.width * 2 - 1, N = -((k - B.top) / B.height) * 2 + 1, U = new qn();
|
|
1773
1778
|
U.setFromCamera(new O.Vector2($, N), m);
|
|
1774
|
-
const be = new
|
|
1779
|
+
const be = new ft(new C(0, 0, 1), 0), ae = new C();
|
|
1775
1780
|
return U.ray.intersectPlane(be, ae), ae ? ae.y : r;
|
|
1776
1781
|
}, [
|
|
1777
1782
|
m,
|
|
1778
1783
|
x,
|
|
1779
1784
|
r
|
|
1780
|
-
]), z =
|
|
1785
|
+
]), z = re((A) => {
|
|
1781
1786
|
A.stopPropagation(), g(true), x.domElement.style.cursor = "ns-resize", S.current = r - b(A.clientX, A.clientY), A.target.setPointerCapture(A.pointerId), d == null ? void 0 : d();
|
|
1782
1787
|
}, [
|
|
1783
1788
|
r,
|
|
1784
1789
|
x,
|
|
1785
1790
|
b,
|
|
1786
1791
|
d
|
|
1787
|
-
]), y =
|
|
1792
|
+
]), y = re((A) => {
|
|
1788
1793
|
if (!p) return;
|
|
1789
1794
|
let k = b(A.clientX, A.clientY) + S.current;
|
|
1790
1795
|
k = Math.max(o, Math.min(l, k)), t(k);
|
|
@@ -1794,7 +1799,7 @@ let __tla = (async () => {
|
|
|
1794
1799
|
t,
|
|
1795
1800
|
o,
|
|
1796
1801
|
l
|
|
1797
|
-
]), D =
|
|
1802
|
+
]), D = re((A) => {
|
|
1798
1803
|
g(false), x.domElement.style.cursor = "auto", A.target.releasePointerCapture(A.pointerId), u == null ? void 0 : u();
|
|
1799
1804
|
}, [
|
|
1800
1805
|
x,
|
|
@@ -1802,7 +1807,7 @@ let __tla = (async () => {
|
|
|
1802
1807
|
]);
|
|
1803
1808
|
if (P.linePoints.length < 2) return null;
|
|
1804
1809
|
const w = p ? n : M ? a : c;
|
|
1805
|
-
return
|
|
1810
|
+
return F("group", {
|
|
1806
1811
|
renderOrder: 10,
|
|
1807
1812
|
children: [
|
|
1808
1813
|
i(de, {
|
|
@@ -1829,7 +1834,7 @@ let __tla = (async () => {
|
|
|
1829
1834
|
r,
|
|
1830
1835
|
0
|
|
1831
1836
|
],
|
|
1832
|
-
children: i(
|
|
1837
|
+
children: i(Xe, {
|
|
1833
1838
|
center: true,
|
|
1834
1839
|
children: i("div", {
|
|
1835
1840
|
style: {
|
|
@@ -1848,17 +1853,17 @@ let __tla = (async () => {
|
|
|
1848
1853
|
]
|
|
1849
1854
|
});
|
|
1850
1855
|
};
|
|
1851
|
-
function
|
|
1856
|
+
function Eo(e, r) {
|
|
1852
1857
|
if (e == null) return {};
|
|
1853
1858
|
var t = {}, o = Object.keys(e), l, s;
|
|
1854
1859
|
for (s = 0; s < o.length; s++) l = o[s], !(r.indexOf(l) >= 0) && (t[l] = e[l]);
|
|
1855
1860
|
return t;
|
|
1856
1861
|
}
|
|
1857
|
-
var
|
|
1862
|
+
var To = [
|
|
1858
1863
|
"color"
|
|
1859
|
-
],
|
|
1860
|
-
var t = e.color, o = t === void 0 ? "currentColor" : t, l =
|
|
1861
|
-
return
|
|
1864
|
+
], Oo = Jn(function(e, r) {
|
|
1865
|
+
var t = e.color, o = t === void 0 ? "currentColor" : t, l = Eo(e, To);
|
|
1866
|
+
return en("svg", Object.assign({
|
|
1862
1867
|
width: "15",
|
|
1863
1868
|
height: "15",
|
|
1864
1869
|
viewBox: "0 0 15 15",
|
|
@@ -1866,20 +1871,20 @@ let __tla = (async () => {
|
|
|
1866
1871
|
xmlns: "http://www.w3.org/2000/svg"
|
|
1867
1872
|
}, l, {
|
|
1868
1873
|
ref: r
|
|
1869
|
-
}),
|
|
1874
|
+
}), en("path", {
|
|
1870
1875
|
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",
|
|
1871
1876
|
fill: o,
|
|
1872
1877
|
fillRule: "evenodd",
|
|
1873
1878
|
clipRule: "evenodd"
|
|
1874
1879
|
}));
|
|
1875
1880
|
});
|
|
1876
|
-
const
|
|
1881
|
+
const $o = [
|
|
1877
1882
|
"Scan doesn't load properly",
|
|
1878
1883
|
"Takes too long",
|
|
1879
1884
|
"I don't want to",
|
|
1880
1885
|
"I want a second opinion",
|
|
1881
1886
|
"I measured from IT"
|
|
1882
|
-
],
|
|
1887
|
+
], Ne = {
|
|
1883
1888
|
padding: "8px 20px",
|
|
1884
1889
|
borderRadius: 4,
|
|
1885
1890
|
fontSize: 14,
|
|
@@ -1888,7 +1893,7 @@ let __tla = (async () => {
|
|
|
1888
1893
|
fontFamily: "system-ui, sans-serif",
|
|
1889
1894
|
letterSpacing: "0.4px",
|
|
1890
1895
|
lineHeight: "36px"
|
|
1891
|
-
},
|
|
1896
|
+
}, Pt = {
|
|
1892
1897
|
width: "100%",
|
|
1893
1898
|
padding: "10px 12px",
|
|
1894
1899
|
fontSize: 15,
|
|
@@ -1897,7 +1902,7 @@ let __tla = (async () => {
|
|
|
1897
1902
|
outline: "none",
|
|
1898
1903
|
boxSizing: "border-box",
|
|
1899
1904
|
fontFamily: "system-ui, sans-serif"
|
|
1900
|
-
},
|
|
1905
|
+
}, Ho = ({ amputationType: e, spacingInches: r, scanMeasurements: t, scanFrontalHeight: o, onSave: l, onSkip: s }) => {
|
|
1901
1906
|
const c = e === "AK" ? "IT" : "MPT", a = r, n = e === "AK" ? 18 : 9, h = j(() => {
|
|
1902
1907
|
const w = [];
|
|
1903
1908
|
for (let A = 2; A >= 1; A -= a) w.push(`${A}\u2033 above ${c}`);
|
|
@@ -1908,7 +1913,7 @@ let __tla = (async () => {
|
|
|
1908
1913
|
a,
|
|
1909
1914
|
c,
|
|
1910
1915
|
n
|
|
1911
|
-
]), [d, u] = E({}), [p, g] = E(""), [M, f] = E(false), [m, x] = E(false), [S, I] = E(null), [
|
|
1916
|
+
]), [d, u] = E({}), [p, g] = E(""), [M, f] = E(false), [m, x] = E(false), [S, I] = E(null), [L, P] = E(""), b = j(() => {
|
|
1912
1917
|
const w = p !== "" && !isNaN(parseFloat(p)), A = h.some((k) => {
|
|
1913
1918
|
const B = d[k];
|
|
1914
1919
|
return B != null && B !== "" && !isNaN(parseFloat(B));
|
|
@@ -1918,7 +1923,7 @@ let __tla = (async () => {
|
|
|
1918
1923
|
d,
|
|
1919
1924
|
p,
|
|
1920
1925
|
h
|
|
1921
|
-
]), z =
|
|
1926
|
+
]), z = re(() => {
|
|
1922
1927
|
if (!b) return;
|
|
1923
1928
|
const w = h.map((k) => {
|
|
1924
1929
|
const B = d[k];
|
|
@@ -1934,7 +1939,7 @@ let __tla = (async () => {
|
|
|
1934
1939
|
d,
|
|
1935
1940
|
p,
|
|
1936
1941
|
l
|
|
1937
|
-
]), y =
|
|
1942
|
+
]), y = re(() => {
|
|
1938
1943
|
const w = {};
|
|
1939
1944
|
h.forEach((A, k) => {
|
|
1940
1945
|
const B = t[k];
|
|
@@ -1947,12 +1952,12 @@ let __tla = (async () => {
|
|
|
1947
1952
|
h,
|
|
1948
1953
|
t,
|
|
1949
1954
|
o
|
|
1950
|
-
]), D =
|
|
1955
|
+
]), D = re(() => {
|
|
1951
1956
|
f(false), x(true);
|
|
1952
1957
|
}, []);
|
|
1953
1958
|
if (m) {
|
|
1954
|
-
const w = S != null && (S !== "Other" ||
|
|
1955
|
-
w && s(S === "Other" ? `Other: ${
|
|
1959
|
+
const w = S != null && (S !== "Other" || L.trim() !== ""), A = () => {
|
|
1960
|
+
w && s(S === "Other" ? `Other: ${L.trim()}` : S);
|
|
1956
1961
|
};
|
|
1957
1962
|
return i("div", {
|
|
1958
1963
|
style: {
|
|
@@ -1967,7 +1972,7 @@ let __tla = (async () => {
|
|
|
1967
1972
|
zIndex: 9999,
|
|
1968
1973
|
fontFamily: "system-ui, sans-serif"
|
|
1969
1974
|
},
|
|
1970
|
-
children:
|
|
1975
|
+
children: F("div", {
|
|
1971
1976
|
style: {
|
|
1972
1977
|
backgroundColor: "#fff",
|
|
1973
1978
|
borderRadius: 12,
|
|
@@ -1975,7 +1980,7 @@ let __tla = (async () => {
|
|
|
1975
1980
|
boxShadow: "0 24px 38px 3px rgba(0,0,0,0.14)"
|
|
1976
1981
|
},
|
|
1977
1982
|
children: [
|
|
1978
|
-
|
|
1983
|
+
F("div", {
|
|
1979
1984
|
style: {
|
|
1980
1985
|
padding: "24px 24px 0"
|
|
1981
1986
|
},
|
|
@@ -1998,7 +2003,7 @@ let __tla = (async () => {
|
|
|
1998
2003
|
})
|
|
1999
2004
|
]
|
|
2000
2005
|
}),
|
|
2001
|
-
|
|
2006
|
+
F("div", {
|
|
2002
2007
|
style: {
|
|
2003
2008
|
padding: "20px 24px",
|
|
2004
2009
|
display: "flex",
|
|
@@ -2007,9 +2012,9 @@ let __tla = (async () => {
|
|
|
2007
2012
|
},
|
|
2008
2013
|
children: [
|
|
2009
2014
|
[
|
|
2010
|
-
|
|
2015
|
+
...$o,
|
|
2011
2016
|
"Other"
|
|
2012
|
-
].map((k) =>
|
|
2017
|
+
].map((k) => F("label", {
|
|
2013
2018
|
style: {
|
|
2014
2019
|
display: "flex",
|
|
2015
2020
|
alignItems: "center",
|
|
@@ -2048,13 +2053,13 @@ let __tla = (async () => {
|
|
|
2048
2053
|
autoFocus: true,
|
|
2049
2054
|
type: "text",
|
|
2050
2055
|
placeholder: "Please describe...",
|
|
2051
|
-
value:
|
|
2056
|
+
value: L,
|
|
2052
2057
|
onChange: (k) => P(k.target.value),
|
|
2053
2058
|
onKeyDown: (k) => {
|
|
2054
2059
|
k.key === "Enter" && A();
|
|
2055
2060
|
},
|
|
2056
2061
|
style: {
|
|
2057
|
-
...
|
|
2062
|
+
...Pt,
|
|
2058
2063
|
marginTop: 8,
|
|
2059
2064
|
marginLeft: 40,
|
|
2060
2065
|
width: "calc(100% - 40px)",
|
|
@@ -2063,7 +2068,7 @@ let __tla = (async () => {
|
|
|
2063
2068
|
})
|
|
2064
2069
|
]
|
|
2065
2070
|
}),
|
|
2066
|
-
|
|
2071
|
+
F("div", {
|
|
2067
2072
|
style: {
|
|
2068
2073
|
display: "flex",
|
|
2069
2074
|
justifyContent: "flex-end",
|
|
@@ -2077,7 +2082,7 @@ let __tla = (async () => {
|
|
|
2077
2082
|
x(false), I(null), P("");
|
|
2078
2083
|
},
|
|
2079
2084
|
style: {
|
|
2080
|
-
...
|
|
2085
|
+
...Ne,
|
|
2081
2086
|
backgroundColor: "#fff",
|
|
2082
2087
|
border: "1px solid #ddd",
|
|
2083
2088
|
color: "#666"
|
|
@@ -2088,7 +2093,7 @@ let __tla = (async () => {
|
|
|
2088
2093
|
onClick: A,
|
|
2089
2094
|
disabled: !w,
|
|
2090
2095
|
style: {
|
|
2091
|
-
...
|
|
2096
|
+
...Ne,
|
|
2092
2097
|
backgroundColor: w ? "rgb(12, 67, 173)" : "#e0e0e0",
|
|
2093
2098
|
border: "none",
|
|
2094
2099
|
color: w ? "#fff" : "#9e9e9e",
|
|
@@ -2115,7 +2120,7 @@ let __tla = (async () => {
|
|
|
2115
2120
|
zIndex: 9999,
|
|
2116
2121
|
fontFamily: "system-ui, sans-serif"
|
|
2117
2122
|
},
|
|
2118
|
-
children:
|
|
2123
|
+
children: F("div", {
|
|
2119
2124
|
style: {
|
|
2120
2125
|
backgroundColor: "#fff",
|
|
2121
2126
|
borderRadius: 8,
|
|
@@ -2141,7 +2146,7 @@ let __tla = (async () => {
|
|
|
2141
2146
|
},
|
|
2142
2147
|
children: "Your measurements will be submitted without comparing to the scan. Are you sure?"
|
|
2143
2148
|
}),
|
|
2144
|
-
|
|
2149
|
+
F("div", {
|
|
2145
2150
|
style: {
|
|
2146
2151
|
display: "flex",
|
|
2147
2152
|
justifyContent: "flex-end",
|
|
@@ -2151,7 +2156,7 @@ let __tla = (async () => {
|
|
|
2151
2156
|
i("button", {
|
|
2152
2157
|
onClick: () => f(false),
|
|
2153
2158
|
style: {
|
|
2154
|
-
...
|
|
2159
|
+
...Ne,
|
|
2155
2160
|
backgroundColor: "#fff",
|
|
2156
2161
|
border: "1px solid #bdbdbd",
|
|
2157
2162
|
color: "#333"
|
|
@@ -2161,7 +2166,7 @@ let __tla = (async () => {
|
|
|
2161
2166
|
i("button", {
|
|
2162
2167
|
onClick: D,
|
|
2163
2168
|
style: {
|
|
2164
|
-
...
|
|
2169
|
+
...Ne,
|
|
2165
2170
|
backgroundColor: "rgb(12, 67, 173)",
|
|
2166
2171
|
border: "none",
|
|
2167
2172
|
color: "#fff"
|
|
@@ -2172,7 +2177,7 @@ let __tla = (async () => {
|
|
|
2172
2177
|
})
|
|
2173
2178
|
]
|
|
2174
2179
|
})
|
|
2175
|
-
}) :
|
|
2180
|
+
}) : F("div", {
|
|
2176
2181
|
style: {
|
|
2177
2182
|
position: "fixed",
|
|
2178
2183
|
inset: 0,
|
|
@@ -2190,7 +2195,7 @@ let __tla = (async () => {
|
|
|
2190
2195
|
borderBottom: "1px solid #e0e0e0",
|
|
2191
2196
|
flexShrink: 0
|
|
2192
2197
|
},
|
|
2193
|
-
children:
|
|
2198
|
+
children: F("div", {
|
|
2194
2199
|
style: {
|
|
2195
2200
|
display: "flex",
|
|
2196
2201
|
alignItems: "center",
|
|
@@ -2199,9 +2204,9 @@ let __tla = (async () => {
|
|
|
2199
2204
|
gap: 12
|
|
2200
2205
|
},
|
|
2201
2206
|
children: [
|
|
2202
|
-
|
|
2207
|
+
F("div", {
|
|
2203
2208
|
children: [
|
|
2204
|
-
|
|
2209
|
+
F("div", {
|
|
2205
2210
|
style: {
|
|
2206
2211
|
fontSize: 22,
|
|
2207
2212
|
fontWeight: 600,
|
|
@@ -2212,7 +2217,7 @@ let __tla = (async () => {
|
|
|
2212
2217
|
" Measurements"
|
|
2213
2218
|
]
|
|
2214
2219
|
}),
|
|
2215
|
-
|
|
2220
|
+
F("div", {
|
|
2216
2221
|
style: {
|
|
2217
2222
|
fontSize: 13,
|
|
2218
2223
|
color: "rgba(0,0,0,0.54)",
|
|
@@ -2230,7 +2235,7 @@ let __tla = (async () => {
|
|
|
2230
2235
|
i("button", {
|
|
2231
2236
|
onClick: y,
|
|
2232
2237
|
style: {
|
|
2233
|
-
...
|
|
2238
|
+
...Ne,
|
|
2234
2239
|
backgroundColor: "#fff",
|
|
2235
2240
|
border: "2px solid rgb(12, 67, 173)",
|
|
2236
2241
|
color: "rgb(12, 67, 173)",
|
|
@@ -2238,7 +2243,7 @@ let __tla = (async () => {
|
|
|
2238
2243
|
padding: "6px 16px",
|
|
2239
2244
|
fontSize: 13
|
|
2240
2245
|
},
|
|
2241
|
-
children:
|
|
2246
|
+
children: F("span", {
|
|
2242
2247
|
style: {
|
|
2243
2248
|
marginRight: 8,
|
|
2244
2249
|
display: "flex",
|
|
@@ -2246,7 +2251,7 @@ let __tla = (async () => {
|
|
|
2246
2251
|
gap: 4
|
|
2247
2252
|
},
|
|
2248
2253
|
children: [
|
|
2249
|
-
i(
|
|
2254
|
+
i(Oo, {
|
|
2250
2255
|
style: {
|
|
2251
2256
|
width: 16,
|
|
2252
2257
|
height: 16
|
|
@@ -2259,7 +2264,7 @@ let __tla = (async () => {
|
|
|
2259
2264
|
]
|
|
2260
2265
|
})
|
|
2261
2266
|
}),
|
|
2262
|
-
|
|
2267
|
+
F("div", {
|
|
2263
2268
|
style: {
|
|
2264
2269
|
flex: 1,
|
|
2265
2270
|
minHeight: 0,
|
|
@@ -2284,9 +2289,9 @@ let __tla = (async () => {
|
|
|
2284
2289
|
gap: "12px 20px",
|
|
2285
2290
|
marginBottom: 28
|
|
2286
2291
|
},
|
|
2287
|
-
children: h.map((w, A) =>
|
|
2292
|
+
children: h.map((w, A) => F("div", {
|
|
2288
2293
|
children: [
|
|
2289
|
-
|
|
2294
|
+
F("label", {
|
|
2290
2295
|
style: {
|
|
2291
2296
|
display: "block",
|
|
2292
2297
|
fontSize: 12,
|
|
@@ -2314,7 +2319,7 @@ let __tla = (async () => {
|
|
|
2314
2319
|
[w]: k.target.value
|
|
2315
2320
|
})),
|
|
2316
2321
|
style: {
|
|
2317
|
-
...
|
|
2322
|
+
...Pt,
|
|
2318
2323
|
padding: "8px 10px",
|
|
2319
2324
|
fontSize: 14,
|
|
2320
2325
|
borderColor: d[w] ? "rgb(12, 67, 173)" : "#ccc"
|
|
@@ -2339,9 +2344,9 @@ let __tla = (async () => {
|
|
|
2339
2344
|
gridTemplateColumns: "repeat(auto-fill, minmax(180px, 1fr))",
|
|
2340
2345
|
gap: "12px 20px"
|
|
2341
2346
|
},
|
|
2342
|
-
children:
|
|
2347
|
+
children: F("div", {
|
|
2343
2348
|
children: [
|
|
2344
|
-
|
|
2349
|
+
F("label", {
|
|
2345
2350
|
style: {
|
|
2346
2351
|
display: "block",
|
|
2347
2352
|
fontSize: 12,
|
|
@@ -2365,7 +2370,7 @@ let __tla = (async () => {
|
|
|
2365
2370
|
value: p,
|
|
2366
2371
|
onChange: (w) => g(w.target.value),
|
|
2367
2372
|
style: {
|
|
2368
|
-
...
|
|
2373
|
+
...Pt,
|
|
2369
2374
|
padding: "8px 10px",
|
|
2370
2375
|
fontSize: 14,
|
|
2371
2376
|
borderColor: p ? "rgb(12, 67, 173)" : "#ccc"
|
|
@@ -2377,7 +2382,7 @@ let __tla = (async () => {
|
|
|
2377
2382
|
})
|
|
2378
2383
|
]
|
|
2379
2384
|
}),
|
|
2380
|
-
|
|
2385
|
+
F("div", {
|
|
2381
2386
|
style: {
|
|
2382
2387
|
padding: "12px 24px",
|
|
2383
2388
|
backgroundColor: "#fff",
|
|
@@ -2393,7 +2398,7 @@ let __tla = (async () => {
|
|
|
2393
2398
|
i("button", {
|
|
2394
2399
|
onClick: () => f(true),
|
|
2395
2400
|
style: {
|
|
2396
|
-
...
|
|
2401
|
+
...Ne,
|
|
2397
2402
|
backgroundColor: "#fff",
|
|
2398
2403
|
border: "1px solid #bdbdbd",
|
|
2399
2404
|
color: "#666",
|
|
@@ -2406,7 +2411,7 @@ let __tla = (async () => {
|
|
|
2406
2411
|
onClick: z,
|
|
2407
2412
|
disabled: !b,
|
|
2408
2413
|
style: {
|
|
2409
|
-
...
|
|
2414
|
+
...Ne,
|
|
2410
2415
|
backgroundColor: b ? "rgb(12, 67, 173)" : "#e0e0e0",
|
|
2411
2416
|
border: "none",
|
|
2412
2417
|
color: b ? "#fff" : "#9e9e9e",
|
|
@@ -2421,18 +2426,18 @@ let __tla = (async () => {
|
|
|
2421
2426
|
]
|
|
2422
2427
|
});
|
|
2423
2428
|
};
|
|
2424
|
-
function
|
|
2429
|
+
function wn(e, r, t) {
|
|
2425
2430
|
const o = e.getAttribute("position"), l = t - r;
|
|
2426
2431
|
if (l < 1) return null;
|
|
2427
2432
|
const s = 30, c = l / s, a = [];
|
|
2428
2433
|
for (let m = 0; m < s; m++) {
|
|
2429
2434
|
const x = r + m * c, S = r + (m + 1) * c;
|
|
2430
|
-
let I = 0,
|
|
2435
|
+
let I = 0, L = 0, P = 0, b = 0;
|
|
2431
2436
|
for (let z = 0; z < o.count; z++) {
|
|
2432
2437
|
const y = o.getY(z);
|
|
2433
|
-
y >= x && y < S && (I += o.getX(z),
|
|
2438
|
+
y >= x && y < S && (I += o.getX(z), L += y, P += o.getZ(z), b++);
|
|
2434
2439
|
}
|
|
2435
|
-
b > 20 && a.push(new C(I / b,
|
|
2440
|
+
b > 20 && a.push(new C(I / b, L / b, P / b));
|
|
2436
2441
|
}
|
|
2437
2442
|
if (a.length < 5) return null;
|
|
2438
2443
|
const n = new C();
|
|
@@ -2445,13 +2450,13 @@ let __tla = (async () => {
|
|
|
2445
2450
|
}
|
|
2446
2451
|
let f = new C(0.01, 1, 0.01).normalize();
|
|
2447
2452
|
for (let m = 0; m < 30; m++) {
|
|
2448
|
-
const x = h * f.x + d * f.y + u * f.z, S = d * f.x + p * f.y + g * f.z, I = u * f.x + g * f.y + M * f.z,
|
|
2449
|
-
if (P < 1e-10 || (
|
|
2450
|
-
f =
|
|
2453
|
+
const x = h * f.x + d * f.y + u * f.z, S = d * f.x + p * f.y + g * f.z, I = u * f.x + g * f.y + M * f.z, L = new C(x, S, I), P = L.length();
|
|
2454
|
+
if (P < 1e-10 || (L.divideScalar(P), f.distanceTo(L) < 1e-8)) break;
|
|
2455
|
+
f = L;
|
|
2451
2456
|
}
|
|
2452
2457
|
return f.y < 0 && f.negate(), f;
|
|
2453
2458
|
}
|
|
2454
|
-
const
|
|
2459
|
+
const Vo = {
|
|
2455
2460
|
pcaAxes: true,
|
|
2456
2461
|
obb: true,
|
|
2457
2462
|
obbAxis: true,
|
|
@@ -2461,12 +2466,12 @@ let __tla = (async () => {
|
|
|
2461
2466
|
landmarkAxis: true,
|
|
2462
2467
|
iterativePCA: false,
|
|
2463
2468
|
fullRegionPCA: true
|
|
2464
|
-
},
|
|
2469
|
+
}, jo = [
|
|
2465
2470
|
"#ff4444",
|
|
2466
2471
|
"#44cc44",
|
|
2467
2472
|
"#4488ff"
|
|
2468
2473
|
];
|
|
2469
|
-
function
|
|
2474
|
+
function Sn(e) {
|
|
2470
2475
|
const r = e.getAttribute("position"), t = r.count, o = new C();
|
|
2471
2476
|
for (let f = 0; f < t; f++) o.x += r.getX(f), o.y += r.getY(f), o.z += r.getZ(f);
|
|
2472
2477
|
o.divideScalar(t);
|
|
@@ -2496,7 +2501,7 @@ let __tla = (async () => {
|
|
|
2496
2501
|
for (let f = 0; f < 3; f++) {
|
|
2497
2502
|
let m = new C(1 + f * 0.1, 1 - f * 0.1, 0.5 + f * 0.3).normalize(), x = 0;
|
|
2498
2503
|
for (let S = 0; S < 100; S++) {
|
|
2499
|
-
const I = p[0][0] * m.x + p[0][1] * m.y + p[0][2] * m.z,
|
|
2504
|
+
const I = p[0][0] * m.x + p[0][1] * m.y + p[0][2] * m.z, L = p[1][0] * m.x + p[1][1] * m.y + p[1][2] * m.z, P = p[2][0] * m.x + p[2][1] * m.y + p[2][2] * m.z, b = new C(I, L, P);
|
|
2500
2505
|
if (x = b.length(), x < 1e-12) break;
|
|
2501
2506
|
if (b.divideScalar(x), m.distanceTo(b) < 1e-10) {
|
|
2502
2507
|
m = b;
|
|
@@ -2506,7 +2511,7 @@ let __tla = (async () => {
|
|
|
2506
2511
|
}
|
|
2507
2512
|
d.push(m.clone()), u.push(x);
|
|
2508
2513
|
for (let S = 0; S < 3; S++) for (let I = 0; I < 3; I++) {
|
|
2509
|
-
const
|
|
2514
|
+
const L = [
|
|
2510
2515
|
m.x,
|
|
2511
2516
|
m.y,
|
|
2512
2517
|
m.z
|
|
@@ -2515,7 +2520,7 @@ let __tla = (async () => {
|
|
|
2515
2520
|
m.y,
|
|
2516
2521
|
m.z
|
|
2517
2522
|
][I];
|
|
2518
|
-
p[S][I] -= x *
|
|
2523
|
+
p[S][I] -= x * L * P;
|
|
2519
2524
|
}
|
|
2520
2525
|
}
|
|
2521
2526
|
const g = new C();
|
|
@@ -2530,7 +2535,7 @@ let __tla = (async () => {
|
|
|
2530
2535
|
let m = 1 / 0, x = -1 / 0;
|
|
2531
2536
|
const S = d[f];
|
|
2532
2537
|
for (let I = 0; I < t; I++) {
|
|
2533
|
-
const
|
|
2538
|
+
const L = r.getX(I) - g.x, P = r.getY(I) - g.y, b = r.getZ(I) - g.z, z = L * S.x + P * S.y + b * S.z;
|
|
2534
2539
|
z < m && (m = z), z > x && (x = z);
|
|
2535
2540
|
}
|
|
2536
2541
|
M[f] = (x - m) / 2;
|
|
@@ -2542,7 +2547,7 @@ let __tla = (async () => {
|
|
|
2542
2547
|
halfExtents: M
|
|
2543
2548
|
};
|
|
2544
2549
|
}
|
|
2545
|
-
function
|
|
2550
|
+
function No({ pca: e }) {
|
|
2546
2551
|
return i("group", {
|
|
2547
2552
|
children: e.axes.map((r, t) => {
|
|
2548
2553
|
const o = e.center.clone().addScaledVector(r, e.halfExtents[t]), l = e.center.clone().addScaledVector(r, -e.halfExtents[t]);
|
|
@@ -2551,13 +2556,13 @@ let __tla = (async () => {
|
|
|
2551
2556
|
l,
|
|
2552
2557
|
o
|
|
2553
2558
|
],
|
|
2554
|
-
color:
|
|
2559
|
+
color: jo[t],
|
|
2555
2560
|
lineWidth: 2
|
|
2556
2561
|
}, t);
|
|
2557
2562
|
})
|
|
2558
2563
|
});
|
|
2559
2564
|
}
|
|
2560
|
-
function
|
|
2565
|
+
function Yo({ pca: e }) {
|
|
2561
2566
|
const r = j(() => {
|
|
2562
2567
|
const { center: t, axes: o, halfExtents: l } = e, s = [];
|
|
2563
2568
|
for (let a = -1; a <= 1; a += 2) for (let n = -1; n <= 1; n += 2) for (let h = -1; h <= 1; h += 2) s.push(t.clone().addScaledVector(o[0], a * l[0]).addScaledVector(o[1], n * l[1]).addScaledVector(o[2], h * l[2]));
|
|
@@ -2627,7 +2632,7 @@ let __tla = (async () => {
|
|
|
2627
2632
|
}, o))
|
|
2628
2633
|
});
|
|
2629
2634
|
}
|
|
2630
|
-
function
|
|
2635
|
+
function Xo({ redPoint: e, greenPoint: r }) {
|
|
2631
2636
|
const t = j(() => new C().subVectors(r, e).normalize(), [
|
|
2632
2637
|
e,
|
|
2633
2638
|
r
|
|
@@ -2637,7 +2642,7 @@ let __tla = (async () => {
|
|
|
2637
2642
|
}, [
|
|
2638
2643
|
t
|
|
2639
2644
|
]), l = o < 1 ? "#44ff44" : o < 5 ? "#ffcc00" : "#ff4444";
|
|
2640
|
-
return
|
|
2645
|
+
return F("group", {
|
|
2641
2646
|
children: [
|
|
2642
2647
|
i(de, {
|
|
2643
2648
|
points: [
|
|
@@ -2647,7 +2652,7 @@ let __tla = (async () => {
|
|
|
2647
2652
|
color: l,
|
|
2648
2653
|
lineWidth: 3
|
|
2649
2654
|
}),
|
|
2650
|
-
|
|
2655
|
+
F("mesh", {
|
|
2651
2656
|
position: e,
|
|
2652
2657
|
children: [
|
|
2653
2658
|
i("sphereGeometry", {
|
|
@@ -2662,7 +2667,7 @@ let __tla = (async () => {
|
|
|
2662
2667
|
})
|
|
2663
2668
|
]
|
|
2664
2669
|
}),
|
|
2665
|
-
|
|
2670
|
+
F("mesh", {
|
|
2666
2671
|
position: r,
|
|
2667
2672
|
children: [
|
|
2668
2673
|
i("sphereGeometry", {
|
|
@@ -2680,13 +2685,13 @@ let __tla = (async () => {
|
|
|
2680
2685
|
]
|
|
2681
2686
|
});
|
|
2682
2687
|
}
|
|
2683
|
-
function
|
|
2688
|
+
function Go({ geometry: e, redY: r, greenY: t, modelSize: o }) {
|
|
2684
2689
|
const s = o * 0.15, c = j(() => {
|
|
2685
2690
|
const a = [];
|
|
2686
2691
|
let n = t - 10;
|
|
2687
2692
|
const h = new C(0, 1, 0);
|
|
2688
2693
|
for (; n > r; ) {
|
|
2689
|
-
const d = Math.min(n, t), u = Math.max(n, t), p =
|
|
2694
|
+
const d = Math.min(n, t), u = Math.max(n, t), p = wn(e, d, u);
|
|
2690
2695
|
if (p) {
|
|
2691
2696
|
const g = p.dot(h), M = Math.acos(Math.min(1, Math.abs(g))) * 180 / Math.PI;
|
|
2692
2697
|
a.push({
|
|
@@ -2707,7 +2712,7 @@ let __tla = (async () => {
|
|
|
2707
2712
|
return i("group", {
|
|
2708
2713
|
children: c.map((a, n) => {
|
|
2709
2714
|
const h = (a.regionMin + a.regionMax) / 2, d = new C(0, h, 0), u = d.clone().addScaledVector(a.axis, s), p = d.clone().addScaledVector(a.axis, -s), g = n / Math.max(1, c.length - 1), M = a.angleDeg < 0.5 ? `hsl(${120 - g * 120}, 80%, 60%)` : `hsl(${40 - a.angleDeg * 2}, 90%, 55%)`;
|
|
2710
|
-
return
|
|
2715
|
+
return F("group", {
|
|
2711
2716
|
children: [
|
|
2712
2717
|
i(de, {
|
|
2713
2718
|
points: [
|
|
@@ -2734,9 +2739,9 @@ let __tla = (async () => {
|
|
|
2734
2739
|
})
|
|
2735
2740
|
});
|
|
2736
2741
|
}
|
|
2737
|
-
function
|
|
2742
|
+
function Zo({ geometry: e, redY: r, greenY: t, modelSize: o }) {
|
|
2738
2743
|
const l = j(() => {
|
|
2739
|
-
const u =
|
|
2744
|
+
const u = wn(e, r, t);
|
|
2740
2745
|
if (!u) return null;
|
|
2741
2746
|
const p = u.dot(new C(0, 1, 0)), g = Math.acos(Math.min(1, Math.abs(p))) * 180 / Math.PI;
|
|
2742
2747
|
return {
|
|
@@ -2764,7 +2769,7 @@ let __tla = (async () => {
|
|
|
2764
2769
|
})
|
|
2765
2770
|
});
|
|
2766
2771
|
}
|
|
2767
|
-
function
|
|
2772
|
+
function Ko({ pca: e, modelSize: r }) {
|
|
2768
2773
|
const t = e.axes[0], o = r * 0.6, l = e.center.clone().addScaledVector(t, o), s = e.center.clone().addScaledVector(t, -o);
|
|
2769
2774
|
return i(de, {
|
|
2770
2775
|
points: [
|
|
@@ -2778,20 +2783,20 @@ let __tla = (async () => {
|
|
|
2778
2783
|
gapSize: 2
|
|
2779
2784
|
});
|
|
2780
2785
|
}
|
|
2781
|
-
function
|
|
2786
|
+
function Uo({ geometry: e, redY: r, greenY: t, modelSize: o, measurementGeometry: l }) {
|
|
2782
2787
|
const s = j(() => {
|
|
2783
|
-
const d = l ?? e, u =
|
|
2788
|
+
const d = l ?? e, u = yn(d), p = new C(0, 1, 0), g = 5, f = t + 3 * 25.4, m = [];
|
|
2784
2789
|
for (let y = r + g; y < f; y += g) {
|
|
2785
|
-
const D =
|
|
2790
|
+
const D = ho(u, d, new C(0, y, 0), p);
|
|
2786
2791
|
D > 0 && m.push({
|
|
2787
2792
|
y,
|
|
2788
2793
|
circ: D
|
|
2789
2794
|
});
|
|
2790
2795
|
}
|
|
2791
2796
|
if (m.length < 5) return null;
|
|
2792
|
-
const x = t - r, S = r + x * 0.3, I = r + x * 0.7,
|
|
2793
|
-
if (
|
|
2794
|
-
const P =
|
|
2797
|
+
const x = t - r, S = r + x * 0.3, I = r + x * 0.7, L = m.filter((y) => y.y >= S && y.y <= I);
|
|
2798
|
+
if (L.length < 3) return null;
|
|
2799
|
+
const P = L.map((y) => y.circ).sort((y, D) => y - D), b = P[Math.floor(P.length / 2)], z = Math.max(...m.map((y) => y.circ));
|
|
2795
2800
|
return {
|
|
2796
2801
|
circumferences: m,
|
|
2797
2802
|
baseline: b,
|
|
@@ -2804,7 +2809,7 @@ let __tla = (async () => {
|
|
|
2804
2809
|
]);
|
|
2805
2810
|
if (!s) return null;
|
|
2806
2811
|
const { circumferences: c, baseline: a, maxCirc: n } = s, h = o * 0.3 / n;
|
|
2807
|
-
return
|
|
2812
|
+
return F("group", {
|
|
2808
2813
|
children: [
|
|
2809
2814
|
c.map(({ y: d, circ: u }, p) => {
|
|
2810
2815
|
const g = u / a, M = g > 1.6 ? "#ff4444" : g > 1.3 ? "#ffcc00" : "#22cc66", f = u * h;
|
|
@@ -2821,7 +2826,7 @@ let __tla = (async () => {
|
|
|
2821
2826
|
}),
|
|
2822
2827
|
(() => {
|
|
2823
2828
|
const d = a * 1.6 * h, u = c[0].y, p = c[c.length - 1].y;
|
|
2824
|
-
return
|
|
2829
|
+
return F(Oe, {
|
|
2825
2830
|
children: [
|
|
2826
2831
|
i(de, {
|
|
2827
2832
|
points: [
|
|
@@ -2855,13 +2860,13 @@ let __tla = (async () => {
|
|
|
2855
2860
|
]
|
|
2856
2861
|
});
|
|
2857
2862
|
}
|
|
2858
|
-
function
|
|
2863
|
+
function Jo({ componentDebug: e }) {
|
|
2859
2864
|
return i("group", {
|
|
2860
2865
|
children: e.geometries.map((r, t) => {
|
|
2861
2866
|
const o = e.colors[t] ?? "#888888", l = t === e.innerIdx;
|
|
2862
2867
|
r.computeBoundingBox();
|
|
2863
2868
|
const s = new C();
|
|
2864
|
-
return r.boundingBox.getCenter(s),
|
|
2869
|
+
return r.boundingBox.getCenter(s), F("group", {
|
|
2865
2870
|
children: [
|
|
2866
2871
|
i("mesh", {
|
|
2867
2872
|
geometry: r,
|
|
@@ -2889,7 +2894,7 @@ let __tla = (async () => {
|
|
|
2889
2894
|
}),
|
|
2890
2895
|
i("group", {
|
|
2891
2896
|
position: s,
|
|
2892
|
-
children: i(
|
|
2897
|
+
children: i(Xe, {
|
|
2893
2898
|
center: true,
|
|
2894
2899
|
style: {
|
|
2895
2900
|
pointerEvents: "none"
|
|
@@ -2919,7 +2924,7 @@ let __tla = (async () => {
|
|
|
2919
2924
|
})
|
|
2920
2925
|
});
|
|
2921
2926
|
}
|
|
2922
|
-
function
|
|
2927
|
+
function Qo({ geometry: e, aoData: r }) {
|
|
2923
2928
|
const t = j(() => {
|
|
2924
2929
|
const o = e.toNonIndexed(), l = o.getAttribute("position"), s = r.length, c = l.count, a = new Float32Array(c * 3);
|
|
2925
2930
|
for (let n = 0; n < s && n * 3 + 2 < c; n++) {
|
|
@@ -2948,8 +2953,8 @@ let __tla = (async () => {
|
|
|
2948
2953
|
})
|
|
2949
2954
|
});
|
|
2950
2955
|
}
|
|
2951
|
-
function
|
|
2952
|
-
const a = e.geometry, n = j(() => a.getAttribute("position") ?
|
|
2956
|
+
function qo({ mesh: e, layers: r, landmarkPoints: t, componentDebug: o, aoData: l, aoGeometry: s, measurementGeometry: c }) {
|
|
2957
|
+
const a = e.geometry, n = j(() => a.getAttribute("position") ? Sn(a) : null, [
|
|
2953
2958
|
a
|
|
2954
2959
|
]), h = j(() => !t || t.length < 2 ? null : {
|
|
2955
2960
|
red: new C(t[1].position.x, t[1].position.y, t[1].position.z),
|
|
@@ -2957,26 +2962,26 @@ let __tla = (async () => {
|
|
|
2957
2962
|
}, [
|
|
2958
2963
|
t
|
|
2959
2964
|
]);
|
|
2960
|
-
return
|
|
2965
|
+
return F("group", {
|
|
2961
2966
|
children: [
|
|
2962
|
-
r.pcaAxes && n && i(
|
|
2967
|
+
r.pcaAxes && n && i(No, {
|
|
2963
2968
|
pca: n
|
|
2964
2969
|
}),
|
|
2965
|
-
r.obb && n && i(
|
|
2970
|
+
r.obb && n && i(Yo, {
|
|
2966
2971
|
pca: n
|
|
2967
2972
|
}),
|
|
2968
|
-
r.obbAxis && n && i(
|
|
2973
|
+
r.obbAxis && n && i(Ko, {
|
|
2969
2974
|
pca: n,
|
|
2970
2975
|
modelSize: n.halfExtents[0] ? Math.max(...n.halfExtents) * 2 : 100
|
|
2971
2976
|
}),
|
|
2972
|
-
r.shellComponents && o && i(
|
|
2977
|
+
r.shellComponents && o && i(Jo, {
|
|
2973
2978
|
componentDebug: o
|
|
2974
2979
|
}),
|
|
2975
|
-
r.ambientOcclusion && l && l.length > 0 && i(
|
|
2980
|
+
r.ambientOcclusion && l && l.length > 0 && i(Qo, {
|
|
2976
2981
|
geometry: s ?? a,
|
|
2977
2982
|
aoData: l
|
|
2978
2983
|
}),
|
|
2979
|
-
r.circumferenceScan && h && i(
|
|
2984
|
+
r.circumferenceScan && h && i(Uo, {
|
|
2980
2985
|
geometry: a,
|
|
2981
2986
|
redY: h.red.y,
|
|
2982
2987
|
greenY: h.green.y,
|
|
@@ -2994,17 +2999,17 @@ let __tla = (async () => {
|
|
|
2994
2999
|
depthWrite: false
|
|
2995
3000
|
})
|
|
2996
3001
|
}),
|
|
2997
|
-
r.landmarkAxis && h && i(
|
|
3002
|
+
r.landmarkAxis && h && i(Xo, {
|
|
2998
3003
|
redPoint: h.red,
|
|
2999
3004
|
greenPoint: h.green
|
|
3000
3005
|
}),
|
|
3001
|
-
r.iterativePCA && h && i(
|
|
3006
|
+
r.iterativePCA && h && i(Go, {
|
|
3002
3007
|
geometry: a,
|
|
3003
3008
|
redY: h.red.y,
|
|
3004
3009
|
greenY: h.green.y,
|
|
3005
3010
|
modelSize: (n == null ? void 0 : n.halfExtents[0]) ? Math.max(...n.halfExtents) * 2 : 100
|
|
3006
3011
|
}),
|
|
3007
|
-
r.fullRegionPCA && h && i(
|
|
3012
|
+
r.fullRegionPCA && h && i(Zo, {
|
|
3008
3013
|
geometry: a,
|
|
3009
3014
|
redY: h.red.y,
|
|
3010
3015
|
greenY: h.green.y,
|
|
@@ -3013,10 +3018,10 @@ let __tla = (async () => {
|
|
|
3013
3018
|
]
|
|
3014
3019
|
});
|
|
3015
3020
|
}
|
|
3016
|
-
function
|
|
3021
|
+
function er({ mesh: e }) {
|
|
3017
3022
|
const r = e.geometry, t = j(() => {
|
|
3018
3023
|
if (!r.getAttribute("position")) return null;
|
|
3019
|
-
const s =
|
|
3024
|
+
const s = Sn(r), c = s.axes[0], a = s.halfExtents[0] * 1.3;
|
|
3020
3025
|
return {
|
|
3021
3026
|
axis: c,
|
|
3022
3027
|
center: s.center,
|
|
@@ -3043,7 +3048,7 @@ let __tla = (async () => {
|
|
|
3043
3048
|
renderOrder: 999
|
|
3044
3049
|
});
|
|
3045
3050
|
}
|
|
3046
|
-
const
|
|
3051
|
+
const vn = [
|
|
3047
3052
|
{
|
|
3048
3053
|
key: "pcaAxes",
|
|
3049
3054
|
label: "PCA Axes (full mesh)",
|
|
@@ -3099,11 +3104,11 @@ let __tla = (async () => {
|
|
|
3099
3104
|
color: "#00ffff",
|
|
3100
3105
|
group: "Alignment"
|
|
3101
3106
|
}
|
|
3102
|
-
],
|
|
3103
|
-
...new Set(
|
|
3107
|
+
], tr = [
|
|
3108
|
+
...new Set(vn.map((e) => e.group))
|
|
3104
3109
|
];
|
|
3105
|
-
function
|
|
3106
|
-
return
|
|
3110
|
+
function nr({ layers: e, onToggleLayer: r, isDoubleShell: t }) {
|
|
3111
|
+
return F("div", {
|
|
3107
3112
|
style: {
|
|
3108
3113
|
position: "absolute",
|
|
3109
3114
|
top: 16,
|
|
@@ -3131,9 +3136,9 @@ let __tla = (async () => {
|
|
|
3131
3136
|
},
|
|
3132
3137
|
children: "Debug Layers"
|
|
3133
3138
|
}),
|
|
3134
|
-
|
|
3135
|
-
const l =
|
|
3136
|
-
return l.length === 0 ? null :
|
|
3139
|
+
tr.map((o) => {
|
|
3140
|
+
const l = vn.filter((s) => s.group === o && !(s.hideWhenDoubleShell && t));
|
|
3141
|
+
return l.length === 0 ? null : F("div", {
|
|
3137
3142
|
children: [
|
|
3138
3143
|
i("div", {
|
|
3139
3144
|
style: {
|
|
@@ -3147,7 +3152,7 @@ let __tla = (async () => {
|
|
|
3147
3152
|
},
|
|
3148
3153
|
children: o
|
|
3149
3154
|
}),
|
|
3150
|
-
l.map(({ key: s, label: c, color: a }) =>
|
|
3155
|
+
l.map(({ key: s, label: c, color: a }) => F("label", {
|
|
3151
3156
|
style: {
|
|
3152
3157
|
display: "flex",
|
|
3153
3158
|
alignItems: "center",
|
|
@@ -3192,45 +3197,45 @@ let __tla = (async () => {
|
|
|
3192
3197
|
]
|
|
3193
3198
|
});
|
|
3194
3199
|
}
|
|
3195
|
-
const
|
|
3196
|
-
const [n, h] = E(null), [d, u] = E(0), [p, g] = E(false), [M, f] = E(false), [m, x] = E(""), [S, I] = E("3D"), [
|
|
3197
|
-
if (
|
|
3198
|
-
const v = (await import("./html2canvas.esm-Dmi1NfiH.js")).default, _ =
|
|
3200
|
+
const or = ({ config: e, spacingType: r, scanUrl: t, formMeasurements: o, onComplete: l, isDebugUser: s = false, onAnalyticsEvent: c, wasmModule: a }) => {
|
|
3201
|
+
const [n, h] = E(null), [d, u] = E(0), [p, g] = E(false), [M, f] = E(false), [m, x] = E(""), [S, I] = E("3D"), [L, P] = E(r === "AK" ? 2 : 1), [b, z] = E(false), [y, D] = E(null), [w, A] = E(r ?? null), [k, B] = E("mm"), [$, N] = E(false), [U, be] = E(""), [ae, fe] = E(false), [ie, J] = E(false), [Y, pe] = E(false), [Z, he] = E(false), [me, ue] = E(null), [H, q] = E(null), [xe, Ce] = E(null), [we, oe] = E(false), [V, X] = E([]), [Le, Pe] = E(null), [Ge, se] = E(null), [ze, Dt] = E(null), [ht, Mn] = E(null), [zn, Bt] = E(false), [Rt, An] = E(null), [gt, _e] = E(null), [Re, kn] = E(false), [Wt, Fn] = E(Vo), [$e, Et] = E("obj"), [Ae, mt] = E(o), [tt, Tt] = E(true), [Ot, xt] = E(false), [$t, Ln] = E(false), [Ie, Ht] = E(false), [yt, Pn] = E(null), [Vt] = E("#c8c8c8"), [In] = E(1), [Ze, _n] = E(false), [bt, jt] = E([]), nt = le(null), He = le(null), wt = le(false), Dn = le(null), St = le(null), vt = le(null), Ue = re(async () => {
|
|
3202
|
+
if (vt.current) try {
|
|
3203
|
+
const v = (await import("./html2canvas.esm-Dmi1NfiH.js")).default, _ = vt.current, W = 2, R = async (K = false) => {
|
|
3199
3204
|
const te = await v(_, {
|
|
3200
3205
|
backgroundColor: null,
|
|
3201
3206
|
useCORS: true,
|
|
3202
3207
|
scale: W,
|
|
3203
|
-
ignoreElements: (
|
|
3208
|
+
ignoreElements: (it) => {
|
|
3204
3209
|
var _a;
|
|
3205
|
-
return ((_a =
|
|
3210
|
+
return ((_a = it.style) == null ? void 0 : _a.zIndex) === "10";
|
|
3206
3211
|
}
|
|
3207
|
-
}), Q = _.getBoundingClientRect(), ke = Q.width,
|
|
3208
|
-
let ve, Me, ye,
|
|
3212
|
+
}), Q = _.getBoundingClientRect(), ke = Q.width, We = Q.height;
|
|
3213
|
+
let ve, Me, ye, Te;
|
|
3209
3214
|
if (K) {
|
|
3210
|
-
const
|
|
3211
|
-
let
|
|
3212
|
-
for (let
|
|
3213
|
-
const
|
|
3214
|
-
|
|
3215
|
+
const De = te.getContext("2d").getImageData(0, 0, te.width, te.height).data;
|
|
3216
|
+
let Be = te.width, Ee = te.height, et = 0, st = 0;
|
|
3217
|
+
for (let Ve = 0; Ve < te.height; Ve++) for (let je = 0; je < te.width; je++) {
|
|
3218
|
+
const Gn = (Ve * te.width + je) * 4;
|
|
3219
|
+
De[Gn + 3] > 20 && (je < Be && (Be = je), je > et && (et = je), Ve < Ee && (Ee = Ve), Ve > st && (st = Ve));
|
|
3215
3220
|
}
|
|
3216
|
-
|
|
3221
|
+
et <= Be && (Be = 0, Ee = 0, et = te.width, st = te.height), ve = Be / W, Me = Ee / W, ye = et / W, Te = st / W;
|
|
3217
3222
|
} else {
|
|
3218
|
-
const
|
|
3219
|
-
ve = 1 / 0, Me = 1 / 0, ye = -1 / 0,
|
|
3220
|
-
const
|
|
3221
|
-
if (
|
|
3222
|
-
const
|
|
3223
|
-
|
|
3224
|
-
}), ve === 1 / 0 && (ve = 0, Me = 0, ye = ke,
|
|
3223
|
+
const it = _.querySelectorAll("[style*='pointer-events: none']");
|
|
3224
|
+
ve = 1 / 0, Me = 1 / 0, ye = -1 / 0, Te = -1 / 0, it.forEach((Ft) => {
|
|
3225
|
+
const De = Ft.getBoundingClientRect();
|
|
3226
|
+
if (De.width === 0 || De.height === 0) return;
|
|
3227
|
+
const Be = De.left - Q.left, Ee = De.top - Q.top;
|
|
3228
|
+
Be < ve && (ve = Be), Ee < Me && (Me = Ee), Be + De.width > ye && (ye = Be + De.width), Ee + De.height > Te && (Te = Ee + De.height);
|
|
3229
|
+
}), ve === 1 / 0 && (ve = 0, Me = 0, ye = ke, Te = We);
|
|
3225
3230
|
}
|
|
3226
|
-
const
|
|
3227
|
-
ve = Math.max(0, ve -
|
|
3228
|
-
const
|
|
3229
|
-
return
|
|
3231
|
+
const Qt = Math.max(ke, We) * 0.03, qt = Math.max(ke, We) * 0.06;
|
|
3232
|
+
ve = Math.max(0, ve - Qt), Me = Math.max(0, Me - qt), ye = Math.min(ke, ye + Qt), Te = Math.min(We, Te + qt);
|
|
3233
|
+
const At = (ye - ve) * W, kt = (Te - Me) * W, Yn = Math.max(0, ve * W), Xn = Math.max(0, Me * W), rt = document.createElement("canvas");
|
|
3234
|
+
return rt.width = Math.round(At), rt.height = Math.round(kt), rt.getContext("2d").drawImage(te, Math.round(Yn), Math.round(Xn), Math.round(At), Math.round(kt), 0, 0, Math.round(At), Math.round(kt)), rt.toDataURL("image/png");
|
|
3230
3235
|
};
|
|
3231
|
-
|
|
3236
|
+
St.current && St.current(), await new Promise((K) => setTimeout(K, 100)), await new Promise((K) => requestAnimationFrame(() => requestAnimationFrame(K)));
|
|
3232
3237
|
const ge = await R();
|
|
3233
|
-
I("2D"), await new Promise((K) => setTimeout(K,
|
|
3238
|
+
I("2D"), await new Promise((K) => setTimeout(K, 200)), await new Promise((K) => requestAnimationFrame(() => requestAnimationFrame(K)));
|
|
3234
3239
|
const G = await R(true);
|
|
3235
3240
|
return I("3D"), {
|
|
3236
3241
|
frontal_view_png: ge,
|
|
@@ -3239,14 +3244,20 @@ let __tla = (async () => {
|
|
|
3239
3244
|
} catch {
|
|
3240
3245
|
return;
|
|
3241
3246
|
}
|
|
3242
|
-
}, []), Se =
|
|
3247
|
+
}, []), Se = re((v) => {
|
|
3243
3248
|
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")}`;
|
|
3244
|
-
|
|
3249
|
+
jt((R) => [
|
|
3245
3250
|
...R.slice(-200),
|
|
3246
3251
|
`[${W}] ${v}`
|
|
3247
3252
|
]);
|
|
3248
|
-
}, []), { landmarkPoints: T, clearLandmarkPoints:
|
|
3249
|
-
|
|
3253
|
+
}, []), { landmarkPoints: T, clearLandmarkPoints: Bn, addLandmarkPoint: Nt, removeLandmarkPoint: Yt, updateLandmarkPositions: Xt, setAligned: Gt, isAligned: ee, setCut: Zt, isCut: Ct, reset: Kt } = _t();
|
|
3254
|
+
ne(() => {
|
|
3255
|
+
Kt();
|
|
3256
|
+
}, [
|
|
3257
|
+
Kt
|
|
3258
|
+
]);
|
|
3259
|
+
const ot = L * ct;
|
|
3260
|
+
ne(() => {
|
|
3250
3261
|
if (!s || T.length === 0) return;
|
|
3251
3262
|
const v = T[T.length - 1];
|
|
3252
3263
|
Se(`LANDMARK[${T.length - 1}]: placed at (${v.position.x.toFixed(1)}, ${v.position.y.toFixed(1)}, ${v.position.z.toFixed(1)}) face=${v.faceIndex}`);
|
|
@@ -3254,44 +3265,44 @@ let __tla = (async () => {
|
|
|
3254
3265
|
T.length,
|
|
3255
3266
|
s,
|
|
3256
3267
|
Se
|
|
3257
|
-
]),
|
|
3268
|
+
]), ne(() => {
|
|
3258
3269
|
s && ee && Se("STATE: mesh aligned");
|
|
3259
3270
|
}, [
|
|
3260
3271
|
ee,
|
|
3261
3272
|
s,
|
|
3262
3273
|
Se
|
|
3263
|
-
]),
|
|
3264
|
-
s &&
|
|
3274
|
+
]), ne(() => {
|
|
3275
|
+
s && Ct && Se("STATE: mesh cut");
|
|
3265
3276
|
}, [
|
|
3266
|
-
|
|
3277
|
+
Ct,
|
|
3267
3278
|
s,
|
|
3268
3279
|
Se
|
|
3269
|
-
]),
|
|
3270
|
-
|
|
3280
|
+
]), ne(() => {
|
|
3281
|
+
nt.current && (nt.current.scrollTop = nt.current.scrollHeight);
|
|
3271
3282
|
}, [
|
|
3272
|
-
|
|
3283
|
+
bt
|
|
3273
3284
|
]);
|
|
3274
|
-
const
|
|
3285
|
+
const Ut = j(() => xe ? new O.Mesh(xe) : null, [
|
|
3275
3286
|
xe
|
|
3276
3287
|
]);
|
|
3277
|
-
|
|
3278
|
-
o &&
|
|
3288
|
+
ne(() => {
|
|
3289
|
+
o && mt(o);
|
|
3279
3290
|
}, [
|
|
3280
3291
|
o
|
|
3281
|
-
]),
|
|
3282
|
-
o ||
|
|
3292
|
+
]), ne(() => {
|
|
3293
|
+
o || mt(void 0);
|
|
3283
3294
|
}, [
|
|
3284
|
-
|
|
3295
|
+
L
|
|
3285
3296
|
]);
|
|
3286
|
-
const
|
|
3287
|
-
|
|
3288
|
-
if (!ee || V.length === 0 ||
|
|
3289
|
-
|
|
3297
|
+
const Mt = le(false);
|
|
3298
|
+
ne(() => {
|
|
3299
|
+
if (!ee || V.length === 0 || Mt.current || !c) return;
|
|
3300
|
+
Mt.current = true;
|
|
3290
3301
|
const v = T.length >= 3 ? Math.abs(T[2].position.y - T[0].position.y) : null;
|
|
3291
3302
|
c("dimensions_calculated", {
|
|
3292
3303
|
spacing_type: w,
|
|
3293
3304
|
source_unit: "mm",
|
|
3294
|
-
file_format:
|
|
3305
|
+
file_format: $e,
|
|
3295
3306
|
measurement_source: "scan_derived",
|
|
3296
3307
|
is_double_wall: Y,
|
|
3297
3308
|
is_unit_converted: false,
|
|
@@ -3306,12 +3317,12 @@ let __tla = (async () => {
|
|
|
3306
3317
|
}, [
|
|
3307
3318
|
ee,
|
|
3308
3319
|
V
|
|
3309
|
-
]),
|
|
3310
|
-
a !== void 0 && (
|
|
3320
|
+
]), ne(() => {
|
|
3321
|
+
a !== void 0 && (He.current = a), _n(true);
|
|
3311
3322
|
}, [
|
|
3312
3323
|
a
|
|
3313
3324
|
]);
|
|
3314
|
-
const
|
|
3325
|
+
const Je = re((v, _) => {
|
|
3315
3326
|
v.computeBoundingBox();
|
|
3316
3327
|
const W = v.boundingBox, R = new C();
|
|
3317
3328
|
W.getCenter(R), v.translate(-R.x, -R.y, -R.z), v.computeBoundingBox();
|
|
@@ -3321,15 +3332,15 @@ let __tla = (async () => {
|
|
|
3321
3332
|
color: 8947848,
|
|
3322
3333
|
side: O.DoubleSide
|
|
3323
3334
|
}));
|
|
3324
|
-
h(K), fe(_), J(true), he(false),
|
|
3325
|
-
}, []),
|
|
3326
|
-
|
|
3335
|
+
h(K), fe(_), J(true), he(false), wt.current = false;
|
|
3336
|
+
}, []), Qe = re(async (v, _) => {
|
|
3337
|
+
_e(null);
|
|
3327
3338
|
const W = _.toLowerCase(), R = W.endsWith(".stl");
|
|
3328
3339
|
if (!W.endsWith(".obj") && !R) {
|
|
3329
|
-
|
|
3340
|
+
_e("Unsupported file format. Please use OBJ or STL.");
|
|
3330
3341
|
return;
|
|
3331
3342
|
}
|
|
3332
|
-
|
|
3343
|
+
Et(R ? "stl" : "obj"), f(true), x("Processing file..."), Se(`FILE_LOAD: ${_} (${R ? "STL" : "OBJ"})`);
|
|
3333
3344
|
try {
|
|
3334
3345
|
let G;
|
|
3335
3346
|
if (R) if (x("Converting STL..."), v instanceof ArrayBuffer) {
|
|
@@ -3338,41 +3349,41 @@ let __tla = (async () => {
|
|
|
3338
3349
|
]), ke = new File([
|
|
3339
3350
|
Q
|
|
3340
3351
|
], _);
|
|
3341
|
-
G = await
|
|
3352
|
+
G = await Lt(ke);
|
|
3342
3353
|
} else {
|
|
3343
3354
|
const Q = new Blob([
|
|
3344
3355
|
v
|
|
3345
3356
|
]), ke = new File([
|
|
3346
3357
|
Q
|
|
3347
3358
|
], _);
|
|
3348
|
-
G = await
|
|
3359
|
+
G = await Lt(ke);
|
|
3349
3360
|
}
|
|
3350
3361
|
else G = typeof v == "string" ? v : new TextDecoder().decode(v);
|
|
3351
|
-
const K = performance.now(), te =
|
|
3362
|
+
const K = performance.now(), te = He.current ? await co(G, He.current, (Q) => {
|
|
3352
3363
|
x(Q), Se(`PREPROCESS: ${Q}`);
|
|
3353
3364
|
}) : null;
|
|
3354
|
-
if (te) Se(`PREPROCESS: done in ${(performance.now() - K).toFixed(0)}ms \u2014 unit=${te.detectedUnit}, scaled=${te.wasScaled}`), e.showAmputationModal && !r ? (D(te), z(true)) :
|
|
3365
|
+
if (te) Se(`PREPROCESS: done in ${(performance.now() - K).toFixed(0)}ms \u2014 unit=${te.detectedUnit}, scaled=${te.wasScaled}`), e.showAmputationModal && !r ? (D(te), z(true)) : Je(te.geometry, te.wasScaled);
|
|
3355
3366
|
else {
|
|
3356
3367
|
x("Using fallback loader...");
|
|
3357
|
-
const Q =
|
|
3368
|
+
const Q = fo(G);
|
|
3358
3369
|
Q ? e.showAmputationModal && !r ? (D({
|
|
3359
3370
|
geometry: Q,
|
|
3360
3371
|
wasScaled: false
|
|
3361
|
-
}), z(true)) :
|
|
3372
|
+
}), z(true)) : Je(Q, false) : _e("Failed to parse the mesh.");
|
|
3362
3373
|
}
|
|
3363
3374
|
} catch (G) {
|
|
3364
|
-
|
|
3375
|
+
_e(G instanceof Error ? G.message : "Failed to process the mesh file.");
|
|
3365
3376
|
} finally {
|
|
3366
3377
|
f(false), x("");
|
|
3367
3378
|
}
|
|
3368
3379
|
}, [
|
|
3369
|
-
|
|
3380
|
+
Ze,
|
|
3370
3381
|
e.showAmputationModal,
|
|
3371
3382
|
r,
|
|
3372
|
-
|
|
3383
|
+
Je
|
|
3373
3384
|
]);
|
|
3374
|
-
|
|
3375
|
-
if (!t || !
|
|
3385
|
+
ne(() => {
|
|
3386
|
+
if (!t || !Ze) return;
|
|
3376
3387
|
(async () => {
|
|
3377
3388
|
f(true), x("Loading scan...");
|
|
3378
3389
|
try {
|
|
@@ -3381,77 +3392,77 @@ let __tla = (async () => {
|
|
|
3381
3392
|
const R = new URL(t).pathname.split("/").pop() || "scan.obj";
|
|
3382
3393
|
if (R.toLowerCase().endsWith(".stl")) {
|
|
3383
3394
|
const G = await _.arrayBuffer();
|
|
3384
|
-
await
|
|
3395
|
+
await Qe(G, R);
|
|
3385
3396
|
} else {
|
|
3386
3397
|
const G = await _.text();
|
|
3387
|
-
await
|
|
3398
|
+
await Qe(G, R);
|
|
3388
3399
|
}
|
|
3389
3400
|
} catch (_) {
|
|
3390
|
-
|
|
3401
|
+
_e(_ instanceof Error ? _.message : "Failed to load scan from URL."), f(false), x("");
|
|
3391
3402
|
}
|
|
3392
3403
|
})();
|
|
3393
3404
|
}, [
|
|
3394
3405
|
t,
|
|
3395
|
-
|
|
3406
|
+
Ze
|
|
3396
3407
|
]);
|
|
3397
|
-
const
|
|
3408
|
+
const Rn = re((v) => {
|
|
3398
3409
|
v.preventDefault(), g(true);
|
|
3399
|
-
}, []),
|
|
3410
|
+
}, []), Wn = re((v) => {
|
|
3400
3411
|
v.preventDefault(), g(false);
|
|
3401
|
-
}, []),
|
|
3402
|
-
if (v.preventDefault(), g(false), !
|
|
3403
|
-
|
|
3412
|
+
}, []), En = re(async (v) => {
|
|
3413
|
+
if (v.preventDefault(), g(false), !Ze) {
|
|
3414
|
+
_e("WASM module is still loading. Please wait.");
|
|
3404
3415
|
return;
|
|
3405
3416
|
}
|
|
3406
3417
|
const _ = v.dataTransfer.files[0];
|
|
3407
3418
|
if (!_) return;
|
|
3408
3419
|
const W = _.name.toLowerCase();
|
|
3409
3420
|
if (!W.endsWith(".obj") && !W.endsWith(".stl")) {
|
|
3410
|
-
|
|
3421
|
+
_e("Please drop an OBJ or STL file.");
|
|
3411
3422
|
return;
|
|
3412
3423
|
}
|
|
3413
3424
|
if (W.endsWith(".stl")) {
|
|
3414
|
-
|
|
3425
|
+
Et("stl"), f(true), x("Converting STL...");
|
|
3415
3426
|
try {
|
|
3416
|
-
const R = await
|
|
3417
|
-
await
|
|
3427
|
+
const R = await Lt(_);
|
|
3428
|
+
await Qe(R, _.name.replace(/\.stl$/i, ".obj"));
|
|
3418
3429
|
} catch (R) {
|
|
3419
|
-
|
|
3430
|
+
_e(R instanceof Error ? R.message : "Failed to process STL file."), f(false), x("");
|
|
3420
3431
|
}
|
|
3421
3432
|
} else {
|
|
3422
3433
|
const R = await _.text();
|
|
3423
|
-
await
|
|
3434
|
+
await Qe(R, _.name);
|
|
3424
3435
|
}
|
|
3425
3436
|
}, [
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
]),
|
|
3429
|
-
A(v), P(v === "AK" ? 2 : 1), z(false), y && (
|
|
3437
|
+
Ze,
|
|
3438
|
+
Qe
|
|
3439
|
+
]), Tn = re((v) => {
|
|
3440
|
+
A(v), P(v === "AK" ? 2 : 1), z(false), y && (Je(y.geometry, y.wasScaled), D(null)), c == null ? void 0 : c("file_loaded", {
|
|
3430
3441
|
spacing_type: v,
|
|
3431
|
-
file_format:
|
|
3442
|
+
file_format: $e,
|
|
3432
3443
|
is_double_wall: false
|
|
3433
3444
|
});
|
|
3434
3445
|
}, [
|
|
3435
3446
|
y,
|
|
3436
|
-
|
|
3447
|
+
Je,
|
|
3437
3448
|
c,
|
|
3438
|
-
|
|
3449
|
+
$e
|
|
3439
3450
|
]);
|
|
3440
|
-
|
|
3441
|
-
if (!n || T.length !== 1 ||
|
|
3442
|
-
|
|
3443
|
-
const v = T[0], _ =
|
|
3451
|
+
ne(() => {
|
|
3452
|
+
if (!n || T.length !== 1 || !He.current || wt.current) return;
|
|
3453
|
+
wt.current = true;
|
|
3454
|
+
const v = T[0], _ = He.current, W = n.geometry, { positions: R, indices: ge } = dt(W), G = new Float32Array([
|
|
3444
3455
|
v.position.x,
|
|
3445
3456
|
v.position.y,
|
|
3446
3457
|
v.position.z
|
|
3447
3458
|
]), K = _.detect_shell(R, ge, G, 40), te = K.details(), Q = K.is_double_shell();
|
|
3448
|
-
Se(`SHELL_DETECT: ${Q ? "DOUBLE" : "SINGLE"} \u2014 ${te}`), Q && (pe(true),
|
|
3459
|
+
Se(`SHELL_DETECT: ${Q ? "DOUBLE" : "SINGLE"} \u2014 ${te}`), Q && (pe(true), oe(true), Se(`SHELL_DETECT: double shell, thickness=${K.thickness().toFixed(1)}mm`));
|
|
3449
3460
|
}, [
|
|
3450
3461
|
n,
|
|
3451
3462
|
T,
|
|
3452
3463
|
Se
|
|
3453
3464
|
]);
|
|
3454
|
-
const
|
|
3465
|
+
const On = re(() => {
|
|
3455
3466
|
if (!n || T.length < 2) return;
|
|
3456
3467
|
N(true), be("Please wait..."), Se("PIPELINE: starting processing pipeline...");
|
|
3457
3468
|
const v = performance.now();
|
|
@@ -3461,29 +3472,29 @@ let __tla = (async () => {
|
|
|
3461
3472
|
T[0],
|
|
3462
3473
|
...T.slice(2)
|
|
3463
3474
|
];
|
|
3464
|
-
|
|
3475
|
+
mo(n, _, ct, {
|
|
3465
3476
|
onStatus: (W) => {
|
|
3466
3477
|
be(W), Se(`PIPELINE: ${W}`);
|
|
3467
3478
|
},
|
|
3468
|
-
addLandmarkPoint:
|
|
3469
|
-
removeLandmarkPoint:
|
|
3479
|
+
addLandmarkPoint: Nt,
|
|
3480
|
+
removeLandmarkPoint: Yt,
|
|
3470
3481
|
updateLandmarkPositions: (W) => {
|
|
3471
3482
|
const R = [
|
|
3472
3483
|
W[1],
|
|
3473
3484
|
W[0],
|
|
3474
3485
|
...W.slice(2)
|
|
3475
3486
|
];
|
|
3476
|
-
|
|
3487
|
+
Xt(R);
|
|
3477
3488
|
},
|
|
3478
|
-
setAligned:
|
|
3479
|
-
setCut:
|
|
3489
|
+
setAligned: Gt,
|
|
3490
|
+
setCut: Zt,
|
|
3480
3491
|
setModelSize: u,
|
|
3481
|
-
setOriginalEndY:
|
|
3492
|
+
setOriginalEndY: Mn,
|
|
3482
3493
|
setAdjustedStartY: se,
|
|
3483
|
-
setAdjustedEndY:
|
|
3484
|
-
setError:
|
|
3494
|
+
setAdjustedEndY: Dt,
|
|
3495
|
+
setError: _e,
|
|
3485
3496
|
setDoubleShell: (W) => {
|
|
3486
|
-
pe(W),
|
|
3497
|
+
pe(W), oe(true);
|
|
3487
3498
|
},
|
|
3488
3499
|
setAoData: (W, R) => {
|
|
3489
3500
|
ue(W), q(R ?? null);
|
|
@@ -3491,26 +3502,26 @@ let __tla = (async () => {
|
|
|
3491
3502
|
setInnerShellExtracted: he,
|
|
3492
3503
|
setMeasurementGeometry: Ce,
|
|
3493
3504
|
setWasmSlices: Pe,
|
|
3494
|
-
wasmModule:
|
|
3495
|
-
}), Se(`PIPELINE: completed in ${(performance.now() - v).toFixed(0)}ms`),
|
|
3505
|
+
wasmModule: He.current ?? void 0
|
|
3506
|
+
}), Se(`PIPELINE: completed in ${(performance.now() - v).toFixed(0)}ms`), Mt.current = false, N(false);
|
|
3496
3507
|
}, 50);
|
|
3497
3508
|
}, [
|
|
3498
3509
|
n,
|
|
3499
3510
|
T,
|
|
3511
|
+
Xt,
|
|
3512
|
+
Gt,
|
|
3500
3513
|
Nt,
|
|
3501
3514
|
Yt,
|
|
3502
|
-
|
|
3503
|
-
jt,
|
|
3504
|
-
Xt,
|
|
3515
|
+
Zt,
|
|
3505
3516
|
Z
|
|
3506
|
-
]),
|
|
3507
|
-
|
|
3508
|
-
ee && V.length > 0 && !
|
|
3517
|
+
]), Jt = le(false);
|
|
3518
|
+
ne(() => {
|
|
3519
|
+
ee && V.length > 0 && !Jt.current && (Jt.current = true, xt(true));
|
|
3509
3520
|
}, [
|
|
3510
3521
|
ee,
|
|
3511
3522
|
V.length
|
|
3512
3523
|
]);
|
|
3513
|
-
const
|
|
3524
|
+
const qe = j(() => {
|
|
3514
3525
|
var _a;
|
|
3515
3526
|
if (!n || T.length < 3) return 0;
|
|
3516
3527
|
if (Y) return Math.abs(T[0].position.y - T[2].position.y);
|
|
@@ -3522,22 +3533,22 @@ let __tla = (async () => {
|
|
|
3522
3533
|
n,
|
|
3523
3534
|
T,
|
|
3524
3535
|
Y
|
|
3525
|
-
]),
|
|
3526
|
-
|
|
3527
|
-
}, []),
|
|
3536
|
+
]), $n = re((v) => {
|
|
3537
|
+
Pn(v), mt(v.circumferences), xt(false), Tt(true), Ln(true);
|
|
3538
|
+
}, []), Hn = re(async (v) => {
|
|
3528
3539
|
if (!l || !n || !w) return;
|
|
3529
|
-
|
|
3530
|
-
const _ = await
|
|
3540
|
+
xt(false), Ht(true);
|
|
3541
|
+
const _ = await Ue();
|
|
3531
3542
|
l({
|
|
3532
3543
|
spacingType: w,
|
|
3533
3544
|
sourceUnit: "mm",
|
|
3534
|
-
fileFormat:
|
|
3545
|
+
fileFormat: $e,
|
|
3535
3546
|
measurementSource: "form_provided",
|
|
3536
3547
|
isDoubleWall: Y,
|
|
3537
3548
|
isUnitConverted: false,
|
|
3538
3549
|
formMeasurements: Ae,
|
|
3539
3550
|
scanMeasurements: V,
|
|
3540
|
-
frontalHeight:
|
|
3551
|
+
frontalHeight: qe,
|
|
3541
3552
|
transverseML: 0,
|
|
3542
3553
|
transverseAP: 0,
|
|
3543
3554
|
scanUrl: t,
|
|
@@ -3549,44 +3560,45 @@ let __tla = (async () => {
|
|
|
3549
3560
|
l,
|
|
3550
3561
|
n,
|
|
3551
3562
|
w,
|
|
3552
|
-
|
|
3563
|
+
$e,
|
|
3553
3564
|
Y,
|
|
3554
3565
|
Ae,
|
|
3555
3566
|
V,
|
|
3556
|
-
|
|
3567
|
+
qe,
|
|
3557
3568
|
t,
|
|
3558
|
-
|
|
3559
|
-
]),
|
|
3569
|
+
Ue
|
|
3570
|
+
]), zt = re(async (v) => {
|
|
3560
3571
|
if (!l || !n || V.length === 0 || !w) return;
|
|
3572
|
+
Ht(true);
|
|
3561
3573
|
let _ = 0, W = 0;
|
|
3562
3574
|
if (T.length >= 2) {
|
|
3563
3575
|
const ge = n.geometry, K = T[0].position.y;
|
|
3564
3576
|
try {
|
|
3565
|
-
const te =
|
|
3577
|
+
const te = yn(ge), Q = Ye(te, ge, K);
|
|
3566
3578
|
if (Q.linePoints.length >= 2) {
|
|
3567
|
-
let ke = Q.linePoints[0],
|
|
3568
|
-
for (const ye of Q.linePoints) ye.x < ke.x && (ke = ye), ye.x >
|
|
3569
|
-
_ = new C(ke.x, K, ke.z).distanceTo(new C(
|
|
3579
|
+
let ke = Q.linePoints[0], We = Q.linePoints[0], ve = Q.linePoints[0], Me = Q.linePoints[0];
|
|
3580
|
+
for (const ye of Q.linePoints) ye.x < ke.x && (ke = ye), ye.x > We.x && (We = ye), ye.z < ve.z && (ve = ye), ye.z > Me.z && (Me = ye);
|
|
3581
|
+
_ = new C(ke.x, K, ke.z).distanceTo(new C(We.x, K, We.z)), W = new C(ve.x, K, ve.z).distanceTo(new C(Me.x, K, Me.z));
|
|
3570
3582
|
}
|
|
3571
3583
|
} catch {
|
|
3572
3584
|
}
|
|
3573
3585
|
}
|
|
3574
|
-
const R = await
|
|
3586
|
+
const R = await Ue();
|
|
3575
3587
|
l({
|
|
3576
3588
|
spacingType: w,
|
|
3577
3589
|
sourceUnit: "mm",
|
|
3578
|
-
fileFormat:
|
|
3590
|
+
fileFormat: $e,
|
|
3579
3591
|
measurementSource: v === "use_form_measurements" ? "form_provided" : "scan_derived",
|
|
3580
3592
|
isDoubleWall: Y,
|
|
3581
3593
|
isUnitConverted: false,
|
|
3582
3594
|
formMeasurements: Ae,
|
|
3583
3595
|
scanMeasurements: V,
|
|
3584
|
-
frontalHeight: (
|
|
3596
|
+
frontalHeight: (yt == null ? void 0 : yt.frontalHeight) ?? qe,
|
|
3585
3597
|
transverseML: _,
|
|
3586
3598
|
transverseAP: W,
|
|
3587
3599
|
scanUrl: t,
|
|
3588
3600
|
decision: v,
|
|
3589
|
-
userEnteredMeasurements:
|
|
3601
|
+
userEnteredMeasurements: yt ?? void 0,
|
|
3590
3602
|
screenshots: R
|
|
3591
3603
|
});
|
|
3592
3604
|
}, [
|
|
@@ -3595,14 +3607,14 @@ let __tla = (async () => {
|
|
|
3595
3607
|
V,
|
|
3596
3608
|
w,
|
|
3597
3609
|
T,
|
|
3598
|
-
|
|
3610
|
+
$e,
|
|
3599
3611
|
Y,
|
|
3600
3612
|
Ae,
|
|
3601
3613
|
t,
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
]),
|
|
3614
|
+
yt,
|
|
3615
|
+
qe,
|
|
3616
|
+
Ue
|
|
3617
|
+
]), Vn = j(() => {
|
|
3606
3618
|
if (!Ae || V.length === 0) return false;
|
|
3607
3619
|
const v = Math.min(Ae.length, V.length);
|
|
3608
3620
|
if (v === 0) return false;
|
|
@@ -3616,7 +3628,7 @@ let __tla = (async () => {
|
|
|
3616
3628
|
}, [
|
|
3617
3629
|
Ae,
|
|
3618
3630
|
V
|
|
3619
|
-
]),
|
|
3631
|
+
]), jn = $t ? 5 : ee && Ot || ee ? 4 : n ? T.length === 0 ? 2 : 3 : 1, Nn = [
|
|
3620
3632
|
{
|
|
3621
3633
|
label: "Load File",
|
|
3622
3634
|
number: 1
|
|
@@ -3638,10 +3650,10 @@ let __tla = (async () => {
|
|
|
3638
3650
|
number: 5
|
|
3639
3651
|
}
|
|
3640
3652
|
];
|
|
3641
|
-
return
|
|
3653
|
+
return F(ro.Provider, {
|
|
3642
3654
|
value: e,
|
|
3643
3655
|
children: [
|
|
3644
|
-
|
|
3656
|
+
F("div", {
|
|
3645
3657
|
style: {
|
|
3646
3658
|
flex: 1,
|
|
3647
3659
|
display: "flex",
|
|
@@ -3670,11 +3682,11 @@ let __tla = (async () => {
|
|
|
3670
3682
|
}
|
|
3671
3683
|
})
|
|
3672
3684
|
}),
|
|
3673
|
-
i(
|
|
3674
|
-
steps:
|
|
3675
|
-
currentStep:
|
|
3685
|
+
i(Bo, {
|
|
3686
|
+
steps: Nn,
|
|
3687
|
+
currentStep: jn
|
|
3676
3688
|
}),
|
|
3677
|
-
|
|
3689
|
+
F("div", {
|
|
3678
3690
|
style: {
|
|
3679
3691
|
flex: 1,
|
|
3680
3692
|
display: "flex",
|
|
@@ -3682,17 +3694,17 @@ let __tla = (async () => {
|
|
|
3682
3694
|
minHeight: 0
|
|
3683
3695
|
},
|
|
3684
3696
|
children: [
|
|
3685
|
-
|
|
3686
|
-
ref:
|
|
3697
|
+
F("div", {
|
|
3698
|
+
ref: vt,
|
|
3687
3699
|
style: {
|
|
3688
3700
|
flex: 1,
|
|
3689
3701
|
position: "relative",
|
|
3690
3702
|
minHeight: 0,
|
|
3691
3703
|
overflow: "hidden"
|
|
3692
3704
|
},
|
|
3693
|
-
onDragOver: e.showDragDrop ?
|
|
3694
|
-
onDragLeave: e.showDragDrop ?
|
|
3695
|
-
onDrop: e.showDragDrop ?
|
|
3705
|
+
onDragOver: e.showDragDrop ? Rn : void 0,
|
|
3706
|
+
onDragLeave: e.showDragDrop ? Wn : void 0,
|
|
3707
|
+
onDrop: e.showDragDrop ? En : void 0,
|
|
3696
3708
|
children: [
|
|
3697
3709
|
e.showDragDrop && !n && !M && i("div", {
|
|
3698
3710
|
style: {
|
|
@@ -3705,7 +3717,7 @@ let __tla = (async () => {
|
|
|
3705
3717
|
justifyContent: "center",
|
|
3706
3718
|
pointerEvents: "none"
|
|
3707
3719
|
},
|
|
3708
|
-
children:
|
|
3720
|
+
children: Ze ? i("div", {
|
|
3709
3721
|
style: {
|
|
3710
3722
|
fontSize: 18,
|
|
3711
3723
|
color: "#aaa",
|
|
@@ -3713,7 +3725,7 @@ let __tla = (async () => {
|
|
|
3713
3725
|
fontFamily: "system-ui, sans-serif"
|
|
3714
3726
|
},
|
|
3715
3727
|
children: "Drag & Drop Files Here"
|
|
3716
|
-
}) :
|
|
3728
|
+
}) : F("div", {
|
|
3717
3729
|
style: {
|
|
3718
3730
|
textAlign: "center"
|
|
3719
3731
|
},
|
|
@@ -3743,7 +3755,7 @@ let __tla = (async () => {
|
|
|
3743
3755
|
]
|
|
3744
3756
|
})
|
|
3745
3757
|
}),
|
|
3746
|
-
!e.showDragDrop && !n && !M && !
|
|
3758
|
+
!e.showDragDrop && !n && !M && !gt && i("div", {
|
|
3747
3759
|
style: {
|
|
3748
3760
|
position: "absolute",
|
|
3749
3761
|
inset: 0,
|
|
@@ -3751,7 +3763,7 @@ let __tla = (async () => {
|
|
|
3751
3763
|
alignItems: "center",
|
|
3752
3764
|
justifyContent: "center"
|
|
3753
3765
|
},
|
|
3754
|
-
children:
|
|
3766
|
+
children: F("div", {
|
|
3755
3767
|
style: {
|
|
3756
3768
|
textAlign: "center"
|
|
3757
3769
|
},
|
|
@@ -3781,7 +3793,7 @@ let __tla = (async () => {
|
|
|
3781
3793
|
]
|
|
3782
3794
|
})
|
|
3783
3795
|
}),
|
|
3784
|
-
n && !ee && T.length === 0 &&
|
|
3796
|
+
n && !ee && T.length === 0 && F("div", {
|
|
3785
3797
|
style: {
|
|
3786
3798
|
position: "absolute",
|
|
3787
3799
|
top: 16,
|
|
@@ -3813,7 +3825,7 @@ let __tla = (async () => {
|
|
|
3813
3825
|
w === "AK" ? "IT" : "MPT"
|
|
3814
3826
|
]
|
|
3815
3827
|
}),
|
|
3816
|
-
n && !ee && T.length === 1 &&
|
|
3828
|
+
n && !ee && T.length === 1 && F("div", {
|
|
3817
3829
|
style: {
|
|
3818
3830
|
position: "absolute",
|
|
3819
3831
|
top: 16,
|
|
@@ -3844,15 +3856,15 @@ let __tla = (async () => {
|
|
|
3844
3856
|
"Click mesh to set Origin"
|
|
3845
3857
|
]
|
|
3846
3858
|
}),
|
|
3847
|
-
M && i(
|
|
3859
|
+
M && i(on, {
|
|
3848
3860
|
message: m || "Processing mesh..."
|
|
3849
3861
|
}),
|
|
3850
|
-
$ && i(
|
|
3862
|
+
$ && i(on, {
|
|
3851
3863
|
message: U
|
|
3852
3864
|
}),
|
|
3853
|
-
|
|
3854
|
-
message:
|
|
3855
|
-
onDismiss: () =>
|
|
3865
|
+
gt && i(yo, {
|
|
3866
|
+
message: gt,
|
|
3867
|
+
onDismiss: () => _e(null)
|
|
3856
3868
|
}),
|
|
3857
3869
|
e.showAmputationModal && b && i("div", {
|
|
3858
3870
|
style: {
|
|
@@ -3866,7 +3878,7 @@ let __tla = (async () => {
|
|
|
3866
3878
|
justifyContent: "center",
|
|
3867
3879
|
zIndex: 20
|
|
3868
3880
|
},
|
|
3869
|
-
children:
|
|
3881
|
+
children: F("div", {
|
|
3870
3882
|
style: {
|
|
3871
3883
|
backgroundColor: "#fff",
|
|
3872
3884
|
borderRadius: 4,
|
|
@@ -3875,7 +3887,7 @@ let __tla = (async () => {
|
|
|
3875
3887
|
fontFamily: "system-ui, sans-serif"
|
|
3876
3888
|
},
|
|
3877
3889
|
children: [
|
|
3878
|
-
|
|
3890
|
+
F("div", {
|
|
3879
3891
|
style: {
|
|
3880
3892
|
padding: "24px 24px 20px"
|
|
3881
3893
|
},
|
|
@@ -3905,7 +3917,7 @@ let __tla = (async () => {
|
|
|
3905
3917
|
children: [
|
|
3906
3918
|
"AK",
|
|
3907
3919
|
"BK"
|
|
3908
|
-
].map((v) =>
|
|
3920
|
+
].map((v) => F("label", {
|
|
3909
3921
|
onClick: () => A(v),
|
|
3910
3922
|
style: {
|
|
3911
3923
|
flex: 1,
|
|
@@ -3941,7 +3953,7 @@ let __tla = (async () => {
|
|
|
3941
3953
|
},
|
|
3942
3954
|
children: v
|
|
3943
3955
|
}),
|
|
3944
|
-
|
|
3956
|
+
F("span", {
|
|
3945
3957
|
style: {
|
|
3946
3958
|
fontSize: 13,
|
|
3947
3959
|
color: "rgba(0,0,0,0.54)"
|
|
@@ -3956,7 +3968,7 @@ let __tla = (async () => {
|
|
|
3956
3968
|
})
|
|
3957
3969
|
]
|
|
3958
3970
|
}),
|
|
3959
|
-
|
|
3971
|
+
F("div", {
|
|
3960
3972
|
style: {
|
|
3961
3973
|
display: "flex",
|
|
3962
3974
|
justifyContent: "flex-end",
|
|
@@ -3985,7 +3997,7 @@ let __tla = (async () => {
|
|
|
3985
3997
|
children: "Cancel"
|
|
3986
3998
|
}),
|
|
3987
3999
|
i("button", {
|
|
3988
|
-
onClick: () => w &&
|
|
4000
|
+
onClick: () => w && Tn(w),
|
|
3989
4001
|
disabled: !w,
|
|
3990
4002
|
style: {
|
|
3991
4003
|
padding: "6px 16px",
|
|
@@ -4017,8 +4029,8 @@ let __tla = (async () => {
|
|
|
4017
4029
|
zIndex: 10
|
|
4018
4030
|
}
|
|
4019
4031
|
}),
|
|
4020
|
-
i(
|
|
4021
|
-
children:
|
|
4032
|
+
i(xo, {
|
|
4033
|
+
children: F(Qn, {
|
|
4022
4034
|
camera: {
|
|
4023
4035
|
position: [
|
|
4024
4036
|
0,
|
|
@@ -4028,14 +4040,14 @@ let __tla = (async () => {
|
|
|
4028
4040
|
},
|
|
4029
4041
|
style: {
|
|
4030
4042
|
display: n ? "block" : "none",
|
|
4031
|
-
backgroundColor:
|
|
4043
|
+
backgroundColor: Re ? "#070611" : void 0
|
|
4032
4044
|
},
|
|
4033
4045
|
gl: {
|
|
4034
4046
|
localClippingEnabled: true,
|
|
4035
4047
|
preserveDrawingBuffer: true
|
|
4036
4048
|
},
|
|
4037
4049
|
scene: {
|
|
4038
|
-
background:
|
|
4050
|
+
background: Re ? new O.Color("#070611") : null
|
|
4039
4051
|
},
|
|
4040
4052
|
children: [
|
|
4041
4053
|
i("ambientLight", {
|
|
@@ -4065,15 +4077,15 @@ let __tla = (async () => {
|
|
|
4065
4077
|
],
|
|
4066
4078
|
intensity: 0.2
|
|
4067
4079
|
}),
|
|
4068
|
-
n && S === "3D" && i(
|
|
4080
|
+
n && S === "3D" && i(wo, {
|
|
4069
4081
|
mesh: n,
|
|
4070
4082
|
maxPoints: 2,
|
|
4071
|
-
meshColor:
|
|
4072
|
-
meshOpacity:
|
|
4083
|
+
meshColor: Vt,
|
|
4084
|
+
meshOpacity: Re ? 0.3 : In,
|
|
4073
4085
|
frontFaceOnly: Z,
|
|
4074
4086
|
doubleShellTransparency: Y && ee
|
|
4075
4087
|
}),
|
|
4076
|
-
n && S === "3D" && i(
|
|
4088
|
+
n && S === "3D" && i(vo, {
|
|
4077
4089
|
modelSize: d,
|
|
4078
4090
|
labels: [
|
|
4079
4091
|
w === "AK" ? "IT" : "MPT",
|
|
@@ -4081,94 +4093,94 @@ let __tla = (async () => {
|
|
|
4081
4093
|
"Cut Plane"
|
|
4082
4094
|
]
|
|
4083
4095
|
}),
|
|
4084
|
-
i(
|
|
4096
|
+
i(Po, {
|
|
4085
4097
|
modelSize: d,
|
|
4086
4098
|
isAligned: ee,
|
|
4087
|
-
isCut:
|
|
4099
|
+
isCut: Ct,
|
|
4088
4100
|
mesh: n,
|
|
4089
4101
|
viewMode: S,
|
|
4090
|
-
sliceY: ee && T.length >= 2 ? ze ??
|
|
4102
|
+
sliceY: ee && T.length >= 2 ? ze ?? ht ?? T[0].position.y : void 0,
|
|
4091
4103
|
landmarkCount: T.length,
|
|
4092
4104
|
measurementGeometry: xe,
|
|
4093
|
-
resetCameraToFrontRef:
|
|
4105
|
+
resetCameraToFrontRef: St
|
|
4094
4106
|
}),
|
|
4095
|
-
!ee && i(
|
|
4107
|
+
!ee && i(dn, {
|
|
4096
4108
|
enableDamping: false
|
|
4097
4109
|
}),
|
|
4098
|
-
ee && V.length > 0 && n && S === "3D" && i(
|
|
4110
|
+
ee && V.length > 0 && n && S === "3D" && i(Io, {
|
|
4099
4111
|
mesh: n,
|
|
4100
|
-
isDragging:
|
|
4112
|
+
isDragging: zn
|
|
4101
4113
|
}),
|
|
4102
4114
|
n && ee && T.length >= 3 && (() => {
|
|
4103
4115
|
const _ = n.geometry.getIndex();
|
|
4104
4116
|
if (!_ || _.count < 30) return null;
|
|
4105
|
-
const W = T[2], R = T[0], ge =
|
|
4106
|
-
return S === "2D" ? i(
|
|
4107
|
-
mesh:
|
|
4117
|
+
const W = T[2], R = T[0], ge = Ge ?? W.position.y, G = ze ?? ht ?? R.position.y;
|
|
4118
|
+
return S === "2D" ? i(Ro, {
|
|
4119
|
+
mesh: Ut ?? n,
|
|
4108
4120
|
upperY: G,
|
|
4109
4121
|
originY: R.position.y,
|
|
4110
4122
|
modelSize: d,
|
|
4111
|
-
meshColor:
|
|
4123
|
+
meshColor: Vt,
|
|
4112
4124
|
displayUnit: k
|
|
4113
|
-
}) :
|
|
4125
|
+
}) : F(Oe, {
|
|
4114
4126
|
children: [
|
|
4115
|
-
i(
|
|
4116
|
-
mesh:
|
|
4127
|
+
i(Fo, {
|
|
4128
|
+
mesh: Ut ?? n,
|
|
4117
4129
|
startY: ge,
|
|
4118
4130
|
endY: G,
|
|
4119
|
-
spacing:
|
|
4131
|
+
spacing: ot,
|
|
4120
4132
|
modelSize: d,
|
|
4121
4133
|
onMeasurementsChange: X,
|
|
4122
4134
|
reverseOrder: true,
|
|
4123
4135
|
displayUnit: k,
|
|
4124
4136
|
useInnerSurface: Y && !Z,
|
|
4125
|
-
formMeasurements:
|
|
4126
|
-
originY:
|
|
4137
|
+
formMeasurements: tt ? Ae : void 0,
|
|
4138
|
+
originY: Rt ?? R.position.y,
|
|
4127
4139
|
wasmSlices: Le
|
|
4128
4140
|
}),
|
|
4129
|
-
i(
|
|
4141
|
+
i(Lo, {
|
|
4130
4142
|
mesh: n,
|
|
4131
4143
|
greenY: R.position.y,
|
|
4132
4144
|
modelSize: d,
|
|
4133
4145
|
displayUnit: k,
|
|
4134
4146
|
bottomY: Y ? W.position.y : void 0
|
|
4135
4147
|
}),
|
|
4136
|
-
i(
|
|
4148
|
+
i(Wo, {
|
|
4137
4149
|
mesh: n,
|
|
4138
|
-
yPosition:
|
|
4150
|
+
yPosition: Rt ?? R.position.y,
|
|
4139
4151
|
onYChange: (K) => {
|
|
4140
|
-
|
|
4152
|
+
An(K), Pe(null);
|
|
4141
4153
|
const te = K - R.position.y;
|
|
4142
|
-
|
|
4154
|
+
Dt((ht ?? R.position.y + ot * 2) + te);
|
|
4143
4155
|
},
|
|
4144
|
-
minY: R.position.y -
|
|
4145
|
-
maxY: R.position.y +
|
|
4156
|
+
minY: R.position.y - ot,
|
|
4157
|
+
maxY: R.position.y + ot,
|
|
4146
4158
|
modelSize: d,
|
|
4147
4159
|
color: "#44ff44",
|
|
4148
4160
|
hoverColor: "#88ff88",
|
|
4149
4161
|
dragColor: "#ffffff",
|
|
4150
4162
|
label: w === "AK" ? "IT" : "MPT",
|
|
4151
|
-
onDragStart: () =>
|
|
4152
|
-
onDragEnd: () =>
|
|
4163
|
+
onDragStart: () => Bt(true),
|
|
4164
|
+
onDragEnd: () => Bt(false)
|
|
4153
4165
|
})
|
|
4154
4166
|
]
|
|
4155
4167
|
});
|
|
4156
4168
|
})(),
|
|
4157
|
-
n && ee && S === "3D" &&
|
|
4169
|
+
n && ee && S === "3D" && Re && i(er, {
|
|
4158
4170
|
mesh: n
|
|
4159
4171
|
}),
|
|
4160
|
-
n && e.showDebug &&
|
|
4172
|
+
n && e.showDebug && Re && S === "3D" && i(qo, {
|
|
4161
4173
|
mesh: n,
|
|
4162
4174
|
modelSize: d,
|
|
4163
|
-
layers:
|
|
4175
|
+
layers: Wt,
|
|
4164
4176
|
landmarkPoints: T,
|
|
4165
4177
|
componentDebug: null,
|
|
4166
4178
|
aoData: me,
|
|
4167
4179
|
aoGeometry: H,
|
|
4168
4180
|
measurementGeometry: xe
|
|
4169
4181
|
}),
|
|
4170
|
-
i(
|
|
4171
|
-
screenshotFnRef:
|
|
4182
|
+
i(rr, {
|
|
4183
|
+
screenshotFnRef: Dn,
|
|
4172
4184
|
mesh: n,
|
|
4173
4185
|
modelSize: d,
|
|
4174
4186
|
measurementGeometry: xe
|
|
@@ -4176,7 +4188,7 @@ let __tla = (async () => {
|
|
|
4176
4188
|
]
|
|
4177
4189
|
})
|
|
4178
4190
|
}),
|
|
4179
|
-
n &&
|
|
4191
|
+
n && F("div", {
|
|
4180
4192
|
style: {
|
|
4181
4193
|
position: "absolute",
|
|
4182
4194
|
top: 16,
|
|
@@ -4204,7 +4216,7 @@ let __tla = (async () => {
|
|
|
4204
4216
|
children: "Start Over"
|
|
4205
4217
|
}),
|
|
4206
4218
|
!ee && T.length >= 1 && i("button", {
|
|
4207
|
-
onClick:
|
|
4219
|
+
onClick: Bn,
|
|
4208
4220
|
style: {
|
|
4209
4221
|
padding: "6px 16px",
|
|
4210
4222
|
borderRadius: 4,
|
|
@@ -4222,15 +4234,15 @@ let __tla = (async () => {
|
|
|
4222
4234
|
})
|
|
4223
4235
|
]
|
|
4224
4236
|
}),
|
|
4225
|
-
e.showDebug &&
|
|
4226
|
-
layers:
|
|
4227
|
-
onToggleLayer: (v) =>
|
|
4237
|
+
e.showDebug && Re && n && S === "3D" && i(nr, {
|
|
4238
|
+
layers: Wt,
|
|
4239
|
+
onToggleLayer: (v) => Fn((_) => ({
|
|
4228
4240
|
..._,
|
|
4229
4241
|
[v]: !_[v]
|
|
4230
4242
|
})),
|
|
4231
4243
|
isDoubleShell: Y
|
|
4232
4244
|
}),
|
|
4233
|
-
ee && V.length > 0 &&
|
|
4245
|
+
ee && V.length > 0 && F("div", {
|
|
4234
4246
|
style: {
|
|
4235
4247
|
position: "absolute",
|
|
4236
4248
|
top: 16,
|
|
@@ -4240,7 +4252,7 @@ let __tla = (async () => {
|
|
|
4240
4252
|
zIndex: 10
|
|
4241
4253
|
},
|
|
4242
4254
|
children: [
|
|
4243
|
-
|
|
4255
|
+
F("div", {
|
|
4244
4256
|
style: {
|
|
4245
4257
|
display: "flex",
|
|
4246
4258
|
borderRadius: 6,
|
|
@@ -4280,7 +4292,7 @@ let __tla = (async () => {
|
|
|
4280
4292
|
})
|
|
4281
4293
|
]
|
|
4282
4294
|
}),
|
|
4283
|
-
|
|
4295
|
+
F("div", {
|
|
4284
4296
|
style: {
|
|
4285
4297
|
display: "flex",
|
|
4286
4298
|
borderRadius: 6,
|
|
@@ -4320,7 +4332,7 @@ let __tla = (async () => {
|
|
|
4320
4332
|
})
|
|
4321
4333
|
]
|
|
4322
4334
|
}),
|
|
4323
|
-
e.showSpacingToggle && S === "3D" &&
|
|
4335
|
+
e.showSpacingToggle && S === "3D" && F("div", {
|
|
4324
4336
|
style: {
|
|
4325
4337
|
display: "flex",
|
|
4326
4338
|
borderRadius: 6,
|
|
@@ -4334,9 +4346,9 @@ let __tla = (async () => {
|
|
|
4334
4346
|
style: {
|
|
4335
4347
|
padding: "6px 14px",
|
|
4336
4348
|
fontSize: 13,
|
|
4337
|
-
fontWeight:
|
|
4338
|
-
backgroundColor:
|
|
4339
|
-
color:
|
|
4349
|
+
fontWeight: L === 1 ? 600 : 400,
|
|
4350
|
+
backgroundColor: L === 1 ? "rgb(12, 67, 173)" : "#fff",
|
|
4351
|
+
color: L === 1 ? "#fff" : "#666",
|
|
4340
4352
|
border: "none",
|
|
4341
4353
|
cursor: "pointer",
|
|
4342
4354
|
fontFamily: "system-ui, sans-serif"
|
|
@@ -4348,9 +4360,9 @@ let __tla = (async () => {
|
|
|
4348
4360
|
style: {
|
|
4349
4361
|
padding: "6px 14px",
|
|
4350
4362
|
fontSize: 13,
|
|
4351
|
-
fontWeight:
|
|
4352
|
-
backgroundColor:
|
|
4353
|
-
color:
|
|
4363
|
+
fontWeight: L === 2 ? 600 : 400,
|
|
4364
|
+
backgroundColor: L === 2 ? "rgb(12, 67, 173)" : "#fff",
|
|
4365
|
+
color: L === 2 ? "#fff" : "#666",
|
|
4354
4366
|
border: "none",
|
|
4355
4367
|
borderLeft: "1px solid #ccc",
|
|
4356
4368
|
cursor: "pointer",
|
|
@@ -4369,13 +4381,13 @@ let __tla = (async () => {
|
|
|
4369
4381
|
boxShadow: "0 2px 8px rgba(0,0,0,0.1)"
|
|
4370
4382
|
},
|
|
4371
4383
|
children: i("button", {
|
|
4372
|
-
onClick: () =>
|
|
4384
|
+
onClick: () => Tt((v) => !v),
|
|
4373
4385
|
style: {
|
|
4374
4386
|
padding: "6px 14px",
|
|
4375
4387
|
fontSize: 13,
|
|
4376
|
-
fontWeight:
|
|
4377
|
-
backgroundColor:
|
|
4378
|
-
color:
|
|
4388
|
+
fontWeight: tt ? 600 : 400,
|
|
4389
|
+
backgroundColor: tt ? "rgb(12, 67, 173)" : "#fff",
|
|
4390
|
+
color: tt ? "#fff" : "#666",
|
|
4379
4391
|
border: "none",
|
|
4380
4392
|
cursor: "pointer",
|
|
4381
4393
|
fontFamily: "system-ui, sans-serif"
|
|
@@ -4393,7 +4405,7 @@ let __tla = (async () => {
|
|
|
4393
4405
|
},
|
|
4394
4406
|
children: i("button", {
|
|
4395
4407
|
onClick: async () => {
|
|
4396
|
-
const v = await
|
|
4408
|
+
const v = await Ue();
|
|
4397
4409
|
if (!v) return;
|
|
4398
4410
|
const _ = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), W = (R, ge) => {
|
|
4399
4411
|
const G = document.createElement("a");
|
|
@@ -4423,13 +4435,13 @@ let __tla = (async () => {
|
|
|
4423
4435
|
boxShadow: "0 2px 8px rgba(0,0,0,0.1)"
|
|
4424
4436
|
},
|
|
4425
4437
|
children: i("button", {
|
|
4426
|
-
onClick: () =>
|
|
4438
|
+
onClick: () => kn((v) => !v),
|
|
4427
4439
|
style: {
|
|
4428
4440
|
padding: "6px 14px",
|
|
4429
4441
|
fontSize: 13,
|
|
4430
|
-
fontWeight:
|
|
4431
|
-
backgroundColor:
|
|
4432
|
-
color:
|
|
4442
|
+
fontWeight: Re ? 600 : 400,
|
|
4443
|
+
backgroundColor: Re ? "#e65100" : "#fff",
|
|
4444
|
+
color: Re ? "#fff" : "#666",
|
|
4433
4445
|
border: "none",
|
|
4434
4446
|
cursor: "pointer",
|
|
4435
4447
|
fontFamily: "system-ui, sans-serif"
|
|
@@ -4439,17 +4451,53 @@ let __tla = (async () => {
|
|
|
4439
4451
|
})
|
|
4440
4452
|
]
|
|
4441
4453
|
}),
|
|
4442
|
-
n && ie && i(
|
|
4454
|
+
n && ie && i(_o, {
|
|
4443
4455
|
wasAutoScaled: ae,
|
|
4444
4456
|
onDismiss: () => J(false)
|
|
4445
4457
|
}),
|
|
4446
|
-
n && we && ee && i(
|
|
4458
|
+
n && we && ee && i(Do, {
|
|
4447
4459
|
isDoubleShell: Y,
|
|
4448
|
-
onDismiss: () =>
|
|
4460
|
+
onDismiss: () => oe(false)
|
|
4449
4461
|
})
|
|
4450
4462
|
]
|
|
4451
4463
|
}),
|
|
4452
|
-
|
|
4464
|
+
Ie && F("div", {
|
|
4465
|
+
style: {
|
|
4466
|
+
position: "absolute",
|
|
4467
|
+
inset: 0,
|
|
4468
|
+
backgroundColor: "rgba(255,255,255,0.85)",
|
|
4469
|
+
display: "flex",
|
|
4470
|
+
flexDirection: "column",
|
|
4471
|
+
alignItems: "center",
|
|
4472
|
+
justifyContent: "center",
|
|
4473
|
+
zIndex: 50
|
|
4474
|
+
},
|
|
4475
|
+
children: [
|
|
4476
|
+
i("div", {
|
|
4477
|
+
style: {
|
|
4478
|
+
width: 32,
|
|
4479
|
+
height: 32,
|
|
4480
|
+
border: "3px solid #e0e0e0",
|
|
4481
|
+
borderTopColor: "rgb(12, 67, 173)",
|
|
4482
|
+
borderRadius: "50%",
|
|
4483
|
+
animation: "gm-spin 0.8s linear infinite"
|
|
4484
|
+
}
|
|
4485
|
+
}),
|
|
4486
|
+
i("p", {
|
|
4487
|
+
style: {
|
|
4488
|
+
marginTop: 12,
|
|
4489
|
+
fontSize: 14,
|
|
4490
|
+
color: "#555",
|
|
4491
|
+
fontFamily: "system-ui, sans-serif"
|
|
4492
|
+
},
|
|
4493
|
+
children: "Generating screenshots and preparing data\u2026"
|
|
4494
|
+
}),
|
|
4495
|
+
i("style", {
|
|
4496
|
+
children: "@keyframes gm-spin { to { transform: rotate(360deg) } }"
|
|
4497
|
+
})
|
|
4498
|
+
]
|
|
4499
|
+
}),
|
|
4500
|
+
F("div", {
|
|
4453
4501
|
style: {
|
|
4454
4502
|
padding: "12px 24px",
|
|
4455
4503
|
backgroundColor: "#fff",
|
|
@@ -4462,7 +4510,7 @@ let __tla = (async () => {
|
|
|
4462
4510
|
},
|
|
4463
4511
|
children: [
|
|
4464
4512
|
n && !ee && T.length >= 2 && i("button", {
|
|
4465
|
-
onClick:
|
|
4513
|
+
onClick: On,
|
|
4466
4514
|
style: {
|
|
4467
4515
|
padding: "6px 16px",
|
|
4468
4516
|
borderRadius: 4,
|
|
@@ -4478,35 +4526,37 @@ let __tla = (async () => {
|
|
|
4478
4526
|
},
|
|
4479
4527
|
children: "Next \xBB"
|
|
4480
4528
|
}),
|
|
4481
|
-
ee &&
|
|
4482
|
-
|
|
4529
|
+
ee && $t && (Vn ? i("button", {
|
|
4530
|
+
disabled: Ie,
|
|
4531
|
+
onClick: () => zt("continue"),
|
|
4483
4532
|
style: {
|
|
4484
4533
|
padding: "6px 16px",
|
|
4485
4534
|
borderRadius: 4,
|
|
4486
4535
|
fontSize: 14,
|
|
4487
4536
|
fontWeight: 500,
|
|
4488
|
-
backgroundColor: "rgb(12, 67, 173)",
|
|
4537
|
+
backgroundColor: Ie ? "#9e9e9e" : "rgb(12, 67, 173)",
|
|
4489
4538
|
border: "none",
|
|
4490
4539
|
color: "#fff",
|
|
4491
|
-
cursor: "pointer",
|
|
4540
|
+
cursor: Ie ? "not-allowed" : "pointer",
|
|
4492
4541
|
fontFamily: "system-ui, sans-serif",
|
|
4493
4542
|
letterSpacing: "0.4px",
|
|
4494
4543
|
lineHeight: "36px"
|
|
4495
4544
|
},
|
|
4496
4545
|
children: "Continue"
|
|
4497
|
-
}) :
|
|
4546
|
+
}) : F(Oe, {
|
|
4498
4547
|
children: [
|
|
4499
4548
|
i("button", {
|
|
4500
|
-
|
|
4549
|
+
disabled: Ie,
|
|
4550
|
+
onClick: () => zt("use_form_measurements"),
|
|
4501
4551
|
style: {
|
|
4502
4552
|
padding: "6px 16px",
|
|
4503
4553
|
borderRadius: 4,
|
|
4504
4554
|
fontSize: 14,
|
|
4505
4555
|
fontWeight: 500,
|
|
4506
|
-
backgroundColor: "rgb(12, 67, 173)",
|
|
4556
|
+
backgroundColor: Ie ? "#9e9e9e" : "rgb(12, 67, 173)",
|
|
4507
4557
|
border: "none",
|
|
4508
4558
|
color: "#fff",
|
|
4509
|
-
cursor: "pointer",
|
|
4559
|
+
cursor: Ie ? "not-allowed" : "pointer",
|
|
4510
4560
|
fontFamily: "system-ui, sans-serif",
|
|
4511
4561
|
letterSpacing: "0.4px",
|
|
4512
4562
|
lineHeight: "36px"
|
|
@@ -4514,16 +4564,17 @@ let __tla = (async () => {
|
|
|
4514
4564
|
children: "Set to Measurements"
|
|
4515
4565
|
}),
|
|
4516
4566
|
i("button", {
|
|
4517
|
-
|
|
4567
|
+
disabled: Ie,
|
|
4568
|
+
onClick: () => zt("use_scan"),
|
|
4518
4569
|
style: {
|
|
4519
4570
|
padding: "6px 16px",
|
|
4520
4571
|
borderRadius: 4,
|
|
4521
4572
|
fontSize: 14,
|
|
4522
4573
|
fontWeight: 500,
|
|
4523
|
-
backgroundColor: "#fff",
|
|
4574
|
+
backgroundColor: Ie ? "#e0e0e0" : "#fff",
|
|
4524
4575
|
border: "1px solid #bdbdbd",
|
|
4525
|
-
color: "#333",
|
|
4526
|
-
cursor: "pointer",
|
|
4576
|
+
color: Ie ? "#999" : "#333",
|
|
4577
|
+
cursor: Ie ? "not-allowed" : "pointer",
|
|
4527
4578
|
fontFamily: "system-ui, sans-serif",
|
|
4528
4579
|
letterSpacing: "0.4px",
|
|
4529
4580
|
lineHeight: "36px"
|
|
@@ -4536,7 +4587,7 @@ let __tla = (async () => {
|
|
|
4536
4587
|
})
|
|
4537
4588
|
]
|
|
4538
4589
|
}),
|
|
4539
|
-
s &&
|
|
4590
|
+
s && bt.length > 0 && F("div", {
|
|
4540
4591
|
style: {
|
|
4541
4592
|
height: 120,
|
|
4542
4593
|
flexShrink: 0,
|
|
@@ -4549,7 +4600,7 @@ let __tla = (async () => {
|
|
|
4549
4600
|
flexDirection: "column"
|
|
4550
4601
|
},
|
|
4551
4602
|
children: [
|
|
4552
|
-
|
|
4603
|
+
F("div", {
|
|
4553
4604
|
style: {
|
|
4554
4605
|
display: "flex",
|
|
4555
4606
|
alignItems: "center",
|
|
@@ -4569,21 +4620,21 @@ let __tla = (async () => {
|
|
|
4569
4620
|
},
|
|
4570
4621
|
children: "GALILEO DEBUG"
|
|
4571
4622
|
}),
|
|
4572
|
-
|
|
4623
|
+
F("div", {
|
|
4573
4624
|
style: {
|
|
4574
4625
|
display: "flex",
|
|
4575
4626
|
gap: 8,
|
|
4576
4627
|
alignItems: "center"
|
|
4577
4628
|
},
|
|
4578
4629
|
children: [
|
|
4579
|
-
|
|
4630
|
+
F("span", {
|
|
4580
4631
|
style: {
|
|
4581
4632
|
color: "#484f58",
|
|
4582
4633
|
fontSize: 9
|
|
4583
4634
|
},
|
|
4584
4635
|
children: [
|
|
4585
4636
|
"WASM ",
|
|
4586
|
-
|
|
4637
|
+
He.current ? "v2" : "N/A",
|
|
4587
4638
|
" | ",
|
|
4588
4639
|
T.length,
|
|
4589
4640
|
" pts | ",
|
|
@@ -4594,7 +4645,7 @@ let __tla = (async () => {
|
|
|
4594
4645
|
]
|
|
4595
4646
|
}),
|
|
4596
4647
|
i("button", {
|
|
4597
|
-
onClick: () =>
|
|
4648
|
+
onClick: () => jt([]),
|
|
4598
4649
|
style: {
|
|
4599
4650
|
background: "none",
|
|
4600
4651
|
border: "1px solid #30363d",
|
|
@@ -4611,14 +4662,14 @@ let __tla = (async () => {
|
|
|
4611
4662
|
]
|
|
4612
4663
|
}),
|
|
4613
4664
|
i("div", {
|
|
4614
|
-
ref:
|
|
4665
|
+
ref: nt,
|
|
4615
4666
|
style: {
|
|
4616
4667
|
flex: 1,
|
|
4617
4668
|
overflowY: "auto",
|
|
4618
4669
|
padding: "4px 10px",
|
|
4619
4670
|
lineHeight: 1.6
|
|
4620
4671
|
},
|
|
4621
|
-
children:
|
|
4672
|
+
children: bt.map((v, _) => {
|
|
4622
4673
|
const W = v.includes("ERROR") || v.includes("failed"), R = v.includes("warning") || v.includes("WARN"), ge = v.includes("PIPELINE:"), G = v.includes("STATE:");
|
|
4623
4674
|
return i("div", {
|
|
4624
4675
|
style: {
|
|
@@ -4633,25 +4684,25 @@ let __tla = (async () => {
|
|
|
4633
4684
|
})
|
|
4634
4685
|
]
|
|
4635
4686
|
}),
|
|
4636
|
-
ee &&
|
|
4687
|
+
ee && Ot && w && i(Ho, {
|
|
4637
4688
|
amputationType: w,
|
|
4638
|
-
spacingInches:
|
|
4689
|
+
spacingInches: L,
|
|
4639
4690
|
scanMeasurements: V,
|
|
4640
|
-
scanFrontalHeight:
|
|
4641
|
-
onSave:
|
|
4642
|
-
onSkip:
|
|
4691
|
+
scanFrontalHeight: qe,
|
|
4692
|
+
onSave: $n,
|
|
4693
|
+
onSkip: Hn
|
|
4643
4694
|
})
|
|
4644
4695
|
]
|
|
4645
4696
|
});
|
|
4646
4697
|
};
|
|
4647
|
-
function
|
|
4648
|
-
return
|
|
4698
|
+
function rr({ screenshotFnRef: e }) {
|
|
4699
|
+
return ne(() => {
|
|
4649
4700
|
e.current = null;
|
|
4650
4701
|
}, [
|
|
4651
4702
|
e
|
|
4652
4703
|
]), null;
|
|
4653
4704
|
}
|
|
4654
|
-
|
|
4705
|
+
Cn = function(e) {
|
|
4655
4706
|
const r = e === "AK" ? 2 : 1, t = [];
|
|
4656
4707
|
for (let o = 2; o >= 1; o -= r) t.push(`${o}_above`);
|
|
4657
4708
|
t.push("at_ref");
|
|
@@ -4670,40 +4721,40 @@ let __tla = (async () => {
|
|
|
4670
4721
|
]) t.push(`${o}_below`);
|
|
4671
4722
|
return t;
|
|
4672
4723
|
};
|
|
4673
|
-
|
|
4674
|
-
const t =
|
|
4724
|
+
at = function(e, r) {
|
|
4725
|
+
const t = Cn(r), o = {};
|
|
4675
4726
|
for (let l = 0; l < Math.min(e.length, t.length); l++) {
|
|
4676
4727
|
const s = e[l];
|
|
4677
4728
|
s != null && !isNaN(s) && (o[t[l]] = s);
|
|
4678
4729
|
}
|
|
4679
4730
|
return o;
|
|
4680
4731
|
};
|
|
4681
|
-
|
|
4732
|
+
ir = function(e, r) {
|
|
4682
4733
|
if (!e) return;
|
|
4683
|
-
const o =
|
|
4734
|
+
const o = Cn(r).map((l) => {
|
|
4684
4735
|
const s = e[l];
|
|
4685
4736
|
return s ?? void 0;
|
|
4686
4737
|
});
|
|
4687
4738
|
if (!o.every((l) => l == null)) return o;
|
|
4688
4739
|
};
|
|
4689
|
-
|
|
4690
|
-
const o = j(() =>
|
|
4740
|
+
mr = ({ request: e, onComplete: r, wasmModule: t }) => {
|
|
4741
|
+
const o = j(() => ir(e.form_measurements, e.spacing_type), [
|
|
4691
4742
|
e.form_measurements,
|
|
4692
4743
|
e.spacing_type
|
|
4693
4744
|
]), l = (s) => {
|
|
4694
4745
|
var _a, _b;
|
|
4695
|
-
const c = s.scanMeasurements.map((f) => +(f.modifiedValue ?? f.originalValue).toFixed(1)), a =
|
|
4746
|
+
const c = s.scanMeasurements.map((f) => +(f.modifiedValue ?? f.originalValue).toFixed(1)), a = at(c, e.spacing_type);
|
|
4696
4747
|
let n, h;
|
|
4697
4748
|
if (s.formMeasurements) {
|
|
4698
|
-
n =
|
|
4749
|
+
n = at(s.formMeasurements, e.spacing_type);
|
|
4699
4750
|
const f = s.scanMeasurements.map((m, x) => {
|
|
4700
4751
|
var _a2;
|
|
4701
4752
|
const S = (_a2 = s.formMeasurements) == null ? void 0 : _a2[x];
|
|
4702
4753
|
return S == null || isNaN(S) ? null : +((m.modifiedValue ?? m.originalValue) - S).toFixed(1);
|
|
4703
4754
|
});
|
|
4704
|
-
h =
|
|
4755
|
+
h = at(f, e.spacing_type);
|
|
4705
4756
|
}
|
|
4706
|
-
const d = s.userEnteredMeasurements ?
|
|
4757
|
+
const d = s.userEnteredMeasurements ? at(s.userEnteredMeasurements.circumferences, e.spacing_type) : void 0, u = s.decision === "use_scan" || s.decision === "continue", p = u ? a : d ?? n ?? a, g = u ? +s.frontalHeight.toFixed(1) : +(((_a = s.userEnteredMeasurements) == null ? void 0 : _a.frontalHeight) ?? s.frontalHeight).toFixed(1), M = {
|
|
4707
4758
|
spacing_type: e.spacing_type,
|
|
4708
4759
|
source_unit: "mm",
|
|
4709
4760
|
file_format: s.fileFormat,
|
|
@@ -4735,8 +4786,8 @@ let __tla = (async () => {
|
|
|
4735
4786
|
height: "100%",
|
|
4736
4787
|
display: "flex"
|
|
4737
4788
|
},
|
|
4738
|
-
children: i(
|
|
4739
|
-
config:
|
|
4789
|
+
children: i(or, {
|
|
4790
|
+
config: oo,
|
|
4740
4791
|
spacingType: e.spacing_type,
|
|
4741
4792
|
scanUrl: e.scan_url,
|
|
4742
4793
|
formMeasurements: o,
|
|
@@ -4747,9 +4798,9 @@ let __tla = (async () => {
|
|
|
4747
4798
|
};
|
|
4748
4799
|
})();
|
|
4749
4800
|
export {
|
|
4750
|
-
|
|
4801
|
+
mr as G,
|
|
4751
4802
|
__tla,
|
|
4752
|
-
|
|
4753
|
-
|
|
4754
|
-
|
|
4803
|
+
at as a,
|
|
4804
|
+
ir as c,
|
|
4805
|
+
Cn as g
|
|
4755
4806
|
};
|