@solid-labs/fab-one-widget 1.0.14 → 1.0.16
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,16 +1,16 @@
|
|
|
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
|
-
import { useFrame as
|
|
4
|
-
import { Html as
|
|
3
|
+
import { useFrame as yn, useThree as wn, Canvas as ho } from "@react-three/fiber";
|
|
4
|
+
import { Html as je, Line as de, OrbitControls as Sn } from "@react-three/drei";
|
|
5
5
|
import * as $ from "three";
|
|
6
6
|
import { Plane as xt, Vector3 as M, Box3 as vn, Line3 as Cn, Raycaster as go } from "three";
|
|
7
7
|
import { create as mo } from "zustand";
|
|
8
8
|
import { OBJLoader as zn } from "three/examples/jsm/loaders/OBJLoader.js";
|
|
9
9
|
import { STLLoader as xo } from "three/examples/jsm/loaders/STLLoader.js";
|
|
10
|
-
import { MeshBVH as
|
|
10
|
+
import { MeshBVH as bt } from "three-mesh-bvh";
|
|
11
11
|
let Rr, ht, vr, Rn;
|
|
12
12
|
let __tla = (async () => {
|
|
13
|
-
const
|
|
13
|
+
const bo = {
|
|
14
14
|
showDragDrop: true,
|
|
15
15
|
showStartOver: true,
|
|
16
16
|
showDebug: true,
|
|
@@ -19,7 +19,7 @@ let __tla = (async () => {
|
|
|
19
19
|
showNavigation: true,
|
|
20
20
|
showToolbar: false,
|
|
21
21
|
showSaveButton: true
|
|
22
|
-
},
|
|
22
|
+
}, yo = {
|
|
23
23
|
showDragDrop: false,
|
|
24
24
|
showStartOver: false,
|
|
25
25
|
showDebug: false,
|
|
@@ -28,100 +28,100 @@ let __tla = (async () => {
|
|
|
28
28
|
showNavigation: false,
|
|
29
29
|
showToolbar: false,
|
|
30
30
|
showSaveButton: false
|
|
31
|
-
}, wo = co(
|
|
31
|
+
}, wo = co(bo), 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
|
|
66
66
|
})
|
|
67
|
-
})), So = 0.45,
|
|
67
|
+
})), So = 0.45, yt = 3, $t = 1e-3, gt = 25.4, vo = [
|
|
68
68
|
0.25,
|
|
69
69
|
-0.25,
|
|
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;
|
|
98
98
|
E < e && (e = E), E > f && (f = E), V < m && (m = V), V > u && (u = V), G < d && (d = G), G > x && (x = G);
|
|
99
99
|
}
|
|
100
|
-
const C = (e + f) * 0.5, p = (m + u) * 0.5, g = (d + x) * 0.5,
|
|
100
|
+
const C = (e + f) * 0.5, p = (m + u) * 0.5, g = (d + x) * 0.5, b = f - e + 1e-6, P = u - m + 1e-6, v = x - d + 1e-6, S = b * 0.5, A = P * 0.5, w = v * 0.5, k = Math.min(128, Math.max(16, Math.round(Math.cbrt(a)))), h = b / k, z = P / k, L = v / k, _ = /* @__PURE__ */ new Map();
|
|
101
101
|
for (let D = 0; D < a; D++) {
|
|
102
|
-
const E = r[D * 3] * o - C, V = r[D * 3 + 1] * o - p, G = r[D * 3 + 2] * o - g, q = Math.min(k - 1, Math.max(0, Math.floor((E + S) / h))),
|
|
102
|
+
const E = r[D * 3] * o - C, V = r[D * 3 + 1] * o - p, G = r[D * 3 + 2] * o - g, q = Math.min(k - 1, Math.max(0, Math.floor((E + S) / h))), be = 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))), fe = q * k * k + be * k + ae;
|
|
103
103
|
let re = _.get(fe);
|
|
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))), be = 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++) {
|
|
111
111
|
if (ee > 0 && Math.abs(Y) < ee && Math.abs(ue) < ee && Math.abs(Z) < ee) continue;
|
|
112
|
-
const pe = q + Y, me =
|
|
112
|
+
const pe = q + Y, me = be + ue, he = ae + Z;
|
|
113
113
|
if (pe < 0 || pe >= k || me < 0 || me >= k || he < 0 || he >= k) continue;
|
|
114
114
|
const H = _.get(pe * k * k + me * k + he);
|
|
115
115
|
if (H) for (const ne of H) {
|
|
116
|
-
const xe = r[ne * 3] * o - C, we = r[ne * 3 + 1] * o - p,
|
|
116
|
+
const xe = r[ne * 3] * o - C, we = r[ne * 3 + 1] * o - p, ye = r[ne * 3 + 2] * o - g, oe = (E - xe) ** 2 + (V - we) ** 2 + (G - ye) ** 2;
|
|
117
117
|
oe < fe && (fe = oe, re = ne);
|
|
118
118
|
}
|
|
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,47 +174,47 @@ 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
|
-
if (l.traverse((
|
|
203
|
-
|
|
202
|
+
if (l.traverse((b) => {
|
|
203
|
+
b.isMesh && !c && (c = b.geometry);
|
|
204
204
|
}), !c) return null;
|
|
205
205
|
const { positions: a, indices: e } = mt(c);
|
|
206
206
|
if (a.length < 9 || e.length < 3) return ce.warn("wasm", `Mesh too small: positions=${a.length} indices=${e.length}`), null;
|
|
207
|
-
for (let
|
|
207
|
+
for (let b = 0; b < Math.min(a.length, 300); b++) if (!isFinite(a[b])) return ce.error("wasm", `Invalid position data: NaN/Infinity at index ${b}`), null;
|
|
208
208
|
const m = a.length / 3;
|
|
209
|
-
for (let
|
|
210
|
-
|
|
209
|
+
for (let b = 0; b < Math.min(e.length, 300); b++) if (e[b] >= m) return ce.error("wasm", `Out-of-bounds index: ${e[b]} >= ${m}`), null;
|
|
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
|
-
const
|
|
217
|
-
zo(g, o.positions, o.colors,
|
|
216
|
+
const b = x ? 1e3 : 1;
|
|
217
|
+
zo(g, o.positions, o.colors, b);
|
|
218
218
|
}
|
|
219
219
|
return {
|
|
220
220
|
geometry: g,
|
|
@@ -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 = [
|
|
@@ -276,11 +276,11 @@ let __tla = (async () => {
|
|
|
276
276
|
for (; x; ) {
|
|
277
277
|
x = false;
|
|
278
278
|
for (let p = l.length - 1; p >= 0; p--) {
|
|
279
|
-
const { a: g, b
|
|
280
|
-
if (g.equals(u[u.length - 1])) u.push(
|
|
281
|
-
else if (
|
|
282
|
-
else if (g.equals(u[0])) u.unshift(
|
|
283
|
-
else if (
|
|
279
|
+
const { a: g, b } = l[p];
|
|
280
|
+
if (g.equals(u[u.length - 1])) u.push(b);
|
|
281
|
+
else if (b.equals(u[u.length - 1])) u.push(g);
|
|
282
|
+
else if (g.equals(u[0])) u.unshift(b);
|
|
283
|
+
else if (b.equals(u[0])) u.unshift(g);
|
|
284
284
|
else continue;
|
|
285
285
|
l.splice(p, 1), x = true;
|
|
286
286
|
}
|
|
@@ -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
|
|
343
|
-
const
|
|
344
|
-
if (
|
|
345
|
-
ce.debug("slice", `y=${
|
|
346
|
-
let l =
|
|
342
|
+
function He(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
|
|
373
|
-
maxLeafTris:
|
|
371
|
+
function Ot(n) {
|
|
372
|
+
return new bt(n, {
|
|
373
|
+
maxLeafTris: yt
|
|
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
|
|
392
|
-
maxLeafTris:
|
|
393
|
-
}), e =
|
|
391
|
+
const a = new bt(n, {
|
|
392
|
+
maxLeafTris: yt
|
|
393
|
+
}), e = He(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 =
|
|
403
|
+
const d = He(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 =
|
|
412
|
+
if (f > t) {
|
|
413
|
+
const u = He(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");
|
|
@@ -445,8 +445,8 @@ let __tla = (async () => {
|
|
|
445
445
|
const X = new $.Quaternion().setFromAxisAngle(new M(1, 0, 0), Math.PI);
|
|
446
446
|
a.applyMatrix4(new $.Matrix4().makeRotationFromQuaternion(X)), e = e.map((Pe) => Pe.clone().applyQuaternion(X));
|
|
447
447
|
}
|
|
448
|
-
const
|
|
449
|
-
a.translate(-
|
|
448
|
+
const ye = e[0].clone();
|
|
449
|
+
a.translate(-ye.x, -ye.y, -ye.z), e = e.map((X) => new M(X.x - ye.x, X.y - ye.y, X.z - ye.z)), a.computeVertexNormals(), a.computeBoundingBox();
|
|
450
450
|
const oe = new M(e[0].x, e[0].y, e[0].z);
|
|
451
451
|
e.push(oe), o.addLandmarkPoint({
|
|
452
452
|
faceIndex: -1,
|
|
@@ -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([
|
|
@@ -484,12 +484,12 @@ let __tla = (async () => {
|
|
|
484
484
|
d.z
|
|
485
485
|
]);
|
|
486
486
|
o.onStatus("Detecting shell type...");
|
|
487
|
-
const p = c.detect_shell(f, u, C, 40), g = p.is_double_shell(),
|
|
487
|
+
const p = c.detect_shell(f, u, C, 40), g = p.is_double_shell(), b = p.surface_normal();
|
|
488
488
|
ce.info(Fe, `Shell: ${g ? "DOUBLE" : "SINGLE"}`, p.details()), (_a = o.setDoubleShell) == null ? void 0 : _a.call(o, g), o.onStatus("Finding cross-section plane...");
|
|
489
489
|
const P = new Float32Array([
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
490
|
+
b[0],
|
|
491
|
+
b[1],
|
|
492
|
+
b[2]
|
|
493
493
|
]), v = c.find_min_cross_section(f, u, C, P, 10), S = v.plane_normal();
|
|
494
494
|
ce.info(Fe, "Cross-section found", v.details()), o.onStatus("Aligning mesh...");
|
|
495
495
|
const A = new Float32Array([
|
|
@@ -518,22 +518,22 @@ let __tla = (async () => {
|
|
|
518
518
|
o.onStatus("Generating measurement points...");
|
|
519
519
|
const E = c.subdivide_origin_to_plane(new Float32Array(z), new Float32Array(h), D);
|
|
520
520
|
ce.debug(Fe, `Subdivide: ${E.count()} pts, spacing=${E.spacing().toFixed(1)}mm`);
|
|
521
|
-
const V = E.points(), G = E.count(), q = 2,
|
|
522
|
-
for (let H = q; H < G -
|
|
521
|
+
const V = E.points(), G = E.count(), q = 2, be = 1, ae = [];
|
|
522
|
+
for (let H = q; H < G - be; H++) ae.push(V[H * 3 + 1]);
|
|
523
523
|
o.onStatus("Computing cross-sections...");
|
|
524
524
|
let fe = [];
|
|
525
525
|
if (ae.length >= 2) {
|
|
526
526
|
const ne = (g ? c.batch_cross_sections_y_inner.bind(c) : c.batch_cross_sections_y.bind(c))(k, u, new Float32Array(ae), 10);
|
|
527
527
|
ce.debug(Fe, "Batch (subdivision)", ne.details());
|
|
528
|
-
const xe = ne.all_loop_points(), we = ne.offsets(),
|
|
528
|
+
const xe = ne.all_loop_points(), we = ne.offsets(), ye = ne.circumferences();
|
|
529
529
|
for (let oe = 0; oe < we.length - 1; oe++) {
|
|
530
530
|
const N = we[oe], X = we[oe + 1];
|
|
531
|
-
if (X <= N ||
|
|
531
|
+
if (X <= N || ye[oe] <= 0) continue;
|
|
532
532
|
const Pe = (X - N) / 3;
|
|
533
533
|
if (Pe < 3) continue;
|
|
534
|
-
let ke = 0,
|
|
535
|
-
for (let Ae = N; Ae < X; Ae += 3) ke += xe[Ae],
|
|
536
|
-
fe.push(ke / Pe,
|
|
534
|
+
let ke = 0, Ve = 0, ie = 0;
|
|
535
|
+
for (let Ae = N; Ae < X; Ae += 3) ke += xe[Ae], Ve += xe[Ae + 1], ie += xe[Ae + 2];
|
|
536
|
+
fe.push(ke / Pe, Ve / Pe, ie / Pe);
|
|
537
537
|
}
|
|
538
538
|
}
|
|
539
539
|
if (fe.length >= 6) {
|
|
@@ -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,
|
|
@@ -570,20 +570,20 @@ let __tla = (async () => {
|
|
|
570
570
|
ue.getSize(Z), o.setModelSize(Math.max(Z.x, Z.y, Z.z)), o.setCut(true), o.setAdjustedStartY(null), o.setAdjustedEndY(null), o.setOriginalEndY(e[1].y + 2 * gt), o.onStatus("Computing final measurements...");
|
|
571
571
|
{
|
|
572
572
|
const H = mt(a), ne = e[1].y, xe = e[0].y;
|
|
573
|
-
let we = 1 / 0,
|
|
573
|
+
let we = 1 / 0, ye = -1 / 0;
|
|
574
574
|
const oe = H.positions;
|
|
575
|
-
for (let ie = 1; ie < oe.length; ie += 3) oe[ie] < we && (we = oe[ie]), oe[ie] >
|
|
575
|
+
for (let ie = 1; ie < oe.length; ie += 3) oe[ie] < we && (we = oe[ie]), oe[ie] > ye && (ye = oe[ie]);
|
|
576
576
|
const N = 25.4, X = [];
|
|
577
577
|
X.push(ne);
|
|
578
578
|
for (let ie = 1; ie <= 2; ie++) {
|
|
579
579
|
const Ae = ne + ie * N;
|
|
580
|
-
Ae <
|
|
580
|
+
Ae < ye - 1 && X.push(Ae);
|
|
581
581
|
}
|
|
582
582
|
for (let ie = ne - N; ie > xe; ie -= N) X.push(ie);
|
|
583
583
|
X.sort((ie, Ae) => ie - Ae), ce.info(Fe, `Horizontal slices: ${X.length} Y planes, range ${(_b = X[0]) == null ? void 0 : _b.toFixed(1)} \u2192 ${(_c = X[X.length - 1]) == null ? void 0 : _c.toFixed(1)} mm`);
|
|
584
584
|
const ke = (g ? c.batch_cross_sections_y_inner.bind(c) : c.batch_cross_sections_y.bind(c))(H.positions, H.indices, new Float32Array(X), 10);
|
|
585
585
|
ce.info(Fe, `Horizontal slices (${g ? "inner" : "outer"}): ${ke.count()}/${X.length} valid`), ce.debug(Fe, "Slice details", ke.details());
|
|
586
|
-
const
|
|
586
|
+
const Ve = {
|
|
587
587
|
yValues: X,
|
|
588
588
|
circumferences: Array.from(ke.circumferences()),
|
|
589
589
|
allLoopPoints: new Float32Array(ke.all_loop_points()),
|
|
@@ -591,13 +591,13 @@ let __tla = (async () => {
|
|
|
591
591
|
mptY: ne,
|
|
592
592
|
originY: xe
|
|
593
593
|
};
|
|
594
|
-
(_d = o.setWasmSlices) == null ? void 0 : _d.call(o,
|
|
594
|
+
(_d = o.setWasmSlices) == null ? void 0 : _d.call(o, Ve);
|
|
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,46 +745,46 @@ 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, b = g.index;
|
|
776
776
|
let P;
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
777
|
+
b ? P = [
|
|
778
|
+
b.getX(p * 3),
|
|
779
|
+
b.getX(p * 3 + 1),
|
|
780
|
+
b.getX(p * 3 + 2)
|
|
781
781
|
] : P = [
|
|
782
782
|
p * 3,
|
|
783
783
|
p * 3 + 1,
|
|
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(je, {
|
|
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(() =>
|
|
893
|
-
maxLeafTris:
|
|
891
|
+
function Pn(n) {
|
|
892
|
+
return j(() => n ? new bt(n, {
|
|
893
|
+
maxLeafTris: yt
|
|
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 :
|
|
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 : He(n, r, t, a), [
|
|
933
931
|
n,
|
|
932
|
+
r,
|
|
933
|
+
t,
|
|
934
934
|
a,
|
|
935
935
|
d,
|
|
936
936
|
f
|
|
@@ -951,7 +951,7 @@ let __tla = (async () => {
|
|
|
951
951
|
}, [
|
|
952
952
|
g
|
|
953
953
|
]);
|
|
954
|
-
const
|
|
954
|
+
const b = le(null), P = j(() => {
|
|
955
955
|
const v = new $.BufferGeometry();
|
|
956
956
|
v.setAttribute("position", new $.Float32BufferAttribute(new Float32Array(6), 3));
|
|
957
957
|
const S = new $.LineBasicMaterial({
|
|
@@ -968,16 +968,16 @@ 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
|
-
]),
|
|
980
|
-
if (!
|
|
979
|
+
]), yn(({ camera: v }) => {
|
|
980
|
+
if (!b.current || x.length < 2) return;
|
|
981
981
|
const S = new M();
|
|
982
982
|
v.getWorldDirection(S);
|
|
983
983
|
const A = new M(S.x, 0, S.z);
|
|
@@ -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 =
|
|
993
|
-
|
|
992
|
+
const z = s * 0.35, L = new M(h.x + w.x * z, t, h.z + w.z * z);
|
|
993
|
+
b.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
|
-
|
|
1030
|
-
ref:
|
|
1031
|
-
children:
|
|
1029
|
+
i("group", {
|
|
1030
|
+
ref: b,
|
|
1031
|
+
children: i(je, {
|
|
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
|
|
@@ -1168,7 +1168,7 @@ let __tla = (async () => {
|
|
|
1168
1168
|
return A;
|
|
1169
1169
|
}, [
|
|
1170
1170
|
f
|
|
1171
|
-
]),
|
|
1171
|
+
]), b = j(() => {
|
|
1172
1172
|
if (!f) return null;
|
|
1173
1173
|
const A = /* @__PURE__ */ new Map();
|
|
1174
1174
|
for (let w = 0; w < f.yValues.length; w++) A.set(f.yValues[w], f.circumferences[w]);
|
|
@@ -1181,32 +1181,32 @@ let __tla = (async () => {
|
|
|
1181
1181
|
}, [
|
|
1182
1182
|
p
|
|
1183
1183
|
]), U(() => {
|
|
1184
|
-
if (!
|
|
1185
|
-
const A = p.filter((w) => (
|
|
1184
|
+
if (!b || !l) return;
|
|
1185
|
+
const A = p.filter((w) => (b.get(w) ?? 0) > 0).map((w) => ({
|
|
1186
1186
|
yPosition: w,
|
|
1187
|
-
originalValue:
|
|
1187
|
+
originalValue: b.get(w) ?? 0,
|
|
1188
1188
|
modifiedValue: null
|
|
1189
1189
|
}));
|
|
1190
1190
|
l(A);
|
|
1191
1191
|
}, [
|
|
1192
|
-
|
|
1192
|
+
b,
|
|
1193
1193
|
p,
|
|
1194
1194
|
l
|
|
1195
1195
|
]);
|
|
1196
1196
|
const P = [
|
|
1197
1197
|
"#5B9BD5"
|
|
1198
|
-
], v =
|
|
1199
|
-
if (
|
|
1198
|
+
], v = s * So, S = Q((A) => {
|
|
1199
|
+
if (b) 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);
|
|
1202
1202
|
l == null ? void 0 : l(w);
|
|
1203
1203
|
}, [
|
|
1204
1204
|
l,
|
|
1205
1205
|
c,
|
|
1206
|
-
|
|
1206
|
+
b
|
|
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,
|
|
@@ -1218,18 +1218,18 @@ let __tla = (async () => {
|
|
|
1218
1218
|
formValue: m == null ? void 0 : m[w],
|
|
1219
1219
|
lineWidth: d != null && Math.abs(A - d) < o * 0.5 ? 4 : 1.5,
|
|
1220
1220
|
wasmLoopPoints: g == null ? void 0 : g.get(A),
|
|
1221
|
-
wasmCircumference:
|
|
1221
|
+
wasmCircumference: b == null ? void 0 : b.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 =
|
|
1232
|
-
|
|
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
|
+
yn(({ camera: w }) => {
|
|
1233
1233
|
if (!f.current) return;
|
|
1234
1234
|
const k = new M();
|
|
1235
1235
|
w.getWorldDirection(k);
|
|
@@ -1241,11 +1241,11 @@ let __tla = (async () => {
|
|
|
1241
1241
|
const L = w.position.x - f.current.position.x, _ = w.position.z - f.current.position.z;
|
|
1242
1242
|
f.current.rotation.y = Math.atan2(L, _);
|
|
1243
1243
|
});
|
|
1244
|
-
const u = new M(0, r, 0), x = new M(0, a, 0), C = new M(0, (r + a) / 2, 0), p = new M(-d, r, 0), g = new M(d, r, 0),
|
|
1244
|
+
const u = new M(0, r, 0), x = new M(0, a, 0), C = new M(0, (r + a) / 2, 0), p = new M(-d, r, 0), g = new M(d, r, 0), b = new M(-d, a, 0), P = new M(d, a, 0), v = l != null && l > 0, S = v ? e - l : 0, A = v ? No(e, l) : "#fff";
|
|
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,17 +1261,17 @@ let __tla = (async () => {
|
|
|
1261
1261
|
color: "#888888",
|
|
1262
1262
|
lineWidth: 1.5
|
|
1263
1263
|
}),
|
|
1264
|
-
|
|
1264
|
+
i(de, {
|
|
1265
1265
|
points: [
|
|
1266
|
-
|
|
1266
|
+
b,
|
|
1267
1267
|
P
|
|
1268
1268
|
],
|
|
1269
1269
|
color: "#888888",
|
|
1270
1270
|
lineWidth: 1.5
|
|
1271
1271
|
}),
|
|
1272
|
-
|
|
1272
|
+
i("mesh", {
|
|
1273
1273
|
position: C,
|
|
1274
|
-
children:
|
|
1274
|
+
children: i(je, {
|
|
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), b = 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,54 +1401,54 @@ 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,
|
|
1416
1416
|
k
|
|
1417
1417
|
]), U(() => {
|
|
1418
|
-
const h =
|
|
1419
|
-
|
|
1418
|
+
const h = b.current;
|
|
1419
|
+
b.current = c, h === 0 && c === 1 && !r && requestAnimationFrame(() => k(f));
|
|
1420
1420
|
}, [
|
|
1421
1421
|
c,
|
|
1422
1422
|
r,
|
|
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 =
|
|
1446
|
-
let E = 1 / 0, V = -1 / 0, G = 1 / 0, q = -1 / 0,
|
|
1445
|
+
const z = o.geometry, L = z.getAttribute("position"), _ = L.array, D = n * 0.15;
|
|
1446
|
+
let E = 1 / 0, V = -1 / 0, G = 1 / 0, q = -1 / 0, be = 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];
|
|
1449
|
-
H < E && (E = H), H > V && (V = H), ne < G && (G = ne), ne > q && (q = ne),
|
|
1449
|
+
H < E && (E = H), H > V && (V = H), ne < G && (G = ne), ne > q && (q = ne), be = true;
|
|
1450
1450
|
}
|
|
1451
|
-
if (!
|
|
1451
|
+
if (!be) {
|
|
1452
1452
|
z.computeBoundingBox();
|
|
1453
1453
|
const he = z.boundingBox;
|
|
1454
1454
|
E = he.min.x, V = he.max.x, G = he.min.z, q = he.max.z;
|
|
@@ -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,15 +1483,15 @@ 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 =
|
|
1489
|
-
let E = 1 / 0, V = -1 / 0, G = 1 / 0, q = -1 / 0,
|
|
1488
|
+
const z = o.geometry, L = z.getAttribute("position"), _ = L.array, D = n * 0.15;
|
|
1489
|
+
let E = 1 / 0, V = -1 / 0, G = 1 / 0, q = -1 / 0, be = 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];
|
|
1492
|
-
pe < E && (E = pe), pe > V && (V = pe), me < G && (G = me), me > q && (q = me),
|
|
1492
|
+
pe < E && (E = pe), pe > V && (V = pe), me < G && (G = me), me > q && (q = me), be = true;
|
|
1493
1493
|
}
|
|
1494
|
-
if (!
|
|
1494
|
+
if (!be) {
|
|
1495
1495
|
z.computeBoundingBox();
|
|
1496
1496
|
const Z = z.boundingBox;
|
|
1497
1497
|
E = Z.min.x, V = Z.max.x, G = Z.min.z, q = Z.max.z;
|
|
@@ -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,46 +1677,46 @@ let __tla = (async () => {
|
|
|
1677
1677
|
]
|
|
1678
1678
|
}, o.number);
|
|
1679
1679
|
})
|
|
1680
|
-
}), Jo = ({ mesh:
|
|
1681
|
-
const c =
|
|
1682
|
-
maxLeafTris:
|
|
1680
|
+
}), Jo = ({ mesh: n, upperY: r, originY: t, modelSize: o, meshColor: s = "#c8c8c8", displayUnit: l = "mm" }) => {
|
|
1681
|
+
const c = n.geometry, a = j(() => new bt(c, {
|
|
1682
|
+
maxLeafTris: yt
|
|
1683
1683
|
}), [
|
|
1684
1684
|
c
|
|
1685
|
-
]), e = j(() =>
|
|
1685
|
+
]), e = j(() => He(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(() => {
|
|
1692
|
-
let g = null,
|
|
1692
|
+
let g = null, b = null, P = 0, v = 0;
|
|
1693
1693
|
if (e.linePoints.length >= 2) {
|
|
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,
|
|
1699
|
-
],
|
|
1700
|
-
new M(w.x,
|
|
1701
|
-
new M(k.x,
|
|
1702
|
-
], P = g[0].distanceTo(g[1]), v =
|
|
1697
|
+
new M(S.x, t, S.z),
|
|
1698
|
+
new M(A.x, t, A.z)
|
|
1699
|
+
], b = [
|
|
1700
|
+
new M(w.x, t, w.z),
|
|
1701
|
+
new M(k.x, t, k.z)
|
|
1702
|
+
], P = g[0].distanceTo(g[1]), v = b[0].distanceTo(b[1]);
|
|
1703
1703
|
}
|
|
1704
1704
|
return {
|
|
1705
1705
|
mlLine: g,
|
|
1706
|
-
apLine:
|
|
1706
|
+
apLine: b,
|
|
1707
1707
|
mlWidth: P,
|
|
1708
1708
|
apWidth: v
|
|
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(je, {
|
|
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(je, {
|
|
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:
|
|
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: b } = wn(), P = le(0), v = n.geometry, S = Pn(v), A = j(() => S ? He(S, v, r) : {
|
|
1829
1829
|
linePoints: [],
|
|
1830
1830
|
lineLength: 0,
|
|
1831
1831
|
rightmostPoint: new M()
|
|
@@ -1834,35 +1834,35 @@ let __tla = (async () => {
|
|
|
1834
1834
|
v,
|
|
1835
1835
|
r
|
|
1836
1836
|
]), w = Q((_, D) => {
|
|
1837
|
-
const E =
|
|
1837
|
+
const E = b.domElement.getBoundingClientRect(), V = (_ - E.left) / E.width * 2 - 1, G = -((D - E.top) / E.height) * 2 + 1, q = new go();
|
|
1838
1838
|
q.setFromCamera(new $.Vector2(V, G), g);
|
|
1839
|
-
const
|
|
1840
|
-
return q.ray.intersectPlane(
|
|
1839
|
+
const be = new xt(new M(0, 0, 1), 0), ae = new M();
|
|
1840
|
+
return q.ray.intersectPlane(be, ae), ae ? ae.y : r;
|
|
1841
1841
|
}, [
|
|
1842
1842
|
g,
|
|
1843
|
-
|
|
1843
|
+
b,
|
|
1844
1844
|
r
|
|
1845
1845
|
]), k = Q((_) => {
|
|
1846
|
-
_.stopPropagation(), x(true),
|
|
1846
|
+
_.stopPropagation(), x(true), b.domElement.style.cursor = "ns-resize", P.current = r - w(_.clientX, _.clientY), _.target.setPointerCapture(_.pointerId), d == null ? void 0 : d();
|
|
1847
1847
|
}, [
|
|
1848
1848
|
r,
|
|
1849
|
-
|
|
1849
|
+
b,
|
|
1850
1850
|
w,
|
|
1851
1851
|
d
|
|
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
|
-
x(false),
|
|
1863
|
+
x(false), b.domElement.style.cursor = "auto", _.target.releasePointerCapture(_.pointerId), f == null ? void 0 : f();
|
|
1864
1864
|
}, [
|
|
1865
|
-
|
|
1865
|
+
b,
|
|
1866
1866
|
f
|
|
1867
1867
|
]);
|
|
1868
1868
|
if (A.linePoints.length < 2) return null;
|
|
@@ -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,
|
|
@@ -1882,21 +1882,21 @@ let __tla = (async () => {
|
|
|
1882
1882
|
onPointerMove: h,
|
|
1883
1883
|
onPointerUp: z,
|
|
1884
1884
|
onPointerEnter: () => {
|
|
1885
|
-
p(true),
|
|
1885
|
+
p(true), b.domElement.style.cursor = "ns-resize";
|
|
1886
1886
|
},
|
|
1887
1887
|
onPointerLeave: () => {
|
|
1888
|
-
u || (p(false),
|
|
1888
|
+
u || (p(false), b.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(je, {
|
|
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",
|
|
@@ -1940,7 +1940,7 @@ let __tla = (async () => {
|
|
|
1940
1940
|
});
|
|
1941
1941
|
const nr = [
|
|
1942
1942
|
"Scan doesn't load properly",
|
|
1943
|
-
"
|
|
1943
|
+
"Modified CAD",
|
|
1944
1944
|
"I don't want to",
|
|
1945
1945
|
"I want a second opinion",
|
|
1946
1946
|
"I measured from IT"
|
|
@@ -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,
|
|
@@ -2202,7 +2202,7 @@ let __tla = (async () => {
|
|
|
2202
2202
|
fontFamily: "system-ui, sans-serif",
|
|
2203
2203
|
letterSpacing: "0.4px",
|
|
2204
2204
|
lineHeight: "36px"
|
|
2205
|
-
},
|
|
2205
|
+
}, bn = {
|
|
2206
2206
|
width: "100%",
|
|
2207
2207
|
padding: "10px 12px",
|
|
2208
2208
|
fontSize: 15,
|
|
@@ -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}`);
|
|
@@ -2228,7 +2228,7 @@ let __tla = (async () => {
|
|
|
2228
2228
|
return x.forEach((z, L) => {
|
|
2229
2229
|
e[L] != null && e[L] !== 0 && (h[z] = e[L].toFixed(1));
|
|
2230
2230
|
}), h;
|
|
2231
|
-
}), [g,
|
|
2231
|
+
}), [g, b] = W(m && m > 0 ? m.toFixed(1) : ""), [P, v] = W(false), S = j(() => x.map((h) => {
|
|
2232
2232
|
const z = C[h];
|
|
2233
2233
|
return z != null && z !== "" && !isNaN(parseFloat(z)) ? parseFloat(z) : 0;
|
|
2234
2234
|
}), [
|
|
@@ -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,19 +2264,19 @@ 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);
|
|
2275
2275
|
}
|
|
2276
|
-
}), p(h), o > 0 &&
|
|
2276
|
+
}), p(h), o > 0 && b(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] ?? "",
|
|
@@ -2408,7 +2408,7 @@ let __tla = (async () => {
|
|
|
2408
2408
|
[h]: L.target.value
|
|
2409
2409
|
})),
|
|
2410
2410
|
style: {
|
|
2411
|
-
...
|
|
2411
|
+
...bn,
|
|
2412
2412
|
padding: "6px 8px",
|
|
2413
2413
|
fontSize: 13,
|
|
2414
2414
|
borderColor: C[h] ? "rgb(12, 67, 173)" : "#ccc",
|
|
@@ -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,13 +2445,13 @@ 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,
|
|
2452
|
-
onChange: (h) =>
|
|
2452
|
+
onChange: (h) => b(h.target.value),
|
|
2453
2453
|
style: {
|
|
2454
|
-
...
|
|
2454
|
+
...bn,
|
|
2455
2455
|
padding: "6px 8px",
|
|
2456
2456
|
fontSize: 13,
|
|
2457
2457
|
borderColor: g ? "rgb(12, 67, 173)" : "#ccc",
|
|
@@ -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,16 +2507,16 @@ 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
|
-
const
|
|
2515
|
+
const b = r + g * c, P = r + (g + 1) * c;
|
|
2516
2516
|
let v = 0, S = 0, A = 0, w = 0;
|
|
2517
2517
|
for (let k = 0; k < o.count; k++) {
|
|
2518
2518
|
const h = o.getY(k);
|
|
2519
|
-
h >=
|
|
2519
|
+
h >= b && h < P && (v += o.getX(k), S += h, A += o.getZ(k), w++);
|
|
2520
2520
|
}
|
|
2521
2521
|
w > 20 && a.push(new M(v / w, S / w, A / w));
|
|
2522
2522
|
}
|
|
@@ -2526,12 +2526,12 @@ let __tla = (async () => {
|
|
|
2526
2526
|
e.divideScalar(a.length);
|
|
2527
2527
|
let m = 0, d = 0, f = 0, u = 0, x = 0, C = 0;
|
|
2528
2528
|
for (const g of a) {
|
|
2529
|
-
const
|
|
2530
|
-
m +=
|
|
2529
|
+
const b = g.x - e.x, P = g.y - e.y, v = g.z - e.z;
|
|
2530
|
+
m += b * b, d += b * P, f += b * v, u += P * P, x += P * v, C += v * v;
|
|
2531
2531
|
}
|
|
2532
2532
|
let p = new M(0.01, 1, 0.01).normalize();
|
|
2533
2533
|
for (let g = 0; g < 30; g++) {
|
|
2534
|
-
const
|
|
2534
|
+
const b = m * p.x + d * p.y + f * p.z, P = d * p.x + u * p.y + x * p.z, v = f * p.x + x * p.y + C * p.z, S = new M(b, P, v), A = S.length();
|
|
2535
2535
|
if (A < 1e-10 || (S.divideScalar(A), p.distanceTo(S) < 1e-8)) break;
|
|
2536
2536
|
p = S;
|
|
2537
2537
|
}
|
|
@@ -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 <
|
|
2561
|
-
const g = r.getX(p) - o.x,
|
|
2562
|
-
|
|
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
|
+
const g = r.getX(p) - o.x, b = r.getY(p) - o.y, P = r.getZ(p) - o.z;
|
|
2562
|
+
s += g * g, l += g * b, c += g * P, a += b * b, e += b * 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
|
],
|
|
@@ -2580,17 +2580,17 @@ let __tla = (async () => {
|
|
|
2580
2580
|
]
|
|
2581
2581
|
];
|
|
2582
2582
|
for (let p = 0; p < 3; p++) {
|
|
2583
|
-
let g = new M(1 + p * 0.1, 1 - p * 0.1, 0.5 + p * 0.3).normalize(),
|
|
2583
|
+
let g = new M(1 + p * 0.1, 1 - p * 0.1, 0.5 + p * 0.3).normalize(), b = 0;
|
|
2584
2584
|
for (let P = 0; P < 100; P++) {
|
|
2585
2585
|
const v = u[0][0] * g.x + u[0][1] * g.y + u[0][2] * g.z, S = u[1][0] * g.x + u[1][1] * g.y + u[1][2] * g.z, A = u[2][0] * g.x + u[2][1] * g.y + u[2][2] * g.z, w = new M(v, S, A);
|
|
2586
|
-
if (
|
|
2587
|
-
if (w.divideScalar(
|
|
2586
|
+
if (b = w.length(), b < 1e-12) break;
|
|
2587
|
+
if (w.divideScalar(b), g.distanceTo(w) < 1e-10) {
|
|
2588
2588
|
g = w;
|
|
2589
2589
|
break;
|
|
2590
2590
|
}
|
|
2591
2591
|
g = w;
|
|
2592
2592
|
}
|
|
2593
|
-
d.push(g.clone()), f.push(
|
|
2593
|
+
d.push(g.clone()), f.push(b);
|
|
2594
2594
|
for (let P = 0; P < 3; P++) for (let v = 0; v < 3; v++) {
|
|
2595
2595
|
const S = [
|
|
2596
2596
|
g.x,
|
|
@@ -2601,25 +2601,25 @@ let __tla = (async () => {
|
|
|
2601
2601
|
g.y,
|
|
2602
2602
|
g.z
|
|
2603
2603
|
][v];
|
|
2604
|
-
u[P][v] -=
|
|
2604
|
+
u[P][v] -= b * S * A;
|
|
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,
|
|
2613
2613
|
0
|
|
2614
2614
|
];
|
|
2615
2615
|
for (let p = 0; p < 3; p++) {
|
|
2616
|
-
let g = 1 / 0,
|
|
2616
|
+
let g = 1 / 0, b = -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
|
-
k < g && (g = k), k >
|
|
2620
|
+
k < g && (g = k), k > b && (b = k);
|
|
2621
2621
|
}
|
|
2622
|
-
C[p] = (
|
|
2622
|
+
C[p] = (b - g) / 2;
|
|
2623
2623
|
}
|
|
2624
2624
|
return {
|
|
2625
2625
|
axes: d,
|
|
@@ -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
|
|
2878
|
+
const b = t - r, P = r + b * 0.3, v = r + b * 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(je, {
|
|
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",
|
|
@@ -3185,10 +3185,10 @@ let __tla = (async () => {
|
|
|
3185
3185
|
color: "#00ffff",
|
|
3186
3186
|
group: "Alignment"
|
|
3187
3187
|
}
|
|
3188
|
-
],
|
|
3189
|
-
...new Set(Dn.map((
|
|
3188
|
+
], br = [
|
|
3189
|
+
...new Set(Dn.map((n) => n.group))
|
|
3190
3190
|
];
|
|
3191
|
-
function
|
|
3191
|
+
function yr({ 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,
|
|
@@ -3217,11 +3217,11 @@ let __tla = (async () => {
|
|
|
3217
3217
|
},
|
|
3218
3218
|
children: "Debug Layers"
|
|
3219
3219
|
}),
|
|
3220
|
-
|
|
3221
|
-
const
|
|
3222
|
-
return
|
|
3220
|
+
br.map((o) => {
|
|
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,16 +3278,16 @@ let __tla = (async () => {
|
|
|
3278
3278
|
]
|
|
3279
3279
|
});
|
|
3280
3280
|
}
|
|
3281
|
-
const wr = ({ config:
|
|
3282
|
-
const [e, m] = W(null), [d, f] = W(0), [u, x] = W(false), [C, p] = W(false), [g,
|
|
3281
|
+
const wr = ({ config: n, spacingType: r, scanUrl: t, formMeasurements: o, onComplete: s, isDebugUser: l = false, onAnalyticsEvent: c, wasmModule: a }) => {
|
|
3282
|
+
const [e, m] = W(null), [d, f] = W(0), [u, x] = W(false), [C, p] = W(false), [g, b] = 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, be] = 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), [ye, oe] = W(false), [N, X] = W([]), [Pe, ke] = W(null), [Ve, 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), [Ne, 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), $e = le(null), it = le(false), Gn = le(null), Ft = le(null), Pt = le(null), Ke = Q(async () => {
|
|
3283
3283
|
if (Pt.current) try {
|
|
3284
|
-
const
|
|
3285
|
-
const J =
|
|
3284
|
+
const y = Pt.current, I = () => {
|
|
3285
|
+
const J = y.querySelector("canvas");
|
|
3286
3286
|
if (!J) return;
|
|
3287
|
-
const O =
|
|
3287
|
+
const O = y.getBoundingClientRect(), ge = J.width, Ce = J.height, te = ge / O.width, Me = Ce / O.height, Re = document.createElement("canvas");
|
|
3288
3288
|
Re.width = ge, Re.height = Ce;
|
|
3289
3289
|
const se = Re.getContext("2d");
|
|
3290
|
-
return se.drawImage(J, 0, 0),
|
|
3290
|
+
return se.drawImage(J, 0, 0), y.querySelectorAll("[style*='pointer-events']").forEach((_e) => {
|
|
3291
3291
|
const nn = _e;
|
|
3292
3292
|
if (nn.hasAttribute("data-finalizing-overlay")) return;
|
|
3293
3293
|
const on = nn.querySelectorAll("div[style*='background']");
|
|
@@ -3296,7 +3296,7 @@ let __tla = (async () => {
|
|
|
3296
3296
|
const Ie = Xe.getBoundingClientRect();
|
|
3297
3297
|
if (Ie.width === 0 || Ie.height === 0) return;
|
|
3298
3298
|
let Rt = 0, qe = Xe;
|
|
3299
|
-
for (; qe && qe !==
|
|
3299
|
+
for (; qe && qe !== y; ) {
|
|
3300
3300
|
const ft = (qe.style.transform || "").match(/rotate\((-?\d+)deg\)/);
|
|
3301
3301
|
if (ft) {
|
|
3302
3302
|
Rt = parseFloat(ft[1]);
|
|
@@ -3337,11 +3337,11 @@ let __tla = (async () => {
|
|
|
3337
3337
|
} catch {
|
|
3338
3338
|
return;
|
|
3339
3339
|
}
|
|
3340
|
-
}, []), ve = Q((
|
|
3340
|
+
}, []), ve = Q((y) => {
|
|
3341
3341
|
const I = /* @__PURE__ */ new Date(), B = `${String(I.getHours()).padStart(2, "0")}:${String(I.getMinutes()).padStart(2, "0")}:${String(I.getSeconds()).padStart(2, "0")}.${String(I.getMilliseconds()).padStart(3, "0")}`;
|
|
3342
3342
|
Kt((R) => [
|
|
3343
3343
|
...R.slice(-200),
|
|
3344
|
-
`[${B}] ${
|
|
3344
|
+
`[${B}] ${y}`
|
|
3345
3345
|
]);
|
|
3346
3346
|
}, []), { landmarkPoints: T, clearLandmarkPoints: Yn, addLandmarkPoint: Ut, removeLandmarkPoint: Jt, updateLandmarkPositions: Qt, setAligned: qt, isAligned: K, setCut: en, isCut: Lt, reset: st } = Ht();
|
|
3347
3347
|
U(() => {
|
|
@@ -3352,8 +3352,8 @@ let __tla = (async () => {
|
|
|
3352
3352
|
const lt = S * gt;
|
|
3353
3353
|
U(() => {
|
|
3354
3354
|
if (!l || T.length === 0) return;
|
|
3355
|
-
const
|
|
3356
|
-
ve(`LANDMARK[${T.length - 1}]: placed at (${
|
|
3355
|
+
const y = T[T.length - 1];
|
|
3356
|
+
ve(`LANDMARK[${T.length - 1}]: placed at (${y.position.x.toFixed(1)}, ${y.position.y.toFixed(1)}, ${y.position.z.toFixed(1)}) face=${y.faceIndex}`);
|
|
3357
3357
|
}, [
|
|
3358
3358
|
T.length,
|
|
3359
3359
|
l,
|
|
@@ -3375,7 +3375,7 @@ let __tla = (async () => {
|
|
|
3375
3375
|
}, [
|
|
3376
3376
|
kt
|
|
3377
3377
|
]);
|
|
3378
|
-
const
|
|
3378
|
+
const Oe = j(() => xe ? new $.Mesh(xe) : null, [
|
|
3379
3379
|
xe
|
|
3380
3380
|
]);
|
|
3381
3381
|
U(() => {
|
|
@@ -3391,7 +3391,7 @@ let __tla = (async () => {
|
|
|
3391
3391
|
U(() => {
|
|
3392
3392
|
if (!K || N.length === 0 || at.current || !c) return;
|
|
3393
3393
|
at.current = true;
|
|
3394
|
-
const
|
|
3394
|
+
const y = T.length >= 3 ? Math.abs(T[2].position.y - T[0].position.y) : null;
|
|
3395
3395
|
c("dimensions_calculated", {
|
|
3396
3396
|
spacing_type: L,
|
|
3397
3397
|
source_unit: "mm",
|
|
@@ -3405,61 +3405,61 @@ let __tla = (async () => {
|
|
|
3405
3405
|
const R = Se[B];
|
|
3406
3406
|
return R == null ? null : +((I.modifiedValue ?? I.originalValue) - R).toFixed(1);
|
|
3407
3407
|
}) : null,
|
|
3408
|
-
frontal_height:
|
|
3408
|
+
frontal_height: y !== null ? +y.toFixed(1) : null
|
|
3409
3409
|
});
|
|
3410
3410
|
}, [
|
|
3411
3411
|
K,
|
|
3412
3412
|
N
|
|
3413
3413
|
]), U(() => {
|
|
3414
|
-
a !== void 0 && (
|
|
3414
|
+
a !== void 0 && ($e.current = a), a !== void 0 && Xn(true);
|
|
3415
3415
|
}, [
|
|
3416
3416
|
a
|
|
3417
3417
|
]);
|
|
3418
|
-
const Ue = Q((
|
|
3419
|
-
|
|
3420
|
-
const B =
|
|
3421
|
-
B.getCenter(R),
|
|
3422
|
-
const J =
|
|
3418
|
+
const Ue = Q((y, I) => {
|
|
3419
|
+
y.computeBoundingBox();
|
|
3420
|
+
const B = y.boundingBox, R = new M();
|
|
3421
|
+
B.getCenter(R), y.translate(-R.x, -R.y, -R.z), y.computeBoundingBox();
|
|
3422
|
+
const J = y.boundingBox, O = new M();
|
|
3423
3423
|
J.getSize(O), f(Math.max(O.x, O.y, O.z));
|
|
3424
|
-
const ge = new $.Mesh(
|
|
3424
|
+
const ge = new $.Mesh(y, new $.MeshStandardMaterial({
|
|
3425
3425
|
color: 8947848,
|
|
3426
3426
|
side: $.DoubleSide
|
|
3427
3427
|
}));
|
|
3428
3428
|
m(ge), fe(I), ee(true), pe(false), it.current = false;
|
|
3429
|
-
}, []), Be = Q(async (
|
|
3429
|
+
}, []), Be = Q(async (y, I) => {
|
|
3430
3430
|
Le(null);
|
|
3431
3431
|
const B = I.toLowerCase(), R = B.endsWith(".stl");
|
|
3432
3432
|
if (!B.endsWith(".obj") && !R) {
|
|
3433
3433
|
Le("Unsupported file format. Please use OBJ or STL.");
|
|
3434
3434
|
return;
|
|
3435
3435
|
}
|
|
3436
|
-
Gt(R ? "stl" : "obj"), p(true),
|
|
3436
|
+
Gt(R ? "stl" : "obj"), p(true), b("Processing file..."), ve(`FILE_LOAD: ${I} (${R ? "STL" : "OBJ"})`);
|
|
3437
3437
|
try {
|
|
3438
3438
|
let O;
|
|
3439
|
-
if (R) if (
|
|
3439
|
+
if (R) if (b("Converting STL..."), y instanceof ArrayBuffer) {
|
|
3440
3440
|
const te = new Blob([
|
|
3441
|
-
|
|
3441
|
+
y
|
|
3442
3442
|
]), Me = new File([
|
|
3443
3443
|
te
|
|
3444
3444
|
], I);
|
|
3445
3445
|
O = await Et(Me);
|
|
3446
3446
|
} else {
|
|
3447
3447
|
const te = new Blob([
|
|
3448
|
-
|
|
3448
|
+
y
|
|
3449
3449
|
]), Me = new File([
|
|
3450
3450
|
te
|
|
3451
3451
|
], I);
|
|
3452
3452
|
O = await Et(Me);
|
|
3453
3453
|
}
|
|
3454
|
-
else O = typeof
|
|
3455
|
-
const ge = performance.now(), Ce =
|
|
3456
|
-
|
|
3454
|
+
else O = typeof y == "string" ? y : new TextDecoder().decode(y);
|
|
3455
|
+
const ge = performance.now(), Ce = $e.current ? await Mo(O, $e.current, (te) => {
|
|
3456
|
+
b(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
|
+
b("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.");
|
|
@@ -3467,22 +3467,22 @@ let __tla = (async () => {
|
|
|
3467
3467
|
} catch (O) {
|
|
3468
3468
|
Le(O instanceof Error ? O.message : "Failed to process the mesh file.");
|
|
3469
3469
|
} finally {
|
|
3470
|
-
p(false),
|
|
3470
|
+
p(false), b("");
|
|
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
|
-
p(true),
|
|
3481
|
+
p(true), b("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);
|
|
@@ -3491,23 +3491,23 @@ let __tla = (async () => {
|
|
|
3491
3491
|
await Be(O, R);
|
|
3492
3492
|
}
|
|
3493
3493
|
} catch (I) {
|
|
3494
|
-
Le(I instanceof Error ? I.message : "Failed to load scan from URL."), p(false),
|
|
3494
|
+
Le(I instanceof Error ? I.message : "Failed to load scan from URL."), p(false), b("");
|
|
3495
3495
|
}
|
|
3496
3496
|
})();
|
|
3497
3497
|
}, [
|
|
3498
|
-
|
|
3498
|
+
t,
|
|
3499
3499
|
We
|
|
3500
3500
|
]);
|
|
3501
|
-
const Zn = Q((
|
|
3502
|
-
|
|
3503
|
-
}, []), Kn = Q((
|
|
3504
|
-
|
|
3505
|
-
}, []), Un = Q(async (
|
|
3506
|
-
if (
|
|
3501
|
+
const Zn = Q((y) => {
|
|
3502
|
+
y.preventDefault(), x(true);
|
|
3503
|
+
}, []), Kn = Q((y) => {
|
|
3504
|
+
y.preventDefault(), x(false);
|
|
3505
|
+
}, []), Un = Q(async (y) => {
|
|
3506
|
+
if (y.preventDefault(), x(false), !We) {
|
|
3507
3507
|
Le("WASM module is still loading. Please wait.");
|
|
3508
3508
|
return;
|
|
3509
3509
|
}
|
|
3510
|
-
const I =
|
|
3510
|
+
const I = y.dataTransfer.files[0];
|
|
3511
3511
|
if (!I) return;
|
|
3512
3512
|
const B = I.name.toLowerCase();
|
|
3513
3513
|
if (!B.endsWith(".obj") && !B.endsWith(".stl")) {
|
|
@@ -3515,12 +3515,12 @@ let __tla = (async () => {
|
|
|
3515
3515
|
return;
|
|
3516
3516
|
}
|
|
3517
3517
|
if (B.endsWith(".stl")) {
|
|
3518
|
-
Gt("stl"), p(true),
|
|
3518
|
+
Gt("stl"), p(true), b("Converting STL...");
|
|
3519
3519
|
try {
|
|
3520
3520
|
const R = await Et(I);
|
|
3521
3521
|
await Be(R, I.name.replace(/\.stl$/i, ".obj"));
|
|
3522
3522
|
} catch (R) {
|
|
3523
|
-
Le(R instanceof Error ? R.message : "Failed to process STL file."), p(false),
|
|
3523
|
+
Le(R instanceof Error ? R.message : "Failed to process STL file."), p(false), b("");
|
|
3524
3524
|
}
|
|
3525
3525
|
} else {
|
|
3526
3526
|
const R = await I.text();
|
|
@@ -3529,9 +3529,9 @@ let __tla = (async () => {
|
|
|
3529
3529
|
}, [
|
|
3530
3530
|
We,
|
|
3531
3531
|
Be
|
|
3532
|
-
]), Jn = Q((
|
|
3533
|
-
_(
|
|
3534
|
-
spacing_type:
|
|
3532
|
+
]), Jn = Q((y) => {
|
|
3533
|
+
_(y), A(y === "AK" ? 2 : 1), k(false), h && (Ue(h.geometry, h.wasScaled), z(null)), c == null ? void 0 : c("file_loaded", {
|
|
3534
|
+
spacing_type: y,
|
|
3535
3535
|
file_format: Te,
|
|
3536
3536
|
is_double_wall: false
|
|
3537
3537
|
});
|
|
@@ -3542,12 +3542,12 @@ let __tla = (async () => {
|
|
|
3542
3542
|
Te
|
|
3543
3543
|
]);
|
|
3544
3544
|
U(() => {
|
|
3545
|
-
if (!e || T.length !== 1 ||
|
|
3545
|
+
if (!e || T.length !== 1 || !$e.current || it.current) return;
|
|
3546
3546
|
it.current = true;
|
|
3547
|
-
const
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3547
|
+
const y = T[0], I = $e.current, B = e.geometry, { positions: R, indices: J } = mt(B), O = new Float32Array([
|
|
3548
|
+
y.position.x,
|
|
3549
|
+
y.position.y,
|
|
3550
|
+
y.position.z
|
|
3551
3551
|
]), ge = I.detect_shell(R, J, O, 40), Ce = ge.details(), te = ge.is_double_shell();
|
|
3552
3552
|
ve(`SHELL_DETECT: ${te ? "DOUBLE" : "SINGLE"} \u2014 ${Ce}`), te && (ue(true), oe(true), ve(`SHELL_DETECT: double shell, thickness=${ge.thickness().toFixed(1)}mm`));
|
|
3553
3553
|
}, [
|
|
@@ -3557,8 +3557,8 @@ let __tla = (async () => {
|
|
|
3557
3557
|
]);
|
|
3558
3558
|
const Qn = Q(() => {
|
|
3559
3559
|
if (!e || T.length < 2) return;
|
|
3560
|
-
G(true),
|
|
3561
|
-
const
|
|
3560
|
+
G(true), be("Please wait..."), ve("PIPELINE: starting processing pipeline...");
|
|
3561
|
+
const y = performance.now();
|
|
3562
3562
|
setTimeout(() => {
|
|
3563
3563
|
const I = [
|
|
3564
3564
|
T[1],
|
|
@@ -3567,7 +3567,7 @@ let __tla = (async () => {
|
|
|
3567
3567
|
];
|
|
3568
3568
|
_o(e, I, gt, {
|
|
3569
3569
|
onStatus: (B) => {
|
|
3570
|
-
|
|
3570
|
+
be(B), ve(`PIPELINE: ${B}`);
|
|
3571
3571
|
},
|
|
3572
3572
|
addLandmarkPoint: Ut,
|
|
3573
3573
|
removeLandmarkPoint: Jt,
|
|
@@ -3595,8 +3595,8 @@ let __tla = (async () => {
|
|
|
3595
3595
|
setInnerShellExtracted: pe,
|
|
3596
3596
|
setMeasurementGeometry: we,
|
|
3597
3597
|
setWasmSlices: ke,
|
|
3598
|
-
wasmModule:
|
|
3599
|
-
}), ve(`PIPELINE: completed in ${(performance.now() -
|
|
3598
|
+
wasmModule: $e.current ?? void 0
|
|
3599
|
+
}), ve(`PIPELINE: completed in ${(performance.now() - y).toFixed(0)}ms`), at.current = false, G(false);
|
|
3600
3600
|
}, 50);
|
|
3601
3601
|
}, [
|
|
3602
3602
|
e,
|
|
@@ -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
|
|
3615
|
-
if (!
|
|
3616
|
-
const B = new URL(
|
|
3617
|
-
B.toLowerCase().endsWith(".stl") ? await Be(await
|
|
3618
|
-
} catch (
|
|
3619
|
-
Le(
|
|
3614
|
+
const y = await fetch(t);
|
|
3615
|
+
if (!y.ok) throw new Error(`Failed to download scan: ${y.status}`);
|
|
3616
|
+
const B = new URL(t).pathname.split("/").pop() || "scan.obj";
|
|
3617
|
+
B.toLowerCase().endsWith(".stl") ? await Be(await y.arrayBuffer(), B) : await Be(await y.text(), B);
|
|
3618
|
+
} catch (y) {
|
|
3619
|
+
Le(y instanceof Error ? y.message : "Failed to reload scan.");
|
|
3620
3620
|
}
|
|
3621
3621
|
}
|
|
3622
3622
|
}, [
|
|
3623
|
-
|
|
3623
|
+
t,
|
|
3624
3624
|
We,
|
|
3625
3625
|
Be,
|
|
3626
3626
|
st
|
|
@@ -3635,23 +3635,23 @@ let __tla = (async () => {
|
|
|
3635
3635
|
var _a;
|
|
3636
3636
|
if (!e || T.length < 3) return 0;
|
|
3637
3637
|
if (Y) return Math.abs(T[0].position.y - T[2].position.y);
|
|
3638
|
-
const
|
|
3639
|
-
|
|
3640
|
-
const I = ((_a =
|
|
3638
|
+
const y = e.geometry;
|
|
3639
|
+
y.computeBoundingBox();
|
|
3640
|
+
const I = ((_a = y.boundingBox) == null ? void 0 : _a.min.y) ?? 0;
|
|
3641
3641
|
return Math.abs(T[0].position.y - I);
|
|
3642
3642
|
}, [
|
|
3643
3643
|
e,
|
|
3644
3644
|
T,
|
|
3645
3645
|
Y
|
|
3646
|
-
]), eo = Q((
|
|
3647
|
-
$n(
|
|
3648
|
-
}, []), tn = Q(async (
|
|
3649
|
-
if (!
|
|
3646
|
+
]), eo = Q((y) => {
|
|
3647
|
+
$n(y), zt(y.circumferences), Mt(true), Yt(true);
|
|
3648
|
+
}, []), tn = Q(async (y) => {
|
|
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,9 +3663,9 @@ 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
|
-
skipReason:
|
|
3668
|
+
skipReason: y,
|
|
3669
3669
|
screenshots: I,
|
|
3670
3670
|
alignedGeometry: e == null ? void 0 : e.geometry
|
|
3671
3671
|
});
|
|
@@ -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(() => {
|
|
@@ -3689,24 +3689,24 @@ let __tla = (async () => {
|
|
|
3689
3689
|
It.current = null;
|
|
3690
3690
|
return;
|
|
3691
3691
|
}
|
|
3692
|
-
const
|
|
3693
|
-
It.current = Ot(
|
|
3692
|
+
const y = (Oe ?? e).geometry;
|
|
3693
|
+
It.current = Ot(y);
|
|
3694
3694
|
}, [
|
|
3695
3695
|
e,
|
|
3696
3696
|
K,
|
|
3697
|
-
|
|
3697
|
+
Oe
|
|
3698
3698
|
]);
|
|
3699
|
-
const Dt = Q(async (
|
|
3700
|
-
if (!
|
|
3699
|
+
const Dt = Q(async (y) => {
|
|
3700
|
+
if (!s || !e || N.length === 0 || !L) return;
|
|
3701
3701
|
ot(true);
|
|
3702
3702
|
const I = await Ke().catch(() => {
|
|
3703
3703
|
});
|
|
3704
3704
|
try {
|
|
3705
3705
|
let B = 0, R = 0;
|
|
3706
3706
|
if (T.length >= 2) {
|
|
3707
|
-
const J = (
|
|
3707
|
+
const J = (Oe ?? e).geometry, ge = T[0].position.y;
|
|
3708
3708
|
try {
|
|
3709
|
-
const Ce = It.current ?? Ot(J), te =
|
|
3709
|
+
const Ce = It.current ?? Ot(J), te = He(Ce, J, ge);
|
|
3710
3710
|
if (te.linePoints.length >= 2) {
|
|
3711
3711
|
let Me = te.linePoints[0], Re = te.linePoints[0], se = te.linePoints[0], Qe = te.linePoints[0];
|
|
3712
3712
|
for (const _e of te.linePoints) _e.x < Me.x && (Me = _e), _e.x > Re.x && (Re = _e), _e.z < se.z && (se = _e), _e.z > Qe.z && (Qe = _e);
|
|
@@ -3715,11 +3715,11 @@ 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,
|
|
3722
|
-
measurementSource:
|
|
3722
|
+
measurementSource: y === "use_form_measurements" ? "form_provided" : "scan_derived",
|
|
3723
3723
|
isDoubleWall: Y,
|
|
3724
3724
|
isUnitConverted: false,
|
|
3725
3725
|
formMeasurements: Se,
|
|
@@ -3727,34 +3727,34 @@ let __tla = (async () => {
|
|
|
3727
3727
|
frontalHeight: (Ze == null ? void 0 : Ze.frontalHeight) ?? Je,
|
|
3728
3728
|
transverseML: B,
|
|
3729
3729
|
transverseAP: R,
|
|
3730
|
-
scanUrl:
|
|
3731
|
-
decision:
|
|
3730
|
+
scanUrl: t,
|
|
3731
|
+
decision: y,
|
|
3732
3732
|
userEnteredMeasurements: Ze ?? void 0,
|
|
3733
3733
|
screenshots: I,
|
|
3734
|
-
alignedGeometry: (
|
|
3734
|
+
alignedGeometry: (Oe ?? e).geometry
|
|
3735
3735
|
});
|
|
3736
3736
|
} finally {
|
|
3737
3737
|
ot(false);
|
|
3738
3738
|
}
|
|
3739
3739
|
}, [
|
|
3740
|
-
|
|
3740
|
+
s,
|
|
3741
3741
|
e,
|
|
3742
|
-
|
|
3742
|
+
Oe,
|
|
3743
3743
|
N,
|
|
3744
3744
|
L,
|
|
3745
3745
|
T,
|
|
3746
3746
|
Te,
|
|
3747
3747
|
Y,
|
|
3748
3748
|
Se,
|
|
3749
|
-
|
|
3749
|
+
t,
|
|
3750
3750
|
Ze,
|
|
3751
3751
|
Je,
|
|
3752
3752
|
Ke
|
|
3753
3753
|
]), to = j(() => {
|
|
3754
3754
|
if (!Se || N.length === 0) return false;
|
|
3755
|
-
const
|
|
3756
|
-
if (
|
|
3757
|
-
for (let I = 0; I <
|
|
3755
|
+
const y = Math.min(Se.length, N.length);
|
|
3756
|
+
if (y === 0) return false;
|
|
3757
|
+
for (let I = 0; I < y; I++) {
|
|
3758
3758
|
const B = Se[I], R = N[I];
|
|
3759
3759
|
if (!R || B == null || B === 0) continue;
|
|
3760
3760
|
const J = R.modifiedValue ?? R.originalValue;
|
|
@@ -3764,7 +3764,7 @@ let __tla = (async () => {
|
|
|
3764
3764
|
}, [
|
|
3765
3765
|
Se,
|
|
3766
3766
|
N
|
|
3767
|
-
]), no = nt ? 5 : K &&
|
|
3767
|
+
]), no = nt ? 5 : K && Ne || K ? 4 : e ? T.length === 0 ? 2 : 3 : 1, oo = [
|
|
3768
3768
|
{
|
|
3769
3769
|
label: "Load File",
|
|
3770
3770
|
number: 1
|
|
@@ -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 &&
|
|
3841
|
+
K && Ne && 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
|
|
@@ -4081,8 +4081,8 @@ let __tla = (async () => {
|
|
|
4081
4081
|
children: [
|
|
4082
4082
|
"AK",
|
|
4083
4083
|
"BK"
|
|
4084
|
-
].map((
|
|
4085
|
-
onClick: () => _(
|
|
4084
|
+
].map((y) => F("label", {
|
|
4085
|
+
onClick: () => _(y),
|
|
4086
4086
|
style: {
|
|
4087
4087
|
flex: 1,
|
|
4088
4088
|
display: "flex",
|
|
@@ -4091,16 +4091,16 @@ let __tla = (async () => {
|
|
|
4091
4091
|
border: "2px solid",
|
|
4092
4092
|
borderRadius: 4,
|
|
4093
4093
|
cursor: "pointer",
|
|
4094
|
-
borderColor: L ===
|
|
4095
|
-
backgroundColor: L ===
|
|
4094
|
+
borderColor: L === y ? "rgb(12, 67, 173)" : "#e0e0e0",
|
|
4095
|
+
backgroundColor: L === y ? "rgba(12, 67, 173, 0.04)" : "#fff",
|
|
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
|
-
checked: L ===
|
|
4103
|
-
onChange: () => _(
|
|
4102
|
+
checked: L === y,
|
|
4103
|
+
onChange: () => _(y),
|
|
4104
4104
|
style: {
|
|
4105
4105
|
accentColor: "rgb(12, 67, 173)",
|
|
4106
4106
|
marginBottom: 12,
|
|
@@ -4108,14 +4108,14 @@ 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,
|
|
4115
4115
|
color: "rgba(0,0,0,0.87)",
|
|
4116
4116
|
marginBottom: 4
|
|
4117
4117
|
},
|
|
4118
|
-
children:
|
|
4118
|
+
children: y
|
|
4119
4119
|
}),
|
|
4120
4120
|
F("span", {
|
|
4121
4121
|
style: {
|
|
@@ -4123,12 +4123,12 @@ let __tla = (async () => {
|
|
|
4123
4123
|
color: "rgba(0,0,0,0.54)"
|
|
4124
4124
|
},
|
|
4125
4125
|
children: [
|
|
4126
|
-
|
|
4126
|
+
y === "AK" ? "2" : "1",
|
|
4127
4127
|
"-inch measurement spacing"
|
|
4128
4128
|
]
|
|
4129
4129
|
})
|
|
4130
4130
|
]
|
|
4131
|
-
},
|
|
4131
|
+
}, y))
|
|
4132
4132
|
})
|
|
4133
4133
|
]
|
|
4134
4134
|
}),
|
|
@@ -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,19 +4268,19 @@ 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
|
}),
|
|
4278
4278
|
e && K && T.length >= 3 && (() => {
|
|
4279
4279
|
const I = e.geometry.getIndex();
|
|
4280
4280
|
if (!I || I.count < 30) return null;
|
|
4281
|
-
const B = T[2], R = T[0], J =
|
|
4282
|
-
return P === "2D" ?
|
|
4283
|
-
mesh:
|
|
4281
|
+
const B = T[2], R = T[0], J = Ve ?? B.position.y, O = Ae ?? St ?? R.position.y;
|
|
4282
|
+
return P === "2D" ? i(Jo, {
|
|
4283
|
+
mesh: Oe ?? e,
|
|
4284
4284
|
upperY: O,
|
|
4285
4285
|
originY: R.position.y,
|
|
4286
4286
|
modelSize: d,
|
|
@@ -4288,8 +4288,8 @@ let __tla = (async () => {
|
|
|
4288
4288
|
displayUnit: D
|
|
4289
4289
|
}) : F(Ee, {
|
|
4290
4290
|
children: [
|
|
4291
|
-
|
|
4292
|
-
mesh:
|
|
4291
|
+
i(Vo, {
|
|
4292
|
+
mesh: Oe ?? e,
|
|
4293
4293
|
startY: J,
|
|
4294
4294
|
endY: O,
|
|
4295
4295
|
spacing: lt,
|
|
@@ -4298,19 +4298,19 @@ let __tla = (async () => {
|
|
|
4298
4298
|
reverseOrder: true,
|
|
4299
4299
|
displayUnit: D,
|
|
4300
4300
|
useInnerSurface: Y && !Z,
|
|
4301
|
-
formMeasurements:
|
|
4301
|
+
formMeasurements: Ne ? On ?? Se : Ye ? Se : void 0,
|
|
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,
|
|
4309
4309
|
displayUnit: D,
|
|
4310
4310
|
bottomY: Y ? B.position.y : void 0,
|
|
4311
|
-
formHeight:
|
|
4311
|
+
formHeight: Ne ? 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,11 +4416,11 @@ let __tla = (async () => {
|
|
|
4416
4416
|
})
|
|
4417
4417
|
]
|
|
4418
4418
|
}),
|
|
4419
|
-
|
|
4419
|
+
n.showDebug && De && e && P === "3D" && i(yr, {
|
|
4420
4420
|
layers: Xt,
|
|
4421
|
-
onToggleLayer: (
|
|
4421
|
+
onToggleLayer: (y) => En((I) => ({
|
|
4422
4422
|
...I,
|
|
4423
|
-
[
|
|
4423
|
+
[y]: !I[y]
|
|
4424
4424
|
})),
|
|
4425
4425
|
isDoubleShell: Y
|
|
4426
4426
|
}),
|
|
@@ -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,8 +4562,8 @@ 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:
|
|
4566
|
-
onClick: () => Mt((
|
|
4565
|
+
children: i("button", {
|
|
4566
|
+
onClick: () => Mt((y) => !y),
|
|
4567
4567
|
style: {
|
|
4568
4568
|
padding: "6px 14px",
|
|
4569
4569
|
fontSize: 13,
|
|
@@ -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,15 +4585,15 @@ 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
|
-
const
|
|
4591
|
-
if (!
|
|
4590
|
+
const y = await Ke();
|
|
4591
|
+
if (!y) return;
|
|
4592
4592
|
const I = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), B = (R, J) => {
|
|
4593
4593
|
const O = document.createElement("a");
|
|
4594
4594
|
O.href = R, O.download = J, O.click();
|
|
4595
4595
|
};
|
|
4596
|
-
B(
|
|
4596
|
+
B(y.frontal_view_png, `measurements_front_${I}.png`), await new Promise((R) => setTimeout(R, 300)), B(y.side_view_png, `measurements_transverse_${I}.png`);
|
|
4597
4597
|
},
|
|
4598
4598
|
style: {
|
|
4599
4599
|
padding: "6px 14px",
|
|
@@ -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,8 +4616,8 @@ 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:
|
|
4620
|
-
onClick: () => Bn((
|
|
4619
|
+
children: i("button", {
|
|
4620
|
+
onClick: () => Bn((y) => !y),
|
|
4621
4621
|
style: {
|
|
4622
4622
|
padding: "6px 14px",
|
|
4623
4623
|
fontSize: 13,
|
|
@@ -4633,13 +4633,35 @@ 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 &&
|
|
4640
|
+
e && ye && K && i(Ko, {
|
|
4641
4641
|
isDoubleShell: Y,
|
|
4642
4642
|
onDismiss: () => oe(false)
|
|
4643
|
+
}),
|
|
4644
|
+
!Ne && s && i("button", {
|
|
4645
|
+
disabled: ze,
|
|
4646
|
+
onClick: () => At(true),
|
|
4647
|
+
style: {
|
|
4648
|
+
position: "absolute",
|
|
4649
|
+
bottom: 60,
|
|
4650
|
+
left: 16,
|
|
4651
|
+
zIndex: 10,
|
|
4652
|
+
padding: "6px 16px",
|
|
4653
|
+
borderRadius: 4,
|
|
4654
|
+
fontSize: 13,
|
|
4655
|
+
fontWeight: 500,
|
|
4656
|
+
backgroundColor: "#fff",
|
|
4657
|
+
border: "1px solid #bdbdbd",
|
|
4658
|
+
color: ze ? "#999" : "#666",
|
|
4659
|
+
cursor: ze ? "not-allowed" : "pointer",
|
|
4660
|
+
fontFamily: "system-ui, sans-serif",
|
|
4661
|
+
letterSpacing: "0.4px",
|
|
4662
|
+
lineHeight: "36px"
|
|
4663
|
+
},
|
|
4664
|
+
children: "Have Galileo Check My Measurements"
|
|
4643
4665
|
})
|
|
4644
4666
|
]
|
|
4645
4667
|
})
|
|
@@ -4658,7 +4680,7 @@ let __tla = (async () => {
|
|
|
4658
4680
|
zIndex: 50
|
|
4659
4681
|
},
|
|
4660
4682
|
children: [
|
|
4661
|
-
|
|
4683
|
+
i("div", {
|
|
4662
4684
|
style: {
|
|
4663
4685
|
width: 32,
|
|
4664
4686
|
height: 32,
|
|
@@ -4668,7 +4690,7 @@ let __tla = (async () => {
|
|
|
4668
4690
|
animation: "gm-spin 0.8s linear infinite"
|
|
4669
4691
|
}
|
|
4670
4692
|
}),
|
|
4671
|
-
|
|
4693
|
+
i("p", {
|
|
4672
4694
|
style: {
|
|
4673
4695
|
marginTop: 12,
|
|
4674
4696
|
fontSize: 14,
|
|
@@ -4677,7 +4699,7 @@ let __tla = (async () => {
|
|
|
4677
4699
|
},
|
|
4678
4700
|
children: "Generating screenshots and preparing data\u2026"
|
|
4679
4701
|
}),
|
|
4680
|
-
|
|
4702
|
+
i("style", {
|
|
4681
4703
|
children: "@keyframes gm-spin { to { transform: rotate(360deg) } }"
|
|
4682
4704
|
})
|
|
4683
4705
|
]
|
|
@@ -4688,38 +4710,20 @@ let __tla = (async () => {
|
|
|
4688
4710
|
backgroundColor: "#fff",
|
|
4689
4711
|
borderTop: "1px solid #e0e0e0",
|
|
4690
4712
|
display: "flex",
|
|
4691
|
-
alignItems: "
|
|
4713
|
+
alignItems: "flex-start",
|
|
4692
4714
|
justifyContent: "space-between",
|
|
4693
4715
|
gap: 8,
|
|
4694
4716
|
flexShrink: 0
|
|
4695
4717
|
},
|
|
4696
4718
|
children: [
|
|
4697
|
-
|
|
4698
|
-
disabled: ze,
|
|
4699
|
-
onClick: () => At(true),
|
|
4700
|
-
style: {
|
|
4701
|
-
padding: "6px 16px",
|
|
4702
|
-
borderRadius: 4,
|
|
4703
|
-
fontSize: 13,
|
|
4704
|
-
fontWeight: 500,
|
|
4705
|
-
backgroundColor: "#fff",
|
|
4706
|
-
border: "1px solid #bdbdbd",
|
|
4707
|
-
color: ze ? "#999" : "#666",
|
|
4708
|
-
cursor: ze ? "not-allowed" : "pointer",
|
|
4709
|
-
fontFamily: "system-ui, sans-serif",
|
|
4710
|
-
letterSpacing: "0.4px",
|
|
4711
|
-
lineHeight: "36px"
|
|
4712
|
-
},
|
|
4713
|
-
children: "Have Galileo Check My Measurements"
|
|
4714
|
-
}),
|
|
4715
|
-
$e && s("div", {}),
|
|
4719
|
+
i("div", {}),
|
|
4716
4720
|
F("div", {
|
|
4717
4721
|
style: {
|
|
4718
4722
|
display: "flex",
|
|
4719
4723
|
gap: 8
|
|
4720
4724
|
},
|
|
4721
4725
|
children: [
|
|
4722
|
-
e && !K && T.length >= 2 &&
|
|
4726
|
+
e && !K && T.length >= 2 && i("button", {
|
|
4723
4727
|
onClick: Qn,
|
|
4724
4728
|
style: {
|
|
4725
4729
|
padding: "6px 16px",
|
|
@@ -4736,7 +4740,7 @@ let __tla = (async () => {
|
|
|
4736
4740
|
},
|
|
4737
4741
|
children: "Next \xBB"
|
|
4738
4742
|
}),
|
|
4739
|
-
K && nt &&
|
|
4743
|
+
K && nt && !Ne && i("button", {
|
|
4740
4744
|
onClick: () => tt(true),
|
|
4741
4745
|
style: {
|
|
4742
4746
|
padding: "6px 16px",
|
|
@@ -4753,7 +4757,7 @@ let __tla = (async () => {
|
|
|
4753
4757
|
},
|
|
4754
4758
|
children: "Edit Measurements"
|
|
4755
4759
|
}),
|
|
4756
|
-
K && nt && (to ?
|
|
4760
|
+
K && nt && (to ? i("button", {
|
|
4757
4761
|
disabled: ze,
|
|
4758
4762
|
onClick: () => Dt("continue"),
|
|
4759
4763
|
style: {
|
|
@@ -4772,7 +4776,7 @@ let __tla = (async () => {
|
|
|
4772
4776
|
children: "Continue"
|
|
4773
4777
|
}) : F(Ee, {
|
|
4774
4778
|
children: [
|
|
4775
|
-
|
|
4779
|
+
i("button", {
|
|
4776
4780
|
disabled: ze,
|
|
4777
4781
|
onClick: () => Dt("use_form_measurements"),
|
|
4778
4782
|
style: {
|
|
@@ -4790,7 +4794,7 @@ let __tla = (async () => {
|
|
|
4790
4794
|
},
|
|
4791
4795
|
children: "Set to Measurements"
|
|
4792
4796
|
}),
|
|
4793
|
-
|
|
4797
|
+
i("button", {
|
|
4794
4798
|
disabled: ze,
|
|
4795
4799
|
onClick: () => Dt("use_scan"),
|
|
4796
4800
|
style: {
|
|
@@ -4840,7 +4844,7 @@ let __tla = (async () => {
|
|
|
4840
4844
|
flexShrink: 0
|
|
4841
4845
|
},
|
|
4842
4846
|
children: [
|
|
4843
|
-
|
|
4847
|
+
i("span", {
|
|
4844
4848
|
style: {
|
|
4845
4849
|
color: "#58a6ff",
|
|
4846
4850
|
fontSize: 10,
|
|
@@ -4863,7 +4867,7 @@ let __tla = (async () => {
|
|
|
4863
4867
|
},
|
|
4864
4868
|
children: [
|
|
4865
4869
|
"WASM ",
|
|
4866
|
-
|
|
4870
|
+
$e.current ? "v2" : "N/A",
|
|
4867
4871
|
" | ",
|
|
4868
4872
|
T.length,
|
|
4869
4873
|
" pts | ",
|
|
@@ -4873,7 +4877,7 @@ let __tla = (async () => {
|
|
|
4873
4877
|
" slices"
|
|
4874
4878
|
]
|
|
4875
4879
|
}),
|
|
4876
|
-
|
|
4880
|
+
i("button", {
|
|
4877
4881
|
onClick: () => Kt([]),
|
|
4878
4882
|
style: {
|
|
4879
4883
|
background: "none",
|
|
@@ -4890,7 +4894,7 @@ let __tla = (async () => {
|
|
|
4890
4894
|
})
|
|
4891
4895
|
]
|
|
4892
4896
|
}),
|
|
4893
|
-
|
|
4897
|
+
i("div", {
|
|
4894
4898
|
ref: rt,
|
|
4895
4899
|
style: {
|
|
4896
4900
|
flex: 1,
|
|
@@ -4898,14 +4902,14 @@ let __tla = (async () => {
|
|
|
4898
4902
|
padding: "4px 10px",
|
|
4899
4903
|
lineHeight: 1.6
|
|
4900
4904
|
},
|
|
4901
|
-
children: kt.map((
|
|
4902
|
-
const B =
|
|
4903
|
-
return
|
|
4905
|
+
children: kt.map((y, I) => {
|
|
4906
|
+
const B = y.includes("ERROR") || y.includes("failed"), R = y.includes("warning") || y.includes("WARN"), J = y.includes("PIPELINE:"), O = y.includes("STATE:");
|
|
4907
|
+
return i("div", {
|
|
4904
4908
|
style: {
|
|
4905
4909
|
color: B ? "#f85149" : R ? "#d29922" : J ? "#58a6ff" : O ? "#3fb950" : "#8b949e",
|
|
4906
4910
|
whiteSpace: "pre"
|
|
4907
4911
|
},
|
|
4908
|
-
children:
|
|
4912
|
+
children: y
|
|
4909
4913
|
}, I);
|
|
4910
4914
|
})
|
|
4911
4915
|
})
|
|
@@ -4913,111 +4917,108 @@ let __tla = (async () => {
|
|
|
4913
4917
|
})
|
|
4914
4918
|
]
|
|
4915
4919
|
}),
|
|
4916
|
-
Tn &&
|
|
4920
|
+
Tn && i(Ln, {
|
|
4917
4921
|
onSkip: tn,
|
|
4918
4922
|
onCancel: () => At(false)
|
|
4919
4923
|
})
|
|
4920
4924
|
]
|
|
4921
4925
|
});
|
|
4922
4926
|
};
|
|
4923
|
-
function Sr({ screenshotFnRef:
|
|
4927
|
+
function Sr({ screenshotFnRef: n }) {
|
|
4924
4928
|
return U(() => {
|
|
4925
|
-
|
|
4929
|
+
n.current = null;
|
|
4926
4930
|
}, [
|
|
4927
|
-
|
|
4931
|
+
n
|
|
4928
4932
|
]), null;
|
|
4929
4933
|
}
|
|
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 (
|
|
4934
|
+
Rn = function(n) {
|
|
4935
|
+
const r = n === "AK" ? 2 : 1, t = [];
|
|
4936
|
+
for (let o = 2; o >= 1; o -= r) t.push(`${o}_above`);
|
|
4937
|
+
t.push("at_ref");
|
|
4938
|
+
for (let o = r; o <= 9; o += r) t.push(`${o}_below`);
|
|
4939
|
+
if (n === "BK") for (const o of [
|
|
4936
4940
|
10,
|
|
4937
4941
|
11,
|
|
4938
4942
|
12
|
|
4939
|
-
])
|
|
4943
|
+
]) t.push(`${o}_below`);
|
|
4940
4944
|
else for (const o of [
|
|
4941
4945
|
10,
|
|
4942
4946
|
12,
|
|
4943
4947
|
14,
|
|
4944
4948
|
16,
|
|
4945
4949
|
18
|
|
4946
|
-
])
|
|
4947
|
-
return
|
|
4950
|
+
]) t.push(`${o}_below`);
|
|
4951
|
+
return t;
|
|
4948
4952
|
};
|
|
4949
|
-
ht = function(
|
|
4950
|
-
const
|
|
4951
|
-
for (let
|
|
4952
|
-
const l =
|
|
4953
|
-
l != null && !isNaN(l) && (o[
|
|
4953
|
+
ht = function(n, r) {
|
|
4954
|
+
const t = Rn(r), o = {};
|
|
4955
|
+
for (let s = 0; s < Math.min(n.length, t.length); s++) {
|
|
4956
|
+
const l = n[s];
|
|
4957
|
+
l != null && !isNaN(l) && (o[t[s]] = l);
|
|
4954
4958
|
}
|
|
4955
4959
|
return o;
|
|
4956
4960
|
};
|
|
4957
|
-
vr = function(
|
|
4958
|
-
if (!
|
|
4959
|
-
const o = Rn(r).map((
|
|
4960
|
-
const l =
|
|
4961
|
+
vr = function(n, r) {
|
|
4962
|
+
if (!n) return;
|
|
4963
|
+
const o = Rn(r).map((s) => {
|
|
4964
|
+
const l = n[s];
|
|
4961
4965
|
return l ?? void 0;
|
|
4962
4966
|
});
|
|
4963
|
-
if (!o.every((
|
|
4967
|
+
if (!o.every((s) => s == null)) return o;
|
|
4964
4968
|
};
|
|
4965
|
-
function Cr(
|
|
4966
|
-
const r =
|
|
4969
|
+
function Cr(n) {
|
|
4970
|
+
const r = n.getAttribute("position");
|
|
4967
4971
|
if (!r) return "";
|
|
4968
|
-
const
|
|
4972
|
+
const t = [
|
|
4969
4973
|
"# Galileo processed mesh"
|
|
4970
4974
|
];
|
|
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 ?
|
|
4975
|
+
for (let l = 0; l < r.count; l++) t.push(`v ${r.getX(l)} ${r.getY(l)} ${r.getZ(l)}`);
|
|
4976
|
+
const o = n.getAttribute("normal");
|
|
4977
|
+
if (o) for (let l = 0; l < o.count; l++) t.push(`vn ${o.getX(l)} ${o.getY(l)} ${o.getZ(l)}`);
|
|
4978
|
+
const s = n.getIndex();
|
|
4979
|
+
if (s) for (let l = 0; l < s.count; l += 3) {
|
|
4980
|
+
const c = s.getX(l) + 1, a = s.getX(l + 1) + 1, e = s.getX(l + 2) + 1;
|
|
4981
|
+
o ? t.push(`f ${c}//${c} ${a}//${a} ${e}//${e}`) : t.push(`f ${c} ${a} ${e}`);
|
|
4978
4982
|
}
|
|
4979
4983
|
else for (let l = 0; l < r.count; l += 3) {
|
|
4980
4984
|
const c = l + 1, a = l + 2, e = l + 3;
|
|
4981
|
-
o ?
|
|
4985
|
+
o ? t.push(`f ${c}//${c} ${a}//${a} ${e}//${e}`) : t.push(`f ${c} ${a} ${e}`);
|
|
4982
4986
|
}
|
|
4983
|
-
return
|
|
4987
|
+
return t.join(`
|
|
4984
4988
|
`);
|
|
4985
4989
|
}
|
|
4986
|
-
async function zr(
|
|
4987
|
-
for (let
|
|
4988
|
-
const
|
|
4990
|
+
async function zr(n, r) {
|
|
4991
|
+
for (let t = 0; t < 3; t++) try {
|
|
4992
|
+
const o = await fetch(n, {
|
|
4989
4993
|
method: "PUT",
|
|
4990
|
-
body: r
|
|
4991
|
-
headers: {
|
|
4992
|
-
"Content-Type": n
|
|
4993
|
-
}
|
|
4994
|
+
body: r
|
|
4994
4995
|
});
|
|
4995
|
-
if (
|
|
4996
|
+
if (o.ok) return {
|
|
4996
4997
|
success: true,
|
|
4997
|
-
status:
|
|
4998
|
+
status: o.status
|
|
4998
4999
|
};
|
|
4999
|
-
if (
|
|
5000
|
+
if (o.status >= 400 && o.status < 500) return {
|
|
5000
5001
|
success: false,
|
|
5001
|
-
status:
|
|
5002
|
-
error: `HTTP ${
|
|
5002
|
+
status: o.status,
|
|
5003
|
+
error: `HTTP ${o.status}: ${o.statusText}`
|
|
5003
5004
|
};
|
|
5004
|
-
if (
|
|
5005
|
-
await new Promise((
|
|
5005
|
+
if (t < 2) {
|
|
5006
|
+
await new Promise((s) => setTimeout(s, (t + 1) * 1e3));
|
|
5006
5007
|
continue;
|
|
5007
5008
|
}
|
|
5008
5009
|
return {
|
|
5009
5010
|
success: false,
|
|
5010
|
-
status:
|
|
5011
|
-
error: `HTTP ${
|
|
5011
|
+
status: o.status,
|
|
5012
|
+
error: `HTTP ${o.status}: ${o.statusText}`
|
|
5012
5013
|
};
|
|
5013
|
-
} catch (
|
|
5014
|
-
if (
|
|
5015
|
-
await new Promise((
|
|
5014
|
+
} catch (o) {
|
|
5015
|
+
if (t < 2) {
|
|
5016
|
+
await new Promise((s) => setTimeout(s, (t + 1) * 1e3));
|
|
5016
5017
|
continue;
|
|
5017
5018
|
}
|
|
5018
5019
|
return {
|
|
5019
5020
|
success: false,
|
|
5020
|
-
error:
|
|
5021
|
+
error: o instanceof Error ? o.message : String(o)
|
|
5021
5022
|
};
|
|
5022
5023
|
}
|
|
5023
5024
|
return {
|
|
@@ -5025,15 +5026,15 @@ let __tla = (async () => {
|
|
|
5025
5026
|
error: "Upload failed after 3 attempts"
|
|
5026
5027
|
};
|
|
5027
5028
|
}
|
|
5028
|
-
Rr = ({ request:
|
|
5029
|
-
const [o,
|
|
5029
|
+
Rr = ({ request: n, onComplete: r, wasmModule: t }) => {
|
|
5030
|
+
const [o, s] = W(null);
|
|
5030
5031
|
U(() => {
|
|
5031
|
-
if (
|
|
5032
|
+
if (t != null) return;
|
|
5032
5033
|
let e = false;
|
|
5033
5034
|
const m = async (d) => {
|
|
5034
5035
|
try {
|
|
5035
5036
|
const f = await import("./geo_wasm-CDwm1q1Z.js");
|
|
5036
|
-
await f.default(), e ||
|
|
5037
|
+
await f.default(), e || s(f);
|
|
5037
5038
|
} catch (f) {
|
|
5038
5039
|
if (d < 2 && !e) {
|
|
5039
5040
|
const u = (d + 1) * 1e3 + d * 1e3;
|
|
@@ -5045,52 +5046,50 @@ let __tla = (async () => {
|
|
|
5045
5046
|
e = true;
|
|
5046
5047
|
};
|
|
5047
5048
|
}, [
|
|
5048
|
-
|
|
5049
|
+
t
|
|
5049
5050
|
]);
|
|
5050
|
-
const l =
|
|
5051
|
-
|
|
5052
|
-
|
|
5051
|
+
const l = t !== void 0 ? t : o ?? void 0, c = j(() => vr(n.form_measurements, n.spacing_type), [
|
|
5052
|
+
n.form_measurements,
|
|
5053
|
+
n.spacing_type
|
|
5053
5054
|
]), a = async (e) => {
|
|
5054
5055
|
var _a, _b;
|
|
5055
|
-
const m = e.scanMeasurements.map((v) => +(v.modifiedValue ?? v.originalValue).toFixed(1)), d = ht(m,
|
|
5056
|
+
const m = e.scanMeasurements.map((v) => +(v.modifiedValue ?? v.originalValue).toFixed(1)), d = ht(m, n.spacing_type);
|
|
5056
5057
|
let f, u;
|
|
5057
5058
|
if (e.formMeasurements) {
|
|
5058
|
-
f = ht(e.formMeasurements,
|
|
5059
|
+
f = ht(e.formMeasurements, n.spacing_type);
|
|
5059
5060
|
const v = e.scanMeasurements.map((S, A) => {
|
|
5060
5061
|
var _a2;
|
|
5061
5062
|
const w = (_a2 = e.formMeasurements) == null ? void 0 : _a2[A];
|
|
5062
5063
|
return w == null || isNaN(w) ? null : +((S.modifiedValue ?? S.originalValue) - w).toFixed(1);
|
|
5063
5064
|
});
|
|
5064
|
-
u = ht(v,
|
|
5065
|
+
u = ht(v, n.spacing_type);
|
|
5065
5066
|
}
|
|
5066
|
-
const x = e.userEnteredMeasurements ? ht(e.userEnteredMeasurements.circumferences,
|
|
5067
|
-
let
|
|
5068
|
-
if (
|
|
5067
|
+
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);
|
|
5068
|
+
let b;
|
|
5069
|
+
if (n.upload_url) if (!e.alignedGeometry) b = {
|
|
5069
5070
|
success: false,
|
|
5070
|
-
url:
|
|
5071
|
+
url: n.upload_url,
|
|
5071
5072
|
message: "No aligned geometry available \u2014 mesh processing may not have completed."
|
|
5072
5073
|
};
|
|
5073
5074
|
else try {
|
|
5074
5075
|
const v = Cr(e.alignedGeometry), S = new Blob([
|
|
5075
5076
|
v
|
|
5076
|
-
],
|
|
5077
|
-
|
|
5078
|
-
}), A = await zr(t.upload_url, S, "application/octet-stream");
|
|
5079
|
-
y = {
|
|
5077
|
+
]), A = await zr(n.upload_url, S);
|
|
5078
|
+
b = {
|
|
5080
5079
|
...A,
|
|
5081
|
-
url:
|
|
5080
|
+
url: n.upload_url,
|
|
5082
5081
|
message: A.success ? "Cleaned mesh uploaded successfully." : `Upload failed: ${A.error ?? "unknown error"}`
|
|
5083
5082
|
};
|
|
5084
5083
|
} catch (v) {
|
|
5085
|
-
|
|
5084
|
+
b = {
|
|
5086
5085
|
success: false,
|
|
5087
|
-
url:
|
|
5086
|
+
url: n.upload_url,
|
|
5088
5087
|
message: `Upload failed: ${v instanceof Error ? v.message : String(v)}`,
|
|
5089
5088
|
error: v instanceof Error ? v.message : String(v)
|
|
5090
5089
|
};
|
|
5091
5090
|
}
|
|
5092
5091
|
const P = {
|
|
5093
|
-
spacing_type:
|
|
5092
|
+
spacing_type: n.spacing_type,
|
|
5094
5093
|
source_unit: "mm",
|
|
5095
5094
|
file_format: e.fileFormat,
|
|
5096
5095
|
measurement_source: e.formMeasurements ? "form_provided" : "scan_derived",
|
|
@@ -5099,7 +5098,7 @@ let __tla = (async () => {
|
|
|
5099
5098
|
form_measurements: f,
|
|
5100
5099
|
scan_measurements: d,
|
|
5101
5100
|
measurement_variance: u,
|
|
5102
|
-
scan_url:
|
|
5101
|
+
scan_url: n.scan_url,
|
|
5103
5102
|
frontal_height: +e.frontalHeight.toFixed(1),
|
|
5104
5103
|
transverse_ml: +e.transverseML.toFixed(1),
|
|
5105
5104
|
transverse_ap: +e.transverseAP.toFixed(1),
|
|
@@ -5112,20 +5111,20 @@ let __tla = (async () => {
|
|
|
5112
5111
|
final_transverse_ml: +e.transverseML.toFixed(1),
|
|
5113
5112
|
final_transverse_ap: +e.transverseAP.toFixed(1),
|
|
5114
5113
|
screenshots: e.screenshots,
|
|
5115
|
-
upload:
|
|
5114
|
+
upload: b
|
|
5116
5115
|
};
|
|
5117
5116
|
r == null ? void 0 : r(P);
|
|
5118
5117
|
};
|
|
5119
|
-
return
|
|
5118
|
+
return i("div", {
|
|
5120
5119
|
style: {
|
|
5121
5120
|
width: "100%",
|
|
5122
5121
|
height: "100%",
|
|
5123
5122
|
display: "flex"
|
|
5124
5123
|
},
|
|
5125
|
-
children:
|
|
5126
|
-
config:
|
|
5127
|
-
spacingType:
|
|
5128
|
-
scanUrl:
|
|
5124
|
+
children: i(wr, {
|
|
5125
|
+
config: yo,
|
|
5126
|
+
spacingType: n.spacing_type,
|
|
5127
|
+
scanUrl: n.scan_url,
|
|
5129
5128
|
formMeasurements: c,
|
|
5130
5129
|
onComplete: a,
|
|
5131
5130
|
wasmModule: l
|