@solid-labs/fab-one-widget 0.1.7 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{GirthManagerWidget-C5L2H3Y2.js → GirthManagerWidget-CaXgi08X.js} +941 -972
- package/dist/{GirthManagerWidget-C5L2H3Y2.js.map → GirthManagerWidget-CaXgi08X.js.map} +1 -1
- package/dist/geo_wasm.d.ts +529 -0
- package/dist/geo_wasm.js +1686 -0
- package/dist/geo_wasm_bg.wasm +0 -0
- package/dist/girth-manager-web-widget/src/GirthManagerWidget.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/web-component.js +1 -1
- package/package.json +8 -3
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { createContext as Yn, Component as Xn, useCallback as
|
|
1
|
+
import { jsxs as L, jsx as i, Fragment as Te } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as Yn, Component as Xn, useCallback as oe, useMemo as j, useState as E, memo as Gn, useEffect as re, useRef as le, forwardRef as Zn, createElement as Jt } from "react";
|
|
3
3
|
import { useFrame as rn, useThree as sn, Canvas as Kn } from "@react-three/fiber";
|
|
4
4
|
import { Html as Ye, Line as de, OrbitControls as ln } from "@react-three/drei";
|
|
5
5
|
import * as O from "three";
|
|
6
|
-
import { Plane as dt, Vector3 as
|
|
6
|
+
import { Plane as dt, Vector3 as C, Box3 as an, Line3 as cn, Raycaster as Un } from "three";
|
|
7
7
|
import { create as Jn } from "zustand";
|
|
8
8
|
import { OBJLoader as dn } from "three/examples/jsm/loaders/OBJLoader.js";
|
|
9
9
|
import { STLLoader as Qn } from "three/examples/jsm/loaders/STLLoader.js";
|
|
@@ -39,7 +39,7 @@ let __tla = (async () => {
|
|
|
39
39
|
]
|
|
40
40
|
}),
|
|
41
41
|
removeLandmarkPoint: (t) => e((o) => ({
|
|
42
|
-
landmarkPoints: o.landmarkPoints.filter((
|
|
42
|
+
landmarkPoints: o.landmarkPoints.filter((l, s) => s !== t)
|
|
43
43
|
})),
|
|
44
44
|
clearLandmarkPoints: () => e({
|
|
45
45
|
landmarkPoints: [],
|
|
@@ -47,9 +47,9 @@ let __tla = (async () => {
|
|
|
47
47
|
isCut: false
|
|
48
48
|
}),
|
|
49
49
|
updateLandmarkPositions: (t) => e((o) => ({
|
|
50
|
-
landmarkPoints: o.landmarkPoints.map((
|
|
51
|
-
...
|
|
52
|
-
position: t[
|
|
50
|
+
landmarkPoints: o.landmarkPoints.map((l, s) => ({
|
|
51
|
+
...l,
|
|
52
|
+
position: t[s] ?? l.position
|
|
53
53
|
}))
|
|
54
54
|
})),
|
|
55
55
|
setAligned: (t) => e({
|
|
@@ -70,51 +70,51 @@ let __tla = (async () => {
|
|
|
70
70
|
const r = e.match(/^v\s+\S+\s+\S+\s+\S+(.*)$/m);
|
|
71
71
|
if (!r || !((_a = r[1]) == null ? void 0 : _a.trim().includes(" "))) return null;
|
|
72
72
|
const t = e.split(`
|
|
73
|
-
`), o = [],
|
|
74
|
-
let
|
|
73
|
+
`), o = [], l = [];
|
|
74
|
+
let s = false;
|
|
75
75
|
for (const c of t) if (c.startsWith("v ")) {
|
|
76
76
|
const a = c.trim().split(/\s+/);
|
|
77
77
|
if (a.length >= 7) {
|
|
78
78
|
o.push(parseFloat(a[1]), parseFloat(a[2]), parseFloat(a[3]));
|
|
79
|
-
let n = parseFloat(a[4]), h = parseFloat(a[5]),
|
|
80
|
-
(n > 1 || h > 1 ||
|
|
81
|
-
} else a.length >= 4 && (o.push(parseFloat(a[1]), parseFloat(a[2]), parseFloat(a[3])),
|
|
79
|
+
let n = parseFloat(a[4]), h = parseFloat(a[5]), d = parseFloat(a[6]);
|
|
80
|
+
(n > 1 || h > 1 || d > 1) && (n /= 255, h /= 255, d /= 255), l.push(n, h, d), s = true;
|
|
81
|
+
} else a.length >= 4 && (o.push(parseFloat(a[1]), parseFloat(a[2]), parseFloat(a[3])), l.push(0, 0, 0));
|
|
82
82
|
}
|
|
83
|
-
return
|
|
83
|
+
return s ? {
|
|
84
84
|
positions: new Float32Array(o),
|
|
85
|
-
colors: new Float32Array(
|
|
85
|
+
colors: new Float32Array(l)
|
|
86
86
|
} : null;
|
|
87
87
|
}
|
|
88
88
|
function io(e, r, t, o) {
|
|
89
|
-
const
|
|
90
|
-
let n = 1 / 0, h = 1 / 0,
|
|
91
|
-
for (let
|
|
92
|
-
const B = r[
|
|
93
|
-
B < n && (n = B), B >
|
|
89
|
+
const l = e.getAttribute("position"), s = l.count, c = new Float32Array(s * 3), a = r.length / 3;
|
|
90
|
+
let n = 1 / 0, h = 1 / 0, d = 1 / 0, u = -1 / 0, p = -1 / 0, g = -1 / 0;
|
|
91
|
+
for (let k = 0; k < a; k++) {
|
|
92
|
+
const B = r[k * 3] * o, $ = r[k * 3 + 1] * o, N = r[k * 3 + 2] * o;
|
|
93
|
+
B < n && (n = B), B > u && (u = B), $ < h && (h = $), $ > p && (p = $), N < d && (d = N), N > g && (g = N);
|
|
94
94
|
}
|
|
95
|
-
const
|
|
96
|
-
for (let
|
|
97
|
-
const B = r[
|
|
98
|
-
let ie =
|
|
99
|
-
ie || (ie = [],
|
|
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, F = 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
|
+
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 + F) / 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
|
+
let ie = A.get(fe);
|
|
99
|
+
ie || (ie = [], A.set(fe, ie)), ie.push(k);
|
|
100
100
|
}
|
|
101
|
-
for (let
|
|
102
|
-
const B =
|
|
101
|
+
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 + F) / 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
103
|
let fe = 1 / 0, ie = 0;
|
|
104
|
-
for (let J = 0; J <=
|
|
104
|
+
for (let J = 0; J <= z && fe > 0; J++) {
|
|
105
105
|
for (let Y = -J; Y <= J; Y++) for (let pe = -J; pe <= J; pe++) for (let Z = -J; Z <= J; Z++) {
|
|
106
106
|
if (J > 0 && Math.abs(Y) < J && Math.abs(pe) < J && Math.abs(Z) < J) continue;
|
|
107
107
|
const he = U + Y, me = be + pe, ue = ae + Z;
|
|
108
|
-
if (he < 0 || he >=
|
|
109
|
-
const H =
|
|
108
|
+
if (he < 0 || he >= z || me < 0 || me >= z || ue < 0 || ue >= z) continue;
|
|
109
|
+
const H = A.get(he * z * z + me * z + ue);
|
|
110
110
|
if (H) for (const q of H) {
|
|
111
|
-
const xe = r[q * 3] * o -
|
|
112
|
-
|
|
111
|
+
const xe = r[q * 3] * o - M, Ce = r[q * 3 + 1] * o - f, we = r[q * 3 + 2] * o - m, ne = (B - xe) ** 2 + ($ - Ce) ** 2 + (N - we) ** 2;
|
|
112
|
+
ne < fe && (fe = ne, ie = q);
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
if (fe < 1 / 0) break;
|
|
116
116
|
}
|
|
117
|
-
c[
|
|
117
|
+
c[k * 3] = t[ie * 3], c[k * 3 + 1] = t[ie * 3 + 1], c[k * 3 + 2] = t[ie * 3 + 2];
|
|
118
118
|
}
|
|
119
119
|
e.setAttribute("color", new O.Float32BufferAttribute(c, 3));
|
|
120
120
|
}
|
|
@@ -147,26 +147,26 @@ let __tla = (async () => {
|
|
|
147
147
|
};
|
|
148
148
|
function st(e, r, t, o) {
|
|
149
149
|
if (Qt[e] < Qt[fn]) return;
|
|
150
|
-
const
|
|
151
|
-
|
|
150
|
+
const l = `[${r}]`, s = o !== void 0 ? [
|
|
151
|
+
l,
|
|
152
152
|
t,
|
|
153
153
|
o
|
|
154
154
|
] : [
|
|
155
|
-
|
|
155
|
+
l,
|
|
156
156
|
t
|
|
157
157
|
];
|
|
158
158
|
switch (e) {
|
|
159
159
|
case "debug":
|
|
160
|
-
console.debug(...
|
|
160
|
+
console.debug(...s);
|
|
161
161
|
break;
|
|
162
162
|
case "info":
|
|
163
|
-
console.log(...
|
|
163
|
+
console.log(...s);
|
|
164
164
|
break;
|
|
165
165
|
case "warn":
|
|
166
|
-
console.warn(...
|
|
166
|
+
console.warn(...s);
|
|
167
167
|
break;
|
|
168
168
|
case "error":
|
|
169
|
-
console.error(...
|
|
169
|
+
console.error(...s);
|
|
170
170
|
break;
|
|
171
171
|
}
|
|
172
172
|
un == null ? void 0 : un(e, r, t, o);
|
|
@@ -177,11 +177,11 @@ let __tla = (async () => {
|
|
|
177
177
|
positions: t,
|
|
178
178
|
indices: new Uint32Array(o.array)
|
|
179
179
|
};
|
|
180
|
-
const
|
|
181
|
-
for (let c = 0; c <
|
|
180
|
+
const l = t.length / 3, s = new Uint32Array(l);
|
|
181
|
+
for (let c = 0; c < l; c++) s[c] = c;
|
|
182
182
|
return {
|
|
183
183
|
positions: t,
|
|
184
|
-
indices:
|
|
184
|
+
indices: s
|
|
185
185
|
};
|
|
186
186
|
}
|
|
187
187
|
function pn(e, r) {
|
|
@@ -192,9 +192,9 @@ let __tla = (async () => {
|
|
|
192
192
|
try {
|
|
193
193
|
const o = ro(e);
|
|
194
194
|
t == null ? void 0 : t("Parsing mesh...");
|
|
195
|
-
const
|
|
195
|
+
const s = new dn().parse(e);
|
|
196
196
|
let c = null;
|
|
197
|
-
if (
|
|
197
|
+
if (s.traverse((x) => {
|
|
198
198
|
x.isMesh && !c && (c = x.geometry);
|
|
199
199
|
}), !c) return null;
|
|
200
200
|
const { positions: a, indices: n } = ct(c);
|
|
@@ -203,10 +203,10 @@ let __tla = (async () => {
|
|
|
203
203
|
const h = a.length / 3;
|
|
204
204
|
for (let x = 0; x < Math.min(n.length, 300); x++) if (n[x] >= h) return ce.error("wasm", `Out-of-bounds index: ${n[x]} >= ${h}`), null;
|
|
205
205
|
t == null ? void 0 : t("Processing mesh (WASM)...");
|
|
206
|
-
const
|
|
207
|
-
if (ce.debug("wasm", "preprocess result",
|
|
206
|
+
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
|
+
if (ce.debug("wasm", "preprocess result", f), u.length === 0) return null;
|
|
208
208
|
t == null ? void 0 : t("Building geometry...");
|
|
209
|
-
const m = pn(
|
|
209
|
+
const m = pn(u, p);
|
|
210
210
|
if (o) {
|
|
211
211
|
const x = g ? 1e3 : 1;
|
|
212
212
|
io(m, o.positions, o.colors, x);
|
|
@@ -215,7 +215,7 @@ let __tla = (async () => {
|
|
|
215
215
|
geometry: m,
|
|
216
216
|
wasScaled: g,
|
|
217
217
|
unitConverted: g,
|
|
218
|
-
detectedUnit:
|
|
218
|
+
detectedUnit: M
|
|
219
219
|
};
|
|
220
220
|
} catch (o) {
|
|
221
221
|
return ce.error("wasm", "Processing failed", o), null;
|
|
@@ -224,17 +224,17 @@ let __tla = (async () => {
|
|
|
224
224
|
function lo(e) {
|
|
225
225
|
const t = new dn().parse(e);
|
|
226
226
|
let o = null;
|
|
227
|
-
return t.traverse((
|
|
228
|
-
|
|
227
|
+
return t.traverse((l) => {
|
|
228
|
+
l.isMesh && !o && (o = l.geometry);
|
|
229
229
|
}), o;
|
|
230
230
|
}
|
|
231
231
|
async function Ft(e) {
|
|
232
|
-
const r = await e.arrayBuffer(),
|
|
233
|
-
if (!
|
|
234
|
-
const
|
|
235
|
-
for (let c = 0; c <
|
|
236
|
-
for (let c = 0; c <
|
|
237
|
-
return
|
|
232
|
+
const r = await e.arrayBuffer(), l = new Qn().parse(r).getAttribute("position");
|
|
233
|
+
if (!l || l.count === 0) throw new Error("Empty STL geometry");
|
|
234
|
+
const s = [];
|
|
235
|
+
for (let c = 0; c < l.count; c++) s.push(`v ${l.getX(c)} ${l.getY(c)} ${l.getZ(c)}`);
|
|
236
|
+
for (let c = 0; c < l.count; c += 3) s.push(`f ${c + 1} ${c + 2} ${c + 3}`);
|
|
237
|
+
return s.join(`
|
|
238
238
|
`);
|
|
239
239
|
}
|
|
240
240
|
function ao(e, r) {
|
|
@@ -254,109 +254,109 @@ let __tla = (async () => {
|
|
|
254
254
|
}
|
|
255
255
|
function hn(e, r = 1e-3, t = false) {
|
|
256
256
|
if (!e.length) return [];
|
|
257
|
-
const o = /* @__PURE__ */ new Map(),
|
|
258
|
-
const p = ao(
|
|
257
|
+
const o = /* @__PURE__ */ new Map(), l = (u) => {
|
|
258
|
+
const p = ao(u, r);
|
|
259
259
|
let g = o.get(p);
|
|
260
|
-
return g || (g =
|
|
261
|
-
},
|
|
262
|
-
a:
|
|
263
|
-
b:
|
|
260
|
+
return g || (g = u.clone(), o.set(p, g)), g;
|
|
261
|
+
}, s = e.map((u) => ({
|
|
262
|
+
a: l(u.a),
|
|
263
|
+
b: l(u.b)
|
|
264
264
|
})), c = [];
|
|
265
|
-
for (;
|
|
266
|
-
const
|
|
267
|
-
|
|
268
|
-
|
|
265
|
+
for (; s.length; ) {
|
|
266
|
+
const u = s.pop(), p = [
|
|
267
|
+
u.a,
|
|
268
|
+
u.b
|
|
269
269
|
];
|
|
270
270
|
let g = true;
|
|
271
271
|
for (; g; ) {
|
|
272
272
|
g = false;
|
|
273
|
-
for (let
|
|
274
|
-
const { a: m, b: x } =
|
|
273
|
+
for (let f = s.length - 1; f >= 0; f--) {
|
|
274
|
+
const { a: m, b: x } = s[f];
|
|
275
275
|
if (m.equals(p[p.length - 1])) p.push(x);
|
|
276
276
|
else if (x.equals(p[p.length - 1])) p.push(m);
|
|
277
277
|
else if (m.equals(p[0])) p.unshift(x);
|
|
278
278
|
else if (x.equals(p[0])) p.unshift(m);
|
|
279
279
|
else continue;
|
|
280
|
-
|
|
280
|
+
s.splice(f, 1), g = true;
|
|
281
281
|
}
|
|
282
282
|
}
|
|
283
|
-
const
|
|
284
|
-
|
|
283
|
+
const M = co(p, r);
|
|
284
|
+
M.length > 1 && c.push(M);
|
|
285
285
|
}
|
|
286
286
|
if (!c.length) return [];
|
|
287
287
|
if (t) {
|
|
288
|
-
c.sort((g,
|
|
289
|
-
const
|
|
288
|
+
c.sort((g, M) => Ze(M) - Ze(g));
|
|
289
|
+
const u = Ze(c[0]), p = c.filter((g) => Ze(g) >= u * 0.3);
|
|
290
290
|
return p[p.length - 1] ?? c[0];
|
|
291
291
|
}
|
|
292
|
-
const a = c.filter((
|
|
292
|
+
const a = c.filter((u) => u.length >= 3 && u[0].distanceTo(u[u.length - 1]) < r * 10), n = a.length > 0 ? a : c;
|
|
293
293
|
if (n.length === 1) return n[0];
|
|
294
|
-
let h = n[0],
|
|
295
|
-
for (const
|
|
294
|
+
let h = n[0], d = 1 / 0;
|
|
295
|
+
for (const u of n) {
|
|
296
296
|
let p = 0, g = 0;
|
|
297
|
-
for (const
|
|
298
|
-
p /=
|
|
299
|
-
const
|
|
300
|
-
|
|
297
|
+
for (const f of u) p += f.x, g += f.z;
|
|
298
|
+
p /= u.length, g /= u.length;
|
|
299
|
+
const M = Math.sqrt(p * p + g * g);
|
|
300
|
+
M < d && (d = M, h = u);
|
|
301
301
|
}
|
|
302
302
|
return h;
|
|
303
303
|
}
|
|
304
304
|
function qt(e, r, t, o = false) {
|
|
305
|
-
const
|
|
305
|
+
const l = new dt(new C(0, 1, 0), -t), s = [], c = new an();
|
|
306
306
|
c.setFromBufferAttribute(r.getAttribute("position"));
|
|
307
307
|
const a = {
|
|
308
308
|
linePoints: [],
|
|
309
309
|
lineLength: 0,
|
|
310
|
-
rightmostPoint: new
|
|
310
|
+
rightmostPoint: new C(0, t, 0)
|
|
311
311
|
};
|
|
312
|
-
if (!
|
|
313
|
-
const n = new cn(), h = new
|
|
312
|
+
if (!l.intersectsBox(c)) return a;
|
|
313
|
+
const n = new cn(), h = new C();
|
|
314
314
|
e.shapecast({
|
|
315
|
-
intersectsBounds: (
|
|
316
|
-
intersectsTriangle: (
|
|
315
|
+
intersectsBounds: (f) => l.intersectsBox(f),
|
|
316
|
+
intersectsTriangle: (f) => {
|
|
317
317
|
const m = [];
|
|
318
|
-
n.set(
|
|
318
|
+
n.set(f.a, f.b), l.intersectLine(n, h) && m.push(h.clone()), n.set(f.b, f.c), l.intersectLine(n, h) && m.push(h.clone()), n.set(f.c, f.a), l.intersectLine(n, h) && m.push(h.clone()), m.length === 2 && s.push({
|
|
319
319
|
a: m[0],
|
|
320
320
|
b: m[1]
|
|
321
321
|
});
|
|
322
322
|
}
|
|
323
323
|
});
|
|
324
|
-
const
|
|
325
|
-
if (
|
|
326
|
-
const
|
|
327
|
-
let p = -1 / 0, g = new
|
|
328
|
-
for (const
|
|
329
|
-
const
|
|
324
|
+
const d = hn(s, Pt, o);
|
|
325
|
+
if (d.length < 2) return a;
|
|
326
|
+
const u = Ze(d);
|
|
327
|
+
let p = -1 / 0, g = new C(0, t, 0);
|
|
328
|
+
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]) < Pt * 10;
|
|
330
330
|
return {
|
|
331
|
-
linePoints:
|
|
332
|
-
lineLength:
|
|
331
|
+
linePoints: d,
|
|
332
|
+
lineLength: u,
|
|
333
333
|
rightmostPoint: g,
|
|
334
|
-
isClosed:
|
|
334
|
+
isClosed: M
|
|
335
335
|
};
|
|
336
336
|
}
|
|
337
337
|
function Ne(e, r, t, o = false) {
|
|
338
|
-
const
|
|
339
|
-
if (
|
|
340
|
-
ce.debug("slice", `y=${t.toFixed(2)} failed (pts=${
|
|
341
|
-
let
|
|
338
|
+
const l = qt(e, r, t, o);
|
|
339
|
+
if (l.isClosed && l.linePoints.length >= 3) return l;
|
|
340
|
+
ce.debug("slice", `y=${t.toFixed(2)} failed (pts=${l.linePoints.length}, closed=${l.isClosed}), retrying...`);
|
|
341
|
+
let s = l;
|
|
342
342
|
for (const c of oo) {
|
|
343
343
|
const a = qt(e, r, t + c, o);
|
|
344
344
|
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
|
-
a.linePoints.length >
|
|
345
|
+
a.linePoints.length > s.linePoints.length && (s = a);
|
|
346
346
|
}
|
|
347
|
-
return ce.warn("slice", `y=${t.toFixed(2)} all retries exhausted (pts=${
|
|
347
|
+
return ce.warn("slice", `y=${t.toFixed(2)} all retries exhausted (pts=${s.linePoints.length}, closed=${s.isClosed})`), s;
|
|
348
348
|
}
|
|
349
349
|
function fo(e, r, t, o) {
|
|
350
|
-
const
|
|
351
|
-
if (
|
|
352
|
-
const c = [], a = new cn(), n = new
|
|
350
|
+
const l = new dt().setFromNormalAndCoplanarPoint(o.clone().normalize(), t), s = new an();
|
|
351
|
+
if (s.setFromBufferAttribute(r.getAttribute("position")), !l.intersectsBox(s)) return 0;
|
|
352
|
+
const c = [], a = new cn(), n = new C();
|
|
353
353
|
e.shapecast({
|
|
354
|
-
intersectsBounds: (
|
|
355
|
-
intersectsTriangle: (
|
|
356
|
-
const
|
|
357
|
-
a.set(
|
|
358
|
-
a:
|
|
359
|
-
b:
|
|
354
|
+
intersectsBounds: (d) => l.intersectsBox(d),
|
|
355
|
+
intersectsTriangle: (d) => {
|
|
356
|
+
const u = [];
|
|
357
|
+
a.set(d.a, d.b), l.intersectLine(a, n) && u.push(n.clone()), a.set(d.b, d.c), l.intersectLine(a, n) && u.push(n.clone()), a.set(d.c, d.a), l.intersectLine(a, n) && u.push(n.clone()), u.length === 2 && c.push({
|
|
358
|
+
a: u[0],
|
|
359
|
+
b: u[1]
|
|
360
360
|
});
|
|
361
361
|
}
|
|
362
362
|
});
|
|
@@ -369,10 +369,10 @@ let __tla = (async () => {
|
|
|
369
369
|
});
|
|
370
370
|
}
|
|
371
371
|
function uo(e, r, t, o) {
|
|
372
|
-
const
|
|
373
|
-
if (
|
|
372
|
+
const l = e.getIndex(), s = l ? l.count / 3 : 0;
|
|
373
|
+
if (s < 10) return {
|
|
374
374
|
valid: false,
|
|
375
|
-
reason: `Geometry is empty or degenerate (${
|
|
375
|
+
reason: `Geometry is empty or degenerate (${s} faces)`
|
|
376
376
|
};
|
|
377
377
|
const c = r - t;
|
|
378
378
|
if (c < 4) return {
|
|
@@ -395,19 +395,19 @@ let __tla = (async () => {
|
|
|
395
395
|
valid: true,
|
|
396
396
|
reason: ""
|
|
397
397
|
};
|
|
398
|
-
const
|
|
399
|
-
if (n.lineLength > 0 &&
|
|
400
|
-
const p = n.lineLength /
|
|
398
|
+
const d = Ne(a, e, h);
|
|
399
|
+
if (n.lineLength > 0 && d.lineLength > 0) {
|
|
400
|
+
const p = n.lineLength / d.lineLength;
|
|
401
401
|
if (p < 0.5) return {
|
|
402
402
|
valid: false,
|
|
403
403
|
reason: `First circumference is too small relative to second (ratio ${p.toFixed(2)} < 0.5) \u2014 possible trimmed angle`
|
|
404
404
|
};
|
|
405
405
|
}
|
|
406
|
-
const
|
|
407
|
-
if (
|
|
408
|
-
const p = Ne(a, e,
|
|
409
|
-
if (
|
|
410
|
-
const g =
|
|
406
|
+
const u = r - o * 2;
|
|
407
|
+
if (u > t) {
|
|
408
|
+
const p = Ne(a, e, u);
|
|
409
|
+
if (d.lineLength > 0 && p.lineLength > 0) {
|
|
410
|
+
const g = d.lineLength / p.lineLength;
|
|
411
411
|
if (g < 0.5) return {
|
|
412
412
|
valid: false,
|
|
413
413
|
reason: `Second circumference is too small relative to third (ratio ${g.toFixed(2)} < 0.5) \u2014 possible trimmed angle`
|
|
@@ -422,28 +422,28 @@ let __tla = (async () => {
|
|
|
422
422
|
const Fe = "pipeline";
|
|
423
423
|
function po(e, r, t, o) {
|
|
424
424
|
var _a, _b, _c, _d;
|
|
425
|
-
const
|
|
425
|
+
const l = e.geometry.clone(), s = r.map((a) => ({
|
|
426
426
|
...a
|
|
427
427
|
})), c = o.wasmModule;
|
|
428
428
|
try {
|
|
429
|
-
let a = e.geometry, n =
|
|
430
|
-
const h = n[0],
|
|
429
|
+
let a = e.geometry, n = s.map((H) => new C(H.position.x, H.position.y, H.position.z));
|
|
430
|
+
const h = n[0], d = n[1];
|
|
431
431
|
if (!c) {
|
|
432
432
|
o.onStatus("Aligning mesh (JS fallback)..."), ce.warn(Fe, "WASM not available, using JS fallback alignment");
|
|
433
|
-
const H = new
|
|
433
|
+
const H = new C(0, 1, 0), q = new C().subVectors(d, h).normalize(), xe = q.dot(H), Ce = new C().crossVectors(q, H);
|
|
434
434
|
if (Ce.length() > 1e-4) {
|
|
435
435
|
Ce.normalize();
|
|
436
436
|
const X = new O.Quaternion().setFromAxisAngle(Ce, Math.acos(Math.min(1, Math.max(-1, xe))));
|
|
437
437
|
a.applyMatrix4(new O.Matrix4().makeRotationFromQuaternion(X)), n = n.map((Le) => Le.clone().applyQuaternion(X));
|
|
438
438
|
}
|
|
439
439
|
if (n[0].y > n[1].y) {
|
|
440
|
-
const X = new O.Quaternion().setFromAxisAngle(new
|
|
440
|
+
const X = new O.Quaternion().setFromAxisAngle(new C(1, 0, 0), Math.PI);
|
|
441
441
|
a.applyMatrix4(new O.Matrix4().makeRotationFromQuaternion(X)), n = n.map((Le) => Le.clone().applyQuaternion(X));
|
|
442
442
|
}
|
|
443
443
|
const we = n[0].clone();
|
|
444
|
-
a.translate(-we.x, -we.y, -we.z), n = n.map((X) => new
|
|
445
|
-
const
|
|
446
|
-
n.push(
|
|
444
|
+
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 ne = new C(n[0].x, n[0].y, n[0].z);
|
|
446
|
+
n.push(ne), o.addLandmarkPoint({
|
|
447
447
|
faceIndex: -1,
|
|
448
448
|
vertexIndices: [
|
|
449
449
|
0,
|
|
@@ -451,9 +451,9 @@ let __tla = (async () => {
|
|
|
451
451
|
2
|
|
452
452
|
],
|
|
453
453
|
position: {
|
|
454
|
-
x:
|
|
455
|
-
y:
|
|
456
|
-
z:
|
|
454
|
+
x: ne.x,
|
|
455
|
+
y: ne.y,
|
|
456
|
+
z: ne.z
|
|
457
457
|
},
|
|
458
458
|
barycentricCoords: {
|
|
459
459
|
u: 0.33,
|
|
@@ -465,37 +465,37 @@ let __tla = (async () => {
|
|
|
465
465
|
y: X.y,
|
|
466
466
|
z: X.z
|
|
467
467
|
}))), o.setAligned(true), o.setCut(true), o.setAdjustedStartY(null), o.setAdjustedEndY(null), o.setOriginalEndY(n[1].y + 2 * at);
|
|
468
|
-
const V = new
|
|
469
|
-
a.computeBoundingBox(), a.boundingBox.getSize(V), o.setModelSize(Math.max(V.x, V.y, V.z)),
|
|
468
|
+
const V = new C();
|
|
469
|
+
a.computeBoundingBox(), a.boundingBox.getSize(V), o.setModelSize(Math.max(V.x, V.y, V.z)), l.dispose();
|
|
470
470
|
return;
|
|
471
471
|
}
|
|
472
|
-
const { positions:
|
|
472
|
+
const { positions: u, indices: p } = ct(a), g = new Float32Array([
|
|
473
473
|
h.x,
|
|
474
474
|
h.y,
|
|
475
475
|
h.z
|
|
476
|
-
]),
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
476
|
+
]), M = new Float32Array([
|
|
477
|
+
d.x,
|
|
478
|
+
d.y,
|
|
479
|
+
d.z
|
|
480
480
|
]);
|
|
481
481
|
o.onStatus("Detecting shell type...");
|
|
482
|
-
const
|
|
483
|
-
ce.info(Fe, `Shell: ${m ? "DOUBLE" : "SINGLE"}`,
|
|
482
|
+
const f = c.detect_shell(u, p, M, 40), m = f.is_double_shell(), x = f.surface_normal();
|
|
483
|
+
ce.info(Fe, `Shell: ${m ? "DOUBLE" : "SINGLE"}`, f.details()), (_a = o.setDoubleShell) == null ? void 0 : _a.call(o, m), o.onStatus("Finding cross-section plane...");
|
|
484
484
|
const S = new Float32Array([
|
|
485
485
|
x[0],
|
|
486
486
|
x[1],
|
|
487
487
|
x[2]
|
|
488
|
-
]), I = c.find_min_cross_section(
|
|
488
|
+
]), I = c.find_min_cross_section(u, p, M, S, 10), F = I.plane_normal();
|
|
489
489
|
ce.info(Fe, "Cross-section found", I.details()), o.onStatus("Aligning mesh...");
|
|
490
|
-
const
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
]),
|
|
495
|
-
let
|
|
496
|
-
const w =
|
|
497
|
-
ce.info(Fe, "Alignment complete",
|
|
498
|
-
const
|
|
490
|
+
const P = new Float32Array([
|
|
491
|
+
F[0],
|
|
492
|
+
F[1],
|
|
493
|
+
F[2]
|
|
494
|
+
]), b = c.align_to_origin(u, g, M, P);
|
|
495
|
+
let z = b.positions(), y = b.mpt(), D = b.origin();
|
|
496
|
+
const w = b.transform();
|
|
497
|
+
ce.info(Fe, "Alignment complete", b.details());
|
|
498
|
+
const A = [
|
|
499
499
|
w[3],
|
|
500
500
|
w[4],
|
|
501
501
|
w[5],
|
|
@@ -505,25 +505,25 @@ let __tla = (async () => {
|
|
|
505
505
|
w[9],
|
|
506
506
|
w[10],
|
|
507
507
|
w[11]
|
|
508
|
-
],
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
508
|
+
], k = new Float32Array([
|
|
509
|
+
A[0] * F[0] + A[1] * F[1] + A[2] * F[2],
|
|
510
|
+
A[3] * F[0] + A[4] * F[1] + A[5] * F[2],
|
|
511
|
+
A[6] * F[0] + A[7] * F[1] + A[8] * F[2]
|
|
512
512
|
]);
|
|
513
513
|
o.onStatus("Generating measurement points...");
|
|
514
|
-
const B = c.subdivide_origin_to_plane(new Float32Array(D), new Float32Array(
|
|
514
|
+
const B = c.subdivide_origin_to_plane(new Float32Array(D), new Float32Array(y), k);
|
|
515
515
|
ce.debug(Fe, `Subdivide: ${B.count()} pts, spacing=${B.spacing().toFixed(1)}mm`);
|
|
516
516
|
const $ = B.points(), N = B.count(), U = 2, be = 1, ae = [];
|
|
517
517
|
for (let H = U; H < N - be; H++) ae.push($[H * 3 + 1]);
|
|
518
518
|
o.onStatus("Computing cross-sections...");
|
|
519
519
|
let fe = [];
|
|
520
520
|
if (ae.length >= 2) {
|
|
521
|
-
const q = (m ? c.batch_cross_sections_y_inner.bind(c) : c.batch_cross_sections_y.bind(c))(
|
|
521
|
+
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
522
|
ce.debug(Fe, "Batch (subdivision)", q.details());
|
|
523
523
|
const xe = q.all_loop_points(), Ce = q.offsets(), we = q.circumferences();
|
|
524
|
-
for (let
|
|
525
|
-
const V = Ce[
|
|
526
|
-
if (X <= V || we[
|
|
524
|
+
for (let ne = 0; ne < Ce.length - 1; ne++) {
|
|
525
|
+
const V = Ce[ne], X = Ce[ne + 1];
|
|
526
|
+
if (X <= V || we[ne] <= 0) continue;
|
|
527
527
|
const Le = (X - V) / 3;
|
|
528
528
|
if (Le < 3) continue;
|
|
529
529
|
let Pe = 0, Xe = 0, se = 0;
|
|
@@ -533,12 +533,12 @@ let __tla = (async () => {
|
|
|
533
533
|
}
|
|
534
534
|
if (fe.length >= 6) {
|
|
535
535
|
o.onStatus("Refining alignment...");
|
|
536
|
-
const H = c.refine_alignment(new Float32Array(fe),
|
|
537
|
-
ce.info(Fe, "Refinement complete", H.details()),
|
|
536
|
+
const H = c.refine_alignment(new Float32Array(fe), z, new Float32Array(D), new Float32Array(y));
|
|
537
|
+
ce.info(Fe, "Refinement complete", H.details()), z = H.positions(), y = H.mpt(), D = H.origin();
|
|
538
538
|
}
|
|
539
|
-
const ie = a.getAttribute("color"), J = pn(
|
|
540
|
-
ie && J.setAttribute("color", ie), a.dispose(), a = J, e.geometry = a, a.computeVertexNormals(), a.computeBoundingBox(), n[0] = new
|
|
541
|
-
const Y = new
|
|
539
|
+
const ie = a.getAttribute("color"), J = pn(z, p);
|
|
540
|
+
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
|
+
const Y = new C(n[0].x, n[0].y, n[0].z);
|
|
542
542
|
n.push(Y), o.addLandmarkPoint({
|
|
543
543
|
faceIndex: -1,
|
|
544
544
|
vertexIndices: [
|
|
@@ -561,13 +561,13 @@ let __tla = (async () => {
|
|
|
561
561
|
y: H.y,
|
|
562
562
|
z: H.z
|
|
563
563
|
}))), o.setAligned(true);
|
|
564
|
-
const pe = a.boundingBox, Z = new
|
|
564
|
+
const pe = a.boundingBox, Z = new C();
|
|
565
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 * at), o.onStatus("Computing final measurements...");
|
|
566
566
|
{
|
|
567
567
|
const H = ct(a), q = n[1].y, xe = n[0].y;
|
|
568
568
|
let Ce = 1 / 0, we = -1 / 0;
|
|
569
|
-
const
|
|
570
|
-
for (let se = 1; se <
|
|
569
|
+
const ne = H.positions;
|
|
570
|
+
for (let se = 1; se < ne.length; se += 3) ne[se] < Ce && (Ce = ne[se]), ne[se] > we && (we = ne[se]);
|
|
571
571
|
const V = 25.4, X = [];
|
|
572
572
|
X.push(q);
|
|
573
573
|
for (let se = 1; se <= 2; se++) {
|
|
@@ -590,9 +590,9 @@ let __tla = (async () => {
|
|
|
590
590
|
}
|
|
591
591
|
o.onStatus("Validating results...");
|
|
592
592
|
const he = n[1].y, me = n[0].y, ue = uo(a, he, me, t);
|
|
593
|
-
ue.valid || ce.warn(Fe, `Validation: ${ue.reason}`), o.setClippedReferenceGeometry ? (
|
|
593
|
+
ue.valid || ce.warn(Fe, `Validation: ${ue.reason}`), o.setClippedReferenceGeometry ? (l.computeVertexNormals(), o.setClippedReferenceGeometry(l)) : l.dispose();
|
|
594
594
|
} catch (a) {
|
|
595
|
-
ce.error(Fe, "Processing failed", a), o.setError(a instanceof Error ? a.message : "Failed to process mesh."),
|
|
595
|
+
ce.error(Fe, "Processing failed", a), o.setError(a instanceof Error ? a.message : "Failed to process mesh."), l.dispose();
|
|
596
596
|
}
|
|
597
597
|
}
|
|
598
598
|
class ho extends Xn {
|
|
@@ -614,7 +614,7 @@ let __tla = (async () => {
|
|
|
614
614
|
console.error("[ErrorBoundary] Caught error:", r, t.componentStack);
|
|
615
615
|
}
|
|
616
616
|
render() {
|
|
617
|
-
return this.state.error ? this.props.fallback ? this.props.fallback(this.state.error, this.reset) :
|
|
617
|
+
return this.state.error ? this.props.fallback ? this.props.fallback(this.state.error, this.reset) : L("div", {
|
|
618
618
|
style: {
|
|
619
619
|
display: "flex",
|
|
620
620
|
flexDirection: "column",
|
|
@@ -662,7 +662,7 @@ let __tla = (async () => {
|
|
|
662
662
|
}) : this.props.children;
|
|
663
663
|
}
|
|
664
664
|
}
|
|
665
|
-
const go = ({ message: e, onDismiss: r }) =>
|
|
665
|
+
const go = ({ message: e, onDismiss: r }) => L("div", {
|
|
666
666
|
style: {
|
|
667
667
|
position: "absolute",
|
|
668
668
|
top: 16,
|
|
@@ -679,7 +679,7 @@ let __tla = (async () => {
|
|
|
679
679
|
gap: 12
|
|
680
680
|
},
|
|
681
681
|
children: [
|
|
682
|
-
|
|
682
|
+
L("div", {
|
|
683
683
|
style: {
|
|
684
684
|
flex: 1
|
|
685
685
|
},
|
|
@@ -715,7 +715,7 @@ let __tla = (async () => {
|
|
|
715
715
|
children: "x"
|
|
716
716
|
})
|
|
717
717
|
]
|
|
718
|
-
}), en = ({ message: e }) =>
|
|
718
|
+
}), en = ({ message: e }) => L("div", {
|
|
719
719
|
style: {
|
|
720
720
|
position: "absolute",
|
|
721
721
|
top: 0,
|
|
@@ -754,41 +754,41 @@ let __tla = (async () => {
|
|
|
754
754
|
]
|
|
755
755
|
});
|
|
756
756
|
function mo(e, r, t, o) {
|
|
757
|
-
const
|
|
757
|
+
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
758
|
return {
|
|
759
|
-
u: 1 - g -
|
|
759
|
+
u: 1 - g - M,
|
|
760
760
|
v: g,
|
|
761
|
-
w:
|
|
761
|
+
w: M
|
|
762
762
|
};
|
|
763
763
|
}
|
|
764
|
-
const xo = ({ mesh: e, maxPoints: r = 2, meshColor: t = "#c8c8c8", meshOpacity: o = 1, frontFaceOnly:
|
|
765
|
-
const { addLandmarkPoint: c, landmarkPoints: a } = It(), n =
|
|
764
|
+
const xo = ({ mesh: e, maxPoints: r = 2, meshColor: t = "#c8c8c8", meshOpacity: o = 1, frontFaceOnly: l = false, doubleShellTransparency: s = false }) => {
|
|
765
|
+
const { addLandmarkPoint: c, landmarkPoints: a } = It(), n = oe((g) => {
|
|
766
766
|
if (a.length >= r) return;
|
|
767
767
|
g.stopPropagation();
|
|
768
|
-
const
|
|
769
|
-
if (!
|
|
768
|
+
const M = g.intersections[0], f = M == null ? void 0 : M.faceIndex;
|
|
769
|
+
if (!M || f == null) return;
|
|
770
770
|
const m = e.geometry, x = m.index;
|
|
771
771
|
let S;
|
|
772
772
|
x ? S = [
|
|
773
|
-
x.getX(
|
|
774
|
-
x.getX(
|
|
775
|
-
x.getX(
|
|
773
|
+
x.getX(f * 3),
|
|
774
|
+
x.getX(f * 3 + 1),
|
|
775
|
+
x.getX(f * 3 + 2)
|
|
776
776
|
] : S = [
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
777
|
+
f * 3,
|
|
778
|
+
f * 3 + 1,
|
|
779
|
+
f * 3 + 2
|
|
780
780
|
];
|
|
781
|
-
const I = m.getAttribute("position"),
|
|
782
|
-
|
|
783
|
-
const
|
|
784
|
-
faceIndex:
|
|
781
|
+
const I = m.getAttribute("position"), F = new C().fromBufferAttribute(I, S[0]), P = new C().fromBufferAttribute(I, S[1]), b = new C().fromBufferAttribute(I, S[2]);
|
|
782
|
+
F.applyMatrix4(e.matrixWorld), P.applyMatrix4(e.matrixWorld), b.applyMatrix4(e.matrixWorld);
|
|
783
|
+
const z = M.point, y = mo(z, F, P, b), D = {
|
|
784
|
+
faceIndex: f,
|
|
785
785
|
vertexIndices: S,
|
|
786
786
|
position: {
|
|
787
|
-
x:
|
|
788
|
-
y:
|
|
789
|
-
z:
|
|
787
|
+
x: z.x,
|
|
788
|
+
y: z.y,
|
|
789
|
+
z: z.z
|
|
790
790
|
},
|
|
791
|
-
barycentricCoords:
|
|
791
|
+
barycentricCoords: y
|
|
792
792
|
};
|
|
793
793
|
c(D);
|
|
794
794
|
}, [
|
|
@@ -798,32 +798,32 @@ let __tla = (async () => {
|
|
|
798
798
|
r
|
|
799
799
|
]), h = j(() => !!e.geometry.getAttribute("color"), [
|
|
800
800
|
e
|
|
801
|
-
]),
|
|
801
|
+
]), d = s ? Math.min(o, 0.65) : o, u = d < 1, p = j(() => new O.MeshStandardMaterial({
|
|
802
802
|
color: h ? "#ffffff" : t,
|
|
803
|
-
side:
|
|
803
|
+
side: l ? O.FrontSide : O.DoubleSide,
|
|
804
804
|
roughness: 0.6,
|
|
805
805
|
metalness: 0.1,
|
|
806
|
-
transparent:
|
|
807
|
-
opacity:
|
|
808
|
-
depthWrite: !
|
|
806
|
+
transparent: u,
|
|
807
|
+
opacity: d,
|
|
808
|
+
depthWrite: !s,
|
|
809
809
|
vertexColors: h
|
|
810
810
|
}), [
|
|
811
811
|
t,
|
|
812
|
-
|
|
813
|
-
|
|
812
|
+
d,
|
|
813
|
+
u,
|
|
814
814
|
h,
|
|
815
|
-
|
|
816
|
-
|
|
815
|
+
l,
|
|
816
|
+
s
|
|
817
817
|
]);
|
|
818
818
|
return i("primitive", {
|
|
819
819
|
object: e,
|
|
820
820
|
onClick: n,
|
|
821
821
|
material: p,
|
|
822
|
-
renderOrder:
|
|
822
|
+
renderOrder: s ? 0 : void 0
|
|
823
823
|
});
|
|
824
|
-
}, yo = ({ point: e, index: r, markerSize: t, color: o, label:
|
|
825
|
-
const [
|
|
826
|
-
return
|
|
824
|
+
}, yo = ({ point: e, index: r, markerSize: t, color: o, label: l }) => {
|
|
825
|
+
const [s, c] = E(false);
|
|
826
|
+
return L("mesh", {
|
|
827
827
|
position: [
|
|
828
828
|
e.position.x,
|
|
829
829
|
e.position.y,
|
|
@@ -842,7 +842,7 @@ let __tla = (async () => {
|
|
|
842
842
|
i("meshBasicMaterial", {
|
|
843
843
|
color: o
|
|
844
844
|
}),
|
|
845
|
-
|
|
845
|
+
s && i(Ye, {
|
|
846
846
|
center: true,
|
|
847
847
|
style: {
|
|
848
848
|
pointerEvents: "none"
|
|
@@ -858,13 +858,13 @@ let __tla = (async () => {
|
|
|
858
858
|
whiteSpace: "nowrap",
|
|
859
859
|
transform: "translateY(-24px)"
|
|
860
860
|
},
|
|
861
|
-
children:
|
|
861
|
+
children: l
|
|
862
862
|
})
|
|
863
863
|
})
|
|
864
864
|
]
|
|
865
865
|
}, r);
|
|
866
866
|
}, bo = ({ modelSize: e, labels: r }) => {
|
|
867
|
-
const { landmarkPoints: t } = It(), o = e * 0.02,
|
|
867
|
+
const { landmarkPoints: t } = It(), o = e * 0.02, l = [
|
|
868
868
|
"#44ff44",
|
|
869
869
|
"#ff4444",
|
|
870
870
|
"#4444ff"
|
|
@@ -878,7 +878,7 @@ let __tla = (async () => {
|
|
|
878
878
|
point: a,
|
|
879
879
|
index: n,
|
|
880
880
|
markerSize: o,
|
|
881
|
-
color:
|
|
881
|
+
color: l[n],
|
|
882
882
|
label: c[n]
|
|
883
883
|
}, n))
|
|
884
884
|
});
|
|
@@ -902,16 +902,16 @@ let __tla = (async () => {
|
|
|
902
902
|
const r = Math.min((e - 20) / 20, 1);
|
|
903
903
|
return on.clone().lerp(wo, r);
|
|
904
904
|
}, vo = (e, r) => {
|
|
905
|
-
const t = e.length, o = new Float32Array(t * 2 * 3),
|
|
905
|
+
const t = e.length, o = new Float32Array(t * 2 * 3), l = new Float32Array(t * 2 * 3), s = [];
|
|
906
906
|
for (let n = 0; n < t; n++) {
|
|
907
|
-
const h = e[n],
|
|
908
|
-
if (o[n * 6] = h.x, o[n * 6 + 1] = h.y, o[n * 6 + 2] = h.z,
|
|
909
|
-
const g = n * 2,
|
|
910
|
-
|
|
907
|
+
const h = e[n], d = r[n], u = h.distanceTo(d), p = So(u);
|
|
908
|
+
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
|
+
const g = n * 2, M = g + 1, f = (n + 1) * 2, m = f + 1;
|
|
910
|
+
s.push(g, M, f, M, m, f);
|
|
911
911
|
}
|
|
912
912
|
}
|
|
913
913
|
const c = new O.BufferGeometry();
|
|
914
|
-
c.setAttribute("position", new O.Float32BufferAttribute(o, 3)), c.setAttribute("color", new O.Float32BufferAttribute(
|
|
914
|
+
c.setAttribute("position", new O.Float32BufferAttribute(o, 3)), c.setAttribute("color", new O.Float32BufferAttribute(l, 3)), c.setIndex(s);
|
|
915
915
|
const a = new O.MeshBasicMaterial({
|
|
916
916
|
vertexColors: true,
|
|
917
917
|
transparent: true,
|
|
@@ -921,27 +921,27 @@ let __tla = (async () => {
|
|
|
921
921
|
depthWrite: false
|
|
922
922
|
});
|
|
923
923
|
return new O.Mesh(c, a);
|
|
924
|
-
}, Co = ({ bvh: e, geometry: r, yPosition: t, color: o = "#00ff00", labelX:
|
|
925
|
-
const p = j(() =>
|
|
924
|
+
}, Co = ({ 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 }) => {
|
|
925
|
+
const p = j(() => d && u != null ? null : Ne(e, r, t, a), [
|
|
926
926
|
e,
|
|
927
927
|
r,
|
|
928
928
|
t,
|
|
929
929
|
a,
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
]), g =
|
|
933
|
-
if (n == null ||
|
|
934
|
-
const I = n /
|
|
935
|
-
return g.map((
|
|
930
|
+
d,
|
|
931
|
+
u
|
|
932
|
+
]), g = d ?? (p == null ? void 0 : p.linePoints) ?? [], M = u ?? (p == null ? void 0 : p.lineLength) ?? 0, f = j(() => {
|
|
933
|
+
if (n == null || M <= 0 || g.length < 2) return null;
|
|
934
|
+
const I = n / M, F = g.reduce((b, z) => b + z.x, 0) / g.length, P = g.reduce((b, z) => b + z.z, 0) / g.length;
|
|
935
|
+
return g.map((b) => new C(F + (b.x - F) * I, b.y, P + (b.z - P) * I));
|
|
936
936
|
}, [
|
|
937
937
|
g,
|
|
938
|
-
|
|
938
|
+
M,
|
|
939
939
|
n
|
|
940
|
-
]), m = j(() => !
|
|
940
|
+
]), m = j(() => !f || g.length < 2 ? null : vo(g, f), [
|
|
941
941
|
g,
|
|
942
|
-
|
|
942
|
+
f
|
|
943
943
|
]);
|
|
944
|
-
|
|
944
|
+
re(() => () => {
|
|
945
945
|
m && (m.geometry.dispose(), m.material.dispose());
|
|
946
946
|
}, [
|
|
947
947
|
m
|
|
@@ -949,46 +949,46 @@ let __tla = (async () => {
|
|
|
949
949
|
const x = le(null), S = j(() => {
|
|
950
950
|
const I = new O.BufferGeometry();
|
|
951
951
|
I.setAttribute("position", new O.Float32BufferAttribute(new Float32Array(6), 3));
|
|
952
|
-
const
|
|
952
|
+
const F = new O.LineBasicMaterial({
|
|
953
953
|
color: 6710886,
|
|
954
954
|
depthTest: false,
|
|
955
955
|
depthWrite: false,
|
|
956
956
|
transparent: true
|
|
957
957
|
});
|
|
958
|
-
return new O.Line(I,
|
|
958
|
+
return new O.Line(I, F);
|
|
959
959
|
}, []);
|
|
960
|
-
return
|
|
960
|
+
return re(() => () => {
|
|
961
961
|
S.geometry.dispose(), S.material.dispose();
|
|
962
962
|
}, [
|
|
963
963
|
S
|
|
964
|
-
]),
|
|
965
|
-
|
|
964
|
+
]), re(() => {
|
|
965
|
+
M > 0 && (s == null ? void 0 : s({
|
|
966
966
|
yPosition: t,
|
|
967
|
-
originalValue:
|
|
967
|
+
originalValue: M,
|
|
968
968
|
modifiedValue: null
|
|
969
969
|
}));
|
|
970
970
|
}, [
|
|
971
|
-
|
|
971
|
+
M,
|
|
972
972
|
t,
|
|
973
|
-
|
|
973
|
+
s
|
|
974
974
|
]), rn(({ camera: I }) => {
|
|
975
975
|
if (!x.current || g.length < 2) return;
|
|
976
|
-
const
|
|
977
|
-
I.getWorldDirection(
|
|
978
|
-
const
|
|
979
|
-
if (
|
|
980
|
-
|
|
981
|
-
const
|
|
982
|
-
let
|
|
983
|
-
for (const
|
|
984
|
-
const B =
|
|
985
|
-
B >
|
|
976
|
+
const F = new C();
|
|
977
|
+
I.getWorldDirection(F);
|
|
978
|
+
const P = new C(F.x, 0, F.z);
|
|
979
|
+
if (P.lengthSq() < 1e-8) return;
|
|
980
|
+
P.normalize();
|
|
981
|
+
const b = new C().crossVectors(P, new C(0, 1, 0)).normalize();
|
|
982
|
+
let z = -1 / 0, y = g[0];
|
|
983
|
+
for (const k of g) {
|
|
984
|
+
const B = b.x * k.x + b.z * k.z;
|
|
985
|
+
B > z && (z = B, y = k);
|
|
986
986
|
}
|
|
987
|
-
const D =
|
|
987
|
+
const D = l * 0.35, w = new C(y.x + b.x * D, t, y.z + b.z * D);
|
|
988
988
|
x.current.position.copy(w);
|
|
989
|
-
const
|
|
990
|
-
|
|
991
|
-
}), g.length < 2 ? null :
|
|
989
|
+
const A = S.geometry.getAttribute("position");
|
|
990
|
+
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 : L("group", {
|
|
992
992
|
renderOrder: 10,
|
|
993
993
|
children: [
|
|
994
994
|
i(de, {
|
|
@@ -1004,9 +1004,9 @@ let __tla = (async () => {
|
|
|
1004
1004
|
object: m,
|
|
1005
1005
|
renderOrder: 10
|
|
1006
1006
|
}),
|
|
1007
|
-
|
|
1008
|
-
points:
|
|
1009
|
-
color: tn(
|
|
1007
|
+
f && n != null && i(de, {
|
|
1008
|
+
points: f,
|
|
1009
|
+
color: tn(M, n),
|
|
1010
1010
|
lineWidth: 2.5,
|
|
1011
1011
|
dashed: true,
|
|
1012
1012
|
dashSize: 2,
|
|
@@ -1032,7 +1032,7 @@ let __tla = (async () => {
|
|
|
1032
1032
|
pointerEvents: "none",
|
|
1033
1033
|
transform: "translateY(-50%)"
|
|
1034
1034
|
},
|
|
1035
|
-
children:
|
|
1035
|
+
children: L("div", {
|
|
1036
1036
|
style: {
|
|
1037
1037
|
display: "flex",
|
|
1038
1038
|
alignItems: "stretch",
|
|
@@ -1042,7 +1042,7 @@ let __tla = (async () => {
|
|
|
1042
1042
|
whiteSpace: "nowrap"
|
|
1043
1043
|
},
|
|
1044
1044
|
children: [
|
|
1045
|
-
|
|
1045
|
+
L("div", {
|
|
1046
1046
|
style: {
|
|
1047
1047
|
display: "flex",
|
|
1048
1048
|
alignItems: "center",
|
|
@@ -1060,7 +1060,7 @@ let __tla = (async () => {
|
|
|
1060
1060
|
minWidth: 52,
|
|
1061
1061
|
textAlign: "right"
|
|
1062
1062
|
},
|
|
1063
|
-
children: c === "inch" ? (
|
|
1063
|
+
children: c === "inch" ? (M / 25.4).toFixed(2) : M.toFixed(1)
|
|
1064
1064
|
}),
|
|
1065
1065
|
i("span", {
|
|
1066
1066
|
style: {
|
|
@@ -1072,9 +1072,9 @@ let __tla = (async () => {
|
|
|
1072
1072
|
})
|
|
1073
1073
|
]
|
|
1074
1074
|
}),
|
|
1075
|
-
n != null &&
|
|
1076
|
-
const I =
|
|
1077
|
-
return
|
|
1075
|
+
n != null && M > 0 && (() => {
|
|
1076
|
+
const I = M - n, F = I > 0.5 ? "\u25B2" : I < -0.5 ? "\u25BC" : "", P = tn(M, n);
|
|
1077
|
+
return L("div", {
|
|
1078
1078
|
style: {
|
|
1079
1079
|
display: "flex",
|
|
1080
1080
|
alignItems: "center",
|
|
@@ -1085,18 +1085,18 @@ let __tla = (async () => {
|
|
|
1085
1085
|
borderLeft: "1px solid rgba(255,255,255,0.12)"
|
|
1086
1086
|
},
|
|
1087
1087
|
children: [
|
|
1088
|
-
|
|
1088
|
+
F && i("span", {
|
|
1089
1089
|
style: {
|
|
1090
1090
|
fontSize: 10,
|
|
1091
|
-
color:
|
|
1091
|
+
color: P,
|
|
1092
1092
|
lineHeight: 1
|
|
1093
1093
|
},
|
|
1094
|
-
children:
|
|
1094
|
+
children: F
|
|
1095
1095
|
}),
|
|
1096
|
-
|
|
1096
|
+
L("span", {
|
|
1097
1097
|
style: {
|
|
1098
1098
|
fontSize: 13,
|
|
1099
|
-
color:
|
|
1099
|
+
color: P,
|
|
1100
1100
|
fontFamily: "monospace",
|
|
1101
1101
|
fontWeight: 600
|
|
1102
1102
|
},
|
|
@@ -1105,7 +1105,7 @@ let __tla = (async () => {
|
|
|
1105
1105
|
c === "inch" ? (I / 25.4).toFixed(2) : I.toFixed(1)
|
|
1106
1106
|
]
|
|
1107
1107
|
}),
|
|
1108
|
-
|
|
1108
|
+
L("span", {
|
|
1109
1109
|
style: {
|
|
1110
1110
|
fontSize: 11,
|
|
1111
1111
|
color: "rgba(255,255,255,0.4)",
|
|
@@ -1125,121 +1125,121 @@ let __tla = (async () => {
|
|
|
1125
1125
|
})
|
|
1126
1126
|
]
|
|
1127
1127
|
});
|
|
1128
|
-
}, Mo = Gn(Co), zo = ({ mesh: e, startY: r, endY: t, spacing: o, modelSize:
|
|
1129
|
-
const p = le(/* @__PURE__ */ new Map()), g = e.geometry,
|
|
1130
|
-
if (
|
|
1131
|
-
let
|
|
1132
|
-
...
|
|
1128
|
+
}, Mo = Gn(Co), zo = ({ 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 }) => {
|
|
1129
|
+
const p = le(/* @__PURE__ */ new Map()), g = e.geometry, M = mn(g), f = j(() => {
|
|
1130
|
+
if (u) {
|
|
1131
|
+
let z = [
|
|
1132
|
+
...u.yValues
|
|
1133
1133
|
];
|
|
1134
1134
|
if (o > 25.4 + 0.1) {
|
|
1135
|
-
const
|
|
1136
|
-
|
|
1137
|
-
const w = Math.abs(D -
|
|
1135
|
+
const y = u.mptY;
|
|
1136
|
+
z = z.filter((D) => {
|
|
1137
|
+
const w = Math.abs(D - y);
|
|
1138
1138
|
return w < 0.5 || Math.abs(Math.round(w / o) * o - w) < 0.5;
|
|
1139
1139
|
});
|
|
1140
1140
|
}
|
|
1141
|
-
return c ?
|
|
1141
|
+
return c ? z.sort((y, D) => D - y) : z.sort((y, D) => y - D), z;
|
|
1142
1142
|
}
|
|
1143
|
-
const
|
|
1144
|
-
if (c) for (let
|
|
1145
|
-
else for (let
|
|
1146
|
-
return
|
|
1143
|
+
const P = [];
|
|
1144
|
+
if (c) for (let b = t; b >= r; b -= o) P.push(b);
|
|
1145
|
+
else for (let b = r; b <= t; b += o) P.push(b);
|
|
1146
|
+
return P;
|
|
1147
1147
|
}, [
|
|
1148
1148
|
r,
|
|
1149
1149
|
t,
|
|
1150
1150
|
o,
|
|
1151
1151
|
c,
|
|
1152
|
-
|
|
1152
|
+
u
|
|
1153
1153
|
]), m = j(() => {
|
|
1154
|
-
if (!
|
|
1155
|
-
const
|
|
1156
|
-
for (let D = 0; D <
|
|
1157
|
-
const w =
|
|
1158
|
-
if (
|
|
1159
|
-
const
|
|
1160
|
-
for (let B = w; B <
|
|
1161
|
-
|
|
1154
|
+
if (!u) return null;
|
|
1155
|
+
const P = /* @__PURE__ */ new Map(), { allLoopPoints: b, offsets: z, yValues: y } = u;
|
|
1156
|
+
for (let D = 0; D < z.length - 1; D++) {
|
|
1157
|
+
const w = z[D], A = z[D + 1];
|
|
1158
|
+
if (A <= w) continue;
|
|
1159
|
+
const k = [];
|
|
1160
|
+
for (let B = w; B < A; B += 3) k.push(new C(b[B], b[B + 1], b[B + 2]));
|
|
1161
|
+
k.length >= 3 && P.set(y[D], k);
|
|
1162
1162
|
}
|
|
1163
|
-
return
|
|
1163
|
+
return P;
|
|
1164
1164
|
}, [
|
|
1165
|
-
|
|
1165
|
+
u
|
|
1166
1166
|
]), x = j(() => {
|
|
1167
|
-
if (!
|
|
1168
|
-
const
|
|
1169
|
-
for (let
|
|
1170
|
-
return
|
|
1167
|
+
if (!u) return null;
|
|
1168
|
+
const P = /* @__PURE__ */ new Map();
|
|
1169
|
+
for (let b = 0; b < u.yValues.length; b++) P.set(u.yValues[b], u.circumferences[b]);
|
|
1170
|
+
return P;
|
|
1171
1171
|
}, [
|
|
1172
|
-
|
|
1172
|
+
u
|
|
1173
1173
|
]);
|
|
1174
|
-
|
|
1174
|
+
re(() => {
|
|
1175
1175
|
p.current.clear();
|
|
1176
1176
|
}, [
|
|
1177
|
-
|
|
1178
|
-
]),
|
|
1179
|
-
if (!x || !
|
|
1180
|
-
const
|
|
1181
|
-
yPosition:
|
|
1182
|
-
originalValue: x.get(
|
|
1177
|
+
f
|
|
1178
|
+
]), re(() => {
|
|
1179
|
+
if (!x || !s) return;
|
|
1180
|
+
const P = f.filter((b) => (x.get(b) ?? 0) > 0).map((b) => ({
|
|
1181
|
+
yPosition: b,
|
|
1182
|
+
originalValue: x.get(b) ?? 0,
|
|
1183
1183
|
modifiedValue: null
|
|
1184
1184
|
}));
|
|
1185
|
-
|
|
1185
|
+
s(P);
|
|
1186
1186
|
}, [
|
|
1187
1187
|
x,
|
|
1188
|
-
|
|
1189
|
-
|
|
1188
|
+
f,
|
|
1189
|
+
s
|
|
1190
1190
|
]);
|
|
1191
1191
|
const S = [
|
|
1192
1192
|
"#5B9BD5"
|
|
1193
|
-
], I =
|
|
1193
|
+
], I = l * no, F = oe((P) => {
|
|
1194
1194
|
if (x) return;
|
|
1195
|
-
p.current.set(
|
|
1196
|
-
const
|
|
1197
|
-
|
|
1195
|
+
p.current.set(P.yPosition, P);
|
|
1196
|
+
const b = Array.from(p.current.values()).sort((z, y) => c ? y.yPosition - z.yPosition : z.yPosition - y.yPosition);
|
|
1197
|
+
s == null ? void 0 : s(b);
|
|
1198
1198
|
}, [
|
|
1199
|
-
|
|
1199
|
+
s,
|
|
1200
1200
|
c,
|
|
1201
1201
|
x
|
|
1202
1202
|
]);
|
|
1203
|
-
return
|
|
1204
|
-
children:
|
|
1205
|
-
bvh:
|
|
1203
|
+
return M ? i(Te, {
|
|
1204
|
+
children: f.map((P, b) => i(Mo, {
|
|
1205
|
+
bvh: M,
|
|
1206
1206
|
geometry: g,
|
|
1207
|
-
yPosition:
|
|
1208
|
-
color:
|
|
1207
|
+
yPosition: P,
|
|
1208
|
+
color: d != null && Math.abs(P - d) < o * 0.5 ? "#44ff44" : S[b % S.length],
|
|
1209
1209
|
labelX: I,
|
|
1210
|
-
onDataChange:
|
|
1210
|
+
onDataChange: F,
|
|
1211
1211
|
displayUnit: a,
|
|
1212
1212
|
useInnerSurface: n,
|
|
1213
|
-
formValue: h == null ? void 0 : h[
|
|
1214
|
-
lineWidth:
|
|
1215
|
-
wasmLoopPoints: m == null ? void 0 : m.get(
|
|
1216
|
-
wasmCircumference: x == null ? void 0 : x.get(
|
|
1217
|
-
},
|
|
1213
|
+
formValue: h == null ? void 0 : h[b],
|
|
1214
|
+
lineWidth: d != null && Math.abs(P - d) < o * 0.5 ? 4 : 1.5,
|
|
1215
|
+
wasmLoopPoints: m == null ? void 0 : m.get(P),
|
|
1216
|
+
wasmCircumference: x == null ? void 0 : x.get(P)
|
|
1217
|
+
}, P))
|
|
1218
1218
|
}) : null;
|
|
1219
|
-
}, Ao = ({ mesh: e, greenY: r, modelSize: t, displayUnit: o = "mm", bottomY:
|
|
1219
|
+
}, Ao = ({ mesh: e, greenY: r, modelSize: t, displayUnit: o = "mm", bottomY: l }) => {
|
|
1220
1220
|
var _a;
|
|
1221
|
-
const
|
|
1222
|
-
|
|
1223
|
-
const c =
|
|
1221
|
+
const s = e.geometry;
|
|
1222
|
+
s.computeBoundingBox();
|
|
1223
|
+
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
1224
|
rn(({ camera: S }) => {
|
|
1225
|
-
if (!
|
|
1226
|
-
const I = new
|
|
1225
|
+
if (!d.current) return;
|
|
1226
|
+
const I = new C();
|
|
1227
1227
|
S.getWorldDirection(I);
|
|
1228
|
-
const
|
|
1229
|
-
if (
|
|
1230
|
-
|
|
1231
|
-
const
|
|
1232
|
-
|
|
1233
|
-
const
|
|
1234
|
-
|
|
1228
|
+
const F = new C(I.x, 0, I.z);
|
|
1229
|
+
if (F.lengthSq() < 1e-8) return;
|
|
1230
|
+
F.normalize();
|
|
1231
|
+
const P = new C().crossVectors(new C(0, 1, 0), F).normalize();
|
|
1232
|
+
d.current.position.set(P.x * n, 0, P.z * n);
|
|
1233
|
+
const b = S.position.x - d.current.position.x, z = S.position.z - d.current.position.z;
|
|
1234
|
+
d.current.rotation.y = Math.atan2(b, z);
|
|
1235
1235
|
});
|
|
1236
|
-
const
|
|
1237
|
-
return
|
|
1238
|
-
ref:
|
|
1236
|
+
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 L("group", {
|
|
1238
|
+
ref: d,
|
|
1239
1239
|
children: [
|
|
1240
1240
|
i(de, {
|
|
1241
1241
|
points: [
|
|
1242
|
-
|
|
1242
|
+
u,
|
|
1243
1243
|
p
|
|
1244
1244
|
],
|
|
1245
1245
|
color: "#888888",
|
|
@@ -1247,8 +1247,8 @@ let __tla = (async () => {
|
|
|
1247
1247
|
}),
|
|
1248
1248
|
i(de, {
|
|
1249
1249
|
points: [
|
|
1250
|
-
|
|
1251
|
-
|
|
1250
|
+
M,
|
|
1251
|
+
f
|
|
1252
1252
|
],
|
|
1253
1253
|
color: "#888888",
|
|
1254
1254
|
lineWidth: 1.5
|
|
@@ -1272,7 +1272,7 @@ let __tla = (async () => {
|
|
|
1272
1272
|
0,
|
|
1273
1273
|
0
|
|
1274
1274
|
],
|
|
1275
|
-
children:
|
|
1275
|
+
children: L("div", {
|
|
1276
1276
|
style: {
|
|
1277
1277
|
padding: "4px 8px",
|
|
1278
1278
|
backgroundColor: "rgba(0, 0, 0, 0.7)",
|
|
@@ -1295,92 +1295,92 @@ let __tla = (async () => {
|
|
|
1295
1295
|
})
|
|
1296
1296
|
]
|
|
1297
1297
|
});
|
|
1298
|
-
}, ko = ({ modelSize: e, isAligned: r, isCut: t, mesh: o, viewMode:
|
|
1299
|
-
const { set: h, size:
|
|
1298
|
+
}, ko = ({ modelSize: e, isAligned: r, isCut: t, mesh: o, viewMode: l, sliceY: s, landmarkCount: c = 0, measurementGeometry: a, resetCameraToFrontRef: n }) => {
|
|
1299
|
+
const { set: h, size: d, camera: u, invalidate: p } = sn(), g = le(false), M = le(l), f = le(new C()), m = le(null), x = le(c), S = le(r), I = le(t), F = le(a), P = le(0), b = oe(() => {
|
|
1300
1300
|
if (!o || e <= 0) return null;
|
|
1301
|
-
const
|
|
1302
|
-
|
|
1303
|
-
const D =
|
|
1301
|
+
const y = a ?? o.geometry;
|
|
1302
|
+
y.computeBoundingBox();
|
|
1303
|
+
const D = y.boundingBox, w = new C();
|
|
1304
1304
|
D.getCenter(w);
|
|
1305
|
-
const
|
|
1306
|
-
D.getSize(
|
|
1307
|
-
const
|
|
1308
|
-
|
|
1305
|
+
const A = new C();
|
|
1306
|
+
D.getSize(A), f.current.copy(A);
|
|
1307
|
+
const k = d.width / d.height, B = Math.max(A.y, A.x / k) * 1.6, $ = B * k, N = w.y - A.y * 0.05;
|
|
1308
|
+
P.current = N;
|
|
1309
1309
|
const U = new O.OrthographicCamera(-$ / 2, $ / 2, B / 2, -B / 2, 0.1, e * 10);
|
|
1310
1310
|
return U.position.set(0, N, e * 2), U.lookAt(0, N, 0), U;
|
|
1311
1311
|
}, [
|
|
1312
1312
|
o,
|
|
1313
1313
|
e,
|
|
1314
|
-
|
|
1314
|
+
d,
|
|
1315
1315
|
a
|
|
1316
1316
|
]);
|
|
1317
|
-
|
|
1317
|
+
re(() => {
|
|
1318
1318
|
if (n) return n.current = () => {
|
|
1319
|
-
const
|
|
1320
|
-
|
|
1321
|
-
camera:
|
|
1319
|
+
const y = b();
|
|
1320
|
+
y && (h({
|
|
1321
|
+
camera: y
|
|
1322
1322
|
}), p());
|
|
1323
1323
|
}, () => {
|
|
1324
1324
|
n && (n.current = null);
|
|
1325
1325
|
};
|
|
1326
1326
|
}, [
|
|
1327
1327
|
n,
|
|
1328
|
-
|
|
1328
|
+
b,
|
|
1329
1329
|
h,
|
|
1330
1330
|
p
|
|
1331
1331
|
]);
|
|
1332
|
-
const
|
|
1333
|
-
const D =
|
|
1334
|
-
|
|
1332
|
+
const z = oe((y) => {
|
|
1333
|
+
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
|
+
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
1335
|
}, [
|
|
1336
1336
|
p
|
|
1337
1337
|
]);
|
|
1338
|
-
return
|
|
1338
|
+
return re(() => {
|
|
1339
1339
|
if (e > 0 && !g.current && !r) {
|
|
1340
1340
|
g.current = true;
|
|
1341
|
-
const
|
|
1342
|
-
|
|
1343
|
-
camera:
|
|
1344
|
-
}), requestAnimationFrame(() =>
|
|
1341
|
+
const y = new O.PerspectiveCamera(50, d.width / d.height, 0.1, e * 10);
|
|
1342
|
+
y.position.set(e * 0.3, e * 0.2, e * 1.5), y.lookAt(0, 0, 0), h({
|
|
1343
|
+
camera: y
|
|
1344
|
+
}), requestAnimationFrame(() => z(y));
|
|
1345
1345
|
}
|
|
1346
1346
|
}, [
|
|
1347
1347
|
e,
|
|
1348
|
-
|
|
1348
|
+
d,
|
|
1349
1349
|
h,
|
|
1350
1350
|
r,
|
|
1351
|
-
|
|
1352
|
-
]),
|
|
1353
|
-
const
|
|
1354
|
-
x.current = c,
|
|
1351
|
+
z
|
|
1352
|
+
]), re(() => {
|
|
1353
|
+
const y = x.current;
|
|
1354
|
+
x.current = c, y === 0 && c === 1 && !r && requestAnimationFrame(() => z(u));
|
|
1355
1355
|
}, [
|
|
1356
1356
|
c,
|
|
1357
1357
|
r,
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
]),
|
|
1361
|
-
const
|
|
1362
|
-
if (S.current = r, I.current = t,
|
|
1363
|
-
const
|
|
1364
|
-
|
|
1365
|
-
camera:
|
|
1358
|
+
u,
|
|
1359
|
+
z
|
|
1360
|
+
]), re(() => {
|
|
1361
|
+
const y = S.current !== r, D = I.current !== t, w = !F.current && !!a;
|
|
1362
|
+
if (S.current = r, I.current = t, F.current = a, !y && !D && !w || !r || l !== "3D") return;
|
|
1363
|
+
const A = b();
|
|
1364
|
+
A && h({
|
|
1365
|
+
camera: A
|
|
1366
1366
|
});
|
|
1367
1367
|
}, [
|
|
1368
1368
|
r,
|
|
1369
1369
|
t,
|
|
1370
|
-
|
|
1370
|
+
l,
|
|
1371
1371
|
a,
|
|
1372
|
-
|
|
1372
|
+
b,
|
|
1373
1373
|
h
|
|
1374
|
-
]),
|
|
1375
|
-
if (
|
|
1376
|
-
const
|
|
1377
|
-
if (
|
|
1378
|
-
if (
|
|
1379
|
-
m.current =
|
|
1380
|
-
const D = o.geometry, w = D.getAttribute("position"),
|
|
1374
|
+
]), re(() => {
|
|
1375
|
+
if (M.current === l) return;
|
|
1376
|
+
const y = M.current;
|
|
1377
|
+
if (M.current = l, !(!r || !o || e <= 0)) {
|
|
1378
|
+
if (l === "2D" && s != null) {
|
|
1379
|
+
m.current = u;
|
|
1380
|
+
const D = o.geometry, w = D.getAttribute("position"), A = w.array, k = e * 0.15;
|
|
1381
1381
|
let B = 1 / 0, $ = -1 / 0, N = 1 / 0, U = -1 / 0, be = false;
|
|
1382
|
-
for (let ue = 0; ue < w.count; ue++) if (Math.abs(
|
|
1383
|
-
const H =
|
|
1382
|
+
for (let ue = 0; ue < w.count; ue++) if (Math.abs(A[ue * 3 + 1] - s) < k) {
|
|
1383
|
+
const H = A[ue * 3], q = A[ue * 3 + 2];
|
|
1384
1384
|
H < B && (B = H), H > $ && ($ = H), q < N && (N = q), q > U && (U = q), be = true;
|
|
1385
1385
|
}
|
|
1386
1386
|
if (!be) {
|
|
@@ -1388,42 +1388,42 @@ let __tla = (async () => {
|
|
|
1388
1388
|
const ue = D.boundingBox;
|
|
1389
1389
|
B = ue.min.x, $ = ue.max.x, N = ue.min.z, U = ue.max.z;
|
|
1390
1390
|
}
|
|
1391
|
-
const ae = (B + $) / 2, fe = (N + U) / 2, ie =
|
|
1391
|
+
const ae = (B + $) / 2, fe = (N + U) / 2, ie = d.width / d.height, J = 1.4, Y = ($ - B) * J, pe = (U - N) * J;
|
|
1392
1392
|
let Z, he;
|
|
1393
1393
|
Y / pe > ie ? (Z = Y, he = Y / ie) : (he = pe, Z = pe * ie);
|
|
1394
1394
|
const me = new O.OrthographicCamera(-Z / 2, Z / 2, he / 2, -he / 2, 0.1, e * 10);
|
|
1395
|
-
me.position.set(ae,
|
|
1395
|
+
me.position.set(ae, s + e * 2, fe), me.up.set(0, 0, -1), me.lookAt(ae, s, fe), h({
|
|
1396
1396
|
camera: me
|
|
1397
1397
|
});
|
|
1398
|
-
} else if (
|
|
1398
|
+
} else if (y === "2D") if (m.current) h({
|
|
1399
1399
|
camera: m.current
|
|
1400
1400
|
}), m.current = null;
|
|
1401
1401
|
else {
|
|
1402
|
-
const D =
|
|
1402
|
+
const D = b();
|
|
1403
1403
|
D && h({
|
|
1404
1404
|
camera: D
|
|
1405
1405
|
});
|
|
1406
1406
|
}
|
|
1407
1407
|
}
|
|
1408
1408
|
}, [
|
|
1409
|
+
l,
|
|
1409
1410
|
s,
|
|
1410
|
-
d,
|
|
1411
1411
|
r,
|
|
1412
1412
|
o,
|
|
1413
1413
|
e,
|
|
1414
|
-
|
|
1414
|
+
d,
|
|
1415
1415
|
h,
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
]),
|
|
1419
|
-
if (!r || !
|
|
1420
|
-
const
|
|
1421
|
-
if (
|
|
1422
|
-
if (!o ||
|
|
1423
|
-
const D = o.geometry, w = D.getAttribute("position"),
|
|
1416
|
+
u,
|
|
1417
|
+
b
|
|
1418
|
+
]), re(() => {
|
|
1419
|
+
if (!r || !u || !u.isOrthographicCamera) return;
|
|
1420
|
+
const y = u;
|
|
1421
|
+
if (l === "2D") {
|
|
1422
|
+
if (!o || s == null) return;
|
|
1423
|
+
const D = o.geometry, w = D.getAttribute("position"), A = w.array, k = e * 0.15;
|
|
1424
1424
|
let B = 1 / 0, $ = -1 / 0, N = 1 / 0, U = -1 / 0, be = false;
|
|
1425
|
-
for (let Z = 0; Z < w.count; Z++) if (Math.abs(
|
|
1426
|
-
const he =
|
|
1425
|
+
for (let Z = 0; Z < w.count; Z++) if (Math.abs(A[Z * 3 + 1] - s) < k) {
|
|
1426
|
+
const he = A[Z * 3], me = A[Z * 3 + 2];
|
|
1427
1427
|
he < B && (B = he), he > $ && ($ = he), me < N && (N = me), me > U && (U = me), be = true;
|
|
1428
1428
|
}
|
|
1429
1429
|
if (!be) {
|
|
@@ -1431,27 +1431,27 @@ let __tla = (async () => {
|
|
|
1431
1431
|
const Z = D.boundingBox;
|
|
1432
1432
|
B = Z.min.x, $ = Z.max.x, N = Z.min.z, U = Z.max.z;
|
|
1433
1433
|
}
|
|
1434
|
-
const ae =
|
|
1434
|
+
const ae = d.width / d.height, fe = 1.4, ie = ($ - B) * fe, J = (U - N) * fe;
|
|
1435
1435
|
let Y, pe;
|
|
1436
|
-
ie / J > ae ? (Y = ie, pe = ie / ae) : (pe = J, Y = J * ae),
|
|
1436
|
+
ie / J > ae ? (Y = ie, pe = ie / ae) : (pe = J, Y = J * ae), y.left = -Y / 2, y.right = Y / 2, y.top = pe / 2, y.bottom = -pe / 2;
|
|
1437
1437
|
} else {
|
|
1438
|
-
const D =
|
|
1439
|
-
|
|
1438
|
+
const D = f.current, w = d.width / d.height, A = Math.max(D.y, D.x / w) * 1.6, k = A * w;
|
|
1439
|
+
y.left = -k / 2, y.right = k / 2, y.top = A / 2, y.bottom = -A / 2;
|
|
1440
1440
|
}
|
|
1441
|
-
|
|
1441
|
+
y.updateProjectionMatrix();
|
|
1442
1442
|
}, [
|
|
1443
|
-
|
|
1444
|
-
|
|
1443
|
+
d.width,
|
|
1444
|
+
d.height,
|
|
1445
1445
|
r,
|
|
1446
|
-
|
|
1447
|
-
|
|
1446
|
+
u,
|
|
1447
|
+
l,
|
|
1448
1448
|
o
|
|
1449
1449
|
]), null;
|
|
1450
1450
|
}, Fo = ({ mesh: e, isDragging: r }) => {
|
|
1451
1451
|
var _a;
|
|
1452
1452
|
const t = e.geometry;
|
|
1453
1453
|
t.computeBoundingBox();
|
|
1454
|
-
const o = new
|
|
1454
|
+
const o = new C();
|
|
1455
1455
|
return (_a = t.boundingBox) == null ? void 0 : _a.getCenter(o), i(ln, {
|
|
1456
1456
|
enableDamping: false,
|
|
1457
1457
|
enablePan: false,
|
|
@@ -1466,7 +1466,7 @@ let __tla = (async () => {
|
|
|
1466
1466
|
o.z
|
|
1467
1467
|
]
|
|
1468
1468
|
});
|
|
1469
|
-
}, Lo = ({ wasAutoScaled: e, onDismiss: r }) =>
|
|
1469
|
+
}, Lo = ({ wasAutoScaled: e, onDismiss: r }) => L("div", {
|
|
1470
1470
|
style: {
|
|
1471
1471
|
position: "absolute",
|
|
1472
1472
|
bottom: 16,
|
|
@@ -1507,7 +1507,7 @@ let __tla = (async () => {
|
|
|
1507
1507
|
children: "X"
|
|
1508
1508
|
})
|
|
1509
1509
|
]
|
|
1510
|
-
}), Po = ({ isDoubleShell: e, onDismiss: r }) =>
|
|
1510
|
+
}), Po = ({ isDoubleShell: e, onDismiss: r }) => L("div", {
|
|
1511
1511
|
style: {
|
|
1512
1512
|
position: "absolute",
|
|
1513
1513
|
bottom: 68,
|
|
@@ -1557,14 +1557,14 @@ let __tla = (async () => {
|
|
|
1557
1557
|
padding: "24px 24px",
|
|
1558
1558
|
flexShrink: 0
|
|
1559
1559
|
},
|
|
1560
|
-
children: e.map((o,
|
|
1561
|
-
const
|
|
1562
|
-
return
|
|
1560
|
+
children: e.map((o, l) => {
|
|
1561
|
+
const s = o.number < r, c = o.number === r;
|
|
1562
|
+
return L("div", {
|
|
1563
1563
|
style: {
|
|
1564
1564
|
display: "contents"
|
|
1565
1565
|
},
|
|
1566
1566
|
children: [
|
|
1567
|
-
|
|
1567
|
+
L("div", {
|
|
1568
1568
|
style: {
|
|
1569
1569
|
display: "flex",
|
|
1570
1570
|
alignItems: "center",
|
|
@@ -1579,7 +1579,7 @@ let __tla = (async () => {
|
|
|
1579
1579
|
width: 24,
|
|
1580
1580
|
height: 24,
|
|
1581
1581
|
borderRadius: "50%",
|
|
1582
|
-
backgroundColor:
|
|
1582
|
+
backgroundColor: s || c ? t : "rgba(0, 0, 0, 0.38)",
|
|
1583
1583
|
color: "#fff",
|
|
1584
1584
|
display: "flex",
|
|
1585
1585
|
alignItems: "center",
|
|
@@ -1588,7 +1588,7 @@ let __tla = (async () => {
|
|
|
1588
1588
|
fontFamily: "system-ui, sans-serif",
|
|
1589
1589
|
flexShrink: 0
|
|
1590
1590
|
},
|
|
1591
|
-
children:
|
|
1591
|
+
children: s ? "\u2713" : o.number
|
|
1592
1592
|
}),
|
|
1593
1593
|
i("div", {
|
|
1594
1594
|
style: {
|
|
@@ -1602,7 +1602,7 @@ let __tla = (async () => {
|
|
|
1602
1602
|
})
|
|
1603
1603
|
]
|
|
1604
1604
|
}),
|
|
1605
|
-
|
|
1605
|
+
l < e.length - 1 && i("div", {
|
|
1606
1606
|
style: {
|
|
1607
1607
|
flex: "auto",
|
|
1608
1608
|
borderTop: "1px solid #bdbdbd",
|
|
@@ -1612,7 +1612,7 @@ let __tla = (async () => {
|
|
|
1612
1612
|
]
|
|
1613
1613
|
}, o.number);
|
|
1614
1614
|
})
|
|
1615
|
-
}), _o = ({ mesh: e, upperY: r, originY: t, modelSize: o, meshColor:
|
|
1615
|
+
}), _o = ({ mesh: e, upperY: r, originY: t, modelSize: o, meshColor: l = "#c8c8c8", displayUnit: s = "mm" }) => {
|
|
1616
1616
|
const c = e.geometry, a = j(() => new ft(c, {
|
|
1617
1617
|
maxLeafTris: ut
|
|
1618
1618
|
}), [
|
|
@@ -1621,19 +1621,19 @@ let __tla = (async () => {
|
|
|
1621
1621
|
a,
|
|
1622
1622
|
c,
|
|
1623
1623
|
t
|
|
1624
|
-
]), h = j(() => new dt(new
|
|
1624
|
+
]), h = j(() => new dt(new C(0, -1, 0), r), [
|
|
1625
1625
|
r
|
|
1626
|
-
]), { mlLine:
|
|
1626
|
+
]), { mlLine: d, apLine: u, mlWidth: p, apWidth: g } = j(() => {
|
|
1627
1627
|
let m = null, x = null, S = 0, I = 0;
|
|
1628
1628
|
if (n.linePoints.length >= 2) {
|
|
1629
|
-
let
|
|
1630
|
-
for (const
|
|
1629
|
+
let F = n.linePoints[0], P = n.linePoints[0], b = n.linePoints[0], z = n.linePoints[0];
|
|
1630
|
+
for (const y of n.linePoints) y.x < F.x && (F = y), y.x > P.x && (P = y), y.z < b.z && (b = y), y.z > z.z && (z = y);
|
|
1631
1631
|
m = [
|
|
1632
|
-
new
|
|
1633
|
-
new
|
|
1632
|
+
new C(F.x, t, F.z),
|
|
1633
|
+
new C(P.x, t, P.z)
|
|
1634
1634
|
], x = [
|
|
1635
|
-
new
|
|
1636
|
-
new
|
|
1635
|
+
new C(b.x, t, b.z),
|
|
1636
|
+
new C(z.x, t, z.z)
|
|
1637
1637
|
], S = m[0].distanceTo(m[1]), I = x[0].distanceTo(x[1]);
|
|
1638
1638
|
}
|
|
1639
1639
|
return {
|
|
@@ -1645,13 +1645,13 @@ let __tla = (async () => {
|
|
|
1645
1645
|
}, [
|
|
1646
1646
|
n,
|
|
1647
1647
|
t
|
|
1648
|
-
]),
|
|
1649
|
-
return
|
|
1648
|
+
]), M = (m) => s === "inch" ? (m / 25.4).toFixed(2) : m.toFixed(1), f = s === "inch" ? "in" : "mm";
|
|
1649
|
+
return L(Te, {
|
|
1650
1650
|
children: [
|
|
1651
1651
|
i("mesh", {
|
|
1652
1652
|
geometry: e.geometry,
|
|
1653
1653
|
children: i("meshStandardMaterial", {
|
|
1654
|
-
color:
|
|
1654
|
+
color: l,
|
|
1655
1655
|
side: O.DoubleSide,
|
|
1656
1656
|
transparent: true,
|
|
1657
1657
|
opacity: 0.15,
|
|
@@ -1669,10 +1669,10 @@ let __tla = (async () => {
|
|
|
1669
1669
|
depthWrite: false,
|
|
1670
1670
|
transparent: true
|
|
1671
1671
|
}),
|
|
1672
|
-
|
|
1672
|
+
d && L(Te, {
|
|
1673
1673
|
children: [
|
|
1674
1674
|
i(de, {
|
|
1675
|
-
points:
|
|
1675
|
+
points: d,
|
|
1676
1676
|
color: "#ff8800",
|
|
1677
1677
|
lineWidth: 2,
|
|
1678
1678
|
depthTest: false,
|
|
@@ -1681,9 +1681,9 @@ let __tla = (async () => {
|
|
|
1681
1681
|
}),
|
|
1682
1682
|
i(Ye, {
|
|
1683
1683
|
position: [
|
|
1684
|
-
|
|
1684
|
+
d[0].x,
|
|
1685
1685
|
t,
|
|
1686
|
-
|
|
1686
|
+
d[0].z - o * 0.02
|
|
1687
1687
|
],
|
|
1688
1688
|
center: true,
|
|
1689
1689
|
style: {
|
|
@@ -1696,7 +1696,7 @@ let __tla = (async () => {
|
|
|
1696
1696
|
backgroundColor: "rgba(0,0,0,0.75)",
|
|
1697
1697
|
borderRadius: 3
|
|
1698
1698
|
},
|
|
1699
|
-
children:
|
|
1699
|
+
children: L("span", {
|
|
1700
1700
|
style: {
|
|
1701
1701
|
fontSize: 12,
|
|
1702
1702
|
color: "#ff8800",
|
|
@@ -1704,19 +1704,19 @@ let __tla = (async () => {
|
|
|
1704
1704
|
},
|
|
1705
1705
|
children: [
|
|
1706
1706
|
"ML ",
|
|
1707
|
-
|
|
1707
|
+
M(p),
|
|
1708
1708
|
" ",
|
|
1709
|
-
|
|
1709
|
+
f
|
|
1710
1710
|
]
|
|
1711
1711
|
})
|
|
1712
1712
|
})
|
|
1713
1713
|
})
|
|
1714
1714
|
]
|
|
1715
1715
|
}),
|
|
1716
|
-
|
|
1716
|
+
u && L(Te, {
|
|
1717
1717
|
children: [
|
|
1718
1718
|
i(de, {
|
|
1719
|
-
points:
|
|
1719
|
+
points: u,
|
|
1720
1720
|
color: "#ff00ff",
|
|
1721
1721
|
lineWidth: 2,
|
|
1722
1722
|
depthTest: false,
|
|
@@ -1725,9 +1725,9 @@ let __tla = (async () => {
|
|
|
1725
1725
|
}),
|
|
1726
1726
|
i(Ye, {
|
|
1727
1727
|
position: [
|
|
1728
|
-
Math.max(
|
|
1728
|
+
Math.max(u[0].x, u[1].x) + o * 0.02,
|
|
1729
1729
|
t,
|
|
1730
|
-
|
|
1730
|
+
u[0].z > u[1].z ? u[0].z : u[1].z
|
|
1731
1731
|
],
|
|
1732
1732
|
center: true,
|
|
1733
1733
|
style: {
|
|
@@ -1740,7 +1740,7 @@ let __tla = (async () => {
|
|
|
1740
1740
|
backgroundColor: "rgba(0,0,0,0.75)",
|
|
1741
1741
|
borderRadius: 3
|
|
1742
1742
|
},
|
|
1743
|
-
children:
|
|
1743
|
+
children: L("span", {
|
|
1744
1744
|
style: {
|
|
1745
1745
|
fontSize: 12,
|
|
1746
1746
|
color: "#ff00ff",
|
|
@@ -1748,9 +1748,9 @@ let __tla = (async () => {
|
|
|
1748
1748
|
},
|
|
1749
1749
|
children: [
|
|
1750
1750
|
"AP ",
|
|
1751
|
-
|
|
1751
|
+
M(g),
|
|
1752
1752
|
" ",
|
|
1753
|
-
|
|
1753
|
+
f
|
|
1754
1754
|
]
|
|
1755
1755
|
})
|
|
1756
1756
|
})
|
|
@@ -1759,73 +1759,73 @@ let __tla = (async () => {
|
|
|
1759
1759
|
})
|
|
1760
1760
|
]
|
|
1761
1761
|
});
|
|
1762
|
-
}, Do = ({ mesh: e, yPosition: r, onYChange: t, minY: o, maxY:
|
|
1763
|
-
const [p, g] =
|
|
1762
|
+
}, Do = ({ mesh: e, yPosition: r, onYChange: t, minY: o, maxY: l, modelSize: s, color: c, hoverColor: a, dragColor: n, label: h, onDragStart: d, onDragEnd: u }) => {
|
|
1763
|
+
const [p, g] = E(false), [M, f] = E(false), { camera: m, gl: x } = sn(), S = le(0), I = e.geometry, F = mn(I), P = j(() => F ? Ne(F, I, r) : {
|
|
1764
1764
|
linePoints: [],
|
|
1765
1765
|
lineLength: 0,
|
|
1766
|
-
rightmostPoint: new
|
|
1766
|
+
rightmostPoint: new C()
|
|
1767
1767
|
}, [
|
|
1768
|
-
|
|
1768
|
+
F,
|
|
1769
1769
|
I,
|
|
1770
1770
|
r
|
|
1771
|
-
]),
|
|
1772
|
-
const B = x.domElement.getBoundingClientRect(), $ = (
|
|
1771
|
+
]), b = oe((A, k) => {
|
|
1772
|
+
const B = x.domElement.getBoundingClientRect(), $ = (A - B.left) / B.width * 2 - 1, N = -((k - B.top) / B.height) * 2 + 1, U = new Un();
|
|
1773
1773
|
U.setFromCamera(new O.Vector2($, N), m);
|
|
1774
|
-
const be = new dt(new
|
|
1774
|
+
const be = new dt(new C(0, 0, 1), 0), ae = new C();
|
|
1775
1775
|
return U.ray.intersectPlane(be, ae), ae ? ae.y : r;
|
|
1776
1776
|
}, [
|
|
1777
1777
|
m,
|
|
1778
1778
|
x,
|
|
1779
1779
|
r
|
|
1780
|
-
]),
|
|
1781
|
-
|
|
1780
|
+
]), z = oe((A) => {
|
|
1781
|
+
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
1782
|
}, [
|
|
1783
1783
|
r,
|
|
1784
1784
|
x,
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
]),
|
|
1785
|
+
b,
|
|
1786
|
+
d
|
|
1787
|
+
]), y = oe((A) => {
|
|
1788
1788
|
if (!p) return;
|
|
1789
|
-
let
|
|
1790
|
-
|
|
1789
|
+
let k = b(A.clientX, A.clientY) + S.current;
|
|
1790
|
+
k = Math.max(o, Math.min(l, k)), t(k);
|
|
1791
1791
|
}, [
|
|
1792
1792
|
p,
|
|
1793
|
-
|
|
1793
|
+
b,
|
|
1794
1794
|
t,
|
|
1795
1795
|
o,
|
|
1796
|
-
|
|
1797
|
-
]), D =
|
|
1798
|
-
g(false), x.domElement.style.cursor = "auto",
|
|
1796
|
+
l
|
|
1797
|
+
]), D = oe((A) => {
|
|
1798
|
+
g(false), x.domElement.style.cursor = "auto", A.target.releasePointerCapture(A.pointerId), u == null ? void 0 : u();
|
|
1799
1799
|
}, [
|
|
1800
1800
|
x,
|
|
1801
|
-
|
|
1801
|
+
u
|
|
1802
1802
|
]);
|
|
1803
|
-
if (
|
|
1804
|
-
const w = p ? n :
|
|
1805
|
-
return
|
|
1803
|
+
if (P.linePoints.length < 2) return null;
|
|
1804
|
+
const w = p ? n : M ? a : c;
|
|
1805
|
+
return L("group", {
|
|
1806
1806
|
renderOrder: 10,
|
|
1807
1807
|
children: [
|
|
1808
1808
|
i(de, {
|
|
1809
|
-
points:
|
|
1809
|
+
points: P.linePoints,
|
|
1810
1810
|
color: w,
|
|
1811
|
-
lineWidth: p ? 6 :
|
|
1811
|
+
lineWidth: p ? 6 : M ? 5 : 4,
|
|
1812
1812
|
depthTest: false,
|
|
1813
1813
|
depthWrite: false,
|
|
1814
1814
|
transparent: true,
|
|
1815
1815
|
renderOrder: 10,
|
|
1816
|
-
onPointerDown:
|
|
1817
|
-
onPointerMove:
|
|
1816
|
+
onPointerDown: z,
|
|
1817
|
+
onPointerMove: y,
|
|
1818
1818
|
onPointerUp: D,
|
|
1819
1819
|
onPointerEnter: () => {
|
|
1820
|
-
|
|
1820
|
+
f(true), x.domElement.style.cursor = "ns-resize";
|
|
1821
1821
|
},
|
|
1822
1822
|
onPointerLeave: () => {
|
|
1823
|
-
p || (
|
|
1823
|
+
p || (f(false), x.domElement.style.cursor = "auto");
|
|
1824
1824
|
}
|
|
1825
1825
|
}),
|
|
1826
|
-
(
|
|
1826
|
+
(M || p) && i("mesh", {
|
|
1827
1827
|
position: [
|
|
1828
|
-
|
|
1828
|
+
P.rightmostPoint.x + s * 0.15,
|
|
1829
1829
|
r,
|
|
1830
1830
|
0
|
|
1831
1831
|
],
|
|
@@ -1850,21 +1850,21 @@ let __tla = (async () => {
|
|
|
1850
1850
|
};
|
|
1851
1851
|
function Bo(e, r) {
|
|
1852
1852
|
if (e == null) return {};
|
|
1853
|
-
var t = {}, o = Object.keys(e),
|
|
1854
|
-
for (
|
|
1853
|
+
var t = {}, o = Object.keys(e), l, s;
|
|
1854
|
+
for (s = 0; s < o.length; s++) l = o[s], !(r.indexOf(l) >= 0) && (t[l] = e[l]);
|
|
1855
1855
|
return t;
|
|
1856
1856
|
}
|
|
1857
1857
|
var Ro = [
|
|
1858
1858
|
"color"
|
|
1859
1859
|
], Wo = Zn(function(e, r) {
|
|
1860
|
-
var t = e.color, o = t === void 0 ? "currentColor" : t,
|
|
1860
|
+
var t = e.color, o = t === void 0 ? "currentColor" : t, l = Bo(e, Ro);
|
|
1861
1861
|
return Jt("svg", Object.assign({
|
|
1862
1862
|
width: "15",
|
|
1863
1863
|
height: "15",
|
|
1864
1864
|
viewBox: "0 0 15 15",
|
|
1865
1865
|
fill: "none",
|
|
1866
1866
|
xmlns: "http://www.w3.org/2000/svg"
|
|
1867
|
-
},
|
|
1867
|
+
}, l, {
|
|
1868
1868
|
ref: r
|
|
1869
1869
|
}), Jt("path", {
|
|
1870
1870
|
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",
|
|
@@ -1897,62 +1897,62 @@ let __tla = (async () => {
|
|
|
1897
1897
|
outline: "none",
|
|
1898
1898
|
boxSizing: "border-box",
|
|
1899
1899
|
fontFamily: "system-ui, sans-serif"
|
|
1900
|
-
}, To = ({ amputationType: e, spacingInches: r, scanMeasurements: t, scanFrontalHeight: o, onSave:
|
|
1900
|
+
}, To = ({ amputationType: e, spacingInches: r, scanMeasurements: t, scanFrontalHeight: o, onSave: l, onSkip: s }) => {
|
|
1901
1901
|
const c = e === "AK" ? "IT" : "MPT", a = r, n = e === "AK" ? 18 : 9, h = j(() => {
|
|
1902
1902
|
const w = [];
|
|
1903
|
-
for (let
|
|
1903
|
+
for (let A = 2; A >= 1; A -= a) w.push(`${A}\u2033 above ${c}`);
|
|
1904
1904
|
w.push(`At ${c}`);
|
|
1905
|
-
for (let
|
|
1905
|
+
for (let A = a; A <= n; A += a) w.push(`${A}\u2033 below ${c}`);
|
|
1906
1906
|
return w;
|
|
1907
1907
|
}, [
|
|
1908
1908
|
a,
|
|
1909
1909
|
c,
|
|
1910
1910
|
n
|
|
1911
|
-
]), [
|
|
1912
|
-
const w = p !== "" && !isNaN(parseFloat(p)),
|
|
1913
|
-
const B =
|
|
1911
|
+
]), [d, u] = E({}), [p, g] = E(""), [M, f] = E(false), [m, x] = E(false), [S, I] = E(null), [F, P] = E(""), b = j(() => {
|
|
1912
|
+
const w = p !== "" && !isNaN(parseFloat(p)), A = h.some((k) => {
|
|
1913
|
+
const B = d[k];
|
|
1914
1914
|
return B != null && B !== "" && !isNaN(parseFloat(B));
|
|
1915
1915
|
});
|
|
1916
|
-
return w ||
|
|
1916
|
+
return w || A;
|
|
1917
1917
|
}, [
|
|
1918
|
-
|
|
1918
|
+
d,
|
|
1919
1919
|
p,
|
|
1920
1920
|
h
|
|
1921
|
-
]),
|
|
1922
|
-
if (!
|
|
1923
|
-
const w = h.map((
|
|
1924
|
-
const B =
|
|
1921
|
+
]), z = oe(() => {
|
|
1922
|
+
if (!b) return;
|
|
1923
|
+
const w = h.map((k) => {
|
|
1924
|
+
const B = d[k];
|
|
1925
1925
|
return B != null && B !== "" && !isNaN(parseFloat(B)) ? parseFloat(B) : 0;
|
|
1926
|
-
}),
|
|
1927
|
-
|
|
1926
|
+
}), A = p !== "" && !isNaN(parseFloat(p)) ? parseFloat(p) : 0;
|
|
1927
|
+
l({
|
|
1928
1928
|
circumferences: w,
|
|
1929
|
-
frontalHeight:
|
|
1929
|
+
frontalHeight: A
|
|
1930
1930
|
});
|
|
1931
1931
|
}, [
|
|
1932
|
-
|
|
1932
|
+
b,
|
|
1933
1933
|
h,
|
|
1934
|
-
|
|
1934
|
+
d,
|
|
1935
1935
|
p,
|
|
1936
|
-
|
|
1937
|
-
]),
|
|
1936
|
+
l
|
|
1937
|
+
]), y = oe(() => {
|
|
1938
1938
|
const w = {};
|
|
1939
|
-
h.forEach((
|
|
1940
|
-
const B = t[
|
|
1939
|
+
h.forEach((A, k) => {
|
|
1940
|
+
const B = t[k];
|
|
1941
1941
|
if (B) {
|
|
1942
1942
|
const $ = B.modifiedValue ?? B.originalValue;
|
|
1943
|
-
w[
|
|
1943
|
+
w[A] = $.toFixed(1);
|
|
1944
1944
|
}
|
|
1945
|
-
}),
|
|
1945
|
+
}), u(w), o > 0 && g(o.toFixed(1));
|
|
1946
1946
|
}, [
|
|
1947
1947
|
h,
|
|
1948
1948
|
t,
|
|
1949
1949
|
o
|
|
1950
|
-
]), D =
|
|
1951
|
-
|
|
1950
|
+
]), D = oe(() => {
|
|
1951
|
+
f(false), x(true);
|
|
1952
1952
|
}, []);
|
|
1953
1953
|
if (m) {
|
|
1954
|
-
const w = S != null && (S !== "Other" ||
|
|
1955
|
-
w &&
|
|
1954
|
+
const w = S != null && (S !== "Other" || F.trim() !== ""), A = () => {
|
|
1955
|
+
w && s(S === "Other" ? `Other: ${F.trim()}` : S);
|
|
1956
1956
|
};
|
|
1957
1957
|
return i("div", {
|
|
1958
1958
|
style: {
|
|
@@ -1967,7 +1967,7 @@ let __tla = (async () => {
|
|
|
1967
1967
|
zIndex: 9999,
|
|
1968
1968
|
fontFamily: "system-ui, sans-serif"
|
|
1969
1969
|
},
|
|
1970
|
-
children:
|
|
1970
|
+
children: L("div", {
|
|
1971
1971
|
style: {
|
|
1972
1972
|
backgroundColor: "#fff",
|
|
1973
1973
|
borderRadius: 12,
|
|
@@ -1975,7 +1975,7 @@ let __tla = (async () => {
|
|
|
1975
1975
|
boxShadow: "0 24px 38px 3px rgba(0,0,0,0.14)"
|
|
1976
1976
|
},
|
|
1977
1977
|
children: [
|
|
1978
|
-
|
|
1978
|
+
L("div", {
|
|
1979
1979
|
style: {
|
|
1980
1980
|
padding: "24px 24px 0"
|
|
1981
1981
|
},
|
|
@@ -1998,7 +1998,7 @@ let __tla = (async () => {
|
|
|
1998
1998
|
})
|
|
1999
1999
|
]
|
|
2000
2000
|
}),
|
|
2001
|
-
|
|
2001
|
+
L("div", {
|
|
2002
2002
|
style: {
|
|
2003
2003
|
padding: "20px 24px",
|
|
2004
2004
|
display: "flex",
|
|
@@ -2009,7 +2009,7 @@ let __tla = (async () => {
|
|
|
2009
2009
|
[
|
|
2010
2010
|
...Eo,
|
|
2011
2011
|
"Other"
|
|
2012
|
-
].map((
|
|
2012
|
+
].map((k) => L("label", {
|
|
2013
2013
|
style: {
|
|
2014
2014
|
display: "flex",
|
|
2015
2015
|
alignItems: "center",
|
|
@@ -2017,15 +2017,15 @@ let __tla = (async () => {
|
|
|
2017
2017
|
padding: "10px 12px",
|
|
2018
2018
|
borderRadius: 6,
|
|
2019
2019
|
cursor: "pointer",
|
|
2020
|
-
backgroundColor: S ===
|
|
2020
|
+
backgroundColor: S === k ? "rgba(12, 67, 173, 0.06)" : "transparent"
|
|
2021
2021
|
},
|
|
2022
2022
|
children: [
|
|
2023
2023
|
i("input", {
|
|
2024
2024
|
type: "radio",
|
|
2025
2025
|
name: "skip-reason",
|
|
2026
|
-
checked: S ===
|
|
2026
|
+
checked: S === k,
|
|
2027
2027
|
onChange: () => {
|
|
2028
|
-
I(
|
|
2028
|
+
I(k), k !== "Other" && P("");
|
|
2029
2029
|
},
|
|
2030
2030
|
style: {
|
|
2031
2031
|
accentColor: "rgb(12, 67, 173)",
|
|
@@ -2040,18 +2040,18 @@ let __tla = (async () => {
|
|
|
2040
2040
|
fontSize: 14,
|
|
2041
2041
|
color: "#333"
|
|
2042
2042
|
},
|
|
2043
|
-
children:
|
|
2043
|
+
children: k
|
|
2044
2044
|
})
|
|
2045
2045
|
]
|
|
2046
|
-
},
|
|
2046
|
+
}, k)),
|
|
2047
2047
|
S === "Other" && i("input", {
|
|
2048
2048
|
autoFocus: true,
|
|
2049
2049
|
type: "text",
|
|
2050
2050
|
placeholder: "Please describe...",
|
|
2051
|
-
value:
|
|
2052
|
-
onChange: (
|
|
2053
|
-
onKeyDown: (
|
|
2054
|
-
|
|
2051
|
+
value: F,
|
|
2052
|
+
onChange: (k) => P(k.target.value),
|
|
2053
|
+
onKeyDown: (k) => {
|
|
2054
|
+
k.key === "Enter" && A();
|
|
2055
2055
|
},
|
|
2056
2056
|
style: {
|
|
2057
2057
|
...Lt,
|
|
@@ -2063,7 +2063,7 @@ let __tla = (async () => {
|
|
|
2063
2063
|
})
|
|
2064
2064
|
]
|
|
2065
2065
|
}),
|
|
2066
|
-
|
|
2066
|
+
L("div", {
|
|
2067
2067
|
style: {
|
|
2068
2068
|
display: "flex",
|
|
2069
2069
|
justifyContent: "flex-end",
|
|
@@ -2074,7 +2074,7 @@ let __tla = (async () => {
|
|
|
2074
2074
|
children: [
|
|
2075
2075
|
i("button", {
|
|
2076
2076
|
onClick: () => {
|
|
2077
|
-
x(false), I(null),
|
|
2077
|
+
x(false), I(null), P("");
|
|
2078
2078
|
},
|
|
2079
2079
|
style: {
|
|
2080
2080
|
...je,
|
|
@@ -2085,7 +2085,7 @@ let __tla = (async () => {
|
|
|
2085
2085
|
children: "Cancel"
|
|
2086
2086
|
}),
|
|
2087
2087
|
i("button", {
|
|
2088
|
-
onClick:
|
|
2088
|
+
onClick: A,
|
|
2089
2089
|
disabled: !w,
|
|
2090
2090
|
style: {
|
|
2091
2091
|
...je,
|
|
@@ -2102,7 +2102,7 @@ let __tla = (async () => {
|
|
|
2102
2102
|
})
|
|
2103
2103
|
});
|
|
2104
2104
|
}
|
|
2105
|
-
return
|
|
2105
|
+
return M ? i("div", {
|
|
2106
2106
|
style: {
|
|
2107
2107
|
position: "fixed",
|
|
2108
2108
|
inset: 0,
|
|
@@ -2115,7 +2115,7 @@ let __tla = (async () => {
|
|
|
2115
2115
|
zIndex: 9999,
|
|
2116
2116
|
fontFamily: "system-ui, sans-serif"
|
|
2117
2117
|
},
|
|
2118
|
-
children:
|
|
2118
|
+
children: L("div", {
|
|
2119
2119
|
style: {
|
|
2120
2120
|
backgroundColor: "#fff",
|
|
2121
2121
|
borderRadius: 8,
|
|
@@ -2141,7 +2141,7 @@ let __tla = (async () => {
|
|
|
2141
2141
|
},
|
|
2142
2142
|
children: "Your measurements will be submitted without comparing to the scan. Are you sure?"
|
|
2143
2143
|
}),
|
|
2144
|
-
|
|
2144
|
+
L("div", {
|
|
2145
2145
|
style: {
|
|
2146
2146
|
display: "flex",
|
|
2147
2147
|
justifyContent: "flex-end",
|
|
@@ -2149,7 +2149,7 @@ let __tla = (async () => {
|
|
|
2149
2149
|
},
|
|
2150
2150
|
children: [
|
|
2151
2151
|
i("button", {
|
|
2152
|
-
onClick: () =>
|
|
2152
|
+
onClick: () => f(false),
|
|
2153
2153
|
style: {
|
|
2154
2154
|
...je,
|
|
2155
2155
|
backgroundColor: "#fff",
|
|
@@ -2172,7 +2172,7 @@ let __tla = (async () => {
|
|
|
2172
2172
|
})
|
|
2173
2173
|
]
|
|
2174
2174
|
})
|
|
2175
|
-
}) :
|
|
2175
|
+
}) : L("div", {
|
|
2176
2176
|
style: {
|
|
2177
2177
|
position: "fixed",
|
|
2178
2178
|
inset: 0,
|
|
@@ -2190,7 +2190,7 @@ let __tla = (async () => {
|
|
|
2190
2190
|
borderBottom: "1px solid #e0e0e0",
|
|
2191
2191
|
flexShrink: 0
|
|
2192
2192
|
},
|
|
2193
|
-
children:
|
|
2193
|
+
children: L("div", {
|
|
2194
2194
|
style: {
|
|
2195
2195
|
display: "flex",
|
|
2196
2196
|
alignItems: "center",
|
|
@@ -2199,9 +2199,9 @@ let __tla = (async () => {
|
|
|
2199
2199
|
gap: 12
|
|
2200
2200
|
},
|
|
2201
2201
|
children: [
|
|
2202
|
-
|
|
2202
|
+
L("div", {
|
|
2203
2203
|
children: [
|
|
2204
|
-
|
|
2204
|
+
L("div", {
|
|
2205
2205
|
style: {
|
|
2206
2206
|
fontSize: 22,
|
|
2207
2207
|
fontWeight: 600,
|
|
@@ -2212,7 +2212,7 @@ let __tla = (async () => {
|
|
|
2212
2212
|
" Measurements"
|
|
2213
2213
|
]
|
|
2214
2214
|
}),
|
|
2215
|
-
|
|
2215
|
+
L("div", {
|
|
2216
2216
|
style: {
|
|
2217
2217
|
fontSize: 13,
|
|
2218
2218
|
color: "rgba(0,0,0,0.54)",
|
|
@@ -2228,7 +2228,7 @@ let __tla = (async () => {
|
|
|
2228
2228
|
]
|
|
2229
2229
|
}),
|
|
2230
2230
|
i("button", {
|
|
2231
|
-
onClick:
|
|
2231
|
+
onClick: y,
|
|
2232
2232
|
style: {
|
|
2233
2233
|
...je,
|
|
2234
2234
|
backgroundColor: "#fff",
|
|
@@ -2238,7 +2238,7 @@ let __tla = (async () => {
|
|
|
2238
2238
|
padding: "6px 16px",
|
|
2239
2239
|
fontSize: 13
|
|
2240
2240
|
},
|
|
2241
|
-
children:
|
|
2241
|
+
children: L("span", {
|
|
2242
2242
|
style: {
|
|
2243
2243
|
marginRight: 8,
|
|
2244
2244
|
display: "flex",
|
|
@@ -2259,7 +2259,7 @@ let __tla = (async () => {
|
|
|
2259
2259
|
]
|
|
2260
2260
|
})
|
|
2261
2261
|
}),
|
|
2262
|
-
|
|
2262
|
+
L("div", {
|
|
2263
2263
|
style: {
|
|
2264
2264
|
flex: 1,
|
|
2265
2265
|
minHeight: 0,
|
|
@@ -2284,9 +2284,9 @@ let __tla = (async () => {
|
|
|
2284
2284
|
gap: "12px 20px",
|
|
2285
2285
|
marginBottom: 28
|
|
2286
2286
|
},
|
|
2287
|
-
children: h.map((w,
|
|
2287
|
+
children: h.map((w, A) => L("div", {
|
|
2288
2288
|
children: [
|
|
2289
|
-
|
|
2289
|
+
L("label", {
|
|
2290
2290
|
style: {
|
|
2291
2291
|
display: "block",
|
|
2292
2292
|
fontSize: 12,
|
|
@@ -2308,21 +2308,21 @@ let __tla = (async () => {
|
|
|
2308
2308
|
i("input", {
|
|
2309
2309
|
type: "number",
|
|
2310
2310
|
step: "0.1",
|
|
2311
|
-
value:
|
|
2312
|
-
onChange: (
|
|
2311
|
+
value: d[w] ?? "",
|
|
2312
|
+
onChange: (k) => u((B) => ({
|
|
2313
2313
|
...B,
|
|
2314
|
-
[w]:
|
|
2314
|
+
[w]: k.target.value
|
|
2315
2315
|
})),
|
|
2316
2316
|
style: {
|
|
2317
2317
|
...Lt,
|
|
2318
2318
|
padding: "8px 10px",
|
|
2319
2319
|
fontSize: 14,
|
|
2320
|
-
borderColor:
|
|
2320
|
+
borderColor: d[w] ? "rgb(12, 67, 173)" : "#ccc"
|
|
2321
2321
|
},
|
|
2322
2322
|
placeholder: "0.0"
|
|
2323
2323
|
})
|
|
2324
2324
|
]
|
|
2325
|
-
},
|
|
2325
|
+
}, A))
|
|
2326
2326
|
}),
|
|
2327
2327
|
i("div", {
|
|
2328
2328
|
style: {
|
|
@@ -2339,9 +2339,9 @@ let __tla = (async () => {
|
|
|
2339
2339
|
gridTemplateColumns: "repeat(auto-fill, minmax(180px, 1fr))",
|
|
2340
2340
|
gap: "12px 20px"
|
|
2341
2341
|
},
|
|
2342
|
-
children:
|
|
2342
|
+
children: L("div", {
|
|
2343
2343
|
children: [
|
|
2344
|
-
|
|
2344
|
+
L("label", {
|
|
2345
2345
|
style: {
|
|
2346
2346
|
display: "block",
|
|
2347
2347
|
fontSize: 12,
|
|
@@ -2377,7 +2377,7 @@ let __tla = (async () => {
|
|
|
2377
2377
|
})
|
|
2378
2378
|
]
|
|
2379
2379
|
}),
|
|
2380
|
-
|
|
2380
|
+
L("div", {
|
|
2381
2381
|
style: {
|
|
2382
2382
|
padding: "12px 24px",
|
|
2383
2383
|
backgroundColor: "#fff",
|
|
@@ -2391,7 +2391,7 @@ let __tla = (async () => {
|
|
|
2391
2391
|
},
|
|
2392
2392
|
children: [
|
|
2393
2393
|
i("button", {
|
|
2394
|
-
onClick: () =>
|
|
2394
|
+
onClick: () => f(true),
|
|
2395
2395
|
style: {
|
|
2396
2396
|
...je,
|
|
2397
2397
|
backgroundColor: "#fff",
|
|
@@ -2403,14 +2403,14 @@ let __tla = (async () => {
|
|
|
2403
2403
|
children: "Have Galileo Check My Measurements"
|
|
2404
2404
|
}),
|
|
2405
2405
|
i("button", {
|
|
2406
|
-
onClick:
|
|
2407
|
-
disabled: !
|
|
2406
|
+
onClick: z,
|
|
2407
|
+
disabled: !b,
|
|
2408
2408
|
style: {
|
|
2409
2409
|
...je,
|
|
2410
|
-
backgroundColor:
|
|
2410
|
+
backgroundColor: b ? "rgb(12, 67, 173)" : "#e0e0e0",
|
|
2411
2411
|
border: "none",
|
|
2412
|
-
color:
|
|
2413
|
-
cursor:
|
|
2412
|
+
color: b ? "#fff" : "#9e9e9e",
|
|
2413
|
+
cursor: b ? "pointer" : "not-allowed",
|
|
2414
2414
|
padding: "6px 16px",
|
|
2415
2415
|
fontSize: 13
|
|
2416
2416
|
},
|
|
@@ -2422,34 +2422,34 @@ let __tla = (async () => {
|
|
|
2422
2422
|
});
|
|
2423
2423
|
};
|
|
2424
2424
|
function xn(e, r, t) {
|
|
2425
|
-
const o = e.getAttribute("position"),
|
|
2426
|
-
if (
|
|
2427
|
-
const
|
|
2428
|
-
for (let m = 0; m <
|
|
2425
|
+
const o = e.getAttribute("position"), l = t - r;
|
|
2426
|
+
if (l < 1) return null;
|
|
2427
|
+
const s = 30, c = l / s, a = [];
|
|
2428
|
+
for (let m = 0; m < s; m++) {
|
|
2429
2429
|
const x = r + m * c, S = r + (m + 1) * c;
|
|
2430
|
-
let I = 0,
|
|
2431
|
-
for (let
|
|
2432
|
-
const
|
|
2433
|
-
|
|
2430
|
+
let I = 0, F = 0, P = 0, b = 0;
|
|
2431
|
+
for (let z = 0; z < o.count; z++) {
|
|
2432
|
+
const y = o.getY(z);
|
|
2433
|
+
y >= x && y < S && (I += o.getX(z), F += y, P += o.getZ(z), b++);
|
|
2434
2434
|
}
|
|
2435
|
-
|
|
2435
|
+
b > 20 && a.push(new C(I / b, F / b, P / b));
|
|
2436
2436
|
}
|
|
2437
2437
|
if (a.length < 5) return null;
|
|
2438
|
-
const n = new
|
|
2438
|
+
const n = new C();
|
|
2439
2439
|
for (const m of a) n.add(m);
|
|
2440
2440
|
n.divideScalar(a.length);
|
|
2441
|
-
let h = 0,
|
|
2441
|
+
let h = 0, d = 0, u = 0, p = 0, g = 0, M = 0;
|
|
2442
2442
|
for (const m of a) {
|
|
2443
2443
|
const x = m.x - n.x, S = m.y - n.y, I = m.z - n.z;
|
|
2444
|
-
h += x * x,
|
|
2444
|
+
h += x * x, d += x * S, u += x * I, p += S * S, g += S * I, M += I * I;
|
|
2445
2445
|
}
|
|
2446
|
-
let
|
|
2446
|
+
let f = new C(0.01, 1, 0.01).normalize();
|
|
2447
2447
|
for (let m = 0; m < 30; m++) {
|
|
2448
|
-
const x = h *
|
|
2449
|
-
if (
|
|
2450
|
-
|
|
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, F = new C(x, S, I), P = F.length();
|
|
2449
|
+
if (P < 1e-10 || (F.divideScalar(P), f.distanceTo(F) < 1e-8)) break;
|
|
2450
|
+
f = F;
|
|
2451
2451
|
}
|
|
2452
|
-
return
|
|
2452
|
+
return f.y < 0 && f.negate(), f;
|
|
2453
2453
|
}
|
|
2454
2454
|
const Oo = {
|
|
2455
2455
|
pcaAxes: true,
|
|
@@ -2467,23 +2467,23 @@ let __tla = (async () => {
|
|
|
2467
2467
|
"#4488ff"
|
|
2468
2468
|
];
|
|
2469
2469
|
function yn(e) {
|
|
2470
|
-
const r = e.getAttribute("position"), t = r.count, o = new
|
|
2471
|
-
for (let
|
|
2470
|
+
const r = e.getAttribute("position"), t = r.count, o = new C();
|
|
2471
|
+
for (let f = 0; f < t; f++) o.x += r.getX(f), o.y += r.getY(f), o.z += r.getZ(f);
|
|
2472
2472
|
o.divideScalar(t);
|
|
2473
|
-
let
|
|
2474
|
-
for (let
|
|
2475
|
-
const m = r.getX(
|
|
2476
|
-
|
|
2473
|
+
let l = 0, s = 0, c = 0, a = 0, n = 0, h = 0;
|
|
2474
|
+
for (let f = 0; f < t; f++) {
|
|
2475
|
+
const m = r.getX(f) - o.x, x = r.getY(f) - o.y, S = r.getZ(f) - o.z;
|
|
2476
|
+
l += m * m, s += m * x, c += m * S, a += x * x, n += x * S, h += S * S;
|
|
2477
2477
|
}
|
|
2478
|
-
|
|
2479
|
-
const
|
|
2478
|
+
l /= t, s /= t, c /= t, a /= t, n /= t, h /= t;
|
|
2479
|
+
const d = [], u = [], p = [
|
|
2480
2480
|
[
|
|
2481
|
+
l,
|
|
2481
2482
|
s,
|
|
2482
|
-
d,
|
|
2483
2483
|
c
|
|
2484
2484
|
],
|
|
2485
2485
|
[
|
|
2486
|
-
|
|
2486
|
+
s,
|
|
2487
2487
|
a,
|
|
2488
2488
|
n
|
|
2489
2489
|
],
|
|
@@ -2493,62 +2493,62 @@ let __tla = (async () => {
|
|
|
2493
2493
|
h
|
|
2494
2494
|
]
|
|
2495
2495
|
];
|
|
2496
|
-
for (let
|
|
2497
|
-
let m = new
|
|
2496
|
+
for (let f = 0; f < 3; f++) {
|
|
2497
|
+
let m = new C(1 + f * 0.1, 1 - f * 0.1, 0.5 + f * 0.3).normalize(), x = 0;
|
|
2498
2498
|
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,
|
|
2500
|
-
if (x =
|
|
2501
|
-
if (
|
|
2502
|
-
m =
|
|
2499
|
+
const I = p[0][0] * m.x + p[0][1] * m.y + p[0][2] * m.z, F = 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, F, P);
|
|
2500
|
+
if (x = b.length(), x < 1e-12) break;
|
|
2501
|
+
if (b.divideScalar(x), m.distanceTo(b) < 1e-10) {
|
|
2502
|
+
m = b;
|
|
2503
2503
|
break;
|
|
2504
2504
|
}
|
|
2505
|
-
m =
|
|
2505
|
+
m = b;
|
|
2506
2506
|
}
|
|
2507
|
-
|
|
2507
|
+
d.push(m.clone()), u.push(x);
|
|
2508
2508
|
for (let S = 0; S < 3; S++) for (let I = 0; I < 3; I++) {
|
|
2509
|
-
const
|
|
2509
|
+
const F = [
|
|
2510
2510
|
m.x,
|
|
2511
2511
|
m.y,
|
|
2512
2512
|
m.z
|
|
2513
|
-
][S],
|
|
2513
|
+
][S], P = [
|
|
2514
2514
|
m.x,
|
|
2515
2515
|
m.y,
|
|
2516
2516
|
m.z
|
|
2517
2517
|
][I];
|
|
2518
|
-
p[S][I] -= x *
|
|
2518
|
+
p[S][I] -= x * F * P;
|
|
2519
2519
|
}
|
|
2520
2520
|
}
|
|
2521
|
-
const g = new
|
|
2522
|
-
for (let
|
|
2521
|
+
const g = new C();
|
|
2522
|
+
for (let f = 0; f < t; f++) g.x += r.getX(f), g.y += r.getY(f), g.z += r.getZ(f);
|
|
2523
2523
|
g.divideScalar(t);
|
|
2524
|
-
const
|
|
2524
|
+
const M = [
|
|
2525
2525
|
0,
|
|
2526
2526
|
0,
|
|
2527
2527
|
0
|
|
2528
2528
|
];
|
|
2529
|
-
for (let
|
|
2529
|
+
for (let f = 0; f < 3; f++) {
|
|
2530
2530
|
let m = 1 / 0, x = -1 / 0;
|
|
2531
|
-
const S =
|
|
2531
|
+
const S = d[f];
|
|
2532
2532
|
for (let I = 0; I < t; I++) {
|
|
2533
|
-
const
|
|
2534
|
-
|
|
2533
|
+
const F = r.getX(I) - g.x, P = r.getY(I) - g.y, b = r.getZ(I) - g.z, z = F * S.x + P * S.y + b * S.z;
|
|
2534
|
+
z < m && (m = z), z > x && (x = z);
|
|
2535
2535
|
}
|
|
2536
|
-
|
|
2536
|
+
M[f] = (x - m) / 2;
|
|
2537
2537
|
}
|
|
2538
2538
|
return {
|
|
2539
|
-
axes:
|
|
2540
|
-
eigenvalues:
|
|
2539
|
+
axes: d,
|
|
2540
|
+
eigenvalues: u,
|
|
2541
2541
|
center: g,
|
|
2542
|
-
halfExtents:
|
|
2542
|
+
halfExtents: M
|
|
2543
2543
|
};
|
|
2544
2544
|
}
|
|
2545
2545
|
function Ho({ pca: e }) {
|
|
2546
2546
|
return i("group", {
|
|
2547
2547
|
children: e.axes.map((r, t) => {
|
|
2548
|
-
const o = e.center.clone().addScaledVector(r, e.halfExtents[t]),
|
|
2548
|
+
const o = e.center.clone().addScaledVector(r, e.halfExtents[t]), l = e.center.clone().addScaledVector(r, -e.halfExtents[t]);
|
|
2549
2549
|
return i(de, {
|
|
2550
2550
|
points: [
|
|
2551
|
-
|
|
2551
|
+
l,
|
|
2552
2552
|
o
|
|
2553
2553
|
],
|
|
2554
2554
|
color: $o[t],
|
|
@@ -2559,8 +2559,8 @@ let __tla = (async () => {
|
|
|
2559
2559
|
}
|
|
2560
2560
|
function Vo({ pca: e }) {
|
|
2561
2561
|
const r = j(() => {
|
|
2562
|
-
const { center: t, axes: o, halfExtents:
|
|
2563
|
-
for (let a = -1; a <= 1; a += 2) for (let n = -1; n <= 1; n += 2) for (let h = -1; h <= 1; h += 2)
|
|
2562
|
+
const { center: t, axes: o, halfExtents: l } = e, s = [];
|
|
2563
|
+
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]));
|
|
2564
2564
|
return [
|
|
2565
2565
|
[
|
|
2566
2566
|
0,
|
|
@@ -2611,8 +2611,8 @@ let __tla = (async () => {
|
|
|
2611
2611
|
7
|
|
2612
2612
|
]
|
|
2613
2613
|
].map(([a, n]) => [
|
|
2614
|
-
|
|
2615
|
-
|
|
2614
|
+
s[a],
|
|
2615
|
+
s[n]
|
|
2616
2616
|
]);
|
|
2617
2617
|
}, [
|
|
2618
2618
|
e
|
|
@@ -2628,26 +2628,26 @@ let __tla = (async () => {
|
|
|
2628
2628
|
});
|
|
2629
2629
|
}
|
|
2630
2630
|
function jo({ redPoint: e, greenPoint: r }) {
|
|
2631
|
-
const t = j(() => new
|
|
2631
|
+
const t = j(() => new C().subVectors(r, e).normalize(), [
|
|
2632
2632
|
e,
|
|
2633
2633
|
r
|
|
2634
2634
|
]), o = j(() => {
|
|
2635
|
-
const
|
|
2636
|
-
return Math.acos(Math.min(1, Math.abs(
|
|
2635
|
+
const s = t.dot(new C(0, 1, 0));
|
|
2636
|
+
return Math.acos(Math.min(1, Math.abs(s))) * 180 / Math.PI;
|
|
2637
2637
|
}, [
|
|
2638
2638
|
t
|
|
2639
|
-
]),
|
|
2640
|
-
return
|
|
2639
|
+
]), l = o < 1 ? "#44ff44" : o < 5 ? "#ffcc00" : "#ff4444";
|
|
2640
|
+
return L("group", {
|
|
2641
2641
|
children: [
|
|
2642
2642
|
i(de, {
|
|
2643
2643
|
points: [
|
|
2644
2644
|
e,
|
|
2645
2645
|
r
|
|
2646
2646
|
],
|
|
2647
|
-
color:
|
|
2647
|
+
color: l,
|
|
2648
2648
|
lineWidth: 3
|
|
2649
2649
|
}),
|
|
2650
|
-
|
|
2650
|
+
L("mesh", {
|
|
2651
2651
|
position: e,
|
|
2652
2652
|
children: [
|
|
2653
2653
|
i("sphereGeometry", {
|
|
@@ -2662,7 +2662,7 @@ let __tla = (async () => {
|
|
|
2662
2662
|
})
|
|
2663
2663
|
]
|
|
2664
2664
|
}),
|
|
2665
|
-
|
|
2665
|
+
L("mesh", {
|
|
2666
2666
|
position: r,
|
|
2667
2667
|
children: [
|
|
2668
2668
|
i("sphereGeometry", {
|
|
@@ -2681,19 +2681,19 @@ let __tla = (async () => {
|
|
|
2681
2681
|
});
|
|
2682
2682
|
}
|
|
2683
2683
|
function No({ geometry: e, redY: r, greenY: t, modelSize: o }) {
|
|
2684
|
-
const
|
|
2684
|
+
const s = o * 0.15, c = j(() => {
|
|
2685
2685
|
const a = [];
|
|
2686
2686
|
let n = t - 10;
|
|
2687
|
-
const h = new
|
|
2687
|
+
const h = new C(0, 1, 0);
|
|
2688
2688
|
for (; n > r; ) {
|
|
2689
|
-
const
|
|
2689
|
+
const d = Math.min(n, t), u = Math.max(n, t), p = xn(e, d, u);
|
|
2690
2690
|
if (p) {
|
|
2691
|
-
const g = p.dot(h),
|
|
2691
|
+
const g = p.dot(h), M = Math.acos(Math.min(1, Math.abs(g))) * 180 / Math.PI;
|
|
2692
2692
|
a.push({
|
|
2693
2693
|
axis: p,
|
|
2694
|
-
regionMin:
|
|
2695
|
-
regionMax:
|
|
2696
|
-
angleDeg:
|
|
2694
|
+
regionMin: d,
|
|
2695
|
+
regionMax: u,
|
|
2696
|
+
angleDeg: M
|
|
2697
2697
|
});
|
|
2698
2698
|
}
|
|
2699
2699
|
n -= 10;
|
|
@@ -2706,25 +2706,25 @@ let __tla = (async () => {
|
|
|
2706
2706
|
]);
|
|
2707
2707
|
return i("group", {
|
|
2708
2708
|
children: c.map((a, n) => {
|
|
2709
|
-
const h = (a.regionMin + a.regionMax) / 2,
|
|
2710
|
-
return
|
|
2709
|
+
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 L("group", {
|
|
2711
2711
|
children: [
|
|
2712
2712
|
i(de, {
|
|
2713
2713
|
points: [
|
|
2714
2714
|
p,
|
|
2715
|
-
|
|
2715
|
+
u
|
|
2716
2716
|
],
|
|
2717
|
-
color:
|
|
2717
|
+
color: M,
|
|
2718
2718
|
lineWidth: 1.5,
|
|
2719
2719
|
transparent: true,
|
|
2720
2720
|
opacity: 0.7
|
|
2721
2721
|
}),
|
|
2722
2722
|
i(de, {
|
|
2723
2723
|
points: [
|
|
2724
|
-
new
|
|
2725
|
-
new
|
|
2724
|
+
new C(-s * 0.3, a.regionMin, 0),
|
|
2725
|
+
new C(s * 0.3, a.regionMin, 0)
|
|
2726
2726
|
],
|
|
2727
|
-
color:
|
|
2727
|
+
color: M,
|
|
2728
2728
|
lineWidth: 0.5,
|
|
2729
2729
|
transparent: true,
|
|
2730
2730
|
opacity: 0.3
|
|
@@ -2735,12 +2735,12 @@ let __tla = (async () => {
|
|
|
2735
2735
|
});
|
|
2736
2736
|
}
|
|
2737
2737
|
function Yo({ geometry: e, redY: r, greenY: t, modelSize: o }) {
|
|
2738
|
-
const
|
|
2739
|
-
const
|
|
2740
|
-
if (!
|
|
2741
|
-
const p =
|
|
2738
|
+
const l = j(() => {
|
|
2739
|
+
const u = xn(e, r, t);
|
|
2740
|
+
if (!u) return null;
|
|
2741
|
+
const p = u.dot(new C(0, 1, 0)), g = Math.acos(Math.min(1, Math.abs(p))) * 180 / Math.PI;
|
|
2742
2742
|
return {
|
|
2743
|
-
axis:
|
|
2743
|
+
axis: u,
|
|
2744
2744
|
angleDeg: g
|
|
2745
2745
|
};
|
|
2746
2746
|
}, [
|
|
@@ -2748,15 +2748,15 @@ let __tla = (async () => {
|
|
|
2748
2748
|
r,
|
|
2749
2749
|
t
|
|
2750
2750
|
]);
|
|
2751
|
-
if (!
|
|
2752
|
-
const
|
|
2751
|
+
if (!l) return null;
|
|
2752
|
+
const s = (r + t) / 2, c = new C(0, s, 0), a = o * 0.4, n = c.clone().addScaledVector(l.axis, a), h = c.clone().addScaledVector(l.axis, -a), d = l.angleDeg < 0.5 ? "#00ffff" : l.angleDeg < 2 ? "#ffcc00" : "#ff6600";
|
|
2753
2753
|
return i("group", {
|
|
2754
2754
|
children: i(de, {
|
|
2755
2755
|
points: [
|
|
2756
2756
|
h,
|
|
2757
2757
|
n
|
|
2758
2758
|
],
|
|
2759
|
-
color:
|
|
2759
|
+
color: d,
|
|
2760
2760
|
lineWidth: 3,
|
|
2761
2761
|
dashed: true,
|
|
2762
2762
|
dashSize: 3,
|
|
@@ -2765,11 +2765,11 @@ let __tla = (async () => {
|
|
|
2765
2765
|
});
|
|
2766
2766
|
}
|
|
2767
2767
|
function Xo({ pca: e, modelSize: r }) {
|
|
2768
|
-
const t = e.axes[0], o = r * 0.6,
|
|
2768
|
+
const t = e.axes[0], o = r * 0.6, l = e.center.clone().addScaledVector(t, o), s = e.center.clone().addScaledVector(t, -o);
|
|
2769
2769
|
return i(de, {
|
|
2770
2770
|
points: [
|
|
2771
|
-
|
|
2772
|
-
|
|
2771
|
+
s,
|
|
2772
|
+
l
|
|
2773
2773
|
],
|
|
2774
2774
|
color: "#ff8800",
|
|
2775
2775
|
lineWidth: 2,
|
|
@@ -2778,55 +2778,55 @@ let __tla = (async () => {
|
|
|
2778
2778
|
gapSize: 2
|
|
2779
2779
|
});
|
|
2780
2780
|
}
|
|
2781
|
-
function Go({ geometry: e, redY: r, greenY: t, modelSize: o, measurementGeometry:
|
|
2782
|
-
const
|
|
2783
|
-
const
|
|
2784
|
-
for (let
|
|
2785
|
-
const D = fo(
|
|
2781
|
+
function Go({ geometry: e, redY: r, greenY: t, modelSize: o, measurementGeometry: l }) {
|
|
2782
|
+
const s = j(() => {
|
|
2783
|
+
const d = l ?? e, u = gn(d), p = new C(0, 1, 0), g = 5, f = t + 3 * 25.4, m = [];
|
|
2784
|
+
for (let y = r + g; y < f; y += g) {
|
|
2785
|
+
const D = fo(u, d, new C(0, y, 0), p);
|
|
2786
2786
|
D > 0 && m.push({
|
|
2787
|
-
y
|
|
2787
|
+
y,
|
|
2788
2788
|
circ: D
|
|
2789
2789
|
});
|
|
2790
2790
|
}
|
|
2791
2791
|
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
|
|
2792
|
+
const x = t - r, S = r + x * 0.3, I = r + x * 0.7, F = m.filter((y) => y.y >= S && y.y <= I);
|
|
2793
|
+
if (F.length < 3) return null;
|
|
2794
|
+
const P = F.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
2795
|
return {
|
|
2796
2796
|
circumferences: m,
|
|
2797
|
-
baseline:
|
|
2798
|
-
maxCirc:
|
|
2797
|
+
baseline: b,
|
|
2798
|
+
maxCirc: z
|
|
2799
2799
|
};
|
|
2800
2800
|
}, [
|
|
2801
2801
|
e,
|
|
2802
2802
|
r,
|
|
2803
2803
|
t
|
|
2804
2804
|
]);
|
|
2805
|
-
if (!
|
|
2806
|
-
const { circumferences: c, baseline: a, maxCirc: n } =
|
|
2807
|
-
return
|
|
2805
|
+
if (!s) return null;
|
|
2806
|
+
const { circumferences: c, baseline: a, maxCirc: n } = s, h = o * 0.3 / n;
|
|
2807
|
+
return L("group", {
|
|
2808
2808
|
children: [
|
|
2809
|
-
c.map(({ y:
|
|
2810
|
-
const g =
|
|
2809
|
+
c.map(({ y: d, circ: u }, p) => {
|
|
2810
|
+
const g = u / a, M = g > 1.6 ? "#ff4444" : g > 1.3 ? "#ffcc00" : "#22cc66", f = u * h;
|
|
2811
2811
|
return i(de, {
|
|
2812
2812
|
points: [
|
|
2813
|
-
new
|
|
2814
|
-
new
|
|
2813
|
+
new C(-f, d, 0),
|
|
2814
|
+
new C(f, d, 0)
|
|
2815
2815
|
],
|
|
2816
|
-
color:
|
|
2816
|
+
color: M,
|
|
2817
2817
|
lineWidth: 1.5,
|
|
2818
2818
|
transparent: true,
|
|
2819
2819
|
opacity: 0.6
|
|
2820
2820
|
}, p);
|
|
2821
2821
|
}),
|
|
2822
2822
|
(() => {
|
|
2823
|
-
const
|
|
2824
|
-
return
|
|
2823
|
+
const d = a * 1.6 * h, u = c[0].y, p = c[c.length - 1].y;
|
|
2824
|
+
return L(Te, {
|
|
2825
2825
|
children: [
|
|
2826
2826
|
i(de, {
|
|
2827
2827
|
points: [
|
|
2828
|
-
new
|
|
2829
|
-
new
|
|
2828
|
+
new C(-d, u, 0),
|
|
2829
|
+
new C(-d, p, 0)
|
|
2830
2830
|
],
|
|
2831
2831
|
color: "#ff4444",
|
|
2832
2832
|
lineWidth: 1,
|
|
@@ -2838,8 +2838,8 @@ let __tla = (async () => {
|
|
|
2838
2838
|
}),
|
|
2839
2839
|
i(de, {
|
|
2840
2840
|
points: [
|
|
2841
|
-
new
|
|
2842
|
-
new
|
|
2841
|
+
new C(d, u, 0),
|
|
2842
|
+
new C(d, p, 0)
|
|
2843
2843
|
],
|
|
2844
2844
|
color: "#ff4444",
|
|
2845
2845
|
lineWidth: 1,
|
|
@@ -2858,18 +2858,18 @@ let __tla = (async () => {
|
|
|
2858
2858
|
function Zo({ componentDebug: e }) {
|
|
2859
2859
|
return i("group", {
|
|
2860
2860
|
children: e.geometries.map((r, t) => {
|
|
2861
|
-
const o = e.colors[t] ?? "#888888",
|
|
2861
|
+
const o = e.colors[t] ?? "#888888", l = t === e.innerIdx;
|
|
2862
2862
|
r.computeBoundingBox();
|
|
2863
|
-
const
|
|
2864
|
-
return r.boundingBox.getCenter(
|
|
2863
|
+
const s = new C();
|
|
2864
|
+
return r.boundingBox.getCenter(s), L("group", {
|
|
2865
2865
|
children: [
|
|
2866
2866
|
i("mesh", {
|
|
2867
2867
|
geometry: r,
|
|
2868
|
-
renderOrder:
|
|
2868
|
+
renderOrder: l ? 2 : 1,
|
|
2869
2869
|
children: i("meshStandardMaterial", {
|
|
2870
2870
|
color: o,
|
|
2871
2871
|
transparent: true,
|
|
2872
|
-
opacity:
|
|
2872
|
+
opacity: l ? 0.5 : 0.2,
|
|
2873
2873
|
side: O.DoubleSide,
|
|
2874
2874
|
depthWrite: false,
|
|
2875
2875
|
polygonOffset: true,
|
|
@@ -2879,16 +2879,16 @@ let __tla = (async () => {
|
|
|
2879
2879
|
}),
|
|
2880
2880
|
i("mesh", {
|
|
2881
2881
|
geometry: r,
|
|
2882
|
-
renderOrder:
|
|
2882
|
+
renderOrder: l ? 2 : 1,
|
|
2883
2883
|
children: i("meshBasicMaterial", {
|
|
2884
2884
|
color: o,
|
|
2885
2885
|
wireframe: true,
|
|
2886
2886
|
transparent: true,
|
|
2887
|
-
opacity:
|
|
2887
|
+
opacity: l ? 0.4 : 0.15
|
|
2888
2888
|
})
|
|
2889
2889
|
}),
|
|
2890
2890
|
i("group", {
|
|
2891
|
-
position:
|
|
2891
|
+
position: s,
|
|
2892
2892
|
children: i(Ye, {
|
|
2893
2893
|
center: true,
|
|
2894
2894
|
style: {
|
|
@@ -2907,7 +2907,7 @@ let __tla = (async () => {
|
|
|
2907
2907
|
fontSize: 11,
|
|
2908
2908
|
color: o,
|
|
2909
2909
|
fontFamily: "monospace",
|
|
2910
|
-
fontWeight:
|
|
2910
|
+
fontWeight: l ? 700 : 400
|
|
2911
2911
|
},
|
|
2912
2912
|
children: e.labels[t]
|
|
2913
2913
|
})
|
|
@@ -2921,12 +2921,12 @@ let __tla = (async () => {
|
|
|
2921
2921
|
}
|
|
2922
2922
|
function Ko({ geometry: e, aoData: r }) {
|
|
2923
2923
|
const t = j(() => {
|
|
2924
|
-
const o = e.toNonIndexed(),
|
|
2925
|
-
for (let n = 0; n <
|
|
2926
|
-
const h = r[n],
|
|
2924
|
+
const o = e.toNonIndexed(), l = o.getAttribute("position"), s = r.length, c = l.count, a = new Float32Array(c * 3);
|
|
2925
|
+
for (let n = 0; n < s && n * 3 + 2 < c; n++) {
|
|
2926
|
+
const h = r[n], d = h, u = h < 0.5 ? 0.8 - h * 1.2 : 0.2 * (1 - h), p = 1 - h;
|
|
2927
2927
|
for (let g = 0; g < 3; g++) {
|
|
2928
|
-
const
|
|
2929
|
-
a[
|
|
2928
|
+
const M = (n * 3 + g) * 3;
|
|
2929
|
+
a[M] = d, a[M + 1] = u, a[M + 2] = p;
|
|
2930
2930
|
}
|
|
2931
2931
|
}
|
|
2932
2932
|
return o.setAttribute("color", new O.Float32BufferAttribute(a, 3)), o;
|
|
@@ -2948,16 +2948,16 @@ let __tla = (async () => {
|
|
|
2948
2948
|
})
|
|
2949
2949
|
});
|
|
2950
2950
|
}
|
|
2951
|
-
function Uo({ mesh: e, layers: r, landmarkPoints: t, componentDebug: o, aoData:
|
|
2951
|
+
function Uo({ mesh: e, layers: r, landmarkPoints: t, componentDebug: o, aoData: l, aoGeometry: s, measurementGeometry: c }) {
|
|
2952
2952
|
const a = e.geometry, n = j(() => a.getAttribute("position") ? yn(a) : null, [
|
|
2953
2953
|
a
|
|
2954
2954
|
]), h = j(() => !t || t.length < 2 ? null : {
|
|
2955
|
-
red: new
|
|
2956
|
-
green: new
|
|
2955
|
+
red: new C(t[1].position.x, t[1].position.y, t[1].position.z),
|
|
2956
|
+
green: new C(t[0].position.x, t[0].position.y, t[0].position.z)
|
|
2957
2957
|
}, [
|
|
2958
2958
|
t
|
|
2959
2959
|
]);
|
|
2960
|
-
return
|
|
2960
|
+
return L("group", {
|
|
2961
2961
|
children: [
|
|
2962
2962
|
r.pcaAxes && n && i(Ho, {
|
|
2963
2963
|
pca: n
|
|
@@ -2972,9 +2972,9 @@ let __tla = (async () => {
|
|
|
2972
2972
|
r.shellComponents && o && i(Zo, {
|
|
2973
2973
|
componentDebug: o
|
|
2974
2974
|
}),
|
|
2975
|
-
r.ambientOcclusion &&
|
|
2976
|
-
geometry:
|
|
2977
|
-
aoData:
|
|
2975
|
+
r.ambientOcclusion && l && l.length > 0 && i(Ko, {
|
|
2976
|
+
geometry: s ?? a,
|
|
2977
|
+
aoData: l
|
|
2978
2978
|
}),
|
|
2979
2979
|
r.circumferenceScan && h && i(Go, {
|
|
2980
2980
|
geometry: a,
|
|
@@ -3016,20 +3016,20 @@ let __tla = (async () => {
|
|
|
3016
3016
|
function Jo({ mesh: e }) {
|
|
3017
3017
|
const r = e.geometry, t = j(() => {
|
|
3018
3018
|
if (!r.getAttribute("position")) return null;
|
|
3019
|
-
const
|
|
3019
|
+
const s = yn(r), c = s.axes[0], a = s.halfExtents[0] * 1.3;
|
|
3020
3020
|
return {
|
|
3021
3021
|
axis: c,
|
|
3022
|
-
center:
|
|
3022
|
+
center: s.center,
|
|
3023
3023
|
halfLen: a
|
|
3024
3024
|
};
|
|
3025
3025
|
}, [
|
|
3026
3026
|
r
|
|
3027
3027
|
]);
|
|
3028
3028
|
if (!t) return null;
|
|
3029
|
-
const o = t.center.clone().addScaledVector(t.axis, t.halfLen),
|
|
3029
|
+
const o = t.center.clone().addScaledVector(t.axis, t.halfLen), l = t.center.clone().addScaledVector(t.axis, -t.halfLen);
|
|
3030
3030
|
return i(de, {
|
|
3031
3031
|
points: [
|
|
3032
|
-
|
|
3032
|
+
l,
|
|
3033
3033
|
o
|
|
3034
3034
|
],
|
|
3035
3035
|
color: "#666",
|
|
@@ -3103,7 +3103,7 @@ let __tla = (async () => {
|
|
|
3103
3103
|
...new Set(bn.map((e) => e.group))
|
|
3104
3104
|
];
|
|
3105
3105
|
function qo({ layers: e, onToggleLayer: r, isDoubleShell: t }) {
|
|
3106
|
-
return
|
|
3106
|
+
return L("div", {
|
|
3107
3107
|
style: {
|
|
3108
3108
|
position: "absolute",
|
|
3109
3109
|
top: 16,
|
|
@@ -3132,8 +3132,8 @@ let __tla = (async () => {
|
|
|
3132
3132
|
children: "Debug Layers"
|
|
3133
3133
|
}),
|
|
3134
3134
|
Qo.map((o) => {
|
|
3135
|
-
const
|
|
3136
|
-
return
|
|
3135
|
+
const l = bn.filter((s) => s.group === o && !(s.hideWhenDoubleShell && t));
|
|
3136
|
+
return l.length === 0 ? null : L("div", {
|
|
3137
3137
|
children: [
|
|
3138
3138
|
i("div", {
|
|
3139
3139
|
style: {
|
|
@@ -3147,7 +3147,7 @@ let __tla = (async () => {
|
|
|
3147
3147
|
},
|
|
3148
3148
|
children: o
|
|
3149
3149
|
}),
|
|
3150
|
-
|
|
3150
|
+
l.map(({ key: s, label: c, color: a }) => L("label", {
|
|
3151
3151
|
style: {
|
|
3152
3152
|
display: "flex",
|
|
3153
3153
|
alignItems: "center",
|
|
@@ -3159,8 +3159,8 @@ let __tla = (async () => {
|
|
|
3159
3159
|
children: [
|
|
3160
3160
|
i("input", {
|
|
3161
3161
|
type: "checkbox",
|
|
3162
|
-
checked: e[
|
|
3163
|
-
onChange: () => r(
|
|
3162
|
+
checked: e[s],
|
|
3163
|
+
onChange: () => r(s),
|
|
3164
3164
|
style: {
|
|
3165
3165
|
accentColor: a,
|
|
3166
3166
|
width: 14,
|
|
@@ -3174,32 +3174,32 @@ let __tla = (async () => {
|
|
|
3174
3174
|
height: 8,
|
|
3175
3175
|
borderRadius: "50%",
|
|
3176
3176
|
backgroundColor: a,
|
|
3177
|
-
opacity: e[
|
|
3177
|
+
opacity: e[s] ? 1 : 0.3,
|
|
3178
3178
|
flexShrink: 0
|
|
3179
3179
|
}
|
|
3180
3180
|
}),
|
|
3181
3181
|
i("span", {
|
|
3182
3182
|
style: {
|
|
3183
|
-
opacity: e[
|
|
3183
|
+
opacity: e[s] ? 1 : 0.5
|
|
3184
3184
|
},
|
|
3185
3185
|
children: c
|
|
3186
3186
|
})
|
|
3187
3187
|
]
|
|
3188
|
-
},
|
|
3188
|
+
}, s))
|
|
3189
3189
|
]
|
|
3190
3190
|
}, o);
|
|
3191
3191
|
})
|
|
3192
3192
|
]
|
|
3193
3193
|
});
|
|
3194
3194
|
}
|
|
3195
|
-
const er = ({ config: e, spacingType: r, scanUrl: t, formMeasurements: o, onComplete:
|
|
3196
|
-
const [n, h] =
|
|
3195
|
+
const er = ({ config: e, spacingType: r, scanUrl: t, formMeasurements: o, onComplete: l, isDebugUser: s = false, onAnalyticsEvent: c, wasmModule: a }) => {
|
|
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"), [F, 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, ne] = E(false), [V, X] = E([]), [Le, Pe] = E(null), [Xe, se] = E(null), [ze, _t] = E(null), [pt, Sn] = E(null), [vn, Dt] = E(false), [Bt, Cn] = E(null), [ht, Ie] = E(null), [Be, Mn] = E(false), [Rt, zn] = E(Oo), [Oe, Wt] = E("obj"), [Ae, gt] = E(o), [et, Et] = E(true), [Tt, mt] = E(false), [Ot, An] = E(false), [xt, kn] = E(null), [$t] = E("#c8c8c8"), [Fn] = E(1), [Ge, Ln] = E(false), [yt, Ht] = E([]), tt = le(null), $e = le(null), bt = le(false), Pn = le(null), wt = le(null), St = le(null), Ke = oe(async () => {
|
|
3197
3197
|
if (St.current) try {
|
|
3198
|
-
const
|
|
3199
|
-
const te = await
|
|
3198
|
+
const v = (await import("./html2canvas.esm-Dmi1NfiH.js")).default, _ = St.current, W = 2, R = async (K = false) => {
|
|
3199
|
+
const te = await v(_, {
|
|
3200
3200
|
backgroundColor: null,
|
|
3201
3201
|
useCORS: true,
|
|
3202
|
-
scale:
|
|
3202
|
+
scale: W,
|
|
3203
3203
|
ignoreElements: (rt) => {
|
|
3204
3204
|
var _a;
|
|
3205
3205
|
return ((_a = rt.style) == null ? void 0 : _a.zIndex) === "10";
|
|
@@ -3213,7 +3213,7 @@ let __tla = (async () => {
|
|
|
3213
3213
|
const Nn = (He * te.width + Ve) * 4;
|
|
3214
3214
|
_e[Nn + 3] > 20 && (Ve < De && (De = Ve), Ve > qe && (qe = Ve), He < We && (We = He), He > it && (it = He));
|
|
3215
3215
|
}
|
|
3216
|
-
qe <= De && (De = 0, We = 0, qe = te.width, it = te.height), ve = De /
|
|
3216
|
+
qe <= De && (De = 0, We = 0, qe = te.width, it = te.height), ve = De / W, Me = We / W, ye = qe / W, Ee = it / W;
|
|
3217
3217
|
} else {
|
|
3218
3218
|
const rt = _.querySelectorAll("[style*='pointer-events: none']");
|
|
3219
3219
|
ve = 1 / 0, Me = 1 / 0, ye = -1 / 0, Ee = -1 / 0, rt.forEach((kt) => {
|
|
@@ -3225,7 +3225,7 @@ let __tla = (async () => {
|
|
|
3225
3225
|
}
|
|
3226
3226
|
const Kt = Math.max(ke, Re) * 0.03, Ut = Math.max(ke, Re) * 0.06;
|
|
3227
3227
|
ve = Math.max(0, ve - Kt), Me = Math.max(0, Me - Ut), ye = Math.min(ke, ye + Kt), Ee = Math.min(Re, Ee + Ut);
|
|
3228
|
-
const zt = (ye - ve) *
|
|
3228
|
+
const zt = (ye - ve) * W, At = (Ee - Me) * W, Vn = Math.max(0, ve * W), jn = Math.max(0, Me * W), ot = document.createElement("canvas");
|
|
3229
3229
|
return ot.width = Math.round(zt), ot.height = Math.round(At), ot.getContext("2d").drawImage(te, Math.round(Vn), Math.round(jn), Math.round(zt), Math.round(At), 0, 0, Math.round(zt), Math.round(At)), ot.toDataURL("image/png");
|
|
3230
3230
|
};
|
|
3231
3231
|
wt.current && wt.current(), await new Promise((K) => setTimeout(K, 200)), await new Promise((K) => requestAnimationFrame(() => requestAnimationFrame(K)));
|
|
@@ -3239,34 +3239,34 @@ let __tla = (async () => {
|
|
|
3239
3239
|
} catch {
|
|
3240
3240
|
return;
|
|
3241
3241
|
}
|
|
3242
|
-
}, []), Se =
|
|
3243
|
-
const _ = /* @__PURE__ */ new Date(),
|
|
3242
|
+
}, []), Se = oe((v) => {
|
|
3243
|
+
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
3244
|
Ht((R) => [
|
|
3245
3245
|
...R.slice(-200),
|
|
3246
|
-
`[${
|
|
3246
|
+
`[${W}] ${v}`
|
|
3247
3247
|
]);
|
|
3248
|
-
}, []), { landmarkPoints: T, clearLandmarkPoints: In, addLandmarkPoint: Vt, removeLandmarkPoint: jt, updateLandmarkPositions: Nt, setAligned: Yt, isAligned: ee, setCut: Xt, isCut: vt } = It(), nt =
|
|
3249
|
-
|
|
3250
|
-
if (!
|
|
3251
|
-
const
|
|
3252
|
-
Se(`LANDMARK[${T.length - 1}]: placed at (${
|
|
3248
|
+
}, []), { landmarkPoints: T, clearLandmarkPoints: In, addLandmarkPoint: Vt, removeLandmarkPoint: jt, updateLandmarkPositions: Nt, setAligned: Yt, isAligned: ee, setCut: Xt, isCut: vt } = It(), nt = F * at;
|
|
3249
|
+
re(() => {
|
|
3250
|
+
if (!s || T.length === 0) return;
|
|
3251
|
+
const v = T[T.length - 1];
|
|
3252
|
+
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}`);
|
|
3253
3253
|
}, [
|
|
3254
3254
|
T.length,
|
|
3255
|
-
|
|
3255
|
+
s,
|
|
3256
3256
|
Se
|
|
3257
|
-
]),
|
|
3258
|
-
|
|
3257
|
+
]), re(() => {
|
|
3258
|
+
s && ee && Se("STATE: mesh aligned");
|
|
3259
3259
|
}, [
|
|
3260
3260
|
ee,
|
|
3261
|
-
|
|
3261
|
+
s,
|
|
3262
3262
|
Se
|
|
3263
|
-
]),
|
|
3264
|
-
|
|
3263
|
+
]), re(() => {
|
|
3264
|
+
s && vt && Se("STATE: mesh cut");
|
|
3265
3265
|
}, [
|
|
3266
3266
|
vt,
|
|
3267
|
-
|
|
3267
|
+
s,
|
|
3268
3268
|
Se
|
|
3269
|
-
]),
|
|
3269
|
+
]), re(() => {
|
|
3270
3270
|
tt.current && (tt.current.scrollTop = tt.current.scrollHeight);
|
|
3271
3271
|
}, [
|
|
3272
3272
|
yt
|
|
@@ -3274,20 +3274,20 @@ let __tla = (async () => {
|
|
|
3274
3274
|
const Gt = j(() => xe ? new O.Mesh(xe) : null, [
|
|
3275
3275
|
xe
|
|
3276
3276
|
]);
|
|
3277
|
-
|
|
3277
|
+
re(() => {
|
|
3278
3278
|
o && gt(o);
|
|
3279
3279
|
}, [
|
|
3280
3280
|
o
|
|
3281
|
-
]),
|
|
3281
|
+
]), re(() => {
|
|
3282
3282
|
o || gt(void 0);
|
|
3283
3283
|
}, [
|
|
3284
|
-
|
|
3284
|
+
F
|
|
3285
3285
|
]);
|
|
3286
3286
|
const Ct = le(false);
|
|
3287
|
-
|
|
3287
|
+
re(() => {
|
|
3288
3288
|
if (!ee || V.length === 0 || Ct.current || !c) return;
|
|
3289
3289
|
Ct.current = true;
|
|
3290
|
-
const
|
|
3290
|
+
const v = T.length >= 3 ? Math.abs(T[2].position.y - T[0].position.y) : null;
|
|
3291
3291
|
c("dimensions_calculated", {
|
|
3292
3292
|
spacing_type: w,
|
|
3293
3293
|
source_unit: "mm",
|
|
@@ -3297,73 +3297,73 @@ let __tla = (async () => {
|
|
|
3297
3297
|
is_unit_converted: false,
|
|
3298
3298
|
form_measurements: (Ae == null ? void 0 : Ae.filter((_) => _ != null)) ?? null,
|
|
3299
3299
|
scan_measurements: V.map((_) => +(_.modifiedValue ?? _.originalValue).toFixed(1)),
|
|
3300
|
-
measurement_variance: Ae ? V.map((_,
|
|
3301
|
-
const R = Ae[
|
|
3300
|
+
measurement_variance: Ae ? V.map((_, W) => {
|
|
3301
|
+
const R = Ae[W];
|
|
3302
3302
|
return R == null ? null : +((_.modifiedValue ?? _.originalValue) - R).toFixed(1);
|
|
3303
3303
|
}) : null,
|
|
3304
|
-
frontal_height:
|
|
3304
|
+
frontal_height: v !== null ? +v.toFixed(1) : null
|
|
3305
3305
|
});
|
|
3306
3306
|
}, [
|
|
3307
3307
|
ee,
|
|
3308
3308
|
V
|
|
3309
|
-
]),
|
|
3309
|
+
]), re(() => {
|
|
3310
3310
|
a !== void 0 && ($e.current = a), Ln(true);
|
|
3311
3311
|
}, [
|
|
3312
3312
|
a
|
|
3313
3313
|
]);
|
|
3314
|
-
const Ue =
|
|
3315
|
-
|
|
3316
|
-
const
|
|
3317
|
-
|
|
3318
|
-
const ge =
|
|
3319
|
-
ge.getSize(G),
|
|
3320
|
-
const K = new O.Mesh(
|
|
3314
|
+
const Ue = oe((v, _) => {
|
|
3315
|
+
v.computeBoundingBox();
|
|
3316
|
+
const W = v.boundingBox, R = new C();
|
|
3317
|
+
W.getCenter(R), v.translate(-R.x, -R.y, -R.z), v.computeBoundingBox();
|
|
3318
|
+
const ge = v.boundingBox, G = new C();
|
|
3319
|
+
ge.getSize(G), u(Math.max(G.x, G.y, G.z));
|
|
3320
|
+
const K = new O.Mesh(v, new O.MeshStandardMaterial({
|
|
3321
3321
|
color: 8947848,
|
|
3322
3322
|
side: O.DoubleSide
|
|
3323
3323
|
}));
|
|
3324
3324
|
h(K), fe(_), J(true), he(false), bt.current = false;
|
|
3325
|
-
}, []), Je =
|
|
3325
|
+
}, []), Je = oe(async (v, _) => {
|
|
3326
3326
|
Ie(null);
|
|
3327
|
-
const
|
|
3328
|
-
if (!
|
|
3327
|
+
const W = _.toLowerCase(), R = W.endsWith(".stl");
|
|
3328
|
+
if (!W.endsWith(".obj") && !R) {
|
|
3329
3329
|
Ie("Unsupported file format. Please use OBJ or STL.");
|
|
3330
3330
|
return;
|
|
3331
3331
|
}
|
|
3332
|
-
Wt(R ? "stl" : "obj"),
|
|
3332
|
+
Wt(R ? "stl" : "obj"), f(true), x("Processing file..."), Se(`FILE_LOAD: ${_} (${R ? "STL" : "OBJ"})`);
|
|
3333
3333
|
try {
|
|
3334
3334
|
let G;
|
|
3335
|
-
if (R) if (x("Converting STL..."),
|
|
3335
|
+
if (R) if (x("Converting STL..."), v instanceof ArrayBuffer) {
|
|
3336
3336
|
const Q = new Blob([
|
|
3337
|
-
|
|
3337
|
+
v
|
|
3338
3338
|
]), ke = new File([
|
|
3339
3339
|
Q
|
|
3340
3340
|
], _);
|
|
3341
3341
|
G = await Ft(ke);
|
|
3342
3342
|
} else {
|
|
3343
3343
|
const Q = new Blob([
|
|
3344
|
-
|
|
3344
|
+
v
|
|
3345
3345
|
]), ke = new File([
|
|
3346
3346
|
Q
|
|
3347
3347
|
], _);
|
|
3348
3348
|
G = await Ft(ke);
|
|
3349
3349
|
}
|
|
3350
|
-
else G = typeof
|
|
3350
|
+
else G = typeof v == "string" ? v : new TextDecoder().decode(v);
|
|
3351
3351
|
const K = performance.now(), te = $e.current ? await so(G, $e.current, (Q) => {
|
|
3352
3352
|
x(Q), Se(`PREPROCESS: ${Q}`);
|
|
3353
3353
|
}) : 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),
|
|
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)) : Ue(te.geometry, te.wasScaled);
|
|
3355
3355
|
else {
|
|
3356
3356
|
x("Using fallback loader...");
|
|
3357
3357
|
const Q = lo(G);
|
|
3358
3358
|
Q ? e.showAmputationModal && !r ? (D({
|
|
3359
3359
|
geometry: Q,
|
|
3360
3360
|
wasScaled: false
|
|
3361
|
-
}),
|
|
3361
|
+
}), z(true)) : Ue(Q, false) : Ie("Failed to parse the mesh.");
|
|
3362
3362
|
}
|
|
3363
3363
|
} catch (G) {
|
|
3364
3364
|
Ie(G instanceof Error ? G.message : "Failed to process the mesh file.");
|
|
3365
3365
|
} finally {
|
|
3366
|
-
|
|
3366
|
+
f(false), x("");
|
|
3367
3367
|
}
|
|
3368
3368
|
}, [
|
|
3369
3369
|
Ge,
|
|
@@ -3371,10 +3371,10 @@ let __tla = (async () => {
|
|
|
3371
3371
|
r,
|
|
3372
3372
|
Ue
|
|
3373
3373
|
]);
|
|
3374
|
-
|
|
3374
|
+
re(() => {
|
|
3375
3375
|
if (!t || !Ge) return;
|
|
3376
3376
|
(async () => {
|
|
3377
|
-
|
|
3377
|
+
f(true), x("Loading scan...");
|
|
3378
3378
|
try {
|
|
3379
3379
|
const _ = await fetch(t);
|
|
3380
3380
|
if (!_.ok) throw new Error(`Failed to download scan: ${_.status}`);
|
|
@@ -3387,36 +3387,36 @@ let __tla = (async () => {
|
|
|
3387
3387
|
await Je(G, R);
|
|
3388
3388
|
}
|
|
3389
3389
|
} catch (_) {
|
|
3390
|
-
Ie(_ instanceof Error ? _.message : "Failed to load scan from URL."),
|
|
3390
|
+
Ie(_ instanceof Error ? _.message : "Failed to load scan from URL."), f(false), x("");
|
|
3391
3391
|
}
|
|
3392
3392
|
})();
|
|
3393
3393
|
}, [
|
|
3394
3394
|
t,
|
|
3395
3395
|
Ge
|
|
3396
3396
|
]);
|
|
3397
|
-
const _n =
|
|
3398
|
-
|
|
3399
|
-
}, []), Dn =
|
|
3400
|
-
|
|
3401
|
-
}, []), Bn =
|
|
3402
|
-
if (
|
|
3397
|
+
const _n = oe((v) => {
|
|
3398
|
+
v.preventDefault(), g(true);
|
|
3399
|
+
}, []), Dn = oe((v) => {
|
|
3400
|
+
v.preventDefault(), g(false);
|
|
3401
|
+
}, []), Bn = oe(async (v) => {
|
|
3402
|
+
if (v.preventDefault(), g(false), !Ge) {
|
|
3403
3403
|
Ie("WASM module is still loading. Please wait.");
|
|
3404
3404
|
return;
|
|
3405
3405
|
}
|
|
3406
|
-
const _ =
|
|
3406
|
+
const _ = v.dataTransfer.files[0];
|
|
3407
3407
|
if (!_) return;
|
|
3408
|
-
const
|
|
3409
|
-
if (!
|
|
3408
|
+
const W = _.name.toLowerCase();
|
|
3409
|
+
if (!W.endsWith(".obj") && !W.endsWith(".stl")) {
|
|
3410
3410
|
Ie("Please drop an OBJ or STL file.");
|
|
3411
3411
|
return;
|
|
3412
3412
|
}
|
|
3413
|
-
if (
|
|
3414
|
-
Wt("stl"),
|
|
3413
|
+
if (W.endsWith(".stl")) {
|
|
3414
|
+
Wt("stl"), f(true), x("Converting STL...");
|
|
3415
3415
|
try {
|
|
3416
3416
|
const R = await Ft(_);
|
|
3417
3417
|
await Je(R, _.name.replace(/\.stl$/i, ".obj"));
|
|
3418
3418
|
} catch (R) {
|
|
3419
|
-
Ie(R instanceof Error ? R.message : "Failed to process STL file."),
|
|
3419
|
+
Ie(R instanceof Error ? R.message : "Failed to process STL file."), f(false), x("");
|
|
3420
3420
|
}
|
|
3421
3421
|
} else {
|
|
3422
3422
|
const R = await _.text();
|
|
@@ -3425,36 +3425,36 @@ let __tla = (async () => {
|
|
|
3425
3425
|
}, [
|
|
3426
3426
|
Ge,
|
|
3427
3427
|
Je
|
|
3428
|
-
]), Rn =
|
|
3429
|
-
|
|
3430
|
-
spacing_type:
|
|
3428
|
+
]), Rn = oe((v) => {
|
|
3429
|
+
A(v), P(v === "AK" ? 2 : 1), z(false), y && (Ue(y.geometry, y.wasScaled), D(null)), c == null ? void 0 : c("file_loaded", {
|
|
3430
|
+
spacing_type: v,
|
|
3431
3431
|
file_format: Oe,
|
|
3432
3432
|
is_double_wall: false
|
|
3433
3433
|
});
|
|
3434
3434
|
}, [
|
|
3435
|
-
|
|
3435
|
+
y,
|
|
3436
3436
|
Ue,
|
|
3437
3437
|
c,
|
|
3438
3438
|
Oe
|
|
3439
3439
|
]);
|
|
3440
|
-
|
|
3440
|
+
re(() => {
|
|
3441
3441
|
if (!n || T.length !== 1 || !$e.current || bt.current) return;
|
|
3442
3442
|
bt.current = true;
|
|
3443
|
-
const
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3443
|
+
const v = T[0], _ = $e.current, W = n.geometry, { positions: R, indices: ge } = ct(W), G = new Float32Array([
|
|
3444
|
+
v.position.x,
|
|
3445
|
+
v.position.y,
|
|
3446
|
+
v.position.z
|
|
3447
3447
|
]), 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),
|
|
3448
|
+
Se(`SHELL_DETECT: ${Q ? "DOUBLE" : "SINGLE"} \u2014 ${te}`), Q && (pe(true), ne(true), Se(`SHELL_DETECT: double shell, thickness=${K.thickness().toFixed(1)}mm`));
|
|
3449
3449
|
}, [
|
|
3450
3450
|
n,
|
|
3451
3451
|
T,
|
|
3452
3452
|
Se
|
|
3453
3453
|
]);
|
|
3454
|
-
const Wn =
|
|
3454
|
+
const Wn = oe(() => {
|
|
3455
3455
|
if (!n || T.length < 2) return;
|
|
3456
3456
|
N(true), be("Please wait..."), Se("PIPELINE: starting processing pipeline...");
|
|
3457
|
-
const
|
|
3457
|
+
const v = performance.now();
|
|
3458
3458
|
setTimeout(() => {
|
|
3459
3459
|
const _ = [
|
|
3460
3460
|
T[1],
|
|
@@ -3462,37 +3462,37 @@ let __tla = (async () => {
|
|
|
3462
3462
|
...T.slice(2)
|
|
3463
3463
|
];
|
|
3464
3464
|
po(n, _, at, {
|
|
3465
|
-
onStatus: (
|
|
3466
|
-
be(
|
|
3465
|
+
onStatus: (W) => {
|
|
3466
|
+
be(W), Se(`PIPELINE: ${W}`);
|
|
3467
3467
|
},
|
|
3468
3468
|
addLandmarkPoint: Vt,
|
|
3469
3469
|
removeLandmarkPoint: jt,
|
|
3470
|
-
updateLandmarkPositions: (
|
|
3470
|
+
updateLandmarkPositions: (W) => {
|
|
3471
3471
|
const R = [
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
...
|
|
3472
|
+
W[1],
|
|
3473
|
+
W[0],
|
|
3474
|
+
...W.slice(2)
|
|
3475
3475
|
];
|
|
3476
3476
|
Nt(R);
|
|
3477
3477
|
},
|
|
3478
3478
|
setAligned: Yt,
|
|
3479
3479
|
setCut: Xt,
|
|
3480
|
-
setModelSize:
|
|
3480
|
+
setModelSize: u,
|
|
3481
3481
|
setOriginalEndY: Sn,
|
|
3482
3482
|
setAdjustedStartY: se,
|
|
3483
3483
|
setAdjustedEndY: _t,
|
|
3484
3484
|
setError: Ie,
|
|
3485
|
-
setDoubleShell: (
|
|
3486
|
-
pe(
|
|
3485
|
+
setDoubleShell: (W) => {
|
|
3486
|
+
pe(W), ne(true);
|
|
3487
3487
|
},
|
|
3488
|
-
setAoData: (
|
|
3489
|
-
ue(
|
|
3488
|
+
setAoData: (W, R) => {
|
|
3489
|
+
ue(W), q(R ?? null);
|
|
3490
3490
|
},
|
|
3491
3491
|
setInnerShellExtracted: he,
|
|
3492
3492
|
setMeasurementGeometry: Ce,
|
|
3493
3493
|
setWasmSlices: Pe,
|
|
3494
3494
|
wasmModule: $e.current ?? void 0
|
|
3495
|
-
}), Se(`PIPELINE: completed in ${(performance.now() -
|
|
3495
|
+
}), Se(`PIPELINE: completed in ${(performance.now() - v).toFixed(0)}ms`), Ct.current = false, N(false);
|
|
3496
3496
|
}, 50);
|
|
3497
3497
|
}, [
|
|
3498
3498
|
n,
|
|
@@ -3504,7 +3504,7 @@ let __tla = (async () => {
|
|
|
3504
3504
|
Xt,
|
|
3505
3505
|
Z
|
|
3506
3506
|
]), Zt = le(false);
|
|
3507
|
-
|
|
3507
|
+
re(() => {
|
|
3508
3508
|
ee && V.length > 0 && !Zt.current && (Zt.current = true, mt(true));
|
|
3509
3509
|
}, [
|
|
3510
3510
|
ee,
|
|
@@ -3514,21 +3514,21 @@ let __tla = (async () => {
|
|
|
3514
3514
|
var _a;
|
|
3515
3515
|
if (!n || T.length < 3) return 0;
|
|
3516
3516
|
if (Y) return Math.abs(T[0].position.y - T[2].position.y);
|
|
3517
|
-
const
|
|
3518
|
-
|
|
3519
|
-
const _ = ((_a =
|
|
3517
|
+
const v = n.geometry;
|
|
3518
|
+
v.computeBoundingBox();
|
|
3519
|
+
const _ = ((_a = v.boundingBox) == null ? void 0 : _a.min.y) ?? 0;
|
|
3520
3520
|
return Math.abs(T[0].position.y - _);
|
|
3521
3521
|
}, [
|
|
3522
3522
|
n,
|
|
3523
3523
|
T,
|
|
3524
3524
|
Y
|
|
3525
|
-
]), En =
|
|
3526
|
-
kn(
|
|
3527
|
-
}, []), Tn =
|
|
3528
|
-
if (!
|
|
3525
|
+
]), En = oe((v) => {
|
|
3526
|
+
kn(v), gt(v.circumferences), mt(false), Et(true), An(true);
|
|
3527
|
+
}, []), Tn = oe(async (v) => {
|
|
3528
|
+
if (!l || !n || !w) return;
|
|
3529
3529
|
mt(false);
|
|
3530
3530
|
const _ = await Ke();
|
|
3531
|
-
|
|
3531
|
+
l({
|
|
3532
3532
|
spacingType: w,
|
|
3533
3533
|
sourceUnit: "mm",
|
|
3534
3534
|
fileFormat: Oe,
|
|
@@ -3542,11 +3542,11 @@ let __tla = (async () => {
|
|
|
3542
3542
|
transverseAP: 0,
|
|
3543
3543
|
scanUrl: t,
|
|
3544
3544
|
decision: "skip",
|
|
3545
|
-
skipReason:
|
|
3545
|
+
skipReason: v,
|
|
3546
3546
|
screenshots: _
|
|
3547
3547
|
});
|
|
3548
3548
|
}, [
|
|
3549
|
-
|
|
3549
|
+
l,
|
|
3550
3550
|
n,
|
|
3551
3551
|
w,
|
|
3552
3552
|
Oe,
|
|
@@ -3556,9 +3556,9 @@ let __tla = (async () => {
|
|
|
3556
3556
|
Qe,
|
|
3557
3557
|
t,
|
|
3558
3558
|
Ke
|
|
3559
|
-
]), Mt =
|
|
3560
|
-
if (!
|
|
3561
|
-
let _ = 0,
|
|
3559
|
+
]), Mt = oe(async (v) => {
|
|
3560
|
+
if (!l || !n || V.length === 0 || !w) return;
|
|
3561
|
+
let _ = 0, W = 0;
|
|
3562
3562
|
if (T.length >= 2) {
|
|
3563
3563
|
const ge = n.geometry, K = T[0].position.y;
|
|
3564
3564
|
try {
|
|
@@ -3566,31 +3566,31 @@ let __tla = (async () => {
|
|
|
3566
3566
|
if (Q.linePoints.length >= 2) {
|
|
3567
3567
|
let ke = Q.linePoints[0], Re = Q.linePoints[0], ve = Q.linePoints[0], Me = Q.linePoints[0];
|
|
3568
3568
|
for (const ye of Q.linePoints) ye.x < ke.x && (ke = ye), ye.x > Re.x && (Re = ye), ye.z < ve.z && (ve = ye), ye.z > Me.z && (Me = ye);
|
|
3569
|
-
_ = new
|
|
3569
|
+
_ = new C(ke.x, K, ke.z).distanceTo(new C(Re.x, K, Re.z)), W = new C(ve.x, K, ve.z).distanceTo(new C(Me.x, K, Me.z));
|
|
3570
3570
|
}
|
|
3571
3571
|
} catch {
|
|
3572
3572
|
}
|
|
3573
3573
|
}
|
|
3574
3574
|
const R = await Ke();
|
|
3575
|
-
|
|
3575
|
+
l({
|
|
3576
3576
|
spacingType: w,
|
|
3577
3577
|
sourceUnit: "mm",
|
|
3578
3578
|
fileFormat: Oe,
|
|
3579
|
-
measurementSource:
|
|
3579
|
+
measurementSource: v === "use_form_measurements" ? "form_provided" : "scan_derived",
|
|
3580
3580
|
isDoubleWall: Y,
|
|
3581
3581
|
isUnitConverted: false,
|
|
3582
3582
|
formMeasurements: Ae,
|
|
3583
3583
|
scanMeasurements: V,
|
|
3584
3584
|
frontalHeight: (xt == null ? void 0 : xt.frontalHeight) ?? Qe,
|
|
3585
3585
|
transverseML: _,
|
|
3586
|
-
transverseAP:
|
|
3586
|
+
transverseAP: W,
|
|
3587
3587
|
scanUrl: t,
|
|
3588
|
-
decision:
|
|
3588
|
+
decision: v,
|
|
3589
3589
|
userEnteredMeasurements: xt ?? void 0,
|
|
3590
3590
|
screenshots: R
|
|
3591
3591
|
});
|
|
3592
3592
|
}, [
|
|
3593
|
-
|
|
3593
|
+
l,
|
|
3594
3594
|
n,
|
|
3595
3595
|
V,
|
|
3596
3596
|
w,
|
|
@@ -3604,13 +3604,13 @@ let __tla = (async () => {
|
|
|
3604
3604
|
Ke
|
|
3605
3605
|
]), On = j(() => {
|
|
3606
3606
|
if (!Ae || V.length === 0) return false;
|
|
3607
|
-
const
|
|
3608
|
-
if (
|
|
3609
|
-
for (let _ = 0; _ <
|
|
3610
|
-
const
|
|
3611
|
-
if (!R ||
|
|
3607
|
+
const v = Math.min(Ae.length, V.length);
|
|
3608
|
+
if (v === 0) return false;
|
|
3609
|
+
for (let _ = 0; _ < v; _++) {
|
|
3610
|
+
const W = Ae[_], R = V[_];
|
|
3611
|
+
if (!R || W == null || W === 0) continue;
|
|
3612
3612
|
const ge = R.modifiedValue ?? R.originalValue;
|
|
3613
|
-
if (Math.abs(ge -
|
|
3613
|
+
if (Math.abs(ge - W) > 7) return false;
|
|
3614
3614
|
}
|
|
3615
3615
|
return true;
|
|
3616
3616
|
}, [
|
|
@@ -3638,10 +3638,10 @@ let __tla = (async () => {
|
|
|
3638
3638
|
number: 5
|
|
3639
3639
|
}
|
|
3640
3640
|
];
|
|
3641
|
-
return
|
|
3641
|
+
return L(to.Provider, {
|
|
3642
3642
|
value: e,
|
|
3643
3643
|
children: [
|
|
3644
|
-
|
|
3644
|
+
L("div", {
|
|
3645
3645
|
style: {
|
|
3646
3646
|
flex: 1,
|
|
3647
3647
|
display: "flex",
|
|
@@ -3674,7 +3674,7 @@ let __tla = (async () => {
|
|
|
3674
3674
|
steps: Hn,
|
|
3675
3675
|
currentStep: $n
|
|
3676
3676
|
}),
|
|
3677
|
-
|
|
3677
|
+
L("div", {
|
|
3678
3678
|
style: {
|
|
3679
3679
|
flex: 1,
|
|
3680
3680
|
display: "flex",
|
|
@@ -3682,7 +3682,7 @@ let __tla = (async () => {
|
|
|
3682
3682
|
minHeight: 0
|
|
3683
3683
|
},
|
|
3684
3684
|
children: [
|
|
3685
|
-
|
|
3685
|
+
L("div", {
|
|
3686
3686
|
ref: St,
|
|
3687
3687
|
style: {
|
|
3688
3688
|
flex: 1,
|
|
@@ -3694,7 +3694,7 @@ let __tla = (async () => {
|
|
|
3694
3694
|
onDragLeave: e.showDragDrop ? Dn : void 0,
|
|
3695
3695
|
onDrop: e.showDragDrop ? Bn : void 0,
|
|
3696
3696
|
children: [
|
|
3697
|
-
e.showDragDrop && !n && !
|
|
3697
|
+
e.showDragDrop && !n && !M && i("div", {
|
|
3698
3698
|
style: {
|
|
3699
3699
|
position: "absolute",
|
|
3700
3700
|
inset: 16,
|
|
@@ -3713,7 +3713,7 @@ let __tla = (async () => {
|
|
|
3713
3713
|
fontFamily: "system-ui, sans-serif"
|
|
3714
3714
|
},
|
|
3715
3715
|
children: "Drag & Drop Files Here"
|
|
3716
|
-
}) :
|
|
3716
|
+
}) : L("div", {
|
|
3717
3717
|
style: {
|
|
3718
3718
|
textAlign: "center"
|
|
3719
3719
|
},
|
|
@@ -3743,7 +3743,7 @@ let __tla = (async () => {
|
|
|
3743
3743
|
]
|
|
3744
3744
|
})
|
|
3745
3745
|
}),
|
|
3746
|
-
!e.showDragDrop && !n && !
|
|
3746
|
+
!e.showDragDrop && !n && !M && !ht && i("div", {
|
|
3747
3747
|
style: {
|
|
3748
3748
|
position: "absolute",
|
|
3749
3749
|
inset: 0,
|
|
@@ -3751,7 +3751,7 @@ let __tla = (async () => {
|
|
|
3751
3751
|
alignItems: "center",
|
|
3752
3752
|
justifyContent: "center"
|
|
3753
3753
|
},
|
|
3754
|
-
children:
|
|
3754
|
+
children: L("div", {
|
|
3755
3755
|
style: {
|
|
3756
3756
|
textAlign: "center"
|
|
3757
3757
|
},
|
|
@@ -3781,7 +3781,7 @@ let __tla = (async () => {
|
|
|
3781
3781
|
]
|
|
3782
3782
|
})
|
|
3783
3783
|
}),
|
|
3784
|
-
n && !ee && T.length === 0 &&
|
|
3784
|
+
n && !ee && T.length === 0 && L("div", {
|
|
3785
3785
|
style: {
|
|
3786
3786
|
position: "absolute",
|
|
3787
3787
|
top: 16,
|
|
@@ -3813,7 +3813,7 @@ let __tla = (async () => {
|
|
|
3813
3813
|
w === "AK" ? "IT" : "MPT"
|
|
3814
3814
|
]
|
|
3815
3815
|
}),
|
|
3816
|
-
n && !ee && T.length === 1 &&
|
|
3816
|
+
n && !ee && T.length === 1 && L("div", {
|
|
3817
3817
|
style: {
|
|
3818
3818
|
position: "absolute",
|
|
3819
3819
|
top: 16,
|
|
@@ -3844,7 +3844,7 @@ let __tla = (async () => {
|
|
|
3844
3844
|
"Click mesh to set Origin"
|
|
3845
3845
|
]
|
|
3846
3846
|
}),
|
|
3847
|
-
|
|
3847
|
+
M && i(en, {
|
|
3848
3848
|
message: m || "Processing mesh..."
|
|
3849
3849
|
}),
|
|
3850
3850
|
$ && i(en, {
|
|
@@ -3854,7 +3854,7 @@ let __tla = (async () => {
|
|
|
3854
3854
|
message: ht,
|
|
3855
3855
|
onDismiss: () => Ie(null)
|
|
3856
3856
|
}),
|
|
3857
|
-
e.showAmputationModal &&
|
|
3857
|
+
e.showAmputationModal && b && i("div", {
|
|
3858
3858
|
style: {
|
|
3859
3859
|
position: "absolute",
|
|
3860
3860
|
inset: 0,
|
|
@@ -3866,7 +3866,7 @@ let __tla = (async () => {
|
|
|
3866
3866
|
justifyContent: "center",
|
|
3867
3867
|
zIndex: 20
|
|
3868
3868
|
},
|
|
3869
|
-
children:
|
|
3869
|
+
children: L("div", {
|
|
3870
3870
|
style: {
|
|
3871
3871
|
backgroundColor: "#fff",
|
|
3872
3872
|
borderRadius: 4,
|
|
@@ -3875,7 +3875,7 @@ let __tla = (async () => {
|
|
|
3875
3875
|
fontFamily: "system-ui, sans-serif"
|
|
3876
3876
|
},
|
|
3877
3877
|
children: [
|
|
3878
|
-
|
|
3878
|
+
L("div", {
|
|
3879
3879
|
style: {
|
|
3880
3880
|
padding: "24px 24px 20px"
|
|
3881
3881
|
},
|
|
@@ -3905,8 +3905,8 @@ let __tla = (async () => {
|
|
|
3905
3905
|
children: [
|
|
3906
3906
|
"AK",
|
|
3907
3907
|
"BK"
|
|
3908
|
-
].map((
|
|
3909
|
-
onClick: () =>
|
|
3908
|
+
].map((v) => L("label", {
|
|
3909
|
+
onClick: () => A(v),
|
|
3910
3910
|
style: {
|
|
3911
3911
|
flex: 1,
|
|
3912
3912
|
display: "flex",
|
|
@@ -3915,16 +3915,16 @@ let __tla = (async () => {
|
|
|
3915
3915
|
border: "2px solid",
|
|
3916
3916
|
borderRadius: 4,
|
|
3917
3917
|
cursor: "pointer",
|
|
3918
|
-
borderColor: w ===
|
|
3919
|
-
backgroundColor: w ===
|
|
3918
|
+
borderColor: w === v ? "rgb(12, 67, 173)" : "#e0e0e0",
|
|
3919
|
+
backgroundColor: w === v ? "rgba(12, 67, 173, 0.04)" : "#fff",
|
|
3920
3920
|
transition: "border-color 0.15s, background-color 0.15s"
|
|
3921
3921
|
},
|
|
3922
3922
|
children: [
|
|
3923
3923
|
i("input", {
|
|
3924
3924
|
type: "radio",
|
|
3925
3925
|
name: "ampType",
|
|
3926
|
-
checked: w ===
|
|
3927
|
-
onChange: () =>
|
|
3926
|
+
checked: w === v,
|
|
3927
|
+
onChange: () => A(v),
|
|
3928
3928
|
style: {
|
|
3929
3929
|
accentColor: "rgb(12, 67, 173)",
|
|
3930
3930
|
marginBottom: 12,
|
|
@@ -3939,24 +3939,24 @@ let __tla = (async () => {
|
|
|
3939
3939
|
color: "rgba(0,0,0,0.87)",
|
|
3940
3940
|
marginBottom: 4
|
|
3941
3941
|
},
|
|
3942
|
-
children:
|
|
3942
|
+
children: v
|
|
3943
3943
|
}),
|
|
3944
|
-
|
|
3944
|
+
L("span", {
|
|
3945
3945
|
style: {
|
|
3946
3946
|
fontSize: 13,
|
|
3947
3947
|
color: "rgba(0,0,0,0.54)"
|
|
3948
3948
|
},
|
|
3949
3949
|
children: [
|
|
3950
|
-
|
|
3950
|
+
v === "AK" ? "2" : "1",
|
|
3951
3951
|
"-inch measurement spacing"
|
|
3952
3952
|
]
|
|
3953
3953
|
})
|
|
3954
3954
|
]
|
|
3955
|
-
},
|
|
3955
|
+
}, v))
|
|
3956
3956
|
})
|
|
3957
3957
|
]
|
|
3958
3958
|
}),
|
|
3959
|
-
|
|
3959
|
+
L("div", {
|
|
3960
3960
|
style: {
|
|
3961
3961
|
display: "flex",
|
|
3962
3962
|
justifyContent: "flex-end",
|
|
@@ -3967,7 +3967,7 @@ let __tla = (async () => {
|
|
|
3967
3967
|
children: [
|
|
3968
3968
|
i("button", {
|
|
3969
3969
|
onClick: () => {
|
|
3970
|
-
|
|
3970
|
+
z(false), D(null);
|
|
3971
3971
|
},
|
|
3972
3972
|
style: {
|
|
3973
3973
|
padding: "6px 16px",
|
|
@@ -4018,7 +4018,7 @@ let __tla = (async () => {
|
|
|
4018
4018
|
}
|
|
4019
4019
|
}),
|
|
4020
4020
|
i(ho, {
|
|
4021
|
-
children:
|
|
4021
|
+
children: L(Kn, {
|
|
4022
4022
|
camera: {
|
|
4023
4023
|
position: [
|
|
4024
4024
|
0,
|
|
@@ -4074,7 +4074,7 @@ let __tla = (async () => {
|
|
|
4074
4074
|
doubleShellTransparency: Y && ee
|
|
4075
4075
|
}),
|
|
4076
4076
|
n && S === "3D" && i(bo, {
|
|
4077
|
-
modelSize:
|
|
4077
|
+
modelSize: d,
|
|
4078
4078
|
labels: [
|
|
4079
4079
|
w === "AK" ? "IT" : "MPT",
|
|
4080
4080
|
"Origin",
|
|
@@ -4082,7 +4082,7 @@ let __tla = (async () => {
|
|
|
4082
4082
|
]
|
|
4083
4083
|
}),
|
|
4084
4084
|
i(ko, {
|
|
4085
|
-
modelSize:
|
|
4085
|
+
modelSize: d,
|
|
4086
4086
|
isAligned: ee,
|
|
4087
4087
|
isCut: vt,
|
|
4088
4088
|
mesh: n,
|
|
@@ -4102,25 +4102,25 @@ let __tla = (async () => {
|
|
|
4102
4102
|
n && ee && T.length >= 3 && (() => {
|
|
4103
4103
|
const _ = n.geometry.getIndex();
|
|
4104
4104
|
if (!_ || _.count < 30) return null;
|
|
4105
|
-
const
|
|
4105
|
+
const W = T[2], R = T[0], ge = Xe ?? W.position.y, G = ze ?? pt ?? R.position.y;
|
|
4106
4106
|
return S === "2D" ? i(_o, {
|
|
4107
4107
|
mesh: Gt ?? n,
|
|
4108
4108
|
upperY: G,
|
|
4109
4109
|
originY: R.position.y,
|
|
4110
|
-
modelSize:
|
|
4110
|
+
modelSize: d,
|
|
4111
4111
|
meshColor: $t,
|
|
4112
|
-
displayUnit:
|
|
4113
|
-
}) :
|
|
4112
|
+
displayUnit: k
|
|
4113
|
+
}) : L(Te, {
|
|
4114
4114
|
children: [
|
|
4115
4115
|
i(zo, {
|
|
4116
4116
|
mesh: Gt ?? n,
|
|
4117
4117
|
startY: ge,
|
|
4118
4118
|
endY: G,
|
|
4119
4119
|
spacing: nt,
|
|
4120
|
-
modelSize:
|
|
4120
|
+
modelSize: d,
|
|
4121
4121
|
onMeasurementsChange: X,
|
|
4122
4122
|
reverseOrder: true,
|
|
4123
|
-
displayUnit:
|
|
4123
|
+
displayUnit: k,
|
|
4124
4124
|
useInnerSurface: Y && !Z,
|
|
4125
4125
|
formMeasurements: et ? Ae : void 0,
|
|
4126
4126
|
originY: Bt ?? R.position.y,
|
|
@@ -4129,9 +4129,9 @@ let __tla = (async () => {
|
|
|
4129
4129
|
i(Ao, {
|
|
4130
4130
|
mesh: n,
|
|
4131
4131
|
greenY: R.position.y,
|
|
4132
|
-
modelSize:
|
|
4133
|
-
displayUnit:
|
|
4134
|
-
bottomY: Y ?
|
|
4132
|
+
modelSize: d,
|
|
4133
|
+
displayUnit: k,
|
|
4134
|
+
bottomY: Y ? W.position.y : void 0
|
|
4135
4135
|
}),
|
|
4136
4136
|
i(Do, {
|
|
4137
4137
|
mesh: n,
|
|
@@ -4143,7 +4143,7 @@ let __tla = (async () => {
|
|
|
4143
4143
|
},
|
|
4144
4144
|
minY: R.position.y - nt,
|
|
4145
4145
|
maxY: R.position.y + nt,
|
|
4146
|
-
modelSize:
|
|
4146
|
+
modelSize: d,
|
|
4147
4147
|
color: "#44ff44",
|
|
4148
4148
|
hoverColor: "#88ff88",
|
|
4149
4149
|
dragColor: "#ffffff",
|
|
@@ -4159,7 +4159,7 @@ let __tla = (async () => {
|
|
|
4159
4159
|
}),
|
|
4160
4160
|
n && e.showDebug && Be && S === "3D" && i(Uo, {
|
|
4161
4161
|
mesh: n,
|
|
4162
|
-
modelSize:
|
|
4162
|
+
modelSize: d,
|
|
4163
4163
|
layers: Rt,
|
|
4164
4164
|
landmarkPoints: T,
|
|
4165
4165
|
componentDebug: null,
|
|
@@ -4170,13 +4170,13 @@ let __tla = (async () => {
|
|
|
4170
4170
|
i(tr, {
|
|
4171
4171
|
screenshotFnRef: Pn,
|
|
4172
4172
|
mesh: n,
|
|
4173
|
-
modelSize:
|
|
4173
|
+
modelSize: d,
|
|
4174
4174
|
measurementGeometry: xe
|
|
4175
4175
|
})
|
|
4176
4176
|
]
|
|
4177
4177
|
})
|
|
4178
4178
|
}),
|
|
4179
|
-
n &&
|
|
4179
|
+
n && L("div", {
|
|
4180
4180
|
style: {
|
|
4181
4181
|
position: "absolute",
|
|
4182
4182
|
top: 16,
|
|
@@ -4224,13 +4224,13 @@ let __tla = (async () => {
|
|
|
4224
4224
|
}),
|
|
4225
4225
|
e.showDebug && Be && n && S === "3D" && i(qo, {
|
|
4226
4226
|
layers: Rt,
|
|
4227
|
-
onToggleLayer: (
|
|
4227
|
+
onToggleLayer: (v) => zn((_) => ({
|
|
4228
4228
|
..._,
|
|
4229
|
-
[
|
|
4229
|
+
[v]: !_[v]
|
|
4230
4230
|
})),
|
|
4231
4231
|
isDoubleShell: Y
|
|
4232
4232
|
}),
|
|
4233
|
-
ee && V.length > 0 &&
|
|
4233
|
+
ee && V.length > 0 && L("div", {
|
|
4234
4234
|
style: {
|
|
4235
4235
|
position: "absolute",
|
|
4236
4236
|
top: 16,
|
|
@@ -4240,7 +4240,7 @@ let __tla = (async () => {
|
|
|
4240
4240
|
zIndex: 10
|
|
4241
4241
|
},
|
|
4242
4242
|
children: [
|
|
4243
|
-
|
|
4243
|
+
L("div", {
|
|
4244
4244
|
style: {
|
|
4245
4245
|
display: "flex",
|
|
4246
4246
|
borderRadius: 6,
|
|
@@ -4280,7 +4280,7 @@ let __tla = (async () => {
|
|
|
4280
4280
|
})
|
|
4281
4281
|
]
|
|
4282
4282
|
}),
|
|
4283
|
-
|
|
4283
|
+
L("div", {
|
|
4284
4284
|
style: {
|
|
4285
4285
|
display: "flex",
|
|
4286
4286
|
borderRadius: 6,
|
|
@@ -4294,9 +4294,9 @@ let __tla = (async () => {
|
|
|
4294
4294
|
style: {
|
|
4295
4295
|
padding: "6px 14px",
|
|
4296
4296
|
fontSize: 13,
|
|
4297
|
-
fontWeight:
|
|
4298
|
-
backgroundColor:
|
|
4299
|
-
color:
|
|
4297
|
+
fontWeight: k === "mm" ? 600 : 400,
|
|
4298
|
+
backgroundColor: k === "mm" ? "rgb(12, 67, 173)" : "#fff",
|
|
4299
|
+
color: k === "mm" ? "#fff" : "#666",
|
|
4300
4300
|
border: "none",
|
|
4301
4301
|
cursor: "pointer",
|
|
4302
4302
|
fontFamily: "system-ui, sans-serif"
|
|
@@ -4308,9 +4308,9 @@ let __tla = (async () => {
|
|
|
4308
4308
|
style: {
|
|
4309
4309
|
padding: "6px 14px",
|
|
4310
4310
|
fontSize: 13,
|
|
4311
|
-
fontWeight:
|
|
4312
|
-
backgroundColor:
|
|
4313
|
-
color:
|
|
4311
|
+
fontWeight: k === "inch" ? 600 : 400,
|
|
4312
|
+
backgroundColor: k === "inch" ? "rgb(12, 67, 173)" : "#fff",
|
|
4313
|
+
color: k === "inch" ? "#fff" : "#666",
|
|
4314
4314
|
border: "none",
|
|
4315
4315
|
borderLeft: "1px solid #ccc",
|
|
4316
4316
|
cursor: "pointer",
|
|
@@ -4320,7 +4320,7 @@ let __tla = (async () => {
|
|
|
4320
4320
|
})
|
|
4321
4321
|
]
|
|
4322
4322
|
}),
|
|
4323
|
-
e.showSpacingToggle && S === "3D" &&
|
|
4323
|
+
e.showSpacingToggle && S === "3D" && L("div", {
|
|
4324
4324
|
style: {
|
|
4325
4325
|
display: "flex",
|
|
4326
4326
|
borderRadius: 6,
|
|
@@ -4330,13 +4330,13 @@ let __tla = (async () => {
|
|
|
4330
4330
|
},
|
|
4331
4331
|
children: [
|
|
4332
4332
|
i("button", {
|
|
4333
|
-
onClick: () =>
|
|
4333
|
+
onClick: () => P(1),
|
|
4334
4334
|
style: {
|
|
4335
4335
|
padding: "6px 14px",
|
|
4336
4336
|
fontSize: 13,
|
|
4337
|
-
fontWeight:
|
|
4338
|
-
backgroundColor:
|
|
4339
|
-
color:
|
|
4337
|
+
fontWeight: F === 1 ? 600 : 400,
|
|
4338
|
+
backgroundColor: F === 1 ? "rgb(12, 67, 173)" : "#fff",
|
|
4339
|
+
color: F === 1 ? "#fff" : "#666",
|
|
4340
4340
|
border: "none",
|
|
4341
4341
|
cursor: "pointer",
|
|
4342
4342
|
fontFamily: "system-ui, sans-serif"
|
|
@@ -4344,13 +4344,13 @@ let __tla = (async () => {
|
|
|
4344
4344
|
children: '1"'
|
|
4345
4345
|
}),
|
|
4346
4346
|
i("button", {
|
|
4347
|
-
onClick: () =>
|
|
4347
|
+
onClick: () => P(2),
|
|
4348
4348
|
style: {
|
|
4349
4349
|
padding: "6px 14px",
|
|
4350
4350
|
fontSize: 13,
|
|
4351
|
-
fontWeight:
|
|
4352
|
-
backgroundColor:
|
|
4353
|
-
color:
|
|
4351
|
+
fontWeight: F === 2 ? 600 : 400,
|
|
4352
|
+
backgroundColor: F === 2 ? "rgb(12, 67, 173)" : "#fff",
|
|
4353
|
+
color: F === 2 ? "#fff" : "#666",
|
|
4354
4354
|
border: "none",
|
|
4355
4355
|
borderLeft: "1px solid #ccc",
|
|
4356
4356
|
cursor: "pointer",
|
|
@@ -4369,7 +4369,7 @@ let __tla = (async () => {
|
|
|
4369
4369
|
boxShadow: "0 2px 8px rgba(0,0,0,0.1)"
|
|
4370
4370
|
},
|
|
4371
4371
|
children: i("button", {
|
|
4372
|
-
onClick: () => Et((
|
|
4372
|
+
onClick: () => Et((v) => !v),
|
|
4373
4373
|
style: {
|
|
4374
4374
|
padding: "6px 14px",
|
|
4375
4375
|
fontSize: 13,
|
|
@@ -4393,13 +4393,13 @@ let __tla = (async () => {
|
|
|
4393
4393
|
},
|
|
4394
4394
|
children: i("button", {
|
|
4395
4395
|
onClick: async () => {
|
|
4396
|
-
const
|
|
4397
|
-
if (!
|
|
4398
|
-
const _ = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10),
|
|
4396
|
+
const v = await Ke();
|
|
4397
|
+
if (!v) return;
|
|
4398
|
+
const _ = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), W = (R, ge) => {
|
|
4399
4399
|
const G = document.createElement("a");
|
|
4400
4400
|
G.href = R, G.download = ge, G.click();
|
|
4401
4401
|
};
|
|
4402
|
-
|
|
4402
|
+
W(v.frontal_view_png, `measurements_front_${_}.png`), await new Promise((R) => setTimeout(R, 300)), W(v.side_view_png, `measurements_transverse_${_}.png`);
|
|
4403
4403
|
},
|
|
4404
4404
|
style: {
|
|
4405
4405
|
padding: "6px 14px",
|
|
@@ -4414,7 +4414,7 @@ let __tla = (async () => {
|
|
|
4414
4414
|
children: "Save"
|
|
4415
4415
|
})
|
|
4416
4416
|
}),
|
|
4417
|
-
e.showDebug &&
|
|
4417
|
+
e.showDebug && s && i("div", {
|
|
4418
4418
|
style: {
|
|
4419
4419
|
display: "flex",
|
|
4420
4420
|
borderRadius: 6,
|
|
@@ -4423,7 +4423,7 @@ let __tla = (async () => {
|
|
|
4423
4423
|
boxShadow: "0 2px 8px rgba(0,0,0,0.1)"
|
|
4424
4424
|
},
|
|
4425
4425
|
children: i("button", {
|
|
4426
|
-
onClick: () => Mn((
|
|
4426
|
+
onClick: () => Mn((v) => !v),
|
|
4427
4427
|
style: {
|
|
4428
4428
|
padding: "6px 14px",
|
|
4429
4429
|
fontSize: 13,
|
|
@@ -4445,11 +4445,11 @@ let __tla = (async () => {
|
|
|
4445
4445
|
}),
|
|
4446
4446
|
n && we && ee && i(Po, {
|
|
4447
4447
|
isDoubleShell: Y,
|
|
4448
|
-
onDismiss: () =>
|
|
4448
|
+
onDismiss: () => ne(false)
|
|
4449
4449
|
})
|
|
4450
4450
|
]
|
|
4451
4451
|
}),
|
|
4452
|
-
|
|
4452
|
+
L("div", {
|
|
4453
4453
|
style: {
|
|
4454
4454
|
padding: "12px 24px",
|
|
4455
4455
|
backgroundColor: "#fff",
|
|
@@ -4494,7 +4494,7 @@ let __tla = (async () => {
|
|
|
4494
4494
|
lineHeight: "36px"
|
|
4495
4495
|
},
|
|
4496
4496
|
children: "Continue"
|
|
4497
|
-
}) :
|
|
4497
|
+
}) : L(Te, {
|
|
4498
4498
|
children: [
|
|
4499
4499
|
i("button", {
|
|
4500
4500
|
onClick: () => Mt("use_form_measurements"),
|
|
@@ -4536,7 +4536,7 @@ let __tla = (async () => {
|
|
|
4536
4536
|
})
|
|
4537
4537
|
]
|
|
4538
4538
|
}),
|
|
4539
|
-
|
|
4539
|
+
s && yt.length > 0 && L("div", {
|
|
4540
4540
|
style: {
|
|
4541
4541
|
height: 120,
|
|
4542
4542
|
flexShrink: 0,
|
|
@@ -4549,7 +4549,7 @@ let __tla = (async () => {
|
|
|
4549
4549
|
flexDirection: "column"
|
|
4550
4550
|
},
|
|
4551
4551
|
children: [
|
|
4552
|
-
|
|
4552
|
+
L("div", {
|
|
4553
4553
|
style: {
|
|
4554
4554
|
display: "flex",
|
|
4555
4555
|
alignItems: "center",
|
|
@@ -4569,14 +4569,14 @@ let __tla = (async () => {
|
|
|
4569
4569
|
},
|
|
4570
4570
|
children: "GALILEO DEBUG"
|
|
4571
4571
|
}),
|
|
4572
|
-
|
|
4572
|
+
L("div", {
|
|
4573
4573
|
style: {
|
|
4574
4574
|
display: "flex",
|
|
4575
4575
|
gap: 8,
|
|
4576
4576
|
alignItems: "center"
|
|
4577
4577
|
},
|
|
4578
4578
|
children: [
|
|
4579
|
-
|
|
4579
|
+
L("span", {
|
|
4580
4580
|
style: {
|
|
4581
4581
|
color: "#484f58",
|
|
4582
4582
|
fontSize: 9
|
|
@@ -4618,14 +4618,14 @@ let __tla = (async () => {
|
|
|
4618
4618
|
padding: "4px 10px",
|
|
4619
4619
|
lineHeight: 1.6
|
|
4620
4620
|
},
|
|
4621
|
-
children: yt.map((
|
|
4622
|
-
const
|
|
4621
|
+
children: yt.map((v, _) => {
|
|
4622
|
+
const W = v.includes("ERROR") || v.includes("failed"), R = v.includes("warning") || v.includes("WARN"), ge = v.includes("PIPELINE:"), G = v.includes("STATE:");
|
|
4623
4623
|
return i("div", {
|
|
4624
4624
|
style: {
|
|
4625
|
-
color:
|
|
4625
|
+
color: W ? "#f85149" : R ? "#d29922" : ge ? "#58a6ff" : G ? "#3fb950" : "#8b949e",
|
|
4626
4626
|
whiteSpace: "pre"
|
|
4627
4627
|
},
|
|
4628
|
-
children:
|
|
4628
|
+
children: v
|
|
4629
4629
|
}, _);
|
|
4630
4630
|
})
|
|
4631
4631
|
})
|
|
@@ -4635,7 +4635,7 @@ let __tla = (async () => {
|
|
|
4635
4635
|
}),
|
|
4636
4636
|
ee && Tt && w && i(To, {
|
|
4637
4637
|
amputationType: w,
|
|
4638
|
-
spacingInches:
|
|
4638
|
+
spacingInches: F,
|
|
4639
4639
|
scanMeasurements: V,
|
|
4640
4640
|
scanFrontalHeight: Qe,
|
|
4641
4641
|
onSave: En,
|
|
@@ -4645,7 +4645,7 @@ let __tla = (async () => {
|
|
|
4645
4645
|
});
|
|
4646
4646
|
};
|
|
4647
4647
|
function tr({ screenshotFnRef: e }) {
|
|
4648
|
-
return
|
|
4648
|
+
return re(() => {
|
|
4649
4649
|
e.current = null;
|
|
4650
4650
|
}, [
|
|
4651
4651
|
e
|
|
@@ -4672,84 +4672,64 @@ let __tla = (async () => {
|
|
|
4672
4672
|
};
|
|
4673
4673
|
lt = function(e, r) {
|
|
4674
4674
|
const t = wn(r), o = {};
|
|
4675
|
-
for (let
|
|
4676
|
-
const
|
|
4677
|
-
|
|
4675
|
+
for (let l = 0; l < Math.min(e.length, t.length); l++) {
|
|
4676
|
+
const s = e[l];
|
|
4677
|
+
s != null && !isNaN(s) && (o[t[l]] = s);
|
|
4678
4678
|
}
|
|
4679
4679
|
return o;
|
|
4680
4680
|
};
|
|
4681
4681
|
nr = function(e, r) {
|
|
4682
4682
|
if (!e) return;
|
|
4683
|
-
const o = wn(r).map((
|
|
4684
|
-
const
|
|
4685
|
-
return
|
|
4683
|
+
const o = wn(r).map((l) => {
|
|
4684
|
+
const s = e[l];
|
|
4685
|
+
return s ?? void 0;
|
|
4686
4686
|
});
|
|
4687
|
-
if (!o.every((
|
|
4687
|
+
if (!o.every((l) => l == null)) return o;
|
|
4688
4688
|
};
|
|
4689
4689
|
pr = ({ request: e, onComplete: r, wasmModule: t }) => {
|
|
4690
|
-
const
|
|
4691
|
-
ne(() => {
|
|
4692
|
-
if (t !== void 0) {
|
|
4693
|
-
c(true);
|
|
4694
|
-
return;
|
|
4695
|
-
}
|
|
4696
|
-
let l = false;
|
|
4697
|
-
return import("geo-wasm").then(async (m) => {
|
|
4698
|
-
await m.__tla;
|
|
4699
|
-
return m;
|
|
4700
|
-
}).then(async (f) => {
|
|
4701
|
-
await f.default(), l || (s(f), c(true));
|
|
4702
|
-
}).catch(() => {
|
|
4703
|
-
l || c(true);
|
|
4704
|
-
}), () => {
|
|
4705
|
-
l = true;
|
|
4706
|
-
};
|
|
4707
|
-
}, [
|
|
4708
|
-
t
|
|
4709
|
-
]);
|
|
4710
|
-
const a = t !== void 0 ? t : o, n = j(() => nr(e.form_measurements, e.spacing_type), [
|
|
4690
|
+
const o = j(() => nr(e.form_measurements, e.spacing_type), [
|
|
4711
4691
|
e.form_measurements,
|
|
4712
4692
|
e.spacing_type
|
|
4713
|
-
]),
|
|
4693
|
+
]), l = (s) => {
|
|
4714
4694
|
var _a, _b;
|
|
4715
|
-
const
|
|
4716
|
-
let
|
|
4717
|
-
if (
|
|
4718
|
-
|
|
4719
|
-
const
|
|
4695
|
+
const c = s.scanMeasurements.map((f) => +(f.modifiedValue ?? f.originalValue).toFixed(1)), a = lt(c, e.spacing_type);
|
|
4696
|
+
let n, h;
|
|
4697
|
+
if (s.formMeasurements) {
|
|
4698
|
+
n = lt(s.formMeasurements, e.spacing_type);
|
|
4699
|
+
const f = s.scanMeasurements.map((m, x) => {
|
|
4720
4700
|
var _a2;
|
|
4721
|
-
const
|
|
4722
|
-
return
|
|
4701
|
+
const S = (_a2 = s.formMeasurements) == null ? void 0 : _a2[x];
|
|
4702
|
+
return S == null || isNaN(S) ? null : +((m.modifiedValue ?? m.originalValue) - S).toFixed(1);
|
|
4723
4703
|
});
|
|
4724
|
-
|
|
4704
|
+
h = lt(f, e.spacing_type);
|
|
4725
4705
|
}
|
|
4726
|
-
const
|
|
4706
|
+
const d = s.userEnteredMeasurements ? lt(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 = {
|
|
4727
4707
|
spacing_type: e.spacing_type,
|
|
4728
4708
|
source_unit: "mm",
|
|
4729
|
-
file_format:
|
|
4730
|
-
measurement_source:
|
|
4731
|
-
is_double_wall:
|
|
4709
|
+
file_format: s.fileFormat,
|
|
4710
|
+
measurement_source: s.formMeasurements ? "form_provided" : "scan_derived",
|
|
4711
|
+
is_double_wall: s.isDoubleWall,
|
|
4732
4712
|
is_unit_converted: false,
|
|
4733
|
-
form_measurements:
|
|
4734
|
-
scan_measurements:
|
|
4735
|
-
measurement_variance:
|
|
4713
|
+
form_measurements: n,
|
|
4714
|
+
scan_measurements: a,
|
|
4715
|
+
measurement_variance: h,
|
|
4736
4716
|
scan_url: e.scan_url,
|
|
4737
|
-
frontal_height: +
|
|
4738
|
-
transverse_ml: +
|
|
4739
|
-
transverse_ap: +
|
|
4740
|
-
decision:
|
|
4741
|
-
skip_reason:
|
|
4742
|
-
user_measurements:
|
|
4743
|
-
user_frontal_height: (_b =
|
|
4744
|
-
final_measurements:
|
|
4745
|
-
final_frontal_height:
|
|
4746
|
-
final_transverse_ml: +
|
|
4747
|
-
final_transverse_ap: +
|
|
4748
|
-
screenshots:
|
|
4717
|
+
frontal_height: +s.frontalHeight.toFixed(1),
|
|
4718
|
+
transverse_ml: +s.transverseML.toFixed(1),
|
|
4719
|
+
transverse_ap: +s.transverseAP.toFixed(1),
|
|
4720
|
+
decision: s.decision,
|
|
4721
|
+
skip_reason: s.skipReason,
|
|
4722
|
+
user_measurements: d,
|
|
4723
|
+
user_frontal_height: (_b = s.userEnteredMeasurements) == null ? void 0 : _b.frontalHeight,
|
|
4724
|
+
final_measurements: p,
|
|
4725
|
+
final_frontal_height: g,
|
|
4726
|
+
final_transverse_ml: +s.transverseML.toFixed(1),
|
|
4727
|
+
final_transverse_ap: +s.transverseAP.toFixed(1),
|
|
4728
|
+
screenshots: s.screenshots
|
|
4749
4729
|
};
|
|
4750
|
-
r == null ? void 0 : r(
|
|
4730
|
+
r == null ? void 0 : r(M);
|
|
4751
4731
|
};
|
|
4752
|
-
return
|
|
4732
|
+
return i("div", {
|
|
4753
4733
|
style: {
|
|
4754
4734
|
width: "100%",
|
|
4755
4735
|
height: "100%",
|
|
@@ -4759,20 +4739,9 @@ let __tla = (async () => {
|
|
|
4759
4739
|
config: eo,
|
|
4760
4740
|
spacingType: e.spacing_type,
|
|
4761
4741
|
scanUrl: e.scan_url,
|
|
4762
|
-
formMeasurements:
|
|
4763
|
-
onComplete:
|
|
4764
|
-
wasmModule:
|
|
4765
|
-
})
|
|
4766
|
-
}) : i("div", {
|
|
4767
|
-
style: {
|
|
4768
|
-
width: "100%",
|
|
4769
|
-
height: "100%",
|
|
4770
|
-
display: "flex",
|
|
4771
|
-
alignItems: "center",
|
|
4772
|
-
justifyContent: "center"
|
|
4773
|
-
},
|
|
4774
|
-
children: i("span", {
|
|
4775
|
-
children: "Initializing..."
|
|
4742
|
+
formMeasurements: o,
|
|
4743
|
+
onComplete: l,
|
|
4744
|
+
wasmModule: t
|
|
4776
4745
|
})
|
|
4777
4746
|
});
|
|
4778
4747
|
};
|