@solid-labs/fab-one-widget 1.1.10 → 1.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { jsxs as y, jsx as i, Fragment as We } from "react/jsx-runtime";
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { useFrame as
|
|
4
|
-
import { Html as Xe, Line as
|
|
5
|
-
import * as
|
|
6
|
-
import { Plane as
|
|
7
|
-
import { create as
|
|
2
|
+
import { createContext as Wo, Component as Ro, useCallback as de, useMemo as te, useState as E, memo as _o, useEffect as Z, useRef as ue, forwardRef as Io, createElement as Mn } from "react";
|
|
3
|
+
import { useFrame as Bn, useThree as En, Canvas as Bo } from "@react-three/fiber";
|
|
4
|
+
import { Html as Xe, Line as ve, OrbitControls as $n } from "@react-three/drei";
|
|
5
|
+
import * as q from "three";
|
|
6
|
+
import { Plane as Ct, Vector3 as P, Box3 as Tn, Line3 as On, Raycaster as Eo } from "three";
|
|
7
|
+
import { create as $o } from "zustand";
|
|
8
8
|
import { OBJLoader as Hn } from "three/examples/jsm/loaders/OBJLoader.js";
|
|
9
9
|
import { STLLoader as Nn } from "three/examples/jsm/loaders/STLLoader.js";
|
|
10
|
-
import { unzipSync as
|
|
11
|
-
import { PLYLoader as
|
|
12
|
-
import { MeshBVH as
|
|
13
|
-
let
|
|
10
|
+
import { unzipSync as To } from "three/examples/jsm/libs/fflate.module.js";
|
|
11
|
+
import { PLYLoader as Oo } from "three/examples/jsm/loaders/PLYLoader.js";
|
|
12
|
+
import { MeshBVH as At } from "three-mesh-bvh";
|
|
13
|
+
let ci, wt, Kr, Jn, Jt;
|
|
14
14
|
let __tla = (async () => {
|
|
15
|
-
let
|
|
16
|
-
|
|
15
|
+
let Ho, No, Vo, jo, zt, Kt, vt, Xo;
|
|
16
|
+
Ho = {
|
|
17
17
|
showDragDrop: true,
|
|
18
18
|
showStartOver: true,
|
|
19
19
|
showDebug: true,
|
|
@@ -23,7 +23,7 @@ let __tla = (async () => {
|
|
|
23
23
|
showToolbar: false,
|
|
24
24
|
showSaveButton: true
|
|
25
25
|
};
|
|
26
|
-
|
|
26
|
+
No = {
|
|
27
27
|
showDragDrop: false,
|
|
28
28
|
showStartOver: false,
|
|
29
29
|
showDebug: false,
|
|
@@ -33,8 +33,8 @@ let __tla = (async () => {
|
|
|
33
33
|
showToolbar: false,
|
|
34
34
|
showSaveButton: false
|
|
35
35
|
};
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
Vo = Wo(Ho);
|
|
37
|
+
Jt = $o((e, o) => ({
|
|
38
38
|
landmarkPoints: [],
|
|
39
39
|
isAligned: false,
|
|
40
40
|
isCut: false,
|
|
@@ -74,17 +74,17 @@ let __tla = (async () => {
|
|
|
74
74
|
isCut: false
|
|
75
75
|
})
|
|
76
76
|
}));
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
77
|
+
jo = 0.45;
|
|
78
|
+
zt = 3;
|
|
79
|
+
Kt = 1e-3;
|
|
80
|
+
vt = 25.4;
|
|
81
|
+
Xo = [
|
|
82
82
|
0.25,
|
|
83
83
|
-0.25,
|
|
84
84
|
0.5,
|
|
85
85
|
-0.5
|
|
86
86
|
];
|
|
87
|
-
function
|
|
87
|
+
function Go(e) {
|
|
88
88
|
var _a;
|
|
89
89
|
const o = e.match(/^v\s+\S+\s+\S+\s+\S+(.*)$/m);
|
|
90
90
|
if (!o || !((_a = o[1]) == null ? void 0 : _a.trim().includes(" "))) return null;
|
|
@@ -95,8 +95,8 @@ let __tla = (async () => {
|
|
|
95
95
|
const a = d.trim().split(/\s+/);
|
|
96
96
|
if (a.length >= 7) {
|
|
97
97
|
n.push(parseFloat(a[1]), parseFloat(a[2]), parseFloat(a[3]));
|
|
98
|
-
let r = parseFloat(a[4]), c = parseFloat(a[5]),
|
|
99
|
-
(r > 1 || c > 1 ||
|
|
98
|
+
let r = parseFloat(a[4]), c = parseFloat(a[5]), u = parseFloat(a[6]);
|
|
99
|
+
(r > 1 || c > 1 || u > 1) && (r /= 255, c /= 255, u /= 255), s.push(r, c, u), l = true;
|
|
100
100
|
} else a.length >= 4 && (n.push(parseFloat(a[1]), parseFloat(a[2]), parseFloat(a[3])), s.push(0, 0, 0));
|
|
101
101
|
}
|
|
102
102
|
return l ? {
|
|
@@ -104,38 +104,38 @@ let __tla = (async () => {
|
|
|
104
104
|
colors: new Float32Array(s)
|
|
105
105
|
} : null;
|
|
106
106
|
}
|
|
107
|
-
function
|
|
107
|
+
function Yo(e, o, t, n) {
|
|
108
108
|
const s = e.getAttribute("position"), l = s.count, d = new Float32Array(l * 3), a = o.length / 3;
|
|
109
|
-
let r = 1 / 0, c = 1 / 0,
|
|
109
|
+
let r = 1 / 0, c = 1 / 0, u = 1 / 0, p = -1 / 0, f = -1 / 0, m = -1 / 0;
|
|
110
110
|
for (let I = 0; I < a; I++) {
|
|
111
|
-
const
|
|
112
|
-
|
|
111
|
+
const W = o[I * 3] * n, $ = o[I * 3 + 1] * n, G = o[I * 3 + 2] * n;
|
|
112
|
+
W < r && (r = W), W > p && (p = W), $ < c && (c = $), $ > f && (f = $), G < u && (u = G), G > m && (m = G);
|
|
113
113
|
}
|
|
114
|
-
const v = (r +
|
|
114
|
+
const v = (r + p) * 0.5, h = (c + f) * 0.5, x = (u + m) * 0.5, w = p - r + 1e-6, C = f - c + 1e-6, b = m - u + 1e-6, F = w * 0.5, S = C * 0.5, A = b * 0.5, z = Math.min(128, Math.max(16, Math.round(Math.cbrt(a)))), _ = w / z, B = C / z, N = b / z, k = /* @__PURE__ */ new Map();
|
|
115
115
|
for (let I = 0; I < a; I++) {
|
|
116
|
-
const
|
|
117
|
-
let
|
|
118
|
-
|
|
116
|
+
const W = o[I * 3] * n - v, $ = o[I * 3 + 1] * n - h, G = o[I * 3 + 2] * n - x, oe = Math.min(z - 1, Math.max(0, Math.floor((W + F) / _))), ce = Math.min(z - 1, Math.max(0, Math.floor(($ + S) / B))), se = Math.min(z - 1, Math.max(0, Math.floor((G + A) / N))), J = oe * z * z + ce * z + se;
|
|
117
|
+
let ae = k.get(J);
|
|
118
|
+
ae || (ae = [], k.set(J, ae)), ae.push(I);
|
|
119
119
|
}
|
|
120
120
|
for (let I = 0; I < l; I++) {
|
|
121
|
-
const
|
|
122
|
-
let
|
|
123
|
-
for (let
|
|
124
|
-
for (let
|
|
125
|
-
if (
|
|
126
|
-
const
|
|
127
|
-
if (
|
|
128
|
-
const
|
|
129
|
-
if (
|
|
130
|
-
const fe = o[K * 3] * n - v,
|
|
131
|
-
|
|
121
|
+
const W = s.getX(I), $ = s.getY(I), G = s.getZ(I), oe = Math.min(z - 1, Math.max(0, Math.floor((W + F) / _))), ce = Math.min(z - 1, Math.max(0, Math.floor(($ + S) / B))), se = Math.min(z - 1, Math.max(0, Math.floor((G + A) / N)));
|
|
122
|
+
let J = 1 / 0, ae = 0;
|
|
123
|
+
for (let U = 0; U <= z && J > 0; U++) {
|
|
124
|
+
for (let ge = -U; ge <= U; ge++) for (let re = -U; re <= U; re++) for (let R = -U; R <= U; R++) {
|
|
125
|
+
if (U > 0 && Math.abs(ge) < U && Math.abs(re) < U && Math.abs(R) < U) continue;
|
|
126
|
+
const H = oe + ge, ne = ce + re, Q = se + R;
|
|
127
|
+
if (H < 0 || H >= z || ne < 0 || ne >= z || Q < 0 || Q >= z) continue;
|
|
128
|
+
const j = k.get(H * z * z + ne * z + Q);
|
|
129
|
+
if (j) for (const K of j) {
|
|
130
|
+
const fe = o[K * 3] * n - v, ie = o[K * 3 + 1] * n - h, pe = o[K * 3 + 2] * n - x, he = (W - fe) ** 2 + ($ - ie) ** 2 + (G - pe) ** 2;
|
|
131
|
+
he < J && (J = he, ae = K);
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
|
-
if (
|
|
134
|
+
if (J < 1 / 0) break;
|
|
135
135
|
}
|
|
136
|
-
d[I * 3] = t[
|
|
136
|
+
d[I * 3] = t[ae * 3], d[I * 3 + 1] = t[ae * 3 + 1], d[I * 3 + 2] = t[ae * 3 + 2];
|
|
137
137
|
}
|
|
138
|
-
e.setAttribute("color", new
|
|
138
|
+
e.setAttribute("color", new q.Float32BufferAttribute(d, 3));
|
|
139
139
|
}
|
|
140
140
|
const Pn = {
|
|
141
141
|
debug: 0,
|
|
@@ -144,7 +144,7 @@ let __tla = (async () => {
|
|
|
144
144
|
error: 3
|
|
145
145
|
};
|
|
146
146
|
let Vn = "warn", jn = null;
|
|
147
|
-
const
|
|
147
|
+
const xe = {
|
|
148
148
|
setLevel(e) {
|
|
149
149
|
Vn = e;
|
|
150
150
|
},
|
|
@@ -152,19 +152,19 @@ let __tla = (async () => {
|
|
|
152
152
|
jn = e;
|
|
153
153
|
},
|
|
154
154
|
debug(e, o, t) {
|
|
155
|
-
|
|
155
|
+
bt("debug", e, o, t);
|
|
156
156
|
},
|
|
157
157
|
info(e, o, t) {
|
|
158
|
-
|
|
158
|
+
bt("info", e, o, t);
|
|
159
159
|
},
|
|
160
160
|
warn(e, o, t) {
|
|
161
|
-
|
|
161
|
+
bt("warn", e, o, t);
|
|
162
162
|
},
|
|
163
163
|
error(e, o, t) {
|
|
164
|
-
|
|
164
|
+
bt("error", e, o, t);
|
|
165
165
|
}
|
|
166
166
|
};
|
|
167
|
-
function
|
|
167
|
+
function bt(e, o, t, n) {
|
|
168
168
|
if (Pn[e] < Pn[Vn]) return;
|
|
169
169
|
const s = `[${o}]`, l = n !== void 0 ? [
|
|
170
170
|
s,
|
|
@@ -190,7 +190,7 @@ let __tla = (async () => {
|
|
|
190
190
|
}
|
|
191
191
|
jn == null ? void 0 : jn(e, o, t, n);
|
|
192
192
|
}
|
|
193
|
-
function
|
|
193
|
+
function St(e) {
|
|
194
194
|
const o = e.getAttribute("position"), t = new Float32Array(o.array), n = e.getIndex();
|
|
195
195
|
if (n) return {
|
|
196
196
|
positions: t,
|
|
@@ -204,50 +204,50 @@ let __tla = (async () => {
|
|
|
204
204
|
};
|
|
205
205
|
}
|
|
206
206
|
function Xn(e, o) {
|
|
207
|
-
const t = new
|
|
208
|
-
return t.setAttribute("position", new
|
|
207
|
+
const t = new q.BufferGeometry();
|
|
208
|
+
return t.setAttribute("position", new q.Float32BufferAttribute(e, 3)), t.setIndex(new q.BufferAttribute(o, 1)), t.computeVertexNormals(), t;
|
|
209
209
|
}
|
|
210
|
-
async function
|
|
210
|
+
async function Ko(e, o, t) {
|
|
211
211
|
try {
|
|
212
|
-
const n =
|
|
212
|
+
const n = Go(e);
|
|
213
213
|
t == null ? void 0 : t("Parsing mesh...");
|
|
214
214
|
const l = new Hn().parse(e);
|
|
215
215
|
let d = null;
|
|
216
216
|
if (l.traverse((w) => {
|
|
217
217
|
w.isMesh && !d && (d = w.geometry);
|
|
218
218
|
}), !d) return null;
|
|
219
|
-
const { positions: a, indices: r } =
|
|
220
|
-
if (a.length < 9 || r.length < 3) return
|
|
221
|
-
for (let w = 0; w < Math.min(a.length, 300); w++) if (!isFinite(a[w])) return
|
|
219
|
+
const { positions: a, indices: r } = St(d);
|
|
220
|
+
if (a.length < 9 || r.length < 3) return xe.warn("wasm", `Mesh too small: positions=${a.length} indices=${r.length}`), null;
|
|
221
|
+
for (let w = 0; w < Math.min(a.length, 300); w++) if (!isFinite(a[w])) return xe.error("wasm", `Invalid position data: NaN/Infinity at index ${w}`), null;
|
|
222
222
|
const c = a.length / 3;
|
|
223
|
-
for (let w = 0; w < Math.min(r.length, 300); w++) if (r[w] >= c) return
|
|
223
|
+
for (let w = 0; w < Math.min(r.length, 300); w++) if (r[w] >= c) return xe.error("wasm", `Out-of-bounds index: ${r[w]} >= ${c}`), null;
|
|
224
224
|
t == null ? void 0 : t("Processing mesh (WASM)...");
|
|
225
|
-
const
|
|
226
|
-
if (
|
|
225
|
+
const u = o.preprocess_mesh(a, r, 10, 100, 1e-4, 500), p = u.positions(), f = u.indices(), m = u.unit_converted(), v = u.detected_unit(), h = u.log();
|
|
226
|
+
if (xe.debug("wasm", "preprocess result", h), p.length === 0) return null;
|
|
227
227
|
t == null ? void 0 : t("Building geometry...");
|
|
228
|
-
const x = Xn(
|
|
228
|
+
const x = Xn(p, f);
|
|
229
229
|
if (n) {
|
|
230
230
|
const w = v === "meter" ? 1e3 : v === "cm" ? 10 : 1;
|
|
231
|
-
|
|
231
|
+
Yo(x, n.positions, n.colors, w);
|
|
232
232
|
}
|
|
233
233
|
return {
|
|
234
234
|
geometry: x,
|
|
235
|
-
wasScaled:
|
|
236
|
-
unitConverted:
|
|
235
|
+
wasScaled: m,
|
|
236
|
+
unitConverted: m,
|
|
237
237
|
detectedUnit: v
|
|
238
238
|
};
|
|
239
239
|
} catch (n) {
|
|
240
|
-
return
|
|
240
|
+
return xe.error("wasm", "Processing failed", n), null;
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
|
-
function
|
|
243
|
+
function Zo(e) {
|
|
244
244
|
const t = new Hn().parse(e);
|
|
245
245
|
let n = null;
|
|
246
246
|
return t.traverse((s) => {
|
|
247
247
|
s.isMesh && !n && (n = s.geometry);
|
|
248
248
|
}), n;
|
|
249
249
|
}
|
|
250
|
-
function
|
|
250
|
+
function Zt(e) {
|
|
251
251
|
const o = e.getAttribute("position");
|
|
252
252
|
if (!o || o.count === 0) throw new Error("Empty geometry");
|
|
253
253
|
const t = [];
|
|
@@ -258,24 +258,24 @@ let __tla = (async () => {
|
|
|
258
258
|
return t.join(`
|
|
259
259
|
`);
|
|
260
260
|
}
|
|
261
|
-
async function
|
|
261
|
+
async function kn(e) {
|
|
262
262
|
const o = await e.arrayBuffer(), n = new Nn().parse(o);
|
|
263
|
-
return
|
|
263
|
+
return Zt(n);
|
|
264
264
|
}
|
|
265
|
-
const
|
|
266
|
-
async function
|
|
265
|
+
const Ut = "aop";
|
|
266
|
+
async function Uo(e) {
|
|
267
267
|
const o = await e.arrayBuffer(), t = new Uint8Array(o);
|
|
268
|
-
return t.length > 3 && t[0] === 80 && t[1] === 75 && (t[2] === 3 || t[2] === 5 || t[2] === 7) ?
|
|
268
|
+
return t.length > 3 && t[0] === 80 && t[1] === 75 && (t[2] === 3 || t[2] === 5 || t[2] === 7) ? qo(t) : (xe.warn(Ut, "AOP payload is not a ZIP container \u2014 sniffing as a bare mesh"), Gn(t, e.name));
|
|
269
269
|
}
|
|
270
|
-
function
|
|
270
|
+
function qo(e) {
|
|
271
271
|
let o;
|
|
272
272
|
try {
|
|
273
|
-
o =
|
|
273
|
+
o = To(e);
|
|
274
274
|
} catch (s) {
|
|
275
275
|
throw new Error(`Could not read the .aop archive: ${s instanceof Error ? s.message : "invalid ZIP"}`);
|
|
276
276
|
}
|
|
277
277
|
const t = Object.keys(o);
|
|
278
|
-
|
|
278
|
+
xe.debug(Ut, `AOP archive entries: ${t.join(", ") || "(none)"}`);
|
|
279
279
|
const n = [
|
|
280
280
|
".obj",
|
|
281
281
|
".ply",
|
|
@@ -283,7 +283,7 @@ let __tla = (async () => {
|
|
|
283
283
|
];
|
|
284
284
|
for (const s of n) {
|
|
285
285
|
const l = t.find((d) => d.toLowerCase().endsWith(s) && o[d] && o[d].length > 0);
|
|
286
|
-
if (l) return
|
|
286
|
+
if (l) return xe.debug(Ut, `Using mesh entry "${l}" from AOP archive`), Gn(o[l], l);
|
|
287
287
|
}
|
|
288
288
|
throw new Error(`No mesh found inside the .aop file (looked for .obj/.ply/.stl). Archive contained: ${t.join(", ") || "no files"}`);
|
|
289
289
|
}
|
|
@@ -292,17 +292,17 @@ let __tla = (async () => {
|
|
|
292
292
|
if (t.endsWith(".obj") || n.startsWith("v ") || n.startsWith("# ")) return new TextDecoder().decode(e);
|
|
293
293
|
const s = e.buffer.slice(e.byteOffset, e.byteOffset + e.byteLength);
|
|
294
294
|
if (t.endsWith(".ply") || n.toLowerCase().startsWith("ply")) {
|
|
295
|
-
const d = new
|
|
296
|
-
return
|
|
295
|
+
const d = new Oo().parse(s);
|
|
296
|
+
return Zt(d);
|
|
297
297
|
}
|
|
298
298
|
const l = new Nn().parse(s);
|
|
299
|
-
return
|
|
299
|
+
return Zt(l);
|
|
300
300
|
}
|
|
301
|
-
function
|
|
301
|
+
function Jo(e, o) {
|
|
302
302
|
const t = 1 / o;
|
|
303
303
|
return `${Math.round(e.x * t)}_${Math.round(e.y * t)}_${Math.round(e.z * t)}`;
|
|
304
304
|
}
|
|
305
|
-
function
|
|
305
|
+
function Qo(e, o) {
|
|
306
306
|
if (!e.length) return [];
|
|
307
307
|
const t = [];
|
|
308
308
|
for (const n of e) (t.length === 0 || t[t.length - 1].distanceTo(n) > o) && t.push(n.clone());
|
|
@@ -315,22 +315,22 @@ let __tla = (async () => {
|
|
|
315
315
|
}
|
|
316
316
|
function Yn(e, o = 1e-3, t = false) {
|
|
317
317
|
if (!e.length) return [];
|
|
318
|
-
const n = /* @__PURE__ */ new Map(), s = (
|
|
319
|
-
const f =
|
|
320
|
-
let
|
|
321
|
-
return
|
|
322
|
-
}, l = e.map((
|
|
323
|
-
a: s(
|
|
324
|
-
b: s(
|
|
318
|
+
const n = /* @__PURE__ */ new Map(), s = (p) => {
|
|
319
|
+
const f = Jo(p, o);
|
|
320
|
+
let m = n.get(f);
|
|
321
|
+
return m || (m = p.clone(), n.set(f, m)), m;
|
|
322
|
+
}, l = e.map((p) => ({
|
|
323
|
+
a: s(p.a),
|
|
324
|
+
b: s(p.b)
|
|
325
325
|
})), d = [];
|
|
326
326
|
for (; l.length; ) {
|
|
327
|
-
const
|
|
328
|
-
|
|
329
|
-
|
|
327
|
+
const p = l.pop(), f = [
|
|
328
|
+
p.a,
|
|
329
|
+
p.b
|
|
330
330
|
];
|
|
331
|
-
let
|
|
332
|
-
for (;
|
|
333
|
-
|
|
331
|
+
let m = true;
|
|
332
|
+
for (; m; ) {
|
|
333
|
+
m = false;
|
|
334
334
|
for (let h = l.length - 1; h >= 0; h--) {
|
|
335
335
|
const { a: x, b: w } = l[h];
|
|
336
336
|
if (x.equals(f[f.length - 1])) f.push(w);
|
|
@@ -338,40 +338,40 @@ let __tla = (async () => {
|
|
|
338
338
|
else if (x.equals(f[0])) f.unshift(w);
|
|
339
339
|
else if (w.equals(f[0])) f.unshift(x);
|
|
340
340
|
else continue;
|
|
341
|
-
l.splice(h, 1),
|
|
341
|
+
l.splice(h, 1), m = true;
|
|
342
342
|
}
|
|
343
343
|
}
|
|
344
|
-
const v =
|
|
344
|
+
const v = Qo(f, o);
|
|
345
345
|
v.length > 1 && d.push(v);
|
|
346
346
|
}
|
|
347
347
|
if (!d.length) return [];
|
|
348
348
|
if (t) {
|
|
349
|
-
d.sort((
|
|
350
|
-
const
|
|
349
|
+
d.sort((m, v) => Ue(v) - Ue(m));
|
|
350
|
+
const p = Ue(d[0]), f = d.filter((m) => Ue(m) >= p * 0.3);
|
|
351
351
|
return f[f.length - 1] ?? d[0];
|
|
352
352
|
}
|
|
353
|
-
const a = d.filter((
|
|
353
|
+
const a = d.filter((p) => p.length >= 3 && p[0].distanceTo(p[p.length - 1]) < o * 10), r = a.length > 0 ? a : d;
|
|
354
354
|
if (r.length === 1) return r[0];
|
|
355
|
-
let c = r[0],
|
|
356
|
-
for (const
|
|
357
|
-
let f = 0,
|
|
358
|
-
for (const h of
|
|
359
|
-
f /=
|
|
360
|
-
const v = Math.sqrt(f * f +
|
|
361
|
-
v <
|
|
355
|
+
let c = r[0], u = 1 / 0;
|
|
356
|
+
for (const p of r) {
|
|
357
|
+
let f = 0, m = 0;
|
|
358
|
+
for (const h of p) f += h.x, m += h.z;
|
|
359
|
+
f /= p.length, m /= p.length;
|
|
360
|
+
const v = Math.sqrt(f * f + m * m);
|
|
361
|
+
v < u && (u = v, c = p);
|
|
362
362
|
}
|
|
363
363
|
return c;
|
|
364
364
|
}
|
|
365
|
-
function
|
|
366
|
-
const s = new
|
|
365
|
+
function Fn(e, o, t, n = false) {
|
|
366
|
+
const s = new Ct(new P(0, 1, 0), -t), l = [], d = new Tn();
|
|
367
367
|
d.setFromBufferAttribute(o.getAttribute("position"));
|
|
368
368
|
const a = {
|
|
369
369
|
linePoints: [],
|
|
370
370
|
lineLength: 0,
|
|
371
|
-
rightmostPoint: new
|
|
371
|
+
rightmostPoint: new P(0, t, 0)
|
|
372
372
|
};
|
|
373
373
|
if (!s.intersectsBox(d)) return a;
|
|
374
|
-
const r = new On(), c = new
|
|
374
|
+
const r = new On(), c = new P();
|
|
375
375
|
e.shapecast({
|
|
376
376
|
intersectsBounds: (h) => s.intersectsBox(h),
|
|
377
377
|
intersectsTriangle: (h) => {
|
|
@@ -382,54 +382,54 @@ let __tla = (async () => {
|
|
|
382
382
|
});
|
|
383
383
|
}
|
|
384
384
|
});
|
|
385
|
-
const
|
|
386
|
-
if (
|
|
387
|
-
const
|
|
388
|
-
let f = -1 / 0,
|
|
389
|
-
for (const h of
|
|
390
|
-
const v =
|
|
385
|
+
const u = Yn(l, Kt, n);
|
|
386
|
+
if (u.length < 2) return a;
|
|
387
|
+
const p = Ue(u);
|
|
388
|
+
let f = -1 / 0, m = new P(0, t, 0);
|
|
389
|
+
for (const h of u) h.x > f && (f = h.x, m = h.clone());
|
|
390
|
+
const v = u.length > 2 && u[0].distanceTo(u[u.length - 1]) < Kt * 10;
|
|
391
391
|
return {
|
|
392
|
-
linePoints:
|
|
393
|
-
lineLength:
|
|
394
|
-
rightmostPoint:
|
|
392
|
+
linePoints: u,
|
|
393
|
+
lineLength: p,
|
|
394
|
+
rightmostPoint: m,
|
|
395
395
|
isClosed: v
|
|
396
396
|
};
|
|
397
397
|
}
|
|
398
398
|
function je(e, o, t, n = false) {
|
|
399
|
-
const s =
|
|
399
|
+
const s = Fn(e, o, t, n);
|
|
400
400
|
if (s.isClosed && s.linePoints.length >= 3) return s;
|
|
401
|
-
|
|
401
|
+
xe.debug("slice", `y=${t.toFixed(2)} failed (pts=${s.linePoints.length}, closed=${s.isClosed}), retrying...`);
|
|
402
402
|
let l = s;
|
|
403
|
-
for (const d of
|
|
404
|
-
const a =
|
|
405
|
-
if (a.isClosed && a.linePoints.length >= 3) return
|
|
403
|
+
for (const d of Xo) {
|
|
404
|
+
const a = Fn(e, o, t + d, n);
|
|
405
|
+
if (a.isClosed && a.linePoints.length >= 3) return xe.debug("slice", `y=${t.toFixed(2)} recovered with offset ${d > 0 ? "+" : ""}${d}mm (pts=${a.linePoints.length}, len=${a.lineLength.toFixed(1)}mm)`), a;
|
|
406
406
|
a.linePoints.length > l.linePoints.length && (l = a);
|
|
407
407
|
}
|
|
408
|
-
return
|
|
408
|
+
return xe.warn("slice", `y=${t.toFixed(2)} all retries exhausted (pts=${l.linePoints.length}, closed=${l.isClosed})`), l;
|
|
409
409
|
}
|
|
410
|
-
function
|
|
411
|
-
const s = new
|
|
410
|
+
function er(e, o, t, n) {
|
|
411
|
+
const s = new Ct().setFromNormalAndCoplanarPoint(n.clone().normalize(), t), l = new Tn();
|
|
412
412
|
if (l.setFromBufferAttribute(o.getAttribute("position")), !s.intersectsBox(l)) return 0;
|
|
413
|
-
const d = [], a = new On(), r = new
|
|
413
|
+
const d = [], a = new On(), r = new P();
|
|
414
414
|
e.shapecast({
|
|
415
|
-
intersectsBounds: (
|
|
416
|
-
intersectsTriangle: (
|
|
417
|
-
const
|
|
418
|
-
a.set(
|
|
419
|
-
a:
|
|
420
|
-
b:
|
|
415
|
+
intersectsBounds: (u) => s.intersectsBox(u),
|
|
416
|
+
intersectsTriangle: (u) => {
|
|
417
|
+
const p = [];
|
|
418
|
+
a.set(u.a, u.b), s.intersectLine(a, r) && p.push(r.clone()), a.set(u.b, u.c), s.intersectLine(a, r) && p.push(r.clone()), a.set(u.c, u.a), s.intersectLine(a, r) && p.push(r.clone()), p.length === 2 && d.push({
|
|
419
|
+
a: p[0],
|
|
420
|
+
b: p[1]
|
|
421
421
|
});
|
|
422
422
|
}
|
|
423
423
|
});
|
|
424
|
-
const c = Yn(d,
|
|
424
|
+
const c = Yn(d, Kt);
|
|
425
425
|
return Ue(c);
|
|
426
426
|
}
|
|
427
|
-
function
|
|
428
|
-
return new
|
|
429
|
-
maxLeafTris:
|
|
427
|
+
function qt(e) {
|
|
428
|
+
return new At(e, {
|
|
429
|
+
maxLeafTris: zt
|
|
430
430
|
});
|
|
431
431
|
}
|
|
432
|
-
function
|
|
432
|
+
function tr(e, o, t, n) {
|
|
433
433
|
const s = e.getIndex(), l = s ? s.count / 3 : 0;
|
|
434
434
|
if (l < 10) return {
|
|
435
435
|
valid: false,
|
|
@@ -444,8 +444,8 @@ let __tla = (async () => {
|
|
|
444
444
|
valid: false,
|
|
445
445
|
reason: `Height too large (${d.toFixed(1)}mm > 1000mm)`
|
|
446
446
|
};
|
|
447
|
-
const a = new
|
|
448
|
-
maxLeafTris:
|
|
447
|
+
const a = new At(e, {
|
|
448
|
+
maxLeafTris: zt
|
|
449
449
|
}), r = je(a, e, o);
|
|
450
450
|
if (r.lineLength === 0) return {
|
|
451
451
|
valid: false,
|
|
@@ -456,22 +456,22 @@ let __tla = (async () => {
|
|
|
456
456
|
valid: true,
|
|
457
457
|
reason: ""
|
|
458
458
|
};
|
|
459
|
-
const
|
|
460
|
-
if (r.lineLength > 0 &&
|
|
461
|
-
const f = r.lineLength /
|
|
459
|
+
const u = je(a, e, c);
|
|
460
|
+
if (r.lineLength > 0 && u.lineLength > 0) {
|
|
461
|
+
const f = r.lineLength / u.lineLength;
|
|
462
462
|
if (f < 0.5) return {
|
|
463
463
|
valid: false,
|
|
464
464
|
reason: `First circumference is too small relative to second (ratio ${f.toFixed(2)} < 0.5) \u2014 possible trimmed angle`
|
|
465
465
|
};
|
|
466
466
|
}
|
|
467
|
-
const
|
|
468
|
-
if (
|
|
469
|
-
const f = je(a, e,
|
|
470
|
-
if (
|
|
471
|
-
const
|
|
472
|
-
if (
|
|
467
|
+
const p = o - n * 2;
|
|
468
|
+
if (p > t) {
|
|
469
|
+
const f = je(a, e, p);
|
|
470
|
+
if (u.lineLength > 0 && f.lineLength > 0) {
|
|
471
|
+
const m = u.lineLength / f.lineLength;
|
|
472
|
+
if (m < 0.5) return {
|
|
473
473
|
valid: false,
|
|
474
|
-
reason: `Second circumference is too small relative to third (ratio ${
|
|
474
|
+
reason: `Second circumference is too small relative to third (ratio ${m.toFixed(2)} < 0.5) \u2014 possible trimmed angle`
|
|
475
475
|
};
|
|
476
476
|
}
|
|
477
477
|
}
|
|
@@ -480,31 +480,31 @@ let __tla = (async () => {
|
|
|
480
480
|
reason: ""
|
|
481
481
|
};
|
|
482
482
|
}
|
|
483
|
-
const
|
|
484
|
-
function
|
|
483
|
+
const De = "pipeline";
|
|
484
|
+
function nr(e, o, t, n) {
|
|
485
485
|
var _a, _b, _c, _d;
|
|
486
486
|
const s = e.geometry.clone(), l = o.map((a) => ({
|
|
487
487
|
...a
|
|
488
488
|
})), d = n.wasmModule;
|
|
489
489
|
try {
|
|
490
|
-
let a = e.geometry, r = l.map((
|
|
491
|
-
const c = r[0],
|
|
490
|
+
let a = e.geometry, r = l.map((j) => new P(j.position.x, j.position.y, j.position.z));
|
|
491
|
+
const c = r[0], u = r[1];
|
|
492
492
|
if (!d) {
|
|
493
|
-
n.onStatus("Aligning mesh (JS fallback)..."),
|
|
494
|
-
const
|
|
495
|
-
if (
|
|
496
|
-
|
|
497
|
-
const T = new
|
|
498
|
-
a.applyMatrix4(new
|
|
493
|
+
n.onStatus("Aligning mesh (JS fallback)..."), xe.warn(De, "WASM not available, using JS fallback alignment");
|
|
494
|
+
const j = new P(0, 1, 0), K = new P().subVectors(u, c).normalize(), fe = K.dot(j), ie = new P().crossVectors(K, j);
|
|
495
|
+
if (ie.length() > 1e-4) {
|
|
496
|
+
ie.normalize();
|
|
497
|
+
const T = new q.Quaternion().setFromAxisAngle(ie, Math.acos(Math.min(1, Math.max(-1, fe))));
|
|
498
|
+
a.applyMatrix4(new q.Matrix4().makeRotationFromQuaternion(T)), r = r.map((Le) => Le.clone().applyQuaternion(T));
|
|
499
499
|
}
|
|
500
500
|
if (r[0].y > r[1].y) {
|
|
501
|
-
const T = new
|
|
502
|
-
a.applyMatrix4(new
|
|
501
|
+
const T = new q.Quaternion().setFromAxisAngle(new P(1, 0, 0), Math.PI);
|
|
502
|
+
a.applyMatrix4(new q.Matrix4().makeRotationFromQuaternion(T)), r = r.map((Le) => Le.clone().applyQuaternion(T));
|
|
503
503
|
}
|
|
504
|
-
const
|
|
505
|
-
a.translate(-
|
|
506
|
-
const
|
|
507
|
-
r.push(
|
|
504
|
+
const pe = r[0].clone();
|
|
505
|
+
a.translate(-pe.x, -pe.y, -pe.z), r = r.map((T) => new P(T.x - pe.x, T.y - pe.y, T.z - pe.z)), a.computeVertexNormals(), a.computeBoundingBox();
|
|
506
|
+
const he = new P(r[0].x, r[0].y, r[0].z);
|
|
507
|
+
r.push(he), n.addLandmarkPoint({
|
|
508
508
|
faceIndex: -1,
|
|
509
509
|
vertexIndices: [
|
|
510
510
|
0,
|
|
@@ -512,9 +512,9 @@ let __tla = (async () => {
|
|
|
512
512
|
2
|
|
513
513
|
],
|
|
514
514
|
position: {
|
|
515
|
-
x:
|
|
516
|
-
y:
|
|
517
|
-
z:
|
|
515
|
+
x: he.x,
|
|
516
|
+
y: he.y,
|
|
517
|
+
z: he.z
|
|
518
518
|
},
|
|
519
519
|
barycentricCoords: {
|
|
520
520
|
u: 0.33,
|
|
@@ -525,82 +525,82 @@ let __tla = (async () => {
|
|
|
525
525
|
x: T.x,
|
|
526
526
|
y: T.y,
|
|
527
527
|
z: T.z
|
|
528
|
-
}))), n.setAligned(true), n.setCut(true), n.setAdjustedStartY(null), n.setAdjustedEndY(null), n.setOriginalEndY(r[1].y + 2 *
|
|
529
|
-
const
|
|
530
|
-
a.computeBoundingBox(), a.boundingBox.getSize(
|
|
528
|
+
}))), n.setAligned(true), n.setCut(true), n.setAdjustedStartY(null), n.setAdjustedEndY(null), n.setOriginalEndY(r[1].y + 2 * vt);
|
|
529
|
+
const Se = new P();
|
|
530
|
+
a.computeBoundingBox(), a.boundingBox.getSize(Se), n.setModelSize(Math.max(Se.x, Se.y, Se.z)), s.dispose();
|
|
531
531
|
return;
|
|
532
532
|
}
|
|
533
|
-
const { positions:
|
|
533
|
+
const { positions: p, indices: f } = St(a), m = new Float32Array([
|
|
534
534
|
c.x,
|
|
535
535
|
c.y,
|
|
536
536
|
c.z
|
|
537
537
|
]), v = new Float32Array([
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
538
|
+
u.x,
|
|
539
|
+
u.y,
|
|
540
|
+
u.z
|
|
541
541
|
]);
|
|
542
542
|
n.onStatus("Detecting shell type...");
|
|
543
|
-
const h = d.detect_shell(
|
|
544
|
-
|
|
543
|
+
const h = d.detect_shell(p, f, v, 40), x = h.is_double_shell(), w = h.surface_normal();
|
|
544
|
+
xe.info(De, `Shell: ${x ? "DOUBLE" : "SINGLE"}`, h.details()), (_a = n.setDoubleShell) == null ? void 0 : _a.call(n, x), n.onStatus("Finding cross-section plane...");
|
|
545
545
|
const C = new Float32Array([
|
|
546
546
|
w[0],
|
|
547
547
|
w[1],
|
|
548
548
|
w[2]
|
|
549
|
-
]), b = d.find_min_cross_section(
|
|
550
|
-
|
|
549
|
+
]), b = d.find_min_cross_section(p, f, v, C, 10), F = b.plane_normal();
|
|
550
|
+
xe.info(De, "Cross-section found", b.details()), n.onStatus("Aligning mesh...");
|
|
551
551
|
const S = new Float32Array([
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
]), A = d.align_to_origin(
|
|
556
|
-
let z = A.positions(), _ = A.mpt(),
|
|
557
|
-
const
|
|
558
|
-
|
|
559
|
-
const
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
552
|
+
F[0],
|
|
553
|
+
F[1],
|
|
554
|
+
F[2]
|
|
555
|
+
]), A = d.align_to_origin(p, m, v, S);
|
|
556
|
+
let z = A.positions(), _ = A.mpt(), B = A.origin();
|
|
557
|
+
const N = A.transform();
|
|
558
|
+
xe.info(De, "Alignment complete", A.details());
|
|
559
|
+
const k = [
|
|
560
|
+
N[3],
|
|
561
|
+
N[4],
|
|
562
|
+
N[5],
|
|
563
|
+
N[6],
|
|
564
|
+
N[7],
|
|
565
|
+
N[8],
|
|
566
|
+
N[9],
|
|
567
|
+
N[10],
|
|
568
|
+
N[11]
|
|
569
569
|
], I = new Float32Array([
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
570
|
+
k[0] * F[0] + k[1] * F[1] + k[2] * F[2],
|
|
571
|
+
k[3] * F[0] + k[4] * F[1] + k[5] * F[2],
|
|
572
|
+
k[6] * F[0] + k[7] * F[1] + k[8] * F[2]
|
|
573
573
|
]);
|
|
574
574
|
n.onStatus("Generating measurement points...");
|
|
575
|
-
const
|
|
576
|
-
|
|
577
|
-
const $ =
|
|
578
|
-
for (let
|
|
575
|
+
const W = d.subdivide_origin_to_plane(new Float32Array(B), new Float32Array(_), I);
|
|
576
|
+
xe.debug(De, `Subdivide: ${W.count()} pts, spacing=${W.spacing().toFixed(1)}mm`);
|
|
577
|
+
const $ = W.points(), G = W.count(), oe = 2, ce = 1, se = [];
|
|
578
|
+
for (let j = oe; j < G - ce; j++) se.push($[j * 3 + 1]);
|
|
579
579
|
n.onStatus("Computing cross-sections...");
|
|
580
|
-
let
|
|
581
|
-
if (
|
|
582
|
-
const K = (x ? d.batch_cross_sections_y_inner.bind(d) : d.batch_cross_sections_y.bind(d))(z, f, new Float32Array(
|
|
583
|
-
|
|
584
|
-
const fe = K.all_loop_points(),
|
|
585
|
-
for (let
|
|
586
|
-
const
|
|
587
|
-
if (T <=
|
|
588
|
-
const
|
|
589
|
-
if (
|
|
590
|
-
let
|
|
591
|
-
for (let Fe =
|
|
592
|
-
|
|
580
|
+
let J = [];
|
|
581
|
+
if (se.length >= 2) {
|
|
582
|
+
const K = (x ? d.batch_cross_sections_y_inner.bind(d) : d.batch_cross_sections_y.bind(d))(z, f, new Float32Array(se), 10);
|
|
583
|
+
xe.debug(De, "Batch (subdivision)", K.details());
|
|
584
|
+
const fe = K.all_loop_points(), ie = K.offsets(), pe = K.circumferences();
|
|
585
|
+
for (let he = 0; he < ie.length - 1; he++) {
|
|
586
|
+
const Se = ie[he], T = ie[he + 1];
|
|
587
|
+
if (T <= Se || pe[he] <= 0) continue;
|
|
588
|
+
const Le = (T - Se) / 3;
|
|
589
|
+
if (Le < 3) continue;
|
|
590
|
+
let ke = 0, Ie = 0, ye = 0;
|
|
591
|
+
for (let Fe = Se; Fe < T; Fe += 3) ke += fe[Fe], Ie += fe[Fe + 1], ye += fe[Fe + 2];
|
|
592
|
+
J.push(ke / Le, Ie / Le, ye / Le);
|
|
593
593
|
}
|
|
594
594
|
}
|
|
595
|
-
if (
|
|
595
|
+
if (J.length >= 6) {
|
|
596
596
|
n.onStatus("Refining alignment...");
|
|
597
|
-
const
|
|
598
|
-
|
|
597
|
+
const j = d.refine_alignment(new Float32Array(J), z, new Float32Array(B), new Float32Array(_));
|
|
598
|
+
xe.info(De, "Refinement complete", j.details()), z = j.positions(), _ = j.mpt(), B = j.origin();
|
|
599
599
|
}
|
|
600
|
-
const
|
|
601
|
-
|
|
602
|
-
const
|
|
603
|
-
r.push(
|
|
600
|
+
const ae = a.getAttribute("color"), U = Xn(z, f);
|
|
601
|
+
ae && U.setAttribute("color", ae), a.dispose(), a = U, e.geometry = a, a.computeVertexNormals(), a.computeBoundingBox(), r[0] = new P(B[0], B[1], B[2]), r[1] = new P(_[0], _[1], _[2]), n.onStatus("Setting blue point...");
|
|
602
|
+
const ge = new P(r[0].x, r[0].y, r[0].z);
|
|
603
|
+
r.push(ge), n.addLandmarkPoint({
|
|
604
604
|
faceIndex: -1,
|
|
605
605
|
vertexIndices: [
|
|
606
606
|
0,
|
|
@@ -608,55 +608,55 @@ let __tla = (async () => {
|
|
|
608
608
|
2
|
|
609
609
|
],
|
|
610
610
|
position: {
|
|
611
|
-
x:
|
|
612
|
-
y:
|
|
613
|
-
z:
|
|
611
|
+
x: ge.x,
|
|
612
|
+
y: ge.y,
|
|
613
|
+
z: ge.z
|
|
614
614
|
},
|
|
615
615
|
barycentricCoords: {
|
|
616
616
|
u: 0.33,
|
|
617
617
|
v: 0.33,
|
|
618
618
|
w: 0.34
|
|
619
619
|
}
|
|
620
|
-
}), n.updateLandmarkPositions(r.map((
|
|
621
|
-
x:
|
|
622
|
-
y:
|
|
623
|
-
z:
|
|
620
|
+
}), n.updateLandmarkPositions(r.map((j) => ({
|
|
621
|
+
x: j.x,
|
|
622
|
+
y: j.y,
|
|
623
|
+
z: j.z
|
|
624
624
|
}))), n.setAligned(true);
|
|
625
|
-
const
|
|
626
|
-
|
|
625
|
+
const re = a.boundingBox, R = new P();
|
|
626
|
+
re.getSize(R), n.setModelSize(Math.max(R.x, R.y, R.z)), n.setCut(true), n.setAdjustedStartY(null), n.setAdjustedEndY(null), n.setOriginalEndY(r[1].y + 2 * vt), n.onStatus("Computing final measurements...");
|
|
627
627
|
{
|
|
628
|
-
const
|
|
629
|
-
let
|
|
630
|
-
const
|
|
631
|
-
for (let
|
|
632
|
-
const
|
|
628
|
+
const j = St(a), K = r[1].y, fe = r[0].y;
|
|
629
|
+
let ie = 1 / 0, pe = -1 / 0;
|
|
630
|
+
const he = j.positions;
|
|
631
|
+
for (let ye = 1; ye < he.length; ye += 3) he[ye] < ie && (ie = he[ye]), he[ye] > pe && (pe = he[ye]);
|
|
632
|
+
const Se = 25.4, T = [];
|
|
633
633
|
T.push(K);
|
|
634
|
-
for (let
|
|
635
|
-
const Fe = K +
|
|
636
|
-
Fe <
|
|
634
|
+
for (let ye = 1; ye <= 2; ye++) {
|
|
635
|
+
const Fe = K + ye * Se;
|
|
636
|
+
Fe < pe - 1 && T.push(Fe);
|
|
637
637
|
}
|
|
638
|
-
for (let
|
|
639
|
-
T.sort((
|
|
640
|
-
const
|
|
641
|
-
|
|
642
|
-
const
|
|
638
|
+
for (let ye = K - Se; ye > fe; ye -= Se) T.push(ye);
|
|
639
|
+
T.sort((ye, Fe) => ye - Fe), xe.info(De, `Horizontal slices: ${T.length} Y planes, range ${(_b = T[0]) == null ? void 0 : _b.toFixed(1)} \u2192 ${(_c = T[T.length - 1]) == null ? void 0 : _c.toFixed(1)} mm`);
|
|
640
|
+
const ke = (x ? d.batch_cross_sections_y_inner.bind(d) : d.batch_cross_sections_y.bind(d))(j.positions, j.indices, new Float32Array(T), 10);
|
|
641
|
+
xe.info(De, `Horizontal slices (${x ? "inner" : "outer"}): ${ke.count()}/${T.length} valid`), xe.debug(De, "Slice details", ke.details());
|
|
642
|
+
const Ie = {
|
|
643
643
|
yValues: T,
|
|
644
|
-
circumferences: Array.from(
|
|
645
|
-
allLoopPoints: new Float32Array(
|
|
646
|
-
offsets: new Uint32Array(
|
|
644
|
+
circumferences: Array.from(ke.circumferences()),
|
|
645
|
+
allLoopPoints: new Float32Array(ke.all_loop_points()),
|
|
646
|
+
offsets: new Uint32Array(ke.offsets()),
|
|
647
647
|
mptY: K,
|
|
648
648
|
originY: fe
|
|
649
649
|
};
|
|
650
|
-
(_d = n.setWasmSlices) == null ? void 0 : _d.call(n,
|
|
650
|
+
(_d = n.setWasmSlices) == null ? void 0 : _d.call(n, Ie);
|
|
651
651
|
}
|
|
652
652
|
n.onStatus("Validating results...");
|
|
653
|
-
const
|
|
654
|
-
|
|
653
|
+
const H = r[1].y, ne = r[0].y, Q = tr(a, H, ne, t);
|
|
654
|
+
Q.valid || xe.warn(De, `Validation: ${Q.reason}`), n.setClippedReferenceGeometry ? (s.computeVertexNormals(), n.setClippedReferenceGeometry(s)) : s.dispose();
|
|
655
655
|
} catch (a) {
|
|
656
|
-
|
|
656
|
+
xe.error(De, "Processing failed", a), n.setError(a instanceof Error ? a.message : "Failed to process mesh."), s.dispose();
|
|
657
657
|
}
|
|
658
658
|
}
|
|
659
|
-
class
|
|
659
|
+
class or extends Ro {
|
|
660
660
|
constructor() {
|
|
661
661
|
super(...arguments), this.state = {
|
|
662
662
|
error: null
|
|
@@ -723,7 +723,7 @@ let __tla = (async () => {
|
|
|
723
723
|
}) : this.props.children;
|
|
724
724
|
}
|
|
725
725
|
}
|
|
726
|
-
const
|
|
726
|
+
const rr = ({ message: e, onDismiss: o }) => y("div", {
|
|
727
727
|
style: {
|
|
728
728
|
position: "absolute",
|
|
729
729
|
top: 16,
|
|
@@ -814,19 +814,19 @@ let __tla = (async () => {
|
|
|
814
814
|
})
|
|
815
815
|
]
|
|
816
816
|
});
|
|
817
|
-
function
|
|
818
|
-
const s = new
|
|
817
|
+
function ir(e, o, t, n) {
|
|
818
|
+
const s = new P().subVectors(t, o), l = new P().subVectors(n, o), d = new P().subVectors(e, o), a = s.dot(s), r = s.dot(l), c = s.dot(d), u = l.dot(l), p = l.dot(d), f = 1 / (a * u - r * r), m = (u * c - r * p) * f, v = (a * p - r * c) * f;
|
|
819
819
|
return {
|
|
820
|
-
u: 1 -
|
|
821
|
-
v:
|
|
820
|
+
u: 1 - m - v,
|
|
821
|
+
v: m,
|
|
822
822
|
w: v
|
|
823
823
|
};
|
|
824
824
|
}
|
|
825
|
-
const
|
|
826
|
-
const { addLandmarkPoint: d, landmarkPoints: a } =
|
|
825
|
+
const sr = ({ mesh: e, maxPoints: o = 2, meshColor: t = "#c8c8c8", meshOpacity: n = 1, frontFaceOnly: s = false, doubleShellTransparency: l = false }) => {
|
|
826
|
+
const { addLandmarkPoint: d, landmarkPoints: a } = Jt(), r = de((m) => {
|
|
827
827
|
if (a.length >= o) return;
|
|
828
|
-
|
|
829
|
-
const v =
|
|
828
|
+
m.stopPropagation();
|
|
829
|
+
const v = m.intersections[0], h = v == null ? void 0 : v.faceIndex;
|
|
830
830
|
if (!v || h == null) return;
|
|
831
831
|
const x = e.geometry, w = x.index;
|
|
832
832
|
let C;
|
|
@@ -839,9 +839,9 @@ let __tla = (async () => {
|
|
|
839
839
|
h * 3 + 1,
|
|
840
840
|
h * 3 + 2
|
|
841
841
|
];
|
|
842
|
-
const b = x.getAttribute("position"),
|
|
843
|
-
|
|
844
|
-
const z = v.point, _ =
|
|
842
|
+
const b = x.getAttribute("position"), F = new P().fromBufferAttribute(b, C[0]), S = new P().fromBufferAttribute(b, C[1]), A = new P().fromBufferAttribute(b, C[2]);
|
|
843
|
+
F.applyMatrix4(e.matrixWorld), S.applyMatrix4(e.matrixWorld), A.applyMatrix4(e.matrixWorld);
|
|
844
|
+
const z = v.point, _ = ir(z, F, S, A), B = {
|
|
845
845
|
faceIndex: h,
|
|
846
846
|
vertexIndices: C,
|
|
847
847
|
position: {
|
|
@@ -851,27 +851,27 @@ let __tla = (async () => {
|
|
|
851
851
|
},
|
|
852
852
|
barycentricCoords: _
|
|
853
853
|
};
|
|
854
|
-
d(
|
|
854
|
+
d(B);
|
|
855
855
|
}, [
|
|
856
856
|
e,
|
|
857
857
|
d,
|
|
858
858
|
a.length,
|
|
859
859
|
o
|
|
860
|
-
]), c =
|
|
860
|
+
]), c = te(() => !!e.geometry.getAttribute("color"), [
|
|
861
861
|
e
|
|
862
|
-
]),
|
|
862
|
+
]), u = l ? Math.min(n, 0.65) : n, p = u < 1, f = te(() => new q.MeshStandardMaterial({
|
|
863
863
|
color: c ? "#ffffff" : t,
|
|
864
|
-
side: s ?
|
|
864
|
+
side: s ? q.FrontSide : q.DoubleSide,
|
|
865
865
|
roughness: 0.6,
|
|
866
866
|
metalness: 0.1,
|
|
867
|
-
transparent:
|
|
868
|
-
opacity:
|
|
867
|
+
transparent: p,
|
|
868
|
+
opacity: u,
|
|
869
869
|
depthWrite: !l,
|
|
870
870
|
vertexColors: c
|
|
871
871
|
}), [
|
|
872
872
|
t,
|
|
873
|
-
p,
|
|
874
873
|
u,
|
|
874
|
+
p,
|
|
875
875
|
c,
|
|
876
876
|
s,
|
|
877
877
|
l
|
|
@@ -882,8 +882,8 @@ let __tla = (async () => {
|
|
|
882
882
|
material: f,
|
|
883
883
|
renderOrder: l ? 0 : void 0
|
|
884
884
|
});
|
|
885
|
-
},
|
|
886
|
-
const [l, d] =
|
|
885
|
+
}, lr = ({ point: e, index: o, markerSize: t, color: n, label: s }) => {
|
|
886
|
+
const [l, d] = E(false);
|
|
887
887
|
return y("mesh", {
|
|
888
888
|
position: [
|
|
889
889
|
e.position.x,
|
|
@@ -924,8 +924,8 @@ let __tla = (async () => {
|
|
|
924
924
|
})
|
|
925
925
|
]
|
|
926
926
|
}, o);
|
|
927
|
-
},
|
|
928
|
-
const { landmarkPoints: t } =
|
|
927
|
+
}, ar = ({ modelSize: e, labels: o }) => {
|
|
928
|
+
const { landmarkPoints: t } = Jt(), n = e * 0.02, s = [
|
|
929
929
|
"#44ff44",
|
|
930
930
|
"#ff4444",
|
|
931
931
|
"#4444ff"
|
|
@@ -935,7 +935,7 @@ let __tla = (async () => {
|
|
|
935
935
|
"Cut Plane"
|
|
936
936
|
];
|
|
937
937
|
return i(We, {
|
|
938
|
-
children: t.map((a, r) => i(
|
|
938
|
+
children: t.map((a, r) => i(lr, {
|
|
939
939
|
point: a,
|
|
940
940
|
index: r,
|
|
941
941
|
markerSize: n,
|
|
@@ -945,8 +945,8 @@ let __tla = (async () => {
|
|
|
945
945
|
});
|
|
946
946
|
};
|
|
947
947
|
function Kn(e) {
|
|
948
|
-
return
|
|
949
|
-
maxLeafTris:
|
|
948
|
+
return te(() => e ? new At(e, {
|
|
949
|
+
maxLeafTris: zt
|
|
950
950
|
}) : null, [
|
|
951
951
|
e
|
|
952
952
|
]);
|
|
@@ -954,75 +954,75 @@ let __tla = (async () => {
|
|
|
954
954
|
const Dn = (e, o) => {
|
|
955
955
|
const t = Math.abs(e - o);
|
|
956
956
|
return t <= 7 ? "#8BC34A" : t <= 20 ? "#FFC107" : "#FF5722";
|
|
957
|
-
}, Wn = new
|
|
957
|
+
}, Wn = new q.Color("#8BC34A"), Rn = new q.Color("#FFC107"), cr = new q.Color("#FF5722"), dr = (e) => {
|
|
958
958
|
if (e <= 7) return Wn.clone();
|
|
959
959
|
if (e <= 20) {
|
|
960
960
|
const t = (e - 7) / 13;
|
|
961
|
-
return Wn.clone().lerp(
|
|
961
|
+
return Wn.clone().lerp(Rn, t);
|
|
962
962
|
}
|
|
963
963
|
const o = Math.min((e - 20) / 20, 1);
|
|
964
|
-
return
|
|
965
|
-
},
|
|
964
|
+
return Rn.clone().lerp(cr, o);
|
|
965
|
+
}, fr = (e, o) => {
|
|
966
966
|
const t = e.length, n = new Float32Array(t * 2 * 3), s = new Float32Array(t * 2 * 3), l = [];
|
|
967
967
|
for (let r = 0; r < t; r++) {
|
|
968
|
-
const c = e[r],
|
|
969
|
-
if (n[r * 6] = c.x, n[r * 6 + 1] = c.y, n[r * 6 + 2] = c.z, s[r * 6] = f.r, s[r * 6 + 1] = f.g, s[r * 6 + 2] = f.b, n[r * 6 + 3] =
|
|
970
|
-
const
|
|
971
|
-
l.push(
|
|
968
|
+
const c = e[r], u = o[r], p = c.distanceTo(u), f = dr(p);
|
|
969
|
+
if (n[r * 6] = c.x, n[r * 6 + 1] = c.y, n[r * 6 + 2] = c.z, s[r * 6] = f.r, s[r * 6 + 1] = f.g, s[r * 6 + 2] = f.b, n[r * 6 + 3] = u.x, n[r * 6 + 4] = u.y, n[r * 6 + 5] = u.z, s[r * 6 + 3] = f.r, s[r * 6 + 4] = f.g, s[r * 6 + 5] = f.b, r < t - 1) {
|
|
970
|
+
const m = r * 2, v = m + 1, h = (r + 1) * 2, x = h + 1;
|
|
971
|
+
l.push(m, v, h, v, x, h);
|
|
972
972
|
}
|
|
973
973
|
}
|
|
974
|
-
const d = new
|
|
975
|
-
d.setAttribute("position", new
|
|
976
|
-
const a = new
|
|
974
|
+
const d = new q.BufferGeometry();
|
|
975
|
+
d.setAttribute("position", new q.Float32BufferAttribute(n, 3)), d.setAttribute("color", new q.Float32BufferAttribute(s, 3)), d.setIndex(l);
|
|
976
|
+
const a = new q.MeshBasicMaterial({
|
|
977
977
|
vertexColors: true,
|
|
978
978
|
transparent: true,
|
|
979
979
|
opacity: 0.25,
|
|
980
|
-
side:
|
|
980
|
+
side: q.DoubleSide,
|
|
981
981
|
depthTest: false,
|
|
982
982
|
depthWrite: false
|
|
983
983
|
});
|
|
984
|
-
return new
|
|
985
|
-
},
|
|
986
|
-
const f =
|
|
984
|
+
return new q.Mesh(d, a);
|
|
985
|
+
}, ur = ({ bvh: e, geometry: o, yPosition: t, color: n = "#00ff00", labelX: s, onDataChange: l, displayUnit: d = "cm", useInnerSurface: a = false, formValue: r, lineWidth: c = 1.5, wasmLoopPoints: u, wasmCircumference: p }) => {
|
|
986
|
+
const f = te(() => u && p != null ? null : je(e, o, t, a), [
|
|
987
987
|
e,
|
|
988
988
|
o,
|
|
989
989
|
t,
|
|
990
990
|
a,
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
]),
|
|
994
|
-
if (r == null || r === 0 || v <= 0 ||
|
|
995
|
-
const b = r / v,
|
|
996
|
-
return
|
|
991
|
+
u,
|
|
992
|
+
p
|
|
993
|
+
]), m = u ?? (f == null ? void 0 : f.linePoints) ?? [], v = p ?? (f == null ? void 0 : f.lineLength) ?? 0, h = te(() => {
|
|
994
|
+
if (r == null || r === 0 || v <= 0 || m.length < 2) return null;
|
|
995
|
+
const b = r / v, F = m.reduce((A, z) => A + z.x, 0) / m.length, S = m.reduce((A, z) => A + z.z, 0) / m.length;
|
|
996
|
+
return m.map((A) => new P(F + (A.x - F) * b, A.y, S + (A.z - S) * b));
|
|
997
997
|
}, [
|
|
998
|
-
|
|
998
|
+
m,
|
|
999
999
|
v,
|
|
1000
1000
|
r
|
|
1001
|
-
]), x =
|
|
1002
|
-
|
|
1001
|
+
]), x = te(() => !h || m.length < 2 ? null : fr(m, h), [
|
|
1002
|
+
m,
|
|
1003
1003
|
h
|
|
1004
1004
|
]);
|
|
1005
|
-
|
|
1005
|
+
Z(() => () => {
|
|
1006
1006
|
x && (x.geometry.dispose(), x.material.dispose());
|
|
1007
1007
|
}, [
|
|
1008
1008
|
x
|
|
1009
1009
|
]);
|
|
1010
|
-
const w =
|
|
1011
|
-
const b = new
|
|
1012
|
-
b.setAttribute("position", new
|
|
1013
|
-
const
|
|
1010
|
+
const w = ue(null), C = te(() => {
|
|
1011
|
+
const b = new q.BufferGeometry();
|
|
1012
|
+
b.setAttribute("position", new q.Float32BufferAttribute(new Float32Array(6), 3));
|
|
1013
|
+
const F = new q.LineBasicMaterial({
|
|
1014
1014
|
color: 6710886,
|
|
1015
1015
|
depthTest: false,
|
|
1016
1016
|
depthWrite: false,
|
|
1017
1017
|
transparent: true
|
|
1018
1018
|
});
|
|
1019
|
-
return new
|
|
1019
|
+
return new q.Line(b, F);
|
|
1020
1020
|
}, []);
|
|
1021
|
-
return
|
|
1021
|
+
return Z(() => () => {
|
|
1022
1022
|
C.geometry.dispose(), C.material.dispose();
|
|
1023
1023
|
}, [
|
|
1024
1024
|
C
|
|
1025
|
-
]),
|
|
1025
|
+
]), Z(() => {
|
|
1026
1026
|
v > 0 && (l == null ? void 0 : l({
|
|
1027
1027
|
yPosition: t,
|
|
1028
1028
|
originalValue: v,
|
|
@@ -1032,28 +1032,28 @@ let __tla = (async () => {
|
|
|
1032
1032
|
v,
|
|
1033
1033
|
t,
|
|
1034
1034
|
l
|
|
1035
|
-
]),
|
|
1036
|
-
if (!w.current ||
|
|
1037
|
-
const
|
|
1038
|
-
b.getWorldDirection(
|
|
1039
|
-
const S = new
|
|
1035
|
+
]), Bn(({ camera: b }) => {
|
|
1036
|
+
if (!w.current || m.length < 2) return;
|
|
1037
|
+
const F = new P();
|
|
1038
|
+
b.getWorldDirection(F);
|
|
1039
|
+
const S = new P(F.x, 0, F.z);
|
|
1040
1040
|
if (S.lengthSq() < 1e-8) return;
|
|
1041
1041
|
S.normalize();
|
|
1042
|
-
const A = new
|
|
1043
|
-
let z = -1 / 0, _ =
|
|
1044
|
-
for (const I of
|
|
1045
|
-
const
|
|
1046
|
-
|
|
1042
|
+
const A = new P().crossVectors(S, new P(0, 1, 0)).normalize();
|
|
1043
|
+
let z = -1 / 0, _ = m[0];
|
|
1044
|
+
for (const I of m) {
|
|
1045
|
+
const W = A.x * I.x + A.z * I.z;
|
|
1046
|
+
W > z && (z = W, _ = I);
|
|
1047
1047
|
}
|
|
1048
|
-
const
|
|
1049
|
-
w.current.position.copy(
|
|
1050
|
-
const
|
|
1051
|
-
|
|
1052
|
-
}),
|
|
1048
|
+
const B = s * 0.35, N = new P(_.x + A.x * B, t, _.z + A.z * B);
|
|
1049
|
+
w.current.position.copy(N);
|
|
1050
|
+
const k = C.geometry.getAttribute("position");
|
|
1051
|
+
k.setXYZ(0, _.x, _.y, _.z), k.setXYZ(1, N.x, N.y, N.z), k.needsUpdate = true;
|
|
1052
|
+
}), m.length < 2 ? null : y("group", {
|
|
1053
1053
|
renderOrder: 10,
|
|
1054
1054
|
children: [
|
|
1055
|
-
i(
|
|
1056
|
-
points:
|
|
1055
|
+
i(ve, {
|
|
1056
|
+
points: m,
|
|
1057
1057
|
color: n,
|
|
1058
1058
|
lineWidth: c,
|
|
1059
1059
|
depthTest: false,
|
|
@@ -1065,7 +1065,7 @@ let __tla = (async () => {
|
|
|
1065
1065
|
object: x,
|
|
1066
1066
|
renderOrder: 10
|
|
1067
1067
|
}),
|
|
1068
|
-
h && r != null && r !== 0 && i(
|
|
1068
|
+
h && r != null && r !== 0 && i(ve, {
|
|
1069
1069
|
points: h,
|
|
1070
1070
|
color: Dn(v, r),
|
|
1071
1071
|
lineWidth: 2.5,
|
|
@@ -1134,7 +1134,7 @@ let __tla = (async () => {
|
|
|
1134
1134
|
]
|
|
1135
1135
|
}),
|
|
1136
1136
|
r != null && r !== 0 && v > 0 && (() => {
|
|
1137
|
-
const b = v - r,
|
|
1137
|
+
const b = v - r, F = b > 0.5 ? "\u25B2" : b < -0.5 ? "\u25BC" : "", S = Dn(v, r);
|
|
1138
1138
|
return y("div", {
|
|
1139
1139
|
style: {
|
|
1140
1140
|
display: "flex",
|
|
@@ -1146,13 +1146,13 @@ let __tla = (async () => {
|
|
|
1146
1146
|
borderLeft: "1px solid rgba(255,255,255,0.12)"
|
|
1147
1147
|
},
|
|
1148
1148
|
children: [
|
|
1149
|
-
|
|
1149
|
+
F && i("span", {
|
|
1150
1150
|
style: {
|
|
1151
1151
|
fontSize: 10,
|
|
1152
1152
|
color: S,
|
|
1153
1153
|
lineHeight: 1
|
|
1154
1154
|
},
|
|
1155
|
-
children:
|
|
1155
|
+
children: F
|
|
1156
1156
|
}),
|
|
1157
1157
|
y("span", {
|
|
1158
1158
|
style: {
|
|
@@ -1186,20 +1186,20 @@ let __tla = (async () => {
|
|
|
1186
1186
|
})
|
|
1187
1187
|
]
|
|
1188
1188
|
});
|
|
1189
|
-
},
|
|
1190
|
-
const f =
|
|
1191
|
-
if (
|
|
1189
|
+
}, pr = _o(ur), hr = ({ mesh: e, startY: o, endY: t, spacing: n, modelSize: s, onMeasurementsChange: l, reverseOrder: d = false, displayUnit: a = "cm", useInnerSurface: r = false, formMeasurements: c, originY: u, wasmSlices: p }) => {
|
|
1190
|
+
const f = ue(/* @__PURE__ */ new Map()), m = e.geometry, v = Kn(m), h = te(() => {
|
|
1191
|
+
if (p) {
|
|
1192
1192
|
let z = [
|
|
1193
|
-
...
|
|
1193
|
+
...p.yValues
|
|
1194
1194
|
];
|
|
1195
1195
|
if (n > 25.4 + 0.1) {
|
|
1196
|
-
const _ =
|
|
1197
|
-
z = z.filter((
|
|
1198
|
-
const
|
|
1199
|
-
return
|
|
1196
|
+
const _ = p.mptY;
|
|
1197
|
+
z = z.filter((B) => {
|
|
1198
|
+
const N = Math.abs(B - _);
|
|
1199
|
+
return N < 0.5 || Math.abs(Math.round(N / n) * n - N) < 0.5;
|
|
1200
1200
|
});
|
|
1201
1201
|
}
|
|
1202
|
-
return d ? z.sort((_,
|
|
1202
|
+
return d ? z.sort((_, B) => B - _) : z.sort((_, B) => _ - B), z;
|
|
1203
1203
|
}
|
|
1204
1204
|
const S = [];
|
|
1205
1205
|
if (d) for (let A = t; A >= o; A -= n) S.push(A);
|
|
@@ -1210,33 +1210,33 @@ let __tla = (async () => {
|
|
|
1210
1210
|
t,
|
|
1211
1211
|
n,
|
|
1212
1212
|
d,
|
|
1213
|
-
|
|
1214
|
-
]), x =
|
|
1215
|
-
if (!
|
|
1216
|
-
const S = /* @__PURE__ */ new Map(), { allLoopPoints: A, offsets: z, yValues: _ } =
|
|
1217
|
-
for (let
|
|
1218
|
-
const
|
|
1219
|
-
if (
|
|
1213
|
+
p
|
|
1214
|
+
]), x = te(() => {
|
|
1215
|
+
if (!p) return null;
|
|
1216
|
+
const S = /* @__PURE__ */ new Map(), { allLoopPoints: A, offsets: z, yValues: _ } = p;
|
|
1217
|
+
for (let B = 0; B < z.length - 1; B++) {
|
|
1218
|
+
const N = z[B], k = z[B + 1];
|
|
1219
|
+
if (k <= N) continue;
|
|
1220
1220
|
const I = [];
|
|
1221
|
-
for (let
|
|
1222
|
-
I.length >= 3 && S.set(_[
|
|
1221
|
+
for (let W = N; W < k; W += 3) I.push(new P(A[W], A[W + 1], A[W + 2]));
|
|
1222
|
+
I.length >= 3 && S.set(_[B], I);
|
|
1223
1223
|
}
|
|
1224
1224
|
return S;
|
|
1225
1225
|
}, [
|
|
1226
|
-
|
|
1227
|
-
]), w =
|
|
1228
|
-
if (!
|
|
1226
|
+
p
|
|
1227
|
+
]), w = te(() => {
|
|
1228
|
+
if (!p) return null;
|
|
1229
1229
|
const S = /* @__PURE__ */ new Map();
|
|
1230
|
-
for (let A = 0; A <
|
|
1230
|
+
for (let A = 0; A < p.yValues.length; A++) S.set(p.yValues[A], p.circumferences[A]);
|
|
1231
1231
|
return S;
|
|
1232
1232
|
}, [
|
|
1233
|
-
|
|
1233
|
+
p
|
|
1234
1234
|
]);
|
|
1235
|
-
|
|
1235
|
+
Z(() => {
|
|
1236
1236
|
f.current.clear();
|
|
1237
1237
|
}, [
|
|
1238
1238
|
h
|
|
1239
|
-
]),
|
|
1239
|
+
]), Z(() => {
|
|
1240
1240
|
if (!w || !l) return;
|
|
1241
1241
|
const S = h.filter((A) => (w.get(A) ?? 0) > 0).map((A) => ({
|
|
1242
1242
|
yPosition: A,
|
|
@@ -1251,7 +1251,7 @@ let __tla = (async () => {
|
|
|
1251
1251
|
]);
|
|
1252
1252
|
const C = [
|
|
1253
1253
|
"#5B9BD5"
|
|
1254
|
-
], b = s *
|
|
1254
|
+
], b = s * jo, F = de((S) => {
|
|
1255
1255
|
if (w) return;
|
|
1256
1256
|
f.current.set(S.yPosition, S);
|
|
1257
1257
|
const A = Array.from(f.current.values()).sort((z, _) => d ? _.yPosition - z.yPosition : z.yPosition - _.yPosition);
|
|
@@ -1262,54 +1262,54 @@ let __tla = (async () => {
|
|
|
1262
1262
|
w
|
|
1263
1263
|
]);
|
|
1264
1264
|
return v ? i(We, {
|
|
1265
|
-
children: h.map((S, A) => i(
|
|
1265
|
+
children: h.map((S, A) => i(pr, {
|
|
1266
1266
|
bvh: v,
|
|
1267
|
-
geometry:
|
|
1267
|
+
geometry: m,
|
|
1268
1268
|
yPosition: S,
|
|
1269
|
-
color:
|
|
1269
|
+
color: u != null && Math.abs(S - u) < n * 0.5 ? "#44ff44" : C[A % C.length],
|
|
1270
1270
|
labelX: b,
|
|
1271
|
-
onDataChange:
|
|
1271
|
+
onDataChange: F,
|
|
1272
1272
|
displayUnit: a,
|
|
1273
1273
|
useInnerSurface: r,
|
|
1274
1274
|
formValue: c == null ? void 0 : c[A],
|
|
1275
|
-
lineWidth:
|
|
1275
|
+
lineWidth: u != null && Math.abs(S - u) < n * 0.5 ? 4 : 1.5,
|
|
1276
1276
|
wasmLoopPoints: x == null ? void 0 : x.get(S),
|
|
1277
1277
|
wasmCircumference: w == null ? void 0 : w.get(S)
|
|
1278
1278
|
}, S))
|
|
1279
1279
|
}) : null;
|
|
1280
|
-
},
|
|
1280
|
+
}, gr = (e, o) => {
|
|
1281
1281
|
const t = Math.abs(e - o);
|
|
1282
1282
|
return t <= 7 ? "#4caf50" : t <= 15 ? "#ff9800" : "#f44336";
|
|
1283
|
-
},
|
|
1283
|
+
}, mr = ({ mesh: e, greenY: o, modelSize: t, displayUnit: n = "cm", bottomY: s, formHeight: l }) => {
|
|
1284
1284
|
var _a;
|
|
1285
1285
|
const d = e.geometry;
|
|
1286
1286
|
d.computeBoundingBox();
|
|
1287
|
-
const a = s ?? ((_a = d.boundingBox) == null ? void 0 : _a.min.y) ?? 0, r = o - a, c = t * 0.4,
|
|
1288
|
-
|
|
1289
|
-
if (!
|
|
1290
|
-
const z = new
|
|
1287
|
+
const a = s ?? ((_a = d.boundingBox) == null ? void 0 : _a.min.y) ?? 0, r = o - a, c = t * 0.4, u = t * 0.03, p = ue(null);
|
|
1288
|
+
Bn(({ camera: A }) => {
|
|
1289
|
+
if (!p.current) return;
|
|
1290
|
+
const z = new P();
|
|
1291
1291
|
A.getWorldDirection(z);
|
|
1292
|
-
const _ = new
|
|
1292
|
+
const _ = new P(z.x, 0, z.z);
|
|
1293
1293
|
if (_.lengthSq() < 1e-8) return;
|
|
1294
1294
|
_.normalize();
|
|
1295
|
-
const
|
|
1296
|
-
|
|
1297
|
-
const
|
|
1298
|
-
|
|
1295
|
+
const B = new P().crossVectors(new P(0, 1, 0), _).normalize();
|
|
1296
|
+
p.current.position.set(B.x * c, 0, B.z * c);
|
|
1297
|
+
const N = A.position.x - p.current.position.x, k = A.position.z - p.current.position.z;
|
|
1298
|
+
p.current.rotation.y = Math.atan2(N, k);
|
|
1299
1299
|
});
|
|
1300
|
-
const f = new
|
|
1300
|
+
const f = new P(0, o, 0), m = new P(0, a, 0), v = new P(0, (o + a) / 2, 0), h = new P(-u, o, 0), x = new P(u, o, 0), w = new P(-u, a, 0), C = new P(u, a, 0), b = l != null && l > 0, F = b ? r - l : 0, S = b ? gr(r, l) : "#fff";
|
|
1301
1301
|
return y("group", {
|
|
1302
|
-
ref:
|
|
1302
|
+
ref: p,
|
|
1303
1303
|
children: [
|
|
1304
|
-
i(
|
|
1304
|
+
i(ve, {
|
|
1305
1305
|
points: [
|
|
1306
1306
|
f,
|
|
1307
|
-
|
|
1307
|
+
m
|
|
1308
1308
|
],
|
|
1309
1309
|
color: "#888888",
|
|
1310
1310
|
lineWidth: 1.5
|
|
1311
1311
|
}),
|
|
1312
|
-
i(
|
|
1312
|
+
i(ve, {
|
|
1313
1313
|
points: [
|
|
1314
1314
|
h,
|
|
1315
1315
|
x
|
|
@@ -1317,7 +1317,7 @@ let __tla = (async () => {
|
|
|
1317
1317
|
color: "#888888",
|
|
1318
1318
|
lineWidth: 1.5
|
|
1319
1319
|
}),
|
|
1320
|
-
i(
|
|
1320
|
+
i(ve, {
|
|
1321
1321
|
points: [
|
|
1322
1322
|
w,
|
|
1323
1323
|
C
|
|
@@ -1377,13 +1377,13 @@ let __tla = (async () => {
|
|
|
1377
1377
|
pointerEvents: "none"
|
|
1378
1378
|
},
|
|
1379
1379
|
children: [
|
|
1380
|
-
Math.abs(
|
|
1380
|
+
Math.abs(F) > 0.5 && i("span", {
|
|
1381
1381
|
style: {
|
|
1382
1382
|
fontSize: 10,
|
|
1383
1383
|
color: S,
|
|
1384
1384
|
lineHeight: 1
|
|
1385
1385
|
},
|
|
1386
|
-
children:
|
|
1386
|
+
children: F > 0.5 ? "\u25B2" : "\u25BC"
|
|
1387
1387
|
}),
|
|
1388
1388
|
y("span", {
|
|
1389
1389
|
style: {
|
|
@@ -1393,8 +1393,8 @@ let __tla = (async () => {
|
|
|
1393
1393
|
fontWeight: 600
|
|
1394
1394
|
},
|
|
1395
1395
|
children: [
|
|
1396
|
-
|
|
1397
|
-
n === "inch" ? (
|
|
1396
|
+
F > 0 ? "+" : "",
|
|
1397
|
+
n === "inch" ? (F / 25.4).toFixed(2) : (F / 10).toFixed(1)
|
|
1398
1398
|
]
|
|
1399
1399
|
}),
|
|
1400
1400
|
y("span", {
|
|
@@ -1416,38 +1416,38 @@ let __tla = (async () => {
|
|
|
1416
1416
|
})
|
|
1417
1417
|
]
|
|
1418
1418
|
});
|
|
1419
|
-
},
|
|
1420
|
-
const { set:
|
|
1419
|
+
}, xr = ({ modelSize: e, isAligned: o, isCut: t, mesh: n, viewMode: s, sliceY: l, landmarkCount: d = 0, measurementGeometry: a, fitYMin: r, fitYMax: c, resetCameraToFrontRef: u }) => {
|
|
1420
|
+
const { set: p, size: f, camera: m, invalidate: v } = En(), h = ue(false), x = ue(s), w = ue(new P()), C = ue(null), b = ue(d), F = ue(o), S = ue(t), A = ue(a), z = ue({
|
|
1421
1421
|
min: r,
|
|
1422
1422
|
max: c
|
|
1423
|
-
}), _ =
|
|
1423
|
+
}), _ = ue(0), B = de(() => {
|
|
1424
1424
|
if (!n || e <= 0) return null;
|
|
1425
|
-
const
|
|
1426
|
-
|
|
1427
|
-
const I =
|
|
1428
|
-
I.getCenter(
|
|
1429
|
-
const $ = new
|
|
1425
|
+
const k = a ?? n.geometry;
|
|
1426
|
+
k.computeBoundingBox();
|
|
1427
|
+
const I = k.boundingBox, W = new P();
|
|
1428
|
+
I.getCenter(W);
|
|
1429
|
+
const $ = new P();
|
|
1430
1430
|
I.getSize($);
|
|
1431
|
-
const
|
|
1432
|
-
if (
|
|
1433
|
-
const
|
|
1434
|
-
if (
|
|
1435
|
-
const
|
|
1436
|
-
let
|
|
1437
|
-
for (let
|
|
1438
|
-
const
|
|
1439
|
-
if (
|
|
1440
|
-
const T =
|
|
1441
|
-
T <
|
|
1431
|
+
const G = r != null && c != null && c > r;
|
|
1432
|
+
if (G) {
|
|
1433
|
+
const re = r, R = c, H = k.getAttribute("position");
|
|
1434
|
+
if (H) {
|
|
1435
|
+
const ne = H.array, Q = (R - re) * 0.08;
|
|
1436
|
+
let j = 1 / 0, K = -1 / 0, fe = re - Q, ie = R + Q, pe = false;
|
|
1437
|
+
for (let he = 0; he < H.count; he++) {
|
|
1438
|
+
const Se = ne[he * 3 + 1];
|
|
1439
|
+
if (Se < re - Q || Se > R + Q) continue;
|
|
1440
|
+
const T = ne[he * 3];
|
|
1441
|
+
T < j && (j = T), T > K && (K = T), pe = true;
|
|
1442
1442
|
}
|
|
1443
|
-
|
|
1443
|
+
pe && (W.set((j + K) / 2, (fe + ie) / 2, 0), $.set(K - j, ie - fe, 0));
|
|
1444
1444
|
}
|
|
1445
1445
|
}
|
|
1446
1446
|
w.current.copy($);
|
|
1447
|
-
const
|
|
1448
|
-
_.current =
|
|
1449
|
-
const
|
|
1450
|
-
return
|
|
1447
|
+
const oe = f.width / f.height, ce = 1.35, se = G ? 1.15 : 1.6, J = Math.max($.y * se, $.x * ce / oe), ae = J * oe, U = W.y - $.y * 0.05;
|
|
1448
|
+
_.current = U;
|
|
1449
|
+
const ge = new q.OrthographicCamera(-ae / 2, ae / 2, J / 2, -J / 2, 0.1, e * 10);
|
|
1450
|
+
return ge.position.set(0, U, e * 2), ge.lookAt(0, U, 0), ge;
|
|
1451
1451
|
}, [
|
|
1452
1452
|
n,
|
|
1453
1453
|
e,
|
|
@@ -1456,58 +1456,58 @@ let __tla = (async () => {
|
|
|
1456
1456
|
r,
|
|
1457
1457
|
c
|
|
1458
1458
|
]);
|
|
1459
|
-
|
|
1460
|
-
if (
|
|
1461
|
-
const
|
|
1462
|
-
|
|
1463
|
-
camera:
|
|
1459
|
+
Z(() => {
|
|
1460
|
+
if (u) return u.current = () => {
|
|
1461
|
+
const k = B();
|
|
1462
|
+
k && (p({
|
|
1463
|
+
camera: k
|
|
1464
1464
|
}), v());
|
|
1465
1465
|
}, () => {
|
|
1466
|
-
|
|
1466
|
+
u && (u.current = null);
|
|
1467
1467
|
};
|
|
1468
1468
|
}, [
|
|
1469
|
-
p,
|
|
1470
|
-
E,
|
|
1471
1469
|
u,
|
|
1470
|
+
B,
|
|
1471
|
+
p,
|
|
1472
1472
|
v
|
|
1473
1473
|
]);
|
|
1474
|
-
const
|
|
1475
|
-
const I =
|
|
1476
|
-
|
|
1474
|
+
const N = de((k) => {
|
|
1475
|
+
const I = k.position.clone(), W = I.length(), $ = Math.atan2(I.x, I.z), G = Math.acos(I.y / W), ce = $ + 0.02;
|
|
1476
|
+
k.position.set(W * Math.sin(G) * Math.sin(ce), W * Math.cos(G), W * Math.sin(G) * Math.cos(ce)), k.lookAt(0, 0, 0), k.updateMatrixWorld(true), v();
|
|
1477
1477
|
}, [
|
|
1478
1478
|
v
|
|
1479
1479
|
]);
|
|
1480
|
-
return
|
|
1480
|
+
return Z(() => {
|
|
1481
1481
|
if (e > 0 && !h.current && !o) {
|
|
1482
1482
|
h.current = true;
|
|
1483
|
-
const
|
|
1484
|
-
|
|
1485
|
-
camera:
|
|
1486
|
-
}), requestAnimationFrame(() =>
|
|
1483
|
+
const k = new q.PerspectiveCamera(50, f.width / f.height, 0.1, e * 10);
|
|
1484
|
+
k.position.set(e * 0.3, e * 0.2, e * 1.5), k.lookAt(0, 0, 0), p({
|
|
1485
|
+
camera: k
|
|
1486
|
+
}), requestAnimationFrame(() => N(k));
|
|
1487
1487
|
}
|
|
1488
1488
|
}, [
|
|
1489
1489
|
e,
|
|
1490
1490
|
f,
|
|
1491
|
-
|
|
1491
|
+
p,
|
|
1492
1492
|
o,
|
|
1493
|
-
|
|
1494
|
-
]),
|
|
1495
|
-
const
|
|
1496
|
-
b.current = d,
|
|
1493
|
+
N
|
|
1494
|
+
]), Z(() => {
|
|
1495
|
+
const k = b.current;
|
|
1496
|
+
b.current = d, k === 0 && d === 1 && !o && requestAnimationFrame(() => N(m));
|
|
1497
1497
|
}, [
|
|
1498
1498
|
d,
|
|
1499
1499
|
o,
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
]),
|
|
1503
|
-
const
|
|
1504
|
-
if (
|
|
1500
|
+
m,
|
|
1501
|
+
N
|
|
1502
|
+
]), Z(() => {
|
|
1503
|
+
const k = F.current !== o, I = S.current !== t, W = !A.current && !!a, $ = (z.current.min == null || z.current.max == null) && r != null && c != null;
|
|
1504
|
+
if (F.current = o, S.current = t, A.current = a, z.current = {
|
|
1505
1505
|
min: r,
|
|
1506
1506
|
max: c
|
|
1507
|
-
}, !
|
|
1508
|
-
const
|
|
1509
|
-
|
|
1510
|
-
camera:
|
|
1507
|
+
}, !k && !I && !W && !$ || !o || s !== "3D") return;
|
|
1508
|
+
const G = B();
|
|
1509
|
+
G && p({
|
|
1510
|
+
camera: G
|
|
1511
1511
|
});
|
|
1512
1512
|
}, [
|
|
1513
1513
|
o,
|
|
@@ -1516,38 +1516,38 @@ let __tla = (async () => {
|
|
|
1516
1516
|
a,
|
|
1517
1517
|
r,
|
|
1518
1518
|
c,
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
]),
|
|
1519
|
+
B,
|
|
1520
|
+
p
|
|
1521
|
+
]), Z(() => {
|
|
1522
1522
|
if (x.current === s) return;
|
|
1523
|
-
const
|
|
1523
|
+
const k = x.current;
|
|
1524
1524
|
if (x.current = s, !(!o || !n || e <= 0)) {
|
|
1525
1525
|
if (s === "2D" && l != null) {
|
|
1526
|
-
C.current =
|
|
1527
|
-
const I = n.geometry,
|
|
1528
|
-
let
|
|
1529
|
-
for (let fe = 0; fe <
|
|
1530
|
-
const
|
|
1531
|
-
|
|
1526
|
+
C.current = m;
|
|
1527
|
+
const I = n.geometry, W = I.getAttribute("position"), $ = W.array, G = e * 0.15;
|
|
1528
|
+
let oe = 1 / 0, ce = -1 / 0, se = 1 / 0, J = -1 / 0, ae = false;
|
|
1529
|
+
for (let fe = 0; fe < W.count; fe++) if (Math.abs($[fe * 3 + 1] - l) < G) {
|
|
1530
|
+
const ie = $[fe * 3], pe = $[fe * 3 + 2];
|
|
1531
|
+
ie < oe && (oe = ie), ie > ce && (ce = ie), pe < se && (se = pe), pe > J && (J = pe), ae = true;
|
|
1532
1532
|
}
|
|
1533
|
-
if (!
|
|
1533
|
+
if (!ae) {
|
|
1534
1534
|
I.computeBoundingBox();
|
|
1535
1535
|
const fe = I.boundingBox;
|
|
1536
|
-
|
|
1536
|
+
oe = fe.min.x, ce = fe.max.x, se = fe.min.z, J = fe.max.z;
|
|
1537
1537
|
}
|
|
1538
|
-
const
|
|
1539
|
-
let
|
|
1540
|
-
|
|
1541
|
-
const K = new
|
|
1542
|
-
K.position.set(
|
|
1538
|
+
const U = (oe + ce) / 2, ge = (se + J) / 2, re = f.width / f.height, R = 1.4, H = (ce - oe) * R, ne = (J - se) * R;
|
|
1539
|
+
let Q, j;
|
|
1540
|
+
H / ne > re ? (Q = H, j = H / re) : (j = ne, Q = ne * re);
|
|
1541
|
+
const K = new q.OrthographicCamera(-Q / 2, Q / 2, j / 2, -j / 2, 0.1, e * 10);
|
|
1542
|
+
K.position.set(U, l + e * 2, ge), K.up.set(0, 0, -1), K.lookAt(U, l, ge), p({
|
|
1543
1543
|
camera: K
|
|
1544
1544
|
});
|
|
1545
|
-
} else if (
|
|
1545
|
+
} else if (k === "2D") if (C.current) p({
|
|
1546
1546
|
camera: C.current
|
|
1547
1547
|
}), C.current = null;
|
|
1548
1548
|
else {
|
|
1549
|
-
const I =
|
|
1550
|
-
I &&
|
|
1549
|
+
const I = B();
|
|
1550
|
+
I && p({
|
|
1551
1551
|
camera: I
|
|
1552
1552
|
});
|
|
1553
1553
|
}
|
|
@@ -1559,46 +1559,46 @@ let __tla = (async () => {
|
|
|
1559
1559
|
n,
|
|
1560
1560
|
e,
|
|
1561
1561
|
f,
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
]),
|
|
1566
|
-
if (!o || !
|
|
1567
|
-
const
|
|
1562
|
+
p,
|
|
1563
|
+
m,
|
|
1564
|
+
B
|
|
1565
|
+
]), Z(() => {
|
|
1566
|
+
if (!o || !m || !m.isOrthographicCamera) return;
|
|
1567
|
+
const k = m;
|
|
1568
1568
|
if (s === "2D") {
|
|
1569
1569
|
if (!n || l == null) return;
|
|
1570
|
-
const I = n.geometry,
|
|
1571
|
-
let
|
|
1572
|
-
for (let
|
|
1573
|
-
const
|
|
1574
|
-
|
|
1570
|
+
const I = n.geometry, W = I.getAttribute("position"), $ = W.array, G = e * 0.15;
|
|
1571
|
+
let oe = 1 / 0, ce = -1 / 0, se = 1 / 0, J = -1 / 0, ae = false;
|
|
1572
|
+
for (let Q = 0; Q < W.count; Q++) if (Math.abs($[Q * 3 + 1] - l) < G) {
|
|
1573
|
+
const j = $[Q * 3], K = $[Q * 3 + 2];
|
|
1574
|
+
j < oe && (oe = j), j > ce && (ce = j), K < se && (se = K), K > J && (J = K), ae = true;
|
|
1575
1575
|
}
|
|
1576
|
-
if (!
|
|
1576
|
+
if (!ae) {
|
|
1577
1577
|
I.computeBoundingBox();
|
|
1578
|
-
const
|
|
1579
|
-
|
|
1578
|
+
const Q = I.boundingBox;
|
|
1579
|
+
oe = Q.min.x, ce = Q.max.x, se = Q.min.z, J = Q.max.z;
|
|
1580
1580
|
}
|
|
1581
|
-
const
|
|
1582
|
-
let
|
|
1583
|
-
|
|
1581
|
+
const U = f.width / f.height, ge = 1.4, re = (ce - oe) * ge, R = (J - se) * ge;
|
|
1582
|
+
let H, ne;
|
|
1583
|
+
re / R > U ? (H = re, ne = re / U) : (ne = R, H = R * U), k.left = -H / 2, k.right = H / 2, k.top = ne / 2, k.bottom = -ne / 2;
|
|
1584
1584
|
} else {
|
|
1585
|
-
const I = w.current,
|
|
1586
|
-
|
|
1585
|
+
const I = w.current, W = f.width / f.height, $ = Math.max(I.y, I.x / W) * 1.6, G = $ * W;
|
|
1586
|
+
k.left = -G / 2, k.right = G / 2, k.top = $ / 2, k.bottom = -$ / 2;
|
|
1587
1587
|
}
|
|
1588
|
-
|
|
1588
|
+
k.updateProjectionMatrix();
|
|
1589
1589
|
}, [
|
|
1590
1590
|
f.width,
|
|
1591
1591
|
f.height,
|
|
1592
1592
|
o,
|
|
1593
|
-
|
|
1593
|
+
m,
|
|
1594
1594
|
s,
|
|
1595
1595
|
n
|
|
1596
1596
|
]), null;
|
|
1597
|
-
},
|
|
1597
|
+
}, br = ({ mesh: e, isDragging: o }) => {
|
|
1598
1598
|
var _a;
|
|
1599
1599
|
const t = e.geometry;
|
|
1600
1600
|
t.computeBoundingBox();
|
|
1601
|
-
const n = new
|
|
1601
|
+
const n = new P();
|
|
1602
1602
|
return (_a = t.boundingBox) == null ? void 0 : _a.getCenter(n), i($n, {
|
|
1603
1603
|
enableDamping: false,
|
|
1604
1604
|
enablePan: false,
|
|
@@ -1613,12 +1613,12 @@ let __tla = (async () => {
|
|
|
1613
1613
|
n.z
|
|
1614
1614
|
]
|
|
1615
1615
|
});
|
|
1616
|
-
},
|
|
1616
|
+
}, yr = {
|
|
1617
1617
|
meter: "Scan units detected as meters \u2014 auto-scaled to millimeters",
|
|
1618
1618
|
cm: "Scan units detected as centimeters \u2014 auto-scaled to millimeters",
|
|
1619
1619
|
mm: "Scan units detected as millimeters"
|
|
1620
|
-
},
|
|
1621
|
-
const t = e === "meter" || e === "cm", n =
|
|
1620
|
+
}, wr = ({ detectedUnit: e, onDismiss: o }) => {
|
|
1621
|
+
const t = e === "meter" || e === "cm", n = yr[e] ?? "Scan units could not be determined";
|
|
1622
1622
|
return y("div", {
|
|
1623
1623
|
style: {
|
|
1624
1624
|
position: "absolute",
|
|
@@ -1661,7 +1661,7 @@ let __tla = (async () => {
|
|
|
1661
1661
|
})
|
|
1662
1662
|
]
|
|
1663
1663
|
});
|
|
1664
|
-
},
|
|
1664
|
+
}, vr = ({ isDoubleShell: e, onDismiss: o }) => (Z(() => {
|
|
1665
1665
|
const t = setTimeout(o, 1e4);
|
|
1666
1666
|
return () => clearTimeout(t);
|
|
1667
1667
|
}, []), y("div", {
|
|
@@ -1705,41 +1705,41 @@ let __tla = (async () => {
|
|
|
1705
1705
|
children: "X"
|
|
1706
1706
|
})
|
|
1707
1707
|
]
|
|
1708
|
-
})),
|
|
1708
|
+
})), _n = (e, o) => {
|
|
1709
1709
|
const t = Math.abs(e - o);
|
|
1710
1710
|
return t <= 7 ? "#4caf50" : t <= 15 ? "#ff9800" : "#f44336";
|
|
1711
|
-
},
|
|
1712
|
-
const r = e.geometry, c =
|
|
1713
|
-
maxLeafTris:
|
|
1711
|
+
}, Sr = ({ mesh: e, upperY: o, originY: t, modelSize: n, meshColor: s = "#c8c8c8", displayUnit: l = "cm", formML: d, formAP: a }) => {
|
|
1712
|
+
const r = e.geometry, c = te(() => new At(r, {
|
|
1713
|
+
maxLeafTris: zt
|
|
1714
1714
|
}), [
|
|
1715
1715
|
r
|
|
1716
|
-
]),
|
|
1716
|
+
]), u = te(() => je(c, r, t), [
|
|
1717
1717
|
c,
|
|
1718
1718
|
r,
|
|
1719
1719
|
t
|
|
1720
|
-
]),
|
|
1720
|
+
]), p = te(() => new Ct(new P(0, -1, 0), o), [
|
|
1721
1721
|
o
|
|
1722
|
-
]), { mlLine: f, apLine:
|
|
1723
|
-
let C = null, b = null,
|
|
1724
|
-
if (
|
|
1725
|
-
let A =
|
|
1726
|
-
for (const
|
|
1722
|
+
]), { mlLine: f, apLine: m, mlWidth: v, apWidth: h } = te(() => {
|
|
1723
|
+
let C = null, b = null, F = 0, S = 0;
|
|
1724
|
+
if (u.linePoints.length >= 2) {
|
|
1725
|
+
let A = u.linePoints[0], z = u.linePoints[0], _ = u.linePoints[0], B = u.linePoints[0];
|
|
1726
|
+
for (const N of u.linePoints) N.x < A.x && (A = N), N.x > z.x && (z = N), N.z < _.z && (_ = N), N.z > B.z && (B = N);
|
|
1727
1727
|
C = [
|
|
1728
|
-
new
|
|
1729
|
-
new
|
|
1728
|
+
new P(A.x, t, A.z),
|
|
1729
|
+
new P(z.x, t, z.z)
|
|
1730
1730
|
], b = [
|
|
1731
|
-
new
|
|
1732
|
-
new
|
|
1733
|
-
],
|
|
1731
|
+
new P(_.x, t, _.z),
|
|
1732
|
+
new P(B.x, t, B.z)
|
|
1733
|
+
], F = C[0].distanceTo(C[1]), S = b[0].distanceTo(b[1]);
|
|
1734
1734
|
}
|
|
1735
1735
|
return {
|
|
1736
1736
|
mlLine: C,
|
|
1737
1737
|
apLine: b,
|
|
1738
|
-
mlWidth:
|
|
1738
|
+
mlWidth: F,
|
|
1739
1739
|
apWidth: S
|
|
1740
1740
|
};
|
|
1741
1741
|
}, [
|
|
1742
|
-
|
|
1742
|
+
u,
|
|
1743
1743
|
t
|
|
1744
1744
|
]), x = (C) => l === "inch" ? (C / 25.4).toFixed(2) : (C / 10).toFixed(1), w = l === "inch" ? "in" : "cm";
|
|
1745
1745
|
return y(We, {
|
|
@@ -1748,17 +1748,17 @@ let __tla = (async () => {
|
|
|
1748
1748
|
geometry: e.geometry,
|
|
1749
1749
|
children: i("meshStandardMaterial", {
|
|
1750
1750
|
color: s,
|
|
1751
|
-
side:
|
|
1751
|
+
side: q.DoubleSide,
|
|
1752
1752
|
transparent: true,
|
|
1753
1753
|
opacity: 0.15,
|
|
1754
1754
|
depthWrite: false,
|
|
1755
1755
|
clippingPlanes: [
|
|
1756
|
-
|
|
1756
|
+
p
|
|
1757
1757
|
]
|
|
1758
1758
|
})
|
|
1759
1759
|
}),
|
|
1760
|
-
|
|
1761
|
-
points:
|
|
1760
|
+
u.linePoints.length >= 2 && i(ve, {
|
|
1761
|
+
points: u.linePoints,
|
|
1762
1762
|
color: "#00ff00",
|
|
1763
1763
|
lineWidth: 3,
|
|
1764
1764
|
depthTest: false,
|
|
@@ -1767,7 +1767,7 @@ let __tla = (async () => {
|
|
|
1767
1767
|
}),
|
|
1768
1768
|
f && y(We, {
|
|
1769
1769
|
children: [
|
|
1770
|
-
i(
|
|
1770
|
+
i(ve, {
|
|
1771
1771
|
points: f,
|
|
1772
1772
|
color: "#ff8800",
|
|
1773
1773
|
lineWidth: 2,
|
|
@@ -1814,7 +1814,7 @@ let __tla = (async () => {
|
|
|
1814
1814
|
})
|
|
1815
1815
|
}),
|
|
1816
1816
|
d != null && d > 0 && (() => {
|
|
1817
|
-
const C = v - d, b =
|
|
1817
|
+
const C = v - d, b = _n(v, d), F = C > 0.5 ? "\u25B2" : C < -0.5 ? "\u25BC" : "";
|
|
1818
1818
|
return y("div", {
|
|
1819
1819
|
style: {
|
|
1820
1820
|
display: "flex",
|
|
@@ -1826,13 +1826,13 @@ let __tla = (async () => {
|
|
|
1826
1826
|
borderTop: "1px solid rgba(255,255,255,0.12)"
|
|
1827
1827
|
},
|
|
1828
1828
|
children: [
|
|
1829
|
-
|
|
1829
|
+
F && i("span", {
|
|
1830
1830
|
style: {
|
|
1831
1831
|
fontSize: 9,
|
|
1832
1832
|
color: b,
|
|
1833
1833
|
lineHeight: 1
|
|
1834
1834
|
},
|
|
1835
|
-
children:
|
|
1835
|
+
children: F
|
|
1836
1836
|
}),
|
|
1837
1837
|
y("span", {
|
|
1838
1838
|
style: {
|
|
@@ -1865,10 +1865,10 @@ let __tla = (async () => {
|
|
|
1865
1865
|
})
|
|
1866
1866
|
]
|
|
1867
1867
|
}),
|
|
1868
|
-
|
|
1868
|
+
m && y(We, {
|
|
1869
1869
|
children: [
|
|
1870
|
-
i(
|
|
1871
|
-
points:
|
|
1870
|
+
i(ve, {
|
|
1871
|
+
points: m,
|
|
1872
1872
|
color: "#ff00ff",
|
|
1873
1873
|
lineWidth: 2,
|
|
1874
1874
|
depthTest: false,
|
|
@@ -1877,9 +1877,9 @@ let __tla = (async () => {
|
|
|
1877
1877
|
}),
|
|
1878
1878
|
i(Xe, {
|
|
1879
1879
|
position: [
|
|
1880
|
-
Math.max(
|
|
1880
|
+
Math.max(m[0].x, m[1].x) + n * 0.02,
|
|
1881
1881
|
t,
|
|
1882
|
-
|
|
1882
|
+
m[0].z > m[1].z ? m[0].z : m[1].z
|
|
1883
1883
|
],
|
|
1884
1884
|
center: true,
|
|
1885
1885
|
style: {
|
|
@@ -1914,7 +1914,7 @@ let __tla = (async () => {
|
|
|
1914
1914
|
})
|
|
1915
1915
|
}),
|
|
1916
1916
|
a != null && a > 0 && (() => {
|
|
1917
|
-
const C = h - a, b =
|
|
1917
|
+
const C = h - a, b = _n(h, a), F = C > 0.5 ? "\u25B2" : C < -0.5 ? "\u25BC" : "";
|
|
1918
1918
|
return y("div", {
|
|
1919
1919
|
style: {
|
|
1920
1920
|
display: "flex",
|
|
@@ -1926,13 +1926,13 @@ let __tla = (async () => {
|
|
|
1926
1926
|
borderTop: "1px solid rgba(255,255,255,0.12)"
|
|
1927
1927
|
},
|
|
1928
1928
|
children: [
|
|
1929
|
-
|
|
1929
|
+
F && i("span", {
|
|
1930
1930
|
style: {
|
|
1931
1931
|
fontSize: 9,
|
|
1932
1932
|
color: b,
|
|
1933
1933
|
lineHeight: 1
|
|
1934
1934
|
},
|
|
1935
|
-
children:
|
|
1935
|
+
children: F
|
|
1936
1936
|
}),
|
|
1937
1937
|
y("span", {
|
|
1938
1938
|
style: {
|
|
@@ -1967,66 +1967,66 @@ let __tla = (async () => {
|
|
|
1967
1967
|
})
|
|
1968
1968
|
]
|
|
1969
1969
|
});
|
|
1970
|
-
},
|
|
1971
|
-
const [f,
|
|
1970
|
+
}, Cr = ({ mesh: e, yPosition: o, onYChange: t, minY: n, maxY: s, modelSize: l, color: d, hoverColor: a, dragColor: r, label: c, onDragStart: u, onDragEnd: p }) => {
|
|
1971
|
+
const [f, m] = E(false), [v, h] = E(false), { camera: x, gl: w } = En(), C = ue(0), b = ue(null), F = e.geometry, S = Kn(F), A = te(() => S ? je(S, F, o) : {
|
|
1972
1972
|
linePoints: [],
|
|
1973
1973
|
lineLength: 0,
|
|
1974
|
-
rightmostPoint: new
|
|
1974
|
+
rightmostPoint: new P()
|
|
1975
1975
|
}, [
|
|
1976
1976
|
S,
|
|
1977
|
-
|
|
1977
|
+
F,
|
|
1978
1978
|
o
|
|
1979
|
-
]), z =
|
|
1980
|
-
const
|
|
1981
|
-
|
|
1982
|
-
const
|
|
1983
|
-
return
|
|
1979
|
+
]), z = de((W, $, G) => {
|
|
1980
|
+
const oe = w.domElement.getBoundingClientRect(), ce = (W - oe.left) / oe.width * 2 - 1, se = -(($ - oe.top) / oe.height) * 2 + 1, J = new Eo();
|
|
1981
|
+
J.setFromCamera(new q.Vector2(ce, se), x);
|
|
1982
|
+
const ae = new P();
|
|
1983
|
+
return J.ray.intersectPlane(G, ae) ? ae.y : null;
|
|
1984
1984
|
}, [
|
|
1985
1985
|
x,
|
|
1986
1986
|
w
|
|
1987
|
-
]), _ =
|
|
1988
|
-
const $ = new
|
|
1987
|
+
]), _ = de((W) => {
|
|
1988
|
+
const $ = new P();
|
|
1989
1989
|
x.getWorldDirection($), $.y = 0, $.lengthSq() < 1e-6 && $.set(0, 0, 1), $.normalize();
|
|
1990
|
-
const
|
|
1991
|
-
return new
|
|
1990
|
+
const G = $.multiplyScalar(-1);
|
|
1991
|
+
return new Ct().setFromNormalAndCoplanarPoint(G, new P(0, W, 0));
|
|
1992
1992
|
}, [
|
|
1993
1993
|
x
|
|
1994
|
-
]),
|
|
1995
|
-
|
|
1994
|
+
]), B = de((W) => {
|
|
1995
|
+
W.stopPropagation(), m(true), w.domElement.style.cursor = "ns-resize";
|
|
1996
1996
|
const $ = _(o);
|
|
1997
1997
|
b.current = $;
|
|
1998
|
-
const
|
|
1999
|
-
C.current =
|
|
1998
|
+
const G = z(W.clientX, W.clientY, $);
|
|
1999
|
+
C.current = G != null ? o - G : 0, W.target.setPointerCapture(W.pointerId), u == null ? void 0 : u();
|
|
2000
2000
|
}, [
|
|
2001
2001
|
o,
|
|
2002
2002
|
w,
|
|
2003
2003
|
_,
|
|
2004
2004
|
z,
|
|
2005
|
-
|
|
2006
|
-
]),
|
|
2005
|
+
u
|
|
2006
|
+
]), N = de((W) => {
|
|
2007
2007
|
if (!f || !b.current) return;
|
|
2008
|
-
const $ = z(
|
|
2008
|
+
const $ = z(W.clientX, W.clientY, b.current);
|
|
2009
2009
|
if ($ == null) return;
|
|
2010
|
-
let
|
|
2011
|
-
|
|
2010
|
+
let G = $ + C.current;
|
|
2011
|
+
G = Math.max(n, Math.min(s, G)), t(G);
|
|
2012
2012
|
}, [
|
|
2013
2013
|
f,
|
|
2014
2014
|
z,
|
|
2015
2015
|
t,
|
|
2016
2016
|
n,
|
|
2017
2017
|
s
|
|
2018
|
-
]),
|
|
2019
|
-
|
|
2018
|
+
]), k = de((W) => {
|
|
2019
|
+
m(false), w.domElement.style.cursor = "auto", b.current = null, W.target.releasePointerCapture(W.pointerId), p == null ? void 0 : p();
|
|
2020
2020
|
}, [
|
|
2021
2021
|
w,
|
|
2022
|
-
|
|
2022
|
+
p
|
|
2023
2023
|
]);
|
|
2024
2024
|
if (A.linePoints.length < 2) return null;
|
|
2025
2025
|
const I = f ? r : v ? a : d;
|
|
2026
2026
|
return y("group", {
|
|
2027
2027
|
renderOrder: 10,
|
|
2028
2028
|
children: [
|
|
2029
|
-
i(
|
|
2029
|
+
i(ve, {
|
|
2030
2030
|
points: A.linePoints,
|
|
2031
2031
|
color: I,
|
|
2032
2032
|
lineWidth: f ? 6 : v ? 5 : 4,
|
|
@@ -2034,9 +2034,9 @@ let __tla = (async () => {
|
|
|
2034
2034
|
depthWrite: false,
|
|
2035
2035
|
transparent: true,
|
|
2036
2036
|
renderOrder: 10,
|
|
2037
|
-
onPointerDown:
|
|
2038
|
-
onPointerMove:
|
|
2039
|
-
onPointerUp:
|
|
2037
|
+
onPointerDown: B,
|
|
2038
|
+
onPointerMove: N,
|
|
2039
|
+
onPointerUp: k,
|
|
2040
2040
|
onPointerEnter: () => {
|
|
2041
2041
|
h(true), w.domElement.style.cursor = "ns-resize";
|
|
2042
2042
|
},
|
|
@@ -2069,16 +2069,16 @@ let __tla = (async () => {
|
|
|
2069
2069
|
]
|
|
2070
2070
|
});
|
|
2071
2071
|
};
|
|
2072
|
-
function
|
|
2072
|
+
function Ar(e, o) {
|
|
2073
2073
|
if (e == null) return {};
|
|
2074
2074
|
var t = {}, n = Object.keys(e), s, l;
|
|
2075
2075
|
for (l = 0; l < n.length; l++) s = n[l], !(o.indexOf(s) >= 0) && (t[s] = e[s]);
|
|
2076
2076
|
return t;
|
|
2077
2077
|
}
|
|
2078
|
-
var
|
|
2078
|
+
var zr = [
|
|
2079
2079
|
"color"
|
|
2080
|
-
],
|
|
2081
|
-
var t = e.color, n = t === void 0 ? "currentColor" : t, s =
|
|
2080
|
+
], Mr = Io(function(e, o) {
|
|
2081
|
+
var t = e.color, n = t === void 0 ? "currentColor" : t, s = Ar(e, zr);
|
|
2082
2082
|
return Mn("svg", Object.assign({
|
|
2083
2083
|
width: "15",
|
|
2084
2084
|
height: "15",
|
|
@@ -2112,19 +2112,19 @@ let __tla = (async () => {
|
|
|
2112
2112
|
outline: "none",
|
|
2113
2113
|
boxSizing: "border-box",
|
|
2114
2114
|
fontFamily: "system-ui, sans-serif"
|
|
2115
|
-
},
|
|
2116
|
-
const v = e === "AK" ? "Perineum" : "MPT", h = o, x = e === "AK" ? 18 : 9, w =
|
|
2115
|
+
}, Pr = ({ amputationType: e, spacingInches: o, scanMeasurements: t, scanFrontalHeight: n, scanTransverseML: s = 0, scanTransverseAP: l = 0, onSave: d, onSkip: a, onFormChange: r, onHeightChange: c, onTransverseMLChange: u, onTransverseAPChange: p, initialValues: f, initialFrontalHeight: m }) => {
|
|
2116
|
+
const v = e === "AK" ? "Perineum" : "MPT", h = o, x = e === "AK" ? 18 : 9, w = te(() => {
|
|
2117
2117
|
const R = [];
|
|
2118
|
-
if (e !== "AK") for (let
|
|
2118
|
+
if (e !== "AK") for (let H = 2; H >= 1; H -= h) R.push(`${H}\u2033 above ${v}`);
|
|
2119
2119
|
R.push(`At ${v}`);
|
|
2120
|
-
for (let
|
|
2120
|
+
for (let H = h; H <= x; H += h) R.push(`${H}\u2033 below ${v}`);
|
|
2121
2121
|
return R;
|
|
2122
2122
|
}, [
|
|
2123
2123
|
h,
|
|
2124
2124
|
v,
|
|
2125
2125
|
x,
|
|
2126
2126
|
e
|
|
2127
|
-
]), C =
|
|
2127
|
+
]), C = te(() => e === "BK" ? /* @__PURE__ */ new Set([
|
|
2128
2128
|
`At ${v}`,
|
|
2129
2129
|
`2\u2033 below ${v}`,
|
|
2130
2130
|
`4\u2033 below ${v}`
|
|
@@ -2135,93 +2135,93 @@ let __tla = (async () => {
|
|
|
2135
2135
|
]), [
|
|
2136
2136
|
e,
|
|
2137
2137
|
v
|
|
2138
|
-
]), [b,
|
|
2138
|
+
]), [b, F] = E(() => {
|
|
2139
2139
|
if (!f) return {};
|
|
2140
2140
|
const R = {};
|
|
2141
|
-
return w.forEach((
|
|
2142
|
-
f[
|
|
2141
|
+
return w.forEach((H, ne) => {
|
|
2142
|
+
f[ne] != null && f[ne] !== 0 && (R[H] = (f[ne] / 10).toFixed(1));
|
|
2143
2143
|
}), R;
|
|
2144
|
-
}), [S, A] =
|
|
2145
|
-
const
|
|
2146
|
-
return
|
|
2144
|
+
}), [S, A] = E(m && m > 0 ? (m / 10).toFixed(1) : ""), [z, _] = E(""), [B, N] = E(""), [k, I] = E(""), [W, $] = E(""), G = e === "AK" ? "Perineum to Distal (Axial)" : "MPT to Distal (Axial)", oe = e === "AK" ? "M/L at Perineum" : "M/L at MPT", ce = e === "AK" ? "A/P at Perineum" : "A/P at MPT", se = te(() => w.map((R) => {
|
|
2145
|
+
const H = b[R];
|
|
2146
|
+
return H != null && H !== "" && !isNaN(parseFloat(H)) ? parseFloat(H) * 10 : 0;
|
|
2147
2147
|
}), [
|
|
2148
2148
|
w,
|
|
2149
2149
|
b
|
|
2150
2150
|
]);
|
|
2151
|
-
|
|
2152
|
-
r == null ? void 0 : r(
|
|
2151
|
+
Z(() => {
|
|
2152
|
+
r == null ? void 0 : r(se);
|
|
2153
2153
|
}, [
|
|
2154
|
-
|
|
2154
|
+
se,
|
|
2155
2155
|
r
|
|
2156
|
-
]),
|
|
2156
|
+
]), Z(() => {
|
|
2157
2157
|
const R = S !== "" && !isNaN(parseFloat(S)) ? parseFloat(S) * 10 : void 0;
|
|
2158
2158
|
c == null ? void 0 : c(R);
|
|
2159
2159
|
}, [
|
|
2160
2160
|
S,
|
|
2161
2161
|
c
|
|
2162
2162
|
]);
|
|
2163
|
-
const
|
|
2164
|
-
|
|
2165
|
-
const R =
|
|
2166
|
-
p == null ? void 0 : p(R);
|
|
2167
|
-
}, [
|
|
2168
|
-
q,
|
|
2169
|
-
p
|
|
2170
|
-
]), Y(() => {
|
|
2171
|
-
const R = ie !== "" && !isNaN(parseFloat(ie)) ? parseFloat(ie) * 10 : void 0;
|
|
2163
|
+
const J = e === "AK" ? z : k, ae = e === "AK" ? B : W;
|
|
2164
|
+
Z(() => {
|
|
2165
|
+
const R = J !== "" && !isNaN(parseFloat(J)) ? parseFloat(J) * 10 : void 0;
|
|
2172
2166
|
u == null ? void 0 : u(R);
|
|
2173
2167
|
}, [
|
|
2174
|
-
|
|
2168
|
+
J,
|
|
2175
2169
|
u
|
|
2170
|
+
]), Z(() => {
|
|
2171
|
+
const R = ae !== "" && !isNaN(parseFloat(ae)) ? parseFloat(ae) * 10 : void 0;
|
|
2172
|
+
p == null ? void 0 : p(R);
|
|
2173
|
+
}, [
|
|
2174
|
+
ae,
|
|
2175
|
+
p
|
|
2176
2176
|
]);
|
|
2177
|
-
const
|
|
2177
|
+
const U = te(() => {
|
|
2178
2178
|
for (const R of C) {
|
|
2179
|
-
const
|
|
2180
|
-
if (
|
|
2181
|
-
if (
|
|
2179
|
+
const H = w.indexOf(R);
|
|
2180
|
+
if (H === -1) continue;
|
|
2181
|
+
if (se[H] === 0) return false;
|
|
2182
2182
|
}
|
|
2183
2183
|
return !(!S || isNaN(parseFloat(S)) || parseFloat(S) === 0);
|
|
2184
2184
|
}, [
|
|
2185
|
-
|
|
2185
|
+
se,
|
|
2186
2186
|
w,
|
|
2187
2187
|
C,
|
|
2188
2188
|
S
|
|
2189
|
-
]),
|
|
2190
|
-
if (!
|
|
2191
|
-
const R = (
|
|
2189
|
+
]), ge = de(() => {
|
|
2190
|
+
if (!U) return;
|
|
2191
|
+
const R = (ne) => ne !== "" && !isNaN(parseFloat(ne)) ? parseFloat(ne) * 10 : void 0, H = R(S) ?? 0;
|
|
2192
2192
|
d({
|
|
2193
|
-
circumferences:
|
|
2194
|
-
frontalHeight:
|
|
2193
|
+
circumferences: se,
|
|
2194
|
+
frontalHeight: H,
|
|
2195
2195
|
perineumML: e === "AK" ? R(z) : void 0,
|
|
2196
|
-
perineumAP: e === "AK" ? R(
|
|
2197
|
-
mptML: e === "BK" ? R(
|
|
2198
|
-
mptAP: e === "BK" ? R(
|
|
2196
|
+
perineumAP: e === "AK" ? R(B) : void 0,
|
|
2197
|
+
mptML: e === "BK" ? R(k) : void 0,
|
|
2198
|
+
mptAP: e === "BK" ? R(W) : void 0
|
|
2199
2199
|
});
|
|
2200
2200
|
}, [
|
|
2201
|
-
|
|
2202
|
-
|
|
2201
|
+
U,
|
|
2202
|
+
se,
|
|
2203
2203
|
S,
|
|
2204
2204
|
z,
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2205
|
+
B,
|
|
2206
|
+
k,
|
|
2207
|
+
W,
|
|
2208
2208
|
e,
|
|
2209
2209
|
d
|
|
2210
|
-
]),
|
|
2210
|
+
]), re = de(() => {
|
|
2211
2211
|
const R = {};
|
|
2212
|
-
if (w.forEach((
|
|
2213
|
-
const
|
|
2214
|
-
if (
|
|
2215
|
-
const
|
|
2216
|
-
R[
|
|
2212
|
+
if (w.forEach((H, ne) => {
|
|
2213
|
+
const Q = t[ne];
|
|
2214
|
+
if (Q) {
|
|
2215
|
+
const j = Q.modifiedValue ?? Q.originalValue;
|
|
2216
|
+
R[H] = (j / 10).toFixed(1);
|
|
2217
2217
|
}
|
|
2218
|
-
}),
|
|
2219
|
-
const
|
|
2220
|
-
e === "AK" ? _(
|
|
2218
|
+
}), F(R), n > 0 && A((n / 10).toFixed(1)), s > 0) {
|
|
2219
|
+
const H = (s / 10).toFixed(1);
|
|
2220
|
+
e === "AK" ? _(H) : I(H);
|
|
2221
2221
|
}
|
|
2222
2222
|
if (l > 0) {
|
|
2223
|
-
const
|
|
2224
|
-
e === "AK" ? H
|
|
2223
|
+
const H = (l / 10).toFixed(1);
|
|
2224
|
+
e === "AK" ? N(H) : $(H);
|
|
2225
2225
|
}
|
|
2226
2226
|
}, [
|
|
2227
2227
|
w,
|
|
@@ -2353,7 +2353,7 @@ let __tla = (async () => {
|
|
|
2353
2353
|
]
|
|
2354
2354
|
}),
|
|
2355
2355
|
i("button", {
|
|
2356
|
-
onClick:
|
|
2356
|
+
onClick: re,
|
|
2357
2357
|
style: {
|
|
2358
2358
|
...In,
|
|
2359
2359
|
backgroundColor: "#fff",
|
|
@@ -2372,7 +2372,7 @@ let __tla = (async () => {
|
|
|
2372
2372
|
gap: 4
|
|
2373
2373
|
},
|
|
2374
2374
|
children: [
|
|
2375
|
-
i(
|
|
2375
|
+
i(Mr, {
|
|
2376
2376
|
style: {
|
|
2377
2377
|
width: 14,
|
|
2378
2378
|
height: 14
|
|
@@ -2409,8 +2409,8 @@ let __tla = (async () => {
|
|
|
2409
2409
|
gap: 10,
|
|
2410
2410
|
marginBottom: 20
|
|
2411
2411
|
},
|
|
2412
|
-
children: w.map((R,
|
|
2413
|
-
const
|
|
2412
|
+
children: w.map((R, H) => {
|
|
2413
|
+
const ne = C.has(R), Q = !!b[R];
|
|
2414
2414
|
return y("div", {
|
|
2415
2415
|
style: {
|
|
2416
2416
|
display: "flex",
|
|
@@ -2432,7 +2432,7 @@ let __tla = (async () => {
|
|
|
2432
2432
|
title: R,
|
|
2433
2433
|
children: [
|
|
2434
2434
|
R,
|
|
2435
|
-
|
|
2435
|
+
ne && i("span", {
|
|
2436
2436
|
style: {
|
|
2437
2437
|
color: "#e53935",
|
|
2438
2438
|
marginLeft: 2
|
|
@@ -2445,21 +2445,21 @@ let __tla = (async () => {
|
|
|
2445
2445
|
type: "number",
|
|
2446
2446
|
step: "0.1",
|
|
2447
2447
|
value: b[R] ?? "",
|
|
2448
|
-
onChange: (
|
|
2448
|
+
onChange: (j) => F((K) => ({
|
|
2449
2449
|
...K,
|
|
2450
|
-
[R]:
|
|
2450
|
+
[R]: j.target.value
|
|
2451
2451
|
})),
|
|
2452
2452
|
style: {
|
|
2453
2453
|
...Ze,
|
|
2454
2454
|
padding: "6px 8px",
|
|
2455
2455
|
fontSize: 13,
|
|
2456
|
-
borderColor:
|
|
2456
|
+
borderColor: Q ? "rgb(12, 67, 173)" : "#ccc",
|
|
2457
2457
|
borderWidth: 1
|
|
2458
2458
|
},
|
|
2459
2459
|
placeholder: "0.0"
|
|
2460
2460
|
})
|
|
2461
2461
|
]
|
|
2462
|
-
},
|
|
2462
|
+
}, H);
|
|
2463
2463
|
})
|
|
2464
2464
|
}),
|
|
2465
2465
|
i("div", {
|
|
@@ -2496,9 +2496,9 @@ let __tla = (async () => {
|
|
|
2496
2496
|
overflow: "hidden",
|
|
2497
2497
|
textOverflow: "ellipsis"
|
|
2498
2498
|
},
|
|
2499
|
-
title:
|
|
2499
|
+
title: G,
|
|
2500
2500
|
children: [
|
|
2501
|
-
|
|
2501
|
+
G,
|
|
2502
2502
|
i("span", {
|
|
2503
2503
|
style: {
|
|
2504
2504
|
color: "#e53935",
|
|
@@ -2544,8 +2544,8 @@ let __tla = (async () => {
|
|
|
2544
2544
|
overflow: "hidden",
|
|
2545
2545
|
textOverflow: "ellipsis"
|
|
2546
2546
|
},
|
|
2547
|
-
title:
|
|
2548
|
-
children:
|
|
2547
|
+
title: oe,
|
|
2548
|
+
children: oe
|
|
2549
2549
|
}),
|
|
2550
2550
|
i("input", {
|
|
2551
2551
|
type: "number",
|
|
@@ -2581,19 +2581,19 @@ let __tla = (async () => {
|
|
|
2581
2581
|
overflow: "hidden",
|
|
2582
2582
|
textOverflow: "ellipsis"
|
|
2583
2583
|
},
|
|
2584
|
-
title:
|
|
2585
|
-
children:
|
|
2584
|
+
title: ce,
|
|
2585
|
+
children: ce
|
|
2586
2586
|
}),
|
|
2587
2587
|
i("input", {
|
|
2588
2588
|
type: "number",
|
|
2589
2589
|
step: "0.1",
|
|
2590
|
-
value:
|
|
2591
|
-
onChange: (R) =>
|
|
2590
|
+
value: B,
|
|
2591
|
+
onChange: (R) => N(R.target.value),
|
|
2592
2592
|
style: {
|
|
2593
2593
|
...Ze,
|
|
2594
2594
|
padding: "6px 8px",
|
|
2595
2595
|
fontSize: 13,
|
|
2596
|
-
borderColor:
|
|
2596
|
+
borderColor: B ? "rgb(12, 67, 173)" : "#ccc",
|
|
2597
2597
|
borderWidth: 1
|
|
2598
2598
|
},
|
|
2599
2599
|
placeholder: "0.0"
|
|
@@ -2621,19 +2621,19 @@ let __tla = (async () => {
|
|
|
2621
2621
|
overflow: "hidden",
|
|
2622
2622
|
textOverflow: "ellipsis"
|
|
2623
2623
|
},
|
|
2624
|
-
title:
|
|
2625
|
-
children:
|
|
2624
|
+
title: oe,
|
|
2625
|
+
children: oe
|
|
2626
2626
|
}),
|
|
2627
2627
|
i("input", {
|
|
2628
2628
|
type: "number",
|
|
2629
2629
|
step: "0.1",
|
|
2630
|
-
value:
|
|
2630
|
+
value: k,
|
|
2631
2631
|
onChange: (R) => I(R.target.value),
|
|
2632
2632
|
style: {
|
|
2633
2633
|
...Ze,
|
|
2634
2634
|
padding: "6px 8px",
|
|
2635
2635
|
fontSize: 13,
|
|
2636
|
-
borderColor:
|
|
2636
|
+
borderColor: k ? "rgb(12, 67, 173)" : "#ccc",
|
|
2637
2637
|
borderWidth: 1
|
|
2638
2638
|
},
|
|
2639
2639
|
placeholder: "0.0"
|
|
@@ -2658,19 +2658,19 @@ let __tla = (async () => {
|
|
|
2658
2658
|
overflow: "hidden",
|
|
2659
2659
|
textOverflow: "ellipsis"
|
|
2660
2660
|
},
|
|
2661
|
-
title:
|
|
2662
|
-
children:
|
|
2661
|
+
title: ce,
|
|
2662
|
+
children: ce
|
|
2663
2663
|
}),
|
|
2664
2664
|
i("input", {
|
|
2665
2665
|
type: "number",
|
|
2666
2666
|
step: "0.1",
|
|
2667
|
-
value:
|
|
2667
|
+
value: W,
|
|
2668
2668
|
onChange: (R) => $(R.target.value),
|
|
2669
2669
|
style: {
|
|
2670
2670
|
...Ze,
|
|
2671
2671
|
padding: "6px 8px",
|
|
2672
2672
|
fontSize: 13,
|
|
2673
|
-
borderColor:
|
|
2673
|
+
borderColor: W ? "rgb(12, 67, 173)" : "#ccc",
|
|
2674
2674
|
borderWidth: 1
|
|
2675
2675
|
},
|
|
2676
2676
|
placeholder: "0.0"
|
|
@@ -2694,14 +2694,14 @@ let __tla = (async () => {
|
|
|
2694
2694
|
flexShrink: 0
|
|
2695
2695
|
},
|
|
2696
2696
|
children: i("button", {
|
|
2697
|
-
onClick:
|
|
2698
|
-
disabled: !
|
|
2697
|
+
onClick: ge,
|
|
2698
|
+
disabled: !U,
|
|
2699
2699
|
style: {
|
|
2700
2700
|
...In,
|
|
2701
|
-
backgroundColor:
|
|
2701
|
+
backgroundColor: U ? "rgb(12, 67, 173)" : "#e0e0e0",
|
|
2702
2702
|
border: "none",
|
|
2703
|
-
color:
|
|
2704
|
-
cursor:
|
|
2703
|
+
color: U ? "#fff" : "#9e9e9e",
|
|
2704
|
+
cursor: U ? "pointer" : "not-allowed",
|
|
2705
2705
|
padding: "6px 16px",
|
|
2706
2706
|
fontSize: 13,
|
|
2707
2707
|
width: "100%"
|
|
@@ -2711,13 +2711,13 @@ let __tla = (async () => {
|
|
|
2711
2711
|
})
|
|
2712
2712
|
]
|
|
2713
2713
|
});
|
|
2714
|
-
},
|
|
2714
|
+
}, kr = [
|
|
2715
2715
|
"Scan doesn't load properly",
|
|
2716
2716
|
"Modified CAD",
|
|
2717
2717
|
"I don't want to",
|
|
2718
2718
|
"I want a second opinion",
|
|
2719
2719
|
"I measured from Perineum"
|
|
2720
|
-
],
|
|
2720
|
+
], yt = {
|
|
2721
2721
|
padding: "8px 20px",
|
|
2722
2722
|
borderRadius: 4,
|
|
2723
2723
|
fontSize: 14,
|
|
@@ -2735,18 +2735,18 @@ let __tla = (async () => {
|
|
|
2735
2735
|
outline: "none",
|
|
2736
2736
|
boxSizing: "border-box",
|
|
2737
2737
|
fontFamily: "system-ui, sans-serif"
|
|
2738
|
-
},
|
|
2739
|
-
const [t, n] =
|
|
2738
|
+
}, Lr = ({ onSkip: e, onCancel: o }) => {
|
|
2739
|
+
const [t, n] = E("confirm"), [s, l] = E(null), [d, a] = E(""), r = de(() => {
|
|
2740
2740
|
n("reasons");
|
|
2741
|
-
}, []), c =
|
|
2741
|
+
}, []), c = de(() => {
|
|
2742
2742
|
t === "reasons" ? (n("confirm"), l(null), a("")) : o();
|
|
2743
2743
|
}, [
|
|
2744
2744
|
t,
|
|
2745
2745
|
o
|
|
2746
|
-
]),
|
|
2747
|
-
!
|
|
2746
|
+
]), u = s != null && (s !== "Other" || d.trim() !== ""), p = de(() => {
|
|
2747
|
+
!u || !s || e(s === "Other" ? `Other: ${d.trim()}` : s);
|
|
2748
2748
|
}, [
|
|
2749
|
-
|
|
2749
|
+
u,
|
|
2750
2750
|
s,
|
|
2751
2751
|
d,
|
|
2752
2752
|
e
|
|
@@ -2804,7 +2804,7 @@ let __tla = (async () => {
|
|
|
2804
2804
|
},
|
|
2805
2805
|
children: [
|
|
2806
2806
|
[
|
|
2807
|
-
...
|
|
2807
|
+
...kr,
|
|
2808
2808
|
"Other"
|
|
2809
2809
|
].map((f) => y("label", {
|
|
2810
2810
|
style: {
|
|
@@ -2848,7 +2848,7 @@ let __tla = (async () => {
|
|
|
2848
2848
|
value: d,
|
|
2849
2849
|
onChange: (f) => a(f.target.value),
|
|
2850
2850
|
onKeyDown: (f) => {
|
|
2851
|
-
f.key === "Enter" &&
|
|
2851
|
+
f.key === "Enter" && p();
|
|
2852
2852
|
},
|
|
2853
2853
|
style: {
|
|
2854
2854
|
...Fr,
|
|
@@ -2872,7 +2872,7 @@ let __tla = (async () => {
|
|
|
2872
2872
|
i("button", {
|
|
2873
2873
|
onClick: c,
|
|
2874
2874
|
style: {
|
|
2875
|
-
...
|
|
2875
|
+
...yt,
|
|
2876
2876
|
backgroundColor: "#fff",
|
|
2877
2877
|
border: "1px solid #ddd",
|
|
2878
2878
|
color: "#666"
|
|
@@ -2880,14 +2880,14 @@ let __tla = (async () => {
|
|
|
2880
2880
|
children: "Cancel"
|
|
2881
2881
|
}),
|
|
2882
2882
|
i("button", {
|
|
2883
|
-
onClick:
|
|
2884
|
-
disabled: !
|
|
2883
|
+
onClick: p,
|
|
2884
|
+
disabled: !u,
|
|
2885
2885
|
style: {
|
|
2886
|
-
...
|
|
2887
|
-
backgroundColor:
|
|
2886
|
+
...yt,
|
|
2887
|
+
backgroundColor: u ? "rgb(12, 67, 173)" : "#e0e0e0",
|
|
2888
2888
|
border: "none",
|
|
2889
|
-
color:
|
|
2890
|
-
cursor:
|
|
2889
|
+
color: u ? "#fff" : "#9e9e9e",
|
|
2890
|
+
cursor: u ? "pointer" : "not-allowed"
|
|
2891
2891
|
},
|
|
2892
2892
|
children: "Submit"
|
|
2893
2893
|
})
|
|
@@ -2944,7 +2944,7 @@ let __tla = (async () => {
|
|
|
2944
2944
|
i("button", {
|
|
2945
2945
|
onClick: o,
|
|
2946
2946
|
style: {
|
|
2947
|
-
...
|
|
2947
|
+
...yt,
|
|
2948
2948
|
backgroundColor: "#fff",
|
|
2949
2949
|
border: "1px solid #bdbdbd",
|
|
2950
2950
|
color: "#333"
|
|
@@ -2954,7 +2954,7 @@ let __tla = (async () => {
|
|
|
2954
2954
|
i("button", {
|
|
2955
2955
|
onClick: r,
|
|
2956
2956
|
style: {
|
|
2957
|
-
...
|
|
2957
|
+
...yt,
|
|
2958
2958
|
backgroundColor: "rgb(12, 67, 173)",
|
|
2959
2959
|
border: "none",
|
|
2960
2960
|
color: "#fff"
|
|
@@ -2973,31 +2973,31 @@ let __tla = (async () => {
|
|
|
2973
2973
|
const l = 30, d = s / l, a = [];
|
|
2974
2974
|
for (let x = 0; x < l; x++) {
|
|
2975
2975
|
const w = o + x * d, C = o + (x + 1) * d;
|
|
2976
|
-
let b = 0,
|
|
2976
|
+
let b = 0, F = 0, S = 0, A = 0;
|
|
2977
2977
|
for (let z = 0; z < n.count; z++) {
|
|
2978
2978
|
const _ = n.getY(z);
|
|
2979
|
-
_ >= w && _ < C && (b += n.getX(z),
|
|
2979
|
+
_ >= w && _ < C && (b += n.getX(z), F += _, S += n.getZ(z), A++);
|
|
2980
2980
|
}
|
|
2981
|
-
A > 20 && a.push(new
|
|
2981
|
+
A > 20 && a.push(new P(b / A, F / A, S / A));
|
|
2982
2982
|
}
|
|
2983
2983
|
if (a.length < 5) return null;
|
|
2984
|
-
const r = new
|
|
2984
|
+
const r = new P();
|
|
2985
2985
|
for (const x of a) r.add(x);
|
|
2986
2986
|
r.divideScalar(a.length);
|
|
2987
|
-
let c = 0,
|
|
2987
|
+
let c = 0, u = 0, p = 0, f = 0, m = 0, v = 0;
|
|
2988
2988
|
for (const x of a) {
|
|
2989
2989
|
const w = x.x - r.x, C = x.y - r.y, b = x.z - r.z;
|
|
2990
|
-
c += w * w,
|
|
2990
|
+
c += w * w, u += w * C, p += w * b, f += C * C, m += C * b, v += b * b;
|
|
2991
2991
|
}
|
|
2992
|
-
let h = new
|
|
2992
|
+
let h = new P(0.01, 1, 0.01).normalize();
|
|
2993
2993
|
for (let x = 0; x < 30; x++) {
|
|
2994
|
-
const w = c * h.x +
|
|
2995
|
-
if (S < 1e-10 || (
|
|
2996
|
-
h =
|
|
2994
|
+
const w = c * h.x + u * h.y + p * h.z, C = u * h.x + f * h.y + m * h.z, b = p * h.x + m * h.y + v * h.z, F = new P(w, C, b), S = F.length();
|
|
2995
|
+
if (S < 1e-10 || (F.divideScalar(S), h.distanceTo(F) < 1e-8)) break;
|
|
2996
|
+
h = F;
|
|
2997
2997
|
}
|
|
2998
2998
|
return h.y < 0 && h.negate(), h;
|
|
2999
2999
|
}
|
|
3000
|
-
const
|
|
3000
|
+
const Dr = {
|
|
3001
3001
|
pcaAxes: true,
|
|
3002
3002
|
obb: true,
|
|
3003
3003
|
obbAxis: true,
|
|
@@ -3007,13 +3007,13 @@ let __tla = (async () => {
|
|
|
3007
3007
|
landmarkAxis: true,
|
|
3008
3008
|
iterativePCA: false,
|
|
3009
3009
|
fullRegionPCA: true
|
|
3010
|
-
},
|
|
3010
|
+
}, Wr = [
|
|
3011
3011
|
"#ff4444",
|
|
3012
3012
|
"#44cc44",
|
|
3013
3013
|
"#4488ff"
|
|
3014
3014
|
];
|
|
3015
3015
|
function Un(e) {
|
|
3016
|
-
const o = e.getAttribute("position"), t = o.count, n = new
|
|
3016
|
+
const o = e.getAttribute("position"), t = o.count, n = new P();
|
|
3017
3017
|
for (let h = 0; h < t; h++) n.x += o.getX(h), n.y += o.getY(h), n.z += o.getZ(h);
|
|
3018
3018
|
n.divideScalar(t);
|
|
3019
3019
|
let s = 0, l = 0, d = 0, a = 0, r = 0, c = 0;
|
|
@@ -3022,7 +3022,7 @@ let __tla = (async () => {
|
|
|
3022
3022
|
s += x * x, l += x * w, d += x * C, a += w * w, r += w * C, c += C * C;
|
|
3023
3023
|
}
|
|
3024
3024
|
s /= t, l /= t, d /= t, a /= t, r /= t, c /= t;
|
|
3025
|
-
const
|
|
3025
|
+
const u = [], p = [], f = [
|
|
3026
3026
|
[
|
|
3027
3027
|
s,
|
|
3028
3028
|
l,
|
|
@@ -3040,9 +3040,9 @@ let __tla = (async () => {
|
|
|
3040
3040
|
]
|
|
3041
3041
|
];
|
|
3042
3042
|
for (let h = 0; h < 3; h++) {
|
|
3043
|
-
let x = new
|
|
3043
|
+
let x = new P(1 + h * 0.1, 1 - h * 0.1, 0.5 + h * 0.3).normalize(), w = 0;
|
|
3044
3044
|
for (let C = 0; C < 100; C++) {
|
|
3045
|
-
const b = f[0][0] * x.x + f[0][1] * x.y + f[0][2] * x.z,
|
|
3045
|
+
const b = f[0][0] * x.x + f[0][1] * x.y + f[0][2] * x.z, F = f[1][0] * x.x + f[1][1] * x.y + f[1][2] * x.z, S = f[2][0] * x.x + f[2][1] * x.y + f[2][2] * x.z, A = new P(b, F, S);
|
|
3046
3046
|
if (w = A.length(), w < 1e-12) break;
|
|
3047
3047
|
if (A.divideScalar(w), x.distanceTo(A) < 1e-10) {
|
|
3048
3048
|
x = A;
|
|
@@ -3050,9 +3050,9 @@ let __tla = (async () => {
|
|
|
3050
3050
|
}
|
|
3051
3051
|
x = A;
|
|
3052
3052
|
}
|
|
3053
|
-
|
|
3053
|
+
u.push(x.clone()), p.push(w);
|
|
3054
3054
|
for (let C = 0; C < 3; C++) for (let b = 0; b < 3; b++) {
|
|
3055
|
-
const
|
|
3055
|
+
const F = [
|
|
3056
3056
|
x.x,
|
|
3057
3057
|
x.y,
|
|
3058
3058
|
x.z
|
|
@@ -3061,12 +3061,12 @@ let __tla = (async () => {
|
|
|
3061
3061
|
x.y,
|
|
3062
3062
|
x.z
|
|
3063
3063
|
][b];
|
|
3064
|
-
f[C][b] -= w *
|
|
3064
|
+
f[C][b] -= w * F * S;
|
|
3065
3065
|
}
|
|
3066
3066
|
}
|
|
3067
|
-
const
|
|
3068
|
-
for (let h = 0; h < t; h++)
|
|
3069
|
-
|
|
3067
|
+
const m = new P();
|
|
3068
|
+
for (let h = 0; h < t; h++) m.x += o.getX(h), m.y += o.getY(h), m.z += o.getZ(h);
|
|
3069
|
+
m.divideScalar(t);
|
|
3070
3070
|
const v = [
|
|
3071
3071
|
0,
|
|
3072
3072
|
0,
|
|
@@ -3074,37 +3074,37 @@ let __tla = (async () => {
|
|
|
3074
3074
|
];
|
|
3075
3075
|
for (let h = 0; h < 3; h++) {
|
|
3076
3076
|
let x = 1 / 0, w = -1 / 0;
|
|
3077
|
-
const C =
|
|
3077
|
+
const C = u[h];
|
|
3078
3078
|
for (let b = 0; b < t; b++) {
|
|
3079
|
-
const
|
|
3079
|
+
const F = o.getX(b) - m.x, S = o.getY(b) - m.y, A = o.getZ(b) - m.z, z = F * C.x + S * C.y + A * C.z;
|
|
3080
3080
|
z < x && (x = z), z > w && (w = z);
|
|
3081
3081
|
}
|
|
3082
3082
|
v[h] = (w - x) / 2;
|
|
3083
3083
|
}
|
|
3084
3084
|
return {
|
|
3085
|
-
axes:
|
|
3086
|
-
eigenvalues:
|
|
3087
|
-
center:
|
|
3085
|
+
axes: u,
|
|
3086
|
+
eigenvalues: p,
|
|
3087
|
+
center: m,
|
|
3088
3088
|
halfExtents: v
|
|
3089
3089
|
};
|
|
3090
3090
|
}
|
|
3091
|
-
function
|
|
3091
|
+
function Rr({ pca: e }) {
|
|
3092
3092
|
return i("group", {
|
|
3093
3093
|
children: e.axes.map((o, t) => {
|
|
3094
3094
|
const n = e.center.clone().addScaledVector(o, e.halfExtents[t]), s = e.center.clone().addScaledVector(o, -e.halfExtents[t]);
|
|
3095
|
-
return i(
|
|
3095
|
+
return i(ve, {
|
|
3096
3096
|
points: [
|
|
3097
3097
|
s,
|
|
3098
3098
|
n
|
|
3099
3099
|
],
|
|
3100
|
-
color:
|
|
3100
|
+
color: Wr[t],
|
|
3101
3101
|
lineWidth: 2
|
|
3102
3102
|
}, t);
|
|
3103
3103
|
})
|
|
3104
3104
|
});
|
|
3105
3105
|
}
|
|
3106
3106
|
function _r({ pca: e }) {
|
|
3107
|
-
const o =
|
|
3107
|
+
const o = te(() => {
|
|
3108
3108
|
const { center: t, axes: n, halfExtents: s } = e, l = [];
|
|
3109
3109
|
for (let a = -1; a <= 1; a += 2) for (let r = -1; r <= 1; r += 2) for (let c = -1; c <= 1; c += 2) l.push(t.clone().addScaledVector(n[0], a * s[0]).addScaledVector(n[1], r * s[1]).addScaledVector(n[2], c * s[2]));
|
|
3110
3110
|
return [
|
|
@@ -3164,7 +3164,7 @@ let __tla = (async () => {
|
|
|
3164
3164
|
e
|
|
3165
3165
|
]);
|
|
3166
3166
|
return i("group", {
|
|
3167
|
-
children: o.map((t, n) => i(
|
|
3167
|
+
children: o.map((t, n) => i(ve, {
|
|
3168
3168
|
points: t,
|
|
3169
3169
|
color: "#ffaa00",
|
|
3170
3170
|
lineWidth: 1,
|
|
@@ -3173,19 +3173,19 @@ let __tla = (async () => {
|
|
|
3173
3173
|
}, n))
|
|
3174
3174
|
});
|
|
3175
3175
|
}
|
|
3176
|
-
function
|
|
3177
|
-
const t =
|
|
3176
|
+
function Ir({ redPoint: e, greenPoint: o }) {
|
|
3177
|
+
const t = te(() => new P().subVectors(o, e).normalize(), [
|
|
3178
3178
|
e,
|
|
3179
3179
|
o
|
|
3180
|
-
]), n =
|
|
3181
|
-
const l = t.dot(new
|
|
3180
|
+
]), n = te(() => {
|
|
3181
|
+
const l = t.dot(new P(0, 1, 0));
|
|
3182
3182
|
return Math.acos(Math.min(1, Math.abs(l))) * 180 / Math.PI;
|
|
3183
3183
|
}, [
|
|
3184
3184
|
t
|
|
3185
3185
|
]), s = n < 1 ? "#44ff44" : n < 5 ? "#ffcc00" : "#ff4444";
|
|
3186
3186
|
return y("group", {
|
|
3187
3187
|
children: [
|
|
3188
|
-
i(
|
|
3188
|
+
i(ve, {
|
|
3189
3189
|
points: [
|
|
3190
3190
|
e,
|
|
3191
3191
|
o
|
|
@@ -3226,19 +3226,19 @@ let __tla = (async () => {
|
|
|
3226
3226
|
]
|
|
3227
3227
|
});
|
|
3228
3228
|
}
|
|
3229
|
-
function
|
|
3230
|
-
const l = n * 0.15, d =
|
|
3229
|
+
function Br({ geometry: e, redY: o, greenY: t, modelSize: n }) {
|
|
3230
|
+
const l = n * 0.15, d = te(() => {
|
|
3231
3231
|
const a = [];
|
|
3232
3232
|
let r = t - 10;
|
|
3233
|
-
const c = new
|
|
3233
|
+
const c = new P(0, 1, 0);
|
|
3234
3234
|
for (; r > o; ) {
|
|
3235
|
-
const
|
|
3235
|
+
const u = Math.min(r, t), p = Math.max(r, t), f = Zn(e, u, p);
|
|
3236
3236
|
if (f) {
|
|
3237
|
-
const
|
|
3237
|
+
const m = f.dot(c), v = Math.acos(Math.min(1, Math.abs(m))) * 180 / Math.PI;
|
|
3238
3238
|
a.push({
|
|
3239
3239
|
axis: f,
|
|
3240
|
-
regionMin:
|
|
3241
|
-
regionMax:
|
|
3240
|
+
regionMin: u,
|
|
3241
|
+
regionMax: p,
|
|
3242
3242
|
angleDeg: v
|
|
3243
3243
|
});
|
|
3244
3244
|
}
|
|
@@ -3252,23 +3252,23 @@ let __tla = (async () => {
|
|
|
3252
3252
|
]);
|
|
3253
3253
|
return i("group", {
|
|
3254
3254
|
children: d.map((a, r) => {
|
|
3255
|
-
const c = (a.regionMin + a.regionMax) / 2,
|
|
3255
|
+
const c = (a.regionMin + a.regionMax) / 2, u = new P(0, c, 0), p = u.clone().addScaledVector(a.axis, l), f = u.clone().addScaledVector(a.axis, -l), m = r / Math.max(1, d.length - 1), v = a.angleDeg < 0.5 ? `hsl(${120 - m * 120}, 80%, 60%)` : `hsl(${40 - a.angleDeg * 2}, 90%, 55%)`;
|
|
3256
3256
|
return y("group", {
|
|
3257
3257
|
children: [
|
|
3258
|
-
i(
|
|
3258
|
+
i(ve, {
|
|
3259
3259
|
points: [
|
|
3260
3260
|
f,
|
|
3261
|
-
|
|
3261
|
+
p
|
|
3262
3262
|
],
|
|
3263
3263
|
color: v,
|
|
3264
3264
|
lineWidth: 1.5,
|
|
3265
3265
|
transparent: true,
|
|
3266
3266
|
opacity: 0.7
|
|
3267
3267
|
}),
|
|
3268
|
-
i(
|
|
3268
|
+
i(ve, {
|
|
3269
3269
|
points: [
|
|
3270
|
-
new
|
|
3271
|
-
new
|
|
3270
|
+
new P(-l * 0.3, a.regionMin, 0),
|
|
3271
|
+
new P(l * 0.3, a.regionMin, 0)
|
|
3272
3272
|
],
|
|
3273
3273
|
color: v,
|
|
3274
3274
|
lineWidth: 0.5,
|
|
@@ -3281,13 +3281,13 @@ let __tla = (async () => {
|
|
|
3281
3281
|
});
|
|
3282
3282
|
}
|
|
3283
3283
|
function Er({ geometry: e, redY: o, greenY: t, modelSize: n }) {
|
|
3284
|
-
const s =
|
|
3285
|
-
const
|
|
3286
|
-
if (!
|
|
3287
|
-
const f =
|
|
3284
|
+
const s = te(() => {
|
|
3285
|
+
const p = Zn(e, o, t);
|
|
3286
|
+
if (!p) return null;
|
|
3287
|
+
const f = p.dot(new P(0, 1, 0)), m = Math.acos(Math.min(1, Math.abs(f))) * 180 / Math.PI;
|
|
3288
3288
|
return {
|
|
3289
|
-
axis:
|
|
3290
|
-
angleDeg:
|
|
3289
|
+
axis: p,
|
|
3290
|
+
angleDeg: m
|
|
3291
3291
|
};
|
|
3292
3292
|
}, [
|
|
3293
3293
|
e,
|
|
@@ -3295,14 +3295,14 @@ let __tla = (async () => {
|
|
|
3295
3295
|
t
|
|
3296
3296
|
]);
|
|
3297
3297
|
if (!s) return null;
|
|
3298
|
-
const l = (o + t) / 2, d = new
|
|
3298
|
+
const l = (o + t) / 2, d = new P(0, l, 0), a = n * 0.4, r = d.clone().addScaledVector(s.axis, a), c = d.clone().addScaledVector(s.axis, -a), u = s.angleDeg < 0.5 ? "#00ffff" : s.angleDeg < 2 ? "#ffcc00" : "#ff6600";
|
|
3299
3299
|
return i("group", {
|
|
3300
|
-
children: i(
|
|
3300
|
+
children: i(ve, {
|
|
3301
3301
|
points: [
|
|
3302
3302
|
c,
|
|
3303
3303
|
r
|
|
3304
3304
|
],
|
|
3305
|
-
color:
|
|
3305
|
+
color: u,
|
|
3306
3306
|
lineWidth: 3,
|
|
3307
3307
|
dashed: true,
|
|
3308
3308
|
dashSize: 3,
|
|
@@ -3310,9 +3310,9 @@ let __tla = (async () => {
|
|
|
3310
3310
|
})
|
|
3311
3311
|
});
|
|
3312
3312
|
}
|
|
3313
|
-
function
|
|
3313
|
+
function $r({ pca: e, modelSize: o }) {
|
|
3314
3314
|
const t = e.axes[0], n = o * 0.6, s = e.center.clone().addScaledVector(t, n), l = e.center.clone().addScaledVector(t, -n);
|
|
3315
|
-
return i(
|
|
3315
|
+
return i(ve, {
|
|
3316
3316
|
points: [
|
|
3317
3317
|
l,
|
|
3318
3318
|
s
|
|
@@ -3324,20 +3324,20 @@ let __tla = (async () => {
|
|
|
3324
3324
|
gapSize: 2
|
|
3325
3325
|
});
|
|
3326
3326
|
}
|
|
3327
|
-
function
|
|
3328
|
-
const l =
|
|
3329
|
-
const
|
|
3330
|
-
for (let _ = o +
|
|
3331
|
-
const
|
|
3332
|
-
|
|
3327
|
+
function Tr({ geometry: e, redY: o, greenY: t, modelSize: n, measurementGeometry: s }) {
|
|
3328
|
+
const l = te(() => {
|
|
3329
|
+
const u = s ?? e, p = qt(u), f = new P(0, 1, 0), m = 5, h = t + 3 * 25.4, x = [];
|
|
3330
|
+
for (let _ = o + m; _ < h; _ += m) {
|
|
3331
|
+
const B = er(p, u, new P(0, _, 0), f);
|
|
3332
|
+
B > 0 && x.push({
|
|
3333
3333
|
y: _,
|
|
3334
|
-
circ:
|
|
3334
|
+
circ: B
|
|
3335
3335
|
});
|
|
3336
3336
|
}
|
|
3337
3337
|
if (x.length < 5) return null;
|
|
3338
|
-
const w = t - o, C = o + w * 0.3, b = o + w * 0.7,
|
|
3339
|
-
if (
|
|
3340
|
-
const S =
|
|
3338
|
+
const w = t - o, C = o + w * 0.3, b = o + w * 0.7, F = x.filter((_) => _.y >= C && _.y <= b);
|
|
3339
|
+
if (F.length < 3) return null;
|
|
3340
|
+
const S = F.map((_) => _.circ).sort((_, B) => _ - B), A = S[Math.floor(S.length / 2)], z = Math.max(...x.map((_) => _.circ));
|
|
3341
3341
|
return {
|
|
3342
3342
|
circumferences: x,
|
|
3343
3343
|
baseline: A,
|
|
@@ -3352,12 +3352,12 @@ let __tla = (async () => {
|
|
|
3352
3352
|
const { circumferences: d, baseline: a, maxCirc: r } = l, c = n * 0.3 / r;
|
|
3353
3353
|
return y("group", {
|
|
3354
3354
|
children: [
|
|
3355
|
-
d.map(({ y:
|
|
3356
|
-
const
|
|
3357
|
-
return i(
|
|
3355
|
+
d.map(({ y: u, circ: p }, f) => {
|
|
3356
|
+
const m = p / a, v = m > 1.6 ? "#ff4444" : m > 1.3 ? "#ffcc00" : "#22cc66", h = p * c;
|
|
3357
|
+
return i(ve, {
|
|
3358
3358
|
points: [
|
|
3359
|
-
new
|
|
3360
|
-
new
|
|
3359
|
+
new P(-h, u, 0),
|
|
3360
|
+
new P(h, u, 0)
|
|
3361
3361
|
],
|
|
3362
3362
|
color: v,
|
|
3363
3363
|
lineWidth: 1.5,
|
|
@@ -3366,13 +3366,13 @@ let __tla = (async () => {
|
|
|
3366
3366
|
}, f);
|
|
3367
3367
|
}),
|
|
3368
3368
|
(() => {
|
|
3369
|
-
const
|
|
3369
|
+
const u = a * 1.6 * c, p = d[0].y, f = d[d.length - 1].y;
|
|
3370
3370
|
return y(We, {
|
|
3371
3371
|
children: [
|
|
3372
|
-
i(
|
|
3372
|
+
i(ve, {
|
|
3373
3373
|
points: [
|
|
3374
|
-
new
|
|
3375
|
-
new
|
|
3374
|
+
new P(-u, p, 0),
|
|
3375
|
+
new P(-u, f, 0)
|
|
3376
3376
|
],
|
|
3377
3377
|
color: "#ff4444",
|
|
3378
3378
|
lineWidth: 1,
|
|
@@ -3382,10 +3382,10 @@ let __tla = (async () => {
|
|
|
3382
3382
|
transparent: true,
|
|
3383
3383
|
opacity: 0.4
|
|
3384
3384
|
}),
|
|
3385
|
-
i(
|
|
3385
|
+
i(ve, {
|
|
3386
3386
|
points: [
|
|
3387
|
-
new
|
|
3388
|
-
new
|
|
3387
|
+
new P(u, p, 0),
|
|
3388
|
+
new P(u, f, 0)
|
|
3389
3389
|
],
|
|
3390
3390
|
color: "#ff4444",
|
|
3391
3391
|
lineWidth: 1,
|
|
@@ -3401,12 +3401,12 @@ let __tla = (async () => {
|
|
|
3401
3401
|
]
|
|
3402
3402
|
});
|
|
3403
3403
|
}
|
|
3404
|
-
function
|
|
3404
|
+
function Or({ componentDebug: e }) {
|
|
3405
3405
|
return i("group", {
|
|
3406
3406
|
children: e.geometries.map((o, t) => {
|
|
3407
3407
|
const n = e.colors[t] ?? "#888888", s = t === e.innerIdx;
|
|
3408
3408
|
o.computeBoundingBox();
|
|
3409
|
-
const l = new
|
|
3409
|
+
const l = new P();
|
|
3410
3410
|
return o.boundingBox.getCenter(l), y("group", {
|
|
3411
3411
|
children: [
|
|
3412
3412
|
i("mesh", {
|
|
@@ -3416,7 +3416,7 @@ let __tla = (async () => {
|
|
|
3416
3416
|
color: n,
|
|
3417
3417
|
transparent: true,
|
|
3418
3418
|
opacity: s ? 0.5 : 0.2,
|
|
3419
|
-
side:
|
|
3419
|
+
side: q.DoubleSide,
|
|
3420
3420
|
depthWrite: false,
|
|
3421
3421
|
polygonOffset: true,
|
|
3422
3422
|
polygonOffsetFactor: 1,
|
|
@@ -3465,22 +3465,22 @@ let __tla = (async () => {
|
|
|
3465
3465
|
})
|
|
3466
3466
|
});
|
|
3467
3467
|
}
|
|
3468
|
-
function
|
|
3469
|
-
const t =
|
|
3468
|
+
function Hr({ geometry: e, aoData: o }) {
|
|
3469
|
+
const t = te(() => {
|
|
3470
3470
|
const n = e.toNonIndexed(), s = n.getAttribute("position"), l = o.length, d = s.count, a = new Float32Array(d * 3);
|
|
3471
3471
|
for (let r = 0; r < l && r * 3 + 2 < d; r++) {
|
|
3472
|
-
const c = o[r],
|
|
3473
|
-
for (let
|
|
3474
|
-
const v = (r * 3 +
|
|
3475
|
-
a[v] =
|
|
3472
|
+
const c = o[r], u = c, p = c < 0.5 ? 0.8 - c * 1.2 : 0.2 * (1 - c), f = 1 - c;
|
|
3473
|
+
for (let m = 0; m < 3; m++) {
|
|
3474
|
+
const v = (r * 3 + m) * 3;
|
|
3475
|
+
a[v] = u, a[v + 1] = p, a[v + 2] = f;
|
|
3476
3476
|
}
|
|
3477
3477
|
}
|
|
3478
|
-
return n.setAttribute("color", new
|
|
3478
|
+
return n.setAttribute("color", new q.Float32BufferAttribute(a, 3)), n;
|
|
3479
3479
|
}, [
|
|
3480
3480
|
e,
|
|
3481
3481
|
o
|
|
3482
3482
|
]);
|
|
3483
|
-
return
|
|
3483
|
+
return te(() => () => t.dispose(), [
|
|
3484
3484
|
t
|
|
3485
3485
|
]), i("mesh", {
|
|
3486
3486
|
geometry: t,
|
|
@@ -3489,40 +3489,40 @@ let __tla = (async () => {
|
|
|
3489
3489
|
vertexColors: true,
|
|
3490
3490
|
transparent: true,
|
|
3491
3491
|
opacity: 0.85,
|
|
3492
|
-
side:
|
|
3492
|
+
side: q.DoubleSide,
|
|
3493
3493
|
depthWrite: false
|
|
3494
3494
|
})
|
|
3495
3495
|
});
|
|
3496
3496
|
}
|
|
3497
|
-
function
|
|
3498
|
-
const a = e.geometry, r =
|
|
3497
|
+
function Nr({ mesh: e, layers: o, landmarkPoints: t, componentDebug: n, aoData: s, aoGeometry: l, measurementGeometry: d }) {
|
|
3498
|
+
const a = e.geometry, r = te(() => a.getAttribute("position") ? Un(a) : null, [
|
|
3499
3499
|
a
|
|
3500
|
-
]), c =
|
|
3501
|
-
red: new
|
|
3502
|
-
green: new
|
|
3500
|
+
]), c = te(() => !t || t.length < 2 ? null : {
|
|
3501
|
+
red: new P(t[1].position.x, t[1].position.y, t[1].position.z),
|
|
3502
|
+
green: new P(t[0].position.x, t[0].position.y, t[0].position.z)
|
|
3503
3503
|
}, [
|
|
3504
3504
|
t
|
|
3505
3505
|
]);
|
|
3506
3506
|
return y("group", {
|
|
3507
3507
|
children: [
|
|
3508
|
-
o.pcaAxes && r && i(
|
|
3508
|
+
o.pcaAxes && r && i(Rr, {
|
|
3509
3509
|
pca: r
|
|
3510
3510
|
}),
|
|
3511
3511
|
o.obb && r && i(_r, {
|
|
3512
3512
|
pca: r
|
|
3513
3513
|
}),
|
|
3514
|
-
o.obbAxis && r && i(
|
|
3514
|
+
o.obbAxis && r && i($r, {
|
|
3515
3515
|
pca: r,
|
|
3516
3516
|
modelSize: r.halfExtents[0] ? Math.max(...r.halfExtents) * 2 : 100
|
|
3517
3517
|
}),
|
|
3518
|
-
o.shellComponents && n && i(
|
|
3518
|
+
o.shellComponents && n && i(Or, {
|
|
3519
3519
|
componentDebug: n
|
|
3520
3520
|
}),
|
|
3521
|
-
o.ambientOcclusion && s && s.length > 0 && i(
|
|
3521
|
+
o.ambientOcclusion && s && s.length > 0 && i(Hr, {
|
|
3522
3522
|
geometry: l ?? a,
|
|
3523
3523
|
aoData: s
|
|
3524
3524
|
}),
|
|
3525
|
-
o.circumferenceScan && c && i(
|
|
3525
|
+
o.circumferenceScan && c && i(Tr, {
|
|
3526
3526
|
geometry: a,
|
|
3527
3527
|
redY: c.red.y,
|
|
3528
3528
|
greenY: c.green.y,
|
|
@@ -3540,11 +3540,11 @@ let __tla = (async () => {
|
|
|
3540
3540
|
depthWrite: false
|
|
3541
3541
|
})
|
|
3542
3542
|
}),
|
|
3543
|
-
o.landmarkAxis && c && i(
|
|
3543
|
+
o.landmarkAxis && c && i(Ir, {
|
|
3544
3544
|
redPoint: c.red,
|
|
3545
3545
|
greenPoint: c.green
|
|
3546
3546
|
}),
|
|
3547
|
-
o.iterativePCA && c && i(
|
|
3547
|
+
o.iterativePCA && c && i(Br, {
|
|
3548
3548
|
geometry: a,
|
|
3549
3549
|
redY: c.red.y,
|
|
3550
3550
|
greenY: c.green.y,
|
|
@@ -3559,8 +3559,8 @@ let __tla = (async () => {
|
|
|
3559
3559
|
]
|
|
3560
3560
|
});
|
|
3561
3561
|
}
|
|
3562
|
-
function
|
|
3563
|
-
const o = e.geometry, t =
|
|
3562
|
+
function Vr({ mesh: e }) {
|
|
3563
|
+
const o = e.geometry, t = te(() => {
|
|
3564
3564
|
if (!o.getAttribute("position")) return null;
|
|
3565
3565
|
const l = Un(o), d = l.axes[0], a = l.halfExtents[0] * 1.3;
|
|
3566
3566
|
return {
|
|
@@ -3573,7 +3573,7 @@ let __tla = (async () => {
|
|
|
3573
3573
|
]);
|
|
3574
3574
|
if (!t) return null;
|
|
3575
3575
|
const n = t.center.clone().addScaledVector(t.axis, t.halfLen), s = t.center.clone().addScaledVector(t.axis, -t.halfLen);
|
|
3576
|
-
return i(
|
|
3576
|
+
return i(ve, {
|
|
3577
3577
|
points: [
|
|
3578
3578
|
s,
|
|
3579
3579
|
n
|
|
@@ -3645,10 +3645,10 @@ let __tla = (async () => {
|
|
|
3645
3645
|
color: "#00ffff",
|
|
3646
3646
|
group: "Alignment"
|
|
3647
3647
|
}
|
|
3648
|
-
],
|
|
3648
|
+
], jr = [
|
|
3649
3649
|
...new Set(qn.map((e) => e.group))
|
|
3650
3650
|
];
|
|
3651
|
-
function
|
|
3651
|
+
function Xr({ layers: e, onToggleLayer: o, isDoubleShell: t }) {
|
|
3652
3652
|
return y("div", {
|
|
3653
3653
|
style: {
|
|
3654
3654
|
position: "absolute",
|
|
@@ -3677,7 +3677,7 @@ let __tla = (async () => {
|
|
|
3677
3677
|
},
|
|
3678
3678
|
children: "Debug Layers"
|
|
3679
3679
|
}),
|
|
3680
|
-
|
|
3680
|
+
jr.map((n) => {
|
|
3681
3681
|
const s = qn.filter((l) => l.group === n && !(l.hideWhenDoubleShell && t));
|
|
3682
3682
|
return s.length === 0 ? null : y("div", {
|
|
3683
3683
|
children: [
|
|
@@ -3738,261 +3738,307 @@ let __tla = (async () => {
|
|
|
3738
3738
|
]
|
|
3739
3739
|
});
|
|
3740
3740
|
}
|
|
3741
|
-
const
|
|
3742
|
-
const [c,
|
|
3741
|
+
const Gr = ({ config: e, spacingType: o, scanUrl: t, formMeasurements: n, onComplete: s, isDebugUser: l = false, onAnalyticsEvent: d, wasmModule: a, autoProcessOnTwoPoints: r = false }) => {
|
|
3742
|
+
const [c, u] = E(null), [p, f] = E(0), [m, v] = E(false), [h, x] = E(false), [w, C] = E(""), [b, F] = E("3D"), [S, A] = E(o === "AK" ? 2 : 1), [z, _] = E(false), [B, N] = E(null), [k, I] = E(o ?? null), [W, $] = E("cm"), [G, oe] = E(false), [ce, se] = E(""), [J, ae] = E("mm"), [U, ge] = E(false), [re, R] = E(false), [H, ne] = E(false), [Q, j] = E(null), [K, fe] = E(null), [ie, pe] = E(null), [he, Se] = E(false), [T, Le] = E([]), [ke, Ie] = E(null), [ye, Fe] = E(null), [Mt, Pt] = E(null), [rt, Qt] = E(null), [Qn, en] = E(false), [it, tn] = E(null), [kt, Re] = E(null), [Be, eo] = E(false), [nn, to] = E(Dr), [Oe, on] = E("obj"), [Pe, Ft] = E(n), [He, Lt] = E(true), [Ge, qe] = E(false), [Dt, rn] = E(false), [st, lt] = E(false), Ye = ue(false), [no, sn] = E(false), [Wt, ln] = E(() => {
|
|
3743
3743
|
try {
|
|
3744
3744
|
return localStorage.getItem("gm_helpTipDismissed") !== "1";
|
|
3745
3745
|
} catch {
|
|
3746
3746
|
return true;
|
|
3747
3747
|
}
|
|
3748
3748
|
});
|
|
3749
|
-
|
|
3750
|
-
if (!
|
|
3751
|
-
const
|
|
3752
|
-
|
|
3749
|
+
Z(() => {
|
|
3750
|
+
if (!Wt) return;
|
|
3751
|
+
const g = setTimeout(() => {
|
|
3752
|
+
ln(false);
|
|
3753
3753
|
try {
|
|
3754
3754
|
localStorage.setItem("gm_helpTipDismissed", "1");
|
|
3755
3755
|
} catch {
|
|
3756
3756
|
}
|
|
3757
3757
|
}, 1e4);
|
|
3758
|
-
return () => clearTimeout(
|
|
3758
|
+
return () => clearTimeout(g);
|
|
3759
3759
|
}, [
|
|
3760
|
-
|
|
3761
|
-
]),
|
|
3762
|
-
if (!
|
|
3763
|
-
const
|
|
3764
|
-
return () => clearTimeout(
|
|
3760
|
+
Wt
|
|
3761
|
+
]), Z(() => {
|
|
3762
|
+
if (!U) return;
|
|
3763
|
+
const g = setTimeout(() => ge(false), 5e3);
|
|
3764
|
+
return () => clearTimeout(g);
|
|
3765
3765
|
}, [
|
|
3766
|
-
|
|
3766
|
+
U
|
|
3767
3767
|
]);
|
|
3768
|
-
const
|
|
3769
|
-
|
|
3770
|
-
if (!
|
|
3771
|
-
const
|
|
3772
|
-
for (const D of
|
|
3768
|
+
const Rt = ue(null), [Ne, oo] = E(0);
|
|
3769
|
+
Z(() => {
|
|
3770
|
+
if (!Rt.current) return;
|
|
3771
|
+
const g = new ResizeObserver((M) => {
|
|
3772
|
+
for (const D of M) oo(D.contentRect.width);
|
|
3773
3773
|
});
|
|
3774
|
-
return
|
|
3774
|
+
return g.observe(Rt.current), () => g.disconnect();
|
|
3775
3775
|
}, []);
|
|
3776
|
-
const [
|
|
3777
|
-
if (!
|
|
3778
|
-
const
|
|
3776
|
+
const [Ce, ro] = E(null), [io, so] = E(void 0), [lo, ao] = E(void 0), [co, fo] = E(void 0), [uo, po] = E(void 0), [an] = E("#c8c8c8"), [ho] = E(1), [$e, go] = E(false), [_t, cn] = E([]), at = ue(null), Ve = ue(null), ct = ue(false), mo = ue(null), It = ue(null), Bt = ue(null), Je = de(async (g) => {
|
|
3777
|
+
if (!Bt.current) return;
|
|
3778
|
+
const M = (g == null ? void 0 : g.restoreView) ?? true;
|
|
3779
3779
|
try {
|
|
3780
|
-
const D =
|
|
3781
|
-
const
|
|
3782
|
-
if (!
|
|
3783
|
-
const
|
|
3784
|
-
|
|
3785
|
-
const
|
|
3786
|
-
return
|
|
3787
|
-
const bn =
|
|
3780
|
+
const D = Bt.current, L = () => {
|
|
3781
|
+
const O = D.querySelector("canvas");
|
|
3782
|
+
if (!O) return;
|
|
3783
|
+
const ee = D.getBoundingClientRect(), me = O.width, be = O.height, ze = me / ee.width, tt = be / ee.height, ht = document.createElement("canvas");
|
|
3784
|
+
ht.width = me, ht.height = be;
|
|
3785
|
+
const Me = ht.getContext("2d");
|
|
3786
|
+
return Me.drawImage(O, 0, 0), D.querySelectorAll("[style*='pointer-events']").forEach((Mo) => {
|
|
3787
|
+
const bn = Mo;
|
|
3788
3788
|
if (bn.hasAttribute("data-finalizing-overlay")) return;
|
|
3789
3789
|
const yn = bn.querySelectorAll("div[style*='background']");
|
|
3790
3790
|
yn.length !== 0 && yn.forEach((Ke) => {
|
|
3791
3791
|
var _a;
|
|
3792
|
-
const
|
|
3793
|
-
if (
|
|
3794
|
-
let
|
|
3792
|
+
const _e = Ke.getBoundingClientRect();
|
|
3793
|
+
if (_e.width === 0 || _e.height === 0) return;
|
|
3794
|
+
let Xt = 0, nt = Ke;
|
|
3795
3795
|
for (; nt && nt !== D; ) {
|
|
3796
|
-
const
|
|
3797
|
-
if (
|
|
3798
|
-
|
|
3796
|
+
const xt = (nt.style.transform || "").match(/rotate\((-?\d+)deg\)/);
|
|
3797
|
+
if (xt) {
|
|
3798
|
+
Xt = parseFloat(xt[1]);
|
|
3799
3799
|
break;
|
|
3800
3800
|
}
|
|
3801
3801
|
nt = nt.parentElement;
|
|
3802
3802
|
}
|
|
3803
|
-
const wn = (
|
|
3804
|
-
|
|
3805
|
-
const
|
|
3806
|
-
|
|
3807
|
-
const
|
|
3808
|
-
|
|
3803
|
+
const wn = (_e.left + _e.width / 2 - ee.left) * ze, vn = (_e.top + _e.height / 2 - ee.top) * tt, gt = Math.abs(Xt) > 1, Sn = (gt ? _e.height : _e.width) * ze, Cn = (gt ? _e.width : _e.height) * tt;
|
|
3804
|
+
Me.save(), Me.translate(wn, vn), gt && Me.rotate(Xt * Math.PI / 180);
|
|
3805
|
+
const Po = Ke.style.backgroundColor || "rgba(0,0,0,0.75)";
|
|
3806
|
+
Me.fillStyle = Po;
|
|
3807
|
+
const ko = 4 * ze;
|
|
3808
|
+
Me.beginPath(), Me.roundRect(-Sn / 2, -Cn / 2, Sn, Cn, ko), Me.fill();
|
|
3809
3809
|
const An = ((_a = Ke.textContent) == null ? void 0 : _a.trim()) || "";
|
|
3810
3810
|
if (An) {
|
|
3811
|
-
const
|
|
3812
|
-
|
|
3811
|
+
const mt = window.getComputedStyle(Ke), xt = parseFloat(mt.fontSize || "14") * tt;
|
|
3812
|
+
Me.font = `${mt.fontWeight || "normal"} ${xt}px monospace`, Me.fillStyle = mt.color || "#fff", Me.textAlign = "center", Me.textBaseline = "middle";
|
|
3813
3813
|
const zn = Ke.querySelectorAll("span");
|
|
3814
|
-
zn.length > 0 && !
|
|
3815
|
-
const ot =
|
|
3814
|
+
zn.length > 0 && !gt ? zn.forEach((Gt) => {
|
|
3815
|
+
const ot = Gt.getBoundingClientRect();
|
|
3816
3816
|
if (ot.width === 0) return;
|
|
3817
|
-
const Fo = (ot.left + ot.width / 2 -
|
|
3818
|
-
|
|
3819
|
-
}) :
|
|
3817
|
+
const Fo = (ot.left + ot.width / 2 - ee.left) * ze - wn, Lo = (ot.top + ot.height / 2 - ee.top) * tt - vn, Yt = window.getComputedStyle(Gt), Do = parseFloat(Yt.fontSize) * tt;
|
|
3818
|
+
Me.font = `${Yt.fontWeight || "normal"} ${Do}px monospace`, Me.fillStyle = Yt.color || "#fff", Me.fillText(Gt.textContent || "", Fo, Lo);
|
|
3819
|
+
}) : Me.fillText(An, 0, 0);
|
|
3820
3820
|
}
|
|
3821
|
-
|
|
3821
|
+
Me.restore();
|
|
3822
3822
|
});
|
|
3823
|
-
}),
|
|
3823
|
+
}), ht.toDataURL("image/png");
|
|
3824
3824
|
};
|
|
3825
|
-
|
|
3826
|
-
const
|
|
3827
|
-
|
|
3828
|
-
const X =
|
|
3829
|
-
return
|
|
3830
|
-
frontal_view_png:
|
|
3825
|
+
It.current && It.current(), await new Promise((O) => requestAnimationFrame(() => requestAnimationFrame(O)));
|
|
3826
|
+
const Y = L();
|
|
3827
|
+
F("2D"), await new Promise((O) => setTimeout(O, 150)), await new Promise((O) => requestAnimationFrame(() => requestAnimationFrame(O)));
|
|
3828
|
+
const X = L();
|
|
3829
|
+
return M && F("3D"), !Y || !X ? void 0 : {
|
|
3830
|
+
frontal_view_png: Y,
|
|
3831
3831
|
side_view_png: X
|
|
3832
3832
|
};
|
|
3833
3833
|
} catch {
|
|
3834
3834
|
return;
|
|
3835
3835
|
}
|
|
3836
|
-
}, []),
|
|
3837
|
-
const
|
|
3838
|
-
|
|
3839
|
-
...
|
|
3840
|
-
`[${D}] ${
|
|
3836
|
+
}, []), Ae = de((g) => {
|
|
3837
|
+
const M = /* @__PURE__ */ new Date(), D = `${String(M.getHours()).padStart(2, "0")}:${String(M.getMinutes()).padStart(2, "0")}:${String(M.getSeconds()).padStart(2, "0")}.${String(M.getMilliseconds()).padStart(3, "0")}`;
|
|
3838
|
+
cn((L) => [
|
|
3839
|
+
...L.slice(-200),
|
|
3840
|
+
`[${D}] ${g}`
|
|
3841
3841
|
]);
|
|
3842
|
-
}, []), { landmarkPoints: V, clearLandmarkPoints: xo, addLandmarkPoint:
|
|
3843
|
-
|
|
3844
|
-
|
|
3842
|
+
}, []), { landmarkPoints: V, clearLandmarkPoints: xo, addLandmarkPoint: dn, removeLandmarkPoint: fn, undoLastLandmarkPoint: Et, updateLandmarkPositions: dt, setAligned: un, isAligned: le, setCut: pn, isCut: $t, reset: ft } = Jt();
|
|
3843
|
+
Z(() => {
|
|
3844
|
+
ft();
|
|
3845
3845
|
}, [
|
|
3846
|
-
|
|
3846
|
+
ft
|
|
3847
3847
|
]);
|
|
3848
|
-
const
|
|
3849
|
-
|
|
3848
|
+
const ut = S * vt;
|
|
3849
|
+
Z(() => {
|
|
3850
3850
|
if (!l || V.length === 0) return;
|
|
3851
|
-
const
|
|
3852
|
-
|
|
3851
|
+
const g = V[V.length - 1];
|
|
3852
|
+
Ae(`LANDMARK[${V.length - 1}]: placed at (${g.position.x.toFixed(1)}, ${g.position.y.toFixed(1)}, ${g.position.z.toFixed(1)}) face=${g.faceIndex}`);
|
|
3853
3853
|
}, [
|
|
3854
3854
|
V.length,
|
|
3855
3855
|
l,
|
|
3856
|
-
|
|
3857
|
-
]),
|
|
3858
|
-
l &&
|
|
3856
|
+
Ae
|
|
3857
|
+
]), Z(() => {
|
|
3858
|
+
l && le && Ae("STATE: mesh aligned");
|
|
3859
3859
|
}, [
|
|
3860
|
-
|
|
3860
|
+
le,
|
|
3861
3861
|
l,
|
|
3862
|
-
|
|
3863
|
-
]),
|
|
3864
|
-
const
|
|
3862
|
+
Ae
|
|
3863
|
+
]), Z(() => {
|
|
3864
|
+
const g = (M) => {
|
|
3865
3865
|
var _a;
|
|
3866
|
-
if (
|
|
3867
|
-
const D = ((_a =
|
|
3868
|
-
|
|
3866
|
+
if (M.key !== "z" && M.key !== "Z" || !(M.ctrlKey || M.metaKey) || M.shiftKey || M.altKey) return;
|
|
3867
|
+
const D = ((_a = M.composedPath) == null ? void 0 : _a.call(M)[0]) ?? M.target, L = D == null ? void 0 : D.tagName;
|
|
3868
|
+
L === "INPUT" || L === "TEXTAREA" || (D == null ? void 0 : D.isContentEditable) || !c || le || V.length === 0 || (M.preventDefault(), Et(), Ae(`UNDO: removed landmark point ${V.length - 1}`));
|
|
3869
3869
|
};
|
|
3870
|
-
return document.addEventListener("keydown",
|
|
3870
|
+
return document.addEventListener("keydown", g, true), () => document.removeEventListener("keydown", g, true);
|
|
3871
3871
|
}, [
|
|
3872
3872
|
c,
|
|
3873
|
-
|
|
3873
|
+
le,
|
|
3874
3874
|
V.length,
|
|
3875
3875
|
Et,
|
|
3876
|
-
|
|
3877
|
-
]),
|
|
3878
|
-
l &&
|
|
3876
|
+
Ae
|
|
3877
|
+
]), Z(() => {
|
|
3878
|
+
l && $t && Ae("STATE: mesh cut");
|
|
3879
3879
|
}, [
|
|
3880
|
-
|
|
3880
|
+
$t,
|
|
3881
3881
|
l,
|
|
3882
|
-
|
|
3883
|
-
])
|
|
3882
|
+
Ae
|
|
3883
|
+
]);
|
|
3884
|
+
const bo = de(() => {
|
|
3885
|
+
if (!c) return;
|
|
3886
|
+
const g = (L) => {
|
|
3887
|
+
const Y = L.clone();
|
|
3888
|
+
Y.scale(-1, 1, 1);
|
|
3889
|
+
const X = Y.getIndex();
|
|
3890
|
+
if (X) {
|
|
3891
|
+
const O = X.array;
|
|
3892
|
+
for (let ee = 0; ee < O.length; ee += 3) {
|
|
3893
|
+
const me = O[ee];
|
|
3894
|
+
O[ee] = O[ee + 2], O[ee + 2] = me;
|
|
3895
|
+
}
|
|
3896
|
+
X.needsUpdate = true;
|
|
3897
|
+
} else {
|
|
3898
|
+
const O = Y.getAttribute("position"), ee = O.array;
|
|
3899
|
+
for (let me = 0; me < ee.length; me += 9) for (let be = 0; be < 3; be++) {
|
|
3900
|
+
const ze = ee[me + be];
|
|
3901
|
+
ee[me + be] = ee[me + 6 + be], ee[me + 6 + be] = ze;
|
|
3902
|
+
}
|
|
3903
|
+
O.needsUpdate = true;
|
|
3904
|
+
}
|
|
3905
|
+
return Y.computeVertexNormals(), Y.computeBoundingBox(), Y.computeBoundingSphere(), Y;
|
|
3906
|
+
}, M = g(c.geometry), D = new q.Mesh(M, c.material);
|
|
3907
|
+
if (u(D), ie && pe(g(ie)), K && fe(g(K)), ke) {
|
|
3908
|
+
const L = new Float32Array(ke.allLoopPoints);
|
|
3909
|
+
for (let Y = 0; Y < L.length; Y += 3) L[Y] = -L[Y];
|
|
3910
|
+
Ie({
|
|
3911
|
+
...ke,
|
|
3912
|
+
allLoopPoints: L
|
|
3913
|
+
});
|
|
3914
|
+
}
|
|
3915
|
+
V.length > 0 && dt(V.map((L) => ({
|
|
3916
|
+
x: -L.position.x,
|
|
3917
|
+
y: L.position.y,
|
|
3918
|
+
z: L.position.z
|
|
3919
|
+
}))), Ae("MIRROR: flipped scan across X axis (alignment preserved)");
|
|
3920
|
+
}, [
|
|
3921
|
+
c,
|
|
3922
|
+
ie,
|
|
3923
|
+
K,
|
|
3924
|
+
ke,
|
|
3925
|
+
V,
|
|
3926
|
+
dt,
|
|
3927
|
+
Ae
|
|
3928
|
+
]);
|
|
3929
|
+
Z(() => {
|
|
3884
3930
|
at.current && (at.current.scrollTop = at.current.scrollHeight);
|
|
3885
3931
|
}, [
|
|
3886
3932
|
_t
|
|
3887
3933
|
]);
|
|
3888
|
-
const Te =
|
|
3889
|
-
|
|
3934
|
+
const Te = te(() => ie ? new q.Mesh(ie) : null, [
|
|
3935
|
+
ie
|
|
3890
3936
|
]);
|
|
3891
|
-
|
|
3937
|
+
Z(() => () => {
|
|
3892
3938
|
c && c.geometry.dispose();
|
|
3893
3939
|
}, [
|
|
3894
3940
|
c
|
|
3895
|
-
]),
|
|
3896
|
-
|
|
3941
|
+
]), Z(() => () => {
|
|
3942
|
+
ie && ie.dispose();
|
|
3897
3943
|
}, [
|
|
3898
|
-
|
|
3899
|
-
]),
|
|
3944
|
+
ie
|
|
3945
|
+
]), Z(() => () => {
|
|
3900
3946
|
K && K.dispose();
|
|
3901
3947
|
}, [
|
|
3902
3948
|
K
|
|
3903
|
-
]),
|
|
3904
|
-
|
|
3949
|
+
]), Z(() => () => {
|
|
3950
|
+
B && B.geometry.dispose();
|
|
3905
3951
|
}, [
|
|
3906
|
-
|
|
3907
|
-
]),
|
|
3952
|
+
B
|
|
3953
|
+
]), Z(() => {
|
|
3908
3954
|
n && Ft(n);
|
|
3909
3955
|
}, [
|
|
3910
3956
|
n
|
|
3911
|
-
]),
|
|
3957
|
+
]), Z(() => {
|
|
3912
3958
|
n || Ft(void 0);
|
|
3913
3959
|
}, [
|
|
3914
3960
|
S
|
|
3915
3961
|
]);
|
|
3916
|
-
const
|
|
3917
|
-
|
|
3918
|
-
if (!
|
|
3919
|
-
|
|
3920
|
-
const
|
|
3962
|
+
const pt = ue(false);
|
|
3963
|
+
Z(() => {
|
|
3964
|
+
if (!le || T.length === 0 || pt.current || !d) return;
|
|
3965
|
+
pt.current = true;
|
|
3966
|
+
const g = V.length >= 3 ? Math.abs(V[2].position.y - V[0].position.y) : null;
|
|
3921
3967
|
d("dimensions_calculated", {
|
|
3922
|
-
spacing_type:
|
|
3968
|
+
spacing_type: k,
|
|
3923
3969
|
source_unit: "mm",
|
|
3924
3970
|
file_format: Oe,
|
|
3925
3971
|
measurement_source: "scan_derived",
|
|
3926
|
-
is_double_wall:
|
|
3972
|
+
is_double_wall: re,
|
|
3927
3973
|
is_unit_converted: false,
|
|
3928
|
-
form_measurements: (
|
|
3929
|
-
scan_measurements: T.map((
|
|
3930
|
-
measurement_variance:
|
|
3931
|
-
const
|
|
3932
|
-
return
|
|
3974
|
+
form_measurements: (Pe == null ? void 0 : Pe.filter((M) => M != null)) ?? null,
|
|
3975
|
+
scan_measurements: T.map((M) => +(M.modifiedValue ?? M.originalValue).toFixed(1)),
|
|
3976
|
+
measurement_variance: Pe ? T.map((M, D) => {
|
|
3977
|
+
const L = Pe[D];
|
|
3978
|
+
return L == null ? null : +((M.modifiedValue ?? M.originalValue) - L).toFixed(1);
|
|
3933
3979
|
}) : null,
|
|
3934
|
-
frontal_height:
|
|
3980
|
+
frontal_height: g !== null ? +g.toFixed(1) : null
|
|
3935
3981
|
});
|
|
3936
3982
|
}, [
|
|
3937
|
-
|
|
3983
|
+
le,
|
|
3938
3984
|
T
|
|
3939
|
-
]),
|
|
3985
|
+
]), Z(() => {
|
|
3940
3986
|
a !== void 0 && (Ve.current = a), a !== void 0 && go(true);
|
|
3941
3987
|
}, [
|
|
3942
3988
|
a
|
|
3943
3989
|
]);
|
|
3944
|
-
const Qe =
|
|
3945
|
-
|
|
3946
|
-
const D =
|
|
3947
|
-
D.getCenter(
|
|
3948
|
-
const
|
|
3949
|
-
|
|
3950
|
-
const
|
|
3990
|
+
const Qe = de((g, M) => {
|
|
3991
|
+
g.computeBoundingBox();
|
|
3992
|
+
const D = g.boundingBox, L = new P();
|
|
3993
|
+
D.getCenter(L), g.translate(-L.x, -L.y, -L.z), g.computeBoundingBox();
|
|
3994
|
+
const Y = g.boundingBox, X = new P();
|
|
3995
|
+
Y.getSize(X), f(Math.max(X.x, X.y, X.z));
|
|
3996
|
+
const O = new q.Mesh(g, new q.MeshStandardMaterial({
|
|
3951
3997
|
color: 8947848,
|
|
3952
|
-
side:
|
|
3998
|
+
side: q.DoubleSide
|
|
3953
3999
|
}));
|
|
3954
|
-
|
|
3955
|
-
}, []), Ee =
|
|
3956
|
-
|
|
3957
|
-
const D =
|
|
3958
|
-
if (!
|
|
3959
|
-
|
|
4000
|
+
u(O), ae(M), ge(true), ne(false), ct.current = false;
|
|
4001
|
+
}, []), Ee = de(async (g, M) => {
|
|
4002
|
+
Re(null);
|
|
4003
|
+
const D = M.toLowerCase(), L = D.endsWith(".stl"), Y = D.endsWith(".obj"), X = D.endsWith(".aop");
|
|
4004
|
+
if (!Y && !L && !X) {
|
|
4005
|
+
Re("Unsupported file format. Please use OBJ, STL, or AOP.");
|
|
3960
4006
|
return;
|
|
3961
4007
|
}
|
|
3962
|
-
|
|
4008
|
+
on(L ? "stl" : X ? "aop" : "obj"), x(true), C("Processing file..."), Ae(`FILE_LOAD: ${M} (${L ? "STL" : X ? "AOP" : "OBJ"})`);
|
|
3963
4009
|
try {
|
|
3964
|
-
let
|
|
3965
|
-
if (
|
|
4010
|
+
let O;
|
|
4011
|
+
if (L) {
|
|
3966
4012
|
C("Converting STL...");
|
|
3967
|
-
const
|
|
3968
|
-
|
|
3969
|
-
]),
|
|
3970
|
-
|
|
3971
|
-
],
|
|
3972
|
-
|
|
4013
|
+
const be = new Blob([
|
|
4014
|
+
g
|
|
4015
|
+
]), ze = new File([
|
|
4016
|
+
be
|
|
4017
|
+
], M);
|
|
4018
|
+
O = await kn(ze);
|
|
3973
4019
|
} else if (X) {
|
|
3974
4020
|
C("Extracting AOP...");
|
|
3975
|
-
const
|
|
3976
|
-
|
|
3977
|
-
]),
|
|
3978
|
-
|
|
3979
|
-
],
|
|
3980
|
-
|
|
3981
|
-
} else
|
|
3982
|
-
const
|
|
3983
|
-
C(
|
|
4021
|
+
const be = new Blob([
|
|
4022
|
+
g
|
|
4023
|
+
]), ze = new File([
|
|
4024
|
+
be
|
|
4025
|
+
], M);
|
|
4026
|
+
O = await Uo(ze);
|
|
4027
|
+
} else O = typeof g == "string" ? g : new TextDecoder().decode(g);
|
|
4028
|
+
const ee = performance.now(), me = Ve.current ? await Ko(O, Ve.current, (be) => {
|
|
4029
|
+
C(be), Ae(`PREPROCESS: ${be}`);
|
|
3984
4030
|
}) : null;
|
|
3985
|
-
if (
|
|
4031
|
+
if (me) Ae(`PREPROCESS: done in ${(performance.now() - ee).toFixed(0)}ms \u2014 unit=${me.detectedUnit}, scaled=${me.wasScaled}`), e.showAmputationModal && !o ? (N(me), _(true)) : Qe(me.geometry, me.detectedUnit);
|
|
3986
4032
|
else {
|
|
3987
4033
|
C("Using fallback loader...");
|
|
3988
|
-
const
|
|
3989
|
-
|
|
3990
|
-
geometry:
|
|
4034
|
+
const be = Zo(O);
|
|
4035
|
+
be ? e.showAmputationModal && !o ? (N({
|
|
4036
|
+
geometry: be,
|
|
3991
4037
|
detectedUnit: "mm"
|
|
3992
|
-
}), _(true)) : Qe(
|
|
4038
|
+
}), _(true)) : Qe(be, "mm") : Re("Failed to parse the mesh.");
|
|
3993
4039
|
}
|
|
3994
|
-
} catch (
|
|
3995
|
-
|
|
4040
|
+
} catch (O) {
|
|
4041
|
+
Re(O instanceof Error ? O.message : "Failed to process the mesh file.");
|
|
3996
4042
|
} finally {
|
|
3997
4043
|
x(false), C("");
|
|
3998
4044
|
}
|
|
@@ -4002,195 +4048,195 @@ let __tla = (async () => {
|
|
|
4002
4048
|
o,
|
|
4003
4049
|
Qe
|
|
4004
4050
|
]);
|
|
4005
|
-
|
|
4051
|
+
Z(() => {
|
|
4006
4052
|
if (!t || !$e) return;
|
|
4007
4053
|
(async () => {
|
|
4008
4054
|
x(true), C("Loading scan...");
|
|
4009
4055
|
try {
|
|
4010
|
-
const
|
|
4011
|
-
if (!
|
|
4012
|
-
const
|
|
4013
|
-
if (
|
|
4014
|
-
const
|
|
4015
|
-
await Ee(
|
|
4056
|
+
const M = await fetch(t);
|
|
4057
|
+
if (!M.ok) throw new Error(`Failed to download scan: ${M.status}`);
|
|
4058
|
+
const L = new URL(t).pathname.split("/").pop() || "scan.obj", Y = L.toLowerCase();
|
|
4059
|
+
if (Y.endsWith(".stl") || Y.endsWith(".aop")) {
|
|
4060
|
+
const O = await M.arrayBuffer();
|
|
4061
|
+
await Ee(O, L);
|
|
4016
4062
|
} else {
|
|
4017
|
-
const
|
|
4018
|
-
await Ee(
|
|
4063
|
+
const O = await M.text();
|
|
4064
|
+
await Ee(O, L);
|
|
4019
4065
|
}
|
|
4020
|
-
} catch (
|
|
4021
|
-
|
|
4066
|
+
} catch (M) {
|
|
4067
|
+
Re(M instanceof Error ? M.message : "Failed to load scan from URL."), x(false), C("");
|
|
4022
4068
|
}
|
|
4023
4069
|
})();
|
|
4024
4070
|
}, [
|
|
4025
4071
|
t,
|
|
4026
4072
|
$e
|
|
4027
4073
|
]);
|
|
4028
|
-
const
|
|
4029
|
-
|
|
4030
|
-
}, []),
|
|
4031
|
-
|
|
4032
|
-
}, []),
|
|
4033
|
-
if (
|
|
4034
|
-
|
|
4074
|
+
const yo = de((g) => {
|
|
4075
|
+
g.preventDefault(), v(true);
|
|
4076
|
+
}, []), wo = de((g) => {
|
|
4077
|
+
g.preventDefault(), v(false);
|
|
4078
|
+
}, []), vo = de(async (g) => {
|
|
4079
|
+
if (g.preventDefault(), v(false), !$e) {
|
|
4080
|
+
Re("WASM module is still loading. Please wait.");
|
|
4035
4081
|
return;
|
|
4036
4082
|
}
|
|
4037
|
-
const
|
|
4038
|
-
if (!
|
|
4039
|
-
const D =
|
|
4083
|
+
const M = g.dataTransfer.files[0];
|
|
4084
|
+
if (!M) return;
|
|
4085
|
+
const D = M.name.toLowerCase();
|
|
4040
4086
|
if (!D.endsWith(".obj") && !D.endsWith(".stl") && !D.endsWith(".aop")) {
|
|
4041
|
-
|
|
4087
|
+
Re("Please drop an OBJ, STL, or AOP file.");
|
|
4042
4088
|
return;
|
|
4043
4089
|
}
|
|
4044
|
-
if (D.endsWith(".aop")) await Ee(await
|
|
4090
|
+
if (D.endsWith(".aop")) await Ee(await M.arrayBuffer(), M.name);
|
|
4045
4091
|
else if (D.endsWith(".stl")) {
|
|
4046
|
-
|
|
4092
|
+
on("stl"), x(true), C("Converting STL...");
|
|
4047
4093
|
try {
|
|
4048
|
-
const
|
|
4049
|
-
await Ee(
|
|
4050
|
-
} catch (
|
|
4051
|
-
|
|
4094
|
+
const L = await kn(M);
|
|
4095
|
+
await Ee(L, M.name.replace(/\.stl$/i, ".obj"));
|
|
4096
|
+
} catch (L) {
|
|
4097
|
+
Re(L instanceof Error ? L.message : "Failed to process STL file."), x(false), C("");
|
|
4052
4098
|
}
|
|
4053
4099
|
} else {
|
|
4054
|
-
const
|
|
4055
|
-
await Ee(
|
|
4100
|
+
const L = await M.text();
|
|
4101
|
+
await Ee(L, M.name);
|
|
4056
4102
|
}
|
|
4057
4103
|
}, [
|
|
4058
4104
|
$e,
|
|
4059
4105
|
Ee
|
|
4060
|
-
]),
|
|
4061
|
-
I(
|
|
4062
|
-
spacing_type:
|
|
4106
|
+
]), So = de((g) => {
|
|
4107
|
+
I(g), A(g === "AK" ? 2 : 1), _(false), B && (Qe(B.geometry, B.detectedUnit), N(null)), d == null ? void 0 : d("file_loaded", {
|
|
4108
|
+
spacing_type: g,
|
|
4063
4109
|
file_format: Oe,
|
|
4064
4110
|
is_double_wall: false
|
|
4065
4111
|
});
|
|
4066
4112
|
}, [
|
|
4067
|
-
|
|
4113
|
+
B,
|
|
4068
4114
|
Qe,
|
|
4069
4115
|
d,
|
|
4070
4116
|
Oe
|
|
4071
4117
|
]);
|
|
4072
|
-
|
|
4118
|
+
Z(() => {
|
|
4073
4119
|
if (!c || V.length !== 1 || !Ve.current || ct.current) return;
|
|
4074
4120
|
ct.current = true;
|
|
4075
|
-
const
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
]),
|
|
4080
|
-
|
|
4121
|
+
const g = V[0], M = Ve.current, D = c.geometry, { positions: L, indices: Y } = St(D), X = new Float32Array([
|
|
4122
|
+
g.position.x,
|
|
4123
|
+
g.position.y,
|
|
4124
|
+
g.position.z
|
|
4125
|
+
]), O = M.detect_shell(L, Y, X, 40), ee = O.details(), me = O.is_double_shell();
|
|
4126
|
+
Ae(`SHELL_DETECT: ${me ? "DOUBLE" : "SINGLE"} \u2014 ${ee}`), me && (R(true), Se(true), Ae(`SHELL_DETECT: double shell, thickness=${O.thickness().toFixed(1)}mm`));
|
|
4081
4127
|
}, [
|
|
4082
4128
|
c,
|
|
4083
4129
|
V,
|
|
4084
|
-
|
|
4130
|
+
Ae
|
|
4085
4131
|
]);
|
|
4086
|
-
const
|
|
4132
|
+
const Tt = de(() => {
|
|
4087
4133
|
if (!c || V.length < 2) return;
|
|
4088
|
-
|
|
4089
|
-
const
|
|
4134
|
+
oe(true), se("Please wait..."), Ae("PIPELINE: starting processing pipeline...");
|
|
4135
|
+
const g = performance.now();
|
|
4090
4136
|
setTimeout(() => {
|
|
4091
|
-
const
|
|
4137
|
+
const M = [
|
|
4092
4138
|
V[1],
|
|
4093
4139
|
V[0],
|
|
4094
4140
|
...V.slice(2)
|
|
4095
4141
|
];
|
|
4096
|
-
|
|
4142
|
+
nr(c, M, vt, {
|
|
4097
4143
|
onStatus: (D) => {
|
|
4098
|
-
|
|
4144
|
+
se(D), Ae(`PIPELINE: ${D}`);
|
|
4099
4145
|
},
|
|
4100
|
-
addLandmarkPoint:
|
|
4101
|
-
removeLandmarkPoint:
|
|
4146
|
+
addLandmarkPoint: dn,
|
|
4147
|
+
removeLandmarkPoint: fn,
|
|
4102
4148
|
updateLandmarkPositions: (D) => {
|
|
4103
|
-
const
|
|
4149
|
+
const L = [
|
|
4104
4150
|
D[1],
|
|
4105
4151
|
D[0],
|
|
4106
4152
|
...D.slice(2)
|
|
4107
4153
|
];
|
|
4108
|
-
|
|
4154
|
+
dt(L);
|
|
4109
4155
|
},
|
|
4110
4156
|
setAligned: un,
|
|
4111
4157
|
setCut: pn,
|
|
4112
4158
|
setModelSize: f,
|
|
4113
|
-
setOriginalEndY:
|
|
4159
|
+
setOriginalEndY: Qt,
|
|
4114
4160
|
setAdjustedStartY: Fe,
|
|
4115
|
-
setAdjustedEndY:
|
|
4116
|
-
setError:
|
|
4161
|
+
setAdjustedEndY: Pt,
|
|
4162
|
+
setError: Re,
|
|
4117
4163
|
setDoubleShell: (D) => {
|
|
4118
|
-
R(D),
|
|
4164
|
+
R(D), Se(true);
|
|
4119
4165
|
},
|
|
4120
|
-
setAoData: (D,
|
|
4121
|
-
|
|
4166
|
+
setAoData: (D, L) => {
|
|
4167
|
+
j(D), fe(L ?? null);
|
|
4122
4168
|
},
|
|
4123
|
-
setInnerShellExtracted:
|
|
4124
|
-
setMeasurementGeometry:
|
|
4125
|
-
setWasmSlices:
|
|
4169
|
+
setInnerShellExtracted: ne,
|
|
4170
|
+
setMeasurementGeometry: pe,
|
|
4171
|
+
setWasmSlices: Ie,
|
|
4126
4172
|
wasmModule: Ve.current ?? void 0
|
|
4127
|
-
}),
|
|
4173
|
+
}), Ae(`PIPELINE: completed in ${(performance.now() - g).toFixed(0)}ms`), pt.current = false, oe(false);
|
|
4128
4174
|
}, 50);
|
|
4129
4175
|
}, [
|
|
4130
4176
|
c,
|
|
4131
4177
|
V,
|
|
4132
|
-
|
|
4178
|
+
dt,
|
|
4133
4179
|
un,
|
|
4134
|
-
cn,
|
|
4135
4180
|
dn,
|
|
4181
|
+
fn,
|
|
4136
4182
|
pn,
|
|
4137
|
-
|
|
4138
|
-
]),
|
|
4139
|
-
|
|
4140
|
-
r && (
|
|
4183
|
+
H
|
|
4184
|
+
]), Ot = ue(false);
|
|
4185
|
+
Z(() => {
|
|
4186
|
+
r && (Ot.current || !c || le || G || V.length < 2 || (Ot.current = true, Tt()));
|
|
4141
4187
|
}, [
|
|
4142
4188
|
r,
|
|
4143
4189
|
c,
|
|
4144
4190
|
V.length,
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
]),
|
|
4149
|
-
V.length < 2 && (
|
|
4191
|
+
le,
|
|
4192
|
+
G,
|
|
4193
|
+
Tt
|
|
4194
|
+
]), Z(() => {
|
|
4195
|
+
V.length < 2 && (Ot.current = false);
|
|
4150
4196
|
}, [
|
|
4151
4197
|
V.length
|
|
4152
4198
|
]);
|
|
4153
|
-
const
|
|
4154
|
-
if (
|
|
4155
|
-
|
|
4199
|
+
const Ht = ue(false), Co = de(async () => {
|
|
4200
|
+
if (ft(), Le([]), Ie(null), pe(null), Fe(null), Pt(null), tn(null), Qt(null), qe(false), rn(false), Lt(true), R(false), ne(false), ct.current = false, Ht.current = false, pt.current = false, F("3D"), t && $e) {
|
|
4201
|
+
u(null);
|
|
4156
4202
|
try {
|
|
4157
|
-
const
|
|
4158
|
-
if (!
|
|
4159
|
-
const D = new URL(t).pathname.split("/").pop() || "scan.obj",
|
|
4160
|
-
|
|
4161
|
-
} catch (
|
|
4162
|
-
|
|
4203
|
+
const g = await fetch(t);
|
|
4204
|
+
if (!g.ok) throw new Error(`Failed to download scan: ${g.status}`);
|
|
4205
|
+
const D = new URL(t).pathname.split("/").pop() || "scan.obj", L = D.toLowerCase();
|
|
4206
|
+
L.endsWith(".stl") || L.endsWith(".aop") ? await Ee(await g.arrayBuffer(), D) : await Ee(await g.text(), D);
|
|
4207
|
+
} catch (g) {
|
|
4208
|
+
Re(g instanceof Error ? g.message : "Failed to reload scan.");
|
|
4163
4209
|
}
|
|
4164
4210
|
}
|
|
4165
4211
|
}, [
|
|
4166
4212
|
t,
|
|
4167
4213
|
$e,
|
|
4168
4214
|
Ee,
|
|
4169
|
-
|
|
4215
|
+
ft
|
|
4170
4216
|
]);
|
|
4171
|
-
|
|
4172
|
-
|
|
4217
|
+
Z(() => {
|
|
4218
|
+
le && T.length > 0 && !Ht.current && (Ht.current = true, qe(true));
|
|
4173
4219
|
}, [
|
|
4174
|
-
|
|
4220
|
+
le,
|
|
4175
4221
|
T.length
|
|
4176
4222
|
]);
|
|
4177
|
-
const { scanTransverseML:
|
|
4178
|
-
if (!c || !
|
|
4223
|
+
const { scanTransverseML: Nt, scanTransverseAP: Vt } = te(() => {
|
|
4224
|
+
if (!c || !le || V.length < 1) return {
|
|
4179
4225
|
scanTransverseML: 0,
|
|
4180
4226
|
scanTransverseAP: 0
|
|
4181
4227
|
};
|
|
4182
4228
|
try {
|
|
4183
|
-
const
|
|
4184
|
-
if (
|
|
4229
|
+
const g = (Te ?? c).geometry, M = V[0].position.y, D = qt(g), L = je(D, g, M);
|
|
4230
|
+
if (L.linePoints.length < 2) return {
|
|
4185
4231
|
scanTransverseML: 0,
|
|
4186
4232
|
scanTransverseAP: 0
|
|
4187
4233
|
};
|
|
4188
|
-
let
|
|
4189
|
-
for (const
|
|
4190
|
-
const
|
|
4234
|
+
let Y = L.linePoints[0], X = L.linePoints[0], O = L.linePoints[0], ee = L.linePoints[0];
|
|
4235
|
+
for (const ze of L.linePoints) ze.x < Y.x && (Y = ze), ze.x > X.x && (X = ze), ze.z < O.z && (O = ze), ze.z > ee.z && (ee = ze);
|
|
4236
|
+
const me = new P(Y.x, M, Y.z).distanceTo(new P(X.x, M, X.z)), be = new P(O.x, M, O.z).distanceTo(new P(ee.x, M, ee.z));
|
|
4191
4237
|
return {
|
|
4192
|
-
scanTransverseML:
|
|
4193
|
-
scanTransverseAP:
|
|
4238
|
+
scanTransverseML: me,
|
|
4239
|
+
scanTransverseAP: be
|
|
4194
4240
|
};
|
|
4195
4241
|
} catch {
|
|
4196
4242
|
return {
|
|
@@ -4201,53 +4247,53 @@ let __tla = (async () => {
|
|
|
4201
4247
|
}, [
|
|
4202
4248
|
c,
|
|
4203
4249
|
Te,
|
|
4204
|
-
|
|
4250
|
+
le,
|
|
4205
4251
|
V
|
|
4206
|
-
]), et =
|
|
4252
|
+
]), et = te(() => {
|
|
4207
4253
|
var _a;
|
|
4208
4254
|
if (!c || V.length < 1) return 0;
|
|
4209
|
-
const
|
|
4210
|
-
|
|
4211
|
-
const
|
|
4212
|
-
if (
|
|
4213
|
-
const
|
|
4214
|
-
if (
|
|
4255
|
+
const g = c.geometry;
|
|
4256
|
+
g.computeBoundingBox();
|
|
4257
|
+
const M = ((_a = g.boundingBox) == null ? void 0 : _a.min.y) ?? 0, D = V[0].position.y;
|
|
4258
|
+
if (re && V.length >= 3) {
|
|
4259
|
+
const L = Math.abs(D - V[2].position.y);
|
|
4260
|
+
if (L > 0.5) return L;
|
|
4215
4261
|
}
|
|
4216
|
-
return Math.abs(D -
|
|
4262
|
+
return Math.abs(D - M);
|
|
4217
4263
|
}, [
|
|
4218
4264
|
c,
|
|
4219
4265
|
V,
|
|
4220
|
-
|
|
4221
|
-
]),
|
|
4222
|
-
ro(
|
|
4223
|
-
}, []),
|
|
4266
|
+
re
|
|
4267
|
+
]), Ao = de((g) => {
|
|
4268
|
+
ro(g), Ft(g.circumferences), Lt(true), rn(true), qe(false);
|
|
4269
|
+
}, []), we = (g) => g == null ? g : +(g / 10).toFixed(2), hn = de(async (g) => {
|
|
4224
4270
|
if (!s || Ye.current) return;
|
|
4225
|
-
Ye.current = true, qe(false),
|
|
4226
|
-
const
|
|
4271
|
+
Ye.current = true, qe(false), sn(false), lt(true), await new Promise((D) => requestAnimationFrame(() => requestAnimationFrame(() => D())));
|
|
4272
|
+
const M = c ? await Je({
|
|
4227
4273
|
restoreView: false
|
|
4228
4274
|
}).catch(() => {
|
|
4229
4275
|
}) : void 0;
|
|
4230
4276
|
try {
|
|
4231
4277
|
s({
|
|
4232
|
-
spacingType:
|
|
4278
|
+
spacingType: k ?? "BK",
|
|
4233
4279
|
sourceUnit: "cm",
|
|
4234
4280
|
fileFormat: Oe,
|
|
4235
4281
|
measurementSource: "form_provided",
|
|
4236
|
-
isDoubleWall:
|
|
4282
|
+
isDoubleWall: re,
|
|
4237
4283
|
isUnitConverted: false,
|
|
4238
|
-
formMeasurements:
|
|
4284
|
+
formMeasurements: Pe == null ? void 0 : Pe.map((D) => we(D)),
|
|
4239
4285
|
scanMeasurements: T.map((D) => ({
|
|
4240
4286
|
yPosition: D.yPosition,
|
|
4241
|
-
originalValue:
|
|
4242
|
-
modifiedValue: D.modifiedValue == null ? null :
|
|
4287
|
+
originalValue: we(D.originalValue),
|
|
4288
|
+
modifiedValue: D.modifiedValue == null ? null : we(D.modifiedValue)
|
|
4243
4289
|
})),
|
|
4244
|
-
frontalHeight:
|
|
4290
|
+
frontalHeight: we(et),
|
|
4245
4291
|
transverseML: 0,
|
|
4246
4292
|
transverseAP: 0,
|
|
4247
4293
|
scanUrl: t,
|
|
4248
4294
|
decision: "skip",
|
|
4249
|
-
skipReason:
|
|
4250
|
-
screenshots:
|
|
4295
|
+
skipReason: g,
|
|
4296
|
+
screenshots: M,
|
|
4251
4297
|
alignedGeometry: c == null ? void 0 : c.geometry
|
|
4252
4298
|
});
|
|
4253
4299
|
} finally {
|
|
@@ -4256,67 +4302,67 @@ let __tla = (async () => {
|
|
|
4256
4302
|
}, [
|
|
4257
4303
|
s,
|
|
4258
4304
|
c,
|
|
4259
|
-
|
|
4305
|
+
k,
|
|
4260
4306
|
Oe,
|
|
4261
|
-
|
|
4262
|
-
|
|
4307
|
+
re,
|
|
4308
|
+
Pe,
|
|
4263
4309
|
T,
|
|
4264
4310
|
et,
|
|
4265
4311
|
t,
|
|
4266
4312
|
Je
|
|
4267
|
-
]), gn =
|
|
4268
|
-
|
|
4269
|
-
if (!c || !
|
|
4313
|
+
]), gn = ue(null);
|
|
4314
|
+
Z(() => {
|
|
4315
|
+
if (!c || !le) {
|
|
4270
4316
|
gn.current = null;
|
|
4271
4317
|
return;
|
|
4272
4318
|
}
|
|
4273
|
-
const
|
|
4274
|
-
gn.current =
|
|
4319
|
+
const g = (Te ?? c).geometry;
|
|
4320
|
+
gn.current = qt(g);
|
|
4275
4321
|
}, [
|
|
4276
4322
|
c,
|
|
4277
|
-
|
|
4323
|
+
le,
|
|
4278
4324
|
Te
|
|
4279
4325
|
]);
|
|
4280
|
-
const
|
|
4281
|
-
if (!s || !c || T.length === 0 || !
|
|
4326
|
+
const jt = de(async (g) => {
|
|
4327
|
+
if (!s || !c || T.length === 0 || !k || Ye.current) return;
|
|
4282
4328
|
Ye.current = true, lt(true), await new Promise((D) => requestAnimationFrame(() => requestAnimationFrame(() => D())));
|
|
4283
|
-
const
|
|
4329
|
+
const M = await Je({
|
|
4284
4330
|
restoreView: false
|
|
4285
4331
|
}).catch(() => {
|
|
4286
4332
|
});
|
|
4287
4333
|
try {
|
|
4288
|
-
const D =
|
|
4289
|
-
circumferences:
|
|
4290
|
-
frontalHeight:
|
|
4291
|
-
perineumML:
|
|
4292
|
-
perineumAP:
|
|
4293
|
-
mptML:
|
|
4294
|
-
mptAP:
|
|
4334
|
+
const D = Nt, L = Vt, Y = Ce ? {
|
|
4335
|
+
circumferences: Ce.circumferences.map((X) => we(X)),
|
|
4336
|
+
frontalHeight: we(Ce.frontalHeight),
|
|
4337
|
+
perineumML: we(Ce.perineumML),
|
|
4338
|
+
perineumAP: we(Ce.perineumAP),
|
|
4339
|
+
mptML: we(Ce.mptML),
|
|
4340
|
+
mptAP: we(Ce.mptAP)
|
|
4295
4341
|
} : void 0;
|
|
4296
4342
|
s({
|
|
4297
|
-
spacingType:
|
|
4343
|
+
spacingType: k,
|
|
4298
4344
|
sourceUnit: "cm",
|
|
4299
4345
|
fileFormat: Oe,
|
|
4300
|
-
measurementSource:
|
|
4301
|
-
isDoubleWall:
|
|
4346
|
+
measurementSource: g === "use_form_measurements" ? "form_provided" : "scan_derived",
|
|
4347
|
+
isDoubleWall: re,
|
|
4302
4348
|
isUnitConverted: false,
|
|
4303
|
-
formMeasurements:
|
|
4349
|
+
formMeasurements: Pe == null ? void 0 : Pe.map((X) => we(X)),
|
|
4304
4350
|
scanMeasurements: T.map((X) => ({
|
|
4305
4351
|
yPosition: X.yPosition,
|
|
4306
|
-
originalValue:
|
|
4307
|
-
modifiedValue: X.modifiedValue == null ? null :
|
|
4352
|
+
originalValue: we(X.originalValue),
|
|
4353
|
+
modifiedValue: X.modifiedValue == null ? null : we(X.modifiedValue)
|
|
4308
4354
|
})),
|
|
4309
|
-
frontalHeight:
|
|
4310
|
-
transverseML:
|
|
4311
|
-
transverseAP:
|
|
4312
|
-
perineumML:
|
|
4313
|
-
perineumAP:
|
|
4314
|
-
mptML:
|
|
4315
|
-
mptAP:
|
|
4355
|
+
frontalHeight: we((Ce == null ? void 0 : Ce.frontalHeight) ?? et),
|
|
4356
|
+
transverseML: we(D),
|
|
4357
|
+
transverseAP: we(L),
|
|
4358
|
+
perineumML: we(Ce == null ? void 0 : Ce.perineumML),
|
|
4359
|
+
perineumAP: we(Ce == null ? void 0 : Ce.perineumAP),
|
|
4360
|
+
mptML: we(Ce == null ? void 0 : Ce.mptML),
|
|
4361
|
+
mptAP: we(Ce == null ? void 0 : Ce.mptAP),
|
|
4316
4362
|
scanUrl: t,
|
|
4317
|
-
decision:
|
|
4318
|
-
userEnteredMeasurements:
|
|
4319
|
-
screenshots:
|
|
4363
|
+
decision: g,
|
|
4364
|
+
userEnteredMeasurements: Y,
|
|
4365
|
+
screenshots: M,
|
|
4320
4366
|
alignedGeometry: (Te ?? c).geometry
|
|
4321
4367
|
});
|
|
4322
4368
|
} finally {
|
|
@@ -4327,33 +4373,33 @@ let __tla = (async () => {
|
|
|
4327
4373
|
c,
|
|
4328
4374
|
Te,
|
|
4329
4375
|
T,
|
|
4330
|
-
|
|
4376
|
+
k,
|
|
4331
4377
|
V,
|
|
4332
4378
|
Oe,
|
|
4333
|
-
|
|
4334
|
-
|
|
4379
|
+
re,
|
|
4380
|
+
Pe,
|
|
4335
4381
|
t,
|
|
4336
|
-
|
|
4382
|
+
Ce,
|
|
4337
4383
|
et,
|
|
4338
|
-
Ht,
|
|
4339
4384
|
Nt,
|
|
4385
|
+
Vt,
|
|
4340
4386
|
Je
|
|
4341
|
-
]),
|
|
4342
|
-
if (!
|
|
4343
|
-
const
|
|
4344
|
-
if (
|
|
4345
|
-
for (let
|
|
4346
|
-
const D =
|
|
4347
|
-
if (!
|
|
4348
|
-
const
|
|
4349
|
-
if (Math.abs(
|
|
4387
|
+
]), zo = te(() => {
|
|
4388
|
+
if (!Pe || T.length === 0) return false;
|
|
4389
|
+
const g = Math.min(Pe.length, T.length);
|
|
4390
|
+
if (g === 0) return false;
|
|
4391
|
+
for (let M = 0; M < g; M++) {
|
|
4392
|
+
const D = Pe[M], L = T[M];
|
|
4393
|
+
if (!L || D == null || D === 0) continue;
|
|
4394
|
+
const Y = L.modifiedValue ?? L.originalValue;
|
|
4395
|
+
if (Math.abs(Y - D) > 7) return false;
|
|
4350
4396
|
}
|
|
4351
4397
|
return true;
|
|
4352
4398
|
}, [
|
|
4353
|
-
|
|
4399
|
+
Pe,
|
|
4354
4400
|
T
|
|
4355
4401
|
]), mn = Ne === 0 ? 320 : Ne < 520 ? Math.max(200, Math.round(Ne * 0.42)) : Ne < 900 ? 280 : Ne < 1400 ? 340 : 400, xn = Ne < 520 ? 16 : Ne < 900 ? 20 : 24;
|
|
4356
|
-
return y(
|
|
4402
|
+
return y(Vo.Provider, {
|
|
4357
4403
|
value: e,
|
|
4358
4404
|
children: [
|
|
4359
4405
|
y("div", {
|
|
@@ -4394,7 +4440,7 @@ let __tla = (async () => {
|
|
|
4394
4440
|
},
|
|
4395
4441
|
children: [
|
|
4396
4442
|
y("div", {
|
|
4397
|
-
ref:
|
|
4443
|
+
ref: Rt,
|
|
4398
4444
|
style: {
|
|
4399
4445
|
flex: 1,
|
|
4400
4446
|
display: "flex",
|
|
@@ -4402,8 +4448,8 @@ let __tla = (async () => {
|
|
|
4402
4448
|
minHeight: 0
|
|
4403
4449
|
},
|
|
4404
4450
|
children: [
|
|
4405
|
-
c && !
|
|
4406
|
-
const
|
|
4451
|
+
c && !le && (() => {
|
|
4452
|
+
const g = V.length === 0 ? 1 : V.length === 1 ? 2 : 3, M = k === "AK" ? "Perineum" : "MPT", D = g === 1 ? `Place Point at ${M}` : g === 2 ? "Place Point at Distal Most Point" : "Ready to Continue", L = g === 1 ? `Click on the model to mark the ${M}.` : g === 2 ? "Click on the model to mark the Distal Most Point." : "Both points are placed. Click Continue to process the scan.", Y = g === 1 ? "#2fbf4a" : g === 2 ? "#e53935" : "#2fbf4a", X = V.length >= 2;
|
|
4407
4453
|
return y("div", {
|
|
4408
4454
|
style: {
|
|
4409
4455
|
width: mn,
|
|
@@ -4434,13 +4480,13 @@ let __tla = (async () => {
|
|
|
4434
4480
|
},
|
|
4435
4481
|
children: [
|
|
4436
4482
|
i("button", {
|
|
4437
|
-
onClick: () =>
|
|
4438
|
-
const
|
|
4439
|
-
if (!
|
|
4483
|
+
onClick: () => ln((O) => {
|
|
4484
|
+
const ee = !O;
|
|
4485
|
+
if (!ee) try {
|
|
4440
4486
|
localStorage.setItem("gm_helpTipDismissed", "1");
|
|
4441
4487
|
} catch {
|
|
4442
4488
|
}
|
|
4443
|
-
return
|
|
4489
|
+
return ee;
|
|
4444
4490
|
}),
|
|
4445
4491
|
"aria-label": "How to use",
|
|
4446
4492
|
style: {
|
|
@@ -4468,7 +4514,7 @@ let __tla = (async () => {
|
|
|
4468
4514
|
},
|
|
4469
4515
|
children: "i"
|
|
4470
4516
|
}),
|
|
4471
|
-
|
|
4517
|
+
Wt && y("div", {
|
|
4472
4518
|
role: "tooltip",
|
|
4473
4519
|
style: {
|
|
4474
4520
|
position: "absolute",
|
|
@@ -4521,16 +4567,16 @@ let __tla = (async () => {
|
|
|
4521
4567
|
2,
|
|
4522
4568
|
3,
|
|
4523
4569
|
4
|
|
4524
|
-
].map((
|
|
4570
|
+
].map((O) => i("div", {
|
|
4525
4571
|
style: {
|
|
4526
4572
|
height: 4,
|
|
4527
4573
|
flex: 1,
|
|
4528
4574
|
maxWidth: 40,
|
|
4529
4575
|
borderRadius: 2,
|
|
4530
|
-
backgroundColor:
|
|
4576
|
+
backgroundColor: O <= g ? "rgb(12, 67, 173)" : "rgba(0,0,0,0.12)",
|
|
4531
4577
|
transition: "background-color 200ms"
|
|
4532
4578
|
}
|
|
4533
|
-
},
|
|
4579
|
+
}, O)),
|
|
4534
4580
|
y("div", {
|
|
4535
4581
|
style: {
|
|
4536
4582
|
fontSize: 11,
|
|
@@ -4540,7 +4586,7 @@ let __tla = (async () => {
|
|
|
4540
4586
|
letterSpacing: "0.4px"
|
|
4541
4587
|
},
|
|
4542
4588
|
children: [
|
|
4543
|
-
|
|
4589
|
+
g,
|
|
4544
4590
|
" / 4"
|
|
4545
4591
|
]
|
|
4546
4592
|
})
|
|
@@ -4559,9 +4605,9 @@ let __tla = (async () => {
|
|
|
4559
4605
|
width: 12,
|
|
4560
4606
|
height: 12,
|
|
4561
4607
|
borderRadius: "50%",
|
|
4562
|
-
backgroundColor:
|
|
4608
|
+
backgroundColor: Y,
|
|
4563
4609
|
flexShrink: 0,
|
|
4564
|
-
boxShadow: `0 0 0 3px ${
|
|
4610
|
+
boxShadow: `0 0 0 3px ${Y}22`
|
|
4565
4611
|
}
|
|
4566
4612
|
}),
|
|
4567
4613
|
i("div", {
|
|
@@ -4581,11 +4627,11 @@ let __tla = (async () => {
|
|
|
4581
4627
|
color: "rgba(0,0,0,0.6)",
|
|
4582
4628
|
lineHeight: "19px"
|
|
4583
4629
|
},
|
|
4584
|
-
children:
|
|
4630
|
+
children: L
|
|
4585
4631
|
}),
|
|
4586
4632
|
i("button", {
|
|
4587
4633
|
disabled: !X,
|
|
4588
|
-
onClick:
|
|
4634
|
+
onClick: Tt,
|
|
4589
4635
|
style: {
|
|
4590
4636
|
marginTop: 4,
|
|
4591
4637
|
padding: "11px 14px",
|
|
@@ -4623,7 +4669,7 @@ let __tla = (async () => {
|
|
|
4623
4669
|
]
|
|
4624
4670
|
});
|
|
4625
4671
|
})(),
|
|
4626
|
-
|
|
4672
|
+
le && Ge && k && i("div", {
|
|
4627
4673
|
style: {
|
|
4628
4674
|
width: mn,
|
|
4629
4675
|
flexShrink: 0,
|
|
@@ -4647,35 +4693,35 @@ let __tla = (async () => {
|
|
|
4647
4693
|
border: "1px solid rgba(0,0,0,0.06)",
|
|
4648
4694
|
overflow: "hidden"
|
|
4649
4695
|
},
|
|
4650
|
-
children: i(
|
|
4651
|
-
amputationType:
|
|
4696
|
+
children: i(Pr, {
|
|
4697
|
+
amputationType: k,
|
|
4652
4698
|
spacingInches: S,
|
|
4653
4699
|
scanMeasurements: T,
|
|
4654
4700
|
scanFrontalHeight: et,
|
|
4655
|
-
scanTransverseML:
|
|
4656
|
-
scanTransverseAP:
|
|
4657
|
-
onSave:
|
|
4701
|
+
scanTransverseML: Nt,
|
|
4702
|
+
scanTransverseAP: Vt,
|
|
4703
|
+
onSave: Ao,
|
|
4658
4704
|
onSkip: hn,
|
|
4659
4705
|
onFormChange: so,
|
|
4660
4706
|
onHeightChange: ao,
|
|
4661
4707
|
onTransverseMLChange: fo,
|
|
4662
4708
|
onTransverseAPChange: po,
|
|
4663
|
-
initialValues:
|
|
4664
|
-
initialFrontalHeight:
|
|
4709
|
+
initialValues: Pe,
|
|
4710
|
+
initialFrontalHeight: Ce == null ? void 0 : Ce.frontalHeight
|
|
4665
4711
|
})
|
|
4666
4712
|
})
|
|
4667
4713
|
}),
|
|
4668
4714
|
y("div", {
|
|
4669
|
-
ref:
|
|
4715
|
+
ref: Bt,
|
|
4670
4716
|
style: {
|
|
4671
4717
|
flex: 1,
|
|
4672
4718
|
position: "relative",
|
|
4673
4719
|
minHeight: 0,
|
|
4674
4720
|
overflow: "hidden"
|
|
4675
4721
|
},
|
|
4676
|
-
onDragOver: e.showDragDrop ?
|
|
4677
|
-
onDragLeave: e.showDragDrop ?
|
|
4678
|
-
onDrop: e.showDragDrop ?
|
|
4722
|
+
onDragOver: e.showDragDrop ? yo : void 0,
|
|
4723
|
+
onDragLeave: e.showDragDrop ? wo : void 0,
|
|
4724
|
+
onDrop: e.showDragDrop ? vo : void 0,
|
|
4679
4725
|
children: [
|
|
4680
4726
|
e.showDragDrop && !c && !h && i("div", {
|
|
4681
4727
|
style: {
|
|
@@ -4726,7 +4772,7 @@ let __tla = (async () => {
|
|
|
4726
4772
|
]
|
|
4727
4773
|
})
|
|
4728
4774
|
}),
|
|
4729
|
-
!e.showDragDrop && !c && !h && !
|
|
4775
|
+
!e.showDragDrop && !c && !h && !kt && i("div", {
|
|
4730
4776
|
style: {
|
|
4731
4777
|
position: "absolute",
|
|
4732
4778
|
inset: 0,
|
|
@@ -4767,12 +4813,12 @@ let __tla = (async () => {
|
|
|
4767
4813
|
h && i(Ln, {
|
|
4768
4814
|
message: w || "Processing mesh..."
|
|
4769
4815
|
}),
|
|
4770
|
-
|
|
4771
|
-
message:
|
|
4816
|
+
G && i(Ln, {
|
|
4817
|
+
message: ce
|
|
4772
4818
|
}),
|
|
4773
|
-
|
|
4774
|
-
message:
|
|
4775
|
-
onDismiss: () =>
|
|
4819
|
+
kt && i(rr, {
|
|
4820
|
+
message: kt,
|
|
4821
|
+
onDismiss: () => Re(null)
|
|
4776
4822
|
}),
|
|
4777
4823
|
e.showAmputationModal && z && i("div", {
|
|
4778
4824
|
style: {
|
|
@@ -4825,8 +4871,8 @@ let __tla = (async () => {
|
|
|
4825
4871
|
children: [
|
|
4826
4872
|
"AK",
|
|
4827
4873
|
"BK"
|
|
4828
|
-
].map((
|
|
4829
|
-
onClick: () => I(
|
|
4874
|
+
].map((g) => y("label", {
|
|
4875
|
+
onClick: () => I(g),
|
|
4830
4876
|
style: {
|
|
4831
4877
|
flex: 1,
|
|
4832
4878
|
display: "flex",
|
|
@@ -4835,16 +4881,16 @@ let __tla = (async () => {
|
|
|
4835
4881
|
border: "2px solid",
|
|
4836
4882
|
borderRadius: 4,
|
|
4837
4883
|
cursor: "pointer",
|
|
4838
|
-
borderColor:
|
|
4839
|
-
backgroundColor:
|
|
4884
|
+
borderColor: k === g ? "rgb(12, 67, 173)" : "#e0e0e0",
|
|
4885
|
+
backgroundColor: k === g ? "rgba(12, 67, 173, 0.04)" : "#fff",
|
|
4840
4886
|
transition: "border-color 0.15s, background-color 0.15s"
|
|
4841
4887
|
},
|
|
4842
4888
|
children: [
|
|
4843
4889
|
i("input", {
|
|
4844
4890
|
type: "radio",
|
|
4845
4891
|
name: "ampType",
|
|
4846
|
-
checked:
|
|
4847
|
-
onChange: () => I(
|
|
4892
|
+
checked: k === g,
|
|
4893
|
+
onChange: () => I(g),
|
|
4848
4894
|
style: {
|
|
4849
4895
|
accentColor: "rgb(12, 67, 173)",
|
|
4850
4896
|
marginBottom: 12,
|
|
@@ -4859,7 +4905,7 @@ let __tla = (async () => {
|
|
|
4859
4905
|
color: "rgba(0,0,0,0.87)",
|
|
4860
4906
|
marginBottom: 4
|
|
4861
4907
|
},
|
|
4862
|
-
children:
|
|
4908
|
+
children: g
|
|
4863
4909
|
}),
|
|
4864
4910
|
y("span", {
|
|
4865
4911
|
style: {
|
|
@@ -4867,12 +4913,12 @@ let __tla = (async () => {
|
|
|
4867
4913
|
color: "rgba(0,0,0,0.54)"
|
|
4868
4914
|
},
|
|
4869
4915
|
children: [
|
|
4870
|
-
|
|
4916
|
+
g === "AK" ? "2" : "1",
|
|
4871
4917
|
"-inch measurement spacing"
|
|
4872
4918
|
]
|
|
4873
4919
|
})
|
|
4874
4920
|
]
|
|
4875
|
-
},
|
|
4921
|
+
}, g))
|
|
4876
4922
|
})
|
|
4877
4923
|
]
|
|
4878
4924
|
}),
|
|
@@ -4887,7 +4933,7 @@ let __tla = (async () => {
|
|
|
4887
4933
|
children: [
|
|
4888
4934
|
i("button", {
|
|
4889
4935
|
onClick: () => {
|
|
4890
|
-
_(false),
|
|
4936
|
+
_(false), N(null);
|
|
4891
4937
|
},
|
|
4892
4938
|
style: {
|
|
4893
4939
|
padding: "6px 16px",
|
|
@@ -4905,17 +4951,17 @@ let __tla = (async () => {
|
|
|
4905
4951
|
children: "Cancel"
|
|
4906
4952
|
}),
|
|
4907
4953
|
i("button", {
|
|
4908
|
-
onClick: () =>
|
|
4909
|
-
disabled: !
|
|
4954
|
+
onClick: () => k && So(k),
|
|
4955
|
+
disabled: !k,
|
|
4910
4956
|
style: {
|
|
4911
4957
|
padding: "6px 16px",
|
|
4912
4958
|
borderRadius: 4,
|
|
4913
4959
|
fontSize: 14,
|
|
4914
4960
|
fontWeight: 500,
|
|
4915
|
-
backgroundColor:
|
|
4961
|
+
backgroundColor: k ? "rgb(12, 67, 173)" : "#e0e0e0",
|
|
4916
4962
|
border: "none",
|
|
4917
|
-
color:
|
|
4918
|
-
cursor:
|
|
4963
|
+
color: k ? "#fff" : "#9e9e9e",
|
|
4964
|
+
cursor: k ? "pointer" : "not-allowed",
|
|
4919
4965
|
fontFamily: "system-ui, sans-serif",
|
|
4920
4966
|
lineHeight: "36px",
|
|
4921
4967
|
letterSpacing: "0.4px"
|
|
@@ -4927,7 +4973,7 @@ let __tla = (async () => {
|
|
|
4927
4973
|
]
|
|
4928
4974
|
})
|
|
4929
4975
|
}),
|
|
4930
|
-
e.showDragDrop &&
|
|
4976
|
+
e.showDragDrop && m && i("div", {
|
|
4931
4977
|
style: {
|
|
4932
4978
|
position: "absolute",
|
|
4933
4979
|
inset: 0,
|
|
@@ -4937,8 +4983,8 @@ let __tla = (async () => {
|
|
|
4937
4983
|
zIndex: 10
|
|
4938
4984
|
}
|
|
4939
4985
|
}),
|
|
4940
|
-
i(
|
|
4941
|
-
children: y(
|
|
4986
|
+
i(or, {
|
|
4987
|
+
children: y(Bo, {
|
|
4942
4988
|
camera: {
|
|
4943
4989
|
position: [
|
|
4944
4990
|
0,
|
|
@@ -4948,14 +4994,14 @@ let __tla = (async () => {
|
|
|
4948
4994
|
},
|
|
4949
4995
|
style: {
|
|
4950
4996
|
display: c ? "block" : "none",
|
|
4951
|
-
backgroundColor:
|
|
4997
|
+
backgroundColor: Be ? "#070611" : void 0
|
|
4952
4998
|
},
|
|
4953
4999
|
gl: {
|
|
4954
5000
|
localClippingEnabled: true,
|
|
4955
5001
|
preserveDrawingBuffer: true
|
|
4956
5002
|
},
|
|
4957
5003
|
scene: {
|
|
4958
|
-
background:
|
|
5004
|
+
background: Be ? new q.Color("#070611") : null
|
|
4959
5005
|
},
|
|
4960
5006
|
children: [
|
|
4961
5007
|
i("ambientLight", {
|
|
@@ -4985,122 +5031,122 @@ let __tla = (async () => {
|
|
|
4985
5031
|
],
|
|
4986
5032
|
intensity: 0.2
|
|
4987
5033
|
}),
|
|
4988
|
-
c && b === "3D" && i(
|
|
5034
|
+
c && b === "3D" && i(sr, {
|
|
4989
5035
|
mesh: c,
|
|
4990
5036
|
maxPoints: 2,
|
|
4991
|
-
meshColor:
|
|
4992
|
-
meshOpacity:
|
|
4993
|
-
frontFaceOnly:
|
|
4994
|
-
doubleShellTransparency:
|
|
5037
|
+
meshColor: an,
|
|
5038
|
+
meshOpacity: Be ? 0.3 : ho,
|
|
5039
|
+
frontFaceOnly: H,
|
|
5040
|
+
doubleShellTransparency: re && le
|
|
4995
5041
|
}),
|
|
4996
|
-
c && b === "3D" && i(
|
|
4997
|
-
modelSize:
|
|
5042
|
+
c && b === "3D" && i(ar, {
|
|
5043
|
+
modelSize: p,
|
|
4998
5044
|
labels: [
|
|
4999
|
-
|
|
5045
|
+
k === "AK" ? "Perineum" : "MPT",
|
|
5000
5046
|
"Distal Most Point",
|
|
5001
5047
|
"Cut Plane"
|
|
5002
5048
|
]
|
|
5003
5049
|
}),
|
|
5004
|
-
i(
|
|
5005
|
-
modelSize:
|
|
5006
|
-
isAligned:
|
|
5007
|
-
isCut:
|
|
5050
|
+
i(xr, {
|
|
5051
|
+
modelSize: p,
|
|
5052
|
+
isAligned: le,
|
|
5053
|
+
isCut: $t,
|
|
5008
5054
|
mesh: c,
|
|
5009
5055
|
viewMode: b,
|
|
5010
|
-
sliceY:
|
|
5056
|
+
sliceY: le && V.length >= 2 ? Mt ?? rt ?? V[0].position.y : void 0,
|
|
5011
5057
|
landmarkCount: V.length,
|
|
5012
|
-
measurementGeometry:
|
|
5013
|
-
fitYMin:
|
|
5014
|
-
fitYMax:
|
|
5015
|
-
resetCameraToFrontRef:
|
|
5058
|
+
measurementGeometry: ie,
|
|
5059
|
+
fitYMin: le && V.length >= 2 ? Mt ?? rt ?? void 0 : void 0,
|
|
5060
|
+
fitYMax: le && V.length >= 2 ? it ?? V[0].position.y : void 0,
|
|
5061
|
+
resetCameraToFrontRef: It
|
|
5016
5062
|
}),
|
|
5017
|
-
!
|
|
5063
|
+
!le && i($n, {
|
|
5018
5064
|
enableDamping: false
|
|
5019
5065
|
}),
|
|
5020
|
-
|
|
5066
|
+
le && T.length > 0 && c && b === "3D" && i(br, {
|
|
5021
5067
|
mesh: c,
|
|
5022
5068
|
isDragging: Qn
|
|
5023
5069
|
}),
|
|
5024
|
-
c &&
|
|
5025
|
-
const
|
|
5026
|
-
if (!
|
|
5027
|
-
const D = V[2],
|
|
5070
|
+
c && le && V.length >= 3 && (() => {
|
|
5071
|
+
const M = c.geometry.getIndex();
|
|
5072
|
+
if (!M || M.count < 30) return null;
|
|
5073
|
+
const D = V[2], L = V[0], Y = ye ?? D.position.y, X = Mt ?? rt ?? L.position.y;
|
|
5028
5074
|
if (b === "2D") {
|
|
5029
|
-
const
|
|
5030
|
-
return i(
|
|
5075
|
+
const O = Ge ? co : He ? k === "AK" ? Ce == null ? void 0 : Ce.perineumML : Ce == null ? void 0 : Ce.mptML : void 0, ee = Ge ? uo : He ? k === "AK" ? Ce == null ? void 0 : Ce.perineumAP : Ce == null ? void 0 : Ce.mptAP : void 0;
|
|
5076
|
+
return i(Sr, {
|
|
5031
5077
|
mesh: Te ?? c,
|
|
5032
5078
|
upperY: X,
|
|
5033
|
-
originY:
|
|
5034
|
-
modelSize:
|
|
5035
|
-
meshColor:
|
|
5036
|
-
displayUnit:
|
|
5037
|
-
formML:
|
|
5038
|
-
formAP:
|
|
5079
|
+
originY: L.position.y,
|
|
5080
|
+
modelSize: p,
|
|
5081
|
+
meshColor: an,
|
|
5082
|
+
displayUnit: W,
|
|
5083
|
+
formML: O,
|
|
5084
|
+
formAP: ee
|
|
5039
5085
|
});
|
|
5040
5086
|
}
|
|
5041
5087
|
return y(We, {
|
|
5042
5088
|
children: [
|
|
5043
|
-
i(
|
|
5089
|
+
i(hr, {
|
|
5044
5090
|
mesh: Te ?? c,
|
|
5045
|
-
startY:
|
|
5091
|
+
startY: Y,
|
|
5046
5092
|
endY: X,
|
|
5047
|
-
spacing:
|
|
5048
|
-
modelSize:
|
|
5049
|
-
onMeasurementsChange:
|
|
5093
|
+
spacing: ut,
|
|
5094
|
+
modelSize: p,
|
|
5095
|
+
onMeasurementsChange: Le,
|
|
5050
5096
|
reverseOrder: true,
|
|
5051
|
-
displayUnit:
|
|
5052
|
-
useInnerSurface:
|
|
5053
|
-
formMeasurements: Ge ? io ??
|
|
5054
|
-
originY: it ??
|
|
5055
|
-
wasmSlices:
|
|
5097
|
+
displayUnit: W,
|
|
5098
|
+
useInnerSurface: re && !H,
|
|
5099
|
+
formMeasurements: Ge ? io ?? Pe : He ? Pe : void 0,
|
|
5100
|
+
originY: it ?? L.position.y,
|
|
5101
|
+
wasmSlices: ke
|
|
5056
5102
|
}),
|
|
5057
|
-
i(
|
|
5103
|
+
i(mr, {
|
|
5058
5104
|
mesh: c,
|
|
5059
|
-
greenY: it ??
|
|
5060
|
-
modelSize:
|
|
5061
|
-
displayUnit:
|
|
5062
|
-
bottomY:
|
|
5063
|
-
formHeight: Ge ? lo : He ?
|
|
5105
|
+
greenY: it ?? L.position.y,
|
|
5106
|
+
modelSize: p,
|
|
5107
|
+
displayUnit: W,
|
|
5108
|
+
bottomY: re ? D.position.y : void 0,
|
|
5109
|
+
formHeight: Ge ? lo : He ? Ce == null ? void 0 : Ce.frontalHeight : void 0
|
|
5064
5110
|
}),
|
|
5065
|
-
i(
|
|
5111
|
+
i(Cr, {
|
|
5066
5112
|
mesh: c,
|
|
5067
|
-
yPosition: it ??
|
|
5068
|
-
onYChange: (
|
|
5069
|
-
|
|
5070
|
-
const
|
|
5071
|
-
|
|
5113
|
+
yPosition: it ?? L.position.y,
|
|
5114
|
+
onYChange: (O) => {
|
|
5115
|
+
tn(O), Ie(null);
|
|
5116
|
+
const ee = O - L.position.y;
|
|
5117
|
+
Pt((rt ?? L.position.y + ut * 2) + ee);
|
|
5072
5118
|
},
|
|
5073
|
-
minY:
|
|
5074
|
-
maxY:
|
|
5075
|
-
modelSize:
|
|
5119
|
+
minY: L.position.y - ut,
|
|
5120
|
+
maxY: L.position.y + ut,
|
|
5121
|
+
modelSize: p,
|
|
5076
5122
|
color: "#44ff44",
|
|
5077
5123
|
hoverColor: "#88ff88",
|
|
5078
5124
|
dragColor: "#ffffff",
|
|
5079
|
-
label:
|
|
5080
|
-
onDragStart: () =>
|
|
5081
|
-
onDragEnd: () =>
|
|
5125
|
+
label: k === "AK" ? "Perineum" : "MPT",
|
|
5126
|
+
onDragStart: () => en(true),
|
|
5127
|
+
onDragEnd: () => en(false)
|
|
5082
5128
|
})
|
|
5083
5129
|
]
|
|
5084
5130
|
});
|
|
5085
5131
|
})(),
|
|
5086
|
-
c &&
|
|
5132
|
+
c && le && b === "3D" && Be && i(Vr, {
|
|
5087
5133
|
mesh: c
|
|
5088
5134
|
}),
|
|
5089
|
-
c && e.showDebug &&
|
|
5135
|
+
c && e.showDebug && Be && b === "3D" && i(Nr, {
|
|
5090
5136
|
mesh: c,
|
|
5091
|
-
modelSize:
|
|
5092
|
-
layers:
|
|
5137
|
+
modelSize: p,
|
|
5138
|
+
layers: nn,
|
|
5093
5139
|
landmarkPoints: V,
|
|
5094
5140
|
componentDebug: null,
|
|
5095
|
-
aoData:
|
|
5141
|
+
aoData: Q,
|
|
5096
5142
|
aoGeometry: K,
|
|
5097
|
-
measurementGeometry:
|
|
5143
|
+
measurementGeometry: ie
|
|
5098
5144
|
}),
|
|
5099
|
-
i(
|
|
5145
|
+
i(Yr, {
|
|
5100
5146
|
screenshotFnRef: mo,
|
|
5101
5147
|
mesh: c,
|
|
5102
|
-
modelSize:
|
|
5103
|
-
measurementGeometry:
|
|
5148
|
+
modelSize: p,
|
|
5149
|
+
measurementGeometry: ie
|
|
5104
5150
|
})
|
|
5105
5151
|
]
|
|
5106
5152
|
})
|
|
@@ -5115,7 +5161,7 @@ let __tla = (async () => {
|
|
|
5115
5161
|
gap: 8
|
|
5116
5162
|
},
|
|
5117
5163
|
children: [
|
|
5118
|
-
e.showStartOver &&
|
|
5164
|
+
e.showStartOver && le && i("button", {
|
|
5119
5165
|
onClick: () => window.location.reload(),
|
|
5120
5166
|
style: {
|
|
5121
5167
|
padding: "6px 16px",
|
|
@@ -5132,7 +5178,7 @@ let __tla = (async () => {
|
|
|
5132
5178
|
},
|
|
5133
5179
|
children: "Start Over"
|
|
5134
5180
|
}),
|
|
5135
|
-
!
|
|
5181
|
+
!le && V.length >= 1 && y(We, {
|
|
5136
5182
|
children: [
|
|
5137
5183
|
i("button", {
|
|
5138
5184
|
onClick: () => Et(),
|
|
@@ -5171,34 +5217,56 @@ let __tla = (async () => {
|
|
|
5171
5217
|
})
|
|
5172
5218
|
]
|
|
5173
5219
|
}),
|
|
5174
|
-
|
|
5175
|
-
|
|
5176
|
-
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
|
|
5180
|
-
|
|
5181
|
-
|
|
5182
|
-
|
|
5183
|
-
|
|
5184
|
-
|
|
5185
|
-
|
|
5186
|
-
|
|
5187
|
-
|
|
5188
|
-
|
|
5189
|
-
|
|
5220
|
+
le && !Dt && y(We, {
|
|
5221
|
+
children: [
|
|
5222
|
+
i("button", {
|
|
5223
|
+
onClick: Co,
|
|
5224
|
+
style: {
|
|
5225
|
+
padding: "6px 16px",
|
|
5226
|
+
borderRadius: 4,
|
|
5227
|
+
fontSize: 13,
|
|
5228
|
+
fontWeight: 500,
|
|
5229
|
+
backgroundColor: "#fff",
|
|
5230
|
+
border: "1px solid #e53935",
|
|
5231
|
+
color: "#e53935",
|
|
5232
|
+
cursor: "pointer",
|
|
5233
|
+
fontFamily: "system-ui, sans-serif",
|
|
5234
|
+
letterSpacing: "0.4px",
|
|
5235
|
+
boxShadow: "0 2px 8px rgba(0,0,0,0.1)"
|
|
5236
|
+
},
|
|
5237
|
+
children: "Reset Points"
|
|
5238
|
+
}),
|
|
5239
|
+
i("button", {
|
|
5240
|
+
onClick: bo,
|
|
5241
|
+
title: "Mirror scan across the vertical axis (use if the scan came in flipped). Alignment will reset so you can re-place landmarks.",
|
|
5242
|
+
style: {
|
|
5243
|
+
padding: "6px 16px",
|
|
5244
|
+
borderRadius: 4,
|
|
5245
|
+
fontSize: 13,
|
|
5246
|
+
fontWeight: 500,
|
|
5247
|
+
backgroundColor: "#fff",
|
|
5248
|
+
border: "1px solid #bdbdbd",
|
|
5249
|
+
color: "#333",
|
|
5250
|
+
cursor: "pointer",
|
|
5251
|
+
fontFamily: "system-ui, sans-serif",
|
|
5252
|
+
letterSpacing: "0.4px",
|
|
5253
|
+
boxShadow: "0 2px 8px rgba(0,0,0,0.1)"
|
|
5254
|
+
},
|
|
5255
|
+
children: "Mirror"
|
|
5256
|
+
})
|
|
5257
|
+
]
|
|
5190
5258
|
})
|
|
5191
5259
|
]
|
|
5192
5260
|
}),
|
|
5193
|
-
e.showDebug &&
|
|
5194
|
-
layers:
|
|
5195
|
-
onToggleLayer: (
|
|
5196
|
-
...
|
|
5197
|
-
[
|
|
5261
|
+
e.showDebug && Be && c && b === "3D" && i(Xr, {
|
|
5262
|
+
layers: nn,
|
|
5263
|
+
onToggleLayer: (g) => to((M) => ({
|
|
5264
|
+
...M,
|
|
5265
|
+
[g]: !M[g]
|
|
5198
5266
|
})),
|
|
5199
|
-
isDoubleShell:
|
|
5267
|
+
isDoubleShell: re
|
|
5200
5268
|
}),
|
|
5201
|
-
|
|
5269
|
+
le && T.length > 0 && y("div", {
|
|
5202
5270
|
style: {
|
|
5203
5271
|
position: "absolute",
|
|
5204
5272
|
top: 16,
|
|
@@ -5218,7 +5286,7 @@ let __tla = (async () => {
|
|
|
5218
5286
|
},
|
|
5219
5287
|
children: [
|
|
5220
5288
|
i("button", {
|
|
5221
|
-
onClick: () =>
|
|
5289
|
+
onClick: () => F("3D"),
|
|
5222
5290
|
style: {
|
|
5223
5291
|
padding: "6px 14px",
|
|
5224
5292
|
fontSize: 13,
|
|
@@ -5232,7 +5300,7 @@ let __tla = (async () => {
|
|
|
5232
5300
|
children: "Orbital"
|
|
5233
5301
|
}),
|
|
5234
5302
|
i("button", {
|
|
5235
|
-
onClick: () =>
|
|
5303
|
+
onClick: () => F("2D"),
|
|
5236
5304
|
style: {
|
|
5237
5305
|
padding: "6px 14px",
|
|
5238
5306
|
fontSize: 13,
|
|
@@ -5262,9 +5330,9 @@ let __tla = (async () => {
|
|
|
5262
5330
|
style: {
|
|
5263
5331
|
padding: "6px 14px",
|
|
5264
5332
|
fontSize: 13,
|
|
5265
|
-
fontWeight:
|
|
5266
|
-
backgroundColor:
|
|
5267
|
-
color:
|
|
5333
|
+
fontWeight: W === "cm" ? 600 : 400,
|
|
5334
|
+
backgroundColor: W === "cm" ? "rgb(12, 67, 173)" : "#fff",
|
|
5335
|
+
color: W === "cm" ? "#fff" : "#666",
|
|
5268
5336
|
border: "none",
|
|
5269
5337
|
cursor: "pointer",
|
|
5270
5338
|
fontFamily: "system-ui, sans-serif"
|
|
@@ -5276,9 +5344,9 @@ let __tla = (async () => {
|
|
|
5276
5344
|
style: {
|
|
5277
5345
|
padding: "6px 14px",
|
|
5278
5346
|
fontSize: 13,
|
|
5279
|
-
fontWeight:
|
|
5280
|
-
backgroundColor:
|
|
5281
|
-
color:
|
|
5347
|
+
fontWeight: W === "inch" ? 600 : 400,
|
|
5348
|
+
backgroundColor: W === "inch" ? "rgb(12, 67, 173)" : "#fff",
|
|
5349
|
+
color: W === "inch" ? "#fff" : "#666",
|
|
5282
5350
|
border: "none",
|
|
5283
5351
|
borderLeft: "1px solid #ccc",
|
|
5284
5352
|
cursor: "pointer",
|
|
@@ -5328,7 +5396,7 @@ let __tla = (async () => {
|
|
|
5328
5396
|
})
|
|
5329
5397
|
]
|
|
5330
5398
|
}),
|
|
5331
|
-
b === "3D" &&
|
|
5399
|
+
b === "3D" && Pe && i("div", {
|
|
5332
5400
|
style: {
|
|
5333
5401
|
display: "flex",
|
|
5334
5402
|
borderRadius: 6,
|
|
@@ -5337,7 +5405,7 @@ let __tla = (async () => {
|
|
|
5337
5405
|
boxShadow: "0 2px 8px rgba(0,0,0,0.1)"
|
|
5338
5406
|
},
|
|
5339
5407
|
children: i("button", {
|
|
5340
|
-
onClick: () =>
|
|
5408
|
+
onClick: () => Lt((g) => !g),
|
|
5341
5409
|
style: {
|
|
5342
5410
|
padding: "6px 14px",
|
|
5343
5411
|
fontSize: 13,
|
|
@@ -5361,13 +5429,13 @@ let __tla = (async () => {
|
|
|
5361
5429
|
},
|
|
5362
5430
|
children: i("button", {
|
|
5363
5431
|
onClick: async () => {
|
|
5364
|
-
const
|
|
5365
|
-
if (!
|
|
5366
|
-
const
|
|
5432
|
+
const g = await Je();
|
|
5433
|
+
if (!g) return;
|
|
5434
|
+
const M = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), D = (L, Y) => {
|
|
5367
5435
|
const X = document.createElement("a");
|
|
5368
|
-
X.href =
|
|
5436
|
+
X.href = L, X.download = Y, X.click();
|
|
5369
5437
|
};
|
|
5370
|
-
D(
|
|
5438
|
+
D(g.frontal_view_png, `measurements_front_${M}.png`), await new Promise((L) => setTimeout(L, 300)), D(g.side_view_png, `measurements_transverse_${M}.png`);
|
|
5371
5439
|
},
|
|
5372
5440
|
style: {
|
|
5373
5441
|
padding: "6px 14px",
|
|
@@ -5391,13 +5459,13 @@ let __tla = (async () => {
|
|
|
5391
5459
|
boxShadow: "0 2px 8px rgba(0,0,0,0.1)"
|
|
5392
5460
|
},
|
|
5393
5461
|
children: i("button", {
|
|
5394
|
-
onClick: () => eo((
|
|
5462
|
+
onClick: () => eo((g) => !g),
|
|
5395
5463
|
style: {
|
|
5396
5464
|
padding: "6px 14px",
|
|
5397
5465
|
fontSize: 13,
|
|
5398
|
-
fontWeight:
|
|
5399
|
-
backgroundColor:
|
|
5400
|
-
color:
|
|
5466
|
+
fontWeight: Be ? 600 : 400,
|
|
5467
|
+
backgroundColor: Be ? "#e65100" : "#fff",
|
|
5468
|
+
color: Be ? "#fff" : "#666",
|
|
5401
5469
|
border: "none",
|
|
5402
5470
|
cursor: "pointer",
|
|
5403
5471
|
fontFamily: "system-ui, sans-serif"
|
|
@@ -5407,15 +5475,15 @@ let __tla = (async () => {
|
|
|
5407
5475
|
})
|
|
5408
5476
|
]
|
|
5409
5477
|
}),
|
|
5410
|
-
c &&
|
|
5411
|
-
detectedUnit:
|
|
5412
|
-
onDismiss: () =>
|
|
5478
|
+
c && U && i(wr, {
|
|
5479
|
+
detectedUnit: J,
|
|
5480
|
+
onDismiss: () => ge(false)
|
|
5413
5481
|
}),
|
|
5414
|
-
c &&
|
|
5415
|
-
isDoubleShell:
|
|
5416
|
-
onDismiss: () =>
|
|
5482
|
+
c && he && le && i(vr, {
|
|
5483
|
+
isDoubleShell: re,
|
|
5484
|
+
onDismiss: () => Se(false)
|
|
5417
5485
|
}),
|
|
5418
|
-
s &&
|
|
5486
|
+
s && le && i("div", {
|
|
5419
5487
|
className: "gm-action-row-container",
|
|
5420
5488
|
style: {
|
|
5421
5489
|
position: "absolute",
|
|
@@ -5465,28 +5533,28 @@ let __tla = (async () => {
|
|
|
5465
5533
|
y("div", {
|
|
5466
5534
|
className: "gm-btn-group",
|
|
5467
5535
|
children: [
|
|
5468
|
-
|
|
5536
|
+
Dt && !Ge && i("button", {
|
|
5469
5537
|
className: "gm-btn gm-btn-secondary",
|
|
5470
5538
|
onClick: () => qe(true),
|
|
5471
5539
|
children: "Edit Measurements"
|
|
5472
5540
|
}),
|
|
5473
|
-
|
|
5541
|
+
Dt && (zo ? i("button", {
|
|
5474
5542
|
className: "gm-btn gm-btn-primary",
|
|
5475
5543
|
disabled: st,
|
|
5476
|
-
onClick: () =>
|
|
5544
|
+
onClick: () => jt("continue"),
|
|
5477
5545
|
children: "Continue \u2192"
|
|
5478
5546
|
}) : y(We, {
|
|
5479
5547
|
children: [
|
|
5480
5548
|
i("button", {
|
|
5481
5549
|
className: "gm-btn gm-btn-primary",
|
|
5482
5550
|
disabled: st,
|
|
5483
|
-
onClick: () =>
|
|
5551
|
+
onClick: () => jt("use_scan"),
|
|
5484
5552
|
children: "Go with Scan"
|
|
5485
5553
|
}),
|
|
5486
5554
|
i("button", {
|
|
5487
5555
|
className: "gm-btn gm-btn-primary",
|
|
5488
5556
|
disabled: st,
|
|
5489
|
-
onClick: () =>
|
|
5557
|
+
onClick: () => jt("use_form_measurements"),
|
|
5490
5558
|
children: "Go with Measurements"
|
|
5491
5559
|
})
|
|
5492
5560
|
]
|
|
@@ -5590,14 +5658,14 @@ let __tla = (async () => {
|
|
|
5590
5658
|
" | ",
|
|
5591
5659
|
V.length,
|
|
5592
5660
|
" pts | ",
|
|
5593
|
-
|
|
5661
|
+
le ? "aligned" : "unaligned",
|
|
5594
5662
|
" | ",
|
|
5595
5663
|
T.length,
|
|
5596
5664
|
" slices"
|
|
5597
5665
|
]
|
|
5598
5666
|
}),
|
|
5599
5667
|
i("button", {
|
|
5600
|
-
onClick: () =>
|
|
5668
|
+
onClick: () => cn([]),
|
|
5601
5669
|
style: {
|
|
5602
5670
|
background: "none",
|
|
5603
5671
|
border: "1px solid #30363d",
|
|
@@ -5621,30 +5689,30 @@ let __tla = (async () => {
|
|
|
5621
5689
|
padding: "4px 10px",
|
|
5622
5690
|
lineHeight: 1.6
|
|
5623
5691
|
},
|
|
5624
|
-
children: _t.map((
|
|
5625
|
-
const D =
|
|
5692
|
+
children: _t.map((g, M) => {
|
|
5693
|
+
const D = g.includes("ERROR") || g.includes("failed"), L = g.includes("warning") || g.includes("WARN"), Y = g.includes("PIPELINE:"), X = g.includes("STATE:");
|
|
5626
5694
|
return i("div", {
|
|
5627
5695
|
style: {
|
|
5628
|
-
color: D ? "#f85149" :
|
|
5696
|
+
color: D ? "#f85149" : L ? "#d29922" : Y ? "#58a6ff" : X ? "#3fb950" : "#8b949e",
|
|
5629
5697
|
whiteSpace: "pre"
|
|
5630
5698
|
},
|
|
5631
|
-
children:
|
|
5632
|
-
},
|
|
5699
|
+
children: g
|
|
5700
|
+
}, M);
|
|
5633
5701
|
})
|
|
5634
5702
|
})
|
|
5635
5703
|
]
|
|
5636
5704
|
})
|
|
5637
5705
|
]
|
|
5638
5706
|
}),
|
|
5639
|
-
no && i(
|
|
5707
|
+
no && i(Lr, {
|
|
5640
5708
|
onSkip: hn,
|
|
5641
|
-
onCancel: () =>
|
|
5709
|
+
onCancel: () => sn(false)
|
|
5642
5710
|
})
|
|
5643
5711
|
]
|
|
5644
5712
|
});
|
|
5645
5713
|
};
|
|
5646
|
-
function
|
|
5647
|
-
return
|
|
5714
|
+
function Yr({ screenshotFnRef: e }) {
|
|
5715
|
+
return Z(() => {
|
|
5648
5716
|
e.current = null;
|
|
5649
5717
|
}, [
|
|
5650
5718
|
e
|
|
@@ -5669,7 +5737,7 @@ let __tla = (async () => {
|
|
|
5669
5737
|
]) t.push(`${n}_below`);
|
|
5670
5738
|
return t;
|
|
5671
5739
|
};
|
|
5672
|
-
|
|
5740
|
+
wt = function(e, o) {
|
|
5673
5741
|
const t = Jn(o), n = {};
|
|
5674
5742
|
for (let s = 0; s < Math.min(e.length, t.length); s++) {
|
|
5675
5743
|
const l = e[s];
|
|
@@ -5677,7 +5745,7 @@ let __tla = (async () => {
|
|
|
5677
5745
|
}
|
|
5678
5746
|
return n;
|
|
5679
5747
|
};
|
|
5680
|
-
|
|
5748
|
+
Kr = function(e, o) {
|
|
5681
5749
|
if (!e) return;
|
|
5682
5750
|
const n = Jn(o).map((s) => {
|
|
5683
5751
|
const l = e[s];
|
|
@@ -5685,7 +5753,7 @@ let __tla = (async () => {
|
|
|
5685
5753
|
});
|
|
5686
5754
|
if (!n.every((s) => s == null)) return n;
|
|
5687
5755
|
};
|
|
5688
|
-
function
|
|
5756
|
+
function Zr(e) {
|
|
5689
5757
|
const o = e.getAttribute("position");
|
|
5690
5758
|
if (!o) return "";
|
|
5691
5759
|
const t = [
|
|
@@ -5706,7 +5774,7 @@ let __tla = (async () => {
|
|
|
5706
5774
|
return t.join(`
|
|
5707
5775
|
`);
|
|
5708
5776
|
}
|
|
5709
|
-
async function
|
|
5777
|
+
async function Ur(e, o) {
|
|
5710
5778
|
for (let t = 0; t < 3; t++) try {
|
|
5711
5779
|
const n = await fetch(e, {
|
|
5712
5780
|
method: "PUT",
|
|
@@ -5745,20 +5813,20 @@ let __tla = (async () => {
|
|
|
5745
5813
|
error: "Upload failed after 3 attempts"
|
|
5746
5814
|
};
|
|
5747
5815
|
}
|
|
5748
|
-
|
|
5749
|
-
const [n, s] =
|
|
5750
|
-
|
|
5816
|
+
ci = ({ request: e, onComplete: o, wasmModule: t }) => {
|
|
5817
|
+
const [n, s] = E(null);
|
|
5818
|
+
Z(() => {
|
|
5751
5819
|
if (t != null) return;
|
|
5752
5820
|
let r = false;
|
|
5753
|
-
const c = async (
|
|
5821
|
+
const c = async (u) => {
|
|
5754
5822
|
try {
|
|
5755
|
-
const
|
|
5756
|
-
await
|
|
5757
|
-
} catch (
|
|
5758
|
-
if (
|
|
5759
|
-
const f = (
|
|
5760
|
-
if (console.warn(`[GirthManagerWidget] WASM load failed (attempt ${
|
|
5761
|
-
} else console.error("[GirthManagerWidget] WASM load failed after 3 attempts:",
|
|
5823
|
+
const p = await import("./geo_wasm-BBuWXukA.js");
|
|
5824
|
+
await p.default(), r || s(p);
|
|
5825
|
+
} catch (p) {
|
|
5826
|
+
if (u < 2 && !r) {
|
|
5827
|
+
const f = (u + 1) * 1e3 + u * 1e3;
|
|
5828
|
+
if (console.warn(`[GirthManagerWidget] WASM load failed (attempt ${u + 1}/3), retrying in ${f}ms...`, p), await new Promise((m) => setTimeout(m, f)), !r) return c(u + 1);
|
|
5829
|
+
} else console.error("[GirthManagerWidget] WASM load failed after 3 attempts:", p);
|
|
5762
5830
|
}
|
|
5763
5831
|
};
|
|
5764
5832
|
return c(0), () => {
|
|
@@ -5767,23 +5835,23 @@ let __tla = (async () => {
|
|
|
5767
5835
|
}, [
|
|
5768
5836
|
t
|
|
5769
5837
|
]);
|
|
5770
|
-
const l = t !== void 0 ? t : n ?? void 0, d =
|
|
5838
|
+
const l = t !== void 0 ? t : n ?? void 0, d = te(() => Kr(e.form_measurements, e.spacing_type), [
|
|
5771
5839
|
e.form_measurements,
|
|
5772
5840
|
e.spacing_type
|
|
5773
5841
|
]), a = async (r) => {
|
|
5774
5842
|
var _a, _b;
|
|
5775
|
-
const c = r.scanMeasurements.map((b) => +(b.modifiedValue ?? b.originalValue).toFixed(1)),
|
|
5776
|
-
let
|
|
5843
|
+
const c = r.scanMeasurements.map((b) => +(b.modifiedValue ?? b.originalValue).toFixed(1)), u = wt(c, e.spacing_type);
|
|
5844
|
+
let p, f;
|
|
5777
5845
|
if (r.formMeasurements) {
|
|
5778
|
-
|
|
5779
|
-
const b = r.scanMeasurements.map((
|
|
5846
|
+
p = wt(r.formMeasurements, e.spacing_type);
|
|
5847
|
+
const b = r.scanMeasurements.map((F, S) => {
|
|
5780
5848
|
var _a2;
|
|
5781
5849
|
const A = (_a2 = r.formMeasurements) == null ? void 0 : _a2[S];
|
|
5782
|
-
return A == null || isNaN(A) ? null : +((
|
|
5850
|
+
return A == null || isNaN(A) ? null : +((F.modifiedValue ?? F.originalValue) - A).toFixed(1);
|
|
5783
5851
|
});
|
|
5784
|
-
f =
|
|
5852
|
+
f = wt(b, e.spacing_type);
|
|
5785
5853
|
}
|
|
5786
|
-
const
|
|
5854
|
+
const m = r.userEnteredMeasurements ? wt(r.userEnteredMeasurements.circumferences, e.spacing_type) : void 0, v = r.decision === "use_scan" || r.decision === "continue", h = v ? u : m ?? p ?? u, x = v ? +r.frontalHeight.toFixed(1) : +(((_a = r.userEnteredMeasurements) == null ? void 0 : _a.frontalHeight) ?? r.frontalHeight).toFixed(1);
|
|
5787
5855
|
let w;
|
|
5788
5856
|
if (e.upload_url) if (!r.alignedGeometry) w = {
|
|
5789
5857
|
success: false,
|
|
@@ -5791,9 +5859,9 @@ let __tla = (async () => {
|
|
|
5791
5859
|
message: "No aligned geometry available \u2014 mesh processing may not have completed."
|
|
5792
5860
|
};
|
|
5793
5861
|
else try {
|
|
5794
|
-
const b =
|
|
5862
|
+
const b = Zr(r.alignedGeometry), F = new Blob([
|
|
5795
5863
|
b
|
|
5796
|
-
]), S = await
|
|
5864
|
+
]), S = await Ur(e.upload_url, F);
|
|
5797
5865
|
w = {
|
|
5798
5866
|
...S,
|
|
5799
5867
|
url: e.upload_url,
|
|
@@ -5814,8 +5882,8 @@ let __tla = (async () => {
|
|
|
5814
5882
|
measurement_source: r.formMeasurements ? "form_provided" : "scan_derived",
|
|
5815
5883
|
is_double_wall: r.isDoubleWall,
|
|
5816
5884
|
is_unit_converted: false,
|
|
5817
|
-
form_measurements:
|
|
5818
|
-
scan_measurements:
|
|
5885
|
+
form_measurements: p,
|
|
5886
|
+
scan_measurements: u,
|
|
5819
5887
|
measurement_variance: f,
|
|
5820
5888
|
scan_url: e.scan_url,
|
|
5821
5889
|
frontal_height: +r.frontalHeight.toFixed(1),
|
|
@@ -5823,7 +5891,7 @@ let __tla = (async () => {
|
|
|
5823
5891
|
transverse_ap: +r.transverseAP.toFixed(1),
|
|
5824
5892
|
decision: r.decision,
|
|
5825
5893
|
skip_reason: r.skipReason,
|
|
5826
|
-
user_measurements:
|
|
5894
|
+
user_measurements: m,
|
|
5827
5895
|
user_frontal_height: (_b = r.userEnteredMeasurements) == null ? void 0 : _b.frontalHeight,
|
|
5828
5896
|
final_measurements: h,
|
|
5829
5897
|
final_frontal_height: x,
|
|
@@ -5844,8 +5912,8 @@ let __tla = (async () => {
|
|
|
5844
5912
|
height: "100%",
|
|
5845
5913
|
display: "flex"
|
|
5846
5914
|
},
|
|
5847
|
-
children: i(
|
|
5848
|
-
config:
|
|
5915
|
+
children: i(Gr, {
|
|
5916
|
+
config: No,
|
|
5849
5917
|
spacingType: e.spacing_type,
|
|
5850
5918
|
scanUrl: e.scan_url,
|
|
5851
5919
|
formMeasurements: d,
|
|
@@ -5856,10 +5924,10 @@ let __tla = (async () => {
|
|
|
5856
5924
|
};
|
|
5857
5925
|
})();
|
|
5858
5926
|
export {
|
|
5859
|
-
|
|
5927
|
+
ci as G,
|
|
5860
5928
|
__tla,
|
|
5861
|
-
|
|
5862
|
-
|
|
5929
|
+
wt as a,
|
|
5930
|
+
Kr as c,
|
|
5863
5931
|
Jn as g,
|
|
5864
|
-
|
|
5932
|
+
Jt as u
|
|
5865
5933
|
};
|