@solid-labs/fab-one-widget 1.0.14 → 1.0.15
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,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as F, jsx as
|
|
1
|
+
import { jsxs as F, jsx as i, Fragment as Ee } from "react/jsx-runtime";
|
|
2
2
|
import { createContext as co, Component as fo, useCallback as Q, useMemo as j, useState as W, memo as uo, useEffect as U, useRef as le, forwardRef as po, createElement as fn } from "react";
|
|
3
3
|
import { useFrame as bn, useThree as wn, Canvas as ho } from "@react-three/fiber";
|
|
4
4
|
import { Html as Ve, Line as de, OrbitControls as Sn } from "@react-three/drei";
|
|
@@ -28,38 +28,38 @@ let __tla = (async () => {
|
|
|
28
28
|
showNavigation: false,
|
|
29
29
|
showToolbar: false,
|
|
30
30
|
showSaveButton: false
|
|
31
|
-
}, wo = co(yo), Ht = mo((
|
|
31
|
+
}, wo = co(yo), Ht = mo((n, r) => ({
|
|
32
32
|
landmarkPoints: [],
|
|
33
33
|
isAligned: false,
|
|
34
34
|
isCut: false,
|
|
35
|
-
addLandmarkPoint: (
|
|
35
|
+
addLandmarkPoint: (t) => n((o) => o.landmarkPoints.length >= 3 ? o : {
|
|
36
36
|
landmarkPoints: [
|
|
37
37
|
...o.landmarkPoints,
|
|
38
|
-
|
|
38
|
+
t
|
|
39
39
|
]
|
|
40
40
|
}),
|
|
41
|
-
removeLandmarkPoint: (
|
|
42
|
-
landmarkPoints: o.landmarkPoints.filter((
|
|
41
|
+
removeLandmarkPoint: (t) => n((o) => ({
|
|
42
|
+
landmarkPoints: o.landmarkPoints.filter((s, l) => l !== t)
|
|
43
43
|
})),
|
|
44
|
-
clearLandmarkPoints: () =>
|
|
44
|
+
clearLandmarkPoints: () => n({
|
|
45
45
|
landmarkPoints: [],
|
|
46
46
|
isAligned: false,
|
|
47
47
|
isCut: false
|
|
48
48
|
}),
|
|
49
|
-
updateLandmarkPositions: (
|
|
50
|
-
landmarkPoints: o.landmarkPoints.map((
|
|
51
|
-
...
|
|
52
|
-
position:
|
|
49
|
+
updateLandmarkPositions: (t) => n((o) => ({
|
|
50
|
+
landmarkPoints: o.landmarkPoints.map((s, l) => ({
|
|
51
|
+
...s,
|
|
52
|
+
position: t[l] ?? s.position
|
|
53
53
|
}))
|
|
54
54
|
})),
|
|
55
|
-
setAligned: (
|
|
56
|
-
isAligned:
|
|
55
|
+
setAligned: (t) => n({
|
|
56
|
+
isAligned: t
|
|
57
57
|
}),
|
|
58
|
-
setCut: (
|
|
59
|
-
isCut:
|
|
58
|
+
setCut: (t) => n({
|
|
59
|
+
isCut: t
|
|
60
60
|
}),
|
|
61
61
|
isSelectionComplete: () => r().landmarkPoints.length === 3,
|
|
62
|
-
reset: () =>
|
|
62
|
+
reset: () => n({
|
|
63
63
|
landmarkPoints: [],
|
|
64
64
|
isAligned: false,
|
|
65
65
|
isCut: false
|
|
@@ -70,28 +70,28 @@ let __tla = (async () => {
|
|
|
70
70
|
0.5,
|
|
71
71
|
-0.5
|
|
72
72
|
];
|
|
73
|
-
function Co(
|
|
73
|
+
function Co(n) {
|
|
74
74
|
var _a;
|
|
75
|
-
const r =
|
|
75
|
+
const r = n.match(/^v\s+\S+\s+\S+\s+\S+(.*)$/m);
|
|
76
76
|
if (!r || !((_a = r[1]) == null ? void 0 : _a.trim().includes(" "))) return null;
|
|
77
|
-
const
|
|
78
|
-
`), o = [],
|
|
77
|
+
const t = n.split(`
|
|
78
|
+
`), o = [], s = [];
|
|
79
79
|
let l = false;
|
|
80
|
-
for (const c of
|
|
80
|
+
for (const c of t) if (c.startsWith("v ")) {
|
|
81
81
|
const a = c.trim().split(/\s+/);
|
|
82
82
|
if (a.length >= 7) {
|
|
83
83
|
o.push(parseFloat(a[1]), parseFloat(a[2]), parseFloat(a[3]));
|
|
84
84
|
let e = parseFloat(a[4]), m = parseFloat(a[5]), d = parseFloat(a[6]);
|
|
85
|
-
(e > 1 || m > 1 || d > 1) && (e /= 255, m /= 255, d /= 255),
|
|
86
|
-
} else a.length >= 4 && (o.push(parseFloat(a[1]), parseFloat(a[2]), parseFloat(a[3])),
|
|
85
|
+
(e > 1 || m > 1 || d > 1) && (e /= 255, m /= 255, d /= 255), s.push(e, m, d), l = true;
|
|
86
|
+
} else a.length >= 4 && (o.push(parseFloat(a[1]), parseFloat(a[2]), parseFloat(a[3])), s.push(0, 0, 0));
|
|
87
87
|
}
|
|
88
88
|
return l ? {
|
|
89
89
|
positions: new Float32Array(o),
|
|
90
|
-
colors: new Float32Array(
|
|
90
|
+
colors: new Float32Array(s)
|
|
91
91
|
} : null;
|
|
92
92
|
}
|
|
93
|
-
function zo(
|
|
94
|
-
const
|
|
93
|
+
function zo(n, r, t, o) {
|
|
94
|
+
const s = n.getAttribute("position"), l = s.count, c = new Float32Array(l * 3), a = r.length / 3;
|
|
95
95
|
let e = 1 / 0, m = 1 / 0, d = 1 / 0, f = -1 / 0, u = -1 / 0, x = -1 / 0;
|
|
96
96
|
for (let D = 0; D < a; D++) {
|
|
97
97
|
const E = r[D * 3] * o, V = r[D * 3 + 1] * o, G = r[D * 3 + 2] * o;
|
|
@@ -104,7 +104,7 @@ let __tla = (async () => {
|
|
|
104
104
|
re || (re = [], _.set(fe, re)), re.push(D);
|
|
105
105
|
}
|
|
106
106
|
for (let D = 0; D < l; D++) {
|
|
107
|
-
const E =
|
|
107
|
+
const E = s.getX(D), V = s.getY(D), G = s.getZ(D), q = Math.min(k - 1, Math.max(0, Math.floor((E + S) / h))), ye = Math.min(k - 1, Math.max(0, Math.floor((V + A) / z))), ae = Math.min(k - 1, Math.max(0, Math.floor((G + w) / L)));
|
|
108
108
|
let fe = 1 / 0, re = 0;
|
|
109
109
|
for (let ee = 0; ee <= k && fe > 0; ee++) {
|
|
110
110
|
for (let Y = -ee; Y <= ee; Y++) for (let ue = -ee; ue <= ee; ue++) for (let Z = -ee; Z <= ee; Z++) {
|
|
@@ -119,9 +119,9 @@ let __tla = (async () => {
|
|
|
119
119
|
}
|
|
120
120
|
if (fe < 1 / 0) break;
|
|
121
121
|
}
|
|
122
|
-
c[D * 3] =
|
|
122
|
+
c[D * 3] = t[re * 3], c[D * 3 + 1] = t[re * 3 + 1], c[D * 3 + 2] = t[re * 3 + 2];
|
|
123
123
|
}
|
|
124
|
-
|
|
124
|
+
n.setAttribute("color", new $.Float32BufferAttribute(c, 3));
|
|
125
125
|
}
|
|
126
126
|
const un = {
|
|
127
127
|
debug: 0,
|
|
@@ -131,36 +131,36 @@ let __tla = (async () => {
|
|
|
131
131
|
};
|
|
132
132
|
let Mn = "warn", An = null;
|
|
133
133
|
const ce = {
|
|
134
|
-
setLevel(
|
|
135
|
-
Mn =
|
|
134
|
+
setLevel(n) {
|
|
135
|
+
Mn = n;
|
|
136
136
|
},
|
|
137
|
-
setHandler(
|
|
138
|
-
An =
|
|
137
|
+
setHandler(n) {
|
|
138
|
+
An = n;
|
|
139
139
|
},
|
|
140
|
-
debug(
|
|
141
|
-
ut("debug",
|
|
140
|
+
debug(n, r, t) {
|
|
141
|
+
ut("debug", n, r, t);
|
|
142
142
|
},
|
|
143
|
-
info(
|
|
144
|
-
ut("info",
|
|
143
|
+
info(n, r, t) {
|
|
144
|
+
ut("info", n, r, t);
|
|
145
145
|
},
|
|
146
|
-
warn(
|
|
147
|
-
ut("warn",
|
|
146
|
+
warn(n, r, t) {
|
|
147
|
+
ut("warn", n, r, t);
|
|
148
148
|
},
|
|
149
|
-
error(
|
|
150
|
-
ut("error",
|
|
149
|
+
error(n, r, t) {
|
|
150
|
+
ut("error", n, r, t);
|
|
151
151
|
}
|
|
152
152
|
};
|
|
153
|
-
function ut(
|
|
154
|
-
if (un[
|
|
155
|
-
const
|
|
156
|
-
|
|
157
|
-
|
|
153
|
+
function ut(n, r, t, o) {
|
|
154
|
+
if (un[n] < un[Mn]) return;
|
|
155
|
+
const s = `[${r}]`, l = o !== void 0 ? [
|
|
156
|
+
s,
|
|
157
|
+
t,
|
|
158
158
|
o
|
|
159
159
|
] : [
|
|
160
|
-
|
|
161
|
-
|
|
160
|
+
s,
|
|
161
|
+
t
|
|
162
162
|
];
|
|
163
|
-
switch (
|
|
163
|
+
switch (n) {
|
|
164
164
|
case "debug":
|
|
165
165
|
console.debug(...l);
|
|
166
166
|
break;
|
|
@@ -174,30 +174,30 @@ let __tla = (async () => {
|
|
|
174
174
|
console.error(...l);
|
|
175
175
|
break;
|
|
176
176
|
}
|
|
177
|
-
An == null ? void 0 : An(
|
|
177
|
+
An == null ? void 0 : An(n, r, t, o);
|
|
178
178
|
}
|
|
179
|
-
function mt(
|
|
180
|
-
const r =
|
|
179
|
+
function mt(n) {
|
|
180
|
+
const r = n.getAttribute("position"), t = new Float32Array(r.array), o = n.getIndex();
|
|
181
181
|
if (o) return {
|
|
182
|
-
positions:
|
|
182
|
+
positions: t,
|
|
183
183
|
indices: new Uint32Array(o.array)
|
|
184
184
|
};
|
|
185
|
-
const
|
|
186
|
-
for (let c = 0; c <
|
|
185
|
+
const s = t.length / 3, l = new Uint32Array(s);
|
|
186
|
+
for (let c = 0; c < s; c++) l[c] = c;
|
|
187
187
|
return {
|
|
188
|
-
positions:
|
|
188
|
+
positions: t,
|
|
189
189
|
indices: l
|
|
190
190
|
};
|
|
191
191
|
}
|
|
192
|
-
function kn(
|
|
193
|
-
const
|
|
194
|
-
return
|
|
192
|
+
function kn(n, r) {
|
|
193
|
+
const t = new $.BufferGeometry();
|
|
194
|
+
return t.setAttribute("position", new $.Float32BufferAttribute(n, 3)), t.setIndex(new $.BufferAttribute(r, 1)), t.computeVertexNormals(), t;
|
|
195
195
|
}
|
|
196
|
-
async function Mo(
|
|
196
|
+
async function Mo(n, r, t) {
|
|
197
197
|
try {
|
|
198
|
-
const o = Co(
|
|
199
|
-
|
|
200
|
-
const l = new zn().parse(
|
|
198
|
+
const o = Co(n);
|
|
199
|
+
t == null ? void 0 : t("Parsing mesh...");
|
|
200
|
+
const l = new zn().parse(n);
|
|
201
201
|
let c = null;
|
|
202
202
|
if (l.traverse((y) => {
|
|
203
203
|
y.isMesh && !c && (c = y.geometry);
|
|
@@ -207,10 +207,10 @@ let __tla = (async () => {
|
|
|
207
207
|
for (let y = 0; y < Math.min(a.length, 300); y++) if (!isFinite(a[y])) return ce.error("wasm", `Invalid position data: NaN/Infinity at index ${y}`), null;
|
|
208
208
|
const m = a.length / 3;
|
|
209
209
|
for (let y = 0; y < Math.min(e.length, 300); y++) if (e[y] >= m) return ce.error("wasm", `Out-of-bounds index: ${e[y]} >= ${m}`), null;
|
|
210
|
-
|
|
210
|
+
t == null ? void 0 : t("Processing mesh (WASM)...");
|
|
211
211
|
const d = r.preprocess_mesh(a, e, 10, 1e-4, 500), f = d.positions(), u = d.indices(), x = d.unit_converted(), C = d.detected_unit(), p = d.log();
|
|
212
212
|
if (ce.debug("wasm", "preprocess result", p), f.length === 0) return null;
|
|
213
|
-
|
|
213
|
+
t == null ? void 0 : t("Building geometry...");
|
|
214
214
|
const g = kn(f, u);
|
|
215
215
|
if (o) {
|
|
216
216
|
const y = x ? 1e3 : 1;
|
|
@@ -226,46 +226,46 @@ let __tla = (async () => {
|
|
|
226
226
|
return ce.error("wasm", "Processing failed", o), null;
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
|
-
function Ao(
|
|
230
|
-
const
|
|
229
|
+
function Ao(n) {
|
|
230
|
+
const t = new zn().parse(n);
|
|
231
231
|
let o = null;
|
|
232
|
-
return
|
|
233
|
-
|
|
232
|
+
return t.traverse((s) => {
|
|
233
|
+
s.isMesh && !o && (o = s.geometry);
|
|
234
234
|
}), o;
|
|
235
235
|
}
|
|
236
|
-
async function Et(
|
|
237
|
-
const r = await
|
|
238
|
-
if (!
|
|
236
|
+
async function Et(n) {
|
|
237
|
+
const r = await n.arrayBuffer(), s = new xo().parse(r).getAttribute("position");
|
|
238
|
+
if (!s || s.count === 0) throw new Error("Empty STL geometry");
|
|
239
239
|
const l = [];
|
|
240
|
-
for (let c = 0; c <
|
|
241
|
-
for (let c = 0; c <
|
|
240
|
+
for (let c = 0; c < s.count; c++) l.push(`v ${s.getX(c)} ${s.getY(c)} ${s.getZ(c)}`);
|
|
241
|
+
for (let c = 0; c < s.count; c += 3) l.push(`f ${c + 1} ${c + 2} ${c + 3}`);
|
|
242
242
|
return l.join(`
|
|
243
243
|
`);
|
|
244
244
|
}
|
|
245
|
-
function ko(
|
|
246
|
-
const
|
|
247
|
-
return `${Math.round(
|
|
245
|
+
function ko(n, r) {
|
|
246
|
+
const t = 1 / r;
|
|
247
|
+
return `${Math.round(n.x * t)}_${Math.round(n.y * t)}_${Math.round(n.z * t)}`;
|
|
248
248
|
}
|
|
249
|
-
function Fo(
|
|
250
|
-
if (!
|
|
251
|
-
const
|
|
252
|
-
for (const o of
|
|
253
|
-
return
|
|
249
|
+
function Fo(n, r) {
|
|
250
|
+
if (!n.length) return [];
|
|
251
|
+
const t = [];
|
|
252
|
+
for (const o of n) (t.length === 0 || t[t.length - 1].distanceTo(o) > r) && t.push(o.clone());
|
|
253
|
+
return t.length > 2 && t[0].distanceTo(t[t.length - 1]) > r && t.push(t[0].clone()), t;
|
|
254
254
|
}
|
|
255
|
-
function Ge(
|
|
255
|
+
function Ge(n) {
|
|
256
256
|
let r = 0;
|
|
257
|
-
for (let
|
|
257
|
+
for (let t = 0; t < n.length - 1; t++) r += n[t].distanceTo(n[t + 1]);
|
|
258
258
|
return r;
|
|
259
259
|
}
|
|
260
|
-
function Fn(
|
|
261
|
-
if (!
|
|
262
|
-
const o = /* @__PURE__ */ new Map(),
|
|
260
|
+
function Fn(n, r = 1e-3, t = false) {
|
|
261
|
+
if (!n.length) return [];
|
|
262
|
+
const o = /* @__PURE__ */ new Map(), s = (f) => {
|
|
263
263
|
const u = ko(f, r);
|
|
264
264
|
let x = o.get(u);
|
|
265
265
|
return x || (x = f.clone(), o.set(u, x)), x;
|
|
266
|
-
}, l =
|
|
267
|
-
a:
|
|
268
|
-
b:
|
|
266
|
+
}, l = n.map((f) => ({
|
|
267
|
+
a: s(f.a),
|
|
268
|
+
b: s(f.b)
|
|
269
269
|
})), c = [];
|
|
270
270
|
for (; l.length; ) {
|
|
271
271
|
const f = l.pop(), u = [
|
|
@@ -289,7 +289,7 @@ let __tla = (async () => {
|
|
|
289
289
|
C.length > 1 && c.push(C);
|
|
290
290
|
}
|
|
291
291
|
if (!c.length) return [];
|
|
292
|
-
if (
|
|
292
|
+
if (t) {
|
|
293
293
|
c.sort((x, C) => Ge(C) - Ge(x));
|
|
294
294
|
const f = Ge(c[0]), u = c.filter((x) => Ge(x) >= f * 0.3);
|
|
295
295
|
return u[u.length - 1] ?? c[0];
|
|
@@ -306,21 +306,21 @@ let __tla = (async () => {
|
|
|
306
306
|
}
|
|
307
307
|
return m;
|
|
308
308
|
}
|
|
309
|
-
function pn(
|
|
310
|
-
const
|
|
309
|
+
function pn(n, r, t, o = false) {
|
|
310
|
+
const s = new xt(new M(0, 1, 0), -t), l = [], c = new vn();
|
|
311
311
|
c.setFromBufferAttribute(r.getAttribute("position"));
|
|
312
312
|
const a = {
|
|
313
313
|
linePoints: [],
|
|
314
314
|
lineLength: 0,
|
|
315
|
-
rightmostPoint: new M(0,
|
|
315
|
+
rightmostPoint: new M(0, t, 0)
|
|
316
316
|
};
|
|
317
|
-
if (!
|
|
317
|
+
if (!s.intersectsBox(c)) return a;
|
|
318
318
|
const e = new Cn(), m = new M();
|
|
319
|
-
|
|
320
|
-
intersectsBounds: (p) =>
|
|
319
|
+
n.shapecast({
|
|
320
|
+
intersectsBounds: (p) => s.intersectsBox(p),
|
|
321
321
|
intersectsTriangle: (p) => {
|
|
322
322
|
const g = [];
|
|
323
|
-
e.set(p.a, p.b),
|
|
323
|
+
e.set(p.a, p.b), s.intersectLine(e, m) && g.push(m.clone()), e.set(p.b, p.c), s.intersectLine(e, m) && g.push(m.clone()), e.set(p.c, p.a), s.intersectLine(e, m) && g.push(m.clone()), g.length === 2 && l.push({
|
|
324
324
|
a: g[0],
|
|
325
325
|
b: g[1]
|
|
326
326
|
});
|
|
@@ -329,7 +329,7 @@ let __tla = (async () => {
|
|
|
329
329
|
const d = Fn(l, $t, o);
|
|
330
330
|
if (d.length < 2) return a;
|
|
331
331
|
const f = Ge(d);
|
|
332
|
-
let u = -1 / 0, x = new M(0,
|
|
332
|
+
let u = -1 / 0, x = new M(0, t, 0);
|
|
333
333
|
for (const p of d) p.x > u && (u = p.x, x = p.clone());
|
|
334
334
|
const C = d.length > 2 && d[0].distanceTo(d[d.length - 1]) < $t * 10;
|
|
335
335
|
return {
|
|
@@ -339,27 +339,27 @@ let __tla = (async () => {
|
|
|
339
339
|
isClosed: C
|
|
340
340
|
};
|
|
341
341
|
}
|
|
342
|
-
function je(
|
|
343
|
-
const
|
|
344
|
-
if (
|
|
345
|
-
ce.debug("slice", `y=${
|
|
346
|
-
let l =
|
|
342
|
+
function je(n, r, t, o = false) {
|
|
343
|
+
const s = pn(n, r, t, o);
|
|
344
|
+
if (s.isClosed && s.linePoints.length >= 3) return s;
|
|
345
|
+
ce.debug("slice", `y=${t.toFixed(2)} failed (pts=${s.linePoints.length}, closed=${s.isClosed}), retrying...`);
|
|
346
|
+
let l = s;
|
|
347
347
|
for (const c of vo) {
|
|
348
|
-
const a = pn(
|
|
349
|
-
if (a.isClosed && a.linePoints.length >= 3) return ce.debug("slice", `y=${
|
|
348
|
+
const a = pn(n, r, t + c, o);
|
|
349
|
+
if (a.isClosed && a.linePoints.length >= 3) return ce.debug("slice", `y=${t.toFixed(2)} recovered with offset ${c > 0 ? "+" : ""}${c}mm (pts=${a.linePoints.length}, len=${a.lineLength.toFixed(1)}mm)`), a;
|
|
350
350
|
a.linePoints.length > l.linePoints.length && (l = a);
|
|
351
351
|
}
|
|
352
|
-
return ce.warn("slice", `y=${
|
|
352
|
+
return ce.warn("slice", `y=${t.toFixed(2)} all retries exhausted (pts=${l.linePoints.length}, closed=${l.isClosed})`), l;
|
|
353
353
|
}
|
|
354
|
-
function Po(
|
|
355
|
-
const
|
|
356
|
-
if (l.setFromBufferAttribute(r.getAttribute("position")), !
|
|
354
|
+
function Po(n, r, t, o) {
|
|
355
|
+
const s = new xt().setFromNormalAndCoplanarPoint(o.clone().normalize(), t), l = new vn();
|
|
356
|
+
if (l.setFromBufferAttribute(r.getAttribute("position")), !s.intersectsBox(l)) return 0;
|
|
357
357
|
const c = [], a = new Cn(), e = new M();
|
|
358
|
-
|
|
359
|
-
intersectsBounds: (d) =>
|
|
358
|
+
n.shapecast({
|
|
359
|
+
intersectsBounds: (d) => s.intersectsBox(d),
|
|
360
360
|
intersectsTriangle: (d) => {
|
|
361
361
|
const f = [];
|
|
362
|
-
a.set(d.a, d.b),
|
|
362
|
+
a.set(d.a, d.b), s.intersectLine(a, e) && f.push(e.clone()), a.set(d.b, d.c), s.intersectLine(a, e) && f.push(e.clone()), a.set(d.c, d.a), s.intersectLine(a, e) && f.push(e.clone()), f.length === 2 && c.push({
|
|
363
363
|
a: f[0],
|
|
364
364
|
b: f[1]
|
|
365
365
|
});
|
|
@@ -368,18 +368,18 @@ let __tla = (async () => {
|
|
|
368
368
|
const m = Fn(c, $t);
|
|
369
369
|
return Ge(m);
|
|
370
370
|
}
|
|
371
|
-
function Ot(
|
|
372
|
-
return new yt(
|
|
371
|
+
function Ot(n) {
|
|
372
|
+
return new yt(n, {
|
|
373
373
|
maxLeafTris: bt
|
|
374
374
|
});
|
|
375
375
|
}
|
|
376
|
-
function Lo(
|
|
377
|
-
const
|
|
376
|
+
function Lo(n, r, t, o) {
|
|
377
|
+
const s = n.getIndex(), l = s ? s.count / 3 : 0;
|
|
378
378
|
if (l < 10) return {
|
|
379
379
|
valid: false,
|
|
380
380
|
reason: `Geometry is empty or degenerate (${l} faces)`
|
|
381
381
|
};
|
|
382
|
-
const c = r -
|
|
382
|
+
const c = r - t;
|
|
383
383
|
if (c < 4) return {
|
|
384
384
|
valid: false,
|
|
385
385
|
reason: `Height too small (${c.toFixed(1)}mm < 4mm)`
|
|
@@ -388,19 +388,19 @@ let __tla = (async () => {
|
|
|
388
388
|
valid: false,
|
|
389
389
|
reason: `Height too large (${c.toFixed(1)}mm > 1000mm)`
|
|
390
390
|
};
|
|
391
|
-
const a = new yt(
|
|
391
|
+
const a = new yt(n, {
|
|
392
392
|
maxLeafTris: bt
|
|
393
|
-
}), e = je(a,
|
|
393
|
+
}), e = je(a, n, r);
|
|
394
394
|
if (e.lineLength === 0) return {
|
|
395
395
|
valid: false,
|
|
396
396
|
reason: "No circumference at green point \u2014 mesh may be empty at that height"
|
|
397
397
|
};
|
|
398
398
|
const m = r - o;
|
|
399
|
-
if (m <=
|
|
399
|
+
if (m <= t) return {
|
|
400
400
|
valid: true,
|
|
401
401
|
reason: ""
|
|
402
402
|
};
|
|
403
|
-
const d = je(a,
|
|
403
|
+
const d = je(a, n, m);
|
|
404
404
|
if (e.lineLength > 0 && d.lineLength > 0) {
|
|
405
405
|
const u = e.lineLength / d.lineLength;
|
|
406
406
|
if (u < 0.5) return {
|
|
@@ -409,8 +409,8 @@ let __tla = (async () => {
|
|
|
409
409
|
};
|
|
410
410
|
}
|
|
411
411
|
const f = r - o * 2;
|
|
412
|
-
if (f >
|
|
413
|
-
const u = je(a,
|
|
412
|
+
if (f > t) {
|
|
413
|
+
const u = je(a, n, f);
|
|
414
414
|
if (d.lineLength > 0 && u.lineLength > 0) {
|
|
415
415
|
const x = d.lineLength / u.lineLength;
|
|
416
416
|
if (x < 0.5) return {
|
|
@@ -425,13 +425,13 @@ let __tla = (async () => {
|
|
|
425
425
|
};
|
|
426
426
|
}
|
|
427
427
|
const Fe = "pipeline";
|
|
428
|
-
function _o(
|
|
428
|
+
function _o(n, r, t, o) {
|
|
429
429
|
var _a, _b, _c, _d;
|
|
430
|
-
const
|
|
430
|
+
const s = n.geometry.clone(), l = r.map((a) => ({
|
|
431
431
|
...a
|
|
432
432
|
})), c = o.wasmModule;
|
|
433
433
|
try {
|
|
434
|
-
let a =
|
|
434
|
+
let a = n.geometry, e = l.map((H) => new M(H.position.x, H.position.y, H.position.z));
|
|
435
435
|
const m = e[0], d = e[1];
|
|
436
436
|
if (!c) {
|
|
437
437
|
o.onStatus("Aligning mesh (JS fallback)..."), ce.warn(Fe, "WASM not available, using JS fallback alignment");
|
|
@@ -471,7 +471,7 @@ let __tla = (async () => {
|
|
|
471
471
|
z: X.z
|
|
472
472
|
}))), o.setAligned(true), o.setCut(true), o.setAdjustedStartY(null), o.setAdjustedEndY(null), o.setOriginalEndY(e[1].y + 2 * gt);
|
|
473
473
|
const N = new M();
|
|
474
|
-
a.computeBoundingBox(), a.boundingBox.getSize(N), o.setModelSize(Math.max(N.x, N.y, N.z)),
|
|
474
|
+
a.computeBoundingBox(), a.boundingBox.getSize(N), o.setModelSize(Math.max(N.x, N.y, N.z)), s.dispose();
|
|
475
475
|
return;
|
|
476
476
|
}
|
|
477
477
|
const { positions: f, indices: u } = mt(a), x = new Float32Array([
|
|
@@ -542,7 +542,7 @@ let __tla = (async () => {
|
|
|
542
542
|
ce.info(Fe, "Refinement complete", H.details()), k = H.positions(), h = H.mpt(), z = H.origin();
|
|
543
543
|
}
|
|
544
544
|
const re = a.getAttribute("color"), ee = kn(k, u);
|
|
545
|
-
re && ee.setAttribute("color", re), a.dispose(), a = ee,
|
|
545
|
+
re && ee.setAttribute("color", re), a.dispose(), a = ee, n.geometry = a, a.computeVertexNormals(), a.computeBoundingBox(), e[0] = new M(z[0], z[1], z[2]), e[1] = new M(h[0], h[1], h[2]), o.onStatus("Setting blue point...");
|
|
546
546
|
const Y = new M(e[0].x, e[0].y, e[0].z);
|
|
547
547
|
e.push(Y), o.addLandmarkPoint({
|
|
548
548
|
faceIndex: -1,
|
|
@@ -594,10 +594,10 @@ let __tla = (async () => {
|
|
|
594
594
|
(_d = o.setWasmSlices) == null ? void 0 : _d.call(o, Ne);
|
|
595
595
|
}
|
|
596
596
|
o.onStatus("Validating results...");
|
|
597
|
-
const pe = e[1].y, me = e[0].y, he = Lo(a, pe, me,
|
|
598
|
-
he.valid || ce.warn(Fe, `Validation: ${he.reason}`), o.setClippedReferenceGeometry ? (
|
|
597
|
+
const pe = e[1].y, me = e[0].y, he = Lo(a, pe, me, t);
|
|
598
|
+
he.valid || ce.warn(Fe, `Validation: ${he.reason}`), o.setClippedReferenceGeometry ? (s.computeVertexNormals(), o.setClippedReferenceGeometry(s)) : s.dispose();
|
|
599
599
|
} catch (a) {
|
|
600
|
-
ce.error(Fe, "Processing failed", a), o.setError(a instanceof Error ? a.message : "Failed to process mesh."),
|
|
600
|
+
ce.error(Fe, "Processing failed", a), o.setError(a instanceof Error ? a.message : "Failed to process mesh."), s.dispose();
|
|
601
601
|
}
|
|
602
602
|
}
|
|
603
603
|
class Io extends fo {
|
|
@@ -615,8 +615,8 @@ let __tla = (async () => {
|
|
|
615
615
|
error: r
|
|
616
616
|
};
|
|
617
617
|
}
|
|
618
|
-
componentDidCatch(r,
|
|
619
|
-
console.error("[ErrorBoundary] Caught error:", r,
|
|
618
|
+
componentDidCatch(r, t) {
|
|
619
|
+
console.error("[ErrorBoundary] Caught error:", r, t.componentStack);
|
|
620
620
|
}
|
|
621
621
|
render() {
|
|
622
622
|
return this.state.error ? this.props.fallback ? this.props.fallback(this.state.error, this.reset) : F("div", {
|
|
@@ -631,7 +631,7 @@ let __tla = (async () => {
|
|
|
631
631
|
fontFamily: "system-ui, sans-serif"
|
|
632
632
|
},
|
|
633
633
|
children: [
|
|
634
|
-
|
|
634
|
+
i("div", {
|
|
635
635
|
style: {
|
|
636
636
|
fontSize: 16,
|
|
637
637
|
fontWeight: 600,
|
|
@@ -640,7 +640,7 @@ let __tla = (async () => {
|
|
|
640
640
|
},
|
|
641
641
|
children: "Something went wrong"
|
|
642
642
|
}),
|
|
643
|
-
|
|
643
|
+
i("div", {
|
|
644
644
|
style: {
|
|
645
645
|
fontSize: 13,
|
|
646
646
|
color: "#666",
|
|
@@ -649,7 +649,7 @@ let __tla = (async () => {
|
|
|
649
649
|
},
|
|
650
650
|
children: this.state.error.message
|
|
651
651
|
}),
|
|
652
|
-
|
|
652
|
+
i("button", {
|
|
653
653
|
onClick: this.reset,
|
|
654
654
|
style: {
|
|
655
655
|
padding: "8px 20px",
|
|
@@ -667,7 +667,7 @@ let __tla = (async () => {
|
|
|
667
667
|
}) : this.props.children;
|
|
668
668
|
}
|
|
669
669
|
}
|
|
670
|
-
const Do = ({ message:
|
|
670
|
+
const Do = ({ message: n, onDismiss: r }) => F("div", {
|
|
671
671
|
style: {
|
|
672
672
|
position: "absolute",
|
|
673
673
|
top: 16,
|
|
@@ -689,23 +689,23 @@ let __tla = (async () => {
|
|
|
689
689
|
flex: 1
|
|
690
690
|
},
|
|
691
691
|
children: [
|
|
692
|
-
|
|
692
|
+
i("div", {
|
|
693
693
|
style: {
|
|
694
694
|
fontWeight: "bold",
|
|
695
695
|
marginBottom: 4
|
|
696
696
|
},
|
|
697
697
|
children: "Error"
|
|
698
698
|
}),
|
|
699
|
-
|
|
699
|
+
i("div", {
|
|
700
700
|
style: {
|
|
701
701
|
fontSize: 12,
|
|
702
702
|
opacity: 0.9
|
|
703
703
|
},
|
|
704
|
-
children:
|
|
704
|
+
children: n
|
|
705
705
|
})
|
|
706
706
|
]
|
|
707
707
|
}),
|
|
708
|
-
|
|
708
|
+
i("button", {
|
|
709
709
|
onClick: r,
|
|
710
710
|
style: {
|
|
711
711
|
background: "none",
|
|
@@ -720,7 +720,7 @@ let __tla = (async () => {
|
|
|
720
720
|
children: "x"
|
|
721
721
|
})
|
|
722
722
|
]
|
|
723
|
-
}), hn = ({ message:
|
|
723
|
+
}), hn = ({ message: n }) => F("div", {
|
|
724
724
|
style: {
|
|
725
725
|
position: "absolute",
|
|
726
726
|
top: 0,
|
|
@@ -735,7 +735,7 @@ let __tla = (async () => {
|
|
|
735
735
|
zIndex: 100
|
|
736
736
|
},
|
|
737
737
|
children: [
|
|
738
|
-
|
|
738
|
+
i("div", {
|
|
739
739
|
style: {
|
|
740
740
|
width: 48,
|
|
741
741
|
height: 48,
|
|
@@ -745,34 +745,34 @@ let __tla = (async () => {
|
|
|
745
745
|
animation: "spin 1s linear infinite"
|
|
746
746
|
}
|
|
747
747
|
}),
|
|
748
|
-
|
|
748
|
+
n && i("div", {
|
|
749
749
|
style: {
|
|
750
750
|
marginTop: 16,
|
|
751
751
|
color: "#fff",
|
|
752
752
|
fontSize: 14
|
|
753
753
|
},
|
|
754
|
-
children:
|
|
754
|
+
children: n
|
|
755
755
|
}),
|
|
756
|
-
|
|
756
|
+
i("style", {
|
|
757
757
|
children: "@keyframes spin { to { transform: rotate(360deg); } }"
|
|
758
758
|
})
|
|
759
759
|
]
|
|
760
760
|
});
|
|
761
|
-
function Ro(
|
|
762
|
-
const
|
|
761
|
+
function Ro(n, r, t, o) {
|
|
762
|
+
const s = new M().subVectors(t, r), l = new M().subVectors(o, r), c = new M().subVectors(n, r), a = s.dot(s), e = s.dot(l), m = s.dot(c), d = l.dot(l), f = l.dot(c), u = 1 / (a * d - e * e), x = (d * m - e * f) * u, C = (a * f - e * m) * u;
|
|
763
763
|
return {
|
|
764
764
|
u: 1 - x - C,
|
|
765
765
|
v: x,
|
|
766
766
|
w: C
|
|
767
767
|
};
|
|
768
768
|
}
|
|
769
|
-
const Wo = ({ mesh:
|
|
769
|
+
const Wo = ({ mesh: n, maxPoints: r = 2, meshColor: t = "#c8c8c8", meshOpacity: o = 1, frontFaceOnly: s = false, doubleShellTransparency: l = false }) => {
|
|
770
770
|
const { addLandmarkPoint: c, landmarkPoints: a } = Ht(), e = Q((x) => {
|
|
771
771
|
if (a.length >= r) return;
|
|
772
772
|
x.stopPropagation();
|
|
773
773
|
const C = x.intersections[0], p = C == null ? void 0 : C.faceIndex;
|
|
774
774
|
if (!C || p == null) return;
|
|
775
|
-
const g =
|
|
775
|
+
const g = n.geometry, y = g.index;
|
|
776
776
|
let P;
|
|
777
777
|
y ? P = [
|
|
778
778
|
y.getX(p * 3),
|
|
@@ -784,7 +784,7 @@ let __tla = (async () => {
|
|
|
784
784
|
p * 3 + 2
|
|
785
785
|
];
|
|
786
786
|
const v = g.getAttribute("position"), S = new M().fromBufferAttribute(v, P[0]), A = new M().fromBufferAttribute(v, P[1]), w = new M().fromBufferAttribute(v, P[2]);
|
|
787
|
-
S.applyMatrix4(
|
|
787
|
+
S.applyMatrix4(n.matrixWorld), A.applyMatrix4(n.matrixWorld), w.applyMatrix4(n.matrixWorld);
|
|
788
788
|
const k = C.point, h = Ro(k, S, A, w), z = {
|
|
789
789
|
faceIndex: p,
|
|
790
790
|
vertexIndices: P,
|
|
@@ -797,15 +797,15 @@ let __tla = (async () => {
|
|
|
797
797
|
};
|
|
798
798
|
c(z);
|
|
799
799
|
}, [
|
|
800
|
-
|
|
800
|
+
n,
|
|
801
801
|
c,
|
|
802
802
|
a.length,
|
|
803
803
|
r
|
|
804
|
-
]), m = j(() => !!
|
|
805
|
-
|
|
804
|
+
]), m = j(() => !!n.geometry.getAttribute("color"), [
|
|
805
|
+
n
|
|
806
806
|
]), d = l ? Math.min(o, 0.65) : o, f = d < 1, u = j(() => new $.MeshStandardMaterial({
|
|
807
|
-
color: m ? "#ffffff" :
|
|
808
|
-
side:
|
|
807
|
+
color: m ? "#ffffff" : t,
|
|
808
|
+
side: s ? $.FrontSide : $.DoubleSide,
|
|
809
809
|
roughness: 0.6,
|
|
810
810
|
metalness: 0.1,
|
|
811
811
|
transparent: f,
|
|
@@ -813,46 +813,46 @@ let __tla = (async () => {
|
|
|
813
813
|
depthWrite: !l,
|
|
814
814
|
vertexColors: m
|
|
815
815
|
}), [
|
|
816
|
-
|
|
816
|
+
t,
|
|
817
817
|
d,
|
|
818
818
|
f,
|
|
819
819
|
m,
|
|
820
|
-
|
|
820
|
+
s,
|
|
821
821
|
l
|
|
822
822
|
]);
|
|
823
|
-
return
|
|
824
|
-
object:
|
|
823
|
+
return i("primitive", {
|
|
824
|
+
object: n,
|
|
825
825
|
onClick: e,
|
|
826
826
|
material: u,
|
|
827
827
|
renderOrder: l ? 0 : void 0
|
|
828
828
|
});
|
|
829
|
-
}, Bo = ({ point:
|
|
829
|
+
}, Bo = ({ point: n, index: r, markerSize: t, color: o, label: s }) => {
|
|
830
830
|
const [l, c] = W(false);
|
|
831
831
|
return F("mesh", {
|
|
832
832
|
position: [
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
833
|
+
n.position.x,
|
|
834
|
+
n.position.y,
|
|
835
|
+
n.position.z
|
|
836
836
|
],
|
|
837
837
|
onPointerOver: () => c(true),
|
|
838
838
|
onPointerOut: () => c(false),
|
|
839
839
|
children: [
|
|
840
|
-
|
|
840
|
+
i("sphereGeometry", {
|
|
841
841
|
args: [
|
|
842
|
-
|
|
842
|
+
t,
|
|
843
843
|
16,
|
|
844
844
|
16
|
|
845
845
|
]
|
|
846
846
|
}),
|
|
847
|
-
|
|
847
|
+
i("meshBasicMaterial", {
|
|
848
848
|
color: o
|
|
849
849
|
}),
|
|
850
|
-
l &&
|
|
850
|
+
l && i(Ve, {
|
|
851
851
|
center: true,
|
|
852
852
|
style: {
|
|
853
853
|
pointerEvents: "none"
|
|
854
854
|
},
|
|
855
|
-
children:
|
|
855
|
+
children: i("div", {
|
|
856
856
|
style: {
|
|
857
857
|
padding: "3px 8px",
|
|
858
858
|
backgroundColor: "rgba(0, 0, 0, 0.75)",
|
|
@@ -863,13 +863,13 @@ let __tla = (async () => {
|
|
|
863
863
|
whiteSpace: "nowrap",
|
|
864
864
|
transform: "translateY(-24px)"
|
|
865
865
|
},
|
|
866
|
-
children:
|
|
866
|
+
children: s
|
|
867
867
|
})
|
|
868
868
|
})
|
|
869
869
|
]
|
|
870
870
|
}, r);
|
|
871
|
-
}, Eo = ({ modelSize:
|
|
872
|
-
const { landmarkPoints:
|
|
871
|
+
}, Eo = ({ modelSize: n, labels: r }) => {
|
|
872
|
+
const { landmarkPoints: t } = Ht(), o = n * 0.02, s = [
|
|
873
873
|
"#44ff44",
|
|
874
874
|
"#ff4444",
|
|
875
875
|
"#4444ff"
|
|
@@ -878,45 +878,45 @@ let __tla = (async () => {
|
|
|
878
878
|
"Origin",
|
|
879
879
|
"Cut Plane"
|
|
880
880
|
];
|
|
881
|
-
return
|
|
882
|
-
children:
|
|
881
|
+
return i(Ee, {
|
|
882
|
+
children: t.map((a, e) => i(Bo, {
|
|
883
883
|
point: a,
|
|
884
884
|
index: e,
|
|
885
885
|
markerSize: o,
|
|
886
|
-
color:
|
|
886
|
+
color: s[e],
|
|
887
887
|
label: c[e]
|
|
888
888
|
}, e))
|
|
889
889
|
});
|
|
890
890
|
};
|
|
891
|
-
function Pn(
|
|
892
|
-
return j(() =>
|
|
891
|
+
function Pn(n) {
|
|
892
|
+
return j(() => n ? new yt(n, {
|
|
893
893
|
maxLeafTris: bt
|
|
894
894
|
}) : null, [
|
|
895
|
-
|
|
895
|
+
n
|
|
896
896
|
]);
|
|
897
897
|
}
|
|
898
|
-
const gn = (
|
|
899
|
-
const
|
|
900
|
-
return
|
|
901
|
-
}, mn = new $.Color("#8BC34A"), xn = new $.Color("#FFC107"), To = new $.Color("#FF5722"), $o = (
|
|
902
|
-
if (
|
|
903
|
-
if (
|
|
904
|
-
const
|
|
905
|
-
return mn.clone().lerp(xn,
|
|
898
|
+
const gn = (n, r) => {
|
|
899
|
+
const t = Math.abs(n - r);
|
|
900
|
+
return t <= 7 ? "#8BC34A" : t <= 20 ? "#FFC107" : "#FF5722";
|
|
901
|
+
}, mn = new $.Color("#8BC34A"), xn = new $.Color("#FFC107"), To = new $.Color("#FF5722"), $o = (n) => {
|
|
902
|
+
if (n <= 7) return mn.clone();
|
|
903
|
+
if (n <= 20) {
|
|
904
|
+
const t = (n - 7) / 13;
|
|
905
|
+
return mn.clone().lerp(xn, t);
|
|
906
906
|
}
|
|
907
|
-
const r = Math.min((
|
|
907
|
+
const r = Math.min((n - 20) / 20, 1);
|
|
908
908
|
return xn.clone().lerp(To, r);
|
|
909
|
-
}, Oo = (
|
|
910
|
-
const
|
|
911
|
-
for (let e = 0; e <
|
|
912
|
-
const m =
|
|
913
|
-
if (o[e * 6] = m.x, o[e * 6 + 1] = m.y, o[e * 6 + 2] = m.z,
|
|
909
|
+
}, Oo = (n, r) => {
|
|
910
|
+
const t = n.length, o = new Float32Array(t * 2 * 3), s = new Float32Array(t * 2 * 3), l = [];
|
|
911
|
+
for (let e = 0; e < t; e++) {
|
|
912
|
+
const m = n[e], d = r[e], f = m.distanceTo(d), u = $o(f);
|
|
913
|
+
if (o[e * 6] = m.x, o[e * 6 + 1] = m.y, o[e * 6 + 2] = m.z, s[e * 6] = u.r, s[e * 6 + 1] = u.g, s[e * 6 + 2] = u.b, o[e * 6 + 3] = d.x, o[e * 6 + 4] = d.y, o[e * 6 + 5] = d.z, s[e * 6 + 3] = u.r, s[e * 6 + 4] = u.g, s[e * 6 + 5] = u.b, e < t - 1) {
|
|
914
914
|
const x = e * 2, C = x + 1, p = (e + 1) * 2, g = p + 1;
|
|
915
915
|
l.push(x, C, p, C, g, p);
|
|
916
916
|
}
|
|
917
917
|
}
|
|
918
918
|
const c = new $.BufferGeometry();
|
|
919
|
-
c.setAttribute("position", new $.Float32BufferAttribute(o, 3)), c.setAttribute("color", new $.Float32BufferAttribute(
|
|
919
|
+
c.setAttribute("position", new $.Float32BufferAttribute(o, 3)), c.setAttribute("color", new $.Float32BufferAttribute(s, 3)), c.setIndex(l);
|
|
920
920
|
const a = new $.MeshBasicMaterial({
|
|
921
921
|
vertexColors: true,
|
|
922
922
|
transparent: true,
|
|
@@ -926,11 +926,11 @@ let __tla = (async () => {
|
|
|
926
926
|
depthWrite: false
|
|
927
927
|
});
|
|
928
928
|
return new $.Mesh(c, a);
|
|
929
|
-
}, Ho = ({ bvh:
|
|
930
|
-
const u = j(() => d && f != null ? null : je(
|
|
931
|
-
t,
|
|
932
|
-
r,
|
|
929
|
+
}, Ho = ({ bvh: n, geometry: r, yPosition: t, color: o = "#00ff00", labelX: s, onDataChange: l, displayUnit: c = "mm", useInnerSurface: a = false, formValue: e, lineWidth: m = 1.5, wasmLoopPoints: d, wasmCircumference: f }) => {
|
|
930
|
+
const u = j(() => d && f != null ? null : je(n, r, t, a), [
|
|
933
931
|
n,
|
|
932
|
+
r,
|
|
933
|
+
t,
|
|
934
934
|
a,
|
|
935
935
|
d,
|
|
936
936
|
f
|
|
@@ -968,13 +968,13 @@ let __tla = (async () => {
|
|
|
968
968
|
P
|
|
969
969
|
]), U(() => {
|
|
970
970
|
C > 0 && (l == null ? void 0 : l({
|
|
971
|
-
yPosition:
|
|
971
|
+
yPosition: t,
|
|
972
972
|
originalValue: C,
|
|
973
973
|
modifiedValue: null
|
|
974
974
|
}));
|
|
975
975
|
}, [
|
|
976
976
|
C,
|
|
977
|
-
|
|
977
|
+
t,
|
|
978
978
|
l
|
|
979
979
|
]), bn(({ camera: v }) => {
|
|
980
980
|
if (!y.current || x.length < 2) return;
|
|
@@ -989,14 +989,14 @@ let __tla = (async () => {
|
|
|
989
989
|
const E = w.x * D.x + w.z * D.z;
|
|
990
990
|
E > k && (k = E, h = D);
|
|
991
991
|
}
|
|
992
|
-
const z =
|
|
992
|
+
const z = s * 0.35, L = new M(h.x + w.x * z, t, h.z + w.z * z);
|
|
993
993
|
y.current.position.copy(L);
|
|
994
994
|
const _ = P.geometry.getAttribute("position");
|
|
995
995
|
_.setXYZ(0, h.x, h.y, h.z), _.setXYZ(1, L.x, L.y, L.z), _.needsUpdate = true;
|
|
996
996
|
}), x.length < 2 ? null : F("group", {
|
|
997
997
|
renderOrder: 10,
|
|
998
998
|
children: [
|
|
999
|
-
|
|
999
|
+
i(de, {
|
|
1000
1000
|
points: x,
|
|
1001
1001
|
color: o,
|
|
1002
1002
|
lineWidth: m,
|
|
@@ -1005,11 +1005,11 @@ let __tla = (async () => {
|
|
|
1005
1005
|
transparent: true,
|
|
1006
1006
|
renderOrder: 10
|
|
1007
1007
|
}),
|
|
1008
|
-
g &&
|
|
1008
|
+
g && i("primitive", {
|
|
1009
1009
|
object: g,
|
|
1010
1010
|
renderOrder: 10
|
|
1011
1011
|
}),
|
|
1012
|
-
p && e != null && e !== 0 &&
|
|
1012
|
+
p && e != null && e !== 0 && i(de, {
|
|
1013
1013
|
points: p,
|
|
1014
1014
|
color: gn(C, e),
|
|
1015
1015
|
lineWidth: 2.5,
|
|
@@ -1022,13 +1022,13 @@ let __tla = (async () => {
|
|
|
1022
1022
|
opacity: 0.8,
|
|
1023
1023
|
renderOrder: 10
|
|
1024
1024
|
}),
|
|
1025
|
-
|
|
1025
|
+
i("primitive", {
|
|
1026
1026
|
object: P,
|
|
1027
1027
|
renderOrder: 10
|
|
1028
1028
|
}),
|
|
1029
|
-
|
|
1029
|
+
i("group", {
|
|
1030
1030
|
ref: y,
|
|
1031
|
-
children:
|
|
1031
|
+
children: i(Ve, {
|
|
1032
1032
|
zIndexRange: [
|
|
1033
1033
|
100,
|
|
1034
1034
|
0
|
|
@@ -1057,7 +1057,7 @@ let __tla = (async () => {
|
|
|
1057
1057
|
borderRadius: e != null && e !== 0 ? "4px 0 0 4px" : 4
|
|
1058
1058
|
},
|
|
1059
1059
|
children: [
|
|
1060
|
-
|
|
1060
|
+
i("span", {
|
|
1061
1061
|
style: {
|
|
1062
1062
|
fontSize: 14,
|
|
1063
1063
|
color: "#fff",
|
|
@@ -1067,7 +1067,7 @@ let __tla = (async () => {
|
|
|
1067
1067
|
},
|
|
1068
1068
|
children: c === "inch" ? (C / 25.4).toFixed(2) : C.toFixed(1)
|
|
1069
1069
|
}),
|
|
1070
|
-
|
|
1070
|
+
i("span", {
|
|
1071
1071
|
style: {
|
|
1072
1072
|
fontSize: 11,
|
|
1073
1073
|
color: "rgba(255,255,255,0.6)",
|
|
@@ -1090,7 +1090,7 @@ let __tla = (async () => {
|
|
|
1090
1090
|
borderLeft: "1px solid rgba(255,255,255,0.12)"
|
|
1091
1091
|
},
|
|
1092
1092
|
children: [
|
|
1093
|
-
S &&
|
|
1093
|
+
S && i("span", {
|
|
1094
1094
|
style: {
|
|
1095
1095
|
fontSize: 10,
|
|
1096
1096
|
color: A,
|
|
@@ -1130,8 +1130,8 @@ let __tla = (async () => {
|
|
|
1130
1130
|
})
|
|
1131
1131
|
]
|
|
1132
1132
|
});
|
|
1133
|
-
}, jo = uo(Ho), Vo = ({ mesh:
|
|
1134
|
-
const u = le(/* @__PURE__ */ new Map()), x =
|
|
1133
|
+
}, jo = uo(Ho), Vo = ({ mesh: n, startY: r, endY: t, spacing: o, modelSize: s, onMeasurementsChange: l, reverseOrder: c = false, displayUnit: a = "mm", useInnerSurface: e = false, formMeasurements: m, originY: d, wasmSlices: f }) => {
|
|
1134
|
+
const u = le(/* @__PURE__ */ new Map()), x = n.geometry, C = Pn(x), p = j(() => {
|
|
1135
1135
|
if (f) {
|
|
1136
1136
|
let k = [
|
|
1137
1137
|
...f.yValues
|
|
@@ -1146,12 +1146,12 @@ let __tla = (async () => {
|
|
|
1146
1146
|
return c ? k.sort((h, z) => z - h) : k.sort((h, z) => h - z), k;
|
|
1147
1147
|
}
|
|
1148
1148
|
const A = [];
|
|
1149
|
-
if (c) for (let w =
|
|
1150
|
-
else for (let w = r; w <=
|
|
1149
|
+
if (c) for (let w = t; w >= r; w -= o) A.push(w);
|
|
1150
|
+
else for (let w = r; w <= t; w += o) A.push(w);
|
|
1151
1151
|
return A;
|
|
1152
1152
|
}, [
|
|
1153
1153
|
r,
|
|
1154
|
-
|
|
1154
|
+
t,
|
|
1155
1155
|
o,
|
|
1156
1156
|
c,
|
|
1157
1157
|
f
|
|
@@ -1195,7 +1195,7 @@ let __tla = (async () => {
|
|
|
1195
1195
|
]);
|
|
1196
1196
|
const P = [
|
|
1197
1197
|
"#5B9BD5"
|
|
1198
|
-
], v =
|
|
1198
|
+
], v = s * So, S = Q((A) => {
|
|
1199
1199
|
if (y) return;
|
|
1200
1200
|
u.current.set(A.yPosition, A);
|
|
1201
1201
|
const w = Array.from(u.current.values()).sort((k, h) => c ? h.yPosition - k.yPosition : k.yPosition - h.yPosition);
|
|
@@ -1205,8 +1205,8 @@ let __tla = (async () => {
|
|
|
1205
1205
|
c,
|
|
1206
1206
|
y
|
|
1207
1207
|
]);
|
|
1208
|
-
return C ?
|
|
1209
|
-
children: p.map((A, w) =>
|
|
1208
|
+
return C ? i(Ee, {
|
|
1209
|
+
children: p.map((A, w) => i(jo, {
|
|
1210
1210
|
bvh: C,
|
|
1211
1211
|
geometry: x,
|
|
1212
1212
|
yPosition: A,
|
|
@@ -1221,14 +1221,14 @@ let __tla = (async () => {
|
|
|
1221
1221
|
wasmCircumference: y == null ? void 0 : y.get(A)
|
|
1222
1222
|
}, A))
|
|
1223
1223
|
}) : null;
|
|
1224
|
-
}, No = (
|
|
1225
|
-
const
|
|
1226
|
-
return
|
|
1227
|
-
}, Xo = ({ mesh:
|
|
1224
|
+
}, No = (n, r) => {
|
|
1225
|
+
const t = Math.abs(n - r);
|
|
1226
|
+
return t <= 7 ? "#4caf50" : t <= 15 ? "#ff9800" : "#f44336";
|
|
1227
|
+
}, Xo = ({ mesh: n, greenY: r, modelSize: t, displayUnit: o = "mm", bottomY: s, formHeight: l }) => {
|
|
1228
1228
|
var _a;
|
|
1229
|
-
const c =
|
|
1229
|
+
const c = n.geometry;
|
|
1230
1230
|
c.computeBoundingBox();
|
|
1231
|
-
const a =
|
|
1231
|
+
const a = s ?? ((_a = c.boundingBox) == null ? void 0 : _a.min.y) ?? 0, e = r - a, m = t * 0.4, d = t * 0.03, f = le(null);
|
|
1232
1232
|
bn(({ camera: w }) => {
|
|
1233
1233
|
if (!f.current) return;
|
|
1234
1234
|
const k = new M();
|
|
@@ -1245,7 +1245,7 @@ let __tla = (async () => {
|
|
|
1245
1245
|
return F("group", {
|
|
1246
1246
|
ref: f,
|
|
1247
1247
|
children: [
|
|
1248
|
-
|
|
1248
|
+
i(de, {
|
|
1249
1249
|
points: [
|
|
1250
1250
|
u,
|
|
1251
1251
|
x
|
|
@@ -1253,7 +1253,7 @@ let __tla = (async () => {
|
|
|
1253
1253
|
color: "#888888",
|
|
1254
1254
|
lineWidth: 1.5
|
|
1255
1255
|
}),
|
|
1256
|
-
|
|
1256
|
+
i(de, {
|
|
1257
1257
|
points: [
|
|
1258
1258
|
p,
|
|
1259
1259
|
g
|
|
@@ -1261,7 +1261,7 @@ let __tla = (async () => {
|
|
|
1261
1261
|
color: "#888888",
|
|
1262
1262
|
lineWidth: 1.5
|
|
1263
1263
|
}),
|
|
1264
|
-
|
|
1264
|
+
i(de, {
|
|
1265
1265
|
points: [
|
|
1266
1266
|
y,
|
|
1267
1267
|
P
|
|
@@ -1269,9 +1269,9 @@ let __tla = (async () => {
|
|
|
1269
1269
|
color: "#888888",
|
|
1270
1270
|
lineWidth: 1.5
|
|
1271
1271
|
}),
|
|
1272
|
-
|
|
1272
|
+
i("mesh", {
|
|
1273
1273
|
position: C,
|
|
1274
|
-
children:
|
|
1274
|
+
children: i(Ve, {
|
|
1275
1275
|
center: true,
|
|
1276
1276
|
style: {
|
|
1277
1277
|
pointerEvents: "none"
|
|
@@ -1321,7 +1321,7 @@ let __tla = (async () => {
|
|
|
1321
1321
|
pointerEvents: "none"
|
|
1322
1322
|
},
|
|
1323
1323
|
children: [
|
|
1324
|
-
Math.abs(S) > 0.5 &&
|
|
1324
|
+
Math.abs(S) > 0.5 && i("span", {
|
|
1325
1325
|
style: {
|
|
1326
1326
|
fontSize: 10,
|
|
1327
1327
|
color: A,
|
|
@@ -1360,9 +1360,9 @@ let __tla = (async () => {
|
|
|
1360
1360
|
})
|
|
1361
1361
|
]
|
|
1362
1362
|
});
|
|
1363
|
-
}, Go = ({ modelSize:
|
|
1364
|
-
const { set: m, size: d, camera: f, invalidate: u } = wn(), x = le(false), C = le(
|
|
1365
|
-
if (!o ||
|
|
1363
|
+
}, Go = ({ modelSize: n, isAligned: r, isCut: t, mesh: o, viewMode: s, sliceY: l, landmarkCount: c = 0, measurementGeometry: a, resetCameraToFrontRef: e }) => {
|
|
1364
|
+
const { set: m, size: d, camera: f, invalidate: u } = wn(), x = le(false), C = le(s), p = le(new M()), g = le(null), y = le(c), P = le(r), v = le(t), S = le(a), A = le(0), w = Q(() => {
|
|
1365
|
+
if (!o || n <= 0) return null;
|
|
1366
1366
|
const h = a ?? o.geometry;
|
|
1367
1367
|
h.computeBoundingBox();
|
|
1368
1368
|
const z = h.boundingBox, L = new M();
|
|
@@ -1371,11 +1371,11 @@ let __tla = (async () => {
|
|
|
1371
1371
|
z.getSize(_), p.current.copy(_);
|
|
1372
1372
|
const D = d.width / d.height, E = Math.max(_.y, _.x / D) * 1.6, V = E * D, G = L.y - _.y * 0.05;
|
|
1373
1373
|
A.current = G;
|
|
1374
|
-
const q = new $.OrthographicCamera(-V / 2, V / 2, E / 2, -E / 2, 0.1,
|
|
1375
|
-
return q.position.set(0, G,
|
|
1374
|
+
const q = new $.OrthographicCamera(-V / 2, V / 2, E / 2, -E / 2, 0.1, n * 10);
|
|
1375
|
+
return q.position.set(0, G, n * 2), q.lookAt(0, G, 0), q;
|
|
1376
1376
|
}, [
|
|
1377
1377
|
o,
|
|
1378
|
-
|
|
1378
|
+
n,
|
|
1379
1379
|
d,
|
|
1380
1380
|
a
|
|
1381
1381
|
]);
|
|
@@ -1401,15 +1401,15 @@ let __tla = (async () => {
|
|
|
1401
1401
|
u
|
|
1402
1402
|
]);
|
|
1403
1403
|
return U(() => {
|
|
1404
|
-
if (
|
|
1404
|
+
if (n > 0 && !x.current && !r) {
|
|
1405
1405
|
x.current = true;
|
|
1406
|
-
const h = new $.PerspectiveCamera(50, d.width / d.height, 0.1,
|
|
1407
|
-
h.position.set(
|
|
1406
|
+
const h = new $.PerspectiveCamera(50, d.width / d.height, 0.1, n * 10);
|
|
1407
|
+
h.position.set(n * 0.3, n * 0.2, n * 1.5), h.lookAt(0, 0, 0), m({
|
|
1408
1408
|
camera: h
|
|
1409
1409
|
}), requestAnimationFrame(() => k(h));
|
|
1410
1410
|
}
|
|
1411
1411
|
}, [
|
|
1412
|
-
|
|
1412
|
+
n,
|
|
1413
1413
|
d,
|
|
1414
1414
|
m,
|
|
1415
1415
|
r,
|
|
@@ -1423,26 +1423,26 @@ let __tla = (async () => {
|
|
|
1423
1423
|
f,
|
|
1424
1424
|
k
|
|
1425
1425
|
]), U(() => {
|
|
1426
|
-
const h = P.current !== r, z = v.current !==
|
|
1427
|
-
if (P.current = r, v.current =
|
|
1426
|
+
const h = P.current !== r, z = v.current !== t, L = !S.current && !!a;
|
|
1427
|
+
if (P.current = r, v.current = t, S.current = a, !h && !z && !L || !r || s !== "3D") return;
|
|
1428
1428
|
const _ = w();
|
|
1429
1429
|
_ && m({
|
|
1430
1430
|
camera: _
|
|
1431
1431
|
});
|
|
1432
1432
|
}, [
|
|
1433
1433
|
r,
|
|
1434
|
-
|
|
1435
|
-
|
|
1434
|
+
t,
|
|
1435
|
+
s,
|
|
1436
1436
|
a,
|
|
1437
1437
|
w,
|
|
1438
1438
|
m
|
|
1439
1439
|
]), U(() => {
|
|
1440
|
-
if (C.current ===
|
|
1440
|
+
if (C.current === s) return;
|
|
1441
1441
|
const h = C.current;
|
|
1442
|
-
if (C.current =
|
|
1443
|
-
if (
|
|
1442
|
+
if (C.current = s, !(!r || !o || n <= 0)) {
|
|
1443
|
+
if (s === "2D" && l != null) {
|
|
1444
1444
|
g.current = f;
|
|
1445
|
-
const z = o.geometry, L = z.getAttribute("position"), _ = L.array, D =
|
|
1445
|
+
const z = o.geometry, L = z.getAttribute("position"), _ = L.array, D = n * 0.15;
|
|
1446
1446
|
let E = 1 / 0, V = -1 / 0, G = 1 / 0, q = -1 / 0, ye = false;
|
|
1447
1447
|
for (let he = 0; he < L.count; he++) if (Math.abs(_[he * 3 + 1] - l) < D) {
|
|
1448
1448
|
const H = _[he * 3], ne = _[he * 3 + 2];
|
|
@@ -1456,8 +1456,8 @@ let __tla = (async () => {
|
|
|
1456
1456
|
const ae = (E + V) / 2, fe = (G + q) / 2, re = d.width / d.height, ee = 1.4, Y = (V - E) * ee, ue = (q - G) * ee;
|
|
1457
1457
|
let Z, pe;
|
|
1458
1458
|
Y / ue > re ? (Z = Y, pe = Y / re) : (pe = ue, Z = ue * re);
|
|
1459
|
-
const me = new $.OrthographicCamera(-Z / 2, Z / 2, pe / 2, -pe / 2, 0.1,
|
|
1460
|
-
me.position.set(ae, l +
|
|
1459
|
+
const me = new $.OrthographicCamera(-Z / 2, Z / 2, pe / 2, -pe / 2, 0.1, n * 10);
|
|
1460
|
+
me.position.set(ae, l + n * 2, fe), me.up.set(0, 0, -1), me.lookAt(ae, l, fe), m({
|
|
1461
1461
|
camera: me
|
|
1462
1462
|
});
|
|
1463
1463
|
} else if (h === "2D") if (g.current) m({
|
|
@@ -1471,11 +1471,11 @@ let __tla = (async () => {
|
|
|
1471
1471
|
}
|
|
1472
1472
|
}
|
|
1473
1473
|
}, [
|
|
1474
|
-
|
|
1474
|
+
s,
|
|
1475
1475
|
l,
|
|
1476
1476
|
r,
|
|
1477
1477
|
o,
|
|
1478
|
-
|
|
1478
|
+
n,
|
|
1479
1479
|
d,
|
|
1480
1480
|
m,
|
|
1481
1481
|
f,
|
|
@@ -1483,9 +1483,9 @@ let __tla = (async () => {
|
|
|
1483
1483
|
]), U(() => {
|
|
1484
1484
|
if (!r || !f || !f.isOrthographicCamera) return;
|
|
1485
1485
|
const h = f;
|
|
1486
|
-
if (
|
|
1486
|
+
if (s === "2D") {
|
|
1487
1487
|
if (!o || l == null) return;
|
|
1488
|
-
const z = o.geometry, L = z.getAttribute("position"), _ = L.array, D =
|
|
1488
|
+
const z = o.geometry, L = z.getAttribute("position"), _ = L.array, D = n * 0.15;
|
|
1489
1489
|
let E = 1 / 0, V = -1 / 0, G = 1 / 0, q = -1 / 0, ye = false;
|
|
1490
1490
|
for (let Z = 0; Z < L.count; Z++) if (Math.abs(_[Z * 3 + 1] - l) < D) {
|
|
1491
1491
|
const pe = _[Z * 3], me = _[Z * 3 + 2];
|
|
@@ -1509,15 +1509,15 @@ let __tla = (async () => {
|
|
|
1509
1509
|
d.height,
|
|
1510
1510
|
r,
|
|
1511
1511
|
f,
|
|
1512
|
-
|
|
1512
|
+
s,
|
|
1513
1513
|
o
|
|
1514
1514
|
]), null;
|
|
1515
|
-
}, Yo = ({ mesh:
|
|
1515
|
+
}, Yo = ({ mesh: n, isDragging: r }) => {
|
|
1516
1516
|
var _a;
|
|
1517
|
-
const
|
|
1518
|
-
|
|
1517
|
+
const t = n.geometry;
|
|
1518
|
+
t.computeBoundingBox();
|
|
1519
1519
|
const o = new M();
|
|
1520
|
-
return (_a =
|
|
1520
|
+
return (_a = t.boundingBox) == null ? void 0 : _a.getCenter(o), i(Sn, {
|
|
1521
1521
|
enableDamping: false,
|
|
1522
1522
|
enablePan: false,
|
|
1523
1523
|
minPolarAngle: Math.PI * 0.15,
|
|
@@ -1531,7 +1531,7 @@ let __tla = (async () => {
|
|
|
1531
1531
|
o.z
|
|
1532
1532
|
]
|
|
1533
1533
|
});
|
|
1534
|
-
}, Zo = ({ wasAutoScaled:
|
|
1534
|
+
}, Zo = ({ wasAutoScaled: n, onDismiss: r }) => F("div", {
|
|
1535
1535
|
style: {
|
|
1536
1536
|
position: "absolute",
|
|
1537
1537
|
bottom: 16,
|
|
@@ -1542,21 +1542,21 @@ let __tla = (async () => {
|
|
|
1542
1542
|
gap: 10,
|
|
1543
1543
|
padding: "10px 14px",
|
|
1544
1544
|
maxWidth: 320,
|
|
1545
|
-
backgroundColor:
|
|
1545
|
+
backgroundColor: n ? "rgba(30, 70, 160, 0.92)" : "rgba(40, 40, 40, 0.88)",
|
|
1546
1546
|
borderRadius: 8,
|
|
1547
1547
|
boxShadow: "0 2px 12px rgba(0,0,0,0.15)",
|
|
1548
1548
|
fontFamily: "system-ui, sans-serif"
|
|
1549
1549
|
},
|
|
1550
1550
|
children: [
|
|
1551
|
-
|
|
1551
|
+
i("span", {
|
|
1552
1552
|
style: {
|
|
1553
1553
|
fontSize: 13,
|
|
1554
1554
|
color: "#fff",
|
|
1555
1555
|
lineHeight: "20px"
|
|
1556
1556
|
},
|
|
1557
|
-
children:
|
|
1557
|
+
children: n ? "Units detected as meters - converted to mm" : "Units detected as mm"
|
|
1558
1558
|
}),
|
|
1559
|
-
|
|
1559
|
+
i("button", {
|
|
1560
1560
|
onClick: r,
|
|
1561
1561
|
style: {
|
|
1562
1562
|
background: "none",
|
|
@@ -1572,7 +1572,7 @@ let __tla = (async () => {
|
|
|
1572
1572
|
children: "X"
|
|
1573
1573
|
})
|
|
1574
1574
|
]
|
|
1575
|
-
}), Ko = ({ isDoubleShell:
|
|
1575
|
+
}), Ko = ({ isDoubleShell: n, onDismiss: r }) => F("div", {
|
|
1576
1576
|
style: {
|
|
1577
1577
|
position: "absolute",
|
|
1578
1578
|
bottom: 68,
|
|
@@ -1583,21 +1583,21 @@ let __tla = (async () => {
|
|
|
1583
1583
|
gap: 10,
|
|
1584
1584
|
padding: "10px 14px",
|
|
1585
1585
|
maxWidth: 320,
|
|
1586
|
-
backgroundColor:
|
|
1586
|
+
backgroundColor: n ? "rgba(130, 80, 20, 0.92)" : "rgba(40, 40, 40, 0.88)",
|
|
1587
1587
|
borderRadius: 8,
|
|
1588
1588
|
boxShadow: "0 2px 12px rgba(0,0,0,0.15)",
|
|
1589
1589
|
fontFamily: "system-ui, sans-serif"
|
|
1590
1590
|
},
|
|
1591
1591
|
children: [
|
|
1592
|
-
|
|
1592
|
+
i("span", {
|
|
1593
1593
|
style: {
|
|
1594
1594
|
fontSize: 13,
|
|
1595
1595
|
color: "#fff",
|
|
1596
1596
|
lineHeight: "20px"
|
|
1597
1597
|
},
|
|
1598
|
-
children:
|
|
1598
|
+
children: n ? "Double shell scan detected" : "Single shell scan detected"
|
|
1599
1599
|
}),
|
|
1600
|
-
|
|
1600
|
+
i("button", {
|
|
1601
1601
|
onClick: r,
|
|
1602
1602
|
style: {
|
|
1603
1603
|
background: "none",
|
|
@@ -1613,7 +1613,7 @@ let __tla = (async () => {
|
|
|
1613
1613
|
children: "X"
|
|
1614
1614
|
})
|
|
1615
1615
|
]
|
|
1616
|
-
}), Uo = ({ steps:
|
|
1616
|
+
}), Uo = ({ steps: n, currentStep: r, accentColor: t = "rgb(12, 67, 173)" }) => i("div", {
|
|
1617
1617
|
style: {
|
|
1618
1618
|
backgroundColor: "#fff",
|
|
1619
1619
|
borderBottom: "1px solid #e0e0e0",
|
|
@@ -1622,7 +1622,7 @@ let __tla = (async () => {
|
|
|
1622
1622
|
padding: "24px 24px",
|
|
1623
1623
|
flexShrink: 0
|
|
1624
1624
|
},
|
|
1625
|
-
children:
|
|
1625
|
+
children: n.map((o, s) => {
|
|
1626
1626
|
const l = o.number < r, c = o.number === r;
|
|
1627
1627
|
return F("div", {
|
|
1628
1628
|
style: {
|
|
@@ -1639,12 +1639,12 @@ let __tla = (async () => {
|
|
|
1639
1639
|
cursor: "default"
|
|
1640
1640
|
},
|
|
1641
1641
|
children: [
|
|
1642
|
-
|
|
1642
|
+
i("div", {
|
|
1643
1643
|
style: {
|
|
1644
1644
|
width: 24,
|
|
1645
1645
|
height: 24,
|
|
1646
1646
|
borderRadius: "50%",
|
|
1647
|
-
backgroundColor: l || c ?
|
|
1647
|
+
backgroundColor: l || c ? t : "rgba(0, 0, 0, 0.38)",
|
|
1648
1648
|
color: "#fff",
|
|
1649
1649
|
display: "flex",
|
|
1650
1650
|
alignItems: "center",
|
|
@@ -1655,7 +1655,7 @@ let __tla = (async () => {
|
|
|
1655
1655
|
},
|
|
1656
1656
|
children: l ? "\u2713" : o.number
|
|
1657
1657
|
}),
|
|
1658
|
-
|
|
1658
|
+
i("div", {
|
|
1659
1659
|
style: {
|
|
1660
1660
|
fontSize: 14,
|
|
1661
1661
|
fontWeight: c ? 600 : 400,
|
|
@@ -1667,7 +1667,7 @@ let __tla = (async () => {
|
|
|
1667
1667
|
})
|
|
1668
1668
|
]
|
|
1669
1669
|
}),
|
|
1670
|
-
|
|
1670
|
+
s < n.length - 1 && i("div", {
|
|
1671
1671
|
style: {
|
|
1672
1672
|
flex: "auto",
|
|
1673
1673
|
borderTop: "1px solid #bdbdbd",
|
|
@@ -1677,15 +1677,15 @@ let __tla = (async () => {
|
|
|
1677
1677
|
]
|
|
1678
1678
|
}, o.number);
|
|
1679
1679
|
})
|
|
1680
|
-
}), Jo = ({ mesh:
|
|
1681
|
-
const c =
|
|
1680
|
+
}), Jo = ({ mesh: n, upperY: r, originY: t, modelSize: o, meshColor: s = "#c8c8c8", displayUnit: l = "mm" }) => {
|
|
1681
|
+
const c = n.geometry, a = j(() => new yt(c, {
|
|
1682
1682
|
maxLeafTris: bt
|
|
1683
1683
|
}), [
|
|
1684
1684
|
c
|
|
1685
|
-
]), e = j(() => je(a, c,
|
|
1685
|
+
]), e = j(() => je(a, c, t), [
|
|
1686
1686
|
a,
|
|
1687
1687
|
c,
|
|
1688
|
-
|
|
1688
|
+
t
|
|
1689
1689
|
]), m = j(() => new xt(new M(0, -1, 0), r), [
|
|
1690
1690
|
r
|
|
1691
1691
|
]), { mlLine: d, apLine: f, mlWidth: u, apWidth: x } = j(() => {
|
|
@@ -1694,11 +1694,11 @@ let __tla = (async () => {
|
|
|
1694
1694
|
let S = e.linePoints[0], A = e.linePoints[0], w = e.linePoints[0], k = e.linePoints[0];
|
|
1695
1695
|
for (const h of e.linePoints) h.x < S.x && (S = h), h.x > A.x && (A = h), h.z < w.z && (w = h), h.z > k.z && (k = h);
|
|
1696
1696
|
g = [
|
|
1697
|
-
new M(S.x,
|
|
1698
|
-
new M(A.x,
|
|
1697
|
+
new M(S.x, t, S.z),
|
|
1698
|
+
new M(A.x, t, A.z)
|
|
1699
1699
|
], y = [
|
|
1700
|
-
new M(w.x,
|
|
1701
|
-
new M(k.x,
|
|
1700
|
+
new M(w.x, t, w.z),
|
|
1701
|
+
new M(k.x, t, k.z)
|
|
1702
1702
|
], P = g[0].distanceTo(g[1]), v = y[0].distanceTo(y[1]);
|
|
1703
1703
|
}
|
|
1704
1704
|
return {
|
|
@@ -1709,14 +1709,14 @@ let __tla = (async () => {
|
|
|
1709
1709
|
};
|
|
1710
1710
|
}, [
|
|
1711
1711
|
e,
|
|
1712
|
-
|
|
1712
|
+
t
|
|
1713
1713
|
]), C = (g) => l === "inch" ? (g / 25.4).toFixed(2) : g.toFixed(1), p = l === "inch" ? "in" : "mm";
|
|
1714
1714
|
return F(Ee, {
|
|
1715
1715
|
children: [
|
|
1716
|
-
|
|
1717
|
-
geometry:
|
|
1718
|
-
children:
|
|
1719
|
-
color:
|
|
1716
|
+
i("mesh", {
|
|
1717
|
+
geometry: n.geometry,
|
|
1718
|
+
children: i("meshStandardMaterial", {
|
|
1719
|
+
color: s,
|
|
1720
1720
|
side: $.DoubleSide,
|
|
1721
1721
|
transparent: true,
|
|
1722
1722
|
opacity: 0.15,
|
|
@@ -1726,7 +1726,7 @@ let __tla = (async () => {
|
|
|
1726
1726
|
]
|
|
1727
1727
|
})
|
|
1728
1728
|
}),
|
|
1729
|
-
e.linePoints.length >= 2 &&
|
|
1729
|
+
e.linePoints.length >= 2 && i(de, {
|
|
1730
1730
|
points: e.linePoints,
|
|
1731
1731
|
color: "#00ff00",
|
|
1732
1732
|
lineWidth: 3,
|
|
@@ -1736,7 +1736,7 @@ let __tla = (async () => {
|
|
|
1736
1736
|
}),
|
|
1737
1737
|
d && F(Ee, {
|
|
1738
1738
|
children: [
|
|
1739
|
-
|
|
1739
|
+
i(de, {
|
|
1740
1740
|
points: d,
|
|
1741
1741
|
color: "#ff8800",
|
|
1742
1742
|
lineWidth: 2,
|
|
@@ -1744,17 +1744,17 @@ let __tla = (async () => {
|
|
|
1744
1744
|
depthWrite: false,
|
|
1745
1745
|
transparent: true
|
|
1746
1746
|
}),
|
|
1747
|
-
|
|
1747
|
+
i(Ve, {
|
|
1748
1748
|
position: [
|
|
1749
1749
|
d[0].x,
|
|
1750
|
-
|
|
1750
|
+
t,
|
|
1751
1751
|
d[0].z - o * 0.02
|
|
1752
1752
|
],
|
|
1753
1753
|
center: true,
|
|
1754
1754
|
style: {
|
|
1755
1755
|
pointerEvents: "none"
|
|
1756
1756
|
},
|
|
1757
|
-
children:
|
|
1757
|
+
children: i("div", {
|
|
1758
1758
|
style: {
|
|
1759
1759
|
whiteSpace: "nowrap",
|
|
1760
1760
|
padding: "2px 6px",
|
|
@@ -1780,7 +1780,7 @@ let __tla = (async () => {
|
|
|
1780
1780
|
}),
|
|
1781
1781
|
f && F(Ee, {
|
|
1782
1782
|
children: [
|
|
1783
|
-
|
|
1783
|
+
i(de, {
|
|
1784
1784
|
points: f,
|
|
1785
1785
|
color: "#ff00ff",
|
|
1786
1786
|
lineWidth: 2,
|
|
@@ -1788,17 +1788,17 @@ let __tla = (async () => {
|
|
|
1788
1788
|
depthWrite: false,
|
|
1789
1789
|
transparent: true
|
|
1790
1790
|
}),
|
|
1791
|
-
|
|
1791
|
+
i(Ve, {
|
|
1792
1792
|
position: [
|
|
1793
1793
|
Math.max(f[0].x, f[1].x) + o * 0.02,
|
|
1794
|
-
|
|
1794
|
+
t,
|
|
1795
1795
|
f[0].z > f[1].z ? f[0].z : f[1].z
|
|
1796
1796
|
],
|
|
1797
1797
|
center: true,
|
|
1798
1798
|
style: {
|
|
1799
1799
|
pointerEvents: "none"
|
|
1800
1800
|
},
|
|
1801
|
-
children:
|
|
1801
|
+
children: i("div", {
|
|
1802
1802
|
style: {
|
|
1803
1803
|
whiteSpace: "nowrap",
|
|
1804
1804
|
padding: "2px 6px",
|
|
@@ -1824,8 +1824,8 @@ let __tla = (async () => {
|
|
|
1824
1824
|
})
|
|
1825
1825
|
]
|
|
1826
1826
|
});
|
|
1827
|
-
}, Qo = ({ mesh:
|
|
1828
|
-
const [u, x] = W(false), [C, p] = W(false), { camera: g, gl: y } = wn(), P = le(0), v =
|
|
1827
|
+
}, Qo = ({ mesh: n, yPosition: r, onYChange: t, minY: o, maxY: s, modelSize: l, color: c, hoverColor: a, dragColor: e, label: m, onDragStart: d, onDragEnd: f }) => {
|
|
1828
|
+
const [u, x] = W(false), [C, p] = W(false), { camera: g, gl: y } = wn(), P = le(0), v = n.geometry, S = Pn(v), A = j(() => S ? je(S, v, r) : {
|
|
1829
1829
|
linePoints: [],
|
|
1830
1830
|
lineLength: 0,
|
|
1831
1831
|
rightmostPoint: new M()
|
|
@@ -1852,13 +1852,13 @@ let __tla = (async () => {
|
|
|
1852
1852
|
]), h = Q((_) => {
|
|
1853
1853
|
if (!u) return;
|
|
1854
1854
|
let D = w(_.clientX, _.clientY) + P.current;
|
|
1855
|
-
D = Math.max(o, Math.min(
|
|
1855
|
+
D = Math.max(o, Math.min(s, D)), t(D);
|
|
1856
1856
|
}, [
|
|
1857
1857
|
u,
|
|
1858
1858
|
w,
|
|
1859
|
-
|
|
1859
|
+
t,
|
|
1860
1860
|
o,
|
|
1861
|
-
|
|
1861
|
+
s
|
|
1862
1862
|
]), z = Q((_) => {
|
|
1863
1863
|
x(false), y.domElement.style.cursor = "auto", _.target.releasePointerCapture(_.pointerId), f == null ? void 0 : f();
|
|
1864
1864
|
}, [
|
|
@@ -1870,7 +1870,7 @@ let __tla = (async () => {
|
|
|
1870
1870
|
return F("group", {
|
|
1871
1871
|
renderOrder: 10,
|
|
1872
1872
|
children: [
|
|
1873
|
-
|
|
1873
|
+
i(de, {
|
|
1874
1874
|
points: A.linePoints,
|
|
1875
1875
|
color: L,
|
|
1876
1876
|
lineWidth: u ? 6 : C ? 5 : 4,
|
|
@@ -1888,15 +1888,15 @@ let __tla = (async () => {
|
|
|
1888
1888
|
u || (p(false), y.domElement.style.cursor = "auto");
|
|
1889
1889
|
}
|
|
1890
1890
|
}),
|
|
1891
|
-
(C || u) &&
|
|
1891
|
+
(C || u) && i("mesh", {
|
|
1892
1892
|
position: [
|
|
1893
1893
|
A.rightmostPoint.x + l * 0.15,
|
|
1894
1894
|
r,
|
|
1895
1895
|
0
|
|
1896
1896
|
],
|
|
1897
|
-
children:
|
|
1897
|
+
children: i(Ve, {
|
|
1898
1898
|
center: true,
|
|
1899
|
-
children:
|
|
1899
|
+
children: i("div", {
|
|
1900
1900
|
style: {
|
|
1901
1901
|
padding: "4px 8px",
|
|
1902
1902
|
backgroundColor: "rgba(0, 0, 0, 0.8)",
|
|
@@ -1913,23 +1913,23 @@ let __tla = (async () => {
|
|
|
1913
1913
|
]
|
|
1914
1914
|
});
|
|
1915
1915
|
};
|
|
1916
|
-
function qo(
|
|
1917
|
-
if (
|
|
1918
|
-
var
|
|
1919
|
-
for (l = 0; l < o.length; l++)
|
|
1920
|
-
return
|
|
1916
|
+
function qo(n, r) {
|
|
1917
|
+
if (n == null) return {};
|
|
1918
|
+
var t = {}, o = Object.keys(n), s, l;
|
|
1919
|
+
for (l = 0; l < o.length; l++) s = o[l], !(r.indexOf(s) >= 0) && (t[s] = n[s]);
|
|
1920
|
+
return t;
|
|
1921
1921
|
}
|
|
1922
1922
|
var er = [
|
|
1923
1923
|
"color"
|
|
1924
|
-
], tr = po(function(
|
|
1925
|
-
var
|
|
1924
|
+
], tr = po(function(n, r) {
|
|
1925
|
+
var t = n.color, o = t === void 0 ? "currentColor" : t, s = qo(n, er);
|
|
1926
1926
|
return fn("svg", Object.assign({
|
|
1927
1927
|
width: "15",
|
|
1928
1928
|
height: "15",
|
|
1929
1929
|
viewBox: "0 0 15 15",
|
|
1930
1930
|
fill: "none",
|
|
1931
1931
|
xmlns: "http://www.w3.org/2000/svg"
|
|
1932
|
-
},
|
|
1932
|
+
}, s, {
|
|
1933
1933
|
ref: r
|
|
1934
1934
|
}), fn("path", {
|
|
1935
1935
|
d: "M7.5 2C7.77614 2 8 2.22386 8 2.5L8 11.2929L11.1464 8.14645C11.3417 7.95118 11.6583 7.95118 11.8536 8.14645C12.0488 8.34171 12.0488 8.65829 11.8536 8.85355L7.85355 12.8536C7.75979 12.9473 7.63261 13 7.5 13C7.36739 13 7.24021 12.9473 7.14645 12.8536L3.14645 8.85355C2.95118 8.65829 2.95118 8.34171 3.14645 8.14645C3.34171 7.95118 3.65829 7.95118 3.85355 8.14645L7 11.2929L7 2.5C7 2.22386 7.22386 2 7.5 2Z",
|
|
@@ -1962,23 +1962,23 @@ let __tla = (async () => {
|
|
|
1962
1962
|
outline: "none",
|
|
1963
1963
|
boxSizing: "border-box",
|
|
1964
1964
|
fontFamily: "system-ui, sans-serif"
|
|
1965
|
-
}, Ln = ({ onSkip:
|
|
1966
|
-
const [
|
|
1965
|
+
}, Ln = ({ onSkip: n, onCancel: r }) => {
|
|
1966
|
+
const [t, o] = W("confirm"), [s, l] = W(null), [c, a] = W(""), e = Q(() => {
|
|
1967
1967
|
o("reasons");
|
|
1968
1968
|
}, []), m = Q(() => {
|
|
1969
|
-
|
|
1969
|
+
t === "reasons" ? (o("confirm"), l(null), a("")) : r();
|
|
1970
1970
|
}, [
|
|
1971
|
-
|
|
1971
|
+
t,
|
|
1972
1972
|
r
|
|
1973
|
-
]), d =
|
|
1974
|
-
!d || !
|
|
1973
|
+
]), d = s != null && (s !== "Other" || c.trim() !== ""), f = Q(() => {
|
|
1974
|
+
!d || !s || n(s === "Other" ? `Other: ${c.trim()}` : s);
|
|
1975
1975
|
}, [
|
|
1976
1976
|
d,
|
|
1977
|
-
|
|
1977
|
+
s,
|
|
1978
1978
|
c,
|
|
1979
|
-
|
|
1979
|
+
n
|
|
1980
1980
|
]);
|
|
1981
|
-
return
|
|
1981
|
+
return t === "reasons" ? i("div", {
|
|
1982
1982
|
style: {
|
|
1983
1983
|
position: "fixed",
|
|
1984
1984
|
inset: 0,
|
|
@@ -2004,7 +2004,7 @@ let __tla = (async () => {
|
|
|
2004
2004
|
padding: "24px 24px 0"
|
|
2005
2005
|
},
|
|
2006
2006
|
children: [
|
|
2007
|
-
|
|
2007
|
+
i("div", {
|
|
2008
2008
|
style: {
|
|
2009
2009
|
fontSize: 18,
|
|
2010
2010
|
fontWeight: 600,
|
|
@@ -2013,7 +2013,7 @@ let __tla = (async () => {
|
|
|
2013
2013
|
},
|
|
2014
2014
|
children: "Why are you skipping?"
|
|
2015
2015
|
}),
|
|
2016
|
-
|
|
2016
|
+
i("div", {
|
|
2017
2017
|
style: {
|
|
2018
2018
|
fontSize: 13,
|
|
2019
2019
|
color: "rgba(0,0,0,0.5)"
|
|
@@ -2041,13 +2041,13 @@ let __tla = (async () => {
|
|
|
2041
2041
|
padding: "10px 12px",
|
|
2042
2042
|
borderRadius: 6,
|
|
2043
2043
|
cursor: "pointer",
|
|
2044
|
-
backgroundColor:
|
|
2044
|
+
backgroundColor: s === u ? "rgba(12, 67, 173, 0.06)" : "transparent"
|
|
2045
2045
|
},
|
|
2046
2046
|
children: [
|
|
2047
|
-
|
|
2047
|
+
i("input", {
|
|
2048
2048
|
type: "radio",
|
|
2049
2049
|
name: "skip-reason",
|
|
2050
|
-
checked:
|
|
2050
|
+
checked: s === u,
|
|
2051
2051
|
onChange: () => {
|
|
2052
2052
|
l(u), u !== "Other" && a("");
|
|
2053
2053
|
},
|
|
@@ -2059,7 +2059,7 @@ let __tla = (async () => {
|
|
|
2059
2059
|
flexShrink: 0
|
|
2060
2060
|
}
|
|
2061
2061
|
}),
|
|
2062
|
-
|
|
2062
|
+
i("span", {
|
|
2063
2063
|
style: {
|
|
2064
2064
|
fontSize: 14,
|
|
2065
2065
|
color: "#333"
|
|
@@ -2068,7 +2068,7 @@ let __tla = (async () => {
|
|
|
2068
2068
|
})
|
|
2069
2069
|
]
|
|
2070
2070
|
}, u)),
|
|
2071
|
-
|
|
2071
|
+
s === "Other" && i("input", {
|
|
2072
2072
|
autoFocus: true,
|
|
2073
2073
|
type: "text",
|
|
2074
2074
|
placeholder: "Please describe...",
|
|
@@ -2096,7 +2096,7 @@ let __tla = (async () => {
|
|
|
2096
2096
|
borderTop: "1px solid #eee"
|
|
2097
2097
|
},
|
|
2098
2098
|
children: [
|
|
2099
|
-
|
|
2099
|
+
i("button", {
|
|
2100
2100
|
onClick: m,
|
|
2101
2101
|
style: {
|
|
2102
2102
|
...pt,
|
|
@@ -2106,7 +2106,7 @@ let __tla = (async () => {
|
|
|
2106
2106
|
},
|
|
2107
2107
|
children: "Cancel"
|
|
2108
2108
|
}),
|
|
2109
|
-
|
|
2109
|
+
i("button", {
|
|
2110
2110
|
onClick: f,
|
|
2111
2111
|
disabled: !d,
|
|
2112
2112
|
style: {
|
|
@@ -2122,7 +2122,7 @@ let __tla = (async () => {
|
|
|
2122
2122
|
})
|
|
2123
2123
|
]
|
|
2124
2124
|
})
|
|
2125
|
-
}) :
|
|
2125
|
+
}) : i("div", {
|
|
2126
2126
|
style: {
|
|
2127
2127
|
position: "fixed",
|
|
2128
2128
|
inset: 0,
|
|
@@ -2144,7 +2144,7 @@ let __tla = (async () => {
|
|
|
2144
2144
|
boxShadow: "0 24px 38px 3px rgba(0,0,0,0.14)"
|
|
2145
2145
|
},
|
|
2146
2146
|
children: [
|
|
2147
|
-
|
|
2147
|
+
i("div", {
|
|
2148
2148
|
style: {
|
|
2149
2149
|
fontSize: 20,
|
|
2150
2150
|
fontWeight: 600,
|
|
@@ -2153,7 +2153,7 @@ let __tla = (async () => {
|
|
|
2153
2153
|
},
|
|
2154
2154
|
children: "Skip Scan Comparison?"
|
|
2155
2155
|
}),
|
|
2156
|
-
|
|
2156
|
+
i("div", {
|
|
2157
2157
|
style: {
|
|
2158
2158
|
fontSize: 14,
|
|
2159
2159
|
color: "rgba(0,0,0,0.54)",
|
|
@@ -2168,7 +2168,7 @@ let __tla = (async () => {
|
|
|
2168
2168
|
gap: 8
|
|
2169
2169
|
},
|
|
2170
2170
|
children: [
|
|
2171
|
-
|
|
2171
|
+
i("button", {
|
|
2172
2172
|
onClick: r,
|
|
2173
2173
|
style: {
|
|
2174
2174
|
...pt,
|
|
@@ -2178,7 +2178,7 @@ let __tla = (async () => {
|
|
|
2178
2178
|
},
|
|
2179
2179
|
children: "Cancel"
|
|
2180
2180
|
}),
|
|
2181
|
-
|
|
2181
|
+
i("button", {
|
|
2182
2182
|
onClick: e,
|
|
2183
2183
|
style: {
|
|
2184
2184
|
...pt,
|
|
@@ -2211,8 +2211,8 @@ let __tla = (async () => {
|
|
|
2211
2211
|
outline: "none",
|
|
2212
2212
|
boxSizing: "border-box",
|
|
2213
2213
|
fontFamily: "system-ui, sans-serif"
|
|
2214
|
-
}, rr = ({ amputationType:
|
|
2215
|
-
const d =
|
|
2214
|
+
}, rr = ({ amputationType: n, spacingInches: r, scanMeasurements: t, scanFrontalHeight: o, onSave: s, onSkip: l, onFormChange: c, onHeightChange: a, initialValues: e, initialFrontalHeight: m }) => {
|
|
2215
|
+
const d = n === "AK" ? "IT" : "MPT", f = r, u = n === "AK" ? 18 : 9, x = j(() => {
|
|
2216
2216
|
const h = [];
|
|
2217
2217
|
for (let z = 2; z >= 1; z -= f) h.push(`${z}\u2033 above ${d}`);
|
|
2218
2218
|
h.push(`At ${d}`);
|
|
@@ -2256,7 +2256,7 @@ let __tla = (async () => {
|
|
|
2256
2256
|
]), w = Q(() => {
|
|
2257
2257
|
if (!A) return;
|
|
2258
2258
|
const h = g !== "" && !isNaN(parseFloat(g)) ? parseFloat(g) : 0;
|
|
2259
|
-
|
|
2259
|
+
s({
|
|
2260
2260
|
circumferences: S,
|
|
2261
2261
|
frontalHeight: h
|
|
2262
2262
|
});
|
|
@@ -2264,11 +2264,11 @@ let __tla = (async () => {
|
|
|
2264
2264
|
A,
|
|
2265
2265
|
S,
|
|
2266
2266
|
g,
|
|
2267
|
-
|
|
2267
|
+
s
|
|
2268
2268
|
]), k = Q(() => {
|
|
2269
2269
|
const h = {};
|
|
2270
2270
|
x.forEach((z, L) => {
|
|
2271
|
-
const _ =
|
|
2271
|
+
const _ = t[L];
|
|
2272
2272
|
if (_) {
|
|
2273
2273
|
const D = _.modifiedValue ?? _.originalValue;
|
|
2274
2274
|
h[z] = D.toFixed(1);
|
|
@@ -2276,7 +2276,7 @@ let __tla = (async () => {
|
|
|
2276
2276
|
}), p(h), o > 0 && y(o.toFixed(1));
|
|
2277
2277
|
}, [
|
|
2278
2278
|
x,
|
|
2279
|
-
|
|
2279
|
+
t,
|
|
2280
2280
|
o
|
|
2281
2281
|
]);
|
|
2282
2282
|
return F("div", {
|
|
@@ -2288,7 +2288,7 @@ let __tla = (async () => {
|
|
|
2288
2288
|
fontFamily: "system-ui, sans-serif"
|
|
2289
2289
|
},
|
|
2290
2290
|
children: [
|
|
2291
|
-
P &&
|
|
2291
|
+
P && i(Ln, {
|
|
2292
2292
|
onSkip: l,
|
|
2293
2293
|
onCancel: () => v(false)
|
|
2294
2294
|
}),
|
|
@@ -2307,7 +2307,7 @@ let __tla = (async () => {
|
|
|
2307
2307
|
color: "rgba(0,0,0,0.87)"
|
|
2308
2308
|
},
|
|
2309
2309
|
children: [
|
|
2310
|
-
|
|
2310
|
+
n,
|
|
2311
2311
|
" Measurements"
|
|
2312
2312
|
]
|
|
2313
2313
|
}),
|
|
@@ -2324,7 +2324,7 @@ let __tla = (async () => {
|
|
|
2324
2324
|
" spacing."
|
|
2325
2325
|
]
|
|
2326
2326
|
}),
|
|
2327
|
-
|
|
2327
|
+
i("button", {
|
|
2328
2328
|
onClick: k,
|
|
2329
2329
|
style: {
|
|
2330
2330
|
...Tt,
|
|
@@ -2345,7 +2345,7 @@ let __tla = (async () => {
|
|
|
2345
2345
|
gap: 4
|
|
2346
2346
|
},
|
|
2347
2347
|
children: [
|
|
2348
|
-
|
|
2348
|
+
i(tr, {
|
|
2349
2349
|
style: {
|
|
2350
2350
|
width: 14,
|
|
2351
2351
|
height: 14
|
|
@@ -2366,7 +2366,7 @@ let __tla = (async () => {
|
|
|
2366
2366
|
WebkitOverflowScrolling: "touch"
|
|
2367
2367
|
},
|
|
2368
2368
|
children: [
|
|
2369
|
-
|
|
2369
|
+
i("div", {
|
|
2370
2370
|
style: {
|
|
2371
2371
|
fontSize: 13,
|
|
2372
2372
|
fontWeight: 600,
|
|
@@ -2375,7 +2375,7 @@ let __tla = (async () => {
|
|
|
2375
2375
|
},
|
|
2376
2376
|
children: "Circumferences"
|
|
2377
2377
|
}),
|
|
2378
|
-
|
|
2378
|
+
i("div", {
|
|
2379
2379
|
style: {
|
|
2380
2380
|
display: "flex",
|
|
2381
2381
|
flexDirection: "column",
|
|
@@ -2389,7 +2389,7 @@ let __tla = (async () => {
|
|
|
2389
2389
|
gap: 8
|
|
2390
2390
|
},
|
|
2391
2391
|
children: [
|
|
2392
|
-
|
|
2392
|
+
i("label", {
|
|
2393
2393
|
style: {
|
|
2394
2394
|
fontSize: 11,
|
|
2395
2395
|
fontWeight: 500,
|
|
@@ -2399,7 +2399,7 @@ let __tla = (async () => {
|
|
|
2399
2399
|
},
|
|
2400
2400
|
children: h
|
|
2401
2401
|
}),
|
|
2402
|
-
|
|
2402
|
+
i("input", {
|
|
2403
2403
|
type: "number",
|
|
2404
2404
|
step: "0.1",
|
|
2405
2405
|
value: C[h] ?? "",
|
|
@@ -2419,7 +2419,7 @@ let __tla = (async () => {
|
|
|
2419
2419
|
]
|
|
2420
2420
|
}, z))
|
|
2421
2421
|
}),
|
|
2422
|
-
|
|
2422
|
+
i("div", {
|
|
2423
2423
|
style: {
|
|
2424
2424
|
fontSize: 13,
|
|
2425
2425
|
fontWeight: 600,
|
|
@@ -2435,7 +2435,7 @@ let __tla = (async () => {
|
|
|
2435
2435
|
gap: 8
|
|
2436
2436
|
},
|
|
2437
2437
|
children: [
|
|
2438
|
-
|
|
2438
|
+
i("label", {
|
|
2439
2439
|
style: {
|
|
2440
2440
|
fontSize: 11,
|
|
2441
2441
|
fontWeight: 500,
|
|
@@ -2445,7 +2445,7 @@ let __tla = (async () => {
|
|
|
2445
2445
|
},
|
|
2446
2446
|
children: "Starting Pt Height"
|
|
2447
2447
|
}),
|
|
2448
|
-
|
|
2448
|
+
i("input", {
|
|
2449
2449
|
type: "number",
|
|
2450
2450
|
step: "0.1",
|
|
2451
2451
|
value: g,
|
|
@@ -2474,7 +2474,7 @@ let __tla = (async () => {
|
|
|
2474
2474
|
flexShrink: 0
|
|
2475
2475
|
},
|
|
2476
2476
|
children: [
|
|
2477
|
-
|
|
2477
|
+
i("button", {
|
|
2478
2478
|
onClick: w,
|
|
2479
2479
|
disabled: !A,
|
|
2480
2480
|
style: {
|
|
@@ -2489,7 +2489,7 @@ let __tla = (async () => {
|
|
|
2489
2489
|
},
|
|
2490
2490
|
children: "Save Measurements"
|
|
2491
2491
|
}),
|
|
2492
|
-
|
|
2492
|
+
i("button", {
|
|
2493
2493
|
onClick: () => v(true),
|
|
2494
2494
|
style: {
|
|
2495
2495
|
...Tt,
|
|
@@ -2507,10 +2507,10 @@ let __tla = (async () => {
|
|
|
2507
2507
|
]
|
|
2508
2508
|
});
|
|
2509
2509
|
};
|
|
2510
|
-
function _n(
|
|
2511
|
-
const o =
|
|
2512
|
-
if (
|
|
2513
|
-
const l = 30, c =
|
|
2510
|
+
function _n(n, r, t) {
|
|
2511
|
+
const o = n.getAttribute("position"), s = t - r;
|
|
2512
|
+
if (s < 1) return null;
|
|
2513
|
+
const l = 30, c = s / l, a = [];
|
|
2514
2514
|
for (let g = 0; g < l; g++) {
|
|
2515
2515
|
const y = r + g * c, P = r + (g + 1) * c;
|
|
2516
2516
|
let v = 0, S = 0, A = 0, w = 0;
|
|
@@ -2552,19 +2552,19 @@ let __tla = (async () => {
|
|
|
2552
2552
|
"#44cc44",
|
|
2553
2553
|
"#4488ff"
|
|
2554
2554
|
];
|
|
2555
|
-
function In(
|
|
2556
|
-
const r =
|
|
2557
|
-
for (let p = 0; p <
|
|
2558
|
-
o.divideScalar(
|
|
2559
|
-
let
|
|
2560
|
-
for (let p = 0; p <
|
|
2555
|
+
function In(n) {
|
|
2556
|
+
const r = n.getAttribute("position"), t = r.count, o = new M();
|
|
2557
|
+
for (let p = 0; p < t; p++) o.x += r.getX(p), o.y += r.getY(p), o.z += r.getZ(p);
|
|
2558
|
+
o.divideScalar(t);
|
|
2559
|
+
let s = 0, l = 0, c = 0, a = 0, e = 0, m = 0;
|
|
2560
|
+
for (let p = 0; p < t; p++) {
|
|
2561
2561
|
const g = r.getX(p) - o.x, y = r.getY(p) - o.y, P = r.getZ(p) - o.z;
|
|
2562
|
-
|
|
2562
|
+
s += g * g, l += g * y, c += g * P, a += y * y, e += y * P, m += P * P;
|
|
2563
2563
|
}
|
|
2564
|
-
|
|
2564
|
+
s /= t, l /= t, c /= t, a /= t, e /= t, m /= t;
|
|
2565
2565
|
const d = [], f = [], u = [
|
|
2566
2566
|
[
|
|
2567
|
-
|
|
2567
|
+
s,
|
|
2568
2568
|
l,
|
|
2569
2569
|
c
|
|
2570
2570
|
],
|
|
@@ -2605,8 +2605,8 @@ let __tla = (async () => {
|
|
|
2605
2605
|
}
|
|
2606
2606
|
}
|
|
2607
2607
|
const x = new M();
|
|
2608
|
-
for (let p = 0; p <
|
|
2609
|
-
x.divideScalar(
|
|
2608
|
+
for (let p = 0; p < t; p++) x.x += r.getX(p), x.y += r.getY(p), x.z += r.getZ(p);
|
|
2609
|
+
x.divideScalar(t);
|
|
2610
2610
|
const C = [
|
|
2611
2611
|
0,
|
|
2612
2612
|
0,
|
|
@@ -2615,7 +2615,7 @@ let __tla = (async () => {
|
|
|
2615
2615
|
for (let p = 0; p < 3; p++) {
|
|
2616
2616
|
let g = 1 / 0, y = -1 / 0;
|
|
2617
2617
|
const P = d[p];
|
|
2618
|
-
for (let v = 0; v <
|
|
2618
|
+
for (let v = 0; v < t; v++) {
|
|
2619
2619
|
const S = r.getX(v) - x.x, A = r.getY(v) - x.y, w = r.getZ(v) - x.z, k = S * P.x + A * P.y + w * P.z;
|
|
2620
2620
|
k < g && (g = k), k > y && (y = k);
|
|
2621
2621
|
}
|
|
@@ -2628,25 +2628,25 @@ let __tla = (async () => {
|
|
|
2628
2628
|
halfExtents: C
|
|
2629
2629
|
};
|
|
2630
2630
|
}
|
|
2631
|
-
function lr({ pca:
|
|
2632
|
-
return
|
|
2633
|
-
children:
|
|
2634
|
-
const o =
|
|
2635
|
-
return
|
|
2631
|
+
function lr({ pca: n }) {
|
|
2632
|
+
return i("group", {
|
|
2633
|
+
children: n.axes.map((r, t) => {
|
|
2634
|
+
const o = n.center.clone().addScaledVector(r, n.halfExtents[t]), s = n.center.clone().addScaledVector(r, -n.halfExtents[t]);
|
|
2635
|
+
return i(de, {
|
|
2636
2636
|
points: [
|
|
2637
|
-
|
|
2637
|
+
s,
|
|
2638
2638
|
o
|
|
2639
2639
|
],
|
|
2640
|
-
color: sr[
|
|
2640
|
+
color: sr[t],
|
|
2641
2641
|
lineWidth: 2
|
|
2642
|
-
},
|
|
2642
|
+
}, t);
|
|
2643
2643
|
})
|
|
2644
2644
|
});
|
|
2645
2645
|
}
|
|
2646
|
-
function ar({ pca:
|
|
2646
|
+
function ar({ pca: n }) {
|
|
2647
2647
|
const r = j(() => {
|
|
2648
|
-
const { center:
|
|
2649
|
-
for (let a = -1; a <= 1; a += 2) for (let e = -1; e <= 1; e += 2) for (let m = -1; m <= 1; m += 2) l.push(
|
|
2648
|
+
const { center: t, axes: o, halfExtents: s } = n, l = [];
|
|
2649
|
+
for (let a = -1; a <= 1; a += 2) for (let e = -1; e <= 1; e += 2) for (let m = -1; m <= 1; m += 2) l.push(t.clone().addScaledVector(o[0], a * s[0]).addScaledVector(o[1], e * s[1]).addScaledVector(o[2], m * s[2]));
|
|
2650
2650
|
return [
|
|
2651
2651
|
[
|
|
2652
2652
|
0,
|
|
@@ -2701,11 +2701,11 @@ let __tla = (async () => {
|
|
|
2701
2701
|
l[e]
|
|
2702
2702
|
]);
|
|
2703
2703
|
}, [
|
|
2704
|
-
|
|
2704
|
+
n
|
|
2705
2705
|
]);
|
|
2706
|
-
return
|
|
2707
|
-
children: r.map((
|
|
2708
|
-
points:
|
|
2706
|
+
return i("group", {
|
|
2707
|
+
children: r.map((t, o) => i(de, {
|
|
2708
|
+
points: t,
|
|
2709
2709
|
color: "#ffaa00",
|
|
2710
2710
|
lineWidth: 1,
|
|
2711
2711
|
transparent: true,
|
|
@@ -2713,37 +2713,37 @@ let __tla = (async () => {
|
|
|
2713
2713
|
}, o))
|
|
2714
2714
|
});
|
|
2715
2715
|
}
|
|
2716
|
-
function cr({ redPoint:
|
|
2717
|
-
const
|
|
2718
|
-
|
|
2716
|
+
function cr({ redPoint: n, greenPoint: r }) {
|
|
2717
|
+
const t = j(() => new M().subVectors(r, n).normalize(), [
|
|
2718
|
+
n,
|
|
2719
2719
|
r
|
|
2720
2720
|
]), o = j(() => {
|
|
2721
|
-
const l =
|
|
2721
|
+
const l = t.dot(new M(0, 1, 0));
|
|
2722
2722
|
return Math.acos(Math.min(1, Math.abs(l))) * 180 / Math.PI;
|
|
2723
2723
|
}, [
|
|
2724
|
-
|
|
2725
|
-
]),
|
|
2724
|
+
t
|
|
2725
|
+
]), s = o < 1 ? "#44ff44" : o < 5 ? "#ffcc00" : "#ff4444";
|
|
2726
2726
|
return F("group", {
|
|
2727
2727
|
children: [
|
|
2728
|
-
|
|
2728
|
+
i(de, {
|
|
2729
2729
|
points: [
|
|
2730
|
-
|
|
2730
|
+
n,
|
|
2731
2731
|
r
|
|
2732
2732
|
],
|
|
2733
|
-
color:
|
|
2733
|
+
color: s,
|
|
2734
2734
|
lineWidth: 3
|
|
2735
2735
|
}),
|
|
2736
2736
|
F("mesh", {
|
|
2737
|
-
position:
|
|
2737
|
+
position: n,
|
|
2738
2738
|
children: [
|
|
2739
|
-
|
|
2739
|
+
i("sphereGeometry", {
|
|
2740
2740
|
args: [
|
|
2741
2741
|
1.5,
|
|
2742
2742
|
8,
|
|
2743
2743
|
8
|
|
2744
2744
|
]
|
|
2745
2745
|
}),
|
|
2746
|
-
|
|
2746
|
+
i("meshBasicMaterial", {
|
|
2747
2747
|
color: "#ff4444"
|
|
2748
2748
|
})
|
|
2749
2749
|
]
|
|
@@ -2751,14 +2751,14 @@ let __tla = (async () => {
|
|
|
2751
2751
|
F("mesh", {
|
|
2752
2752
|
position: r,
|
|
2753
2753
|
children: [
|
|
2754
|
-
|
|
2754
|
+
i("sphereGeometry", {
|
|
2755
2755
|
args: [
|
|
2756
2756
|
1.5,
|
|
2757
2757
|
8,
|
|
2758
2758
|
8
|
|
2759
2759
|
]
|
|
2760
2760
|
}),
|
|
2761
|
-
|
|
2761
|
+
i("meshBasicMaterial", {
|
|
2762
2762
|
color: "#44ff44"
|
|
2763
2763
|
})
|
|
2764
2764
|
]
|
|
@@ -2766,13 +2766,13 @@ let __tla = (async () => {
|
|
|
2766
2766
|
]
|
|
2767
2767
|
});
|
|
2768
2768
|
}
|
|
2769
|
-
function dr({ geometry:
|
|
2769
|
+
function dr({ geometry: n, redY: r, greenY: t, modelSize: o }) {
|
|
2770
2770
|
const l = o * 0.15, c = j(() => {
|
|
2771
2771
|
const a = [];
|
|
2772
|
-
let e =
|
|
2772
|
+
let e = t - 10;
|
|
2773
2773
|
const m = new M(0, 1, 0);
|
|
2774
2774
|
for (; e > r; ) {
|
|
2775
|
-
const d = Math.min(e,
|
|
2775
|
+
const d = Math.min(e, t), f = Math.max(e, t), u = _n(n, d, f);
|
|
2776
2776
|
if (u) {
|
|
2777
2777
|
const x = u.dot(m), C = Math.acos(Math.min(1, Math.abs(x))) * 180 / Math.PI;
|
|
2778
2778
|
a.push({
|
|
@@ -2786,16 +2786,16 @@ let __tla = (async () => {
|
|
|
2786
2786
|
}
|
|
2787
2787
|
return a;
|
|
2788
2788
|
}, [
|
|
2789
|
-
|
|
2789
|
+
n,
|
|
2790
2790
|
r,
|
|
2791
|
-
|
|
2791
|
+
t
|
|
2792
2792
|
]);
|
|
2793
|
-
return
|
|
2793
|
+
return i("group", {
|
|
2794
2794
|
children: c.map((a, e) => {
|
|
2795
2795
|
const m = (a.regionMin + a.regionMax) / 2, d = new M(0, m, 0), f = d.clone().addScaledVector(a.axis, l), u = d.clone().addScaledVector(a.axis, -l), x = e / Math.max(1, c.length - 1), C = a.angleDeg < 0.5 ? `hsl(${120 - x * 120}, 80%, 60%)` : `hsl(${40 - a.angleDeg * 2}, 90%, 55%)`;
|
|
2796
2796
|
return F("group", {
|
|
2797
2797
|
children: [
|
|
2798
|
-
|
|
2798
|
+
i(de, {
|
|
2799
2799
|
points: [
|
|
2800
2800
|
u,
|
|
2801
2801
|
f
|
|
@@ -2805,7 +2805,7 @@ let __tla = (async () => {
|
|
|
2805
2805
|
transparent: true,
|
|
2806
2806
|
opacity: 0.7
|
|
2807
2807
|
}),
|
|
2808
|
-
|
|
2808
|
+
i(de, {
|
|
2809
2809
|
points: [
|
|
2810
2810
|
new M(-l * 0.3, a.regionMin, 0),
|
|
2811
2811
|
new M(l * 0.3, a.regionMin, 0)
|
|
@@ -2820,9 +2820,9 @@ let __tla = (async () => {
|
|
|
2820
2820
|
})
|
|
2821
2821
|
});
|
|
2822
2822
|
}
|
|
2823
|
-
function fr({ geometry:
|
|
2824
|
-
const
|
|
2825
|
-
const f = _n(
|
|
2823
|
+
function fr({ geometry: n, redY: r, greenY: t, modelSize: o }) {
|
|
2824
|
+
const s = j(() => {
|
|
2825
|
+
const f = _n(n, r, t);
|
|
2826
2826
|
if (!f) return null;
|
|
2827
2827
|
const u = f.dot(new M(0, 1, 0)), x = Math.acos(Math.min(1, Math.abs(u))) * 180 / Math.PI;
|
|
2828
2828
|
return {
|
|
@@ -2830,14 +2830,14 @@ let __tla = (async () => {
|
|
|
2830
2830
|
angleDeg: x
|
|
2831
2831
|
};
|
|
2832
2832
|
}, [
|
|
2833
|
-
|
|
2833
|
+
n,
|
|
2834
2834
|
r,
|
|
2835
|
-
|
|
2835
|
+
t
|
|
2836
2836
|
]);
|
|
2837
|
-
if (!
|
|
2838
|
-
const l = (r +
|
|
2839
|
-
return
|
|
2840
|
-
children:
|
|
2837
|
+
if (!s) return null;
|
|
2838
|
+
const l = (r + t) / 2, c = new M(0, l, 0), a = o * 0.4, e = c.clone().addScaledVector(s.axis, a), m = c.clone().addScaledVector(s.axis, -a), d = s.angleDeg < 0.5 ? "#00ffff" : s.angleDeg < 2 ? "#ffcc00" : "#ff6600";
|
|
2839
|
+
return i("group", {
|
|
2840
|
+
children: i(de, {
|
|
2841
2841
|
points: [
|
|
2842
2842
|
m,
|
|
2843
2843
|
e
|
|
@@ -2850,12 +2850,12 @@ let __tla = (async () => {
|
|
|
2850
2850
|
})
|
|
2851
2851
|
});
|
|
2852
2852
|
}
|
|
2853
|
-
function ur({ pca:
|
|
2854
|
-
const
|
|
2855
|
-
return
|
|
2853
|
+
function ur({ pca: n, modelSize: r }) {
|
|
2854
|
+
const t = n.axes[0], o = r * 0.6, s = n.center.clone().addScaledVector(t, o), l = n.center.clone().addScaledVector(t, -o);
|
|
2855
|
+
return i(de, {
|
|
2856
2856
|
points: [
|
|
2857
2857
|
l,
|
|
2858
|
-
|
|
2858
|
+
s
|
|
2859
2859
|
],
|
|
2860
2860
|
color: "#ff8800",
|
|
2861
2861
|
lineWidth: 2,
|
|
@@ -2864,9 +2864,9 @@ let __tla = (async () => {
|
|
|
2864
2864
|
gapSize: 2
|
|
2865
2865
|
});
|
|
2866
2866
|
}
|
|
2867
|
-
function pr({ geometry:
|
|
2867
|
+
function pr({ geometry: n, redY: r, greenY: t, modelSize: o, measurementGeometry: s }) {
|
|
2868
2868
|
const l = j(() => {
|
|
2869
|
-
const d =
|
|
2869
|
+
const d = s ?? n, f = Ot(d), u = new M(0, 1, 0), x = 5, p = t + 3 * 25.4, g = [];
|
|
2870
2870
|
for (let h = r + x; h < p; h += x) {
|
|
2871
2871
|
const z = Po(f, d, new M(0, h, 0), u);
|
|
2872
2872
|
z > 0 && g.push({
|
|
@@ -2875,7 +2875,7 @@ let __tla = (async () => {
|
|
|
2875
2875
|
});
|
|
2876
2876
|
}
|
|
2877
2877
|
if (g.length < 5) return null;
|
|
2878
|
-
const y =
|
|
2878
|
+
const y = t - r, P = r + y * 0.3, v = r + y * 0.7, S = g.filter((h) => h.y >= P && h.y <= v);
|
|
2879
2879
|
if (S.length < 3) return null;
|
|
2880
2880
|
const A = S.map((h) => h.circ).sort((h, z) => h - z), w = A[Math.floor(A.length / 2)], k = Math.max(...g.map((h) => h.circ));
|
|
2881
2881
|
return {
|
|
@@ -2884,9 +2884,9 @@ let __tla = (async () => {
|
|
|
2884
2884
|
maxCirc: k
|
|
2885
2885
|
};
|
|
2886
2886
|
}, [
|
|
2887
|
-
|
|
2887
|
+
n,
|
|
2888
2888
|
r,
|
|
2889
|
-
|
|
2889
|
+
t
|
|
2890
2890
|
]);
|
|
2891
2891
|
if (!l) return null;
|
|
2892
2892
|
const { circumferences: c, baseline: a, maxCirc: e } = l, m = o * 0.3 / e;
|
|
@@ -2894,7 +2894,7 @@ let __tla = (async () => {
|
|
|
2894
2894
|
children: [
|
|
2895
2895
|
c.map(({ y: d, circ: f }, u) => {
|
|
2896
2896
|
const x = f / a, C = x > 1.6 ? "#ff4444" : x > 1.3 ? "#ffcc00" : "#22cc66", p = f * m;
|
|
2897
|
-
return
|
|
2897
|
+
return i(de, {
|
|
2898
2898
|
points: [
|
|
2899
2899
|
new M(-p, d, 0),
|
|
2900
2900
|
new M(p, d, 0)
|
|
@@ -2909,7 +2909,7 @@ let __tla = (async () => {
|
|
|
2909
2909
|
const d = a * 1.6 * m, f = c[0].y, u = c[c.length - 1].y;
|
|
2910
2910
|
return F(Ee, {
|
|
2911
2911
|
children: [
|
|
2912
|
-
|
|
2912
|
+
i(de, {
|
|
2913
2913
|
points: [
|
|
2914
2914
|
new M(-d, f, 0),
|
|
2915
2915
|
new M(-d, u, 0)
|
|
@@ -2922,7 +2922,7 @@ let __tla = (async () => {
|
|
|
2922
2922
|
transparent: true,
|
|
2923
2923
|
opacity: 0.4
|
|
2924
2924
|
}),
|
|
2925
|
-
|
|
2925
|
+
i(de, {
|
|
2926
2926
|
points: [
|
|
2927
2927
|
new M(d, f, 0),
|
|
2928
2928
|
new M(d, u, 0)
|
|
@@ -2941,21 +2941,21 @@ let __tla = (async () => {
|
|
|
2941
2941
|
]
|
|
2942
2942
|
});
|
|
2943
2943
|
}
|
|
2944
|
-
function hr({ componentDebug:
|
|
2945
|
-
return
|
|
2946
|
-
children:
|
|
2947
|
-
const o =
|
|
2944
|
+
function hr({ componentDebug: n }) {
|
|
2945
|
+
return i("group", {
|
|
2946
|
+
children: n.geometries.map((r, t) => {
|
|
2947
|
+
const o = n.colors[t] ?? "#888888", s = t === n.innerIdx;
|
|
2948
2948
|
r.computeBoundingBox();
|
|
2949
2949
|
const l = new M();
|
|
2950
2950
|
return r.boundingBox.getCenter(l), F("group", {
|
|
2951
2951
|
children: [
|
|
2952
|
-
|
|
2952
|
+
i("mesh", {
|
|
2953
2953
|
geometry: r,
|
|
2954
|
-
renderOrder:
|
|
2955
|
-
children:
|
|
2954
|
+
renderOrder: s ? 2 : 1,
|
|
2955
|
+
children: i("meshStandardMaterial", {
|
|
2956
2956
|
color: o,
|
|
2957
2957
|
transparent: true,
|
|
2958
|
-
opacity:
|
|
2958
|
+
opacity: s ? 0.5 : 0.2,
|
|
2959
2959
|
side: $.DoubleSide,
|
|
2960
2960
|
depthWrite: false,
|
|
2961
2961
|
polygonOffset: true,
|
|
@@ -2963,24 +2963,24 @@ let __tla = (async () => {
|
|
|
2963
2963
|
polygonOffsetUnits: 1
|
|
2964
2964
|
})
|
|
2965
2965
|
}),
|
|
2966
|
-
|
|
2966
|
+
i("mesh", {
|
|
2967
2967
|
geometry: r,
|
|
2968
|
-
renderOrder:
|
|
2969
|
-
children:
|
|
2968
|
+
renderOrder: s ? 2 : 1,
|
|
2969
|
+
children: i("meshBasicMaterial", {
|
|
2970
2970
|
color: o,
|
|
2971
2971
|
wireframe: true,
|
|
2972
2972
|
transparent: true,
|
|
2973
|
-
opacity:
|
|
2973
|
+
opacity: s ? 0.4 : 0.15
|
|
2974
2974
|
})
|
|
2975
2975
|
}),
|
|
2976
|
-
|
|
2976
|
+
i("group", {
|
|
2977
2977
|
position: l,
|
|
2978
|
-
children:
|
|
2978
|
+
children: i(Ve, {
|
|
2979
2979
|
center: true,
|
|
2980
2980
|
style: {
|
|
2981
2981
|
pointerEvents: "none"
|
|
2982
2982
|
},
|
|
2983
|
-
children:
|
|
2983
|
+
children: i("div", {
|
|
2984
2984
|
style: {
|
|
2985
2985
|
padding: "2px 8px",
|
|
2986
2986
|
backgroundColor: "rgba(0,0,0,0.8)",
|
|
@@ -2988,26 +2988,26 @@ let __tla = (async () => {
|
|
|
2988
2988
|
border: `1px solid ${o}`,
|
|
2989
2989
|
whiteSpace: "nowrap"
|
|
2990
2990
|
},
|
|
2991
|
-
children:
|
|
2991
|
+
children: i("span", {
|
|
2992
2992
|
style: {
|
|
2993
2993
|
fontSize: 11,
|
|
2994
2994
|
color: o,
|
|
2995
2995
|
fontFamily: "monospace",
|
|
2996
|
-
fontWeight:
|
|
2996
|
+
fontWeight: s ? 700 : 400
|
|
2997
2997
|
},
|
|
2998
|
-
children:
|
|
2998
|
+
children: n.labels[t]
|
|
2999
2999
|
})
|
|
3000
3000
|
})
|
|
3001
3001
|
})
|
|
3002
3002
|
})
|
|
3003
3003
|
]
|
|
3004
|
-
},
|
|
3004
|
+
}, t);
|
|
3005
3005
|
})
|
|
3006
3006
|
});
|
|
3007
3007
|
}
|
|
3008
|
-
function gr({ geometry:
|
|
3009
|
-
const
|
|
3010
|
-
const o =
|
|
3008
|
+
function gr({ geometry: n, aoData: r }) {
|
|
3009
|
+
const t = j(() => {
|
|
3010
|
+
const o = n.toNonIndexed(), s = o.getAttribute("position"), l = r.length, c = s.count, a = new Float32Array(c * 3);
|
|
3011
3011
|
for (let e = 0; e < l && e * 3 + 2 < c; e++) {
|
|
3012
3012
|
const m = r[e], d = m, f = m < 0.5 ? 0.8 - m * 1.2 : 0.2 * (1 - m), u = 1 - m;
|
|
3013
3013
|
for (let x = 0; x < 3; x++) {
|
|
@@ -3017,15 +3017,15 @@ let __tla = (async () => {
|
|
|
3017
3017
|
}
|
|
3018
3018
|
return o.setAttribute("color", new $.Float32BufferAttribute(a, 3)), o;
|
|
3019
3019
|
}, [
|
|
3020
|
-
|
|
3020
|
+
n,
|
|
3021
3021
|
r
|
|
3022
3022
|
]);
|
|
3023
|
-
return j(() => () =>
|
|
3024
|
-
|
|
3025
|
-
]),
|
|
3026
|
-
geometry:
|
|
3023
|
+
return j(() => () => t.dispose(), [
|
|
3024
|
+
t
|
|
3025
|
+
]), i("mesh", {
|
|
3026
|
+
geometry: t,
|
|
3027
3027
|
renderOrder: 3,
|
|
3028
|
-
children:
|
|
3028
|
+
children: i("meshBasicMaterial", {
|
|
3029
3029
|
vertexColors: true,
|
|
3030
3030
|
transparent: true,
|
|
3031
3031
|
opacity: 0.85,
|
|
@@ -3034,45 +3034,45 @@ let __tla = (async () => {
|
|
|
3034
3034
|
})
|
|
3035
3035
|
});
|
|
3036
3036
|
}
|
|
3037
|
-
function mr({ mesh:
|
|
3038
|
-
const a =
|
|
3037
|
+
function mr({ mesh: n, layers: r, landmarkPoints: t, componentDebug: o, aoData: s, aoGeometry: l, measurementGeometry: c }) {
|
|
3038
|
+
const a = n.geometry, e = j(() => a.getAttribute("position") ? In(a) : null, [
|
|
3039
3039
|
a
|
|
3040
|
-
]), m = j(() => !
|
|
3041
|
-
red: new M(
|
|
3042
|
-
green: new M(
|
|
3040
|
+
]), m = j(() => !t || t.length < 2 ? null : {
|
|
3041
|
+
red: new M(t[1].position.x, t[1].position.y, t[1].position.z),
|
|
3042
|
+
green: new M(t[0].position.x, t[0].position.y, t[0].position.z)
|
|
3043
3043
|
}, [
|
|
3044
|
-
|
|
3044
|
+
t
|
|
3045
3045
|
]);
|
|
3046
3046
|
return F("group", {
|
|
3047
3047
|
children: [
|
|
3048
|
-
r.pcaAxes && e &&
|
|
3048
|
+
r.pcaAxes && e && i(lr, {
|
|
3049
3049
|
pca: e
|
|
3050
3050
|
}),
|
|
3051
|
-
r.obb && e &&
|
|
3051
|
+
r.obb && e && i(ar, {
|
|
3052
3052
|
pca: e
|
|
3053
3053
|
}),
|
|
3054
|
-
r.obbAxis && e &&
|
|
3054
|
+
r.obbAxis && e && i(ur, {
|
|
3055
3055
|
pca: e,
|
|
3056
3056
|
modelSize: e.halfExtents[0] ? Math.max(...e.halfExtents) * 2 : 100
|
|
3057
3057
|
}),
|
|
3058
|
-
r.shellComponents && o &&
|
|
3058
|
+
r.shellComponents && o && i(hr, {
|
|
3059
3059
|
componentDebug: o
|
|
3060
3060
|
}),
|
|
3061
|
-
r.ambientOcclusion &&
|
|
3061
|
+
r.ambientOcclusion && s && s.length > 0 && i(gr, {
|
|
3062
3062
|
geometry: l ?? a,
|
|
3063
|
-
aoData:
|
|
3063
|
+
aoData: s
|
|
3064
3064
|
}),
|
|
3065
|
-
r.circumferenceScan && m &&
|
|
3065
|
+
r.circumferenceScan && m && i(pr, {
|
|
3066
3066
|
geometry: a,
|
|
3067
3067
|
redY: m.red.y,
|
|
3068
3068
|
greenY: m.green.y,
|
|
3069
3069
|
modelSize: (e == null ? void 0 : e.halfExtents[0]) ? Math.max(...e.halfExtents) * 2 : 100,
|
|
3070
3070
|
measurementGeometry: c
|
|
3071
3071
|
}),
|
|
3072
|
-
c &&
|
|
3072
|
+
c && i("mesh", {
|
|
3073
3073
|
geometry: c,
|
|
3074
3074
|
renderOrder: 5,
|
|
3075
|
-
children:
|
|
3075
|
+
children: i("meshBasicMaterial", {
|
|
3076
3076
|
color: "#00ccff",
|
|
3077
3077
|
wireframe: true,
|
|
3078
3078
|
transparent: true,
|
|
@@ -3080,17 +3080,17 @@ let __tla = (async () => {
|
|
|
3080
3080
|
depthWrite: false
|
|
3081
3081
|
})
|
|
3082
3082
|
}),
|
|
3083
|
-
r.landmarkAxis && m &&
|
|
3083
|
+
r.landmarkAxis && m && i(cr, {
|
|
3084
3084
|
redPoint: m.red,
|
|
3085
3085
|
greenPoint: m.green
|
|
3086
3086
|
}),
|
|
3087
|
-
r.iterativePCA && m &&
|
|
3087
|
+
r.iterativePCA && m && i(dr, {
|
|
3088
3088
|
geometry: a,
|
|
3089
3089
|
redY: m.red.y,
|
|
3090
3090
|
greenY: m.green.y,
|
|
3091
3091
|
modelSize: (e == null ? void 0 : e.halfExtents[0]) ? Math.max(...e.halfExtents) * 2 : 100
|
|
3092
3092
|
}),
|
|
3093
|
-
r.fullRegionPCA && m &&
|
|
3093
|
+
r.fullRegionPCA && m && i(fr, {
|
|
3094
3094
|
geometry: a,
|
|
3095
3095
|
redY: m.red.y,
|
|
3096
3096
|
greenY: m.green.y,
|
|
@@ -3099,8 +3099,8 @@ let __tla = (async () => {
|
|
|
3099
3099
|
]
|
|
3100
3100
|
});
|
|
3101
3101
|
}
|
|
3102
|
-
function xr({ mesh:
|
|
3103
|
-
const r =
|
|
3102
|
+
function xr({ mesh: n }) {
|
|
3103
|
+
const r = n.geometry, t = j(() => {
|
|
3104
3104
|
if (!r.getAttribute("position")) return null;
|
|
3105
3105
|
const l = In(r), c = l.axes[0], a = l.halfExtents[0] * 1.3;
|
|
3106
3106
|
return {
|
|
@@ -3111,11 +3111,11 @@ let __tla = (async () => {
|
|
|
3111
3111
|
}, [
|
|
3112
3112
|
r
|
|
3113
3113
|
]);
|
|
3114
|
-
if (!
|
|
3115
|
-
const o =
|
|
3116
|
-
return
|
|
3114
|
+
if (!t) return null;
|
|
3115
|
+
const o = t.center.clone().addScaledVector(t.axis, t.halfLen), s = t.center.clone().addScaledVector(t.axis, -t.halfLen);
|
|
3116
|
+
return i(de, {
|
|
3117
3117
|
points: [
|
|
3118
|
-
|
|
3118
|
+
s,
|
|
3119
3119
|
o
|
|
3120
3120
|
],
|
|
3121
3121
|
color: "#666",
|
|
@@ -3186,9 +3186,9 @@ let __tla = (async () => {
|
|
|
3186
3186
|
group: "Alignment"
|
|
3187
3187
|
}
|
|
3188
3188
|
], yr = [
|
|
3189
|
-
...new Set(Dn.map((
|
|
3189
|
+
...new Set(Dn.map((n) => n.group))
|
|
3190
3190
|
];
|
|
3191
|
-
function br({ layers:
|
|
3191
|
+
function br({ layers: n, onToggleLayer: r, isDoubleShell: t }) {
|
|
3192
3192
|
return F("div", {
|
|
3193
3193
|
style: {
|
|
3194
3194
|
position: "absolute",
|
|
@@ -3206,7 +3206,7 @@ let __tla = (async () => {
|
|
|
3206
3206
|
backdropFilter: "blur(8px)"
|
|
3207
3207
|
},
|
|
3208
3208
|
children: [
|
|
3209
|
-
|
|
3209
|
+
i("div", {
|
|
3210
3210
|
style: {
|
|
3211
3211
|
fontSize: 10,
|
|
3212
3212
|
fontWeight: 600,
|
|
@@ -3218,10 +3218,10 @@ let __tla = (async () => {
|
|
|
3218
3218
|
children: "Debug Layers"
|
|
3219
3219
|
}),
|
|
3220
3220
|
yr.map((o) => {
|
|
3221
|
-
const
|
|
3222
|
-
return
|
|
3221
|
+
const s = Dn.filter((l) => l.group === o && !(l.hideWhenDoubleShell && t));
|
|
3222
|
+
return s.length === 0 ? null : F("div", {
|
|
3223
3223
|
children: [
|
|
3224
|
-
|
|
3224
|
+
i("div", {
|
|
3225
3225
|
style: {
|
|
3226
3226
|
fontSize: 9,
|
|
3227
3227
|
fontWeight: 600,
|
|
@@ -3233,7 +3233,7 @@ let __tla = (async () => {
|
|
|
3233
3233
|
},
|
|
3234
3234
|
children: o
|
|
3235
3235
|
}),
|
|
3236
|
-
|
|
3236
|
+
s.map(({ key: l, label: c, color: a }) => F("label", {
|
|
3237
3237
|
style: {
|
|
3238
3238
|
display: "flex",
|
|
3239
3239
|
alignItems: "center",
|
|
@@ -3243,9 +3243,9 @@ let __tla = (async () => {
|
|
|
3243
3243
|
userSelect: "none"
|
|
3244
3244
|
},
|
|
3245
3245
|
children: [
|
|
3246
|
-
|
|
3246
|
+
i("input", {
|
|
3247
3247
|
type: "checkbox",
|
|
3248
|
-
checked:
|
|
3248
|
+
checked: n[l],
|
|
3249
3249
|
onChange: () => r(l),
|
|
3250
3250
|
style: {
|
|
3251
3251
|
accentColor: a,
|
|
@@ -3254,19 +3254,19 @@ let __tla = (async () => {
|
|
|
3254
3254
|
cursor: "pointer"
|
|
3255
3255
|
}
|
|
3256
3256
|
}),
|
|
3257
|
-
|
|
3257
|
+
i("span", {
|
|
3258
3258
|
style: {
|
|
3259
3259
|
width: 8,
|
|
3260
3260
|
height: 8,
|
|
3261
3261
|
borderRadius: "50%",
|
|
3262
3262
|
backgroundColor: a,
|
|
3263
|
-
opacity:
|
|
3263
|
+
opacity: n[l] ? 1 : 0.3,
|
|
3264
3264
|
flexShrink: 0
|
|
3265
3265
|
}
|
|
3266
3266
|
}),
|
|
3267
|
-
|
|
3267
|
+
i("span", {
|
|
3268
3268
|
style: {
|
|
3269
|
-
opacity:
|
|
3269
|
+
opacity: n[l] ? 1 : 0.5
|
|
3270
3270
|
},
|
|
3271
3271
|
children: c
|
|
3272
3272
|
})
|
|
@@ -3278,7 +3278,7 @@ let __tla = (async () => {
|
|
|
3278
3278
|
]
|
|
3279
3279
|
});
|
|
3280
3280
|
}
|
|
3281
|
-
const wr = ({ config:
|
|
3281
|
+
const wr = ({ config: n, spacingType: r, scanUrl: t, formMeasurements: o, onComplete: s, isDebugUser: l = false, onAnalyticsEvent: c, wasmModule: a }) => {
|
|
3282
3282
|
const [e, m] = W(null), [d, f] = W(0), [u, x] = W(false), [C, p] = W(false), [g, y] = W(""), [P, v] = W("3D"), [S, A] = W(r === "AK" ? 2 : 1), [w, k] = W(false), [h, z] = W(null), [L, _] = W(r ?? null), [D, E] = W("mm"), [V, G] = W(false), [q, ye] = W(""), [ae, fe] = W(false), [re, ee] = W(false), [Y, ue] = W(false), [Z, pe] = W(false), [me, he] = W(null), [H, ne] = W(null), [xe, we] = W(null), [be, oe] = W(false), [N, X] = W([]), [Pe, ke] = W(null), [Ne, ie] = W(null), [Ae, wt] = W(null), [St, jt] = W(null), [Wn, Vt] = W(false), [vt, Nt] = W(null), [Ct, Le] = W(null), [De, Bn] = W(false), [Xt, En] = W(ir), [Te, Gt] = W("obj"), [Se, zt] = W(o), [Ye, Mt] = W(true), [$e, tt] = W(false), [nt, Yt] = W(false), [ze, ot] = W(false), [Tn, At] = W(false), [Ze, $n] = W(null), [On, Hn] = W(void 0), [jn, Vn] = W(void 0), [Zt] = W("#c8c8c8"), [Nn] = W(1), [We, Xn] = W(false), [kt, Kt] = W([]), rt = le(null), Oe = le(null), it = le(false), Gn = le(null), Ft = le(null), Pt = le(null), Ke = Q(async () => {
|
|
3283
3283
|
if (Pt.current) try {
|
|
3284
3284
|
const b = Pt.current, I = () => {
|
|
@@ -3455,11 +3455,11 @@ let __tla = (async () => {
|
|
|
3455
3455
|
const ge = performance.now(), Ce = Oe.current ? await Mo(O, Oe.current, (te) => {
|
|
3456
3456
|
y(te), ve(`PREPROCESS: ${te}`);
|
|
3457
3457
|
}) : null;
|
|
3458
|
-
if (Ce) ve(`PREPROCESS: done in ${(performance.now() - ge).toFixed(0)}ms \u2014 unit=${Ce.detectedUnit}, scaled=${Ce.wasScaled}`),
|
|
3458
|
+
if (Ce) ve(`PREPROCESS: done in ${(performance.now() - ge).toFixed(0)}ms \u2014 unit=${Ce.detectedUnit}, scaled=${Ce.wasScaled}`), n.showAmputationModal && !r ? (z(Ce), k(true)) : Ue(Ce.geometry, Ce.wasScaled);
|
|
3459
3459
|
else {
|
|
3460
3460
|
y("Using fallback loader...");
|
|
3461
3461
|
const te = Ao(O);
|
|
3462
|
-
te ?
|
|
3462
|
+
te ? n.showAmputationModal && !r ? (z({
|
|
3463
3463
|
geometry: te,
|
|
3464
3464
|
wasScaled: false
|
|
3465
3465
|
}), k(true)) : Ue(te, false) : Le("Failed to parse the mesh.");
|
|
@@ -3471,18 +3471,18 @@ let __tla = (async () => {
|
|
|
3471
3471
|
}
|
|
3472
3472
|
}, [
|
|
3473
3473
|
We,
|
|
3474
|
-
|
|
3474
|
+
n.showAmputationModal,
|
|
3475
3475
|
r,
|
|
3476
3476
|
Ue
|
|
3477
3477
|
]);
|
|
3478
3478
|
U(() => {
|
|
3479
|
-
if (!
|
|
3479
|
+
if (!t || !We) return;
|
|
3480
3480
|
(async () => {
|
|
3481
3481
|
p(true), y("Loading scan...");
|
|
3482
3482
|
try {
|
|
3483
|
-
const I = await fetch(
|
|
3483
|
+
const I = await fetch(t);
|
|
3484
3484
|
if (!I.ok) throw new Error(`Failed to download scan: ${I.status}`);
|
|
3485
|
-
const R = new URL(
|
|
3485
|
+
const R = new URL(t).pathname.split("/").pop() || "scan.obj";
|
|
3486
3486
|
if (R.toLowerCase().endsWith(".stl")) {
|
|
3487
3487
|
const O = await I.arrayBuffer();
|
|
3488
3488
|
await Be(O, R);
|
|
@@ -3495,7 +3495,7 @@ let __tla = (async () => {
|
|
|
3495
3495
|
}
|
|
3496
3496
|
})();
|
|
3497
3497
|
}, [
|
|
3498
|
-
|
|
3498
|
+
t,
|
|
3499
3499
|
We
|
|
3500
3500
|
]);
|
|
3501
3501
|
const Zn = Q((b) => {
|
|
@@ -3608,19 +3608,19 @@ let __tla = (async () => {
|
|
|
3608
3608
|
en,
|
|
3609
3609
|
Z
|
|
3610
3610
|
]), _t = le(false), qn = Q(async () => {
|
|
3611
|
-
if (st(), X([]), ke(null), we(null), ie(null), wt(null), Nt(null), jt(null), tt(false), Yt(false), Mt(true), ue(false), pe(false), it.current = false, _t.current = false, at.current = false, v("3D"),
|
|
3611
|
+
if (st(), X([]), ke(null), we(null), ie(null), wt(null), Nt(null), jt(null), tt(false), Yt(false), Mt(true), ue(false), pe(false), it.current = false, _t.current = false, at.current = false, v("3D"), t && We) {
|
|
3612
3612
|
m(null);
|
|
3613
3613
|
try {
|
|
3614
|
-
const b = await fetch(
|
|
3614
|
+
const b = await fetch(t);
|
|
3615
3615
|
if (!b.ok) throw new Error(`Failed to download scan: ${b.status}`);
|
|
3616
|
-
const B = new URL(
|
|
3616
|
+
const B = new URL(t).pathname.split("/").pop() || "scan.obj";
|
|
3617
3617
|
B.toLowerCase().endsWith(".stl") ? await Be(await b.arrayBuffer(), B) : await Be(await b.text(), B);
|
|
3618
3618
|
} catch (b) {
|
|
3619
3619
|
Le(b instanceof Error ? b.message : "Failed to reload scan.");
|
|
3620
3620
|
}
|
|
3621
3621
|
}
|
|
3622
3622
|
}, [
|
|
3623
|
-
|
|
3623
|
+
t,
|
|
3624
3624
|
We,
|
|
3625
3625
|
Be,
|
|
3626
3626
|
st
|
|
@@ -3646,12 +3646,12 @@ let __tla = (async () => {
|
|
|
3646
3646
|
]), eo = Q((b) => {
|
|
3647
3647
|
$n(b), zt(b.circumferences), Mt(true), Yt(true);
|
|
3648
3648
|
}, []), tn = Q(async (b) => {
|
|
3649
|
-
if (!
|
|
3649
|
+
if (!s) return;
|
|
3650
3650
|
tt(false), At(false), ot(true);
|
|
3651
3651
|
const I = e ? await Ke().catch(() => {
|
|
3652
3652
|
}) : void 0;
|
|
3653
3653
|
try {
|
|
3654
|
-
|
|
3654
|
+
s({
|
|
3655
3655
|
spacingType: L ?? "BK",
|
|
3656
3656
|
sourceUnit: "mm",
|
|
3657
3657
|
fileFormat: Te,
|
|
@@ -3663,7 +3663,7 @@ let __tla = (async () => {
|
|
|
3663
3663
|
frontalHeight: Je,
|
|
3664
3664
|
transverseML: 0,
|
|
3665
3665
|
transverseAP: 0,
|
|
3666
|
-
scanUrl:
|
|
3666
|
+
scanUrl: t,
|
|
3667
3667
|
decision: "skip",
|
|
3668
3668
|
skipReason: b,
|
|
3669
3669
|
screenshots: I,
|
|
@@ -3673,7 +3673,7 @@ let __tla = (async () => {
|
|
|
3673
3673
|
ot(false);
|
|
3674
3674
|
}
|
|
3675
3675
|
}, [
|
|
3676
|
-
|
|
3676
|
+
s,
|
|
3677
3677
|
e,
|
|
3678
3678
|
L,
|
|
3679
3679
|
Te,
|
|
@@ -3681,7 +3681,7 @@ let __tla = (async () => {
|
|
|
3681
3681
|
Se,
|
|
3682
3682
|
N,
|
|
3683
3683
|
Je,
|
|
3684
|
-
|
|
3684
|
+
t,
|
|
3685
3685
|
Ke
|
|
3686
3686
|
]), It = le(null);
|
|
3687
3687
|
U(() => {
|
|
@@ -3697,7 +3697,7 @@ let __tla = (async () => {
|
|
|
3697
3697
|
He
|
|
3698
3698
|
]);
|
|
3699
3699
|
const Dt = Q(async (b) => {
|
|
3700
|
-
if (!
|
|
3700
|
+
if (!s || !e || N.length === 0 || !L) return;
|
|
3701
3701
|
ot(true);
|
|
3702
3702
|
const I = await Ke().catch(() => {
|
|
3703
3703
|
});
|
|
@@ -3715,7 +3715,7 @@ let __tla = (async () => {
|
|
|
3715
3715
|
} catch {
|
|
3716
3716
|
}
|
|
3717
3717
|
}
|
|
3718
|
-
|
|
3718
|
+
s({
|
|
3719
3719
|
spacingType: L,
|
|
3720
3720
|
sourceUnit: "mm",
|
|
3721
3721
|
fileFormat: Te,
|
|
@@ -3727,7 +3727,7 @@ let __tla = (async () => {
|
|
|
3727
3727
|
frontalHeight: (Ze == null ? void 0 : Ze.frontalHeight) ?? Je,
|
|
3728
3728
|
transverseML: B,
|
|
3729
3729
|
transverseAP: R,
|
|
3730
|
-
scanUrl:
|
|
3730
|
+
scanUrl: t,
|
|
3731
3731
|
decision: b,
|
|
3732
3732
|
userEnteredMeasurements: Ze ?? void 0,
|
|
3733
3733
|
screenshots: I,
|
|
@@ -3737,7 +3737,7 @@ let __tla = (async () => {
|
|
|
3737
3737
|
ot(false);
|
|
3738
3738
|
}
|
|
3739
3739
|
}, [
|
|
3740
|
-
|
|
3740
|
+
s,
|
|
3741
3741
|
e,
|
|
3742
3742
|
He,
|
|
3743
3743
|
N,
|
|
@@ -3746,7 +3746,7 @@ let __tla = (async () => {
|
|
|
3746
3746
|
Te,
|
|
3747
3747
|
Y,
|
|
3748
3748
|
Se,
|
|
3749
|
-
|
|
3749
|
+
t,
|
|
3750
3750
|
Ze,
|
|
3751
3751
|
Je,
|
|
3752
3752
|
Ke
|
|
@@ -3787,7 +3787,7 @@ let __tla = (async () => {
|
|
|
3787
3787
|
}
|
|
3788
3788
|
];
|
|
3789
3789
|
return F(wo.Provider, {
|
|
3790
|
-
value:
|
|
3790
|
+
value: n,
|
|
3791
3791
|
children: [
|
|
3792
3792
|
F("div", {
|
|
3793
3793
|
style: {
|
|
@@ -3800,7 +3800,7 @@ let __tla = (async () => {
|
|
|
3800
3800
|
height: "100%"
|
|
3801
3801
|
},
|
|
3802
3802
|
children: [
|
|
3803
|
-
|
|
3803
|
+
n.showToolbar && i("div", {
|
|
3804
3804
|
style: {
|
|
3805
3805
|
height: 83,
|
|
3806
3806
|
backgroundColor: "#9e9e9e",
|
|
@@ -3808,7 +3808,7 @@ let __tla = (async () => {
|
|
|
3808
3808
|
position: "relative",
|
|
3809
3809
|
overflow: "hidden"
|
|
3810
3810
|
},
|
|
3811
|
-
children:
|
|
3811
|
+
children: i("div", {
|
|
3812
3812
|
style: {
|
|
3813
3813
|
position: "absolute",
|
|
3814
3814
|
inset: 0,
|
|
@@ -3818,7 +3818,7 @@ let __tla = (async () => {
|
|
|
3818
3818
|
}
|
|
3819
3819
|
})
|
|
3820
3820
|
}),
|
|
3821
|
-
|
|
3821
|
+
i(Uo, {
|
|
3822
3822
|
steps: oo,
|
|
3823
3823
|
currentStep: no
|
|
3824
3824
|
}),
|
|
@@ -3838,14 +3838,14 @@ let __tla = (async () => {
|
|
|
3838
3838
|
minHeight: 0
|
|
3839
3839
|
},
|
|
3840
3840
|
children: [
|
|
3841
|
-
K && $e && L &&
|
|
3841
|
+
K && $e && L && i("div", {
|
|
3842
3842
|
style: {
|
|
3843
3843
|
width: 340,
|
|
3844
3844
|
flexShrink: 0,
|
|
3845
3845
|
borderRight: "1px solid #e0e0e0",
|
|
3846
3846
|
overflow: "hidden"
|
|
3847
3847
|
},
|
|
3848
|
-
children:
|
|
3848
|
+
children: i(rr, {
|
|
3849
3849
|
amputationType: L,
|
|
3850
3850
|
spacingInches: S,
|
|
3851
3851
|
scanMeasurements: N,
|
|
@@ -3866,11 +3866,11 @@ let __tla = (async () => {
|
|
|
3866
3866
|
minHeight: 0,
|
|
3867
3867
|
overflow: "hidden"
|
|
3868
3868
|
},
|
|
3869
|
-
onDragOver:
|
|
3870
|
-
onDragLeave:
|
|
3871
|
-
onDrop:
|
|
3869
|
+
onDragOver: n.showDragDrop ? Zn : void 0,
|
|
3870
|
+
onDragLeave: n.showDragDrop ? Kn : void 0,
|
|
3871
|
+
onDrop: n.showDragDrop ? Un : void 0,
|
|
3872
3872
|
children: [
|
|
3873
|
-
|
|
3873
|
+
n.showDragDrop && !e && !C && i("div", {
|
|
3874
3874
|
style: {
|
|
3875
3875
|
position: "absolute",
|
|
3876
3876
|
inset: 16,
|
|
@@ -3881,7 +3881,7 @@ let __tla = (async () => {
|
|
|
3881
3881
|
justifyContent: "center",
|
|
3882
3882
|
pointerEvents: "none"
|
|
3883
3883
|
},
|
|
3884
|
-
children: We ?
|
|
3884
|
+
children: We ? i("div", {
|
|
3885
3885
|
style: {
|
|
3886
3886
|
fontSize: 18,
|
|
3887
3887
|
color: "#aaa",
|
|
@@ -3894,7 +3894,7 @@ let __tla = (async () => {
|
|
|
3894
3894
|
textAlign: "center"
|
|
3895
3895
|
},
|
|
3896
3896
|
children: [
|
|
3897
|
-
|
|
3897
|
+
i("div", {
|
|
3898
3898
|
style: {
|
|
3899
3899
|
width: 32,
|
|
3900
3900
|
height: 32,
|
|
@@ -3905,7 +3905,7 @@ let __tla = (async () => {
|
|
|
3905
3905
|
margin: "0 auto 12px"
|
|
3906
3906
|
}
|
|
3907
3907
|
}),
|
|
3908
|
-
|
|
3908
|
+
i("div", {
|
|
3909
3909
|
style: {
|
|
3910
3910
|
fontSize: 16,
|
|
3911
3911
|
color: "#999",
|
|
@@ -3913,13 +3913,13 @@ let __tla = (async () => {
|
|
|
3913
3913
|
},
|
|
3914
3914
|
children: "Loading WASM module..."
|
|
3915
3915
|
}),
|
|
3916
|
-
|
|
3916
|
+
i("style", {
|
|
3917
3917
|
children: "@keyframes spin { to { transform: rotate(360deg); } }"
|
|
3918
3918
|
})
|
|
3919
3919
|
]
|
|
3920
3920
|
})
|
|
3921
3921
|
}),
|
|
3922
|
-
!
|
|
3922
|
+
!n.showDragDrop && !e && !C && !Ct && i("div", {
|
|
3923
3923
|
style: {
|
|
3924
3924
|
position: "absolute",
|
|
3925
3925
|
inset: 0,
|
|
@@ -3932,7 +3932,7 @@ let __tla = (async () => {
|
|
|
3932
3932
|
textAlign: "center"
|
|
3933
3933
|
},
|
|
3934
3934
|
children: [
|
|
3935
|
-
|
|
3935
|
+
i("div", {
|
|
3936
3936
|
style: {
|
|
3937
3937
|
width: 32,
|
|
3938
3938
|
height: 32,
|
|
@@ -3943,7 +3943,7 @@ let __tla = (async () => {
|
|
|
3943
3943
|
margin: "0 auto 12px"
|
|
3944
3944
|
}
|
|
3945
3945
|
}),
|
|
3946
|
-
|
|
3946
|
+
i("div", {
|
|
3947
3947
|
style: {
|
|
3948
3948
|
fontSize: 16,
|
|
3949
3949
|
color: "#999",
|
|
@@ -3951,7 +3951,7 @@ let __tla = (async () => {
|
|
|
3951
3951
|
},
|
|
3952
3952
|
children: "Loading scan..."
|
|
3953
3953
|
}),
|
|
3954
|
-
|
|
3954
|
+
i("style", {
|
|
3955
3955
|
children: "@keyframes spin { to { transform: rotate(360deg); } }"
|
|
3956
3956
|
})
|
|
3957
3957
|
]
|
|
@@ -3976,7 +3976,7 @@ let __tla = (async () => {
|
|
|
3976
3976
|
fontFamily: "system-ui, sans-serif"
|
|
3977
3977
|
},
|
|
3978
3978
|
children: [
|
|
3979
|
-
|
|
3979
|
+
i("div", {
|
|
3980
3980
|
style: {
|
|
3981
3981
|
width: 10,
|
|
3982
3982
|
height: 10,
|
|
@@ -4008,7 +4008,7 @@ let __tla = (async () => {
|
|
|
4008
4008
|
fontFamily: "system-ui, sans-serif"
|
|
4009
4009
|
},
|
|
4010
4010
|
children: [
|
|
4011
|
-
|
|
4011
|
+
i("div", {
|
|
4012
4012
|
style: {
|
|
4013
4013
|
width: 10,
|
|
4014
4014
|
height: 10,
|
|
@@ -4020,17 +4020,17 @@ let __tla = (async () => {
|
|
|
4020
4020
|
"Click mesh to set Origin"
|
|
4021
4021
|
]
|
|
4022
4022
|
}),
|
|
4023
|
-
C &&
|
|
4023
|
+
C && i(hn, {
|
|
4024
4024
|
message: g || "Processing mesh..."
|
|
4025
4025
|
}),
|
|
4026
|
-
V &&
|
|
4026
|
+
V && i(hn, {
|
|
4027
4027
|
message: q
|
|
4028
4028
|
}),
|
|
4029
|
-
Ct &&
|
|
4029
|
+
Ct && i(Do, {
|
|
4030
4030
|
message: Ct,
|
|
4031
4031
|
onDismiss: () => Le(null)
|
|
4032
4032
|
}),
|
|
4033
|
-
|
|
4033
|
+
n.showAmputationModal && w && i("div", {
|
|
4034
4034
|
style: {
|
|
4035
4035
|
position: "absolute",
|
|
4036
4036
|
inset: 0,
|
|
@@ -4056,7 +4056,7 @@ let __tla = (async () => {
|
|
|
4056
4056
|
padding: "24px 24px 20px"
|
|
4057
4057
|
},
|
|
4058
4058
|
children: [
|
|
4059
|
-
|
|
4059
|
+
i("div", {
|
|
4060
4060
|
style: {
|
|
4061
4061
|
fontSize: 20,
|
|
4062
4062
|
fontWeight: 500,
|
|
@@ -4065,7 +4065,7 @@ let __tla = (async () => {
|
|
|
4065
4065
|
},
|
|
4066
4066
|
children: "Select Spacing Type"
|
|
4067
4067
|
}),
|
|
4068
|
-
|
|
4068
|
+
i("div", {
|
|
4069
4069
|
style: {
|
|
4070
4070
|
fontSize: 14,
|
|
4071
4071
|
color: "rgba(0,0,0,0.54)",
|
|
@@ -4073,7 +4073,7 @@ let __tla = (async () => {
|
|
|
4073
4073
|
},
|
|
4074
4074
|
children: "Choose the measurement spacing for this scan"
|
|
4075
4075
|
}),
|
|
4076
|
-
|
|
4076
|
+
i("div", {
|
|
4077
4077
|
style: {
|
|
4078
4078
|
display: "flex",
|
|
4079
4079
|
gap: 16
|
|
@@ -4096,7 +4096,7 @@ let __tla = (async () => {
|
|
|
4096
4096
|
transition: "border-color 0.15s, background-color 0.15s"
|
|
4097
4097
|
},
|
|
4098
4098
|
children: [
|
|
4099
|
-
|
|
4099
|
+
i("input", {
|
|
4100
4100
|
type: "radio",
|
|
4101
4101
|
name: "ampType",
|
|
4102
4102
|
checked: L === b,
|
|
@@ -4108,7 +4108,7 @@ let __tla = (async () => {
|
|
|
4108
4108
|
height: 18
|
|
4109
4109
|
}
|
|
4110
4110
|
}),
|
|
4111
|
-
|
|
4111
|
+
i("span", {
|
|
4112
4112
|
style: {
|
|
4113
4113
|
fontSize: 18,
|
|
4114
4114
|
fontWeight: 600,
|
|
@@ -4141,7 +4141,7 @@ let __tla = (async () => {
|
|
|
4141
4141
|
borderTop: "1px solid #e0e0e0"
|
|
4142
4142
|
},
|
|
4143
4143
|
children: [
|
|
4144
|
-
|
|
4144
|
+
i("button", {
|
|
4145
4145
|
onClick: () => {
|
|
4146
4146
|
k(false), z(null);
|
|
4147
4147
|
},
|
|
@@ -4160,7 +4160,7 @@ let __tla = (async () => {
|
|
|
4160
4160
|
},
|
|
4161
4161
|
children: "Cancel"
|
|
4162
4162
|
}),
|
|
4163
|
-
|
|
4163
|
+
i("button", {
|
|
4164
4164
|
onClick: () => L && Jn(L),
|
|
4165
4165
|
disabled: !L,
|
|
4166
4166
|
style: {
|
|
@@ -4183,7 +4183,7 @@ let __tla = (async () => {
|
|
|
4183
4183
|
]
|
|
4184
4184
|
})
|
|
4185
4185
|
}),
|
|
4186
|
-
|
|
4186
|
+
n.showDragDrop && u && i("div", {
|
|
4187
4187
|
style: {
|
|
4188
4188
|
position: "absolute",
|
|
4189
4189
|
inset: 0,
|
|
@@ -4193,7 +4193,7 @@ let __tla = (async () => {
|
|
|
4193
4193
|
zIndex: 10
|
|
4194
4194
|
}
|
|
4195
4195
|
}),
|
|
4196
|
-
|
|
4196
|
+
i(Io, {
|
|
4197
4197
|
children: F(ho, {
|
|
4198
4198
|
camera: {
|
|
4199
4199
|
position: [
|
|
@@ -4214,10 +4214,10 @@ let __tla = (async () => {
|
|
|
4214
4214
|
background: De ? new $.Color("#070611") : null
|
|
4215
4215
|
},
|
|
4216
4216
|
children: [
|
|
4217
|
-
|
|
4217
|
+
i("ambientLight", {
|
|
4218
4218
|
intensity: 0.4
|
|
4219
4219
|
}),
|
|
4220
|
-
|
|
4220
|
+
i("directionalLight", {
|
|
4221
4221
|
position: [
|
|
4222
4222
|
10,
|
|
4223
4223
|
10,
|
|
@@ -4225,7 +4225,7 @@ let __tla = (async () => {
|
|
|
4225
4225
|
],
|
|
4226
4226
|
intensity: 1.2
|
|
4227
4227
|
}),
|
|
4228
|
-
|
|
4228
|
+
i("directionalLight", {
|
|
4229
4229
|
position: [
|
|
4230
4230
|
-5,
|
|
4231
4231
|
5,
|
|
@@ -4233,7 +4233,7 @@ let __tla = (async () => {
|
|
|
4233
4233
|
],
|
|
4234
4234
|
intensity: 0.4
|
|
4235
4235
|
}),
|
|
4236
|
-
|
|
4236
|
+
i("directionalLight", {
|
|
4237
4237
|
position: [
|
|
4238
4238
|
0,
|
|
4239
4239
|
-10,
|
|
@@ -4241,7 +4241,7 @@ let __tla = (async () => {
|
|
|
4241
4241
|
],
|
|
4242
4242
|
intensity: 0.2
|
|
4243
4243
|
}),
|
|
4244
|
-
e && P === "3D" &&
|
|
4244
|
+
e && P === "3D" && i(Wo, {
|
|
4245
4245
|
mesh: e,
|
|
4246
4246
|
maxPoints: 2,
|
|
4247
4247
|
meshColor: Zt,
|
|
@@ -4249,7 +4249,7 @@ let __tla = (async () => {
|
|
|
4249
4249
|
frontFaceOnly: Z,
|
|
4250
4250
|
doubleShellTransparency: Y && K
|
|
4251
4251
|
}),
|
|
4252
|
-
e && P === "3D" &&
|
|
4252
|
+
e && P === "3D" && i(Eo, {
|
|
4253
4253
|
modelSize: d,
|
|
4254
4254
|
labels: [
|
|
4255
4255
|
L === "AK" ? "IT" : "MPT",
|
|
@@ -4257,7 +4257,7 @@ let __tla = (async () => {
|
|
|
4257
4257
|
"Cut Plane"
|
|
4258
4258
|
]
|
|
4259
4259
|
}),
|
|
4260
|
-
|
|
4260
|
+
i(Go, {
|
|
4261
4261
|
modelSize: d,
|
|
4262
4262
|
isAligned: K,
|
|
4263
4263
|
isCut: Lt,
|
|
@@ -4268,10 +4268,10 @@ let __tla = (async () => {
|
|
|
4268
4268
|
measurementGeometry: xe,
|
|
4269
4269
|
resetCameraToFrontRef: Ft
|
|
4270
4270
|
}),
|
|
4271
|
-
!K &&
|
|
4271
|
+
!K && i(Sn, {
|
|
4272
4272
|
enableDamping: false
|
|
4273
4273
|
}),
|
|
4274
|
-
K && N.length > 0 && e && P === "3D" &&
|
|
4274
|
+
K && N.length > 0 && e && P === "3D" && i(Yo, {
|
|
4275
4275
|
mesh: e,
|
|
4276
4276
|
isDragging: Wn
|
|
4277
4277
|
}),
|
|
@@ -4279,7 +4279,7 @@ let __tla = (async () => {
|
|
|
4279
4279
|
const I = e.geometry.getIndex();
|
|
4280
4280
|
if (!I || I.count < 30) return null;
|
|
4281
4281
|
const B = T[2], R = T[0], J = Ne ?? B.position.y, O = Ae ?? St ?? R.position.y;
|
|
4282
|
-
return P === "2D" ?
|
|
4282
|
+
return P === "2D" ? i(Jo, {
|
|
4283
4283
|
mesh: He ?? e,
|
|
4284
4284
|
upperY: O,
|
|
4285
4285
|
originY: R.position.y,
|
|
@@ -4288,7 +4288,7 @@ let __tla = (async () => {
|
|
|
4288
4288
|
displayUnit: D
|
|
4289
4289
|
}) : F(Ee, {
|
|
4290
4290
|
children: [
|
|
4291
|
-
|
|
4291
|
+
i(Vo, {
|
|
4292
4292
|
mesh: He ?? e,
|
|
4293
4293
|
startY: J,
|
|
4294
4294
|
endY: O,
|
|
@@ -4302,7 +4302,7 @@ let __tla = (async () => {
|
|
|
4302
4302
|
originY: vt ?? R.position.y,
|
|
4303
4303
|
wasmSlices: Pe
|
|
4304
4304
|
}),
|
|
4305
|
-
|
|
4305
|
+
i(Xo, {
|
|
4306
4306
|
mesh: e,
|
|
4307
4307
|
greenY: vt ?? R.position.y,
|
|
4308
4308
|
modelSize: d,
|
|
@@ -4310,7 +4310,7 @@ let __tla = (async () => {
|
|
|
4310
4310
|
bottomY: Y ? B.position.y : void 0,
|
|
4311
4311
|
formHeight: $e ? jn : Ye ? Ze == null ? void 0 : Ze.frontalHeight : void 0
|
|
4312
4312
|
}),
|
|
4313
|
-
|
|
4313
|
+
i(Qo, {
|
|
4314
4314
|
mesh: e,
|
|
4315
4315
|
yPosition: vt ?? R.position.y,
|
|
4316
4316
|
onYChange: (ge) => {
|
|
@@ -4331,10 +4331,10 @@ let __tla = (async () => {
|
|
|
4331
4331
|
]
|
|
4332
4332
|
});
|
|
4333
4333
|
})(),
|
|
4334
|
-
e && K && P === "3D" && De &&
|
|
4334
|
+
e && K && P === "3D" && De && i(xr, {
|
|
4335
4335
|
mesh: e
|
|
4336
4336
|
}),
|
|
4337
|
-
e &&
|
|
4337
|
+
e && n.showDebug && De && P === "3D" && i(mr, {
|
|
4338
4338
|
mesh: e,
|
|
4339
4339
|
modelSize: d,
|
|
4340
4340
|
layers: Xt,
|
|
@@ -4344,7 +4344,7 @@ let __tla = (async () => {
|
|
|
4344
4344
|
aoGeometry: H,
|
|
4345
4345
|
measurementGeometry: xe
|
|
4346
4346
|
}),
|
|
4347
|
-
|
|
4347
|
+
i(Sr, {
|
|
4348
4348
|
screenshotFnRef: Gn,
|
|
4349
4349
|
mesh: e,
|
|
4350
4350
|
modelSize: d,
|
|
@@ -4363,7 +4363,7 @@ let __tla = (async () => {
|
|
|
4363
4363
|
gap: 8
|
|
4364
4364
|
},
|
|
4365
4365
|
children: [
|
|
4366
|
-
|
|
4366
|
+
n.showStartOver && i("button", {
|
|
4367
4367
|
onClick: () => window.location.reload(),
|
|
4368
4368
|
style: {
|
|
4369
4369
|
padding: "6px 16px",
|
|
@@ -4380,7 +4380,7 @@ let __tla = (async () => {
|
|
|
4380
4380
|
},
|
|
4381
4381
|
children: "Start Over"
|
|
4382
4382
|
}),
|
|
4383
|
-
!K && T.length >= 1 &&
|
|
4383
|
+
!K && T.length >= 1 && i("button", {
|
|
4384
4384
|
onClick: Yn,
|
|
4385
4385
|
style: {
|
|
4386
4386
|
padding: "6px 16px",
|
|
@@ -4397,7 +4397,7 @@ let __tla = (async () => {
|
|
|
4397
4397
|
},
|
|
4398
4398
|
children: "Reset Points"
|
|
4399
4399
|
}),
|
|
4400
|
-
K && !nt &&
|
|
4400
|
+
K && !nt && i("button", {
|
|
4401
4401
|
onClick: qn,
|
|
4402
4402
|
style: {
|
|
4403
4403
|
padding: "6px 16px",
|
|
@@ -4416,7 +4416,7 @@ let __tla = (async () => {
|
|
|
4416
4416
|
})
|
|
4417
4417
|
]
|
|
4418
4418
|
}),
|
|
4419
|
-
|
|
4419
|
+
n.showDebug && De && e && P === "3D" && i(br, {
|
|
4420
4420
|
layers: Xt,
|
|
4421
4421
|
onToggleLayer: (b) => En((I) => ({
|
|
4422
4422
|
...I,
|
|
@@ -4443,7 +4443,7 @@ let __tla = (async () => {
|
|
|
4443
4443
|
boxShadow: "0 2px 8px rgba(0,0,0,0.1)"
|
|
4444
4444
|
},
|
|
4445
4445
|
children: [
|
|
4446
|
-
|
|
4446
|
+
i("button", {
|
|
4447
4447
|
onClick: () => v("3D"),
|
|
4448
4448
|
style: {
|
|
4449
4449
|
padding: "6px 14px",
|
|
@@ -4457,7 +4457,7 @@ let __tla = (async () => {
|
|
|
4457
4457
|
},
|
|
4458
4458
|
children: "Orbital"
|
|
4459
4459
|
}),
|
|
4460
|
-
|
|
4460
|
+
i("button", {
|
|
4461
4461
|
onClick: () => v("2D"),
|
|
4462
4462
|
style: {
|
|
4463
4463
|
padding: "6px 14px",
|
|
@@ -4483,7 +4483,7 @@ let __tla = (async () => {
|
|
|
4483
4483
|
boxShadow: "0 2px 8px rgba(0,0,0,0.1)"
|
|
4484
4484
|
},
|
|
4485
4485
|
children: [
|
|
4486
|
-
|
|
4486
|
+
i("button", {
|
|
4487
4487
|
onClick: () => E("mm"),
|
|
4488
4488
|
style: {
|
|
4489
4489
|
padding: "6px 14px",
|
|
@@ -4497,7 +4497,7 @@ let __tla = (async () => {
|
|
|
4497
4497
|
},
|
|
4498
4498
|
children: "mm"
|
|
4499
4499
|
}),
|
|
4500
|
-
|
|
4500
|
+
i("button", {
|
|
4501
4501
|
onClick: () => E("inch"),
|
|
4502
4502
|
style: {
|
|
4503
4503
|
padding: "6px 14px",
|
|
@@ -4514,7 +4514,7 @@ let __tla = (async () => {
|
|
|
4514
4514
|
})
|
|
4515
4515
|
]
|
|
4516
4516
|
}),
|
|
4517
|
-
|
|
4517
|
+
n.showSpacingToggle && P === "3D" && F("div", {
|
|
4518
4518
|
style: {
|
|
4519
4519
|
display: "flex",
|
|
4520
4520
|
borderRadius: 6,
|
|
@@ -4523,7 +4523,7 @@ let __tla = (async () => {
|
|
|
4523
4523
|
boxShadow: "0 2px 8px rgba(0,0,0,0.1)"
|
|
4524
4524
|
},
|
|
4525
4525
|
children: [
|
|
4526
|
-
|
|
4526
|
+
i("button", {
|
|
4527
4527
|
onClick: () => A(1),
|
|
4528
4528
|
style: {
|
|
4529
4529
|
padding: "6px 14px",
|
|
@@ -4537,7 +4537,7 @@ let __tla = (async () => {
|
|
|
4537
4537
|
},
|
|
4538
4538
|
children: '1"'
|
|
4539
4539
|
}),
|
|
4540
|
-
|
|
4540
|
+
i("button", {
|
|
4541
4541
|
onClick: () => A(2),
|
|
4542
4542
|
style: {
|
|
4543
4543
|
padding: "6px 14px",
|
|
@@ -4554,7 +4554,7 @@ let __tla = (async () => {
|
|
|
4554
4554
|
})
|
|
4555
4555
|
]
|
|
4556
4556
|
}),
|
|
4557
|
-
P === "3D" && Se &&
|
|
4557
|
+
P === "3D" && Se && i("div", {
|
|
4558
4558
|
style: {
|
|
4559
4559
|
display: "flex",
|
|
4560
4560
|
borderRadius: 6,
|
|
@@ -4562,7 +4562,7 @@ let __tla = (async () => {
|
|
|
4562
4562
|
border: "1px solid #ccc",
|
|
4563
4563
|
boxShadow: "0 2px 8px rgba(0,0,0,0.1)"
|
|
4564
4564
|
},
|
|
4565
|
-
children:
|
|
4565
|
+
children: i("button", {
|
|
4566
4566
|
onClick: () => Mt((b) => !b),
|
|
4567
4567
|
style: {
|
|
4568
4568
|
padding: "6px 14px",
|
|
@@ -4577,7 +4577,7 @@ let __tla = (async () => {
|
|
|
4577
4577
|
children: "Measurement Overlay"
|
|
4578
4578
|
})
|
|
4579
4579
|
}),
|
|
4580
|
-
|
|
4580
|
+
n.showSaveButton && i("div", {
|
|
4581
4581
|
style: {
|
|
4582
4582
|
display: "flex",
|
|
4583
4583
|
borderRadius: 6,
|
|
@@ -4585,7 +4585,7 @@ let __tla = (async () => {
|
|
|
4585
4585
|
border: "1px solid #ccc",
|
|
4586
4586
|
boxShadow: "0 2px 8px rgba(0,0,0,0.1)"
|
|
4587
4587
|
},
|
|
4588
|
-
children:
|
|
4588
|
+
children: i("button", {
|
|
4589
4589
|
onClick: async () => {
|
|
4590
4590
|
const b = await Ke();
|
|
4591
4591
|
if (!b) return;
|
|
@@ -4608,7 +4608,7 @@ let __tla = (async () => {
|
|
|
4608
4608
|
children: "Save"
|
|
4609
4609
|
})
|
|
4610
4610
|
}),
|
|
4611
|
-
|
|
4611
|
+
n.showDebug && l && i("div", {
|
|
4612
4612
|
style: {
|
|
4613
4613
|
display: "flex",
|
|
4614
4614
|
borderRadius: 6,
|
|
@@ -4616,7 +4616,7 @@ let __tla = (async () => {
|
|
|
4616
4616
|
border: "1px solid #ccc",
|
|
4617
4617
|
boxShadow: "0 2px 8px rgba(0,0,0,0.1)"
|
|
4618
4618
|
},
|
|
4619
|
-
children:
|
|
4619
|
+
children: i("button", {
|
|
4620
4620
|
onClick: () => Bn((b) => !b),
|
|
4621
4621
|
style: {
|
|
4622
4622
|
padding: "6px 14px",
|
|
@@ -4633,11 +4633,11 @@ let __tla = (async () => {
|
|
|
4633
4633
|
})
|
|
4634
4634
|
]
|
|
4635
4635
|
}),
|
|
4636
|
-
e && re &&
|
|
4636
|
+
e && re && i(Zo, {
|
|
4637
4637
|
wasAutoScaled: ae,
|
|
4638
4638
|
onDismiss: () => ee(false)
|
|
4639
4639
|
}),
|
|
4640
|
-
e && be && K &&
|
|
4640
|
+
e && be && K && i(Ko, {
|
|
4641
4641
|
isDoubleShell: Y,
|
|
4642
4642
|
onDismiss: () => oe(false)
|
|
4643
4643
|
})
|
|
@@ -4658,7 +4658,7 @@ let __tla = (async () => {
|
|
|
4658
4658
|
zIndex: 50
|
|
4659
4659
|
},
|
|
4660
4660
|
children: [
|
|
4661
|
-
|
|
4661
|
+
i("div", {
|
|
4662
4662
|
style: {
|
|
4663
4663
|
width: 32,
|
|
4664
4664
|
height: 32,
|
|
@@ -4668,7 +4668,7 @@ let __tla = (async () => {
|
|
|
4668
4668
|
animation: "gm-spin 0.8s linear infinite"
|
|
4669
4669
|
}
|
|
4670
4670
|
}),
|
|
4671
|
-
|
|
4671
|
+
i("p", {
|
|
4672
4672
|
style: {
|
|
4673
4673
|
marginTop: 12,
|
|
4674
4674
|
fontSize: 14,
|
|
@@ -4677,7 +4677,7 @@ let __tla = (async () => {
|
|
|
4677
4677
|
},
|
|
4678
4678
|
children: "Generating screenshots and preparing data\u2026"
|
|
4679
4679
|
}),
|
|
4680
|
-
|
|
4680
|
+
i("style", {
|
|
4681
4681
|
children: "@keyframes gm-spin { to { transform: rotate(360deg) } }"
|
|
4682
4682
|
})
|
|
4683
4683
|
]
|
|
@@ -4694,7 +4694,7 @@ let __tla = (async () => {
|
|
|
4694
4694
|
flexShrink: 0
|
|
4695
4695
|
},
|
|
4696
4696
|
children: [
|
|
4697
|
-
!$e &&
|
|
4697
|
+
!$e && s && i("button", {
|
|
4698
4698
|
disabled: ze,
|
|
4699
4699
|
onClick: () => At(true),
|
|
4700
4700
|
style: {
|
|
@@ -4712,14 +4712,14 @@ let __tla = (async () => {
|
|
|
4712
4712
|
},
|
|
4713
4713
|
children: "Have Galileo Check My Measurements"
|
|
4714
4714
|
}),
|
|
4715
|
-
$e &&
|
|
4715
|
+
$e && i("div", {}),
|
|
4716
4716
|
F("div", {
|
|
4717
4717
|
style: {
|
|
4718
4718
|
display: "flex",
|
|
4719
4719
|
gap: 8
|
|
4720
4720
|
},
|
|
4721
4721
|
children: [
|
|
4722
|
-
e && !K && T.length >= 2 &&
|
|
4722
|
+
e && !K && T.length >= 2 && i("button", {
|
|
4723
4723
|
onClick: Qn,
|
|
4724
4724
|
style: {
|
|
4725
4725
|
padding: "6px 16px",
|
|
@@ -4736,7 +4736,7 @@ let __tla = (async () => {
|
|
|
4736
4736
|
},
|
|
4737
4737
|
children: "Next \xBB"
|
|
4738
4738
|
}),
|
|
4739
|
-
K && nt && !$e &&
|
|
4739
|
+
K && nt && !$e && i("button", {
|
|
4740
4740
|
onClick: () => tt(true),
|
|
4741
4741
|
style: {
|
|
4742
4742
|
padding: "6px 16px",
|
|
@@ -4753,7 +4753,7 @@ let __tla = (async () => {
|
|
|
4753
4753
|
},
|
|
4754
4754
|
children: "Edit Measurements"
|
|
4755
4755
|
}),
|
|
4756
|
-
K && nt && (to ?
|
|
4756
|
+
K && nt && (to ? i("button", {
|
|
4757
4757
|
disabled: ze,
|
|
4758
4758
|
onClick: () => Dt("continue"),
|
|
4759
4759
|
style: {
|
|
@@ -4772,7 +4772,7 @@ let __tla = (async () => {
|
|
|
4772
4772
|
children: "Continue"
|
|
4773
4773
|
}) : F(Ee, {
|
|
4774
4774
|
children: [
|
|
4775
|
-
|
|
4775
|
+
i("button", {
|
|
4776
4776
|
disabled: ze,
|
|
4777
4777
|
onClick: () => Dt("use_form_measurements"),
|
|
4778
4778
|
style: {
|
|
@@ -4790,7 +4790,7 @@ let __tla = (async () => {
|
|
|
4790
4790
|
},
|
|
4791
4791
|
children: "Set to Measurements"
|
|
4792
4792
|
}),
|
|
4793
|
-
|
|
4793
|
+
i("button", {
|
|
4794
4794
|
disabled: ze,
|
|
4795
4795
|
onClick: () => Dt("use_scan"),
|
|
4796
4796
|
style: {
|
|
@@ -4840,7 +4840,7 @@ let __tla = (async () => {
|
|
|
4840
4840
|
flexShrink: 0
|
|
4841
4841
|
},
|
|
4842
4842
|
children: [
|
|
4843
|
-
|
|
4843
|
+
i("span", {
|
|
4844
4844
|
style: {
|
|
4845
4845
|
color: "#58a6ff",
|
|
4846
4846
|
fontSize: 10,
|
|
@@ -4873,7 +4873,7 @@ let __tla = (async () => {
|
|
|
4873
4873
|
" slices"
|
|
4874
4874
|
]
|
|
4875
4875
|
}),
|
|
4876
|
-
|
|
4876
|
+
i("button", {
|
|
4877
4877
|
onClick: () => Kt([]),
|
|
4878
4878
|
style: {
|
|
4879
4879
|
background: "none",
|
|
@@ -4890,7 +4890,7 @@ let __tla = (async () => {
|
|
|
4890
4890
|
})
|
|
4891
4891
|
]
|
|
4892
4892
|
}),
|
|
4893
|
-
|
|
4893
|
+
i("div", {
|
|
4894
4894
|
ref: rt,
|
|
4895
4895
|
style: {
|
|
4896
4896
|
flex: 1,
|
|
@@ -4900,7 +4900,7 @@ let __tla = (async () => {
|
|
|
4900
4900
|
},
|
|
4901
4901
|
children: kt.map((b, I) => {
|
|
4902
4902
|
const B = b.includes("ERROR") || b.includes("failed"), R = b.includes("warning") || b.includes("WARN"), J = b.includes("PIPELINE:"), O = b.includes("STATE:");
|
|
4903
|
-
return
|
|
4903
|
+
return i("div", {
|
|
4904
4904
|
style: {
|
|
4905
4905
|
color: B ? "#f85149" : R ? "#d29922" : J ? "#58a6ff" : O ? "#3fb950" : "#8b949e",
|
|
4906
4906
|
whiteSpace: "pre"
|
|
@@ -4913,111 +4913,108 @@ let __tla = (async () => {
|
|
|
4913
4913
|
})
|
|
4914
4914
|
]
|
|
4915
4915
|
}),
|
|
4916
|
-
Tn &&
|
|
4916
|
+
Tn && i(Ln, {
|
|
4917
4917
|
onSkip: tn,
|
|
4918
4918
|
onCancel: () => At(false)
|
|
4919
4919
|
})
|
|
4920
4920
|
]
|
|
4921
4921
|
});
|
|
4922
4922
|
};
|
|
4923
|
-
function Sr({ screenshotFnRef:
|
|
4923
|
+
function Sr({ screenshotFnRef: n }) {
|
|
4924
4924
|
return U(() => {
|
|
4925
|
-
|
|
4925
|
+
n.current = null;
|
|
4926
4926
|
}, [
|
|
4927
|
-
|
|
4927
|
+
n
|
|
4928
4928
|
]), null;
|
|
4929
4929
|
}
|
|
4930
|
-
Rn = function(
|
|
4931
|
-
const r =
|
|
4932
|
-
for (let o = 2; o >= 1; o -= r)
|
|
4933
|
-
|
|
4934
|
-
for (let o = r; o <= 9; o += r)
|
|
4935
|
-
if (
|
|
4930
|
+
Rn = function(n) {
|
|
4931
|
+
const r = n === "AK" ? 2 : 1, t = [];
|
|
4932
|
+
for (let o = 2; o >= 1; o -= r) t.push(`${o}_above`);
|
|
4933
|
+
t.push("at_ref");
|
|
4934
|
+
for (let o = r; o <= 9; o += r) t.push(`${o}_below`);
|
|
4935
|
+
if (n === "BK") for (const o of [
|
|
4936
4936
|
10,
|
|
4937
4937
|
11,
|
|
4938
4938
|
12
|
|
4939
|
-
])
|
|
4939
|
+
]) t.push(`${o}_below`);
|
|
4940
4940
|
else for (const o of [
|
|
4941
4941
|
10,
|
|
4942
4942
|
12,
|
|
4943
4943
|
14,
|
|
4944
4944
|
16,
|
|
4945
4945
|
18
|
|
4946
|
-
])
|
|
4947
|
-
return
|
|
4946
|
+
]) t.push(`${o}_below`);
|
|
4947
|
+
return t;
|
|
4948
4948
|
};
|
|
4949
|
-
ht = function(
|
|
4950
|
-
const
|
|
4951
|
-
for (let
|
|
4952
|
-
const l =
|
|
4953
|
-
l != null && !isNaN(l) && (o[
|
|
4949
|
+
ht = function(n, r) {
|
|
4950
|
+
const t = Rn(r), o = {};
|
|
4951
|
+
for (let s = 0; s < Math.min(n.length, t.length); s++) {
|
|
4952
|
+
const l = n[s];
|
|
4953
|
+
l != null && !isNaN(l) && (o[t[s]] = l);
|
|
4954
4954
|
}
|
|
4955
4955
|
return o;
|
|
4956
4956
|
};
|
|
4957
|
-
vr = function(
|
|
4958
|
-
if (!
|
|
4959
|
-
const o = Rn(r).map((
|
|
4960
|
-
const l =
|
|
4957
|
+
vr = function(n, r) {
|
|
4958
|
+
if (!n) return;
|
|
4959
|
+
const o = Rn(r).map((s) => {
|
|
4960
|
+
const l = n[s];
|
|
4961
4961
|
return l ?? void 0;
|
|
4962
4962
|
});
|
|
4963
|
-
if (!o.every((
|
|
4963
|
+
if (!o.every((s) => s == null)) return o;
|
|
4964
4964
|
};
|
|
4965
|
-
function Cr(
|
|
4966
|
-
const r =
|
|
4965
|
+
function Cr(n) {
|
|
4966
|
+
const r = n.getAttribute("position");
|
|
4967
4967
|
if (!r) return "";
|
|
4968
|
-
const
|
|
4968
|
+
const t = [
|
|
4969
4969
|
"# Galileo processed mesh"
|
|
4970
4970
|
];
|
|
4971
|
-
for (let l = 0; l < r.count; l++)
|
|
4972
|
-
const o =
|
|
4973
|
-
if (o) for (let l = 0; l < o.count; l++)
|
|
4974
|
-
const
|
|
4975
|
-
if (
|
|
4976
|
-
const c =
|
|
4977
|
-
o ?
|
|
4971
|
+
for (let l = 0; l < r.count; l++) t.push(`v ${r.getX(l)} ${r.getY(l)} ${r.getZ(l)}`);
|
|
4972
|
+
const o = n.getAttribute("normal");
|
|
4973
|
+
if (o) for (let l = 0; l < o.count; l++) t.push(`vn ${o.getX(l)} ${o.getY(l)} ${o.getZ(l)}`);
|
|
4974
|
+
const s = n.getIndex();
|
|
4975
|
+
if (s) for (let l = 0; l < s.count; l += 3) {
|
|
4976
|
+
const c = s.getX(l) + 1, a = s.getX(l + 1) + 1, e = s.getX(l + 2) + 1;
|
|
4977
|
+
o ? t.push(`f ${c}//${c} ${a}//${a} ${e}//${e}`) : t.push(`f ${c} ${a} ${e}`);
|
|
4978
4978
|
}
|
|
4979
4979
|
else for (let l = 0; l < r.count; l += 3) {
|
|
4980
4980
|
const c = l + 1, a = l + 2, e = l + 3;
|
|
4981
|
-
o ?
|
|
4981
|
+
o ? t.push(`f ${c}//${c} ${a}//${a} ${e}//${e}`) : t.push(`f ${c} ${a} ${e}`);
|
|
4982
4982
|
}
|
|
4983
|
-
return
|
|
4983
|
+
return t.join(`
|
|
4984
4984
|
`);
|
|
4985
4985
|
}
|
|
4986
|
-
async function zr(
|
|
4987
|
-
for (let
|
|
4988
|
-
const
|
|
4986
|
+
async function zr(n, r) {
|
|
4987
|
+
for (let t = 0; t < 3; t++) try {
|
|
4988
|
+
const o = await fetch(n, {
|
|
4989
4989
|
method: "PUT",
|
|
4990
|
-
body: r
|
|
4991
|
-
headers: {
|
|
4992
|
-
"Content-Type": n
|
|
4993
|
-
}
|
|
4990
|
+
body: r
|
|
4994
4991
|
});
|
|
4995
|
-
if (
|
|
4992
|
+
if (o.ok) return {
|
|
4996
4993
|
success: true,
|
|
4997
|
-
status:
|
|
4994
|
+
status: o.status
|
|
4998
4995
|
};
|
|
4999
|
-
if (
|
|
4996
|
+
if (o.status >= 400 && o.status < 500) return {
|
|
5000
4997
|
success: false,
|
|
5001
|
-
status:
|
|
5002
|
-
error: `HTTP ${
|
|
4998
|
+
status: o.status,
|
|
4999
|
+
error: `HTTP ${o.status}: ${o.statusText}`
|
|
5003
5000
|
};
|
|
5004
|
-
if (
|
|
5005
|
-
await new Promise((
|
|
5001
|
+
if (t < 2) {
|
|
5002
|
+
await new Promise((s) => setTimeout(s, (t + 1) * 1e3));
|
|
5006
5003
|
continue;
|
|
5007
5004
|
}
|
|
5008
5005
|
return {
|
|
5009
5006
|
success: false,
|
|
5010
|
-
status:
|
|
5011
|
-
error: `HTTP ${
|
|
5007
|
+
status: o.status,
|
|
5008
|
+
error: `HTTP ${o.status}: ${o.statusText}`
|
|
5012
5009
|
};
|
|
5013
|
-
} catch (
|
|
5014
|
-
if (
|
|
5015
|
-
await new Promise((
|
|
5010
|
+
} catch (o) {
|
|
5011
|
+
if (t < 2) {
|
|
5012
|
+
await new Promise((s) => setTimeout(s, (t + 1) * 1e3));
|
|
5016
5013
|
continue;
|
|
5017
5014
|
}
|
|
5018
5015
|
return {
|
|
5019
5016
|
success: false,
|
|
5020
|
-
error:
|
|
5017
|
+
error: o instanceof Error ? o.message : String(o)
|
|
5021
5018
|
};
|
|
5022
5019
|
}
|
|
5023
5020
|
return {
|
|
@@ -5025,15 +5022,15 @@ let __tla = (async () => {
|
|
|
5025
5022
|
error: "Upload failed after 3 attempts"
|
|
5026
5023
|
};
|
|
5027
5024
|
}
|
|
5028
|
-
Rr = ({ request:
|
|
5029
|
-
const [o,
|
|
5025
|
+
Rr = ({ request: n, onComplete: r, wasmModule: t }) => {
|
|
5026
|
+
const [o, s] = W(null);
|
|
5030
5027
|
U(() => {
|
|
5031
|
-
if (
|
|
5028
|
+
if (t != null) return;
|
|
5032
5029
|
let e = false;
|
|
5033
5030
|
const m = async (d) => {
|
|
5034
5031
|
try {
|
|
5035
5032
|
const f = await import("./geo_wasm-CDwm1q1Z.js");
|
|
5036
|
-
await f.default(), e ||
|
|
5033
|
+
await f.default(), e || s(f);
|
|
5037
5034
|
} catch (f) {
|
|
5038
5035
|
if (d < 2 && !e) {
|
|
5039
5036
|
const u = (d + 1) * 1e3 + d * 1e3;
|
|
@@ -5045,52 +5042,50 @@ let __tla = (async () => {
|
|
|
5045
5042
|
e = true;
|
|
5046
5043
|
};
|
|
5047
5044
|
}, [
|
|
5048
|
-
|
|
5045
|
+
t
|
|
5049
5046
|
]);
|
|
5050
|
-
const l =
|
|
5051
|
-
|
|
5052
|
-
|
|
5047
|
+
const l = t !== void 0 ? t : o ?? void 0, c = j(() => vr(n.form_measurements, n.spacing_type), [
|
|
5048
|
+
n.form_measurements,
|
|
5049
|
+
n.spacing_type
|
|
5053
5050
|
]), a = async (e) => {
|
|
5054
5051
|
var _a, _b;
|
|
5055
|
-
const m = e.scanMeasurements.map((v) => +(v.modifiedValue ?? v.originalValue).toFixed(1)), d = ht(m,
|
|
5052
|
+
const m = e.scanMeasurements.map((v) => +(v.modifiedValue ?? v.originalValue).toFixed(1)), d = ht(m, n.spacing_type);
|
|
5056
5053
|
let f, u;
|
|
5057
5054
|
if (e.formMeasurements) {
|
|
5058
|
-
f = ht(e.formMeasurements,
|
|
5055
|
+
f = ht(e.formMeasurements, n.spacing_type);
|
|
5059
5056
|
const v = e.scanMeasurements.map((S, A) => {
|
|
5060
5057
|
var _a2;
|
|
5061
5058
|
const w = (_a2 = e.formMeasurements) == null ? void 0 : _a2[A];
|
|
5062
5059
|
return w == null || isNaN(w) ? null : +((S.modifiedValue ?? S.originalValue) - w).toFixed(1);
|
|
5063
5060
|
});
|
|
5064
|
-
u = ht(v,
|
|
5061
|
+
u = ht(v, n.spacing_type);
|
|
5065
5062
|
}
|
|
5066
|
-
const x = e.userEnteredMeasurements ? ht(e.userEnteredMeasurements.circumferences,
|
|
5063
|
+
const x = e.userEnteredMeasurements ? ht(e.userEnteredMeasurements.circumferences, n.spacing_type) : void 0, C = e.decision === "use_scan" || e.decision === "continue", p = C ? d : x ?? f ?? d, g = C ? +e.frontalHeight.toFixed(1) : +(((_a = e.userEnteredMeasurements) == null ? void 0 : _a.frontalHeight) ?? e.frontalHeight).toFixed(1);
|
|
5067
5064
|
let y;
|
|
5068
|
-
if (
|
|
5065
|
+
if (n.upload_url) if (!e.alignedGeometry) y = {
|
|
5069
5066
|
success: false,
|
|
5070
|
-
url:
|
|
5067
|
+
url: n.upload_url,
|
|
5071
5068
|
message: "No aligned geometry available \u2014 mesh processing may not have completed."
|
|
5072
5069
|
};
|
|
5073
5070
|
else try {
|
|
5074
5071
|
const v = Cr(e.alignedGeometry), S = new Blob([
|
|
5075
5072
|
v
|
|
5076
|
-
],
|
|
5077
|
-
type: "application/octet-stream"
|
|
5078
|
-
}), A = await zr(t.upload_url, S, "application/octet-stream");
|
|
5073
|
+
]), A = await zr(n.upload_url, S);
|
|
5079
5074
|
y = {
|
|
5080
5075
|
...A,
|
|
5081
|
-
url:
|
|
5076
|
+
url: n.upload_url,
|
|
5082
5077
|
message: A.success ? "Cleaned mesh uploaded successfully." : `Upload failed: ${A.error ?? "unknown error"}`
|
|
5083
5078
|
};
|
|
5084
5079
|
} catch (v) {
|
|
5085
5080
|
y = {
|
|
5086
5081
|
success: false,
|
|
5087
|
-
url:
|
|
5082
|
+
url: n.upload_url,
|
|
5088
5083
|
message: `Upload failed: ${v instanceof Error ? v.message : String(v)}`,
|
|
5089
5084
|
error: v instanceof Error ? v.message : String(v)
|
|
5090
5085
|
};
|
|
5091
5086
|
}
|
|
5092
5087
|
const P = {
|
|
5093
|
-
spacing_type:
|
|
5088
|
+
spacing_type: n.spacing_type,
|
|
5094
5089
|
source_unit: "mm",
|
|
5095
5090
|
file_format: e.fileFormat,
|
|
5096
5091
|
measurement_source: e.formMeasurements ? "form_provided" : "scan_derived",
|
|
@@ -5099,7 +5094,7 @@ let __tla = (async () => {
|
|
|
5099
5094
|
form_measurements: f,
|
|
5100
5095
|
scan_measurements: d,
|
|
5101
5096
|
measurement_variance: u,
|
|
5102
|
-
scan_url:
|
|
5097
|
+
scan_url: n.scan_url,
|
|
5103
5098
|
frontal_height: +e.frontalHeight.toFixed(1),
|
|
5104
5099
|
transverse_ml: +e.transverseML.toFixed(1),
|
|
5105
5100
|
transverse_ap: +e.transverseAP.toFixed(1),
|
|
@@ -5116,16 +5111,16 @@ let __tla = (async () => {
|
|
|
5116
5111
|
};
|
|
5117
5112
|
r == null ? void 0 : r(P);
|
|
5118
5113
|
};
|
|
5119
|
-
return
|
|
5114
|
+
return i("div", {
|
|
5120
5115
|
style: {
|
|
5121
5116
|
width: "100%",
|
|
5122
5117
|
height: "100%",
|
|
5123
5118
|
display: "flex"
|
|
5124
5119
|
},
|
|
5125
|
-
children:
|
|
5120
|
+
children: i(wr, {
|
|
5126
5121
|
config: bo,
|
|
5127
|
-
spacingType:
|
|
5128
|
-
scanUrl:
|
|
5122
|
+
spacingType: n.spacing_type,
|
|
5123
|
+
scanUrl: n.scan_url,
|
|
5129
5124
|
formMeasurements: c,
|
|
5130
5125
|
onComplete: a,
|
|
5131
5126
|
wasmModule: l
|