bimatter-viewer-react 0.5.5 → 0.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/lib/Viewer.d.ts +1 -0
- package/lib/index.js +746 -732
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
import e, { createContext as t, forwardRef as n, memo as r, useCallback as i, useContext as a, useEffect as o, useImperativeHandle as s, useMemo as c, useRef as l, useState as u } from "react";
|
|
2
2
|
import { Canvas as d, useFrame as f, useThree as p } from "@react-three/fiber";
|
|
3
3
|
import { OrbitControls as m, Stats as h } from "@react-three/drei";
|
|
4
|
-
import { Box3 as g, BoxGeometry as _, BufferAttribute as v, BufferGeometry as y, CanvasTexture as b, Color as x, ConeGeometry as S, DataTexture as C, DoubleSide as w, DynamicDrawUsage as T, Float32BufferAttribute as E, Group as D, Line as
|
|
5
|
-
import { useStore as
|
|
6
|
-
import { createStore as
|
|
7
|
-
import { CONTAINED as
|
|
8
|
-
import { Fragment as
|
|
9
|
-
import
|
|
4
|
+
import { Box3 as g, BoxGeometry as _, BufferAttribute as v, BufferGeometry as y, CanvasTexture as b, Color as x, ConeGeometry as S, DataTexture as C, DoubleSide as w, DynamicDrawUsage as T, Float32BufferAttribute as E, Group as D, Line as ee, Line3 as O, LineBasicMaterial as te, LineDashedMaterial as k, LineSegments as ne, LinearFilter as A, MathUtils as re, Matrix4 as j, Mesh as M, MeshBasicMaterial as ie, MeshLambertMaterial as ae, NearestFilter as oe, Object3D as se, OrthographicCamera as ce, PerspectiveCamera as le, Plane as ue, RGBAFormat as de, SRGBColorSpace as fe, Sphere as pe, SphereGeometry as me, Sprite as he, SpriteMaterial as ge, UnsignedByteType as _e, Vector2 as N, Vector3 as P } from "three";
|
|
5
|
+
import { useStore as ve } from "zustand";
|
|
6
|
+
import { createStore as ye } from "zustand/vanilla";
|
|
7
|
+
import { CONTAINED as be, INTERSECTED as xe, MeshBVH as Se, NOT_INTERSECTED as Ce, acceleratedRaycast as we } from "three-mesh-bvh";
|
|
8
|
+
import { Fragment as Te, jsx as F, jsxs as I } from "react/jsx-runtime";
|
|
9
|
+
import Ee from "pako";
|
|
10
10
|
//#region src/viewer/store/ViewerStoreContext.ts
|
|
11
|
-
var
|
|
11
|
+
var De = t(null);
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region src/viewer/store/useViewerStore.ts
|
|
14
|
-
function
|
|
15
|
-
return
|
|
14
|
+
function L(e) {
|
|
15
|
+
return ve(R(), e);
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
let e = a(
|
|
17
|
+
function R() {
|
|
18
|
+
let e = a(De);
|
|
19
19
|
if (!e) throw Error("useViewerStore must be used inside ViewerStoreProvider");
|
|
20
20
|
return e;
|
|
21
21
|
}
|
|
22
22
|
//#endregion
|
|
23
23
|
//#region src/viewer/store/ViewerStore.ts
|
|
24
|
-
var
|
|
24
|
+
var Oe = "rgb(17, 148, 189)", ke = "rgb(104, 198, 227)", Ae = {
|
|
25
25
|
bottom: !0,
|
|
26
26
|
left: !0,
|
|
27
27
|
right: !0,
|
|
28
28
|
top: !0,
|
|
29
29
|
visible: !0
|
|
30
30
|
};
|
|
31
|
-
function
|
|
32
|
-
return
|
|
31
|
+
function je() {
|
|
32
|
+
return ye((e) => ({
|
|
33
33
|
api: null,
|
|
34
34
|
defaultHotkeysEnabled: !0,
|
|
35
|
-
gridAxesVisibility:
|
|
35
|
+
gridAxesVisibility: Ae,
|
|
36
36
|
modelNames: {},
|
|
37
37
|
modelProps: {},
|
|
38
38
|
modelStructure: {},
|
|
39
|
-
preselectionColor:
|
|
39
|
+
preselectionColor: ke,
|
|
40
40
|
selected: {},
|
|
41
|
-
selectionColor:
|
|
41
|
+
selectionColor: Oe,
|
|
42
42
|
selectionInteractionDisabled: !1,
|
|
43
43
|
showNavCube: !0,
|
|
44
44
|
showStats: !1,
|
|
@@ -119,60 +119,60 @@ function ke() {
|
|
|
119
119
|
}
|
|
120
120
|
}));
|
|
121
121
|
}
|
|
122
|
-
var
|
|
123
|
-
function
|
|
124
|
-
let e = new C(new Uint8Array(256 * 4), 256, 1,
|
|
125
|
-
return e.magFilter =
|
|
122
|
+
var Me = 2;
|
|
123
|
+
function Ne() {
|
|
124
|
+
let e = new C(new Uint8Array(256 * 4), 256, 1, de, _e);
|
|
125
|
+
return e.magFilter = oe, e.minFilter = oe, e.generateMipmaps = !1, e.needsUpdate = !0, Fe(e, 1, new x(Oe)), e;
|
|
126
126
|
}
|
|
127
|
-
function
|
|
127
|
+
function Pe(e) {
|
|
128
128
|
return `${e.r.toFixed(6)}:${e.g.toFixed(6)}:${e.b.toFixed(6)}`;
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function Fe(e, t, n) {
|
|
131
131
|
let r = e.image.data, i = t * 4;
|
|
132
132
|
r[i] = Math.round(n.r * 255), r[i + 1] = Math.round(n.g * 255), r[i + 2] = Math.round(n.b * 255), r[i + 3] = 255, e.needsUpdate = !0;
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function Ie(e) {
|
|
135
135
|
return e.mesh.geometry.attributes.colorIndex;
|
|
136
136
|
}
|
|
137
|
-
function
|
|
137
|
+
function Le(e) {
|
|
138
138
|
let t = e.mesh.geometry.attributes.ids;
|
|
139
139
|
if (!t) return null;
|
|
140
140
|
let n = new v(new Uint8Array(t.count), 1);
|
|
141
141
|
return e.mesh.geometry.setAttribute("colorIndex", n), n;
|
|
142
142
|
}
|
|
143
|
-
function
|
|
144
|
-
let n =
|
|
145
|
-
return n || t === 0 ? n :
|
|
143
|
+
function Re(e, t) {
|
|
144
|
+
let n = Ie(e);
|
|
145
|
+
return n || t === 0 ? n : Le(e);
|
|
146
146
|
}
|
|
147
|
-
function
|
|
148
|
-
|
|
147
|
+
function ze(e) {
|
|
148
|
+
Ie(e) && e.mesh.geometry.deleteAttribute("colorIndex");
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function Be(e, t, n) {
|
|
151
151
|
let r = e.get(t);
|
|
152
152
|
return !r && n && (r = /* @__PURE__ */ new Set(), e.set(t, r)), r;
|
|
153
153
|
}
|
|
154
|
-
function
|
|
155
|
-
let n =
|
|
154
|
+
function Ve(e, t) {
|
|
155
|
+
let n = Re(e.record, t);
|
|
156
156
|
if (!n) return !1;
|
|
157
157
|
let r = n.array;
|
|
158
158
|
return e.vertexRanges.forEach(({ count: e, start: n }) => {
|
|
159
159
|
r.fill(t, n, n + e);
|
|
160
160
|
}), n.needsUpdate = !0, !0;
|
|
161
161
|
}
|
|
162
|
-
function
|
|
162
|
+
function He(e, t, n, r, i) {
|
|
163
163
|
e && e.forEach((e) => {
|
|
164
164
|
if (e.record.modelID !== t) return;
|
|
165
|
-
let a =
|
|
166
|
-
r === 0 ? (o?.delete(n), o?.size || (i.delete(e.record),
|
|
165
|
+
let a = Ve(e, r), o = Be(i, e.record, r !== 0 && a);
|
|
166
|
+
r === 0 ? (o?.delete(n), o?.size || (i.delete(e.record), ze(e.record))) : a && o?.add(n);
|
|
167
167
|
});
|
|
168
168
|
}
|
|
169
|
-
function
|
|
169
|
+
function Ue(e) {
|
|
170
170
|
let t = /* @__PURE__ */ new Set();
|
|
171
171
|
return Object.entries(e).forEach(([e, n]) => {
|
|
172
172
|
n.forEach((n) => t.add(`${e}:${n}`));
|
|
173
173
|
}), t;
|
|
174
174
|
}
|
|
175
|
-
function
|
|
175
|
+
function We(e, t) {
|
|
176
176
|
let n = /* @__PURE__ */ new Map(), r = (e) => {
|
|
177
177
|
let [t, r] = e.split(":").map(Number), i = n.get(t);
|
|
178
178
|
i || (i = /* @__PURE__ */ new Set(), n.set(t, i)), i.add(r);
|
|
@@ -183,28 +183,28 @@ function He(e, t) {
|
|
|
183
183
|
t.has(e) || r(e);
|
|
184
184
|
}), n;
|
|
185
185
|
}
|
|
186
|
-
function
|
|
187
|
-
let t =
|
|
186
|
+
function Ge(e) {
|
|
187
|
+
let t = L((e) => e.selected), n = L((e) => e.selectionColor), r = c(Ne, []), a = l(/* @__PURE__ */ new Map()), s = l(Me), u = l(/* @__PURE__ */ new Map()), d = l(t), f = l(/* @__PURE__ */ new Set()), p = l(/* @__PURE__ */ new WeakMap());
|
|
188
188
|
o(() => {
|
|
189
189
|
d.current = t;
|
|
190
190
|
}, [t]), o(() => () => r.dispose(), [r]), o(() => {
|
|
191
|
-
|
|
191
|
+
Fe(r, 1, new x(n));
|
|
192
192
|
}, [r, n]);
|
|
193
193
|
let m = i((e, t) => d.current[e]?.has(t) ? 1 : u.current.get(e)?.get(t) ?? 0, []), h = i((t, n) => {
|
|
194
194
|
let r = e.buildIndex();
|
|
195
195
|
n.forEach((e) => {
|
|
196
|
-
|
|
196
|
+
He(r.elementIndex.get(e), t, e, m(t, e), p.current);
|
|
197
197
|
});
|
|
198
198
|
}, [e, m]), g = i((e) => {
|
|
199
|
-
let t = new x(e), n =
|
|
199
|
+
let t = new x(e), n = Pe(t), i = a.current.get(n);
|
|
200
200
|
if (i !== void 0) return i;
|
|
201
201
|
let o = s.current;
|
|
202
202
|
if (o >= 256) throw Error("Element color palette is full. Maximum colors: 255.");
|
|
203
|
-
return a.current.set(n, o), s.current += 1,
|
|
203
|
+
return a.current.set(n, o), s.current += 1, Fe(r, o, t), o;
|
|
204
204
|
}, [r]);
|
|
205
205
|
o(() => {
|
|
206
|
-
let e =
|
|
207
|
-
|
|
206
|
+
let e = Ue(t);
|
|
207
|
+
We(f.current, e).forEach((e, t) => {
|
|
208
208
|
h(t, Array.from(e));
|
|
209
209
|
}), f.current = e;
|
|
210
210
|
}, [h, t]);
|
|
@@ -232,12 +232,12 @@ function Ue(e) {
|
|
|
232
232
|
t.forEach((t) => r(Number(e), t));
|
|
233
233
|
}), n.forEach((e, n) => {
|
|
234
234
|
e.forEach((e) => {
|
|
235
|
-
|
|
235
|
+
He(t.elementIndex.get(e), n, e, m(n, e), p.current);
|
|
236
236
|
});
|
|
237
237
|
});
|
|
238
238
|
}, [e, m]), S = i(() => {
|
|
239
239
|
e.buildIndex().records.forEach((e) => {
|
|
240
|
-
p.current.delete(e),
|
|
240
|
+
p.current.delete(e), ze(e);
|
|
241
241
|
}), p.current = /* @__PURE__ */ new WeakMap(), u.current.clear(), b();
|
|
242
242
|
}, [b, e]);
|
|
243
243
|
return {
|
|
@@ -259,12 +259,12 @@ function Ue(e) {
|
|
|
259
259
|
}
|
|
260
260
|
//#endregion
|
|
261
261
|
//#region src/viewer/SelectableMesh.tsx
|
|
262
|
-
|
|
263
|
-
var
|
|
264
|
-
let a = l(null), s =
|
|
262
|
+
M.prototype.raycast = we;
|
|
263
|
+
var Ke = e.memo(function({ colorPaletteTexture: e, material: t, data: n, isIfcSpace: r = !1, meshMatrix: i }) {
|
|
264
|
+
let a = l(null), s = L((e) => e.preselectionColor), u = l(s);
|
|
265
265
|
u.current = s;
|
|
266
266
|
let d = c(() => {
|
|
267
|
-
let n = new
|
|
267
|
+
let n = new ae({
|
|
268
268
|
color: new x(t.r, t.g, t.b),
|
|
269
269
|
transparent: !!(t.opacity && t.opacity != 1),
|
|
270
270
|
opacity: t.opacity ?? 1,
|
|
@@ -298,11 +298,11 @@ var We = e.memo(function({ colorPaletteTexture: e, material: t, data: n, isIfcSp
|
|
|
298
298
|
e && (e.value instanceof x ? e.value.set(s) : e.value = new x(s));
|
|
299
299
|
}, [d, s]), o(() => {
|
|
300
300
|
if (!a.current) return;
|
|
301
|
-
let e = a.current.geometry, t = new
|
|
301
|
+
let e = a.current.geometry, t = new Se(e, { indirect: !0 });
|
|
302
302
|
return Object.assign(e, { boundsTree: t }), () => {
|
|
303
303
|
d.dispose(), Object.assign(e, { boundsTree: null });
|
|
304
304
|
};
|
|
305
|
-
}, [d]), /* @__PURE__ */
|
|
305
|
+
}, [d]), /* @__PURE__ */ I("mesh", {
|
|
306
306
|
matrix: i,
|
|
307
307
|
matrixAutoUpdate: !1,
|
|
308
308
|
name: r ? "space" : void 0,
|
|
@@ -312,38 +312,38 @@ var We = e.memo(function({ colorPaletteTexture: e, material: t, data: n, isIfcSp
|
|
|
312
312
|
let t = e.object;
|
|
313
313
|
t.preselected &&= !1;
|
|
314
314
|
},
|
|
315
|
-
children: [/* @__PURE__ */
|
|
316
|
-
/* @__PURE__ */
|
|
315
|
+
children: [/* @__PURE__ */ I("bufferGeometry", { children: [
|
|
316
|
+
/* @__PURE__ */ F("bufferAttribute", {
|
|
317
317
|
attach: "attributes-position",
|
|
318
318
|
args: [n.pos, 3]
|
|
319
319
|
}),
|
|
320
|
-
n.norm && /* @__PURE__ */
|
|
320
|
+
n.norm && /* @__PURE__ */ F("bufferAttribute", {
|
|
321
321
|
attach: "attributes-normal",
|
|
322
322
|
args: [n.norm, 3]
|
|
323
323
|
}),
|
|
324
|
-
/* @__PURE__ */
|
|
324
|
+
/* @__PURE__ */ F("bufferAttribute", {
|
|
325
325
|
attach: "attributes-ids",
|
|
326
326
|
args: [n.ids, 1]
|
|
327
327
|
}),
|
|
328
|
-
/* @__PURE__ */
|
|
328
|
+
/* @__PURE__ */ F("bufferAttribute", {
|
|
329
329
|
attach: "index",
|
|
330
330
|
args: [n.ind, 1]
|
|
331
331
|
})
|
|
332
|
-
] }), /* @__PURE__ */
|
|
332
|
+
] }), /* @__PURE__ */ F("primitive", { object: d })]
|
|
333
333
|
});
|
|
334
|
-
}),
|
|
335
|
-
function
|
|
334
|
+
}), qe = 10, Je = "#1d2733", Ye = 2, Xe = .05, Ze = "\0", Qe = /* @__PURE__ */ new Map();
|
|
335
|
+
function $e() {
|
|
336
336
|
return typeof window > "u" ? 1 : Math.min(window.devicePixelRatio || 1, 2);
|
|
337
337
|
}
|
|
338
|
-
function
|
|
339
|
-
let i =
|
|
338
|
+
function et(e, t, n, r) {
|
|
339
|
+
let i = $e(), a = document.createElement("canvas"), o = a.getContext("2d");
|
|
340
340
|
if (!o) throw Error("Could not create grid label canvas context");
|
|
341
341
|
let s = `400 ${r}px system-ui, "Segoe UI", sans-serif`, c = Math.ceil(r * .5), l = Math.ceil(r * .35);
|
|
342
342
|
o.font = s;
|
|
343
343
|
let u = o.measureText(t), d = u.actualBoundingBoxAscent || r * .8, f = u.actualBoundingBoxDescent || r * .2, p = Math.max(1, Math.ceil(u.width + c * 2)), m = Math.max(1, Math.ceil(d + f + l * 2));
|
|
344
344
|
a.width = Math.ceil(p * i), a.height = Math.ceil(m * i), o.scale(i, i), o.clearRect(0, 0, p, m), o.font = s, o.fillStyle = n, o.textAlign = "left", o.textBaseline = "alphabetic", o.fillText(t, c, l + d);
|
|
345
345
|
let h = new b(a);
|
|
346
|
-
return h.colorSpace =
|
|
346
|
+
return h.colorSpace = fe, h.generateMipmaps = !1, h.magFilter = A, h.minFilter = A, h.needsUpdate = !0, {
|
|
347
347
|
disposeTimer: null,
|
|
348
348
|
height: m,
|
|
349
349
|
key: e,
|
|
@@ -352,49 +352,49 @@ function Qe(e, t, n, r) {
|
|
|
352
352
|
width: p
|
|
353
353
|
};
|
|
354
354
|
}
|
|
355
|
-
function
|
|
355
|
+
function tt(e, t, n) {
|
|
356
356
|
let r = [
|
|
357
357
|
e,
|
|
358
358
|
t,
|
|
359
359
|
n
|
|
360
|
-
].join(
|
|
361
|
-
return i || (i =
|
|
360
|
+
].join(Ze), i = Qe.get(r);
|
|
361
|
+
return i || (i = et(r, e, t, n), Qe.set(r, i)), i;
|
|
362
362
|
}
|
|
363
|
-
function
|
|
364
|
-
let r = c(() =>
|
|
363
|
+
function nt(e, t, n) {
|
|
364
|
+
let r = c(() => tt(e, t, n), [
|
|
365
365
|
t,
|
|
366
366
|
n,
|
|
367
367
|
e
|
|
368
368
|
]);
|
|
369
369
|
return o(() => (r.disposeTimer &&= (clearTimeout(r.disposeTimer), null), r.refs++, () => {
|
|
370
370
|
r.refs = Math.max(0, r.refs - 1), r.refs <= 0 && (r.disposeTimer = setTimeout(() => {
|
|
371
|
-
r.refs > 0 || (r.texture.dispose(),
|
|
371
|
+
r.refs > 0 || (r.texture.dispose(), Qe.delete(r.key), r.disposeTimer = null);
|
|
372
372
|
}, 1e3));
|
|
373
373
|
}), [r]), r;
|
|
374
374
|
}
|
|
375
|
-
function
|
|
375
|
+
function rt(e, t, n, r) {
|
|
376
376
|
let i = Math.abs(n.projectionMatrix.elements[5]) || 1, a = t.height * 2 / (Math.max(1, r) * i), o = a * (t.width / t.height);
|
|
377
377
|
e.scale.set(o, a, 1);
|
|
378
378
|
}
|
|
379
|
-
function
|
|
379
|
+
function it(e, t) {
|
|
380
380
|
let n = e[t];
|
|
381
381
|
return n === void 0 ? 0 : Number.isFinite(n) ? n : null;
|
|
382
382
|
}
|
|
383
|
-
function
|
|
384
|
-
return
|
|
383
|
+
function z(e, t) {
|
|
384
|
+
return it(e, t) ?? 0;
|
|
385
385
|
}
|
|
386
|
-
function
|
|
387
|
-
let t =
|
|
388
|
-
return t === null || n === null || r === null ? null : new
|
|
386
|
+
function at(e) {
|
|
387
|
+
let t = it(e, "x"), n = it(e, "y"), r = it(e, "z");
|
|
388
|
+
return t === null || n === null || r === null ? null : new P(t, n, r);
|
|
389
389
|
}
|
|
390
|
-
function
|
|
390
|
+
function ot(e, t) {
|
|
391
391
|
return [
|
|
392
|
-
|
|
393
|
-
t !== void 0 && Number.isFinite(t) ? t :
|
|
394
|
-
|
|
392
|
+
z(e, "x"),
|
|
393
|
+
t !== void 0 && Number.isFinite(t) ? t : z(e, "y"),
|
|
394
|
+
z(e, "z")
|
|
395
395
|
];
|
|
396
396
|
}
|
|
397
|
-
function
|
|
397
|
+
function st(e) {
|
|
398
398
|
let { h: t, l: n } = e.getHSL({
|
|
399
399
|
h: 0,
|
|
400
400
|
s: 0,
|
|
@@ -402,14 +402,14 @@ function at(e) {
|
|
|
402
402
|
});
|
|
403
403
|
return t < .55 && n >= .5 || t >= .55 && n >= .75 ? "#000000" : "#ffffff";
|
|
404
404
|
}
|
|
405
|
-
function
|
|
405
|
+
function ct(e) {
|
|
406
406
|
let t = p((e) => e.scene.background);
|
|
407
|
-
return c(() => e || (t instanceof x ?
|
|
407
|
+
return c(() => e || (t instanceof x ? st(t) : Je), [t, e]);
|
|
408
408
|
}
|
|
409
|
-
function
|
|
409
|
+
function lt({ axis: e, grid: t, endSide: n, startSide: r }) {
|
|
410
410
|
return Object.entries(e).flatMap(([e, i]) => {
|
|
411
411
|
if (i.length < 2) return [];
|
|
412
|
-
let a =
|
|
412
|
+
let a = at(i[0]), o = at(i[1]);
|
|
413
413
|
return !a || !o ? [] : (a.y = 0, o.y = 0, [{
|
|
414
414
|
endSide: n,
|
|
415
415
|
loc: t.loc,
|
|
@@ -419,18 +419,18 @@ function st({ axis: e, grid: t, endSide: n, startSide: r }) {
|
|
|
419
419
|
}]);
|
|
420
420
|
});
|
|
421
421
|
}
|
|
422
|
-
function
|
|
422
|
+
function ut({ flattenToFloor: e, grids: t, showBottom: n, showLeft: r, showRight: i, showTop: a }) {
|
|
423
423
|
let o = {
|
|
424
424
|
bottom: n,
|
|
425
425
|
left: r,
|
|
426
426
|
right: i,
|
|
427
427
|
top: a
|
|
428
|
-
}, s = Object.values(t).flatMap((e) => [...
|
|
428
|
+
}, s = Object.values(t).flatMap((e) => [...lt({
|
|
429
429
|
axis: e.points.u,
|
|
430
430
|
endSide: "right",
|
|
431
431
|
grid: e,
|
|
432
432
|
startSide: "left"
|
|
433
|
-
}), ...
|
|
433
|
+
}), ...lt({
|
|
434
434
|
axis: e.points.v,
|
|
435
435
|
endSide: "bottom",
|
|
436
436
|
grid: e,
|
|
@@ -443,8 +443,8 @@ function ct({ flattenToFloor: e, grids: t, showBottom: n, showLeft: r, showRight
|
|
|
443
443
|
e.startSide,
|
|
444
444
|
e.endSide,
|
|
445
445
|
e.name,
|
|
446
|
-
|
|
447
|
-
|
|
446
|
+
z(e.loc, "x"),
|
|
447
|
+
z(e.loc, "z"),
|
|
448
448
|
e.points[0].x,
|
|
449
449
|
e.points[0].z,
|
|
450
450
|
e.points[1].x,
|
|
@@ -453,57 +453,57 @@ function ct({ flattenToFloor: e, grids: t, showBottom: n, showLeft: r, showRight
|
|
|
453
453
|
c.has(t) || c.set(t, e);
|
|
454
454
|
}), Array.from(c.values());
|
|
455
455
|
}
|
|
456
|
-
function
|
|
457
|
-
return new
|
|
456
|
+
function dt(e, t) {
|
|
457
|
+
return new P(...ot(e.loc, t));
|
|
458
458
|
}
|
|
459
|
-
function
|
|
459
|
+
function ft({ cameraPosition: e, floorY: t, line: n, showBottom: r, showLeft: i, showRight: a, showTop: o }) {
|
|
460
460
|
let s = {
|
|
461
461
|
bottom: r,
|
|
462
462
|
left: i,
|
|
463
463
|
right: a,
|
|
464
464
|
top: o
|
|
465
|
-
}, c =
|
|
465
|
+
}, c = dt(n, t), l = n.points[0].clone().add(c), u = n.points[1].clone().add(c), d = l.distanceToSquared(e) > u.distanceToSquared(e) ? "start" : "end", f = d === "start" ? "end" : "start", p = (e) => s[e === "start" ? n.startSide : n.endSide];
|
|
466
466
|
return p(d) ? d : p(f) ? f : null;
|
|
467
467
|
}
|
|
468
|
-
function
|
|
468
|
+
function pt({ endpoint: e, labelOffset: t, line: n }) {
|
|
469
469
|
let r = e === "start" ? n.points[0].clone() : n.points[1].clone(), i = n.points[1].clone().sub(n.points[0]);
|
|
470
470
|
return i.y = 0, i.lengthSq() === 0 && i.set(1, 0, 0), i.normalize().multiplyScalar(t), e === "start" && i.negate(), r.add(i);
|
|
471
471
|
}
|
|
472
|
-
function
|
|
473
|
-
let n = new
|
|
472
|
+
function mt(e, t) {
|
|
473
|
+
let n = new P(), r = 0;
|
|
474
474
|
return e.forEach((e) => {
|
|
475
|
-
let i =
|
|
475
|
+
let i = dt(e, t);
|
|
476
476
|
e.points.forEach((e) => {
|
|
477
477
|
n.add(e).add(i), r++;
|
|
478
478
|
});
|
|
479
479
|
}), r && n.divideScalar(r), n;
|
|
480
480
|
}
|
|
481
|
-
function
|
|
481
|
+
function ht(e, t, n) {
|
|
482
482
|
let r = 0;
|
|
483
483
|
return e.forEach((e) => {
|
|
484
|
-
let i =
|
|
484
|
+
let i = dt(e, n);
|
|
485
485
|
e.points.forEach((e) => {
|
|
486
486
|
r = Math.max(r, e.clone().add(i).distanceTo(t));
|
|
487
487
|
});
|
|
488
488
|
}), r;
|
|
489
489
|
}
|
|
490
|
-
function
|
|
491
|
-
let { camera: i, size: a } = p(), s = l(null), c =
|
|
490
|
+
function gt({ color: e, fontSize: t, position: n, text: r }) {
|
|
491
|
+
let { camera: i, size: a } = p(), s = l(null), c = nt(r, e, t);
|
|
492
492
|
return o(() => {
|
|
493
493
|
let e = s.current;
|
|
494
|
-
e &&
|
|
494
|
+
e && rt(e, c, i, a.height);
|
|
495
495
|
}, [
|
|
496
496
|
i,
|
|
497
497
|
a.height,
|
|
498
498
|
c
|
|
499
499
|
]), f(({ camera: e, size: t }) => {
|
|
500
500
|
let n = s.current;
|
|
501
|
-
n &&
|
|
502
|
-
}), /* @__PURE__ */
|
|
501
|
+
n && rt(n, c, e, t.height);
|
|
502
|
+
}), /* @__PURE__ */ F("sprite", {
|
|
503
503
|
ref: s,
|
|
504
504
|
position: n,
|
|
505
505
|
renderOrder: 2,
|
|
506
|
-
children: /* @__PURE__ */
|
|
506
|
+
children: /* @__PURE__ */ F("spriteMaterial", {
|
|
507
507
|
alphaTest: .1,
|
|
508
508
|
depthTest: !0,
|
|
509
509
|
depthWrite: !1,
|
|
@@ -514,8 +514,8 @@ function mt({ color: e, fontSize: t, position: n, text: r }) {
|
|
|
514
514
|
})
|
|
515
515
|
});
|
|
516
516
|
}
|
|
517
|
-
function
|
|
518
|
-
let f = c(() => new y().setFromPoints(a.points), [a.points]), p =
|
|
517
|
+
function _t({ cameraPosition: e, color: t, floorY: n, fontSize: r, labelOffset: i, line: a, showBottom: s, showLeft: l, showRight: u, showTop: d }) {
|
|
518
|
+
let f = c(() => new y().setFromPoints(a.points), [a.points]), p = ft({
|
|
519
519
|
cameraPosition: e,
|
|
520
520
|
floorY: n,
|
|
521
521
|
line: a,
|
|
@@ -523,19 +523,19 @@ function ht({ cameraPosition: e, color: t, floorY: n, fontSize: r, labelOffset:
|
|
|
523
523
|
showLeft: l,
|
|
524
524
|
showRight: u,
|
|
525
525
|
showTop: d
|
|
526
|
-
}), m = p ?
|
|
526
|
+
}), m = p ? pt({
|
|
527
527
|
endpoint: p,
|
|
528
528
|
labelOffset: i,
|
|
529
529
|
line: a
|
|
530
530
|
}) : null;
|
|
531
|
-
return o(() => () => f.dispose(), [f]), /* @__PURE__ */
|
|
531
|
+
return o(() => () => f.dispose(), [f]), /* @__PURE__ */ I("lineSegments", {
|
|
532
532
|
geometry: f,
|
|
533
|
-
position:
|
|
534
|
-
children: [/* @__PURE__ */
|
|
533
|
+
position: ot(a.loc, n),
|
|
534
|
+
children: [/* @__PURE__ */ F("lineBasicMaterial", {
|
|
535
535
|
color: t,
|
|
536
536
|
depthWrite: !1,
|
|
537
537
|
linewidth: 2
|
|
538
|
-
}), m && /* @__PURE__ */
|
|
538
|
+
}), m && /* @__PURE__ */ F(gt, {
|
|
539
539
|
color: t,
|
|
540
540
|
fontSize: r,
|
|
541
541
|
position: m,
|
|
@@ -543,8 +543,8 @@ function ht({ cameraPosition: e, color: t, floorY: n, fontSize: r, labelOffset:
|
|
|
543
543
|
})]
|
|
544
544
|
});
|
|
545
545
|
}
|
|
546
|
-
function
|
|
547
|
-
let h = p((e) => e.camera), g = l(null), [_, v] = u(() => new
|
|
546
|
+
function vt({ color: e, floorY: t, fontSize: n = qe, grids: r, labelOffset: i = Ye, showBottom: a = !0, showLeft: o = !0, showRight: s = !0, showTop: d = !0, visible: m = !0 }) {
|
|
547
|
+
let h = p((e) => e.camera), g = l(null), [_, v] = u(() => new P()), y = ct(e), b = c(() => r ? ut({
|
|
548
548
|
flattenToFloor: t !== void 0,
|
|
549
549
|
grids: r,
|
|
550
550
|
showBottom: a,
|
|
@@ -558,7 +558,7 @@ function gt({ color: e, floorY: t, fontSize: n = Ge, grids: r, labelOffset: i =
|
|
|
558
558
|
o,
|
|
559
559
|
s,
|
|
560
560
|
d
|
|
561
|
-
]), x = c(() =>
|
|
561
|
+
]), x = c(() => mt(b, t), [t, b]), S = c(() => Math.max(i, ht(b, x, t) * .015), [
|
|
562
562
|
x,
|
|
563
563
|
t,
|
|
564
564
|
i,
|
|
@@ -568,11 +568,11 @@ function gt({ color: e, floorY: t, fontSize: n = Ge, grids: r, labelOffset: i =
|
|
|
568
568
|
let e = g.current;
|
|
569
569
|
if (!e) return;
|
|
570
570
|
let t = h.position.clone();
|
|
571
|
-
e.worldToLocal(t), !(t.distanceToSquared(_) <
|
|
572
|
-
}), !m || !b.length ? null : /* @__PURE__ */
|
|
571
|
+
e.worldToLocal(t), !(t.distanceToSquared(_) < Xe) && v(t);
|
|
572
|
+
}), !m || !b.length ? null : /* @__PURE__ */ F("group", {
|
|
573
573
|
ref: g,
|
|
574
574
|
userData: { modelGrids: !0 },
|
|
575
|
-
children: b.map((e) => /* @__PURE__ */
|
|
575
|
+
children: b.map((e) => /* @__PURE__ */ F(_t, {
|
|
576
576
|
cameraPosition: _,
|
|
577
577
|
color: y,
|
|
578
578
|
floorY: t,
|
|
@@ -587,9 +587,9 @@ function gt({ color: e, floorY: t, fontSize: n = Ge, grids: r, labelOffset: i =
|
|
|
587
587
|
e.startSide,
|
|
588
588
|
e.endSide,
|
|
589
589
|
e.name,
|
|
590
|
-
|
|
591
|
-
t ??
|
|
592
|
-
|
|
590
|
+
z(e.loc, "x"),
|
|
591
|
+
t ?? z(e.loc, "y"),
|
|
592
|
+
z(e.loc, "z"),
|
|
593
593
|
e.points[0].x,
|
|
594
594
|
e.points[0].y,
|
|
595
595
|
e.points[0].z,
|
|
@@ -601,33 +601,33 @@ function gt({ color: e, floorY: t, fontSize: n = Ge, grids: r, labelOffset: i =
|
|
|
601
601
|
}
|
|
602
602
|
//#endregion
|
|
603
603
|
//#region src/viewer/Model.tsx
|
|
604
|
-
var
|
|
605
|
-
function
|
|
604
|
+
var yt = new j();
|
|
605
|
+
function bt(e) {
|
|
606
606
|
if (!e) return null;
|
|
607
607
|
try {
|
|
608
608
|
let t = JSON.parse(e);
|
|
609
|
-
return !Array.isArray(t) || t.length !== 16 ? null : new
|
|
609
|
+
return !Array.isArray(t) || t.length !== 16 ? null : new j().fromArray(t);
|
|
610
610
|
} catch (e) {
|
|
611
611
|
return console.warn("Model matrix parsing error", e), null;
|
|
612
612
|
}
|
|
613
613
|
}
|
|
614
|
-
function
|
|
615
|
-
return
|
|
614
|
+
function xt(e) {
|
|
615
|
+
return bt(St(e));
|
|
616
616
|
}
|
|
617
|
-
function
|
|
617
|
+
function St(e) {
|
|
618
618
|
return e.coordinationMatrix ?? Object.values(e.data)[0]?.matrix;
|
|
619
619
|
}
|
|
620
|
-
function
|
|
621
|
-
let i =
|
|
620
|
+
function Ct({ colorPaletteTexture: e, coordinationMatrix: t, modelID: n, data: r }) {
|
|
621
|
+
let i = L((e) => e.gridAxesVisibility), a = c(() => {
|
|
622
622
|
if (!r) return {
|
|
623
623
|
data: [],
|
|
624
624
|
coordinationMatrix: null,
|
|
625
625
|
floorY: 0
|
|
626
626
|
};
|
|
627
|
-
let e = Object.values(r.data).some((e) => !!e.matrix) ? t?.clone() ??
|
|
627
|
+
let e = Object.values(r.data).some((e) => !!e.matrix) ? t?.clone() ?? xt(r) : null, i = Infinity, a = new P();
|
|
628
628
|
return {
|
|
629
629
|
data: Object.values(r.data).map((e) => {
|
|
630
|
-
let t = (
|
|
630
|
+
let t = (bt(e.matrix) ?? new j()).clone().invert(), r = e.mat, o = e.pos;
|
|
631
631
|
for (let e = 0; e < o.length; e += 3) a.set(o[e], o[e + 1], o[e + 2]).applyMatrix4(t), Number.isFinite(a.y) && (i = Math.min(i, a.y));
|
|
632
632
|
return {
|
|
633
633
|
data: e,
|
|
@@ -645,17 +645,17 @@ function xt({ colorPaletteTexture: e, coordinationMatrix: t, modelID: n, data: r
|
|
|
645
645
|
r,
|
|
646
646
|
n
|
|
647
647
|
]);
|
|
648
|
-
return r ? /* @__PURE__ */
|
|
649
|
-
matrix: a.coordinationMatrix ??
|
|
648
|
+
return r ? /* @__PURE__ */ I("group", {
|
|
649
|
+
matrix: a.coordinationMatrix ?? yt,
|
|
650
650
|
matrixAutoUpdate: !1,
|
|
651
651
|
userData: { modelID: n },
|
|
652
|
-
children: [a.data.map(({ data: t, isIfcSpace: n, key: r, material: i, meshMatrix: a }) => /* @__PURE__ */
|
|
652
|
+
children: [a.data.map(({ data: t, isIfcSpace: n, key: r, material: i, meshMatrix: a }) => /* @__PURE__ */ F(Ke, {
|
|
653
653
|
colorPaletteTexture: e,
|
|
654
654
|
material: i,
|
|
655
655
|
data: t,
|
|
656
656
|
isIfcSpace: n,
|
|
657
657
|
meshMatrix: a
|
|
658
|
-
}, r)), /* @__PURE__ */
|
|
658
|
+
}, r)), /* @__PURE__ */ F(vt, {
|
|
659
659
|
floorY: a.floorY,
|
|
660
660
|
grids: r.grids,
|
|
661
661
|
showBottom: i.bottom,
|
|
@@ -664,12 +664,12 @@ function xt({ colorPaletteTexture: e, coordinationMatrix: t, modelID: n, data: r
|
|
|
664
664
|
showTop: i.top,
|
|
665
665
|
visible: i.visible
|
|
666
666
|
})]
|
|
667
|
-
}) : /* @__PURE__ */
|
|
667
|
+
}) : /* @__PURE__ */ F(Te, {});
|
|
668
668
|
}
|
|
669
|
-
var
|
|
669
|
+
var wt = r(Ct);
|
|
670
670
|
//#endregion
|
|
671
671
|
//#region src/viewer/utils/GeometryUtils/useGeometryIndex.ts
|
|
672
|
-
function
|
|
672
|
+
function Tt() {
|
|
673
673
|
return {
|
|
674
674
|
elementIndex: /* @__PURE__ */ new Map(),
|
|
675
675
|
ifcSpacesVisible: !0,
|
|
@@ -679,10 +679,10 @@ function Ct() {
|
|
|
679
679
|
records: /* @__PURE__ */ new Set()
|
|
680
680
|
};
|
|
681
681
|
}
|
|
682
|
-
function
|
|
682
|
+
function Et(e) {
|
|
683
683
|
return e instanceof Uint16Array || e instanceof Uint32Array ? e : e.length > 65535 ? new Uint32Array(e) : new Uint16Array(e);
|
|
684
684
|
}
|
|
685
|
-
function
|
|
685
|
+
function Dt(e, t, n, r) {
|
|
686
686
|
let i = n.get(e);
|
|
687
687
|
if (i) return i;
|
|
688
688
|
i = {
|
|
@@ -692,20 +692,20 @@ function Tt(e, t, n, r) {
|
|
|
692
692
|
let a = r.get(e);
|
|
693
693
|
return a || (a = [], r.set(e, a)), a.push(i), i;
|
|
694
694
|
}
|
|
695
|
-
function
|
|
696
|
-
n &&
|
|
695
|
+
function Ot(e, t, n, r, i, a) {
|
|
696
|
+
n && Dt(e, r, i, a).vertexRanges.push({
|
|
697
697
|
count: n,
|
|
698
698
|
start: t
|
|
699
699
|
});
|
|
700
700
|
}
|
|
701
|
-
function
|
|
702
|
-
n && (
|
|
701
|
+
function kt(e, t, n, r, i, a) {
|
|
702
|
+
n && (Dt(e, r, i, a), r.triangleRanges.push({
|
|
703
703
|
count: n,
|
|
704
704
|
id: e,
|
|
705
705
|
start: t
|
|
706
706
|
}));
|
|
707
707
|
}
|
|
708
|
-
function
|
|
708
|
+
function At(e) {
|
|
709
709
|
let t = e;
|
|
710
710
|
for (; t;) {
|
|
711
711
|
let e = t.userData.modelID;
|
|
@@ -714,22 +714,22 @@ function Ot(e) {
|
|
|
714
714
|
}
|
|
715
715
|
return 0;
|
|
716
716
|
}
|
|
717
|
-
function
|
|
717
|
+
function jt(e) {
|
|
718
718
|
return e.name === "space" || e.userData.isIfcSpace === !0;
|
|
719
719
|
}
|
|
720
|
-
function
|
|
721
|
-
let t = l(
|
|
720
|
+
function Mt(e) {
|
|
721
|
+
let t = l(Tt()), n = i(() => {
|
|
722
722
|
let n = e.current, r = t.current;
|
|
723
723
|
if (!n || r.indexedModel === n && r.records.size) return r;
|
|
724
724
|
let i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set();
|
|
725
725
|
return n.traverse((e) => {
|
|
726
|
-
if (!(e instanceof
|
|
726
|
+
if (!(e instanceof M)) return;
|
|
727
727
|
let t = e, n = t.geometry, r = n.index, o = n.attributes.ids;
|
|
728
728
|
if (!r || !o) return;
|
|
729
|
-
let s =
|
|
729
|
+
let s = At(t), c = Et(r.array), l = {
|
|
730
730
|
hiddenIds: /* @__PURE__ */ new Set(),
|
|
731
731
|
initialVisible: t.visible,
|
|
732
|
-
isIfcSpace:
|
|
732
|
+
isIfcSpace: jt(t),
|
|
733
733
|
mesh: t,
|
|
734
734
|
modelID: s,
|
|
735
735
|
originalBoundsTree: n.boundsTree ?? null,
|
|
@@ -739,15 +739,15 @@ function At(e) {
|
|
|
739
739
|
}, u = /* @__PURE__ */ new Map(), d = null, f = 0, p = c.length / 3;
|
|
740
740
|
for (let e = 0; e < p; e++) {
|
|
741
741
|
let t = o.getX(c[e * 3]);
|
|
742
|
-
d === null ? (d = t, f = e) : t !== d && (
|
|
742
|
+
d === null ? (d = t, f = e) : t !== d && (kt(d, f, e - f, l, u, i), d = t, f = e);
|
|
743
743
|
}
|
|
744
|
-
d !== null &&
|
|
744
|
+
d !== null && kt(d, f, p - f, l, u, i);
|
|
745
745
|
let m = null, h = 0;
|
|
746
746
|
for (let e = 0; e < o.count; e++) {
|
|
747
747
|
let t = o.getX(e);
|
|
748
|
-
m === null ? (m = t, h = e) : t !== m && (
|
|
748
|
+
m === null ? (m = t, h = e) : t !== m && (Ot(m, h, e - h, l, u, i), m = t, h = e);
|
|
749
749
|
}
|
|
750
|
-
m !== null &&
|
|
750
|
+
m !== null && Ot(m, h, o.count - h, l, u, i), a.add(l);
|
|
751
751
|
}), t.current = {
|
|
752
752
|
elementIndex: i,
|
|
753
753
|
ifcSpacesVisible: r.ifcSpacesVisible,
|
|
@@ -757,7 +757,7 @@ function At(e) {
|
|
|
757
757
|
records: a
|
|
758
758
|
}, t.current;
|
|
759
759
|
}, [e]), r = i(() => {
|
|
760
|
-
t.current =
|
|
760
|
+
t.current = Tt();
|
|
761
761
|
}, []);
|
|
762
762
|
return c(() => ({
|
|
763
763
|
buildIndex: n,
|
|
@@ -766,95 +766,95 @@ function At(e) {
|
|
|
766
766
|
}
|
|
767
767
|
//#endregion
|
|
768
768
|
//#region src/viewer/utils/GeometryUtils/useGeometryUtils.ts
|
|
769
|
-
function
|
|
769
|
+
function Nt(e, t) {
|
|
770
770
|
return e instanceof Uint32Array ? new Uint32Array(t) : new Uint16Array(t);
|
|
771
771
|
}
|
|
772
|
-
function
|
|
772
|
+
function Pt(e) {
|
|
773
773
|
let t = e.geometry;
|
|
774
|
-
Object.assign(t, { boundsTree: void 0 }), e.geometry.index?.count && Object.assign(t, { boundsTree: new
|
|
774
|
+
Object.assign(t, { boundsTree: void 0 }), e.geometry.index?.count && Object.assign(t, { boundsTree: new Se(e.geometry, { indirect: !0 }) });
|
|
775
775
|
}
|
|
776
|
-
function
|
|
777
|
-
e.mesh.geometry.setIndex(new v(t, 1)), n &&
|
|
776
|
+
function Ft(e, t, n = !0) {
|
|
777
|
+
e.mesh.geometry.setIndex(new v(t, 1)), n && Pt(e.mesh);
|
|
778
778
|
}
|
|
779
|
-
function
|
|
779
|
+
function It(e, t) {
|
|
780
780
|
return e.initialVisible && (!e.isIfcSpace || t);
|
|
781
781
|
}
|
|
782
|
-
function
|
|
782
|
+
function Lt(e, t) {
|
|
783
783
|
let n = e.mesh.geometry, r = n.index?.array;
|
|
784
|
-
e.mesh.visible =
|
|
784
|
+
e.mesh.visible = It(e, t), r !== e.originalIndex && Ft(e, e.originalIndex, !1), e.originalBoundsTree ? Object.assign(n, { boundsTree: e.originalBoundsTree }) : (Pt(e.mesh), e.originalBoundsTree = e.mesh.geometry.boundsTree ?? null);
|
|
785
785
|
}
|
|
786
|
-
function
|
|
786
|
+
function Rt(e) {
|
|
787
787
|
return e === null ? "*" : e.size ? Array.from(e).sort((e, t) => e - t).join(",") : "";
|
|
788
788
|
}
|
|
789
|
-
function
|
|
790
|
-
return `h:${
|
|
789
|
+
function zt(e, t, n, r) {
|
|
790
|
+
return `h:${Rt(e)}|i:${Rt(n)}|s:${r ? Number(t) : ""}`;
|
|
791
791
|
}
|
|
792
|
-
function
|
|
792
|
+
function Bt(e, t, n) {
|
|
793
793
|
return !t.has(e) && (!n || n.has(e));
|
|
794
794
|
}
|
|
795
|
-
function
|
|
795
|
+
function Vt(e, t) {
|
|
796
796
|
Object.entries(e).forEach(([e, n]) => {
|
|
797
797
|
n.forEach((n) => t(Number(e), n));
|
|
798
798
|
});
|
|
799
799
|
}
|
|
800
|
-
function
|
|
800
|
+
function Ht(e, t, n) {
|
|
801
801
|
e.hiddenIds.has(t) || (e.hiddenIds.add(t), n.add(e));
|
|
802
802
|
}
|
|
803
|
-
function
|
|
803
|
+
function B(e, t, n) {
|
|
804
804
|
e && console.log(`${t}:`, Date.now() - n, "ms");
|
|
805
805
|
}
|
|
806
|
-
function
|
|
807
|
-
let { hiddenIds: i, originalIndex: a, triangleRanges: o } = e, s =
|
|
806
|
+
function V(e, t, n, r) {
|
|
807
|
+
let { hiddenIds: i, originalIndex: a, triangleRanges: o } = e, s = zt(i, t, n, e.isIfcSpace);
|
|
808
808
|
if (e.visibleStateKey === s) return;
|
|
809
809
|
if (!i.size && !n) {
|
|
810
|
-
|
|
810
|
+
Lt(e, t), e.visibleStateKey = s;
|
|
811
811
|
return;
|
|
812
812
|
}
|
|
813
813
|
let c = 0, l = 0;
|
|
814
814
|
if (o.forEach(({ count: e, id: t }) => {
|
|
815
|
-
|
|
815
|
+
Bt(t, i, n) ? c += e * 3 : l += e * 3;
|
|
816
816
|
}), !c) {
|
|
817
|
-
|
|
817
|
+
Lt(e, t), e.mesh.visible = !1, e.visibleStateKey = s;
|
|
818
818
|
return;
|
|
819
819
|
}
|
|
820
820
|
if (!l) {
|
|
821
|
-
|
|
821
|
+
Lt(e, t), e.visibleStateKey = s;
|
|
822
822
|
return;
|
|
823
823
|
}
|
|
824
|
-
e.mesh.visible =
|
|
825
|
-
let u =
|
|
824
|
+
e.mesh.visible = It(e, t);
|
|
825
|
+
let u = Nt(a, c), d = 0;
|
|
826
826
|
for (let e = 0; e < o.length; e++) {
|
|
827
827
|
let { count: t, id: r, start: s } = o[e];
|
|
828
|
-
if (!
|
|
828
|
+
if (!Bt(r, i, n)) continue;
|
|
829
829
|
let c = s * 3, l = c + t * 3;
|
|
830
830
|
u.set(a.subarray(c, l), d), d += t * 3;
|
|
831
831
|
}
|
|
832
|
-
r || (e.originalBoundsTree = null),
|
|
832
|
+
r || (e.originalBoundsTree = null), Ft(e, u), e.visibleStateKey = s;
|
|
833
833
|
}
|
|
834
|
-
function
|
|
834
|
+
function H(e, t) {
|
|
835
835
|
return e.isolatedIdsByModel ? e.isolatedIdsByModel.get(t.modelID) ?? /* @__PURE__ */ new Set() : e.isolatedIds;
|
|
836
836
|
}
|
|
837
|
-
function
|
|
838
|
-
let t =
|
|
837
|
+
function Ut(e) {
|
|
838
|
+
let t = L((e) => e.selected), n = L((e) => e.resetSelected), r = L((e) => e.showStats), a = L((e) => e.userDevice) === "pc", o = e.buildIndex, s = i(() => Array.from(o().elementIndex.keys()), [o]), c = i(() => o().ifcSpacesVisible, [o]), l = i((e) => {
|
|
839
839
|
let t = Date.now(), n = o(), i = /* @__PURE__ */ new Set();
|
|
840
840
|
e.forEach((e) => {
|
|
841
841
|
let t = n.elementIndex.get(e);
|
|
842
842
|
t && t.forEach(({ record: t }) => {
|
|
843
|
-
|
|
843
|
+
Ht(t, e, i);
|
|
844
844
|
});
|
|
845
|
-
}), i.forEach((e) =>
|
|
845
|
+
}), i.forEach((e) => V(e, n.ifcSpacesVisible, H(n, e), a)), B(r, "hideByIds", t);
|
|
846
846
|
}, [
|
|
847
847
|
o,
|
|
848
848
|
a,
|
|
849
849
|
r
|
|
850
850
|
]), u = i(() => {
|
|
851
851
|
let e = Date.now(), i = o(), s = /* @__PURE__ */ new Set();
|
|
852
|
-
|
|
852
|
+
Vt(t, (e, t) => {
|
|
853
853
|
let n = i.elementIndex.get(t);
|
|
854
854
|
n && n.forEach(({ record: n }) => {
|
|
855
|
-
n.modelID === e &&
|
|
855
|
+
n.modelID === e && Ht(n, t, s);
|
|
856
856
|
});
|
|
857
|
-
}), s.forEach((e) =>
|
|
857
|
+
}), s.forEach((e) => V(e, i.ifcSpacesVisible, H(i, e), a)), n(), B(r, "hideSelected", e);
|
|
858
858
|
}, [
|
|
859
859
|
o,
|
|
860
860
|
a,
|
|
@@ -868,24 +868,24 @@ function Vt(e) {
|
|
|
868
868
|
t && t.forEach(({ record: t }) => {
|
|
869
869
|
t.hiddenIds.delete(e) && i.add(t);
|
|
870
870
|
});
|
|
871
|
-
}), i.forEach((e) =>
|
|
871
|
+
}), i.forEach((e) => V(e, n.ifcSpacesVisible, H(n, e), a)), B(r, "showByIds", t);
|
|
872
872
|
}, [
|
|
873
873
|
o,
|
|
874
874
|
a,
|
|
875
875
|
r
|
|
876
876
|
]), f = i((e) => {
|
|
877
877
|
let t = Date.now(), n = o();
|
|
878
|
-
n.isolatedIdsByModel = null, n.isolatedIds = new Set(e), n.records.forEach((e) =>
|
|
878
|
+
n.isolatedIdsByModel = null, n.isolatedIds = new Set(e), n.records.forEach((e) => V(e, n.ifcSpacesVisible, H(n, e), a)), B(r, "isolateByIds", t);
|
|
879
879
|
}, [
|
|
880
880
|
o,
|
|
881
881
|
a,
|
|
882
882
|
r
|
|
883
883
|
]), p = i(() => {
|
|
884
884
|
let e = Date.now(), n = o(), i = /* @__PURE__ */ new Map();
|
|
885
|
-
|
|
885
|
+
Vt(t, (e, t) => {
|
|
886
886
|
let n = i.get(e);
|
|
887
887
|
n || (n = /* @__PURE__ */ new Set(), i.set(e, n)), n.add(t);
|
|
888
|
-
}), n.isolatedIdsByModel = i, n.isolatedIds = null, n.records.forEach((e) =>
|
|
888
|
+
}), n.isolatedIdsByModel = i, n.isolatedIds = null, n.records.forEach((e) => V(e, n.ifcSpacesVisible, H(n, e), a)), B(r, "isolateSelected", e);
|
|
889
889
|
}, [
|
|
890
890
|
o,
|
|
891
891
|
a,
|
|
@@ -893,7 +893,7 @@ function Vt(e) {
|
|
|
893
893
|
r
|
|
894
894
|
]), m = i(() => {
|
|
895
895
|
let e = Date.now(), t = o();
|
|
896
|
-
t.isolatedIdsByModel = null, t.isolatedIds = null, t.records.forEach((e) =>
|
|
896
|
+
t.isolatedIdsByModel = null, t.isolatedIds = null, t.records.forEach((e) => V(e, t.ifcSpacesVisible, H(t, e), a)), B(r, "resetIsolation", e);
|
|
897
897
|
}, [
|
|
898
898
|
o,
|
|
899
899
|
a,
|
|
@@ -901,7 +901,7 @@ function Vt(e) {
|
|
|
901
901
|
]), h = i((e) => {
|
|
902
902
|
let t = o();
|
|
903
903
|
t.ifcSpacesVisible !== e && (t.ifcSpacesVisible = e, t.records.forEach((e) => {
|
|
904
|
-
e.isIfcSpace &&
|
|
904
|
+
e.isIfcSpace && V(e, t.ifcSpacesVisible, H(t, e), a);
|
|
905
905
|
}));
|
|
906
906
|
}, [o, a]), g = i(() => {
|
|
907
907
|
h(!c());
|
|
@@ -919,8 +919,8 @@ function Vt(e) {
|
|
|
919
919
|
showAll: i(() => {
|
|
920
920
|
let e = Date.now(), t = o();
|
|
921
921
|
t.isolatedIdsByModel = null, t.isolatedIds = null, t.records.forEach((e) => {
|
|
922
|
-
e.hiddenIds.clear(),
|
|
923
|
-
}),
|
|
922
|
+
e.hiddenIds.clear(), V(e, t.ifcSpacesVisible, H(t, e), a);
|
|
923
|
+
}), B(r, "showAll", e);
|
|
924
924
|
}, [
|
|
925
925
|
o,
|
|
926
926
|
a,
|
|
@@ -932,49 +932,49 @@ function Vt(e) {
|
|
|
932
932
|
}
|
|
933
933
|
//#endregion
|
|
934
934
|
//#region src/viewer/utils/ClippingUtils/ClippingEdges.ts
|
|
935
|
-
var
|
|
936
|
-
function
|
|
935
|
+
var Wt = 1024, Gt = -1e-5;
|
|
936
|
+
function Kt(e) {
|
|
937
937
|
let t = new v(new Float32Array(e * 3), 3, !1);
|
|
938
938
|
return t.setUsage(T), t;
|
|
939
939
|
}
|
|
940
|
-
function
|
|
940
|
+
function qt(e) {
|
|
941
941
|
return Math.max(1, Math.ceil((e.geometry.index?.count ?? 0) / 3));
|
|
942
942
|
}
|
|
943
|
-
function
|
|
944
|
-
let n = new y(), r = Math.ceil(Math.min(Math.max(
|
|
945
|
-
n.setAttribute("position",
|
|
946
|
-
let i = new
|
|
943
|
+
function Jt(e, t) {
|
|
944
|
+
let n = new y(), r = Math.ceil(Math.min(Math.max(Wt, qt(t) * .05), 32768));
|
|
945
|
+
n.setAttribute("position", Kt(r)), n.setDrawRange(0, 0);
|
|
946
|
+
let i = new ne(n, e);
|
|
947
947
|
return i.frustumCulled = !1, i.renderOrder = 1, i.visible = !1, i;
|
|
948
948
|
}
|
|
949
|
-
function
|
|
949
|
+
function Yt(e, t) {
|
|
950
950
|
let n = e.geometry.getAttribute("position");
|
|
951
951
|
if (n.count > t) return n;
|
|
952
|
-
let r =
|
|
952
|
+
let r = Kt(Math.max(n.count * 2, t + 1));
|
|
953
953
|
return r.array.set(n.array), e.geometry.setAttribute("position", r), n = r, n;
|
|
954
954
|
}
|
|
955
|
-
function
|
|
955
|
+
function Xt(e) {
|
|
956
956
|
return e.filter((e) => e.parent && e.geometry.index?.count);
|
|
957
957
|
}
|
|
958
|
-
var
|
|
958
|
+
var Zt = class {
|
|
959
959
|
active;
|
|
960
960
|
material;
|
|
961
961
|
plane;
|
|
962
962
|
context;
|
|
963
963
|
lines = /* @__PURE__ */ new Map();
|
|
964
|
-
inverseMatrix = new
|
|
965
|
-
localPlane = new
|
|
966
|
-
tempLine = new
|
|
967
|
-
tempVector = new
|
|
968
|
-
tempVector1 = new
|
|
969
|
-
tempVector2 = new
|
|
970
|
-
tempVector3 = new
|
|
964
|
+
inverseMatrix = new j();
|
|
965
|
+
localPlane = new ue();
|
|
966
|
+
tempLine = new O();
|
|
967
|
+
tempVector = new P();
|
|
968
|
+
tempVector1 = new P();
|
|
969
|
+
tempVector2 = new P();
|
|
970
|
+
tempVector3 = new P();
|
|
971
971
|
constructor(e, t) {
|
|
972
972
|
this.context = e, this.plane = t, this.active = e.getActive() && e.getEdgesActive(), e.edges.forEach((e) => {
|
|
973
973
|
let n = e.material.clippingPlanes ?? [];
|
|
974
974
|
e.plane === t || n.includes(t) || (e.material.clippingPlanes = [...n, t], e.material.needsUpdate = !0);
|
|
975
975
|
});
|
|
976
976
|
let n = e.planes.filter((e) => e !== t);
|
|
977
|
-
this.material = new
|
|
977
|
+
this.material = new te({
|
|
978
978
|
clippingPlanes: n,
|
|
979
979
|
color: "black",
|
|
980
980
|
depthTest: !0,
|
|
@@ -985,12 +985,12 @@ var Yt = class {
|
|
|
985
985
|
return this.syncMeshes(), Array.from(this.lines.values());
|
|
986
986
|
}
|
|
987
987
|
syncMeshes() {
|
|
988
|
-
let e = new Set(
|
|
988
|
+
let e = new Set(Xt(this.context.getMeshes()));
|
|
989
989
|
this.lines.forEach((t, n) => {
|
|
990
990
|
e.has(n) || (t.removeFromParent(), t.geometry.dispose(), this.lines.delete(n));
|
|
991
991
|
}), e.forEach((e) => {
|
|
992
992
|
if (this.lines.has(e)) return;
|
|
993
|
-
let t =
|
|
993
|
+
let t = Jt(this.material, e);
|
|
994
994
|
e.add(t), this.lines.set(e, t);
|
|
995
995
|
}), this.setVisible(this.active);
|
|
996
996
|
}
|
|
@@ -1016,7 +1016,7 @@ var Yt = class {
|
|
|
1016
1016
|
}
|
|
1017
1017
|
t.updateWorldMatrix(!0, !1), this.inverseMatrix.copy(t.matrixWorld).invert(), this.localPlane.copy(this.plane).applyMatrix4(this.inverseMatrix);
|
|
1018
1018
|
let r = 0, i = e.geometry.getAttribute("position"), a = (t) => {
|
|
1019
|
-
i =
|
|
1019
|
+
i = Yt(e, r), i.setXYZ(r, t.x, t.y, t.z), r++;
|
|
1020
1020
|
};
|
|
1021
1021
|
n.shapecast({
|
|
1022
1022
|
intersectsBounds: (e) => this.localPlane.intersectsBox(e),
|
|
@@ -1024,19 +1024,19 @@ var Yt = class {
|
|
|
1024
1024
|
let t = 0;
|
|
1025
1025
|
this.tempLine.start.copy(e.a), this.tempLine.end.copy(e.b), this.localPlane.intersectLine(this.tempLine, this.tempVector) && (a(this.tempVector), t++), this.tempLine.start.copy(e.b), this.tempLine.end.copy(e.c), this.localPlane.intersectLine(this.tempLine, this.tempVector) && (a(this.tempVector), t++), this.tempLine.start.copy(e.c), this.tempLine.end.copy(e.a), this.localPlane.intersectLine(this.tempLine, this.tempVector) && (a(this.tempVector), t++), t === 3 && (this.tempVector1.fromBufferAttribute(i, r - 3), this.tempVector2.fromBufferAttribute(i, r - 2), this.tempVector3.fromBufferAttribute(i, r - 1), this.tempVector3.equals(this.tempVector1) || this.tempVector3.equals(this.tempVector2) ? (t--, r--) : this.tempVector1.equals(this.tempVector2) && (i.setXYZ(r - 2, this.tempVector3.x, this.tempVector3.y, this.tempVector3.z), t--, r--)), t !== 2 && (r -= t);
|
|
1026
1026
|
}
|
|
1027
|
-
}), e.geometry.setDrawRange(0, r), e.position.copy(this.localPlane.normal).multiplyScalar(
|
|
1027
|
+
}), e.geometry.setDrawRange(0, r), e.position.copy(this.localPlane.normal).multiplyScalar(Gt), i.needsUpdate = !0;
|
|
1028
1028
|
}));
|
|
1029
1029
|
}
|
|
1030
|
-
},
|
|
1031
|
-
function
|
|
1030
|
+
}, Qt = "#0b2f5f", $t = "#0b2f5f", en = 0, tn = "#1f7ae0", nn = .22, rn = .01, an = .025, on = .015, sn = .25, cn = .15, ln = .25, U = 1;
|
|
1031
|
+
function un(e, t) {
|
|
1032
1032
|
let n = t.getBoundingClientRect();
|
|
1033
|
-
return new
|
|
1033
|
+
return new N((e.clientX - n.left) / n.width * 2 - 1, -((e.clientY - n.top) / n.height) * 2 + 1);
|
|
1034
1034
|
}
|
|
1035
|
-
function
|
|
1036
|
-
let t = e.getSize(new
|
|
1037
|
-
return Math.max(
|
|
1035
|
+
function dn(e) {
|
|
1036
|
+
let t = e.getSize(new P());
|
|
1037
|
+
return Math.max(ln, t.length() * rn);
|
|
1038
1038
|
}
|
|
1039
|
-
var
|
|
1039
|
+
var fn = class extends se {
|
|
1040
1040
|
helper = new D();
|
|
1041
1041
|
borderMaterial;
|
|
1042
1042
|
material;
|
|
@@ -1047,22 +1047,22 @@ var un = class extends ie {
|
|
|
1047
1047
|
location;
|
|
1048
1048
|
normal;
|
|
1049
1049
|
planeMesh;
|
|
1050
|
-
pointer = new
|
|
1050
|
+
pointer = new N();
|
|
1051
1051
|
layout;
|
|
1052
1052
|
dragState = null;
|
|
1053
1053
|
hovered = !1;
|
|
1054
1054
|
listenersActive = !1;
|
|
1055
1055
|
constructor(e, t, n, r) {
|
|
1056
|
-
super(), this.context = e, this.plane = t, this.location = n.clone(), this.normal = r.clone().normalize(), this.material = new
|
|
1057
|
-
color:
|
|
1056
|
+
super(), this.context = e, this.plane = t, this.location = n.clone(), this.normal = r.clone().normalize(), this.material = new ie({
|
|
1057
|
+
color: $t,
|
|
1058
1058
|
depthWrite: !1,
|
|
1059
|
-
opacity:
|
|
1059
|
+
opacity: en,
|
|
1060
1060
|
side: w,
|
|
1061
1061
|
transparent: !0
|
|
1062
1062
|
}), this.helper.position.copy(this.location), this.applyPlaneOrientation(), this.layout = this.getHelperLayout();
|
|
1063
|
-
let i = Math.max(
|
|
1064
|
-
this.borderMaterial = new
|
|
1065
|
-
color:
|
|
1063
|
+
let i = Math.max(sn, Math.min(this.layout.width, this.layout.height) * an), a = Math.max(cn, Math.min(this.layout.width, this.layout.height) * on);
|
|
1064
|
+
this.borderMaterial = new k({
|
|
1065
|
+
color: Qt,
|
|
1066
1066
|
dashSize: i,
|
|
1067
1067
|
depthWrite: !1,
|
|
1068
1068
|
gapSize: a
|
|
@@ -1093,7 +1093,7 @@ var un = class extends ie {
|
|
|
1093
1093
|
}
|
|
1094
1094
|
updateBorderDash() {
|
|
1095
1095
|
let e = Math.min(this.layout.width, this.layout.height);
|
|
1096
|
-
this.borderMaterial.dashSize = Math.max(
|
|
1096
|
+
this.borderMaterial.dashSize = Math.max(sn, e * an), this.borderMaterial.gapSize = Math.max(cn, e * on), this.borderMaterial.needsUpdate = !0;
|
|
1097
1097
|
}
|
|
1098
1098
|
addEventListeners() {
|
|
1099
1099
|
if (this.listenersActive) return;
|
|
@@ -1128,15 +1128,15 @@ var un = class extends ie {
|
|
|
1128
1128
|
hasModelIntersection(e) {
|
|
1129
1129
|
return !!this.context.getCameraUtils().getIntersection(!0, {
|
|
1130
1130
|
event: e,
|
|
1131
|
-
filter: (e) => !(e.object instanceof
|
|
1131
|
+
filter: (e) => !(e.object instanceof M) || e.faceIndex === void 0 || e.faceIndex === null ? !1 : !!(e.object.geometry.index && e.object.geometry.attributes.ids),
|
|
1132
1132
|
object: this.context.getMeshes(),
|
|
1133
1133
|
recursive: !1
|
|
1134
1134
|
});
|
|
1135
1135
|
}
|
|
1136
1136
|
getPointerPointOnPlane(e, t) {
|
|
1137
1137
|
let n = this.context.getDomElement();
|
|
1138
|
-
this.pointer.copy(
|
|
1139
|
-
let r = this.context.getRaycaster(), i = new
|
|
1138
|
+
this.pointer.copy(un(e, n));
|
|
1139
|
+
let r = this.context.getRaycaster(), i = new P();
|
|
1140
1140
|
return r.setFromCamera(this.pointer, this.context.getCamera()), r.ray.intersectPlane(t, i);
|
|
1141
1141
|
}
|
|
1142
1142
|
onPointerDown = (e) => {
|
|
@@ -1148,9 +1148,9 @@ var un = class extends ie {
|
|
|
1148
1148
|
let t = this.getPointerIntersection(e);
|
|
1149
1149
|
if (!t) return;
|
|
1150
1150
|
e.preventDefault(), e.stopPropagation(), e.stopImmediatePropagation(), this.context.clearHelpersHover(this), this.setHovered(!0), this.context.setHelperDragActive(!0), this.context.setSelectionInteractionDisabled(!0);
|
|
1151
|
-
let n = new
|
|
1151
|
+
let n = new P();
|
|
1152
1152
|
this.context.getCamera().getWorldDirection(n), n.normalize();
|
|
1153
|
-
let r = new
|
|
1153
|
+
let r = new ue().setFromNormalAndCoplanarPoint(n, t.point);
|
|
1154
1154
|
this.dragState = {
|
|
1155
1155
|
dragPlane: r,
|
|
1156
1156
|
helperStart: this.helper.position.clone(),
|
|
@@ -1192,14 +1192,14 @@ var un = class extends ie {
|
|
|
1192
1192
|
this.hovered !== t && this.setHovered(t);
|
|
1193
1193
|
}
|
|
1194
1194
|
setHovered(e) {
|
|
1195
|
-
this.hovered = e, this.material.color.set(e ?
|
|
1195
|
+
this.hovered = e, this.material.color.set(e ? tn : $t), this.material.opacity = e ? nn : en, this.material.needsUpdate = !0;
|
|
1196
1196
|
}
|
|
1197
1197
|
createPlaneMesh() {
|
|
1198
|
-
let e = new
|
|
1198
|
+
let e = new M(new y(), this.material);
|
|
1199
1199
|
return e.renderOrder = 2, e;
|
|
1200
1200
|
}
|
|
1201
1201
|
createBorder() {
|
|
1202
|
-
let e = new
|
|
1202
|
+
let e = new ne(new y(), this.borderMaterial);
|
|
1203
1203
|
return e.renderOrder = 3, e;
|
|
1204
1204
|
}
|
|
1205
1205
|
replaceGeometry(e, t) {
|
|
@@ -1268,27 +1268,27 @@ var un = class extends ie {
|
|
|
1268
1268
|
getHelperLayout() {
|
|
1269
1269
|
let e = this.getModelWorldBox();
|
|
1270
1270
|
if (!e || e.isEmpty()) return {
|
|
1271
|
-
height:
|
|
1272
|
-
maxU:
|
|
1273
|
-
maxV:
|
|
1274
|
-
minU: -
|
|
1275
|
-
minV: -
|
|
1276
|
-
width:
|
|
1271
|
+
height: U,
|
|
1272
|
+
maxU: U / 2,
|
|
1273
|
+
maxV: U / 2,
|
|
1274
|
+
minU: -U / 2,
|
|
1275
|
+
minV: -U / 2,
|
|
1276
|
+
width: U
|
|
1277
1277
|
};
|
|
1278
|
-
let t = this.getPlaneBasis(), n = this.helper.position, r = this.getBoxCorners(e), i = new
|
|
1278
|
+
let t = this.getPlaneBasis(), n = this.helper.position, r = this.getBoxCorners(e), i = new P(), a = new P(), o = Infinity, s = -Infinity, c = Infinity, l = -Infinity;
|
|
1279
1279
|
if (r.forEach((e) => {
|
|
1280
1280
|
this.plane.projectPoint(e, i), a.copy(i).sub(n);
|
|
1281
1281
|
let r = a.dot(t.u), u = a.dot(t.v);
|
|
1282
1282
|
o = Math.min(o, r), s = Math.max(s, r), c = Math.min(c, u), l = Math.max(l, u);
|
|
1283
1283
|
}), !Number.isFinite(o) || !Number.isFinite(s) || !Number.isFinite(c) || !Number.isFinite(l)) return {
|
|
1284
|
-
height:
|
|
1285
|
-
maxU:
|
|
1286
|
-
maxV:
|
|
1287
|
-
minU: -
|
|
1288
|
-
minV: -
|
|
1289
|
-
width:
|
|
1284
|
+
height: U,
|
|
1285
|
+
maxU: U / 2,
|
|
1286
|
+
maxV: U / 2,
|
|
1287
|
+
minU: -U / 2,
|
|
1288
|
+
minV: -U / 2,
|
|
1289
|
+
width: U
|
|
1290
1290
|
};
|
|
1291
|
-
let u =
|
|
1291
|
+
let u = dn(e), d = o - u, f = s + u, p = c - u, m = l + u, h = Math.max(U, f - d), g = Math.max(U, m - p), _ = (d + f) / 2, v = (p + m) / 2;
|
|
1292
1292
|
return {
|
|
1293
1293
|
height: g,
|
|
1294
1294
|
maxU: _ + h / 2,
|
|
@@ -1299,14 +1299,14 @@ var un = class extends ie {
|
|
|
1299
1299
|
};
|
|
1300
1300
|
}
|
|
1301
1301
|
getPlaneBasis() {
|
|
1302
|
-
let e = (Math.abs(this.normal.y) < .9 ? new
|
|
1302
|
+
let e = (Math.abs(this.normal.y) < .9 ? new P(0, 1, 0) : new P(1, 0, 0)).cross(this.normal).normalize();
|
|
1303
1303
|
return {
|
|
1304
1304
|
u: e,
|
|
1305
1305
|
v: this.normal.clone().cross(e).normalize()
|
|
1306
1306
|
};
|
|
1307
1307
|
}
|
|
1308
1308
|
applyPlaneOrientation() {
|
|
1309
|
-
let e = this.getPlaneBasis(), t = new
|
|
1309
|
+
let e = this.getPlaneBasis(), t = new j().makeBasis(e.u, e.v, this.normal);
|
|
1310
1310
|
this.helper.quaternion.setFromRotationMatrix(t);
|
|
1311
1311
|
}
|
|
1312
1312
|
getModelWorldBox() {
|
|
@@ -1319,20 +1319,20 @@ var un = class extends ie {
|
|
|
1319
1319
|
}
|
|
1320
1320
|
getBoxCorners(e) {
|
|
1321
1321
|
return [
|
|
1322
|
-
new
|
|
1323
|
-
new
|
|
1324
|
-
new
|
|
1325
|
-
new
|
|
1326
|
-
new
|
|
1327
|
-
new
|
|
1328
|
-
new
|
|
1329
|
-
new
|
|
1322
|
+
new P(e.min.x, e.min.y, e.min.z),
|
|
1323
|
+
new P(e.min.x, e.min.y, e.max.z),
|
|
1324
|
+
new P(e.min.x, e.max.y, e.min.z),
|
|
1325
|
+
new P(e.min.x, e.max.y, e.max.z),
|
|
1326
|
+
new P(e.max.x, e.min.y, e.min.z),
|
|
1327
|
+
new P(e.max.x, e.min.y, e.max.z),
|
|
1328
|
+
new P(e.max.x, e.max.y, e.min.z),
|
|
1329
|
+
new P(e.max.x, e.max.y, e.max.z)
|
|
1330
1330
|
];
|
|
1331
1331
|
}
|
|
1332
1332
|
};
|
|
1333
1333
|
//#endregion
|
|
1334
1334
|
//#region src/viewer/utils/ClippingUtils/ClippingUtils.ts
|
|
1335
|
-
function
|
|
1335
|
+
function pn(e, t) {
|
|
1336
1336
|
if (Array.isArray(e)) {
|
|
1337
1337
|
e.forEach((e) => {
|
|
1338
1338
|
e.clippingPlanes = t, e.needsUpdate = !0;
|
|
@@ -1341,16 +1341,16 @@ function dn(e, t) {
|
|
|
1341
1341
|
}
|
|
1342
1342
|
e.clippingPlanes = t, e.needsUpdate = !0;
|
|
1343
1343
|
}
|
|
1344
|
-
function
|
|
1344
|
+
function mn(e) {
|
|
1345
1345
|
let t = [];
|
|
1346
1346
|
return e?.traverse((e) => {
|
|
1347
|
-
e instanceof
|
|
1347
|
+
e instanceof M && (!e.geometry.index || !e.geometry.attributes.ids || t.push(e));
|
|
1348
1348
|
}), t;
|
|
1349
1349
|
}
|
|
1350
|
-
function
|
|
1350
|
+
function hn(e, t) {
|
|
1351
1351
|
return t.clone().transformDirection(e.matrixWorld).normalize();
|
|
1352
1352
|
}
|
|
1353
|
-
var
|
|
1353
|
+
var gn = class {
|
|
1354
1354
|
planes = [];
|
|
1355
1355
|
edges = [];
|
|
1356
1356
|
helpers = [];
|
|
@@ -1399,7 +1399,7 @@ var mn = class {
|
|
|
1399
1399
|
return this.context.controlRef;
|
|
1400
1400
|
}
|
|
1401
1401
|
getMeshes() {
|
|
1402
|
-
return
|
|
1402
|
+
return mn(this.context.modelRef.current);
|
|
1403
1403
|
}
|
|
1404
1404
|
getHelperHoverIsMoving() {
|
|
1405
1405
|
return this.helperHoverMoveState !== "end" && this.helperHoverMoveState !== "start";
|
|
@@ -1442,7 +1442,7 @@ var mn = class {
|
|
|
1442
1442
|
updateMaterials() {
|
|
1443
1443
|
let e = this.active ? this.planes : [];
|
|
1444
1444
|
this.getMeshes().forEach((t) => {
|
|
1445
|
-
|
|
1445
|
+
pn(t.material, e);
|
|
1446
1446
|
}), this.context.camera.updateMatrixWorld();
|
|
1447
1447
|
}
|
|
1448
1448
|
setActive(e) {
|
|
@@ -1461,42 +1461,42 @@ var mn = class {
|
|
|
1461
1461
|
recursive: !1
|
|
1462
1462
|
});
|
|
1463
1463
|
if (!n?.face) return null;
|
|
1464
|
-
let r = n.point.clone(), i =
|
|
1464
|
+
let r = n.point.clone(), i = hn(n.object, n.face.normal);
|
|
1465
1465
|
r.add(i.clone().multiplyScalar(.001));
|
|
1466
|
-
let a = new
|
|
1466
|
+
let a = new ue().setFromNormalAndCoplanarPoint(i.clone().negate(), r);
|
|
1467
1467
|
return this.addPlane(a, r, i), a.clone();
|
|
1468
1468
|
}
|
|
1469
1469
|
createClippingRectangle() {
|
|
1470
1470
|
let e = this.getModelWorldBox();
|
|
1471
1471
|
if (!e) return [];
|
|
1472
|
-
let t =
|
|
1472
|
+
let t = dn(e), n = e.min.clone().addScalar(-t), r = e.max.clone().addScalar(t), i = e.getCenter(new P()), a = [
|
|
1473
1473
|
{
|
|
1474
|
-
normal: new
|
|
1475
|
-
point: new
|
|
1474
|
+
normal: new P(1, 0, 0),
|
|
1475
|
+
point: new P(n.x, i.y, i.z)
|
|
1476
1476
|
},
|
|
1477
1477
|
{
|
|
1478
|
-
normal: new
|
|
1479
|
-
point: new
|
|
1478
|
+
normal: new P(-1, 0, 0),
|
|
1479
|
+
point: new P(r.x, i.y, i.z)
|
|
1480
1480
|
},
|
|
1481
1481
|
{
|
|
1482
|
-
normal: new
|
|
1483
|
-
point: new
|
|
1482
|
+
normal: new P(0, 1, 0),
|
|
1483
|
+
point: new P(i.x, n.y, i.z)
|
|
1484
1484
|
},
|
|
1485
1485
|
{
|
|
1486
|
-
normal: new
|
|
1487
|
-
point: new
|
|
1486
|
+
normal: new P(0, -1, 0),
|
|
1487
|
+
point: new P(i.x, r.y, i.z)
|
|
1488
1488
|
},
|
|
1489
1489
|
{
|
|
1490
|
-
normal: new
|
|
1491
|
-
point: new
|
|
1490
|
+
normal: new P(0, 0, 1),
|
|
1491
|
+
point: new P(i.x, i.y, n.z)
|
|
1492
1492
|
},
|
|
1493
1493
|
{
|
|
1494
|
-
normal: new
|
|
1495
|
-
point: new
|
|
1494
|
+
normal: new P(0, 0, -1),
|
|
1495
|
+
point: new P(i.x, i.y, r.z)
|
|
1496
1496
|
}
|
|
1497
1497
|
].map(({ normal: e, point: t }) => ({
|
|
1498
1498
|
normal: e,
|
|
1499
|
-
plane: new
|
|
1499
|
+
plane: new ue().setFromNormalAndCoplanarPoint(e, t),
|
|
1500
1500
|
point: t
|
|
1501
1501
|
}));
|
|
1502
1502
|
return a.forEach(({ normal: e, plane: t, point: n }) => {
|
|
@@ -1504,8 +1504,8 @@ var mn = class {
|
|
|
1504
1504
|
}), this.updateHelpers(), a.map(({ plane: e }) => e.clone());
|
|
1505
1505
|
}
|
|
1506
1506
|
addPlane(e, t, n) {
|
|
1507
|
-
if (this.active || this.setActive(!0), this.planes.push(e), new
|
|
1508
|
-
let t = new
|
|
1507
|
+
if (this.active || this.setActive(!0), this.planes.push(e), new fn(this, e, t, n), this.updateHelpers(), this.updateMaterials(), this.edgesActive) {
|
|
1508
|
+
let t = new Zt(this, e);
|
|
1509
1509
|
t.create(), t.update();
|
|
1510
1510
|
}
|
|
1511
1511
|
}
|
|
@@ -1517,7 +1517,7 @@ var mn = class {
|
|
|
1517
1517
|
}
|
|
1518
1518
|
setEdgesActive(e) {
|
|
1519
1519
|
this.edgesActive !== e && (this.edgesActive = e, e && this.edges.length !== this.planes.length && (this.edges.forEach((e) => e.dispose()), this.edges = [], this.planes.forEach((e) => {
|
|
1520
|
-
let t = new
|
|
1520
|
+
let t = new Zt(this, e);
|
|
1521
1521
|
t.create(), t.update();
|
|
1522
1522
|
})), this.edges.forEach((t) => t.setVisible(this.active && e)));
|
|
1523
1523
|
}
|
|
@@ -1544,8 +1544,8 @@ var mn = class {
|
|
|
1544
1544
|
this.deleteAllPlanes();
|
|
1545
1545
|
}
|
|
1546
1546
|
};
|
|
1547
|
-
function
|
|
1548
|
-
let r = p((e) => e.camera), i = p((e) => e.gl), a = p((e) => e.raycaster), s = p((e) => e.scene), l =
|
|
1547
|
+
function _n(e, t, n) {
|
|
1548
|
+
let r = p((e) => e.camera), i = p((e) => e.gl), a = p((e) => e.raycaster), s = p((e) => e.scene), l = R(), u = c(() => new gn({
|
|
1549
1549
|
camera: r,
|
|
1550
1550
|
cameraUtils: n,
|
|
1551
1551
|
controlRef: t,
|
|
@@ -1615,28 +1615,28 @@ function hn(e, t, n) {
|
|
|
1615
1615
|
}
|
|
1616
1616
|
//#endregion
|
|
1617
1617
|
//#region src/viewer/utils/DimentionsUtils/DimentionLine.ts
|
|
1618
|
-
var
|
|
1619
|
-
function
|
|
1618
|
+
var vn = 12, yn = 6, bn = 4;
|
|
1619
|
+
function xn() {
|
|
1620
1620
|
return typeof window > "u" ? 1 : Math.min(window.devicePixelRatio || 1, 2);
|
|
1621
1621
|
}
|
|
1622
|
-
function
|
|
1623
|
-
return e instanceof
|
|
1622
|
+
function Sn(e, t) {
|
|
1623
|
+
return e instanceof ce ? (e.top - e.bottom) / e.zoom : e instanceof le ? 2 * Math.tan(e.fov * Math.PI / 360) * Math.max(t, .001) : Math.max(t, 1);
|
|
1624
1624
|
}
|
|
1625
|
-
function
|
|
1626
|
-
let t =
|
|
1625
|
+
function Cn(e) {
|
|
1626
|
+
let t = xn(), n = document.createElement("canvas"), r = n.getContext("2d");
|
|
1627
1627
|
if (!r) throw Error("Could not create dimension label canvas context");
|
|
1628
|
-
let i = `600 ${
|
|
1628
|
+
let i = `600 ${vn}px system-ui, "Segoe UI", sans-serif`;
|
|
1629
1629
|
r.font = i;
|
|
1630
|
-
let a = r.measureText(e), o = a.actualBoundingBoxAscent ||
|
|
1630
|
+
let a = r.measureText(e), o = a.actualBoundingBoxAscent || vn * .8, s = a.actualBoundingBoxDescent || vn * .2, c = Math.max(1, Math.ceil(a.width + yn * 2)), l = Math.max(1, Math.ceil(o + s + bn * 2));
|
|
1631
1631
|
n.width = Math.ceil(c * t), n.height = Math.ceil(l * t), r.scale(t, t), r.clearRect(0, 0, c, l), r.fillStyle = "rgba(255, 255, 255, 0.86)", r.strokeStyle = "rgba(29, 39, 51, 0.22)", r.lineWidth = 1, r.beginPath(), r.roundRect(.5, .5, c - 1, l - 1, 4), r.fill(), r.stroke(), r.font = i, r.fillStyle = "#111827", r.textAlign = "center", r.textBaseline = "middle", r.fillText(e, c / 2, l / 2);
|
|
1632
1632
|
let u = new b(n);
|
|
1633
|
-
return u.colorSpace =
|
|
1633
|
+
return u.colorSpace = fe, u.generateMipmaps = !1, u.magFilter = A, u.minFilter = A, u.needsUpdate = !0, {
|
|
1634
1634
|
height: l,
|
|
1635
1635
|
texture: u,
|
|
1636
1636
|
width: c
|
|
1637
1637
|
};
|
|
1638
1638
|
}
|
|
1639
|
-
var
|
|
1639
|
+
var wn = class e {
|
|
1640
1640
|
static scale = 1;
|
|
1641
1641
|
static scaleFactor = .015;
|
|
1642
1642
|
static units = "m";
|
|
@@ -1666,7 +1666,7 @@ var Sn = class e {
|
|
|
1666
1666
|
this.end.x,
|
|
1667
1667
|
this.end.y,
|
|
1668
1668
|
this.end.z
|
|
1669
|
-
], 3)), this.line = new
|
|
1669
|
+
], 3)), this.line = new ee(this.lineGeometry, this.lineMaterial), this.line.renderOrder = 4, this.line.computeLineDistances(), this.root.add(this.line), this.addEndpointMeshes(), this.labelSprite = this.createLabelSprite(), this.root.add(this.labelSprite), this.updateLabel(), this.updatePositions(), this.ownerRoot.add(this.root);
|
|
1670
1670
|
}
|
|
1671
1671
|
get length() {
|
|
1672
1672
|
return this.start.distanceTo(this.end);
|
|
@@ -1708,11 +1708,11 @@ var Sn = class e {
|
|
|
1708
1708
|
this.addEndpointMesh(this.start, this.end), this.addEndpointMesh(this.end, this.start);
|
|
1709
1709
|
}
|
|
1710
1710
|
addEndpointMesh(e, t) {
|
|
1711
|
-
let n = new
|
|
1711
|
+
let n = new M(this.endpointGeometry, this.endpointMaterial);
|
|
1712
1712
|
n.position.copy(e), n.scale.copy(this.endpointBaseScale), n.lookAt(t), n.renderOrder = 4, this.endpointMeshes.push(n), this.root.add(n);
|
|
1713
1713
|
}
|
|
1714
1714
|
createLabelSprite() {
|
|
1715
|
-
let e = new
|
|
1715
|
+
let e = new he(new ge({
|
|
1716
1716
|
depthTest: !1,
|
|
1717
1717
|
depthWrite: !1,
|
|
1718
1718
|
transparent: !0
|
|
@@ -1720,7 +1720,7 @@ var Sn = class e {
|
|
|
1720
1720
|
return e.renderOrder = 5, e;
|
|
1721
1721
|
}
|
|
1722
1722
|
createBoundingBoxMesh() {
|
|
1723
|
-
let e = new
|
|
1723
|
+
let e = new M(new _(1, 1, Math.max(this.length, .001)), this.boundingMaterial);
|
|
1724
1724
|
return e.renderOrder = 3, e;
|
|
1725
1725
|
}
|
|
1726
1726
|
getTextContent() {
|
|
@@ -1731,7 +1731,7 @@ var Sn = class e {
|
|
|
1731
1731
|
let e = this.getTextContent();
|
|
1732
1732
|
if (this.labelText === e) return;
|
|
1733
1733
|
this.labelText = e, this.labelTexture?.dispose();
|
|
1734
|
-
let t =
|
|
1734
|
+
let t = Cn(e);
|
|
1735
1735
|
this.labelHeight = t.height, this.labelTexture = t.texture, this.labelWidth = t.width, this.labelSprite.material.map = t.texture, this.labelSprite.material.needsUpdate = !0;
|
|
1736
1736
|
}
|
|
1737
1737
|
updatePositions() {
|
|
@@ -1742,37 +1742,37 @@ var Sn = class e {
|
|
|
1742
1742
|
this.boundingMesh && (this.boundingMesh.position.copy(this.center), this.boundingMesh.lookAt(this.end), this.boundingMesh.geometry.dispose(), this.boundingMesh.geometry = new _(1, 1, Math.max(this.length, .001)));
|
|
1743
1743
|
}
|
|
1744
1744
|
rescaleMesh(t, n, r) {
|
|
1745
|
-
let i =
|
|
1745
|
+
let i = Sn(n, t.position.distanceTo(n.position)) / Math.max(1, r) * 12 * e.scaleFactor;
|
|
1746
1746
|
t.scale.setScalar(i);
|
|
1747
1747
|
}
|
|
1748
1748
|
rescaleBoundingMesh(e, t) {
|
|
1749
1749
|
if (!this.boundingMesh) return;
|
|
1750
|
-
let n =
|
|
1750
|
+
let n = Sn(e, this.boundingMesh.position.distanceTo(e.position)) / Math.max(1, t) * 8;
|
|
1751
1751
|
this.boundingMesh.scale.set(n, n, 1);
|
|
1752
1752
|
}
|
|
1753
1753
|
rescaleLabel(e, t) {
|
|
1754
|
-
let n =
|
|
1754
|
+
let n = Sn(e, this.labelSprite.position.distanceTo(e.position)), r = this.labelHeight / Math.max(1, t) * n, i = r * (this.labelWidth / this.labelHeight);
|
|
1755
1755
|
this.labelSprite.scale.set(i, r, 1);
|
|
1756
1756
|
}
|
|
1757
|
-
},
|
|
1758
|
-
function
|
|
1757
|
+
}, Tn = "#111827", En = 1, Dn = "x";
|
|
1758
|
+
function On(e) {
|
|
1759
1759
|
let t = [];
|
|
1760
1760
|
return e?.traverse((e) => {
|
|
1761
|
-
e instanceof
|
|
1761
|
+
e instanceof M && e.geometry.attributes.position && t.push(e);
|
|
1762
1762
|
}), t;
|
|
1763
1763
|
}
|
|
1764
|
-
function
|
|
1764
|
+
function kn(e, t, n) {
|
|
1765
1765
|
let r = e.clone();
|
|
1766
1766
|
return r[n] = t[n], r;
|
|
1767
1767
|
}
|
|
1768
|
-
function
|
|
1768
|
+
function An(e, t) {
|
|
1769
1769
|
let n = Math.hypot(t.y - e.y, t.z - e.z), r = Math.hypot(t.x - e.x, t.z - e.z), i = Math.hypot(t.x - e.x, t.y - e.y), a = Math.min(n, r, i);
|
|
1770
1770
|
return a === n ? "x" : a === r ? "y" : "z";
|
|
1771
1771
|
}
|
|
1772
|
-
var
|
|
1772
|
+
var jn = class e {
|
|
1773
1773
|
active = !1;
|
|
1774
1774
|
axis = null;
|
|
1775
|
-
boundingMaterial = new
|
|
1775
|
+
boundingMaterial = new ie({
|
|
1776
1776
|
color: 0,
|
|
1777
1777
|
depthTest: !1,
|
|
1778
1778
|
depthWrite: !1,
|
|
@@ -1783,14 +1783,14 @@ var kn = class e {
|
|
|
1783
1783
|
currentDimension = null;
|
|
1784
1784
|
dimensions = [];
|
|
1785
1785
|
endpointGeometry = e.createEndpointGeometry();
|
|
1786
|
-
endpointMaterial = new
|
|
1787
|
-
color:
|
|
1786
|
+
endpointMaterial = new ie({
|
|
1787
|
+
color: Tn,
|
|
1788
1788
|
depthTest: !1,
|
|
1789
1789
|
depthWrite: !1
|
|
1790
1790
|
});
|
|
1791
|
-
endpointScale = new
|
|
1792
|
-
lineMaterial = new
|
|
1793
|
-
color:
|
|
1791
|
+
endpointScale = new P(1, 1, 1);
|
|
1792
|
+
lineMaterial = new k({
|
|
1793
|
+
color: Tn,
|
|
1794
1794
|
dashSize: .2,
|
|
1795
1795
|
depthTest: !1,
|
|
1796
1796
|
depthWrite: !1,
|
|
@@ -1798,14 +1798,14 @@ var kn = class e {
|
|
|
1798
1798
|
});
|
|
1799
1799
|
measureInProcess = !1;
|
|
1800
1800
|
moveState = "end";
|
|
1801
|
-
previewMarker = new
|
|
1801
|
+
previewMarker = new M(e.createPreviewGeometry(), new ie({
|
|
1802
1802
|
color: 0,
|
|
1803
1803
|
depthTest: !1,
|
|
1804
1804
|
depthWrite: !1
|
|
1805
1805
|
}));
|
|
1806
1806
|
root = new D();
|
|
1807
|
-
snapDistance =
|
|
1808
|
-
startPoint = new
|
|
1807
|
+
snapDistance = En;
|
|
1808
|
+
startPoint = new P();
|
|
1809
1809
|
unit = "m";
|
|
1810
1810
|
constructor(e) {
|
|
1811
1811
|
this.context = e, this.root.name = "BimatterDimensions", this.previewMarker.renderOrder = 5, this.previewMarker.visible = !1, this.root.add(this.previewMarker), this.context.scene.add(this.root);
|
|
@@ -1838,13 +1838,13 @@ var kn = class e {
|
|
|
1838
1838
|
});
|
|
1839
1839
|
}
|
|
1840
1840
|
setEndpointScaleFactor(e) {
|
|
1841
|
-
!Number.isFinite(e) || e <= 0 || (
|
|
1841
|
+
!Number.isFinite(e) || e <= 0 || (wn.scaleFactor = e);
|
|
1842
1842
|
}
|
|
1843
1843
|
setSnapDistance(e) {
|
|
1844
1844
|
!Number.isFinite(e) || e < 0 || (this.snapDistance = e);
|
|
1845
1845
|
}
|
|
1846
1846
|
setUnit(e) {
|
|
1847
|
-
this.unit = e,
|
|
1847
|
+
this.unit = e, wn.units = e, wn.scale = e === "mm" ? 1e3 : 1, this.dimensions.forEach((e) => {
|
|
1848
1848
|
e.endPoint = e.end;
|
|
1849
1849
|
}), this.currentDimension && (this.currentDimension.endPoint = this.currentDimension.end);
|
|
1850
1850
|
}
|
|
@@ -1870,7 +1870,7 @@ var kn = class e {
|
|
|
1870
1870
|
changeAxes() {
|
|
1871
1871
|
if (!this.measureInProcess || !this.currentDimension) return;
|
|
1872
1872
|
let e = this.currentDimension.end, t = this.getNextAxis();
|
|
1873
|
-
this.axis = t, this.currentDimension.endPoint =
|
|
1873
|
+
this.axis = t, this.currentDimension.endPoint = kn(this.startPoint, e, t);
|
|
1874
1874
|
}
|
|
1875
1875
|
updateFrame() {
|
|
1876
1876
|
if (!this.active) return;
|
|
@@ -1914,7 +1914,7 @@ var kn = class e {
|
|
|
1914
1914
|
this.currentDimension && (this.currentDimension.createBoundingBox(), this.dimensions.push(this.currentDimension), this.currentDimension = null, this.measureInProcess = !1, this.axis = null);
|
|
1915
1915
|
}
|
|
1916
1916
|
createDimension(e, t) {
|
|
1917
|
-
return new
|
|
1917
|
+
return new wn({
|
|
1918
1918
|
boundingMaterial: this.boundingMaterial,
|
|
1919
1919
|
endpointGeometry: this.endpointGeometry,
|
|
1920
1920
|
endpointMaterial: this.endpointMaterial,
|
|
@@ -1926,7 +1926,7 @@ var kn = class e {
|
|
|
1926
1926
|
});
|
|
1927
1927
|
}
|
|
1928
1928
|
getModelHit(e) {
|
|
1929
|
-
let t =
|
|
1929
|
+
let t = On(this.context.modelRef.current);
|
|
1930
1930
|
return t.length ? this.context.cameraUtils.getIntersection(!0, {
|
|
1931
1931
|
event: e,
|
|
1932
1932
|
filter: (e) => !!e.face,
|
|
@@ -1938,7 +1938,7 @@ var kn = class e {
|
|
|
1938
1938
|
return this.dimensions.map((e) => e.boundingBox).filter((e) => !!e);
|
|
1939
1939
|
}
|
|
1940
1940
|
getClosestVertex(e) {
|
|
1941
|
-
if (!(e.object instanceof
|
|
1941
|
+
if (!(e.object instanceof M) || !e.face) return e.point.clone();
|
|
1942
1942
|
let t = e.object.geometry.attributes.position;
|
|
1943
1943
|
if (!t) return e.point.clone();
|
|
1944
1944
|
let n = [
|
|
@@ -1946,29 +1946,29 @@ var kn = class e {
|
|
|
1946
1946
|
e.face.b,
|
|
1947
1947
|
e.face.c
|
|
1948
1948
|
].map((n) => {
|
|
1949
|
-
let r = new
|
|
1949
|
+
let r = new P(t.getX(n), t.getY(n), t.getZ(n));
|
|
1950
1950
|
return e.object.localToWorld(r);
|
|
1951
1951
|
}).filter((t) => t.distanceTo(e.point) <= this.snapDistance);
|
|
1952
1952
|
return n.length ? n.reduce((t, n) => n.distanceTo(e.point) < t.distanceTo(e.point) ? n : t) : e.point.clone();
|
|
1953
1953
|
}
|
|
1954
1954
|
getPreviewEndPoint(e, t) {
|
|
1955
1955
|
if (!t) return this.axis = null, e.clone();
|
|
1956
|
-
let n = this.axis ??
|
|
1957
|
-
return this.axis = n,
|
|
1956
|
+
let n = this.axis ?? An(this.startPoint, e);
|
|
1957
|
+
return this.axis = n, kn(this.startPoint, e, n);
|
|
1958
1958
|
}
|
|
1959
1959
|
getNextAxis() {
|
|
1960
1960
|
switch (this.axis) {
|
|
1961
1961
|
case "x": return "y";
|
|
1962
1962
|
case "y": return "z";
|
|
1963
1963
|
case "z": return "x";
|
|
1964
|
-
default: return
|
|
1964
|
+
default: return Dn;
|
|
1965
1965
|
}
|
|
1966
1966
|
}
|
|
1967
1967
|
getIsMoving() {
|
|
1968
1968
|
return this.moveState !== "end" && this.moveState !== "start";
|
|
1969
1969
|
}
|
|
1970
1970
|
rescalePreviewMarker() {
|
|
1971
|
-
let { camera: e, viewportHeight: t } = this.context, n = this.previewMarker.position.distanceTo(e.position), r = e instanceof
|
|
1971
|
+
let { camera: e, viewportHeight: t } = this.context, n = this.previewMarker.position.distanceTo(e.position), r = e instanceof le ? 2 * Math.tan(e.fov * Math.PI / 360) * Math.max(n, .001) * 6.667 / Math.max(1, t) : .08;
|
|
1972
1972
|
this.previewMarker.scale.setScalar(r);
|
|
1973
1973
|
}
|
|
1974
1974
|
setSelectionInteractionDisabled(e) {
|
|
@@ -2005,11 +2005,11 @@ var kn = class e {
|
|
|
2005
2005
|
return n.translate(0, -e / 2, 0), n.rotateX(-Math.PI / 2), n;
|
|
2006
2006
|
}
|
|
2007
2007
|
static createPreviewGeometry() {
|
|
2008
|
-
return new
|
|
2008
|
+
return new me(.5, 16, 12);
|
|
2009
2009
|
}
|
|
2010
2010
|
};
|
|
2011
|
-
function
|
|
2012
|
-
let r = p((e) => e.camera), i = p((e) => e.gl), a = p((e) => e.scene), s = p((e) => e.size), l =
|
|
2011
|
+
function Mn(e, t, n) {
|
|
2012
|
+
let r = p((e) => e.camera), i = p((e) => e.gl), a = p((e) => e.scene), s = p((e) => e.size), l = R(), u = c(() => new jn({
|
|
2013
2013
|
camera: r,
|
|
2014
2014
|
cameraUtils: n,
|
|
2015
2015
|
controlRef: t,
|
|
@@ -2071,15 +2071,15 @@ function An(e, t, n) {
|
|
|
2071
2071
|
}
|
|
2072
2072
|
//#endregion
|
|
2073
2073
|
//#region src/viewer/utils/Hotkeys/useHotkeysUtils.tsx
|
|
2074
|
-
function
|
|
2074
|
+
function Nn(e) {
|
|
2075
2075
|
return e instanceof HTMLElement ? e.isContentEditable || e instanceof HTMLInputElement || e instanceof HTMLSelectElement || e instanceof HTMLTextAreaElement : !1;
|
|
2076
2076
|
}
|
|
2077
|
-
function
|
|
2078
|
-
let e =
|
|
2077
|
+
function Pn() {
|
|
2078
|
+
let e = L((e) => e.api), t = L((e) => e.defaultHotkeysEnabled);
|
|
2079
2079
|
o(() => {
|
|
2080
2080
|
if (!t) return;
|
|
2081
2081
|
let n = (t) => {
|
|
2082
|
-
|
|
2082
|
+
Nn(t.target) || (t.code === "KeyI" && e?.geometryUtils.isolateSelected(), t.code === "KeyH" && e?.geometryUtils.hideSelected(), t.code === "KeyC" && e?.geometryUtils.showAll(), t.code === "KeyP" && e?.clipping.createPlane(), t.code === "KeyM" && e?.dimensions.toggle());
|
|
2083
2083
|
};
|
|
2084
2084
|
return window.addEventListener("keydown", n), () => {
|
|
2085
2085
|
window.removeEventListener("keydown", n);
|
|
@@ -2088,15 +2088,15 @@ function Mn() {
|
|
|
2088
2088
|
}
|
|
2089
2089
|
//#endregion
|
|
2090
2090
|
//#region src/viewer/Camera/useCameraUtils.ts
|
|
2091
|
-
var
|
|
2092
|
-
function
|
|
2091
|
+
var Fn = 1e-6;
|
|
2092
|
+
function In(e, t) {
|
|
2093
2093
|
let n = t.getBoundingClientRect();
|
|
2094
|
-
return n.width <= 0 || n.height <= 0 || e.clientX < n.left || e.clientX > n.right || e.clientY < n.top || e.clientY > n.bottom ? null : new
|
|
2094
|
+
return n.width <= 0 || n.height <= 0 || e.clientX < n.left || e.clientX > n.right || e.clientY < n.top || e.clientY > n.bottom ? null : new N((e.clientX - n.left) / n.width * 2 - 1, -((e.clientY - n.top) / n.height) * 2 + 1);
|
|
2095
2095
|
}
|
|
2096
|
-
function
|
|
2097
|
-
return t.every((t) => t.distanceToPoint(e) >= -
|
|
2096
|
+
function Ln(e, t) {
|
|
2097
|
+
return t.every((t) => t.distanceToPoint(e) >= -Fn);
|
|
2098
2098
|
}
|
|
2099
|
-
function
|
|
2099
|
+
function Rn(e) {
|
|
2100
2100
|
let t = e;
|
|
2101
2101
|
for (; t;) {
|
|
2102
2102
|
if (!t.visible) return !1;
|
|
@@ -2104,8 +2104,8 @@ function In(e) {
|
|
|
2104
2104
|
}
|
|
2105
2105
|
return !0;
|
|
2106
2106
|
}
|
|
2107
|
-
function
|
|
2108
|
-
let t = p((e) => e.camera), n = p((e) => e.gl), r = p((e) => e.raycaster), a = l(null), s = l(null), u = l(new
|
|
2107
|
+
function zn(e) {
|
|
2108
|
+
let t = p((e) => e.camera), n = p((e) => e.gl), r = p((e) => e.raycaster), a = l(null), s = l(null), u = l(new N()), d = i((e) => {
|
|
2109
2109
|
a.current = e;
|
|
2110
2110
|
}, []), f = i(() => {
|
|
2111
2111
|
let e = a.current;
|
|
@@ -2113,7 +2113,7 @@ function Ln(e) {
|
|
|
2113
2113
|
}, []);
|
|
2114
2114
|
o(() => {
|
|
2115
2115
|
let e = n.domElement, t = (t) => {
|
|
2116
|
-
let n =
|
|
2116
|
+
let n = In(t, e);
|
|
2117
2117
|
n && (s.current = n);
|
|
2118
2118
|
}, r = () => {
|
|
2119
2119
|
s.current = null;
|
|
@@ -2123,11 +2123,11 @@ function Ln(e) {
|
|
|
2123
2123
|
};
|
|
2124
2124
|
}, [n]);
|
|
2125
2125
|
let m = i((i = !1, { event: a, filter: o, object: c = e.current, recursive: l = !0, respectClipping: d = !0 } = {}) => {
|
|
2126
|
-
let p = a ?
|
|
2126
|
+
let p = a ? In(a, n.domElement) : s.current;
|
|
2127
2127
|
if (!p || !c) return i ? null : [];
|
|
2128
2128
|
let m = d ? f() : [], h = Array.isArray(c) ? c : [c];
|
|
2129
2129
|
t.updateMatrixWorld(), e.current?.updateMatrixWorld(!0), u.current.copy(p), r.setFromCamera(u.current, t);
|
|
2130
|
-
let g = r.intersectObjects(h, l).filter((e) =>
|
|
2130
|
+
let g = r.intersectObjects(h, l).filter((e) => Rn(e.object) ? m.length ? Ln(e.point, m) : !0 : !1).filter((e) => o ? o(e) : !0);
|
|
2131
2131
|
return i ? g[0] ?? null : g;
|
|
2132
2132
|
}, [
|
|
2133
2133
|
t,
|
|
@@ -2148,8 +2148,8 @@ function Ln(e) {
|
|
|
2148
2148
|
}
|
|
2149
2149
|
//#endregion
|
|
2150
2150
|
//#region src/viewer/Selector/SelectionBox.ts
|
|
2151
|
-
var
|
|
2152
|
-
function
|
|
2151
|
+
var Bn = new P(), Vn = new P(), W = new N(), Hn = new P(), Un = new P(), Wn = new P(), Gn = new P(), Kn = new P(), qn = new P(), Jn = new P();
|
|
2152
|
+
function Yn(e) {
|
|
2153
2153
|
let t = e;
|
|
2154
2154
|
for (; t;) {
|
|
2155
2155
|
let e = t.modelID ?? t.userData.modelID;
|
|
@@ -2158,7 +2158,7 @@ function qn(e) {
|
|
|
2158
2158
|
}
|
|
2159
2159
|
return 0;
|
|
2160
2160
|
}
|
|
2161
|
-
function
|
|
2161
|
+
function Xn(e) {
|
|
2162
2162
|
let t = e;
|
|
2163
2163
|
for (; t;) {
|
|
2164
2164
|
if (!t.visible) return !1;
|
|
@@ -2166,16 +2166,16 @@ function Jn(e) {
|
|
|
2166
2166
|
}
|
|
2167
2167
|
return !0;
|
|
2168
2168
|
}
|
|
2169
|
-
function
|
|
2170
|
-
return n.length ? (
|
|
2169
|
+
function Zn(e, t, n) {
|
|
2170
|
+
return n.length ? (Hn.copy(t).applyMatrix4(e.matrixWorld), Ln(Hn, n)) : !0;
|
|
2171
2171
|
}
|
|
2172
|
-
function
|
|
2173
|
-
return i.length ? (
|
|
2174
|
-
let t = e.distanceToPoint(
|
|
2172
|
+
function Qn(e, t, n, r, i) {
|
|
2173
|
+
return i.length ? (Un.copy(t).applyMatrix4(e.matrixWorld), Wn.copy(n).applyMatrix4(e.matrixWorld), Gn.copy(r).applyMatrix4(e.matrixWorld), i.every((e) => {
|
|
2174
|
+
let t = e.distanceToPoint(Un), n = e.distanceToPoint(Wn), r = e.distanceToPoint(Gn);
|
|
2175
2175
|
return !(t < -1e-6 && n < -1e-6 && r < -1e-6);
|
|
2176
2176
|
})) : !0;
|
|
2177
2177
|
}
|
|
2178
|
-
function
|
|
2178
|
+
function $n(e) {
|
|
2179
2179
|
let t = e.getBoundingClientRect();
|
|
2180
2180
|
return {
|
|
2181
2181
|
height: t.height,
|
|
@@ -2184,7 +2184,7 @@ function Zn(e) {
|
|
|
2184
2184
|
width: t.width
|
|
2185
2185
|
};
|
|
2186
2186
|
}
|
|
2187
|
-
function
|
|
2187
|
+
function er(e) {
|
|
2188
2188
|
return {
|
|
2189
2189
|
boundsCheckMs: 0,
|
|
2190
2190
|
candidateIds: 0,
|
|
@@ -2210,7 +2210,7 @@ function Qn(e) {
|
|
|
2210
2210
|
triangleProjectionMs: 0
|
|
2211
2211
|
};
|
|
2212
2212
|
}
|
|
2213
|
-
function
|
|
2213
|
+
function tr(e, t) {
|
|
2214
2214
|
return {
|
|
2215
2215
|
minX: Math.min(e.x, t.x),
|
|
2216
2216
|
minY: Math.min(e.y, t.y),
|
|
@@ -2218,43 +2218,43 @@ function $n(e, t) {
|
|
|
2218
2218
|
maxY: Math.max(e.y, t.y)
|
|
2219
2219
|
};
|
|
2220
2220
|
}
|
|
2221
|
-
function
|
|
2221
|
+
function nr(e, t) {
|
|
2222
2222
|
return t.x >= e.x ? "contains" : "intersects";
|
|
2223
2223
|
}
|
|
2224
|
-
function
|
|
2225
|
-
return
|
|
2224
|
+
function rr(e, t) {
|
|
2225
|
+
return ir(e.x, e.y, t);
|
|
2226
2226
|
}
|
|
2227
|
-
function
|
|
2227
|
+
function ir(e, t, n) {
|
|
2228
2228
|
return e >= n.minX && e <= n.maxX && t >= n.minY && t <= n.maxY;
|
|
2229
2229
|
}
|
|
2230
|
-
function
|
|
2230
|
+
function ar(e, t, n, r, i, a) {
|
|
2231
2231
|
return (a - t) * (n - e) > (r - t) * (i - e);
|
|
2232
2232
|
}
|
|
2233
|
-
function
|
|
2234
|
-
return
|
|
2233
|
+
function or(e, t, n, r, i, a, o, s) {
|
|
2234
|
+
return ar(e, t, i, a, o, s) !== ar(n, r, i, a, o, s) && ar(e, t, n, r, i, a) !== ar(e, t, n, r, o, s);
|
|
2235
2235
|
}
|
|
2236
|
-
function
|
|
2236
|
+
function sr(e, t, n, r, i) {
|
|
2237
2237
|
let a = .5 * (-r.y * i.x + n.y * (-r.x + i.x) + n.x * (r.y - i.y) + r.x * i.y), o = a < 0 ? -1 : 1, s = (n.y * i.x - n.x * i.y + (i.y - n.y) * e + (n.x - i.x) * t) * o, c = (n.x * r.y - n.y * r.x + (n.y - r.y) * e + (r.x - n.x) * t) * o;
|
|
2238
2238
|
return s >= 0 && c >= 0 && s + c <= 2 * a * o;
|
|
2239
2239
|
}
|
|
2240
|
-
function
|
|
2241
|
-
return
|
|
2240
|
+
function cr(e, t, n, r) {
|
|
2241
|
+
return rr(e, r) || rr(t, r) || rr(n, r) || sr(r.minX, r.minY, e, t, n) || sr(r.maxX, r.minY, e, t, n) || sr(r.maxX, r.maxY, e, t, n) || sr(r.minX, r.maxY, e, t, n) ? !0 : lr(e, t, r) || lr(t, n, r) || lr(n, e, r);
|
|
2242
2242
|
}
|
|
2243
|
-
function
|
|
2244
|
-
return
|
|
2243
|
+
function lr(e, t, n) {
|
|
2244
|
+
return or(e.x, e.y, t.x, t.y, n.minX, n.minY, n.maxX, n.minY) || or(e.x, e.y, t.x, t.y, n.maxX, n.minY, n.maxX, n.maxY) || or(e.x, e.y, t.x, t.y, n.maxX, n.maxY, n.minX, n.maxY) || or(e.x, e.y, t.x, t.y, n.minX, n.maxY, n.minX, n.minY);
|
|
2245
2245
|
}
|
|
2246
|
-
function
|
|
2247
|
-
let a =
|
|
2246
|
+
function G(e, t, n, r, i = new N()) {
|
|
2247
|
+
let a = Bn.copy(t).applyMatrix4(e.matrixWorld).project(n);
|
|
2248
2248
|
return i.set((a.x + 1) / 2 * r.width + r.left, (-a.y + 1) / 2 * r.height + r.top);
|
|
2249
2249
|
}
|
|
2250
|
-
function
|
|
2250
|
+
function ur(e, t, n, r, i) {
|
|
2251
2251
|
let a = Infinity, o = -Infinity, s = Infinity, c = -Infinity, l = 0;
|
|
2252
|
-
for (let u = 0; u < 2; u++) for (let d = 0; d < 2; d++) for (let f = 0; f < 2; f++)
|
|
2253
|
-
return o < n.minX || a > n.maxX || c < n.minY || s > n.maxY ?
|
|
2252
|
+
for (let u = 0; u < 2; u++) for (let d = 0; d < 2; d++) for (let f = 0; f < 2; f++) Vn.set(u ? t.max.x : t.min.x, d ? t.max.y : t.min.y, f ? t.max.z : t.min.z), G(e, Vn, r, i, W), a = Math.min(a, W.x), o = Math.max(o, W.x), s = Math.min(s, W.y), c = Math.max(c, W.y), rr(W, n) && (l += 1);
|
|
2253
|
+
return o < n.minX || a > n.maxX || c < n.minY || s > n.maxY ? Ce : l === 8 ? be : xe;
|
|
2254
2254
|
}
|
|
2255
|
-
function
|
|
2255
|
+
function dr(e, t, n, r) {
|
|
2256
2256
|
let i = Infinity, a = -Infinity, o = Infinity, s = -Infinity;
|
|
2257
|
-
for (let c = 0; c < 2; c++) for (let l = 0; l < 2; l++) for (let u = 0; u < 2; u++)
|
|
2257
|
+
for (let c = 0; c < 2; c++) for (let l = 0; l < 2; l++) for (let u = 0; u < 2; u++) Vn.set(c ? t.max.x : t.min.x, l ? t.max.y : t.min.y, u ? t.max.z : t.min.z), G(e, Vn, n, r, W), i = Math.min(i, W.x), a = Math.max(a, W.x), o = Math.min(o, W.y), s = Math.max(s, W.y);
|
|
2258
2258
|
return {
|
|
2259
2259
|
minX: i,
|
|
2260
2260
|
minY: o,
|
|
@@ -2262,41 +2262,41 @@ function ur(e, t, n, r) {
|
|
|
2262
2262
|
maxY: s
|
|
2263
2263
|
};
|
|
2264
2264
|
}
|
|
2265
|
-
function
|
|
2265
|
+
function fr(e, t) {
|
|
2266
2266
|
return !(e.maxX < t.minX || e.minX > t.maxX || e.maxY < t.minY || e.minY > t.maxY);
|
|
2267
2267
|
}
|
|
2268
|
-
function
|
|
2268
|
+
function pr(e, t, n, r) {
|
|
2269
2269
|
e.geometry.boundingBox || e.geometry.computeBoundingBox();
|
|
2270
2270
|
let i = e.geometry.boundingBox;
|
|
2271
|
-
return i ? dr(
|
|
2271
|
+
return i ? fr(dr(e, i, n, r), t) : !0;
|
|
2272
2272
|
}
|
|
2273
|
-
function
|
|
2273
|
+
function mr(e, t, n) {
|
|
2274
2274
|
let r = e.get(t);
|
|
2275
2275
|
r || (r = /* @__PURE__ */ new Set(), e.set(t, r)), r.add(n);
|
|
2276
2276
|
}
|
|
2277
|
-
function
|
|
2277
|
+
function hr(e) {
|
|
2278
2278
|
let t = 0;
|
|
2279
2279
|
return e.forEach((e) => {
|
|
2280
2280
|
t += e.size;
|
|
2281
2281
|
}), t;
|
|
2282
2282
|
}
|
|
2283
|
-
function
|
|
2283
|
+
function gr(e, t, n, r = []) {
|
|
2284
2284
|
let i = e.geometry, a = i.index, o = i.attributes.ids, s = i.attributes.position;
|
|
2285
2285
|
if (!a || !o || !s) return;
|
|
2286
2286
|
let c = t * 3;
|
|
2287
|
-
r.length && (
|
|
2287
|
+
r.length && (Kn.fromBufferAttribute(s, a.getX(c)), qn.fromBufferAttribute(s, a.getX(c + 1)), Jn.fromBufferAttribute(s, a.getX(c + 2)), !Qn(e, Kn, qn, Jn, r)) || mr(n, Yn(e), o.getX(a.getX(c)));
|
|
2288
2288
|
}
|
|
2289
|
-
function
|
|
2290
|
-
let s = performance.now(), c = /* @__PURE__ */ new Map(), l = new
|
|
2289
|
+
function _r({ model: e, camera: t, viewport: n, rect: r, candidateIdsByModel: i, clippingPlanes: a, profile: o }) {
|
|
2290
|
+
let s = performance.now(), c = /* @__PURE__ */ new Map(), l = new P();
|
|
2291
2291
|
e.traverse((e) => {
|
|
2292
2292
|
let s = e;
|
|
2293
|
-
if (!s.isMesh || !
|
|
2293
|
+
if (!s.isMesh || !Xn(s)) return;
|
|
2294
2294
|
let u = s.geometry.attributes.ids, d = s.geometry.attributes.position;
|
|
2295
2295
|
if (!(!u || !d)) {
|
|
2296
2296
|
o && (o.containedVerticesVisited += u.count);
|
|
2297
2297
|
for (let e = 0; e < u.count; e++) {
|
|
2298
|
-
let f =
|
|
2299
|
-
if (!i.get(f)?.has(p) || (l.fromBufferAttribute(d, e), !
|
|
2298
|
+
let f = Yn(s), p = u.getX(e);
|
|
2299
|
+
if (!i.get(f)?.has(p) || (l.fromBufferAttribute(d, e), !Zn(s, l, a))) continue;
|
|
2300
2300
|
o && (o.containedCandidateVertices += 1);
|
|
2301
2301
|
let m = `${f}:${p}`, h = c.get(m);
|
|
2302
2302
|
h || (h = {
|
|
@@ -2304,23 +2304,23 @@ function gr({ model: e, camera: t, viewport: n, rect: r, candidateIdsByModel: i,
|
|
|
2304
2304
|
inside: 0,
|
|
2305
2305
|
modelID: f,
|
|
2306
2306
|
total: 0
|
|
2307
|
-
}, c.set(m, h)), h.total += 1,
|
|
2307
|
+
}, c.set(m, h)), h.total += 1, rr(G(s, l, t, n), r) && (h.inside += 1);
|
|
2308
2308
|
}
|
|
2309
2309
|
}
|
|
2310
2310
|
});
|
|
2311
2311
|
let u = /* @__PURE__ */ new Map();
|
|
2312
2312
|
return c.forEach((e) => {
|
|
2313
|
-
e.total > 0 && e.total === e.inside &&
|
|
2313
|
+
e.total > 0 && e.total === e.inside && mr(u, e.modelID, e.id);
|
|
2314
2314
|
}), o && (o.containedIdsMs += performance.now() - s), u;
|
|
2315
2315
|
}
|
|
2316
|
-
function
|
|
2316
|
+
function vr({ model: e, camera: t, clippingPlanes: n = [], domElement: r, rect: i, mode: a, profile: o }) {
|
|
2317
2317
|
let s = performance.now(), c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map();
|
|
2318
2318
|
if (!e) return c;
|
|
2319
|
-
let u =
|
|
2319
|
+
let u = $n(r), d = performance.now();
|
|
2320
2320
|
e.updateMatrixWorld(!0), t.updateMatrixWorld(), o && (o.matrixUpdateMs += performance.now() - d), e.traverse((e) => {
|
|
2321
2321
|
let r = e;
|
|
2322
2322
|
if (!r.isMesh) return;
|
|
2323
|
-
if (o && (o.meshCount += 1), !
|
|
2323
|
+
if (o && (o.meshCount += 1), !Xn(r)) {
|
|
2324
2324
|
o && (o.skippedMeshCount += 1);
|
|
2325
2325
|
return;
|
|
2326
2326
|
}
|
|
@@ -2329,7 +2329,7 @@ function _r({ model: e, camera: t, clippingPlanes: n = [], domElement: r, rect:
|
|
|
2329
2329
|
o && (o.skippedMeshCount += 1);
|
|
2330
2330
|
return;
|
|
2331
2331
|
}
|
|
2332
|
-
let d = performance.now(), f =
|
|
2332
|
+
let d = performance.now(), f = pr(r, i, t, u);
|
|
2333
2333
|
if (o && (o.boundsCheckMs += performance.now() - d), !f) {
|
|
2334
2334
|
o && (o.skippedMeshCount += 1);
|
|
2335
2335
|
return;
|
|
@@ -2337,26 +2337,26 @@ function _r({ model: e, camera: t, clippingPlanes: n = [], domElement: r, rect:
|
|
|
2337
2337
|
let p = performance.now();
|
|
2338
2338
|
s.shapecast({
|
|
2339
2339
|
intersectsBounds: (e) => {
|
|
2340
|
-
let n = performance.now(), a =
|
|
2340
|
+
let n = performance.now(), a = ur(r, e, i, t, u);
|
|
2341
2341
|
return o && (o.intersectsBoundsCalls += 1, o.intersectsBoundsMs += performance.now() - n), a;
|
|
2342
2342
|
},
|
|
2343
2343
|
intersectsRange: (e, t, i) => {
|
|
2344
2344
|
let u = performance.now();
|
|
2345
2345
|
if (o && (o.intersectsRangeCalls += 1), !i) return o && (o.intersectsRangeMs += performance.now() - u), !1;
|
|
2346
|
-
for (let i = e; i < e + t; i++)
|
|
2346
|
+
for (let i = e; i < e + t; i++) gr(r, s.resolveTriangleIndex(i), a === "contains" ? l : c, n);
|
|
2347
2347
|
return o && (o.intersectsRangeMs += performance.now() - u), !1;
|
|
2348
2348
|
},
|
|
2349
2349
|
intersectsTriangle: (e, s, d) => {
|
|
2350
2350
|
let f = performance.now();
|
|
2351
2351
|
if (o && (o.intersectsTriangleCalls += 1), !d) {
|
|
2352
|
-
let n = performance.now(), a =
|
|
2353
|
-
if (o && (o.triangleProjectionMs += performance.now() - n), !
|
|
2352
|
+
let n = performance.now(), a = G(r, e.a, t, u), s = G(r, e.b, t, u), c = G(r, e.c, t, u);
|
|
2353
|
+
if (o && (o.triangleProjectionMs += performance.now() - n), !cr(a, s, c, i)) return o && (o.intersectsTriangleMs += performance.now() - f), !1;
|
|
2354
2354
|
}
|
|
2355
|
-
return a === "contains" ?
|
|
2355
|
+
return a === "contains" ? gr(r, s, l, n) : gr(r, s, c, n), o && (o.intersectsTriangleMs += performance.now() - f), !1;
|
|
2356
2356
|
}
|
|
2357
2357
|
}), o && (o.shapecastMs += performance.now() - p);
|
|
2358
2358
|
});
|
|
2359
|
-
let f = a === "contains" ?
|
|
2359
|
+
let f = a === "contains" ? _r({
|
|
2360
2360
|
model: e,
|
|
2361
2361
|
camera: t,
|
|
2362
2362
|
clippingPlanes: n,
|
|
@@ -2365,19 +2365,19 @@ function _r({ model: e, camera: t, clippingPlanes: n = [], domElement: r, rect:
|
|
|
2365
2365
|
candidateIdsByModel: l,
|
|
2366
2366
|
profile: o
|
|
2367
2367
|
}) : c;
|
|
2368
|
-
return o && (o.candidateIds =
|
|
2368
|
+
return o && (o.candidateIds = hr(l), o.selectedIds = hr(f), o.totalMs = performance.now() - s), f;
|
|
2369
2369
|
}
|
|
2370
|
-
function
|
|
2371
|
-
let t =
|
|
2370
|
+
function yr(e) {
|
|
2371
|
+
let t = er(e.mode);
|
|
2372
2372
|
return {
|
|
2373
|
-
ids:
|
|
2373
|
+
ids: vr({
|
|
2374
2374
|
...e,
|
|
2375
2375
|
profile: t
|
|
2376
2376
|
}),
|
|
2377
2377
|
profile: t
|
|
2378
2378
|
};
|
|
2379
2379
|
}
|
|
2380
|
-
function
|
|
2380
|
+
function br(e) {
|
|
2381
2381
|
return e === "contains" ? {
|
|
2382
2382
|
border: "rgb(37, 99, 235)",
|
|
2383
2383
|
background: "rgba(37, 99, 235, 0.16)"
|
|
@@ -2386,32 +2386,32 @@ function yr(e) {
|
|
|
2386
2386
|
background: "rgba(22, 163, 74, 0.16)"
|
|
2387
2387
|
};
|
|
2388
2388
|
}
|
|
2389
|
-
function
|
|
2390
|
-
let r =
|
|
2389
|
+
function xr(e, t, n) {
|
|
2390
|
+
let r = br(nr(t, n));
|
|
2391
2391
|
if (!e.current) {
|
|
2392
2392
|
let t = document.createElement("div");
|
|
2393
2393
|
t.style.position = "fixed", t.style.pointerEvents = "none", t.style.zIndex = "10", e.current = t, document.body.appendChild(t);
|
|
2394
2394
|
}
|
|
2395
|
-
let i =
|
|
2395
|
+
let i = tr(t, n);
|
|
2396
2396
|
e.current.style.border = `1px solid ${r.border}`, e.current.style.background = r.background, e.current.style.left = `${i.minX}px`, e.current.style.top = `${i.minY}px`, e.current.style.width = `${i.maxX - i.minX}px`, e.current.style.height = `${i.maxY - i.minY}px`;
|
|
2397
2397
|
}
|
|
2398
|
-
function
|
|
2398
|
+
function Sr(e) {
|
|
2399
2399
|
e.current?.remove(), e.current = null;
|
|
2400
2400
|
}
|
|
2401
2401
|
//#endregion
|
|
2402
2402
|
//#region src/viewer/Selector/useSelector.tsx
|
|
2403
|
-
var
|
|
2404
|
-
function
|
|
2403
|
+
var Cr = 40;
|
|
2404
|
+
function wr(e) {
|
|
2405
2405
|
if (!Array.isArray(e)) return e.userData.shader;
|
|
2406
2406
|
}
|
|
2407
|
-
function
|
|
2408
|
-
let n =
|
|
2407
|
+
function Tr(e, t) {
|
|
2408
|
+
let n = wr(e)?.uniforms.preSelectionId;
|
|
2409
2409
|
n && (n.value = t);
|
|
2410
2410
|
}
|
|
2411
|
-
function
|
|
2411
|
+
function Er(e) {
|
|
2412
2412
|
return Number(e.current?.modelID ?? 0);
|
|
2413
2413
|
}
|
|
2414
|
-
function
|
|
2414
|
+
function Dr(e) {
|
|
2415
2415
|
let t = e;
|
|
2416
2416
|
for (; t;) {
|
|
2417
2417
|
let e = t.modelID ?? t.userData.modelID;
|
|
@@ -2420,7 +2420,7 @@ function Er(e) {
|
|
|
2420
2420
|
}
|
|
2421
2421
|
return 0;
|
|
2422
2422
|
}
|
|
2423
|
-
function
|
|
2423
|
+
function Or(e) {
|
|
2424
2424
|
let t = e;
|
|
2425
2425
|
for (; t;) {
|
|
2426
2426
|
if (!t.visible) return !1;
|
|
@@ -2428,20 +2428,20 @@ function Dr(e) {
|
|
|
2428
2428
|
}
|
|
2429
2429
|
return !0;
|
|
2430
2430
|
}
|
|
2431
|
-
function
|
|
2432
|
-
if (!
|
|
2431
|
+
function kr(e) {
|
|
2432
|
+
if (!Or(e.object) || !(e.object instanceof M) || e.faceIndex === void 0 || e.faceIndex === null) return !1;
|
|
2433
2433
|
let t = e.object.geometry;
|
|
2434
2434
|
return !!(t.index && t.attributes.ids);
|
|
2435
2435
|
}
|
|
2436
|
-
function
|
|
2437
|
-
let r = l("end"), i =
|
|
2436
|
+
function Ar(e, t, n) {
|
|
2437
|
+
let r = l("end"), i = L((e) => e.selected), a = L((e) => e.setSelected), s = L((e) => e.addSelected), c = L((e) => e.removeSelected), u = L((e) => e.showStats), d = R(), f = l(null), m = l(null), h = l(!1), g = l(!1), _ = l("add"), v = l(null), y = l(!1), b = l(0), x = l(null), S = l(null), C = () => d.getState().selectionInteractionDisabled, w = () => {
|
|
2438
2438
|
e.current?.traverse((e) => {
|
|
2439
|
-
if (!(e instanceof
|
|
2439
|
+
if (!(e instanceof M)) return;
|
|
2440
2440
|
let t = e;
|
|
2441
|
-
t.preselected = !1,
|
|
2441
|
+
t.preselected = !1, Tr(t.material, -1);
|
|
2442
2442
|
});
|
|
2443
2443
|
}, T = () => {
|
|
2444
|
-
f.current = null, h.current = !1,
|
|
2444
|
+
f.current = null, h.current = !1, Sr(m), t.current && (t.current.enabled = !0);
|
|
2445
2445
|
}, E = (t) => {
|
|
2446
2446
|
if (C()) {
|
|
2447
2447
|
w();
|
|
@@ -2455,47 +2455,47 @@ function kr(e, t, n) {
|
|
|
2455
2455
|
w();
|
|
2456
2456
|
return;
|
|
2457
2457
|
}
|
|
2458
|
-
let n =
|
|
2458
|
+
let n = oe(t, e.current)[0], i;
|
|
2459
2459
|
n && (i = n.object), w(), !(!n || !i) && e.current?.traverse((e) => {
|
|
2460
|
-
if (!(e instanceof
|
|
2460
|
+
if (!(e instanceof M)) return;
|
|
2461
2461
|
let t = e;
|
|
2462
2462
|
if (t !== i) return;
|
|
2463
2463
|
let r = n.faceIndex * 3, a = t.geometry.index.getX(r), o = t.geometry.attributes.ids.getX(a);
|
|
2464
|
-
t.preselected = !0,
|
|
2464
|
+
t.preselected = !0, Tr(t.material, o);
|
|
2465
2465
|
});
|
|
2466
2466
|
};
|
|
2467
2467
|
function D() {
|
|
2468
2468
|
return performance.now();
|
|
2469
2469
|
}
|
|
2470
|
-
let
|
|
2470
|
+
let ee = (e) => {
|
|
2471
2471
|
if (C()) {
|
|
2472
2472
|
S.current = null, x.current !== null && (window.clearTimeout(x.current), x.current = null), w();
|
|
2473
2473
|
return;
|
|
2474
2474
|
}
|
|
2475
2475
|
if (S.current = e, x.current !== null) return;
|
|
2476
|
-
let t = D() - b.current, n = Math.max(0,
|
|
2476
|
+
let t = D() - b.current, n = Math.max(0, Cr - t);
|
|
2477
2477
|
x.current = window.setTimeout(() => {
|
|
2478
2478
|
x.current = null;
|
|
2479
2479
|
let e = S.current;
|
|
2480
2480
|
S.current = null, e && (b.current = performance.now(), E(e));
|
|
2481
2481
|
}, n);
|
|
2482
|
-
},
|
|
2482
|
+
}, O = l(null);
|
|
2483
2483
|
o(() => {
|
|
2484
2484
|
let e = v.current;
|
|
2485
2485
|
if (e) {
|
|
2486
|
-
u &&
|
|
2486
|
+
u && O.current !== null && console.log(`selection ${e.action}:`, Date.now() - O.current, "ms"), v.current = null, O.current = null;
|
|
2487
2487
|
return;
|
|
2488
2488
|
}
|
|
2489
|
-
u &&
|
|
2489
|
+
u && O.current !== null && (console.log("selection spend:", Date.now() - O.current, "ms"), O.current = null);
|
|
2490
2490
|
}, [i, u]);
|
|
2491
|
-
let { camera:
|
|
2492
|
-
function
|
|
2491
|
+
let { camera: te, gl: k } = p();
|
|
2492
|
+
function ne() {
|
|
2493
2493
|
return Date.now();
|
|
2494
2494
|
}
|
|
2495
|
-
let
|
|
2496
|
-
let t =
|
|
2495
|
+
let A = (e) => {
|
|
2496
|
+
let t = k.domElement.getBoundingClientRect();
|
|
2497
2497
|
return e.clientX >= t.left && e.clientX <= t.right && e.clientY >= t.top && e.clientY <= t.bottom;
|
|
2498
|
-
},
|
|
2498
|
+
}, re = (t) => {
|
|
2499
2499
|
if (C()) {
|
|
2500
2500
|
y.current = !1, g.current = !1, w();
|
|
2501
2501
|
return;
|
|
@@ -2505,15 +2505,15 @@ function kr(e, t, n) {
|
|
|
2505
2505
|
g.current = !1;
|
|
2506
2506
|
return;
|
|
2507
2507
|
}
|
|
2508
|
-
if (!
|
|
2509
|
-
if (
|
|
2508
|
+
if (!A(t)) return;
|
|
2509
|
+
if (O.current = ne(), r.current !== "end" && r.current !== "start" && r.current > 15) {
|
|
2510
2510
|
r.current = "end";
|
|
2511
2511
|
return;
|
|
2512
2512
|
}
|
|
2513
|
-
let n = t.shiftKey, o = t.ctrlKey, l =
|
|
2513
|
+
let n = t.shiftKey, o = t.ctrlKey, l = oe(t, e.current), u, d = Er(e);
|
|
2514
2514
|
if (l.length) {
|
|
2515
2515
|
let e = l[0], t = e.object;
|
|
2516
|
-
d =
|
|
2516
|
+
d = Dr(t);
|
|
2517
2517
|
let n = e.faceIndex * 3, r = t.geometry.index.getX(n);
|
|
2518
2518
|
u = t.geometry.attributes.ids.getX(r);
|
|
2519
2519
|
}
|
|
@@ -2525,33 +2525,33 @@ function kr(e, t, n) {
|
|
|
2525
2525
|
return;
|
|
2526
2526
|
}
|
|
2527
2527
|
a(d, u === void 0 ? [] : [u], !0);
|
|
2528
|
-
},
|
|
2529
|
-
C() || e.button !== 0 || !e.shiftKey && !e.ctrlKey || (f.current = new
|
|
2530
|
-
},
|
|
2528
|
+
}, j = (e) => {
|
|
2529
|
+
C() || e.button !== 0 || !e.shiftKey && !e.ctrlKey || (f.current = new N(e.clientX, e.clientY), _.current = e.ctrlKey ? "remove" : "add", h.current = !1, t.current && (t.current.enabled = !1));
|
|
2530
|
+
}, ie = (e) => {
|
|
2531
2531
|
if (C()) {
|
|
2532
2532
|
T();
|
|
2533
2533
|
return;
|
|
2534
2534
|
}
|
|
2535
2535
|
if (!f.current) return;
|
|
2536
|
-
let t = new
|
|
2537
|
-
n < 6 && r < 6 || (h.current ||= !0, e.preventDefault(),
|
|
2538
|
-
},
|
|
2536
|
+
let t = new N(e.clientX, e.clientY), n = Math.abs(t.x - f.current.x), r = Math.abs(t.y - f.current.y);
|
|
2537
|
+
n < 6 && r < 6 || (h.current ||= !0, e.preventDefault(), xr(m, f.current, t));
|
|
2538
|
+
}, ae = (r) => {
|
|
2539
2539
|
if (C()) {
|
|
2540
2540
|
T();
|
|
2541
2541
|
return;
|
|
2542
2542
|
}
|
|
2543
2543
|
if (!f.current) return;
|
|
2544
|
-
|
|
2545
|
-
let i = h.current, a = new
|
|
2546
|
-
if (f.current = null, h.current = !1,
|
|
2544
|
+
O.current = ne();
|
|
2545
|
+
let i = h.current, a = new N(r.clientX, r.clientY), o = tr(f.current, a), l = nr(f.current, a);
|
|
2546
|
+
if (f.current = null, h.current = !1, Sr(m), t.current && setTimeout(() => {
|
|
2547
2547
|
t.current && (t.current.enabled = !0);
|
|
2548
2548
|
}, 100), !i) return;
|
|
2549
2549
|
g.current = !0, r.preventDefault();
|
|
2550
|
-
let { ids: u, profile: d } =
|
|
2550
|
+
let { ids: u, profile: d } = yr({
|
|
2551
2551
|
model: e.current,
|
|
2552
|
-
camera:
|
|
2552
|
+
camera: te,
|
|
2553
2553
|
clippingPlanes: n.getActiveClippingPlanes(),
|
|
2554
|
-
domElement:
|
|
2554
|
+
domElement: k.domElement,
|
|
2555
2555
|
rect: o,
|
|
2556
2556
|
mode: l
|
|
2557
2557
|
}), p = Array.from(u.values()).reduce((e, t) => e + t.size, 0), y = {
|
|
@@ -2563,16 +2563,16 @@ function kr(e, t, n) {
|
|
|
2563
2563
|
let n = Array.from(e);
|
|
2564
2564
|
_.current === "remove" ? c(t, n) : s(t, n);
|
|
2565
2565
|
}));
|
|
2566
|
-
},
|
|
2566
|
+
}, oe = (e, t) => t ? n.getIntersection(!1, {
|
|
2567
2567
|
event: e,
|
|
2568
|
-
filter:
|
|
2568
|
+
filter: kr,
|
|
2569
2569
|
object: t,
|
|
2570
2570
|
recursive: !0
|
|
2571
2571
|
}) : [];
|
|
2572
2572
|
o(() => {
|
|
2573
2573
|
let e = t.current;
|
|
2574
2574
|
if (!e) return;
|
|
2575
|
-
|
|
2575
|
+
k.domElement.addEventListener("pointerdown", j), k.domElement.addEventListener("pointermove", ie), window.addEventListener("pointerup", ae), window.addEventListener("pointerup", re), k.domElement.addEventListener("contextmenu", o), k.domElement.addEventListener("pointerup", a), k.domElement.addEventListener("pointermove", ee), k.domElement.addEventListener("pointerleave", w), k.domElement.addEventListener("pointerdown", i), e.addEventListener("change", n);
|
|
2576
2576
|
function n() {
|
|
2577
2577
|
typeof r.current == "number" ? r.current += 1 : r.current === "start" && (r.current = 1);
|
|
2578
2578
|
}
|
|
@@ -2588,35 +2588,35 @@ function kr(e, t, n) {
|
|
|
2588
2588
|
e.ctrlKey && e.preventDefault();
|
|
2589
2589
|
}
|
|
2590
2590
|
return () => {
|
|
2591
|
-
|
|
2591
|
+
Sr(m), x.current !== null && (window.clearTimeout(x.current), x.current = null), S.current = null, w(), e.removeEventListener("change", n), k.domElement.removeEventListener("pointerdown", j), k.domElement.removeEventListener("pointermove", ie), window.removeEventListener("pointerup", ae), window.removeEventListener("pointerup", re), k.domElement.removeEventListener("contextmenu", o), k.domElement.removeEventListener("pointerup", a), k.domElement.removeEventListener("pointerdown", i), k.domElement.removeEventListener("pointermove", ee), k.domElement.removeEventListener("pointerleave", w);
|
|
2592
2592
|
};
|
|
2593
2593
|
});
|
|
2594
2594
|
}
|
|
2595
2595
|
//#endregion
|
|
2596
2596
|
//#region src/viewer/Camera/useCameraFit.tsx
|
|
2597
|
-
var
|
|
2598
|
-
function
|
|
2597
|
+
var jr = new P(1, 1, 1).normalize(), Mr = 1.18;
|
|
2598
|
+
function Nr() {
|
|
2599
2599
|
let { camera: e } = p();
|
|
2600
2600
|
return i((t, n, r) => {
|
|
2601
|
-
if (!t.current || !(e instanceof
|
|
2601
|
+
if (!t.current || !(e instanceof le)) return;
|
|
2602
2602
|
let i = new g().setFromObject(t.current);
|
|
2603
2603
|
if (i.isEmpty()) return;
|
|
2604
|
-
let a = i.getCenter(new
|
|
2605
|
-
e.position.copy(a).addScaledVector(
|
|
2604
|
+
let a = i.getCenter(new P()), o = i.getBoundingSphere(new pe()), s = re.degToRad(e.fov), c = 2 * Math.atan(Math.tan(s / 2) * e.aspect), l = Math.min(s, c), u = o.radius / Math.sin(l / 2) * Mr;
|
|
2605
|
+
e.position.copy(a).addScaledVector(jr, u), e.up.set(0, 1, 0), e.lookAt(a), e.updateProjectionMatrix(), n.current && (n.current.target.copy(a), n.current.update()), r.current && (r.current.position.copy(a).addScaledVector(jr, u * .8), r.current.lookAt(a));
|
|
2606
2606
|
}, [e]);
|
|
2607
2607
|
}
|
|
2608
2608
|
//#endregion
|
|
2609
2609
|
//#region src/viewer/store/ViewerStoreProvider.tsx
|
|
2610
|
-
function
|
|
2611
|
-
let [n] = u(() => t ??
|
|
2612
|
-
return /* @__PURE__ */
|
|
2610
|
+
function Pr({ children: e, store: t }) {
|
|
2611
|
+
let [n] = u(() => t ?? je());
|
|
2612
|
+
return /* @__PURE__ */ F(De.Provider, {
|
|
2613
2613
|
value: n,
|
|
2614
2614
|
children: e
|
|
2615
2615
|
});
|
|
2616
2616
|
}
|
|
2617
2617
|
//#endregion
|
|
2618
2618
|
//#region src/viewer/utils/ExportUtils/ExportUtils.ts
|
|
2619
|
-
var
|
|
2619
|
+
var K = new TextEncoder(), Fr = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>", Ir = "Unknown", Lr = ["elementID", "ifcguid"], Rr = 0, zr = 33;
|
|
2620
2620
|
function Br(e) {
|
|
2621
2621
|
return !!e && typeof e == "object" && !Array.isArray(e);
|
|
2622
2622
|
}
|
|
@@ -2840,7 +2840,7 @@ function gi(e) {
|
|
|
2840
2840
|
let n = {
|
|
2841
2841
|
...e,
|
|
2842
2842
|
crc: di(e.data),
|
|
2843
|
-
nameBytes:
|
|
2843
|
+
nameBytes: K.encode(e.path),
|
|
2844
2844
|
offset: t
|
|
2845
2845
|
};
|
|
2846
2846
|
return t += 30 + n.nameBytes.length + n.data.length, n;
|
|
@@ -2877,23 +2877,23 @@ function vi(e, t = {}) {
|
|
|
2877
2877
|
let n = _i(e, t.emptyValue ?? "-"), r = n.map((e) => e.name), i = [
|
|
2878
2878
|
{
|
|
2879
2879
|
path: "[Content_Types].xml",
|
|
2880
|
-
data:
|
|
2880
|
+
data: K.encode(ci(r))
|
|
2881
2881
|
},
|
|
2882
2882
|
{
|
|
2883
2883
|
path: "_rels/.rels",
|
|
2884
|
-
data:
|
|
2884
|
+
data: K.encode(si())
|
|
2885
2885
|
},
|
|
2886
2886
|
{
|
|
2887
2887
|
path: "xl/workbook.xml",
|
|
2888
|
-
data:
|
|
2888
|
+
data: K.encode(ai(r))
|
|
2889
2889
|
},
|
|
2890
2890
|
{
|
|
2891
2891
|
path: "xl/_rels/workbook.xml.rels",
|
|
2892
|
-
data:
|
|
2892
|
+
data: K.encode(oi(r))
|
|
2893
2893
|
},
|
|
2894
2894
|
...n.map((e, t) => ({
|
|
2895
2895
|
path: `xl/worksheets/sheet${t + 1}.xml`,
|
|
2896
|
-
data:
|
|
2896
|
+
data: K.encode(ni(e.rows))
|
|
2897
2897
|
}))
|
|
2898
2898
|
];
|
|
2899
2899
|
return new Blob([gi(i)], { type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" });
|
|
@@ -3227,7 +3227,7 @@ var wi = "BMT", Ti = 1, J = {
|
|
|
3227
3227
|
let t = /* @__PURE__ */ new Map();
|
|
3228
3228
|
return (Array.isArray(e) ? e : [e]).forEach((e) => {
|
|
3229
3229
|
e.traverse((e) => {
|
|
3230
|
-
if (!(e instanceof
|
|
3230
|
+
if (!(e instanceof M) || !this.isIfcSpaceObject(e)) return;
|
|
3231
3231
|
let n = this.getObjectModelID(e);
|
|
3232
3232
|
if (n === null) return;
|
|
3233
3233
|
let r = e.geometry.getAttribute("ids");
|
|
@@ -3241,7 +3241,7 @@ var wi = "BMT", Ti = 1, J = {
|
|
|
3241
3241
|
addVisibleIdsFromObject3D(e, t) {
|
|
3242
3242
|
(Array.isArray(e) ? e : [e]).forEach((e) => {
|
|
3243
3243
|
e.traverse((e) => {
|
|
3244
|
-
if (!(e instanceof
|
|
3244
|
+
if (!(e instanceof M) || !this.isObjectVisible(e)) return;
|
|
3245
3245
|
let n = this.getObjectModelID(e);
|
|
3246
3246
|
if (n === null) return;
|
|
3247
3247
|
let r = e.geometry.getAttribute("ids");
|
|
@@ -3293,7 +3293,7 @@ var wi = "BMT", Ti = 1, J = {
|
|
|
3293
3293
|
return this.deflateBytes(new Uint8Array(e.buffer, e.byteOffset, e.byteLength));
|
|
3294
3294
|
}
|
|
3295
3295
|
deflateBytes(e) {
|
|
3296
|
-
return
|
|
3296
|
+
return Ee.deflate(e);
|
|
3297
3297
|
}
|
|
3298
3298
|
encodeText(e) {
|
|
3299
3299
|
return this.textEncoder.encode(e);
|
|
@@ -3671,9 +3671,9 @@ var qi = class {
|
|
|
3671
3671
|
}
|
|
3672
3672
|
}, Ji = class {
|
|
3673
3673
|
decodeBuffer(e) {
|
|
3674
|
-
return this.textDecoder.decode(
|
|
3674
|
+
return this.textDecoder.decode(Ee.inflate(e));
|
|
3675
3675
|
}
|
|
3676
|
-
decoder =
|
|
3676
|
+
decoder = Ee;
|
|
3677
3677
|
textDecoder = new TextDecoder("utf-8");
|
|
3678
3678
|
ChunkType = {
|
|
3679
3679
|
PROP: 1,
|
|
@@ -3923,17 +3923,20 @@ function ca(e) {
|
|
|
3923
3923
|
function la(e) {
|
|
3924
3924
|
return e.split(/[?#]/)[0].split(/[\\/]/).pop() || "model.ifc";
|
|
3925
3925
|
}
|
|
3926
|
-
function ua(
|
|
3927
|
-
|
|
3928
|
-
return /^(https?:|blob:|data:)/i.test(t) ? t : new URL(t, globalThis.location.href).href;
|
|
3926
|
+
function ua() {
|
|
3927
|
+
return globalThis.document?.baseURI ?? globalThis.location.href;
|
|
3929
3928
|
}
|
|
3930
3929
|
function da(e) {
|
|
3930
|
+
let t = e ?? "ifc-parser.wasm";
|
|
3931
|
+
return /^(https?:|blob:|data:)/i.test(t) ? t : new URL(t, ua()).href;
|
|
3932
|
+
}
|
|
3933
|
+
function fa(e) {
|
|
3931
3934
|
return e.map((e) => e.kind === "buffer" ? e.buffer : null).filter((e) => e instanceof ArrayBuffer);
|
|
3932
3935
|
}
|
|
3933
|
-
function
|
|
3936
|
+
function pa() {
|
|
3934
3937
|
return new aa();
|
|
3935
3938
|
}
|
|
3936
|
-
function
|
|
3939
|
+
function ma(e) {
|
|
3937
3940
|
return {
|
|
3938
3941
|
chunk: e.chunk,
|
|
3939
3942
|
coordinationMatrix: e.coordinationMatrix,
|
|
@@ -3942,12 +3945,12 @@ function pa(e) {
|
|
|
3942
3945
|
useIfcColors: e.useIfcColors,
|
|
3943
3946
|
useIfcElementAssembly: e.useIfcElementAssembly,
|
|
3944
3947
|
useIfcSpace: e.useIfcSpace,
|
|
3945
|
-
wasmPath:
|
|
3948
|
+
wasmPath: da(e.wasmPath)
|
|
3946
3949
|
};
|
|
3947
3950
|
}
|
|
3948
|
-
function
|
|
3949
|
-
let n = t.worker ??
|
|
3950
|
-
options:
|
|
3951
|
+
function ha(e, t = {}) {
|
|
3952
|
+
let n = t.worker ?? pa(), r = t.terminateOnComplete ?? !t.worker, i = t.collectChunks ?? !0, a = sa(e).map(ca), o = oa(), s = {}, c = {
|
|
3953
|
+
options: ma(t),
|
|
3951
3954
|
sources: a,
|
|
3952
3955
|
taskId: o,
|
|
3953
3956
|
type: "load-ifc-model"
|
|
@@ -3985,34 +3988,34 @@ function ma(e, t = {}) {
|
|
|
3985
3988
|
let a = Error(r.error.message);
|
|
3986
3989
|
r.error.stack && (a.stack = r.error.stack), l(a);
|
|
3987
3990
|
};
|
|
3988
|
-
n.addEventListener("message", f), n.addEventListener("error", d), n.postMessage(c,
|
|
3991
|
+
n.addEventListener("message", f), n.addEventListener("error", d), n.postMessage(c, fa(a));
|
|
3989
3992
|
});
|
|
3990
3993
|
}
|
|
3991
|
-
function
|
|
3992
|
-
return
|
|
3994
|
+
function ga() {
|
|
3995
|
+
return pa();
|
|
3993
3996
|
}
|
|
3994
3997
|
//#endregion
|
|
3995
3998
|
//#region src/viewer/api/loader.ts
|
|
3996
|
-
function ga(e) {
|
|
3997
|
-
return typeof e == "string" ? e : e.name;
|
|
3998
|
-
}
|
|
3999
3999
|
function _a(e) {
|
|
4000
|
-
return
|
|
4000
|
+
return typeof e == "string" ? e : e.name;
|
|
4001
4001
|
}
|
|
4002
4002
|
function va(e) {
|
|
4003
|
-
|
|
4004
|
-
return n === -1 ? "" : t.slice(n + 1);
|
|
4003
|
+
return (_a(e).split(/[?#]/)[0].split(/[\\/]/).pop() || "model").replace(/\.min\.bmt$/i, "").replace(/\.[^.]+$/i, "") || "model";
|
|
4005
4004
|
}
|
|
4006
4005
|
function ya(e) {
|
|
4007
|
-
|
|
4006
|
+
let t = _a(e).split(/[?#]/)[0].toLowerCase(), n = t.lastIndexOf(".");
|
|
4007
|
+
return n === -1 ? "" : t.slice(n + 1);
|
|
4008
4008
|
}
|
|
4009
4009
|
function ba(e) {
|
|
4010
|
-
return
|
|
4010
|
+
return /\.min\.bmt$/i.test(e.name) ? e.name.replace(/\.min\.bmt$/i, "_props.json") : null;
|
|
4011
4011
|
}
|
|
4012
4012
|
function xa(e) {
|
|
4013
|
+
return /_props\.json$/i.test(_a(e).split(/[?#]/)[0]);
|
|
4014
|
+
}
|
|
4015
|
+
function Sa(e) {
|
|
4013
4016
|
return e.coordinationMatrix ? e.coordinationMatrix : Object.values(e.data)[0]?.matrix || void 0;
|
|
4014
4017
|
}
|
|
4015
|
-
var
|
|
4018
|
+
var Ca = new class {
|
|
4016
4019
|
coordinationMatrix;
|
|
4017
4020
|
useIfcSpace = !1;
|
|
4018
4021
|
bmtLoader = null;
|
|
@@ -4051,7 +4054,7 @@ var Sa = new class {
|
|
|
4051
4054
|
async loadBmtModel(e, t) {
|
|
4052
4055
|
let n = this.getBmtLoader();
|
|
4053
4056
|
if (typeof e == "string") return n.loadModel(e);
|
|
4054
|
-
let r = n.parseBinaryFile(await e.arrayBuffer()), i =
|
|
4057
|
+
let r = n.parseBinaryFile(await e.arrayBuffer()), i = ba(e), a = i ? t.get(i) : void 0;
|
|
4055
4058
|
return this.applyBmtMetadata(r, a);
|
|
4056
4059
|
}
|
|
4057
4060
|
createWorkerProgressHandler(e, t, n, r) {
|
|
@@ -4074,7 +4077,7 @@ var Sa = new class {
|
|
|
4074
4077
|
};
|
|
4075
4078
|
}
|
|
4076
4079
|
async loadIfcModelInWorker(e, t, n, r, i) {
|
|
4077
|
-
return (await
|
|
4080
|
+
return (await ha(e, {
|
|
4078
4081
|
chunk: t.chunk,
|
|
4079
4082
|
collectChunks: t.collectWorkerChunks,
|
|
4080
4083
|
coordinationMatrix: this.coordinationMatrix,
|
|
@@ -4094,7 +4097,7 @@ var Sa = new class {
|
|
|
4094
4097
|
streamGeometryChunks: n.streamGeometryChunks ?? !!n.onChunk
|
|
4095
4098
|
}))[0];
|
|
4096
4099
|
if (e instanceof File) {
|
|
4097
|
-
let n =
|
|
4100
|
+
let n = ba(e), r = n ? t.get(n) : void 0;
|
|
4098
4101
|
return this.applyBmtMetadata(o, r);
|
|
4099
4102
|
}
|
|
4100
4103
|
return o;
|
|
@@ -4107,21 +4110,21 @@ var Sa = new class {
|
|
|
4107
4110
|
}
|
|
4108
4111
|
async loadModel(e, t = {}) {
|
|
4109
4112
|
this.initLoaders();
|
|
4110
|
-
let n = Array.isArray(e) ? e : [e], r = this.getFileSourceMap(n), i = {}, a = n.filter((e) => !
|
|
4113
|
+
let n = Array.isArray(e) ? e : [e], r = this.getFileSourceMap(n), i = {}, a = n.filter((e) => !xa(e)).length, o = 0;
|
|
4111
4114
|
this.loadedModelCount === 0 && this.resetCoordinationMatrixState();
|
|
4112
4115
|
for (let e = 0; e < n.length; e++) {
|
|
4113
|
-
let s = n[e], c =
|
|
4114
|
-
if (c === "json" &&
|
|
4116
|
+
let s = n[e], c = ya(s), l;
|
|
4117
|
+
if (c === "json" && xa(s)) continue;
|
|
4115
4118
|
let u = this.nextModelID, d = o;
|
|
4116
4119
|
if (o++, c === "ifc") l = t.useWorker ? await this.loadIfcModelInWorker(s, t, u, d, a) : (await (await this.getIfcLoader(t)).loadModel(s, this.coordinationMatrix))[0];
|
|
4117
4120
|
else if (c === "bmt") l = t.useWorker ? await this.loadBmtModelInWorker(s, r, t, u, d, a) : await this.loadBmtModel(s, r);
|
|
4118
|
-
else throw Error(`Unsupported model format: ${
|
|
4119
|
-
let f =
|
|
4120
|
-
!this.coordinationMatrix && f && (this.coordinationMatrix = f), !l.coordinationMatrix && this.coordinationMatrix && (l.coordinationMatrix = this.coordinationMatrix), l.name ??=
|
|
4121
|
+
else throw Error(`Unsupported model format: ${_a(s)}`);
|
|
4122
|
+
let f = Sa(l);
|
|
4123
|
+
!this.coordinationMatrix && f && (this.coordinationMatrix = f), !l.coordinationMatrix && this.coordinationMatrix && (l.coordinationMatrix = this.coordinationMatrix), l.name ??= va(s), this.nextModelID += 1, this.loadedModelCount += 1, i[u] = l;
|
|
4121
4124
|
}
|
|
4122
4125
|
return i;
|
|
4123
4126
|
}
|
|
4124
|
-
}(),
|
|
4127
|
+
}(), wa = .5, X = .04, Z = .16, Ta = Z, Q = wa * 2 - Z * 2, Ea = wa - X / 2, Da = wa - Z / 2, Oa = wa - Ta / 2, ka = .63, Aa = "#dfe6ec", ja = 260, Ma = 52, Na = .17, Pa = new g(), $ = new pe(), Fa = [
|
|
4125
4128
|
{
|
|
4126
4129
|
direction: [
|
|
4127
4130
|
0,
|
|
@@ -4132,7 +4135,7 @@ var Sa = new class {
|
|
|
4132
4135
|
position: [
|
|
4133
4136
|
0,
|
|
4134
4137
|
0,
|
|
4135
|
-
|
|
4138
|
+
Ea
|
|
4136
4139
|
],
|
|
4137
4140
|
scale: [
|
|
4138
4141
|
Q,
|
|
@@ -4152,7 +4155,7 @@ var Sa = new class {
|
|
|
4152
4155
|
position: [
|
|
4153
4156
|
0,
|
|
4154
4157
|
0,
|
|
4155
|
-
-
|
|
4158
|
+
-Ea
|
|
4156
4159
|
],
|
|
4157
4160
|
rotation: [
|
|
4158
4161
|
0,
|
|
@@ -4175,7 +4178,7 @@ var Sa = new class {
|
|
|
4175
4178
|
],
|
|
4176
4179
|
label: "right",
|
|
4177
4180
|
position: [
|
|
4178
|
-
|
|
4181
|
+
Ea,
|
|
4179
4182
|
0,
|
|
4180
4183
|
0
|
|
4181
4184
|
],
|
|
@@ -4200,7 +4203,7 @@ var Sa = new class {
|
|
|
4200
4203
|
],
|
|
4201
4204
|
label: "left",
|
|
4202
4205
|
position: [
|
|
4203
|
-
-
|
|
4206
|
+
-Ea,
|
|
4204
4207
|
0,
|
|
4205
4208
|
0
|
|
4206
4209
|
],
|
|
@@ -4226,7 +4229,7 @@ var Sa = new class {
|
|
|
4226
4229
|
label: "top",
|
|
4227
4230
|
position: [
|
|
4228
4231
|
0,
|
|
4229
|
-
|
|
4232
|
+
Ea,
|
|
4230
4233
|
0
|
|
4231
4234
|
],
|
|
4232
4235
|
rotation: [
|
|
@@ -4251,7 +4254,7 @@ var Sa = new class {
|
|
|
4251
4254
|
label: "bot",
|
|
4252
4255
|
position: [
|
|
4253
4256
|
0,
|
|
4254
|
-
-
|
|
4257
|
+
-Ea,
|
|
4255
4258
|
0
|
|
4256
4259
|
],
|
|
4257
4260
|
rotation: [
|
|
@@ -4268,7 +4271,7 @@ var Sa = new class {
|
|
|
4268
4271
|
type: "face"
|
|
4269
4272
|
}
|
|
4270
4273
|
];
|
|
4271
|
-
function
|
|
4274
|
+
function Ia() {
|
|
4272
4275
|
let e = [], t = [-1, 1];
|
|
4273
4276
|
return t.forEach((n) => {
|
|
4274
4277
|
t.forEach((t) => {
|
|
@@ -4280,8 +4283,8 @@ function Fa() {
|
|
|
4280
4283
|
],
|
|
4281
4284
|
position: [
|
|
4282
4285
|
0,
|
|
4283
|
-
n *
|
|
4284
|
-
t *
|
|
4286
|
+
n * Da,
|
|
4287
|
+
t * Da
|
|
4285
4288
|
],
|
|
4286
4289
|
scale: [
|
|
4287
4290
|
Q,
|
|
@@ -4301,9 +4304,9 @@ function Fa() {
|
|
|
4301
4304
|
t
|
|
4302
4305
|
],
|
|
4303
4306
|
position: [
|
|
4304
|
-
n *
|
|
4307
|
+
n * Da,
|
|
4305
4308
|
0,
|
|
4306
|
-
t *
|
|
4309
|
+
t * Da
|
|
4307
4310
|
],
|
|
4308
4311
|
scale: [
|
|
4309
4312
|
Z,
|
|
@@ -4323,8 +4326,8 @@ function Fa() {
|
|
|
4323
4326
|
0
|
|
4324
4327
|
],
|
|
4325
4328
|
position: [
|
|
4326
|
-
n *
|
|
4327
|
-
t *
|
|
4329
|
+
n * Da,
|
|
4330
|
+
t * Da,
|
|
4328
4331
|
0
|
|
4329
4332
|
],
|
|
4330
4333
|
scale: [
|
|
@@ -4338,7 +4341,7 @@ function Fa() {
|
|
|
4338
4341
|
});
|
|
4339
4342
|
}), e;
|
|
4340
4343
|
}
|
|
4341
|
-
function
|
|
4344
|
+
function La() {
|
|
4342
4345
|
let e = [], t = [-1, 1];
|
|
4343
4346
|
return t.forEach((n) => {
|
|
4344
4347
|
t.forEach((r) => {
|
|
@@ -4350,14 +4353,14 @@ function Ia() {
|
|
|
4350
4353
|
t
|
|
4351
4354
|
],
|
|
4352
4355
|
position: [
|
|
4353
|
-
n *
|
|
4354
|
-
r *
|
|
4355
|
-
t *
|
|
4356
|
+
n * Oa,
|
|
4357
|
+
r * Oa,
|
|
4358
|
+
t * Oa
|
|
4356
4359
|
],
|
|
4357
4360
|
scale: [
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
+
Ta,
|
|
4362
|
+
Ta,
|
|
4363
|
+
Ta
|
|
4361
4364
|
],
|
|
4362
4365
|
title: `${r > 0 ? "Top" : "Bottom"} ${n > 0 ? "Right" : "Left"} ${t > 0 ? "Front" : "Back"}`,
|
|
4363
4366
|
type: "corner"
|
|
@@ -4366,34 +4369,34 @@ function Ia() {
|
|
|
4366
4369
|
});
|
|
4367
4370
|
}), e;
|
|
4368
4371
|
}
|
|
4369
|
-
function La(e) {
|
|
4370
|
-
e.stopPropagation(), e.nativeEvent.stopPropagation(), e.nativeEvent.stopImmediatePropagation?.();
|
|
4371
|
-
}
|
|
4372
4372
|
function Ra(e) {
|
|
4373
|
-
|
|
4373
|
+
e.stopPropagation(), e.nativeEvent.stopPropagation(), e.nativeEvent.stopImmediatePropagation?.();
|
|
4374
4374
|
}
|
|
4375
4375
|
function za(e) {
|
|
4376
|
+
return e ? "#4f7fa3" : Aa;
|
|
4377
|
+
}
|
|
4378
|
+
function Ba(e) {
|
|
4376
4379
|
return e ? 1 : .96;
|
|
4377
4380
|
}
|
|
4378
|
-
function
|
|
4381
|
+
function Va(e, t) {
|
|
4379
4382
|
let n = document.createElement("canvas"), r = n.getContext("2d");
|
|
4380
4383
|
if (!r) throw Error("Could not create navigation cube label context");
|
|
4381
|
-
let i = `600 ${
|
|
4384
|
+
let i = `600 ${Ma}px system-ui, "Segoe UI", sans-serif`;
|
|
4382
4385
|
r.font = i;
|
|
4383
|
-
let a = r.measureText(e), o = a.actualBoundingBoxAscent ||
|
|
4386
|
+
let a = r.measureText(e), o = a.actualBoundingBoxAscent || Ma * .8, s = a.actualBoundingBoxDescent || Ma * .2, c = Math.ceil(a.width + 36), l = Math.ceil(o + s + 20);
|
|
4384
4387
|
n.width = c, n.height = l, r.clearRect(0, 0, c, l), r.font = i, r.fillStyle = t, r.textAlign = "center", r.textBaseline = "alphabetic", r.fillText(e, c / 2, 10 + o);
|
|
4385
4388
|
let u = new b(n);
|
|
4386
|
-
return u.colorSpace =
|
|
4389
|
+
return u.colorSpace = fe, u.generateMipmaps = !1, u.magFilter = A, u.minFilter = A, u.needsUpdate = !0, {
|
|
4387
4390
|
aspect: c / l,
|
|
4388
4391
|
texture: u
|
|
4389
4392
|
};
|
|
4390
4393
|
}
|
|
4391
|
-
function
|
|
4392
|
-
let { aspect: i, texture: a } = c(() =>
|
|
4393
|
-
return o(() => () => a.dispose(), [a]), /* @__PURE__ */
|
|
4394
|
+
function Ha({ color: e, label: t, position: n, rotation: r }) {
|
|
4395
|
+
let { aspect: i, texture: a } = c(() => Va(t, e), [e, t]);
|
|
4396
|
+
return o(() => () => a.dispose(), [a]), /* @__PURE__ */ I("mesh", {
|
|
4394
4397
|
position: n,
|
|
4395
4398
|
rotation: r,
|
|
4396
|
-
children: [/* @__PURE__ */
|
|
4399
|
+
children: [/* @__PURE__ */ F("planeGeometry", { args: [Na * i, Na] }), /* @__PURE__ */ F("meshBasicMaterial", {
|
|
4397
4400
|
alphaTest: .1,
|
|
4398
4401
|
depthWrite: !1,
|
|
4399
4402
|
map: a,
|
|
@@ -4402,54 +4405,54 @@ function Va({ color: e, label: t, position: n, rotation: r }) {
|
|
|
4402
4405
|
})]
|
|
4403
4406
|
});
|
|
4404
4407
|
}
|
|
4405
|
-
function
|
|
4406
|
-
return Math.abs(e.y) > .9 ? new
|
|
4408
|
+
function Ua(e) {
|
|
4409
|
+
return Math.abs(e.y) > .9 ? new P(0, 0, e.y > 0 ? -1 : 1) : new P(0, 1, 0);
|
|
4407
4410
|
}
|
|
4408
|
-
function
|
|
4411
|
+
function Wa(e, t) {
|
|
4409
4412
|
let n = e.current;
|
|
4410
|
-
return !n || (n.updateWorldMatrix(!0, !0),
|
|
4413
|
+
return !n || (n.updateWorldMatrix(!0, !0), Pa.setFromObject(n), Pa.isEmpty()) ? ($.center.copy(t), $.radius = 10, $) : (Pa.getBoundingSphere($), (!Number.isFinite($.radius) || $.radius <= 0) && ($.radius = 10), $);
|
|
4411
4414
|
}
|
|
4412
|
-
function
|
|
4413
|
-
return e.current?.target.clone() ?? new
|
|
4415
|
+
function Ga(e) {
|
|
4416
|
+
return e.current?.target.clone() ?? new P();
|
|
4414
4417
|
}
|
|
4415
|
-
function
|
|
4416
|
-
let a =
|
|
4418
|
+
function Ka({ camera: e, controlRef: t, direction: n, modelRef: r, transitionRef: i }) {
|
|
4419
|
+
let a = Ga(t), o = Wa(r, a), s = o.center.clone(), c = new P(...n).normalize(), l = e.position.distanceTo(a), u = Number.isFinite(l) && l > o.radius * .5 ? l : o.radius * 2.4;
|
|
4417
4420
|
i.current = {
|
|
4418
4421
|
endPosition: s.clone().addScaledVector(c, u),
|
|
4419
4422
|
endTarget: s,
|
|
4420
|
-
endUp:
|
|
4423
|
+
endUp: Ua(c),
|
|
4421
4424
|
startPosition: e.position.clone(),
|
|
4422
4425
|
startTarget: a,
|
|
4423
4426
|
startTime: performance.now(),
|
|
4424
4427
|
startUp: e.up.clone()
|
|
4425
4428
|
};
|
|
4426
4429
|
}
|
|
4427
|
-
function
|
|
4430
|
+
function qa({ action: e, onPick: t }) {
|
|
4428
4431
|
let [n, r] = u(!1);
|
|
4429
|
-
return /* @__PURE__ */
|
|
4432
|
+
return /* @__PURE__ */ I("group", {
|
|
4430
4433
|
position: e.position,
|
|
4431
|
-
onClick:
|
|
4434
|
+
onClick: Ra,
|
|
4432
4435
|
onPointerDown: (n) => {
|
|
4433
|
-
|
|
4436
|
+
Ra(n), t(e);
|
|
4434
4437
|
},
|
|
4435
4438
|
onPointerEnter: (e) => {
|
|
4436
|
-
|
|
4439
|
+
Ra(e), r(!0);
|
|
4437
4440
|
},
|
|
4438
4441
|
onPointerLeave: (e) => {
|
|
4439
|
-
|
|
4442
|
+
Ra(e), r(!1);
|
|
4440
4443
|
},
|
|
4441
|
-
children: [/* @__PURE__ */
|
|
4444
|
+
children: [/* @__PURE__ */ I("mesh", {
|
|
4442
4445
|
scale: e.scale,
|
|
4443
|
-
children: [/* @__PURE__ */
|
|
4446
|
+
children: [/* @__PURE__ */ F("boxGeometry", { args: [
|
|
4444
4447
|
1,
|
|
4445
4448
|
1,
|
|
4446
4449
|
1
|
|
4447
|
-
] }), /* @__PURE__ */
|
|
4448
|
-
color:
|
|
4449
|
-
opacity:
|
|
4450
|
+
] }), /* @__PURE__ */ F("meshBasicMaterial", {
|
|
4451
|
+
color: za(n),
|
|
4452
|
+
opacity: Ba(n),
|
|
4450
4453
|
transparent: !0
|
|
4451
4454
|
})]
|
|
4452
|
-
}), e.label && /* @__PURE__ */
|
|
4455
|
+
}), e.label && /* @__PURE__ */ F(Ha, {
|
|
4453
4456
|
color: n ? "#ffffff" : "#50606f",
|
|
4454
4457
|
label: e.label,
|
|
4455
4458
|
position: [
|
|
@@ -4461,11 +4464,11 @@ function Ka({ action: e, onPick: t }) {
|
|
|
4461
4464
|
})]
|
|
4462
4465
|
});
|
|
4463
4466
|
}
|
|
4464
|
-
function
|
|
4467
|
+
function Ja({ active: e = !0, cameraRef: t, controlRef: n, modelRef: r }) {
|
|
4465
4468
|
let i = l(null), a = l(null), o = c(() => [
|
|
4466
|
-
...
|
|
4467
|
-
...
|
|
4468
|
-
...
|
|
4469
|
+
...Fa,
|
|
4470
|
+
...Ia(),
|
|
4471
|
+
...La()
|
|
4469
4472
|
], []);
|
|
4470
4473
|
return f(() => {
|
|
4471
4474
|
if (!e) return;
|
|
@@ -4474,16 +4477,16 @@ function qa({ active: e = !0, cameraRef: t, controlRef: n, modelRef: r }) {
|
|
|
4474
4477
|
i.current && i.current.quaternion.copy(r.quaternion).invert();
|
|
4475
4478
|
let o = a.current;
|
|
4476
4479
|
if (!o) return;
|
|
4477
|
-
let s = performance.now() - o.startTime, c = Math.min(s /
|
|
4480
|
+
let s = performance.now() - o.startTime, c = Math.min(s / ja, 1), l = 1 - (1 - c) ** 3, u = n.current;
|
|
4478
4481
|
r.position.lerpVectors(o.startPosition, o.endPosition, l), r.up.lerpVectors(o.startUp, o.endUp, l), u ? (u.target.lerpVectors(o.startTarget, o.endTarget, l), u.update()) : r.lookAt(o.endTarget), c >= 1 && (r.up.copy(o.endUp), u?.target.copy(o.endTarget), u?.update(), a.current = null);
|
|
4479
|
-
}), e ? /* @__PURE__ */
|
|
4482
|
+
}), e ? /* @__PURE__ */ F("group", {
|
|
4480
4483
|
ref: i,
|
|
4481
|
-
scale:
|
|
4482
|
-
children: o.map((e) => /* @__PURE__ */
|
|
4484
|
+
scale: ka,
|
|
4485
|
+
children: o.map((e) => /* @__PURE__ */ F(qa, {
|
|
4483
4486
|
action: e,
|
|
4484
4487
|
onPick: (e) => {
|
|
4485
4488
|
let i = t.current;
|
|
4486
|
-
i &&
|
|
4489
|
+
i && Ka({
|
|
4487
4490
|
camera: i,
|
|
4488
4491
|
controlRef: n,
|
|
4489
4492
|
direction: e.direction,
|
|
@@ -4496,7 +4499,13 @@ function qa({ active: e = !0, cameraRef: t, controlRef: n, modelRef: r }) {
|
|
|
4496
4499
|
}
|
|
4497
4500
|
//#endregion
|
|
4498
4501
|
//#region src/viewer/Viewer.tsx
|
|
4499
|
-
var
|
|
4502
|
+
var Ya = class {
|
|
4503
|
+
sceneApi = null;
|
|
4504
|
+
get = () => this.sceneApi;
|
|
4505
|
+
set = (e) => {
|
|
4506
|
+
this.sceneApi = e;
|
|
4507
|
+
};
|
|
4508
|
+
}, Xa = {
|
|
4500
4509
|
bottom: 16,
|
|
4501
4510
|
height: 96,
|
|
4502
4511
|
pointerEvents: "auto",
|
|
@@ -4505,11 +4514,11 @@ var Ja = {
|
|
|
4505
4514
|
touchAction: "none",
|
|
4506
4515
|
width: 96,
|
|
4507
4516
|
zIndex: 2
|
|
4508
|
-
},
|
|
4517
|
+
}, Za = {
|
|
4509
4518
|
height: "100%",
|
|
4510
4519
|
position: "relative",
|
|
4511
4520
|
width: "100%"
|
|
4512
|
-
},
|
|
4521
|
+
}, Qa = {
|
|
4513
4522
|
far: 50,
|
|
4514
4523
|
near: .1,
|
|
4515
4524
|
position: [
|
|
@@ -4518,132 +4527,136 @@ var Ja = {
|
|
|
4518
4527
|
10
|
|
4519
4528
|
],
|
|
4520
4529
|
zoom: 72
|
|
4521
|
-
},
|
|
4530
|
+
}, $a = {
|
|
4522
4531
|
alpha: !0,
|
|
4523
4532
|
antialias: !0
|
|
4524
4533
|
};
|
|
4525
|
-
function
|
|
4534
|
+
function eo() {
|
|
4526
4535
|
let e = navigator, t = navigator.userAgent.toLowerCase(), n = navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1, r = window.matchMedia?.("(pointer: coarse)").matches ?? !1;
|
|
4527
4536
|
return e.userAgentData?.mobile || n || /android|iphone|ipad|ipod|mobile|tablet/.test(t) || navigator.maxTouchPoints > 1 && r ? "mobile" : "pc";
|
|
4528
4537
|
}
|
|
4529
|
-
function
|
|
4530
|
-
let
|
|
4531
|
-
let e = Object.keys(
|
|
4538
|
+
function to({ autoFitCamera: e, cameraRef: t, controlRef: n, lightRef: r, modelRef: i, modelsData: a, onReady: s, publicApi: u, setSceneApi: d }) {
|
|
4539
|
+
let f = p((e) => e.camera), g = Mt(i), _ = Ut(g), { colorPaletteTexture: v, colorUtils: y } = Ge(g), b = zn(i), x = _n(i, n, b), S = Mn(i, n, b), C = c(() => new ki(), []), w = _.buildIndex, T = g.resetIndex, E = y.applyStoredColors, D = Nr(), ee = l(!1), O = L((e) => e.showStats), te = c(() => {
|
|
4540
|
+
let e = Object.keys(a).sort((e, t) => Number(e) - Number(t));
|
|
4532
4541
|
for (let t of e) {
|
|
4533
|
-
let e =
|
|
4542
|
+
let e = St(a[Number(t)]);
|
|
4534
4543
|
if (e) return e;
|
|
4535
4544
|
}
|
|
4536
4545
|
return null;
|
|
4537
|
-
}, [
|
|
4546
|
+
}, [a]), k = c(() => bt(te ?? void 0), [te]), ne = c(() => Object.entries(a).map(([e, t]) => [Number(e), t]), [a]), A = c(() => {
|
|
4538
4547
|
let e = (e) => ({
|
|
4539
4548
|
...e,
|
|
4540
|
-
activeViewRoot:
|
|
4549
|
+
activeViewRoot: i.current
|
|
4541
4550
|
});
|
|
4542
4551
|
return {
|
|
4543
|
-
convertIfcFileToBmt: (e, t) =>
|
|
4544
|
-
convertToBmt: (t) =>
|
|
4552
|
+
convertIfcFileToBmt: (e, t) => C.ConvertIfcFileToBmt(e, t),
|
|
4553
|
+
convertToBmt: (t) => C.ConvertToBmt(a, e(t))
|
|
4545
4554
|
};
|
|
4546
4555
|
}, [
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
|
|
4556
|
+
C,
|
|
4557
|
+
i,
|
|
4558
|
+
a
|
|
4550
4559
|
]);
|
|
4551
|
-
return
|
|
4552
|
-
|
|
4553
|
-
}), [
|
|
4554
|
-
|
|
4555
|
-
}), [
|
|
4556
|
-
if (!
|
|
4557
|
-
let
|
|
4558
|
-
|
|
4560
|
+
return Ar(i, n, b), Pn(), o(() => (b.setClippingSource(x), () => {
|
|
4561
|
+
b.setClippingSource(null);
|
|
4562
|
+
}), [b, x]), o(() => (t.current = f, () => {
|
|
4563
|
+
t.current === f && (t.current = null);
|
|
4564
|
+
}), [f, t]), o(() => {
|
|
4565
|
+
if (!i.current) return;
|
|
4566
|
+
let t = requestAnimationFrame(() => {
|
|
4567
|
+
i.current?.updateMatrixWorld(!0), T(), w(), E(), x.syncWithModel(), S.syncWithModel(), e && D(i, n, r);
|
|
4559
4568
|
});
|
|
4560
|
-
return () => cancelAnimationFrame(
|
|
4569
|
+
return () => cancelAnimationFrame(t);
|
|
4561
4570
|
}, [
|
|
4562
|
-
T,
|
|
4563
|
-
C,
|
|
4564
|
-
b,
|
|
4565
|
-
t,
|
|
4566
|
-
x,
|
|
4567
4571
|
E,
|
|
4572
|
+
e,
|
|
4573
|
+
w,
|
|
4574
|
+
x,
|
|
4568
4575
|
n,
|
|
4576
|
+
S,
|
|
4577
|
+
D,
|
|
4569
4578
|
r,
|
|
4570
4579
|
i,
|
|
4571
|
-
|
|
4572
|
-
|
|
4580
|
+
a,
|
|
4581
|
+
T
|
|
4582
|
+
]), o(() => (d({
|
|
4573
4583
|
camera: {
|
|
4574
|
-
fitCamera: () =>
|
|
4575
|
-
getIntersection:
|
|
4584
|
+
fitCamera: () => D(i, n, r),
|
|
4585
|
+
getIntersection: b.getIntersection
|
|
4576
4586
|
},
|
|
4577
4587
|
clipping: {
|
|
4578
|
-
createClippingRectangle:
|
|
4579
|
-
createPlane:
|
|
4580
|
-
deleteAllPlanes:
|
|
4581
|
-
getActive:
|
|
4582
|
-
getEdgesActive:
|
|
4583
|
-
getHelpersActive:
|
|
4584
|
-
getPlanes:
|
|
4585
|
-
setActive:
|
|
4586
|
-
setEdgesActive:
|
|
4587
|
-
setHelpersActive:
|
|
4588
|
-
toggle:
|
|
4589
|
-
updateEdges:
|
|
4590
|
-
updateMaterials:
|
|
4588
|
+
createClippingRectangle: x.createClippingRectangle,
|
|
4589
|
+
createPlane: x.createPlane,
|
|
4590
|
+
deleteAllPlanes: x.deleteAllPlanes,
|
|
4591
|
+
getActive: x.getActive,
|
|
4592
|
+
getEdgesActive: x.getEdgesActive,
|
|
4593
|
+
getHelpersActive: x.getHelpersActive,
|
|
4594
|
+
getPlanes: x.getPlanes,
|
|
4595
|
+
setActive: x.setActive,
|
|
4596
|
+
setEdgesActive: x.setEdgesActive,
|
|
4597
|
+
setHelpersActive: x.setHelpersActive,
|
|
4598
|
+
toggle: x.toggle,
|
|
4599
|
+
updateEdges: x.updateEdges,
|
|
4600
|
+
updateMaterials: x.updateMaterials
|
|
4591
4601
|
},
|
|
4592
4602
|
colors: {
|
|
4593
|
-
clearAllColors:
|
|
4594
|
-
clearColor:
|
|
4595
|
-
clearModelColors:
|
|
4596
|
-
setColor:
|
|
4603
|
+
clearAllColors: y.clearAllColors,
|
|
4604
|
+
clearColor: y.clearColor,
|
|
4605
|
+
clearModelColors: y.clearModelColors,
|
|
4606
|
+
setColor: y.setColor
|
|
4597
4607
|
},
|
|
4598
|
-
converter:
|
|
4608
|
+
converter: A,
|
|
4599
4609
|
dimensions: {
|
|
4600
|
-
cancelDrawing:
|
|
4601
|
-
changeAxes:
|
|
4602
|
-
delete:
|
|
4603
|
-
deleteAll:
|
|
4604
|
-
getActive:
|
|
4605
|
-
getDimensions:
|
|
4606
|
-
getSnapDistance:
|
|
4607
|
-
getUnit:
|
|
4608
|
-
setActive:
|
|
4609
|
-
setColor:
|
|
4610
|
-
setEndpointScaleFactor:
|
|
4611
|
-
setSnapDistance:
|
|
4612
|
-
setUnit:
|
|
4613
|
-
setWidth:
|
|
4614
|
-
toggle:
|
|
4610
|
+
cancelDrawing: S.cancelDrawing,
|
|
4611
|
+
changeAxes: S.changeAxes,
|
|
4612
|
+
delete: S.delete,
|
|
4613
|
+
deleteAll: S.deleteAll,
|
|
4614
|
+
getActive: S.getActive,
|
|
4615
|
+
getDimensions: S.getDimensions,
|
|
4616
|
+
getSnapDistance: S.getSnapDistance,
|
|
4617
|
+
getUnit: S.getUnit,
|
|
4618
|
+
setActive: S.setActive,
|
|
4619
|
+
setColor: S.setColor,
|
|
4620
|
+
setEndpointScaleFactor: S.setEndpointScaleFactor,
|
|
4621
|
+
setSnapDistance: S.setSnapDistance,
|
|
4622
|
+
setUnit: S.setUnit,
|
|
4623
|
+
setWidth: S.setWidth,
|
|
4624
|
+
toggle: S.toggle
|
|
4615
4625
|
},
|
|
4616
4626
|
geometryUtils: {
|
|
4617
|
-
getAllIds:
|
|
4618
|
-
getIfcSpacesVisibility:
|
|
4619
|
-
hideByIds:
|
|
4620
|
-
hideSelected:
|
|
4621
|
-
isolateByIds:
|
|
4622
|
-
isolateSelected:
|
|
4623
|
-
resetIsolation:
|
|
4624
|
-
setIfcSpacesVisibility:
|
|
4625
|
-
showAll:
|
|
4626
|
-
showByIds:
|
|
4627
|
-
toggleIIfcSpacesVisibility:
|
|
4627
|
+
getAllIds: _.getAllIds,
|
|
4628
|
+
getIfcSpacesVisibility: _.getIfcSpacesVisibility,
|
|
4629
|
+
hideByIds: _.hideByIds,
|
|
4630
|
+
hideSelected: _.hideSelected,
|
|
4631
|
+
isolateByIds: _.isolateByIds,
|
|
4632
|
+
isolateSelected: _.isolateSelected,
|
|
4633
|
+
resetIsolation: _.resetIsolation,
|
|
4634
|
+
setIfcSpacesVisibility: _.setIfcSpacesVisibility,
|
|
4635
|
+
showAll: _.showAll,
|
|
4636
|
+
showByIds: _.showByIds,
|
|
4637
|
+
toggleIIfcSpacesVisibility: _.toggleIIfcSpacesVisibility
|
|
4628
4638
|
}
|
|
4629
|
-
}),
|
|
4639
|
+
}), ee.current || (ee.current = !0, s?.(u)), () => d(null)), [
|
|
4640
|
+
x,
|
|
4630
4641
|
b,
|
|
4631
4642
|
y,
|
|
4632
|
-
|
|
4633
|
-
|
|
4634
|
-
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
|
|
4643
|
+
n,
|
|
4644
|
+
A,
|
|
4645
|
+
S,
|
|
4646
|
+
D,
|
|
4647
|
+
_,
|
|
4648
|
+
r,
|
|
4649
|
+
i,
|
|
4638
4650
|
s,
|
|
4639
|
-
u
|
|
4640
|
-
|
|
4641
|
-
|
|
4651
|
+
u,
|
|
4652
|
+
d
|
|
4653
|
+
]), /* @__PURE__ */ I(Te, { children: [
|
|
4654
|
+
/* @__PURE__ */ F("ambientLight", {
|
|
4642
4655
|
intensity: 1.2,
|
|
4643
4656
|
color: "#ffffff"
|
|
4644
4657
|
}),
|
|
4645
|
-
/* @__PURE__ */
|
|
4646
|
-
ref:
|
|
4658
|
+
/* @__PURE__ */ F("directionalLight", {
|
|
4659
|
+
ref: r,
|
|
4647
4660
|
position: [
|
|
4648
4661
|
10,
|
|
4649
4662
|
10,
|
|
@@ -4652,102 +4665,103 @@ function $a({ cameraRef: e, controlRef: t, lightRef: n, modelRef: r, modelsData:
|
|
|
4652
4665
|
color: "#ffffff",
|
|
4653
4666
|
intensity: 2
|
|
4654
4667
|
}),
|
|
4655
|
-
O && /* @__PURE__ */
|
|
4656
|
-
/* @__PURE__ */
|
|
4657
|
-
ref:
|
|
4658
|
-
children:
|
|
4659
|
-
colorPaletteTexture:
|
|
4660
|
-
coordinationMatrix:
|
|
4668
|
+
O && /* @__PURE__ */ F(h, {}),
|
|
4669
|
+
/* @__PURE__ */ F("group", {
|
|
4670
|
+
ref: i,
|
|
4671
|
+
children: ne.map(([e, t]) => /* @__PURE__ */ F(wt, {
|
|
4672
|
+
colorPaletteTexture: v,
|
|
4673
|
+
coordinationMatrix: k,
|
|
4661
4674
|
data: t,
|
|
4662
4675
|
modelID: e
|
|
4663
4676
|
}, e))
|
|
4664
4677
|
}),
|
|
4665
|
-
/* @__PURE__ */
|
|
4678
|
+
/* @__PURE__ */ F(m, {
|
|
4666
4679
|
dampingFactor: .15,
|
|
4667
4680
|
enableDamping: !0,
|
|
4668
|
-
ref:
|
|
4681
|
+
ref: n
|
|
4669
4682
|
})
|
|
4670
4683
|
] });
|
|
4671
4684
|
}
|
|
4672
|
-
function
|
|
4685
|
+
function no({ autoFitCamera: e = !0, camera: t = {
|
|
4673
4686
|
position: [
|
|
4674
4687
|
10,
|
|
4675
4688
|
10,
|
|
4676
4689
|
10
|
|
4677
4690
|
],
|
|
4678
4691
|
fov: 50
|
|
4679
|
-
}, dpr:
|
|
4680
|
-
let
|
|
4692
|
+
}, dpr: n = window.devicePixelRatio, modelUrls: r, modelSources: i, modelsData: a, onReady: s, publicApi: c, setSceneApi: f, showNavCube: p, showStats: m }) {
|
|
4693
|
+
let h = l(null), g = l(null), _ = l(null), v = l(null), [y, b] = u(), x = R(), S = L((e) => e.setModelNames), C = L((e) => e.setModelProps), w = L((e) => e.setModelStructure), T = L((e) => e.setShowNavCube), E = L((e) => e.setShowStats), D = L((e) => e.setUserDevice), ee = L((e) => e.showNavCube), O = a ?? y;
|
|
4681
4694
|
return o(() => {
|
|
4682
|
-
|
|
4683
|
-
}, [
|
|
4684
|
-
|
|
4695
|
+
D(eo());
|
|
4696
|
+
}, [D]), o(() => {
|
|
4697
|
+
E(!!m);
|
|
4698
|
+
}, [E, m]), o(() => {
|
|
4699
|
+
p !== void 0 && T(p);
|
|
4685
4700
|
}, [T, p]), o(() => {
|
|
4686
|
-
f !== void 0 && w(f);
|
|
4687
|
-
}, [w, f]), o(() => {
|
|
4688
4701
|
let e = {}, t = {}, n = {};
|
|
4689
4702
|
O && Object.entries(O).forEach(([r, i]) => {
|
|
4690
4703
|
let a = Number(r);
|
|
4691
4704
|
i.name !== void 0 && (e[a] = i.name), i.props !== void 0 && (t[a] = i.props), i.structure !== void 0 && (n[a] = i.structure);
|
|
4692
|
-
}),
|
|
4705
|
+
}), S(e), C(t), w(n);
|
|
4693
4706
|
}, [
|
|
4694
4707
|
O,
|
|
4695
|
-
x,
|
|
4696
4708
|
S,
|
|
4697
|
-
C
|
|
4709
|
+
C,
|
|
4710
|
+
w
|
|
4698
4711
|
]), o(() => {
|
|
4699
|
-
if (
|
|
4700
|
-
let e =
|
|
4712
|
+
if (a) return;
|
|
4713
|
+
let e = i ?? r;
|
|
4701
4714
|
if (!e?.length) return;
|
|
4702
4715
|
let t = !0;
|
|
4703
|
-
return
|
|
4704
|
-
t &&
|
|
4716
|
+
return Ca.loadModel(e).then((e) => {
|
|
4717
|
+
t && b(e);
|
|
4705
4718
|
}), () => {
|
|
4706
4719
|
t = !1;
|
|
4707
4720
|
};
|
|
4708
4721
|
}, [
|
|
4722
|
+
a,
|
|
4709
4723
|
i,
|
|
4710
|
-
r
|
|
4711
|
-
|
|
4712
|
-
|
|
4713
|
-
|
|
4714
|
-
|
|
4715
|
-
|
|
4716
|
-
|
|
4717
|
-
|
|
4718
|
-
|
|
4719
|
-
|
|
4720
|
-
cameraRef:
|
|
4721
|
-
controlRef:
|
|
4722
|
-
lightRef:
|
|
4723
|
-
modelRef:
|
|
4724
|
+
r
|
|
4725
|
+
]), O ? /* @__PURE__ */ I("div", {
|
|
4726
|
+
style: Za,
|
|
4727
|
+
children: [/* @__PURE__ */ F(d, {
|
|
4728
|
+
camera: t,
|
|
4729
|
+
dpr: n,
|
|
4730
|
+
children: /* @__PURE__ */ F(Pr, {
|
|
4731
|
+
store: x,
|
|
4732
|
+
children: /* @__PURE__ */ F(to, {
|
|
4733
|
+
autoFitCamera: e,
|
|
4734
|
+
cameraRef: h,
|
|
4735
|
+
controlRef: g,
|
|
4736
|
+
lightRef: v,
|
|
4737
|
+
modelRef: _,
|
|
4724
4738
|
modelsData: O,
|
|
4725
|
-
onReady:
|
|
4726
|
-
publicApi:
|
|
4727
|
-
setSceneApi:
|
|
4739
|
+
onReady: s,
|
|
4740
|
+
publicApi: c,
|
|
4741
|
+
setSceneApi: f
|
|
4728
4742
|
})
|
|
4729
4743
|
})
|
|
4730
|
-
}),
|
|
4731
|
-
style:
|
|
4732
|
-
children: /* @__PURE__ */
|
|
4733
|
-
camera:
|
|
4734
|
-
dpr:
|
|
4735
|
-
gl:
|
|
4744
|
+
}), ee && /* @__PURE__ */ F("div", {
|
|
4745
|
+
style: Xa,
|
|
4746
|
+
children: /* @__PURE__ */ F(d, {
|
|
4747
|
+
camera: Qa,
|
|
4748
|
+
dpr: n,
|
|
4749
|
+
gl: $a,
|
|
4736
4750
|
orthographic: !0,
|
|
4737
|
-
children: /* @__PURE__ */
|
|
4751
|
+
children: /* @__PURE__ */ F(Ja, {
|
|
4738
4752
|
active: !0,
|
|
4739
|
-
cameraRef:
|
|
4740
|
-
controlRef:
|
|
4741
|
-
modelRef:
|
|
4753
|
+
cameraRef: h,
|
|
4754
|
+
controlRef: g,
|
|
4755
|
+
modelRef: _
|
|
4742
4756
|
})
|
|
4743
4757
|
})
|
|
4744
4758
|
})]
|
|
4745
|
-
}) : /* @__PURE__ */
|
|
4759
|
+
}) : /* @__PURE__ */ F(Te, {});
|
|
4746
4760
|
}
|
|
4747
|
-
var
|
|
4748
|
-
let [n] = u(
|
|
4749
|
-
d.
|
|
4750
|
-
}, []), g = c(() => Ki(n,
|
|
4761
|
+
var ro = n(function(e, t) {
|
|
4762
|
+
let [n] = u(je), r = l(!1), a = l(!1), d = c(() => new Ya(), []), { defaultSelected: f, onSelectedChange: p, selected: m } = e, h = i((e) => {
|
|
4763
|
+
d.set(e);
|
|
4764
|
+
}, [d]), g = c(() => Ki(n, d.get), [d, n]);
|
|
4751
4765
|
return s(t, () => g, [g]), o(() => (n.getState().setApi(g), () => {
|
|
4752
4766
|
n.getState().api === g && n.getState().setApi(null);
|
|
4753
4767
|
}), [g, n]), o(() => {
|
|
@@ -4762,15 +4776,15 @@ var to = n(function(e, t) {
|
|
|
4762
4776
|
if (p) return n.subscribe((e, t) => {
|
|
4763
4777
|
e.selected !== t.selected && (a.current || p(Wi(e.selected)));
|
|
4764
4778
|
});
|
|
4765
|
-
}, [p, n]), /* @__PURE__ */
|
|
4779
|
+
}, [p, n]), /* @__PURE__ */ F(Pr, {
|
|
4766
4780
|
store: n,
|
|
4767
|
-
children: /* @__PURE__ */
|
|
4781
|
+
children: /* @__PURE__ */ F(no, {
|
|
4768
4782
|
...e,
|
|
4769
4783
|
publicApi: g,
|
|
4770
4784
|
setSceneApi: h
|
|
4771
4785
|
})
|
|
4772
4786
|
});
|
|
4773
4787
|
});
|
|
4774
|
-
|
|
4788
|
+
ro.displayName = "Viewer";
|
|
4775
4789
|
//#endregion
|
|
4776
|
-
export { Ji as BMTLoader, ki as BmtConverter, ji as ConvertIfcFileToBmt, Mi as ConvertToBmt,
|
|
4790
|
+
export { Ji as BMTLoader, ki as BmtConverter, ji as ConvertIfcFileToBmt, Mi as ConvertToBmt, wn as DimensionLine, jn as DimensionsUtils, Ui as FilteredElementsCollector, vt as ModelGrids, Ja as NavigationCube, ro as Viewer, Pr as ViewerStoreProvider, Ai as bmtConverter, ia as createBmtWorker, ga as createIfcWorker, je as createViewerStore, xi as exportExcel, vi as exportModelPropertiesToExcel, ra as loadBmtModelsInWorker, ha as loadIfcModelsInWorker, Ca as loader, Mn as useDimensionsUtils, L as useViewerStore, R as useViewerStoreApi };
|