@thatopen/components 2.0.8 → 2.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ifc/IfcRelationsIndexer/index.d.ts +1 -0
- package/dist/index.cjs +5 -5
- package/dist/index.mjs +1008 -1007
- package/dist/namespace.d.ts +762 -761
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -92,17 +92,17 @@ function Ae(l) {
|
|
|
92
92
|
return 2 * (s * t + t * e + e * s);
|
|
93
93
|
}
|
|
94
94
|
function Gs(l, s, t, e, i = null) {
|
|
95
|
-
let o = 1 / 0, n = 1 / 0, r = 1 / 0, a = -1 / 0, c = -1 / 0, h = -1 / 0, d = 1 / 0, E = 1 / 0, u = 1 / 0, p = -1 / 0, A = -1 / 0,
|
|
95
|
+
let o = 1 / 0, n = 1 / 0, r = 1 / 0, a = -1 / 0, c = -1 / 0, h = -1 / 0, d = 1 / 0, E = 1 / 0, u = 1 / 0, p = -1 / 0, A = -1 / 0, m = -1 / 0;
|
|
96
96
|
const C = i !== null;
|
|
97
|
-
for (let
|
|
98
|
-
const f = l[
|
|
97
|
+
for (let R = s * 6, F = (s + t) * 6; R < F; R += 6) {
|
|
98
|
+
const f = l[R + 0], T = l[R + 1], O = f - T, S = f + T;
|
|
99
99
|
O < o && (o = O), S > a && (a = S), C && f < d && (d = f), C && f > p && (p = f);
|
|
100
|
-
const _ = l[
|
|
100
|
+
const _ = l[R + 2], N = l[R + 3], L = _ - N, M = _ + N;
|
|
101
101
|
L < n && (n = L), M > c && (c = M), C && _ < E && (E = _), C && _ > A && (A = _);
|
|
102
|
-
const y = l[
|
|
103
|
-
b < r && (r = b), B > h && (h = B), C && y < u && (u = y), C && y >
|
|
102
|
+
const y = l[R + 4], x = l[R + 5], b = y - x, B = y + x;
|
|
103
|
+
b < r && (r = b), B > h && (h = B), C && y < u && (u = y), C && y > m && (m = y);
|
|
104
104
|
}
|
|
105
|
-
e[0] = o, e[1] = n, e[2] = r, e[3] = a, e[4] = c, e[5] = h, C && (i[0] = d, i[1] = E, i[2] = u, i[3] = p, i[4] = A, i[5] =
|
|
105
|
+
e[0] = o, e[1] = n, e[2] = r, e[3] = a, e[4] = c, e[5] = h, C && (i[0] = d, i[1] = E, i[2] = u, i[3] = p, i[4] = A, i[5] = m);
|
|
106
106
|
}
|
|
107
107
|
function ho(l, s, t, e) {
|
|
108
108
|
let i = 1 / 0, o = 1 / 0, n = 1 / 0, r = -1 / 0, a = -1 / 0, c = -1 / 0;
|
|
@@ -124,17 +124,17 @@ function Eo(l, s) {
|
|
|
124
124
|
const h = ["getX", "getY", "getZ"];
|
|
125
125
|
for (let d = 0; d < i; d++) {
|
|
126
126
|
const E = d * 3, u = d * 6;
|
|
127
|
-
let p = E + 0, A = E + 1,
|
|
128
|
-
e && (p = e[p], A = e[A],
|
|
127
|
+
let p = E + 0, A = E + 1, m = E + 2;
|
|
128
|
+
e && (p = e[p], A = e[A], m = e[m]), n || (p = p * c + a, A = A * c + a, m = m * c + a);
|
|
129
129
|
for (let C = 0; C < 3; C++) {
|
|
130
|
-
let
|
|
131
|
-
n ? (
|
|
132
|
-
let
|
|
133
|
-
F <
|
|
134
|
-
let O =
|
|
130
|
+
let R, F, f;
|
|
131
|
+
n ? (R = t[h[C]](p), F = t[h[C]](A), f = t[h[C]](m)) : (R = r[p + C], F = r[A + C], f = r[m + C]);
|
|
132
|
+
let T = R;
|
|
133
|
+
F < T && (T = F), f < T && (T = f);
|
|
134
|
+
let O = R;
|
|
135
135
|
F > O && (O = F), f > O && (O = f);
|
|
136
|
-
const S = (O -
|
|
137
|
-
o[u + _ + 0] =
|
|
136
|
+
const S = (O - T) / 2, _ = C * 2;
|
|
137
|
+
o[u + _ + 0] = T + S, o[u + _ + 1] = S + (Math.abs(T) + S) * no, T < s[C] && (s[C] = T), O > s[C + 3] && (s[C + 3] = O);
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
return o;
|
|
@@ -157,19 +157,19 @@ function Io(l, s, t, e, i, o) {
|
|
|
157
157
|
let c = Ys * i;
|
|
158
158
|
const h = e * 6, d = (e + i) * 6;
|
|
159
159
|
for (let E = 0; E < 3; E++) {
|
|
160
|
-
const u = s[E],
|
|
160
|
+
const u = s[E], m = (s[E + 3] - u) / wt;
|
|
161
161
|
if (i < wt / 4) {
|
|
162
162
|
const C = [...Ut];
|
|
163
163
|
C.length = i;
|
|
164
|
-
let
|
|
165
|
-
for (let f = h; f < d; f += 6,
|
|
166
|
-
const
|
|
167
|
-
|
|
164
|
+
let R = 0;
|
|
165
|
+
for (let f = h; f < d; f += 6, R++) {
|
|
166
|
+
const T = C[R];
|
|
167
|
+
T.candidate = t[f + 2 * E], T.count = 0;
|
|
168
168
|
const {
|
|
169
169
|
bounds: O,
|
|
170
170
|
leftCacheBounds: S,
|
|
171
171
|
rightCacheBounds: _
|
|
172
|
-
} =
|
|
172
|
+
} = T;
|
|
173
173
|
for (let N = 0; N < 3; N++)
|
|
174
174
|
_[N] = 1 / 0, _[N + 3] = -1 / 0, S[N] = 1 / 0, S[N + 3] = -1 / 0, O[N] = 1 / 0, O[N + 3] = -1 / 0;
|
|
175
175
|
je(f, t, O);
|
|
@@ -177,36 +177,36 @@ function Io(l, s, t, e, i, o) {
|
|
|
177
177
|
C.sort(uo);
|
|
178
178
|
let F = i;
|
|
179
179
|
for (let f = 0; f < F; f++) {
|
|
180
|
-
const
|
|
181
|
-
for (; f + 1 < F && C[f + 1].candidate ===
|
|
180
|
+
const T = C[f];
|
|
181
|
+
for (; f + 1 < F && C[f + 1].candidate === T.candidate; )
|
|
182
182
|
C.splice(f + 1, 1), F--;
|
|
183
183
|
}
|
|
184
184
|
for (let f = h; f < d; f += 6) {
|
|
185
|
-
const
|
|
185
|
+
const T = t[f + 2 * E];
|
|
186
186
|
for (let O = 0; O < F; O++) {
|
|
187
187
|
const S = C[O];
|
|
188
|
-
|
|
188
|
+
T >= S.candidate ? je(f, t, S.rightCacheBounds) : (je(f, t, S.leftCacheBounds), S.count++);
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
191
|
for (let f = 0; f < F; f++) {
|
|
192
|
-
const
|
|
192
|
+
const T = C[f], O = T.count, S = i - T.count, _ = T.leftCacheBounds, N = T.rightCacheBounds;
|
|
193
193
|
let L = 0;
|
|
194
194
|
O !== 0 && (L = Ae(_) / a);
|
|
195
195
|
let M = 0;
|
|
196
196
|
S !== 0 && (M = Ae(N) / a);
|
|
197
197
|
const y = vi + Ys * (L * O + M * S);
|
|
198
|
-
y < c && (n = E, c = y, r =
|
|
198
|
+
y < c && (n = E, c = y, r = T.candidate);
|
|
199
199
|
}
|
|
200
200
|
} else {
|
|
201
201
|
for (let F = 0; F < wt; F++) {
|
|
202
202
|
const f = Ut[F];
|
|
203
|
-
f.count = 0, f.candidate = u +
|
|
204
|
-
const
|
|
203
|
+
f.count = 0, f.candidate = u + m + F * m;
|
|
204
|
+
const T = f.bounds;
|
|
205
205
|
for (let O = 0; O < 3; O++)
|
|
206
|
-
|
|
206
|
+
T[O] = 1 / 0, T[O + 3] = -1 / 0;
|
|
207
207
|
}
|
|
208
208
|
for (let F = h; F < d; F += 6) {
|
|
209
|
-
let O = ~~((t[F + 2 * E] - u) /
|
|
209
|
+
let O = ~~((t[F + 2 * E] - u) / m);
|
|
210
210
|
O >= wt && (O = wt - 1);
|
|
211
211
|
const S = Ut[O];
|
|
212
212
|
S.count++, je(F, t, S.bounds);
|
|
@@ -214,18 +214,18 @@ function Io(l, s, t, e, i, o) {
|
|
|
214
214
|
const C = Ut[wt - 1];
|
|
215
215
|
Yi(C.bounds, C.rightCacheBounds);
|
|
216
216
|
for (let F = wt - 2; F >= 0; F--) {
|
|
217
|
-
const f = Ut[F],
|
|
218
|
-
Vi(f.bounds,
|
|
217
|
+
const f = Ut[F], T = Ut[F + 1];
|
|
218
|
+
Vi(f.bounds, T.rightCacheBounds, f.rightCacheBounds);
|
|
219
219
|
}
|
|
220
|
-
let
|
|
220
|
+
let R = 0;
|
|
221
221
|
for (let F = 0; F < wt - 1; F++) {
|
|
222
|
-
const f = Ut[F],
|
|
223
|
-
|
|
222
|
+
const f = Ut[F], T = f.count, O = f.bounds, _ = Ut[F + 1].rightCacheBounds;
|
|
223
|
+
T !== 0 && (R === 0 ? Yi(O, qe) : Vi(O, qe, qe)), R += T;
|
|
224
224
|
let N = 0, L = 0;
|
|
225
|
-
|
|
226
|
-
const M = i -
|
|
225
|
+
R !== 0 && (N = Ae(qe) / a);
|
|
226
|
+
const M = i - R;
|
|
227
227
|
M !== 0 && (L = Ae(_) / a);
|
|
228
|
-
const y = vi + Ys * (N *
|
|
228
|
+
const y = vi + Ys * (N * R + L * M);
|
|
229
229
|
y < c && (n = E, c = y, r = f.candidate);
|
|
230
230
|
}
|
|
231
231
|
}
|
|
@@ -295,31 +295,31 @@ function To(l, s) {
|
|
|
295
295
|
function mo(l, s) {
|
|
296
296
|
const t = l.geometry, e = t.index ? t.index.array : null, i = s.maxDepth, o = s.verbose, n = s.maxLeafTris, r = s.strategy, a = s.onProgress, c = Ce(t), h = l._indirectBuffer;
|
|
297
297
|
let d = !1;
|
|
298
|
-
const E = new Float32Array(6), u = new Float32Array(6), p = Eo(t, E), A = s.indirect ? Co : po,
|
|
298
|
+
const E = new Float32Array(6), u = new Float32Array(6), p = Eo(t, E), A = s.indirect ? Co : po, m = [], C = s.indirect ? Dn(t) : Un(t);
|
|
299
299
|
if (C.length === 1) {
|
|
300
|
-
const f = C[0],
|
|
301
|
-
|
|
300
|
+
const f = C[0], T = new $e();
|
|
301
|
+
T.boundingData = E, ho(p, f.offset, f.count, u), F(T, f.offset, f.count, u), m.push(T);
|
|
302
302
|
} else
|
|
303
303
|
for (let f of C) {
|
|
304
|
-
const
|
|
305
|
-
|
|
304
|
+
const T = new $e();
|
|
305
|
+
T.boundingData = new Float32Array(6), Gs(p, f.offset, f.count, T.boundingData, u), F(T, f.offset, f.count, u), m.push(T);
|
|
306
306
|
}
|
|
307
|
-
return
|
|
308
|
-
function
|
|
307
|
+
return m;
|
|
308
|
+
function R(f) {
|
|
309
309
|
a && a(f / c);
|
|
310
310
|
}
|
|
311
|
-
function F(f,
|
|
311
|
+
function F(f, T, O, S = null, _ = 0) {
|
|
312
312
|
if (!d && _ >= i && (d = !0, o && (console.warn(`MeshBVH: Max depth of ${i} reached when generating BVH. Consider increasing maxDepth.`), console.warn(t))), O <= n || _ >= i)
|
|
313
|
-
return T
|
|
314
|
-
const N = Io(f.boundingData, S, p,
|
|
313
|
+
return R(T + O), f.offset = T, f.count = O, f;
|
|
314
|
+
const N = Io(f.boundingData, S, p, T, O, r);
|
|
315
315
|
if (N.axis === -1)
|
|
316
|
-
return T
|
|
317
|
-
const L = A(h, e, p,
|
|
318
|
-
if (L ===
|
|
319
|
-
T
|
|
316
|
+
return R(T + O), f.offset = T, f.count = O, f;
|
|
317
|
+
const L = A(h, e, p, T, O, N);
|
|
318
|
+
if (L === T || L === T + O)
|
|
319
|
+
R(T + O), f.offset = T, f.count = O;
|
|
320
320
|
else {
|
|
321
321
|
f.splitAxis = N.axis;
|
|
322
|
-
const M = new $e(), y =
|
|
322
|
+
const M = new $e(), y = T, x = L - T;
|
|
323
323
|
f.left = M, M.boundingData = new Float32Array(6), Gs(p, y, x, M.boundingData, u), F(M, y, x, u, _ + 1);
|
|
324
324
|
const b = new $e(), B = L, H = O - x;
|
|
325
325
|
f.right = b, b.boundingData = new Float32Array(6), Gs(p, B, H, b.boundingData, u), F(b, B, H, u, _ + 1);
|
|
@@ -347,18 +347,18 @@ function Ro(l, s) {
|
|
|
347
347
|
return d.count ? 1 : 1 + c(d.left) + c(d.right);
|
|
348
348
|
}
|
|
349
349
|
function h(d, E) {
|
|
350
|
-
const u = d / 4, p = d / 2, A = !!E.count,
|
|
350
|
+
const u = d / 4, p = d / 2, A = !!E.count, m = E.boundingData;
|
|
351
351
|
for (let C = 0; C < 6; C++)
|
|
352
|
-
i[u + C] =
|
|
352
|
+
i[u + C] = m[C];
|
|
353
353
|
if (A) {
|
|
354
|
-
const C = E.offset,
|
|
355
|
-
return o[u + 6] = C, n[p + 14] =
|
|
354
|
+
const C = E.offset, R = E.count;
|
|
355
|
+
return o[u + 6] = C, n[p + 14] = R, n[p + 15] = Us, d + Ts;
|
|
356
356
|
} else {
|
|
357
|
-
const C = E.left,
|
|
357
|
+
const C = E.left, R = E.right, F = E.splitAxis;
|
|
358
358
|
let f;
|
|
359
359
|
if (f = h(d + Ts, C), f / 4 > Math.pow(2, 32))
|
|
360
360
|
throw new Error("MeshBVH: Cannot store child pointer greater than 32 bits.");
|
|
361
|
-
return o[u + 6] = f / 4, f = h(f,
|
|
361
|
+
return o[u + 6] = f / 4, f = h(f, R), o[u + 7] = F, f;
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
364
|
}
|
|
@@ -406,9 +406,9 @@ const Ao = function() {
|
|
|
406
406
|
return function(i, o, n) {
|
|
407
407
|
const r = i.start, a = l, c = o.start, h = s;
|
|
408
408
|
t.subVectors(r, c), l.subVectors(i.end, i.start), s.subVectors(o.end, o.start);
|
|
409
|
-
const d = t.dot(h), E = h.dot(a), u = h.dot(h), p = t.dot(a),
|
|
410
|
-
let C,
|
|
411
|
-
|
|
409
|
+
const d = t.dot(h), E = h.dot(a), u = h.dot(h), p = t.dot(a), m = a.dot(a) * u - E * E;
|
|
410
|
+
let C, R;
|
|
411
|
+
m !== 0 ? C = (d * E - p * u) / m : C = 0, R = (d + C * E) / u, n.x = C, n.y = R;
|
|
412
412
|
};
|
|
413
413
|
}(), Oi = function() {
|
|
414
414
|
const l = new pe(), s = new w(), t = new w();
|
|
@@ -489,18 +489,18 @@ Ft.prototype.closestPointToSegment = function() {
|
|
|
489
489
|
}();
|
|
490
490
|
Ft.prototype.intersectsTriangle = function() {
|
|
491
491
|
const l = new Ft(), s = new Array(3), t = new Array(3), e = new Mt(), i = new Mt(), o = new w(), n = new w(), r = new w(), a = new w(), c = new w(), h = new Lt(), d = new Lt(), E = new Lt(), u = new w();
|
|
492
|
-
function p(A,
|
|
493
|
-
const
|
|
492
|
+
function p(A, m, C) {
|
|
493
|
+
const R = A.points;
|
|
494
494
|
let F = 0, f = -1;
|
|
495
|
-
for (let
|
|
495
|
+
for (let T = 0; T < 3; T++) {
|
|
496
496
|
const { start: O, end: S } = h;
|
|
497
|
-
O.copy(T
|
|
498
|
-
const _ = zs(
|
|
499
|
-
if (zs(
|
|
497
|
+
O.copy(R[T]), S.copy(R[(T + 1) % 3]), h.delta(n);
|
|
498
|
+
const _ = zs(m.distanceToPoint(O));
|
|
499
|
+
if (zs(m.normal.dot(n)) && _) {
|
|
500
500
|
C.copy(h), F = 2;
|
|
501
501
|
break;
|
|
502
502
|
}
|
|
503
|
-
const N =
|
|
503
|
+
const N = m.intersectLine(h, u);
|
|
504
504
|
if (!N && _ && u.copy(O), (N || _) && !zs(u.distanceTo(S))) {
|
|
505
505
|
if (F <= 1)
|
|
506
506
|
(F === 1 ? C.start : C.end).copy(u), _ && (f = F);
|
|
@@ -514,18 +514,18 @@ Ft.prototype.intersectsTriangle = function() {
|
|
|
514
514
|
}
|
|
515
515
|
return F;
|
|
516
516
|
}
|
|
517
|
-
return function(
|
|
518
|
-
this.needsUpdate && this.update(),
|
|
519
|
-
const F = this.plane, f =
|
|
517
|
+
return function(m, C = null, R = !1) {
|
|
518
|
+
this.needsUpdate && this.update(), m.isExtendedTriangle ? m.needsUpdate && m.update() : (l.copy(m), l.update(), m = l);
|
|
519
|
+
const F = this.plane, f = m.plane;
|
|
520
520
|
if (Math.abs(F.normal.dot(f.normal)) > 1 - 1e-10) {
|
|
521
|
-
const
|
|
522
|
-
t[0] =
|
|
521
|
+
const T = this.satBounds, O = this.satAxes;
|
|
522
|
+
t[0] = m.a, t[1] = m.b, t[2] = m.c;
|
|
523
523
|
for (let N = 0; N < 4; N++) {
|
|
524
|
-
const L =
|
|
524
|
+
const L = T[N], M = O[N];
|
|
525
525
|
if (e.setFromPoints(M, t), L.isSeparated(e))
|
|
526
526
|
return !1;
|
|
527
527
|
}
|
|
528
|
-
const S =
|
|
528
|
+
const S = m.satBounds, _ = m.satAxes;
|
|
529
529
|
s[0] = this.a, s[1] = this.b, s[2] = this.c;
|
|
530
530
|
for (let N = 0; N < 4; N++) {
|
|
531
531
|
const L = S[N], M = _[N];
|
|
@@ -540,14 +540,14 @@ Ft.prototype.intersectsTriangle = function() {
|
|
|
540
540
|
return !1;
|
|
541
541
|
}
|
|
542
542
|
}
|
|
543
|
-
return C && (
|
|
543
|
+
return C && (R || console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."), C.start.set(0, 0, 0), C.end.set(0, 0, 0)), !0;
|
|
544
544
|
} else {
|
|
545
|
-
const
|
|
546
|
-
if (
|
|
545
|
+
const T = p(this, f, d);
|
|
546
|
+
if (T === 1 && m.containsPoint(d.end))
|
|
547
547
|
return C && (C.start.copy(d.end), C.end.copy(d.end)), !0;
|
|
548
|
-
if (
|
|
548
|
+
if (T !== 2)
|
|
549
549
|
return !1;
|
|
550
|
-
const O = p(
|
|
550
|
+
const O = p(m, F, E);
|
|
551
551
|
if (O === 1 && this.containsPoint(E.end))
|
|
552
552
|
return C && (C.start.copy(E.end), C.end.copy(E.end)), !0;
|
|
553
553
|
if (O !== 2)
|
|
@@ -585,8 +585,8 @@ Ft.prototype.distanceToTriangle = function() {
|
|
|
585
585
|
const E = t[d], u = t[(d + 1) % 3];
|
|
586
586
|
e.set(this[E], this[u]);
|
|
587
587
|
for (let p = 0; p < 3; p++) {
|
|
588
|
-
const A = t[p],
|
|
589
|
-
i.set(n[A], n[
|
|
588
|
+
const A = t[p], m = t[(p + 1) % 3];
|
|
589
|
+
i.set(n[A], n[m]), Oi(e, i, l, s);
|
|
590
590
|
const C = l.distanceToSquared(s);
|
|
591
591
|
C < h && (h = C, r && r.copy(l), a && a.copy(s));
|
|
592
592
|
}
|
|
@@ -684,34 +684,34 @@ at.prototype.distanceToBox = function() {
|
|
|
684
684
|
return (a || c) && (n.getCenter(i), this.closestPointToPoint(i, e), n.closestPointToPoint(e, i), a && a.copy(e), c && c.copy(i)), 0;
|
|
685
685
|
const h = r * r, d = n.min, E = n.max, u = this.points;
|
|
686
686
|
let p = 1 / 0;
|
|
687
|
-
for (let
|
|
688
|
-
const C = u[
|
|
687
|
+
for (let m = 0; m < 8; m++) {
|
|
688
|
+
const C = u[m];
|
|
689
689
|
i.copy(C).clamp(d, E);
|
|
690
|
-
const
|
|
691
|
-
if (
|
|
692
|
-
return Math.sqrt(
|
|
690
|
+
const R = C.distanceToSquared(i);
|
|
691
|
+
if (R < p && (p = R, a && a.copy(C), c && c.copy(i), R < h))
|
|
692
|
+
return Math.sqrt(R);
|
|
693
693
|
}
|
|
694
694
|
let A = 0;
|
|
695
|
-
for (let
|
|
695
|
+
for (let m = 0; m < 3; m++)
|
|
696
696
|
for (let C = 0; C <= 1; C++)
|
|
697
|
-
for (let
|
|
698
|
-
const F = (
|
|
697
|
+
for (let R = 0; R <= 1; R++) {
|
|
698
|
+
const F = (m + 1) % 3, f = (m + 2) % 3, T = C << F | R << f, O = 1 << m | C << F | R << f, S = u[T], _ = u[O];
|
|
699
699
|
s[A].set(S, _);
|
|
700
|
-
const L = l[
|
|
701
|
-
b[L] = d[L], b[M] = C ? d[M] : E[M], b[y] =
|
|
700
|
+
const L = l[m], M = l[F], y = l[f], x = t[A], b = x.start, B = x.end;
|
|
701
|
+
b[L] = d[L], b[M] = C ? d[M] : E[M], b[y] = R ? d[y] : E[M], B[L] = E[L], B[M] = C ? d[M] : E[M], B[y] = R ? d[y] : E[M], A++;
|
|
702
702
|
}
|
|
703
|
-
for (let
|
|
703
|
+
for (let m = 0; m <= 1; m++)
|
|
704
704
|
for (let C = 0; C <= 1; C++)
|
|
705
|
-
for (let
|
|
706
|
-
i.x =
|
|
705
|
+
for (let R = 0; R <= 1; R++) {
|
|
706
|
+
i.x = m ? E.x : d.x, i.y = C ? E.y : d.y, i.z = R ? E.z : d.z, this.closestPointToPoint(i, e);
|
|
707
707
|
const F = i.distanceToSquared(e);
|
|
708
708
|
if (F < p && (p = F, a && a.copy(e), c && c.copy(i), F < h))
|
|
709
709
|
return Math.sqrt(F);
|
|
710
710
|
}
|
|
711
|
-
for (let
|
|
712
|
-
const C = s[
|
|
713
|
-
for (let
|
|
714
|
-
const F = t[
|
|
711
|
+
for (let m = 0; m < 12; m++) {
|
|
712
|
+
const C = s[m];
|
|
713
|
+
for (let R = 0; R < 12; R++) {
|
|
714
|
+
const F = t[R];
|
|
715
715
|
Oi(C, F, e, i);
|
|
716
716
|
const f = e.distanceToSquared(i);
|
|
717
717
|
if (f < p && (p = f, a && a.copy(e), c && c.copy(i), f < h))
|
|
@@ -800,20 +800,20 @@ function ai(l, s, t, e, i = null, o = 0, n = 0) {
|
|
|
800
800
|
return Et(y, b) + ft(B, x);
|
|
801
801
|
};
|
|
802
802
|
const E = pt(l), u = Ct(l, c);
|
|
803
|
-
let p = E, A = u,
|
|
804
|
-
if (i && (
|
|
803
|
+
let p = E, A = u, m, C, R, F;
|
|
804
|
+
if (i && (R = Yt, F = fe, $(p, r, R), $(A, r, F), m = i(R), C = i(F), C < m)) {
|
|
805
805
|
p = u, A = E;
|
|
806
|
-
const y =
|
|
807
|
-
|
|
806
|
+
const y = m;
|
|
807
|
+
m = C, C = y, R = F;
|
|
808
808
|
}
|
|
809
|
-
|
|
810
|
-
const f = ht(p * 2, a),
|
|
809
|
+
R || (R = Yt, $(p, r, R));
|
|
810
|
+
const f = ht(p * 2, a), T = t(R, f, m, n + 1, o + p);
|
|
811
811
|
let O;
|
|
812
|
-
if (
|
|
812
|
+
if (T === bi) {
|
|
813
813
|
const y = L(p), b = M(p) - y;
|
|
814
|
-
O = e(y, b, !0, n + 1, o + p,
|
|
814
|
+
O = e(y, b, !0, n + 1, o + p, R);
|
|
815
815
|
} else
|
|
816
|
-
O =
|
|
816
|
+
O = T && ai(
|
|
817
817
|
p,
|
|
818
818
|
s,
|
|
819
819
|
t,
|
|
@@ -932,27 +932,27 @@ function Do(l, s = null) {
|
|
|
932
932
|
function d(E, u, p = !1) {
|
|
933
933
|
const A = E * 2;
|
|
934
934
|
if (r[A + 15] === Us) {
|
|
935
|
-
const C = n[E + 6],
|
|
936
|
-
let F = 1 / 0, f = 1 / 0,
|
|
937
|
-
for (let N = 3 * C, L = 3 * (C +
|
|
935
|
+
const C = n[E + 6], R = r[A + 14];
|
|
936
|
+
let F = 1 / 0, f = 1 / 0, T = 1 / 0, O = -1 / 0, S = -1 / 0, _ = -1 / 0;
|
|
937
|
+
for (let N = 3 * C, L = 3 * (C + R); N < L; N++) {
|
|
938
938
|
let M = e[N];
|
|
939
939
|
const y = i.getX(M), x = i.getY(M), b = i.getZ(M);
|
|
940
|
-
y < F && (F = y), y > O && (O = y), x < f && (f = x), x > S && (S = x), b <
|
|
940
|
+
y < F && (F = y), y > O && (O = y), x < f && (f = x), x > S && (S = x), b < T && (T = b), b > _ && (_ = b);
|
|
941
941
|
}
|
|
942
|
-
return a[E + 0] !== F || a[E + 1] !== f || a[E + 2] !==
|
|
942
|
+
return a[E + 0] !== F || a[E + 1] !== f || a[E + 2] !== T || a[E + 3] !== O || a[E + 4] !== S || a[E + 5] !== _ ? (a[E + 0] = F, a[E + 1] = f, a[E + 2] = T, a[E + 3] = O, a[E + 4] = S, a[E + 5] = _, !0) : !1;
|
|
943
943
|
} else {
|
|
944
|
-
const C = E + 8,
|
|
945
|
-
let
|
|
946
|
-
s ?
|
|
947
|
-
const _ =
|
|
944
|
+
const C = E + 8, R = n[E + 6], F = C + u, f = R + u;
|
|
945
|
+
let T = p, O = !1, S = !1;
|
|
946
|
+
s ? T || (O = s.has(F), S = s.has(f), T = !O && !S) : (O = !0, S = !0);
|
|
947
|
+
const _ = T || O, N = T || S;
|
|
948
948
|
let L = !1;
|
|
949
|
-
_ && (L = d(C, u,
|
|
949
|
+
_ && (L = d(C, u, T));
|
|
950
950
|
let M = !1;
|
|
951
|
-
N && (M = d(
|
|
951
|
+
N && (M = d(R, u, T));
|
|
952
952
|
const y = L || M;
|
|
953
953
|
if (y)
|
|
954
954
|
for (let x = 0; x < 3; x++) {
|
|
955
|
-
const b = C + x, B =
|
|
955
|
+
const b = C + x, B = R + x, H = a[b], q = a[b + 3], st = a[B], Q = a[B + 3];
|
|
956
956
|
a[E + x] = H < st ? H : st, a[E + x + 3] = q > Q ? q : Q;
|
|
957
957
|
}
|
|
958
958
|
return y;
|
|
@@ -960,7 +960,7 @@ function Do(l, s = null) {
|
|
|
960
960
|
}
|
|
961
961
|
}
|
|
962
962
|
const ki = /* @__PURE__ */ new Ot();
|
|
963
|
-
function
|
|
963
|
+
function Gt(l, s, t, e) {
|
|
964
964
|
return $(l, s, ki), t.intersectBox(ki, e);
|
|
965
965
|
}
|
|
966
966
|
function Uo(l, s, t, e, i, o) {
|
|
@@ -999,9 +999,9 @@ function ci(l, s, t, e, i) {
|
|
|
999
999
|
yo(s, t, e, h, d, i);
|
|
1000
1000
|
} else {
|
|
1001
1001
|
const h = pt(l);
|
|
1002
|
-
|
|
1002
|
+
Gt(h, o, e, Wi) && ci(h, s, t, e, i);
|
|
1003
1003
|
const d = Ct(l, r);
|
|
1004
|
-
|
|
1004
|
+
Gt(d, o, e, Wi) && ci(d, s, t, e, i);
|
|
1005
1005
|
}
|
|
1006
1006
|
}
|
|
1007
1007
|
const Xi = /* @__PURE__ */ new w(), Bo = ["x", "y", "z"];
|
|
@@ -1020,17 +1020,17 @@ function li(l, s, t, e) {
|
|
|
1020
1020
|
const c = xn(l, n), h = Bo[c], E = e.direction[h] >= 0;
|
|
1021
1021
|
let u, p;
|
|
1022
1022
|
E ? (u = pt(l), p = Ct(l, n)) : (u = Ct(l, n), p = pt(l));
|
|
1023
|
-
const
|
|
1024
|
-
if (
|
|
1025
|
-
const F =
|
|
1023
|
+
const m = Gt(u, i, e, Xi) ? li(u, s, t, e) : null;
|
|
1024
|
+
if (m) {
|
|
1025
|
+
const F = m.point[h];
|
|
1026
1026
|
if (E ? F <= i[p + c] : (
|
|
1027
1027
|
// min bounding data
|
|
1028
1028
|
F >= i[p + c + 3]
|
|
1029
1029
|
))
|
|
1030
|
-
return
|
|
1030
|
+
return m;
|
|
1031
1031
|
}
|
|
1032
|
-
const
|
|
1033
|
-
return
|
|
1032
|
+
const R = Gt(p, i, e, Xi) ? li(p, s, t, e) : null;
|
|
1033
|
+
return m && R ? m.distance <= R.distance ? m : R : m || R || null;
|
|
1034
1034
|
}
|
|
1035
1035
|
}
|
|
1036
1036
|
const is = /* @__PURE__ */ new Ot(), ne = /* @__PURE__ */ new Ft(), oe = /* @__PURE__ */ new Ft(), Oe = /* @__PURE__ */ new yt(), Zi = /* @__PURE__ */ new at(), ns = /* @__PURE__ */ new at();
|
|
@@ -1043,19 +1043,19 @@ function hi(l, s, t, e, i = null) {
|
|
|
1043
1043
|
const { float32Array: o, uint16Array: n, uint32Array: r } = Z;
|
|
1044
1044
|
let a = l * 2;
|
|
1045
1045
|
if (i === null && (t.boundingBox || t.computeBoundingBox(), Zi.set(t.boundingBox.min, t.boundingBox.max, e), i = Zi), ht(a, n)) {
|
|
1046
|
-
const h = s.geometry, d = h.index, E = h.attributes.position, u = t.index, p = t.attributes.position, A = Et(l, r),
|
|
1046
|
+
const h = s.geometry, d = h.index, E = h.attributes.position, u = t.index, p = t.attributes.position, A = Et(l, r), m = ft(a, n);
|
|
1047
1047
|
if (Oe.copy(e).invert(), t.boundsTree)
|
|
1048
1048
|
return $(l, o, ns), ns.matrix.copy(Oe), ns.needsUpdate = !0, t.boundsTree.shapecast({
|
|
1049
|
-
intersectsBounds: (
|
|
1050
|
-
intersectsTriangle: (
|
|
1051
|
-
|
|
1052
|
-
for (let F = A * 3, f = (
|
|
1053
|
-
if (et(oe, F, d, E), oe.needsUpdate = !0,
|
|
1049
|
+
intersectsBounds: (R) => ns.intersectsBox(R),
|
|
1050
|
+
intersectsTriangle: (R) => {
|
|
1051
|
+
R.a.applyMatrix4(e), R.b.applyMatrix4(e), R.c.applyMatrix4(e), R.needsUpdate = !0;
|
|
1052
|
+
for (let F = A * 3, f = (m + A) * 3; F < f; F += 3)
|
|
1053
|
+
if (et(oe, F, d, E), oe.needsUpdate = !0, R.intersectsTriangle(oe))
|
|
1054
1054
|
return !0;
|
|
1055
1055
|
return !1;
|
|
1056
1056
|
}
|
|
1057
1057
|
});
|
|
1058
|
-
for (let C = A * 3,
|
|
1058
|
+
for (let C = A * 3, R = (m + A) * 3; C < R; C += 3) {
|
|
1059
1059
|
et(ne, C, d, E), ne.a.applyMatrix4(Oe), ne.b.applyMatrix4(Oe), ne.c.applyMatrix4(Oe), ne.needsUpdate = !0;
|
|
1060
1060
|
for (let F = 0, f = u.count; F < f; F += 3)
|
|
1061
1061
|
if (et(oe, F, u, p), oe.needsUpdate = !0, ne.intersectsTriangle(oe))
|
|
@@ -1070,25 +1070,25 @@ const os = /* @__PURE__ */ new yt(), ks = /* @__PURE__ */ new at(), ge = /* @__P
|
|
|
1070
1070
|
function Wo(l, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
|
|
1071
1071
|
s.boundingBox || s.computeBoundingBox(), ks.set(s.boundingBox.min, s.boundingBox.max, t), ks.needsUpdate = !0;
|
|
1072
1072
|
const r = l.geometry, a = r.attributes.position, c = r.index, h = s.attributes.position, d = s.index, E = It.getPrimitive(), u = It.getPrimitive();
|
|
1073
|
-
let p = Go, A = zo,
|
|
1074
|
-
i && (
|
|
1075
|
-
let
|
|
1073
|
+
let p = Go, A = zo, m = null, C = null;
|
|
1074
|
+
i && (m = Ho, C = ko);
|
|
1075
|
+
let R = 1 / 0, F = null, f = null;
|
|
1076
1076
|
return os.copy(t).invert(), ge.matrix.copy(os), l.shapecast(
|
|
1077
1077
|
{
|
|
1078
|
-
boundsTraverseOrder: (
|
|
1079
|
-
intersectsBounds: (
|
|
1080
|
-
intersectsRange: (
|
|
1078
|
+
boundsTraverseOrder: (T) => ks.distanceToBox(T),
|
|
1079
|
+
intersectsBounds: (T, O, S) => S < R && S < n ? (O && (ge.min.copy(T.min), ge.max.copy(T.max), ge.needsUpdate = !0), !0) : !1,
|
|
1080
|
+
intersectsRange: (T, O) => {
|
|
1081
1081
|
if (s.boundsTree)
|
|
1082
1082
|
return s.boundsTree.shapecast({
|
|
1083
1083
|
boundsTraverseOrder: (_) => ge.distanceToBox(_),
|
|
1084
|
-
intersectsBounds: (_, N, L) => L <
|
|
1084
|
+
intersectsBounds: (_, N, L) => L < R && L < n,
|
|
1085
1085
|
intersectsRange: (_, N) => {
|
|
1086
1086
|
for (let L = _, M = _ + N; L < M; L++) {
|
|
1087
1087
|
et(u, 3 * L, d, h), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
|
|
1088
|
-
for (let y =
|
|
1088
|
+
for (let y = T, x = T + O; y < x; y++) {
|
|
1089
1089
|
et(E, 3 * y, c, a), E.needsUpdate = !0;
|
|
1090
|
-
const b = E.distanceToTriangle(u, p,
|
|
1091
|
-
if (b <
|
|
1090
|
+
const b = E.distanceToTriangle(u, p, m);
|
|
1091
|
+
if (b < R && (A.copy(p), C && C.copy(m), R = b, F = y, f = L), b < o)
|
|
1092
1092
|
return !0;
|
|
1093
1093
|
}
|
|
1094
1094
|
}
|
|
@@ -1098,17 +1098,17 @@ function Wo(l, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
|
|
|
1098
1098
|
const S = Ce(s);
|
|
1099
1099
|
for (let _ = 0, N = S; _ < N; _++) {
|
|
1100
1100
|
et(u, 3 * _, d, h), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
|
|
1101
|
-
for (let L =
|
|
1101
|
+
for (let L = T, M = T + O; L < M; L++) {
|
|
1102
1102
|
et(E, 3 * L, c, a), E.needsUpdate = !0;
|
|
1103
|
-
const y = E.distanceToTriangle(u, p,
|
|
1104
|
-
if (y <
|
|
1103
|
+
const y = E.distanceToTriangle(u, p, m);
|
|
1104
|
+
if (y < R && (A.copy(p), C && C.copy(m), R = y, F = L, f = _), y < o)
|
|
1105
1105
|
return !0;
|
|
1106
1106
|
}
|
|
1107
1107
|
}
|
|
1108
1108
|
}
|
|
1109
1109
|
}
|
|
1110
1110
|
}
|
|
1111
|
-
), It.releasePrimitive(E), It.releasePrimitive(u),
|
|
1111
|
+
), It.releasePrimitive(E), It.releasePrimitive(u), R === 1 / 0 ? null : (e.point ? e.point.copy(A) : e.point = A.clone(), e.distance = R, e.faceIndex = F, i && (i.point ? i.point.copy(C) : i.point = C.clone(), i.point.applyMatrix4(os), A.applyMatrix4(os), i.distance = A.sub(i.point).length(), i.faceIndex = f), e);
|
|
1112
1112
|
}
|
|
1113
1113
|
function Xo(l, s = null) {
|
|
1114
1114
|
s && Array.isArray(s) && (s = new Set(s));
|
|
@@ -1120,31 +1120,31 @@ function Xo(l, s = null) {
|
|
|
1120
1120
|
function d(E, u, p = !1) {
|
|
1121
1121
|
const A = E * 2;
|
|
1122
1122
|
if (r[A + 15] === Us) {
|
|
1123
|
-
const C = n[E + 6],
|
|
1124
|
-
let F = 1 / 0, f = 1 / 0,
|
|
1125
|
-
for (let N = C, L = C +
|
|
1123
|
+
const C = n[E + 6], R = r[A + 14];
|
|
1124
|
+
let F = 1 / 0, f = 1 / 0, T = 1 / 0, O = -1 / 0, S = -1 / 0, _ = -1 / 0;
|
|
1125
|
+
for (let N = C, L = C + R; N < L; N++) {
|
|
1126
1126
|
const M = 3 * l.resolveTriangleIndex(N);
|
|
1127
1127
|
for (let y = 0; y < 3; y++) {
|
|
1128
1128
|
let x = M + y;
|
|
1129
1129
|
x = e ? e[x] : x;
|
|
1130
1130
|
const b = i.getX(x), B = i.getY(x), H = i.getZ(x);
|
|
1131
|
-
b < F && (F = b), b > O && (O = b), B < f && (f = B), B > S && (S = B), H <
|
|
1131
|
+
b < F && (F = b), b > O && (O = b), B < f && (f = B), B > S && (S = B), H < T && (T = H), H > _ && (_ = H);
|
|
1132
1132
|
}
|
|
1133
1133
|
}
|
|
1134
|
-
return a[E + 0] !== F || a[E + 1] !== f || a[E + 2] !==
|
|
1134
|
+
return a[E + 0] !== F || a[E + 1] !== f || a[E + 2] !== T || a[E + 3] !== O || a[E + 4] !== S || a[E + 5] !== _ ? (a[E + 0] = F, a[E + 1] = f, a[E + 2] = T, a[E + 3] = O, a[E + 4] = S, a[E + 5] = _, !0) : !1;
|
|
1135
1135
|
} else {
|
|
1136
|
-
const C = E + 8,
|
|
1137
|
-
let
|
|
1138
|
-
s ?
|
|
1139
|
-
const _ =
|
|
1136
|
+
const C = E + 8, R = n[E + 6], F = C + u, f = R + u;
|
|
1137
|
+
let T = p, O = !1, S = !1;
|
|
1138
|
+
s ? T || (O = s.has(F), S = s.has(f), T = !O && !S) : (O = !0, S = !0);
|
|
1139
|
+
const _ = T || O, N = T || S;
|
|
1140
1140
|
let L = !1;
|
|
1141
|
-
_ && (L = d(C, u,
|
|
1141
|
+
_ && (L = d(C, u, T));
|
|
1142
1142
|
let M = !1;
|
|
1143
|
-
N && (M = d(
|
|
1143
|
+
N && (M = d(R, u, T));
|
|
1144
1144
|
const y = L || M;
|
|
1145
1145
|
if (y)
|
|
1146
1146
|
for (let x = 0; x < 3; x++) {
|
|
1147
|
-
const b = C + x, B =
|
|
1147
|
+
const b = C + x, B = R + x, H = a[b], q = a[b + 3], st = a[B], Q = a[B + 3];
|
|
1148
1148
|
a[E + x] = H < st ? H : st, a[E + x + 3] = q > Q ? q : Q;
|
|
1149
1149
|
}
|
|
1150
1150
|
return y;
|
|
@@ -1162,9 +1162,9 @@ function Ei(l, s, t, e, i) {
|
|
|
1162
1162
|
Uo(s, t, e, h, d, i);
|
|
1163
1163
|
} else {
|
|
1164
1164
|
const h = pt(l);
|
|
1165
|
-
|
|
1165
|
+
Gt(h, o, e, Qi) && Ei(h, s, t, e, i);
|
|
1166
1166
|
const d = Ct(l, r);
|
|
1167
|
-
|
|
1167
|
+
Gt(d, o, e, Qi) && Ei(d, s, t, e, i);
|
|
1168
1168
|
}
|
|
1169
1169
|
}
|
|
1170
1170
|
const ji = /* @__PURE__ */ new w(), Qo = ["x", "y", "z"];
|
|
@@ -1183,17 +1183,17 @@ function di(l, s, t, e) {
|
|
|
1183
1183
|
const c = xn(l, n), h = Qo[c], E = e.direction[h] >= 0;
|
|
1184
1184
|
let u, p;
|
|
1185
1185
|
E ? (u = pt(l), p = Ct(l, n)) : (u = Ct(l, n), p = pt(l));
|
|
1186
|
-
const
|
|
1187
|
-
if (
|
|
1188
|
-
const F =
|
|
1186
|
+
const m = Gt(u, i, e, ji) ? di(u, s, t, e) : null;
|
|
1187
|
+
if (m) {
|
|
1188
|
+
const F = m.point[h];
|
|
1189
1189
|
if (E ? F <= i[p + c] : (
|
|
1190
1190
|
// min bounding data
|
|
1191
1191
|
F >= i[p + c + 3]
|
|
1192
1192
|
))
|
|
1193
|
-
return
|
|
1193
|
+
return m;
|
|
1194
1194
|
}
|
|
1195
|
-
const
|
|
1196
|
-
return
|
|
1195
|
+
const R = Gt(p, i, e, ji) ? di(p, s, t, e) : null;
|
|
1196
|
+
return m && R ? m.distance <= R.distance ? m : R : m || R || null;
|
|
1197
1197
|
}
|
|
1198
1198
|
}
|
|
1199
1199
|
const rs = /* @__PURE__ */ new Ot(), re = /* @__PURE__ */ new Ft(), ae = /* @__PURE__ */ new Ft(), Se = /* @__PURE__ */ new yt(), qi = /* @__PURE__ */ new at(), as = /* @__PURE__ */ new at();
|
|
@@ -1206,22 +1206,22 @@ function ui(l, s, t, e, i = null) {
|
|
|
1206
1206
|
const { float32Array: o, uint16Array: n, uint32Array: r } = Z;
|
|
1207
1207
|
let a = l * 2;
|
|
1208
1208
|
if (i === null && (t.boundingBox || t.computeBoundingBox(), qi.set(t.boundingBox.min, t.boundingBox.max, e), i = qi), ht(a, n)) {
|
|
1209
|
-
const h = s.geometry, d = h.index, E = h.attributes.position, u = t.index, p = t.attributes.position, A = Et(l, r),
|
|
1209
|
+
const h = s.geometry, d = h.index, E = h.attributes.position, u = t.index, p = t.attributes.position, A = Et(l, r), m = ft(a, n);
|
|
1210
1210
|
if (Se.copy(e).invert(), t.boundsTree)
|
|
1211
1211
|
return $(l, o, as), as.matrix.copy(Se), as.needsUpdate = !0, t.boundsTree.shapecast({
|
|
1212
|
-
intersectsBounds: (
|
|
1213
|
-
intersectsTriangle: (
|
|
1214
|
-
|
|
1215
|
-
for (let F = A, f =
|
|
1216
|
-
if (et(ae, 3 * s.resolveTriangleIndex(F), d, E), ae.needsUpdate = !0,
|
|
1212
|
+
intersectsBounds: (R) => as.intersectsBox(R),
|
|
1213
|
+
intersectsTriangle: (R) => {
|
|
1214
|
+
R.a.applyMatrix4(e), R.b.applyMatrix4(e), R.c.applyMatrix4(e), R.needsUpdate = !0;
|
|
1215
|
+
for (let F = A, f = m + A; F < f; F++)
|
|
1216
|
+
if (et(ae, 3 * s.resolveTriangleIndex(F), d, E), ae.needsUpdate = !0, R.intersectsTriangle(ae))
|
|
1217
1217
|
return !0;
|
|
1218
1218
|
return !1;
|
|
1219
1219
|
}
|
|
1220
1220
|
});
|
|
1221
|
-
for (let C = A,
|
|
1221
|
+
for (let C = A, R = m + A; C < R; C++) {
|
|
1222
1222
|
const F = s.resolveTriangleIndex(C);
|
|
1223
1223
|
et(re, 3 * F, d, E), re.a.applyMatrix4(Se), re.b.applyMatrix4(Se), re.c.applyMatrix4(Se), re.needsUpdate = !0;
|
|
1224
|
-
for (let f = 0,
|
|
1224
|
+
for (let f = 0, T = u.count; f < T; f += 3)
|
|
1225
1225
|
if (et(ae, f, u, p), ae.needsUpdate = !0, re.intersectsTriangle(ae))
|
|
1226
1226
|
return !0;
|
|
1227
1227
|
}
|
|
@@ -1234,28 +1234,28 @@ const cs = /* @__PURE__ */ new yt(), Ws = /* @__PURE__ */ new at(), _e = /* @__P
|
|
|
1234
1234
|
function er(l, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
|
|
1235
1235
|
s.boundingBox || s.computeBoundingBox(), Ws.set(s.boundingBox.min, s.boundingBox.max, t), Ws.needsUpdate = !0;
|
|
1236
1236
|
const r = l.geometry, a = r.attributes.position, c = r.index, h = s.attributes.position, d = s.index, E = It.getPrimitive(), u = It.getPrimitive();
|
|
1237
|
-
let p = $o, A = Ko,
|
|
1238
|
-
i && (
|
|
1239
|
-
let
|
|
1237
|
+
let p = $o, A = Ko, m = null, C = null;
|
|
1238
|
+
i && (m = Jo, C = tr);
|
|
1239
|
+
let R = 1 / 0, F = null, f = null;
|
|
1240
1240
|
return cs.copy(t).invert(), _e.matrix.copy(cs), l.shapecast(
|
|
1241
1241
|
{
|
|
1242
|
-
boundsTraverseOrder: (
|
|
1243
|
-
intersectsBounds: (
|
|
1244
|
-
intersectsRange: (
|
|
1242
|
+
boundsTraverseOrder: (T) => Ws.distanceToBox(T),
|
|
1243
|
+
intersectsBounds: (T, O, S) => S < R && S < n ? (O && (_e.min.copy(T.min), _e.max.copy(T.max), _e.needsUpdate = !0), !0) : !1,
|
|
1244
|
+
intersectsRange: (T, O) => {
|
|
1245
1245
|
if (s.boundsTree) {
|
|
1246
1246
|
const S = s.boundsTree;
|
|
1247
1247
|
return S.shapecast({
|
|
1248
1248
|
boundsTraverseOrder: (_) => _e.distanceToBox(_),
|
|
1249
|
-
intersectsBounds: (_, N, L) => L <
|
|
1249
|
+
intersectsBounds: (_, N, L) => L < R && L < n,
|
|
1250
1250
|
intersectsRange: (_, N) => {
|
|
1251
1251
|
for (let L = _, M = _ + N; L < M; L++) {
|
|
1252
1252
|
const y = S.resolveTriangleIndex(L);
|
|
1253
1253
|
et(u, 3 * y, d, h), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
|
|
1254
|
-
for (let x =
|
|
1254
|
+
for (let x = T, b = T + O; x < b; x++) {
|
|
1255
1255
|
const B = l.resolveTriangleIndex(x);
|
|
1256
1256
|
et(E, 3 * B, c, a), E.needsUpdate = !0;
|
|
1257
|
-
const H = E.distanceToTriangle(u, p,
|
|
1258
|
-
if (H <
|
|
1257
|
+
const H = E.distanceToTriangle(u, p, m);
|
|
1258
|
+
if (H < R && (A.copy(p), C && C.copy(m), R = H, F = x, f = L), H < o)
|
|
1259
1259
|
return !0;
|
|
1260
1260
|
}
|
|
1261
1261
|
}
|
|
@@ -1265,18 +1265,18 @@ function er(l, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
|
|
|
1265
1265
|
const S = Ce(s);
|
|
1266
1266
|
for (let _ = 0, N = S; _ < N; _++) {
|
|
1267
1267
|
et(u, 3 * _, d, h), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
|
|
1268
|
-
for (let L =
|
|
1268
|
+
for (let L = T, M = T + O; L < M; L++) {
|
|
1269
1269
|
const y = l.resolveTriangleIndex(L);
|
|
1270
1270
|
et(E, 3 * y, c, a), E.needsUpdate = !0;
|
|
1271
|
-
const x = E.distanceToTriangle(u, p,
|
|
1272
|
-
if (x <
|
|
1271
|
+
const x = E.distanceToTriangle(u, p, m);
|
|
1272
|
+
if (x < R && (A.copy(p), C && C.copy(m), R = x, F = L, f = _), x < o)
|
|
1273
1273
|
return !0;
|
|
1274
1274
|
}
|
|
1275
1275
|
}
|
|
1276
1276
|
}
|
|
1277
1277
|
}
|
|
1278
1278
|
}
|
|
1279
|
-
), It.releasePrimitive(E), It.releasePrimitive(u),
|
|
1279
|
+
), It.releasePrimitive(E), It.releasePrimitive(u), R === 1 / 0 ? null : (e.point ? e.point.copy(A) : e.point = A.clone(), e.distance = R, e.faceIndex = F, i && (i.point ? i.point.copy(C) : i.point = C.clone(), i.point.applyMatrix4(cs), A.applyMatrix4(cs), i.distance = A.sub(i.point).length(), i.faceIndex = f), e);
|
|
1280
1280
|
}
|
|
1281
1281
|
function sr() {
|
|
1282
1282
|
return typeof SharedArrayBuffer < "u";
|
|
@@ -1315,12 +1315,12 @@ function ir(l, s, t, e) {
|
|
|
1315
1315
|
function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
|
|
1316
1316
|
let d, E;
|
|
1317
1317
|
h ? (d = As, E = be) : (d = be, E = As);
|
|
1318
|
-
const u = d.float32Array, p = d.uint32Array, A = d.uint16Array,
|
|
1318
|
+
const u = d.float32Array, p = d.uint32Array, A = d.uint16Array, m = E.float32Array, C = E.uint32Array, R = E.uint16Array, F = l * 2, f = s * 2, T = ht(F, A), O = ht(f, R);
|
|
1319
1319
|
let S = !1;
|
|
1320
|
-
if (O &&
|
|
1320
|
+
if (O && T)
|
|
1321
1321
|
h ? S = i(
|
|
1322
1322
|
Et(s, C),
|
|
1323
|
-
ft(s * 2,
|
|
1323
|
+
ft(s * 2, R),
|
|
1324
1324
|
Et(l, p),
|
|
1325
1325
|
ft(l * 2, A),
|
|
1326
1326
|
a,
|
|
@@ -1331,7 +1331,7 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
|
|
|
1331
1331
|
Et(l, p),
|
|
1332
1332
|
ft(l * 2, A),
|
|
1333
1333
|
Et(s, C),
|
|
1334
|
-
ft(s * 2,
|
|
1334
|
+
ft(s * 2, R),
|
|
1335
1335
|
r,
|
|
1336
1336
|
o + l,
|
|
1337
1337
|
a,
|
|
@@ -1339,7 +1339,7 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
|
|
|
1339
1339
|
);
|
|
1340
1340
|
else if (O) {
|
|
1341
1341
|
const _ = vt.getPrimitive();
|
|
1342
|
-
$(s,
|
|
1342
|
+
$(s, m, _), _.applyMatrix4(t);
|
|
1343
1343
|
const N = pt(l), L = Ct(l, p);
|
|
1344
1344
|
$(N, u, ce), $(L, u, le);
|
|
1345
1345
|
const M = _.intersectsBox(ce), y = _.intersectsBox(le);
|
|
@@ -1370,7 +1370,7 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
|
|
|
1370
1370
|
), vt.releasePrimitive(_);
|
|
1371
1371
|
} else {
|
|
1372
1372
|
const _ = pt(s), N = Ct(s, C);
|
|
1373
|
-
$(_,
|
|
1373
|
+
$(_, m, Xs), $(N, m, Zs);
|
|
1374
1374
|
const L = c.intersectsBox(Xs), M = c.intersectsBox(Zs);
|
|
1375
1375
|
if (L && M)
|
|
1376
1376
|
S = Tt(
|
|
@@ -1399,7 +1399,7 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
|
|
|
1399
1399
|
h
|
|
1400
1400
|
);
|
|
1401
1401
|
else if (L)
|
|
1402
|
-
if (
|
|
1402
|
+
if (T)
|
|
1403
1403
|
S = Tt(
|
|
1404
1404
|
l,
|
|
1405
1405
|
_,
|
|
@@ -1446,7 +1446,7 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
|
|
|
1446
1446
|
), vt.releasePrimitive(y);
|
|
1447
1447
|
}
|
|
1448
1448
|
else if (M)
|
|
1449
|
-
if (
|
|
1449
|
+
if (T)
|
|
1450
1450
|
S = Tt(
|
|
1451
1451
|
l,
|
|
1452
1452
|
N,
|
|
@@ -1582,8 +1582,8 @@ class Si {
|
|
|
1582
1582
|
const u = r ? t[a[d].materialIndex].side : c, p = o.length;
|
|
1583
1583
|
if (h(this, d, u, s, o), r) {
|
|
1584
1584
|
const A = a[d].materialIndex;
|
|
1585
|
-
for (let
|
|
1586
|
-
o[
|
|
1585
|
+
for (let m = p, C = o.length; m < C; m++)
|
|
1586
|
+
o[m].face.materialIndex = A;
|
|
1587
1587
|
}
|
|
1588
1588
|
}
|
|
1589
1589
|
return o;
|
|
@@ -1615,7 +1615,7 @@ class Si {
|
|
|
1615
1615
|
} = s;
|
|
1616
1616
|
if (n && r) {
|
|
1617
1617
|
const d = n;
|
|
1618
|
-
n = (E, u, p, A,
|
|
1618
|
+
n = (E, u, p, A, m) => d(E, u, p, A, m) ? !0 : e(E, u, this, r, p, A, t);
|
|
1619
1619
|
} else
|
|
1620
1620
|
n || (r ? n = (d, E, u, p) => e(d, E, this, r, u, p, t) : n = (d, E, u) => u);
|
|
1621
1621
|
let a = !1, c = 0;
|
|
@@ -1645,19 +1645,19 @@ class Si {
|
|
|
1645
1645
|
et(h, p * 3, d, E);
|
|
1646
1646
|
};
|
|
1647
1647
|
if (o) {
|
|
1648
|
-
const p = (A,
|
|
1649
|
-
for (let S = C, _ = C +
|
|
1648
|
+
const p = (A, m, C, R, F, f, T, O) => {
|
|
1649
|
+
for (let S = C, _ = C + R; S < _; S++) {
|
|
1650
1650
|
u(S), h.a.applyMatrix4(t), h.b.applyMatrix4(t), h.c.applyMatrix4(t), h.needsUpdate = !0;
|
|
1651
|
-
for (let N = A, L = A +
|
|
1652
|
-
if (c(N), n.needsUpdate = !0, o(n, h, N, S, F, f,
|
|
1651
|
+
for (let N = A, L = A + m; N < L; N++)
|
|
1652
|
+
if (c(N), n.needsUpdate = !0, o(n, h, N, S, F, f, T, O))
|
|
1653
1653
|
return !0;
|
|
1654
1654
|
}
|
|
1655
1655
|
return !1;
|
|
1656
1656
|
};
|
|
1657
1657
|
if (i) {
|
|
1658
1658
|
const A = i;
|
|
1659
|
-
i = function(
|
|
1660
|
-
return A(
|
|
1659
|
+
i = function(m, C, R, F, f, T, O, S) {
|
|
1660
|
+
return A(m, C, R, F, f, T, O, S) ? !0 : p(m, C, R, F, f, T, O, S);
|
|
1661
1661
|
};
|
|
1662
1662
|
} else
|
|
1663
1663
|
i = p;
|
|
@@ -1765,7 +1765,7 @@ class D {
|
|
|
1765
1765
|
this.handlers.length = 0;
|
|
1766
1766
|
}
|
|
1767
1767
|
}
|
|
1768
|
-
class
|
|
1768
|
+
class $t {
|
|
1769
1769
|
constructor() {
|
|
1770
1770
|
/** Triggers all the callbacks assigned to this event. */
|
|
1771
1771
|
I(this, "trigger", async (s) => {
|
|
@@ -1931,7 +1931,7 @@ const ve = class ve extends J {
|
|
|
1931
1931
|
}
|
|
1932
1932
|
};
|
|
1933
1933
|
I(ve, "uuid", "76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe");
|
|
1934
|
-
let
|
|
1934
|
+
let zt = ve;
|
|
1935
1935
|
class hr extends Ni {
|
|
1936
1936
|
constructor(t) {
|
|
1937
1937
|
super(t);
|
|
@@ -1940,7 +1940,7 @@ class hr extends Ni {
|
|
|
1940
1940
|
}
|
|
1941
1941
|
/** {@link Disposable.dispose} */
|
|
1942
1942
|
dispose() {
|
|
1943
|
-
const t = this.components.get(
|
|
1943
|
+
const t = this.components.get(zt);
|
|
1944
1944
|
for (const e of this.three.children) {
|
|
1945
1945
|
const i = e;
|
|
1946
1946
|
i.geometry && t.destroy(i);
|
|
@@ -2129,9 +2129,9 @@ class ur {
|
|
|
2129
2129
|
if (p !== r && p !== a && p !== c && p !== h) {
|
|
2130
2130
|
o = this.tolerance;
|
|
2131
2131
|
let A = null;
|
|
2132
|
-
for (let
|
|
2133
|
-
const C = this.faces[
|
|
2134
|
-
C > o && (o = C, A = this.faces[
|
|
2132
|
+
for (let m = 0; m < 4; m++) {
|
|
2133
|
+
const C = this.faces[m].distanceToPoint(p.point);
|
|
2134
|
+
C > o && (o = C, A = this.faces[m]);
|
|
2135
2135
|
}
|
|
2136
2136
|
A !== null && this.addVertexToFace(p, A);
|
|
2137
2137
|
}
|
|
@@ -2346,8 +2346,8 @@ function Tr(l, s) {
|
|
|
2346
2346
|
function mr(l) {
|
|
2347
2347
|
const s = [];
|
|
2348
2348
|
for (let it = 0; it < l.length - 2; it += 3) {
|
|
2349
|
-
const
|
|
2350
|
-
s.push(new g.Vector3(
|
|
2349
|
+
const Xt = l[it], tt = l[it + 1], Jt = l[it + 2];
|
|
2350
|
+
s.push(new g.Vector3(Xt, tt, Jt));
|
|
2351
2351
|
}
|
|
2352
2352
|
const t = new ur();
|
|
2353
2353
|
t.setFromPoints(s);
|
|
@@ -2355,7 +2355,7 @@ function mr(l) {
|
|
|
2355
2355
|
unitary: new g.Matrix3(),
|
|
2356
2356
|
diagonal: new g.Matrix3()
|
|
2357
2357
|
}, i = t.faces, o = [], n = [];
|
|
2358
|
-
for (let it = 0,
|
|
2358
|
+
for (let it = 0, Xt = i.length; it < Xt; it++) {
|
|
2359
2359
|
const tt = i[it];
|
|
2360
2360
|
let Jt = tt.edge;
|
|
2361
2361
|
o.length = 0;
|
|
@@ -2369,29 +2369,29 @@ function mr(l) {
|
|
|
2369
2369
|
}
|
|
2370
2370
|
}
|
|
2371
2371
|
const r = new g.Vector3(), a = new g.Vector3(), c = new g.Vector3(), h = new g.Vector3(), d = new g.Vector3(), E = new g.Vector3(), u = new g.Vector3(), p = new g.Vector3();
|
|
2372
|
-
let A = 0,
|
|
2373
|
-
for (let it = 0,
|
|
2372
|
+
let A = 0, m = 0, C = 0, R = 0, F = 0, f = 0, T = 0;
|
|
2373
|
+
for (let it = 0, Xt = n.length; it < Xt; it += 9) {
|
|
2374
2374
|
r.fromArray(n, it), a.fromArray(n, it + 3), c.fromArray(n, it + 6), u.set(0, 0, 0), u.add(r).add(a).add(c).divideScalar(3), h.subVectors(a, r), d.subVectors(c, r);
|
|
2375
2375
|
const tt = E.crossVectors(h, d).length() / 2;
|
|
2376
|
-
p.add(E.copy(u).multiplyScalar(tt)), A += tt,
|
|
2376
|
+
p.add(E.copy(u).multiplyScalar(tt)), A += tt, m += (9 * u.x * u.x + r.x * r.x + a.x * a.x + c.x * c.x) * (tt / 12), C += (9 * u.x * u.y + r.x * r.y + a.x * a.y + c.x * c.y) * (tt / 12), R += (9 * u.x * u.z + r.x * r.z + a.x * a.z + c.x * c.z) * (tt / 12), F += (9 * u.y * u.y + r.y * r.y + a.y * a.y + c.y * c.y) * (tt / 12), f += (9 * u.y * u.z + r.y * r.z + a.y * a.z + c.y * c.z) * (tt / 12), T += (9 * u.z * u.z + r.z * r.z + a.z * a.z + c.z * c.z) * (tt / 12);
|
|
2377
2377
|
}
|
|
2378
|
-
p.divideScalar(A),
|
|
2378
|
+
p.divideScalar(A), m /= A, C /= A, R /= A, F /= A, f /= A, T /= A, m -= p.x * p.x, C -= p.x * p.y, R -= p.x * p.z, F -= p.y * p.y, f -= p.y * p.z, T -= p.z * p.z;
|
|
2379
2379
|
const O = new g.Matrix3();
|
|
2380
|
-
O.elements[0] =
|
|
2380
|
+
O.elements[0] = m, O.elements[1] = C, O.elements[2] = R, O.elements[3] = C, O.elements[4] = F, O.elements[5] = f, O.elements[6] = R, O.elements[7] = f, O.elements[8] = T, Tr(O, e);
|
|
2381
2381
|
const S = e.unitary, _ = new g.Vector3(), N = new g.Vector3(), L = new g.Vector3();
|
|
2382
2382
|
S.extractBasis(_, N, L);
|
|
2383
2383
|
let M = -1 / 0, y = -1 / 0, x = -1 / 0, b = 1 / 0, B = 1 / 0, H = 1 / 0;
|
|
2384
|
-
for (let it = 0,
|
|
2384
|
+
for (let it = 0, Xt = s.length; it < Xt; it++) {
|
|
2385
2385
|
const tt = s[it];
|
|
2386
2386
|
M = Math.max(_.dot(tt), M), y = Math.max(N.dot(tt), y), x = Math.max(L.dot(tt), x), b = Math.min(_.dot(tt), b), B = Math.min(N.dot(tt), B), H = Math.min(L.dot(tt), H);
|
|
2387
2387
|
}
|
|
2388
2388
|
_.multiplyScalar(0.5 * (b + M)), N.multiplyScalar(0.5 * (B + y)), L.multiplyScalar(0.5 * (H + x));
|
|
2389
2389
|
const q = new g.Vector3(), st = new g.Vector3(), Q = new g.Matrix3();
|
|
2390
2390
|
q.add(_).add(N).add(L), st.x = M - b, st.y = y - B, st.z = x - H, st.multiplyScalar(0.5), Q.copy(S);
|
|
2391
|
-
const { x:
|
|
2392
|
-
Xe.makeScale(
|
|
2391
|
+
const { x: Ht, y: kt, z: Wt } = st, Xe = new g.Matrix4();
|
|
2392
|
+
Xe.makeScale(Ht * 2, kt * 2, Wt * 2);
|
|
2393
2393
|
const Te = new g.Matrix4();
|
|
2394
|
-
Te.makeTranslation(-
|
|
2394
|
+
Te.makeTranslation(-Ht, -kt, -Wt);
|
|
2395
2395
|
const wi = new g.Matrix4();
|
|
2396
2396
|
wi.makeTranslation(q.x, q.y, q.z);
|
|
2397
2397
|
const Mi = new g.Matrix4();
|
|
@@ -3009,7 +3009,7 @@ class Or extends _i {
|
|
|
3009
3009
|
}
|
|
3010
3010
|
dispose(t = !0) {
|
|
3011
3011
|
if (this.enabled = !1, this.isDisposing = !0, this.scene.onWorldChanged.trigger({ world: this, action: "removed" }), this.camera.onWorldChanged.trigger({ world: this, action: "removed" }), this.renderer && this.renderer.onWorldChanged.trigger({ world: this, action: "removed" }), t) {
|
|
3012
|
-
const e = this.components.get(
|
|
3012
|
+
const e = this.components.get(zt);
|
|
3013
3013
|
this.scene.dispose(), this.camera.isDisposeable() && this.camera.dispose(), this.renderer && this.renderer.dispose();
|
|
3014
3014
|
for (const i of this.meshes)
|
|
3015
3015
|
e.destroy(i);
|
|
@@ -3158,7 +3158,7 @@ const V = {
|
|
|
3158
3158
|
IN: 1,
|
|
3159
3159
|
OUT: -1
|
|
3160
3160
|
};
|
|
3161
|
-
function
|
|
3161
|
+
function Zt(l) {
|
|
3162
3162
|
return l.isPerspectiveCamera;
|
|
3163
3163
|
}
|
|
3164
3164
|
function bt(l) {
|
|
@@ -3198,16 +3198,16 @@ function an(l, s, t, e, i = 1 / 0, o, n) {
|
|
|
3198
3198
|
e = Math.max(1e-4, e);
|
|
3199
3199
|
const r = 2 / e, a = r * o, c = 1 / (1 + a + 0.48 * a * a + 0.235 * a * a * a);
|
|
3200
3200
|
let h = s.x, d = s.y, E = s.z, u = l.x - h, p = l.y - d, A = l.z - E;
|
|
3201
|
-
const
|
|
3202
|
-
if (
|
|
3203
|
-
const B = Math.sqrt(
|
|
3201
|
+
const m = h, C = d, R = E, F = i * e, f = F * F, T = u * u + p * p + A * A;
|
|
3202
|
+
if (T > f) {
|
|
3203
|
+
const B = Math.sqrt(T);
|
|
3204
3204
|
u = u / B * F, p = p / B * F, A = A / B * F;
|
|
3205
3205
|
}
|
|
3206
3206
|
h = l.x - u, d = l.y - p, E = l.z - A;
|
|
3207
3207
|
const O = (t.x + r * u) * o, S = (t.y + r * p) * o, _ = (t.z + r * A) * o;
|
|
3208
3208
|
t.x = (t.x - r * O) * c, t.y = (t.y - r * S) * c, t.z = (t.z - r * _) * c, n.x = h + (u + O) * c, n.y = d + (p + S) * c, n.z = E + (A + _) * c;
|
|
3209
|
-
const N =
|
|
3210
|
-
return N * y + L * x + M * b > 0 && (n.x =
|
|
3209
|
+
const N = m - l.x, L = C - l.y, M = R - l.z, y = n.x - m, x = n.y - C, b = n.z - R;
|
|
3210
|
+
return N * y + L * x + M * b > 0 && (n.x = m, n.y = C, n.z = R, t.x = (n.x - m) / o, t.y = (n.y - C) / o, t.z = (n.z - R) / o), n;
|
|
3211
3211
|
}
|
|
3212
3212
|
function Ks(l, s) {
|
|
3213
3213
|
s.set(0, 0), l.forEach((t) => {
|
|
@@ -3282,7 +3282,7 @@ class gr {
|
|
|
3282
3282
|
}
|
|
3283
3283
|
}
|
|
3284
3284
|
const Sr = "2.7.3", ds = 1 / 8, vn = typeof window < "u", _r = vn && /Mac/.test(navigator.platform), Nr = !(vn && "PointerEvent" in window);
|
|
3285
|
-
let Y, cn, us, ti, lt, G, z, de, ye, gt, St,
|
|
3285
|
+
let Y, cn, us, ti, lt, G, z, de, ye, gt, St, Qt, ln, hn, dt, we, ue, En, ei, dn, si, ii, Is;
|
|
3286
3286
|
class ot extends gr {
|
|
3287
3287
|
/**
|
|
3288
3288
|
* Injects THREE as the dependency. You can then proceed to use CameraControls.
|
|
@@ -3325,7 +3325,7 @@ class ot extends gr {
|
|
|
3325
3325
|
* @category Statics
|
|
3326
3326
|
*/
|
|
3327
3327
|
static install(s) {
|
|
3328
|
-
Y = s.THREE, cn = Object.freeze(new Y.Vector3(0, 0, 0)), us = Object.freeze(new Y.Vector3(0, 1, 0)), ti = Object.freeze(new Y.Vector3(0, 0, 1)), lt = new Y.Vector2(), G = new Y.Vector3(), z = new Y.Vector3(), de = new Y.Vector3(), ye = new Y.Vector3(), gt = new Y.Vector3(), St = new Y.Vector3(),
|
|
3328
|
+
Y = s.THREE, cn = Object.freeze(new Y.Vector3(0, 0, 0)), us = Object.freeze(new Y.Vector3(0, 1, 0)), ti = Object.freeze(new Y.Vector3(0, 0, 1)), lt = new Y.Vector2(), G = new Y.Vector3(), z = new Y.Vector3(), de = new Y.Vector3(), ye = new Y.Vector3(), gt = new Y.Vector3(), St = new Y.Vector3(), Qt = new Y.Vector3(), ln = new Y.Vector3(), hn = new Y.Vector3(), dt = new Y.Spherical(), we = new Y.Spherical(), ue = new Y.Box3(), En = new Y.Box3(), ei = new Y.Sphere(), dn = new Y.Quaternion(), si = new Y.Quaternion(), ii = new Y.Matrix4(), Is = new Y.Raycaster();
|
|
3329
3329
|
}
|
|
3330
3330
|
/**
|
|
3331
3331
|
* list all ACTIONs
|
|
@@ -3353,26 +3353,26 @@ class ot extends gr {
|
|
|
3353
3353
|
*/
|
|
3354
3354
|
constructor(s, t) {
|
|
3355
3355
|
super(), this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.minDistance = Number.EPSILON, this.maxDistance = 1 / 0, this.infinityDolly = !1, this.minZoom = 0.01, this.maxZoom = 1 / 0, this.smoothTime = 0.25, this.draggingSmoothTime = 0.125, this.maxSpeed = 1 / 0, this.azimuthRotateSpeed = 1, this.polarRotateSpeed = 1, this.dollySpeed = 1, this.dollyDragInverted = !1, this.truckSpeed = 2, this.dollyToCursor = !1, this.dragToOffset = !1, this.verticalDragToForward = !1, this.boundaryFriction = 0, this.restThreshold = 0.01, this.colliderMeshes = [], this.cancel = () => {
|
|
3356
|
-
}, this._enabled = !0, this._state = P.NONE, this._viewport = null, this._changedDolly = 0, this._changedZoom = 0, this._hasRested = !0, this._boundaryEnclosesCamera = !1, this._needsUpdate = !0, this._updatedLastTime = !1, this._elementRect = new DOMRect(), this._isDragging = !1, this._dragNeedsUpdate = !0, this._activePointers = [], this._lockedPointer = null, this._interactiveArea = new DOMRect(0, 0, 1, 1), this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._isUserControllingOffset = !1, this._isUserControllingZoom = !1, this._lastDollyDirection = he.NONE, this._thetaVelocity = { value: 0 }, this._phiVelocity = { value: 0 }, this._radiusVelocity = { value: 0 }, this._targetVelocity = new Y.Vector3(), this._focalOffsetVelocity = new Y.Vector3(), this._zoomVelocity = { value: 0 }, this._truckInternal = (f,
|
|
3356
|
+
}, this._enabled = !0, this._state = P.NONE, this._viewport = null, this._changedDolly = 0, this._changedZoom = 0, this._hasRested = !0, this._boundaryEnclosesCamera = !1, this._needsUpdate = !0, this._updatedLastTime = !1, this._elementRect = new DOMRect(), this._isDragging = !1, this._dragNeedsUpdate = !0, this._activePointers = [], this._lockedPointer = null, this._interactiveArea = new DOMRect(0, 0, 1, 1), this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._isUserControllingOffset = !1, this._isUserControllingZoom = !1, this._lastDollyDirection = he.NONE, this._thetaVelocity = { value: 0 }, this._phiVelocity = { value: 0 }, this._radiusVelocity = { value: 0 }, this._targetVelocity = new Y.Vector3(), this._focalOffsetVelocity = new Y.Vector3(), this._zoomVelocity = { value: 0 }, this._truckInternal = (f, T, O) => {
|
|
3357
3357
|
let S, _;
|
|
3358
|
-
if (
|
|
3358
|
+
if (Zt(this._camera)) {
|
|
3359
3359
|
const N = G.copy(this._camera.position).sub(this._target), L = this._camera.getEffectiveFOV() * Ne, M = N.length() * Math.tan(L * 0.5);
|
|
3360
|
-
S = this.truckSpeed * f * M / this._elementRect.height, _ = this.truckSpeed *
|
|
3360
|
+
S = this.truckSpeed * f * M / this._elementRect.height, _ = this.truckSpeed * T * M / this._elementRect.height;
|
|
3361
3361
|
} else if (bt(this._camera)) {
|
|
3362
3362
|
const N = this._camera;
|
|
3363
|
-
S = f * (N.right - N.left) / N.zoom / this._elementRect.width, _ =
|
|
3363
|
+
S = f * (N.right - N.left) / N.zoom / this._elementRect.width, _ = T * (N.top - N.bottom) / N.zoom / this._elementRect.height;
|
|
3364
3364
|
} else
|
|
3365
3365
|
return;
|
|
3366
3366
|
this.verticalDragToForward ? (O ? this.setFocalOffset(this._focalOffsetEnd.x + S, this._focalOffsetEnd.y, this._focalOffsetEnd.z, !0) : this.truck(S, 0, !0), this.forward(-_, !0)) : O ? this.setFocalOffset(this._focalOffsetEnd.x + S, this._focalOffsetEnd.y + _, this._focalOffsetEnd.z, !0) : this.truck(S, _, !0);
|
|
3367
|
-
}, this._rotateInternal = (f,
|
|
3368
|
-
const O = Ee * this.azimuthRotateSpeed * f / this._elementRect.height, S = Ee * this.polarRotateSpeed *
|
|
3367
|
+
}, this._rotateInternal = (f, T) => {
|
|
3368
|
+
const O = Ee * this.azimuthRotateSpeed * f / this._elementRect.height, S = Ee * this.polarRotateSpeed * T / this._elementRect.height;
|
|
3369
3369
|
this.rotate(O, S, !0);
|
|
3370
|
-
}, this._dollyInternal = (f,
|
|
3370
|
+
}, this._dollyInternal = (f, T, O) => {
|
|
3371
3371
|
const S = Math.pow(0.95, -f * this.dollySpeed), _ = this._sphericalEnd.radius, N = this._sphericalEnd.radius * S, L = mt(N, this.minDistance, this.maxDistance), M = L - N;
|
|
3372
|
-
this.infinityDolly && this.dollyToCursor ? this._dollyToNoClamp(N, !0) : this.infinityDolly && !this.dollyToCursor ? (this.dollyInFixed(M, !0), this._dollyToNoClamp(L, !0)) : this._dollyToNoClamp(L, !0), this.dollyToCursor && (this._changedDolly += (this.infinityDolly ? N : L) - _, this._dollyControlCoord.set(
|
|
3373
|
-
}, this._zoomInternal = (f,
|
|
3372
|
+
this.infinityDolly && this.dollyToCursor ? this._dollyToNoClamp(N, !0) : this.infinityDolly && !this.dollyToCursor ? (this.dollyInFixed(M, !0), this._dollyToNoClamp(L, !0)) : this._dollyToNoClamp(L, !0), this.dollyToCursor && (this._changedDolly += (this.infinityDolly ? N : L) - _, this._dollyControlCoord.set(T, O)), this._lastDollyDirection = Math.sign(-f);
|
|
3373
|
+
}, this._zoomInternal = (f, T, O) => {
|
|
3374
3374
|
const S = Math.pow(0.95, f * this.dollySpeed), _ = this._zoom, N = this._zoom * S;
|
|
3375
|
-
this.zoomTo(N, !0), this.dollyToCursor && (this._changedZoom += N - _, this._dollyControlCoord.set(
|
|
3375
|
+
this.zoomTo(N, !0), this.dollyToCursor && (this._changedZoom += N - _, this._dollyControlCoord.set(T, O));
|
|
3376
3376
|
}, typeof Y > "u" && console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."), this._camera = s, this._yAxisUpSpace = new Y.Quaternion().setFromUnitVectors(this._camera.up, us), this._yAxisUpSpaceInverse = this._yAxisUpSpace.clone().invert(), this._state = P.NONE, this._target = new Y.Vector3(), this._targetEnd = this._target.clone(), this._focalOffset = new Y.Vector3(), this._focalOffsetEnd = this._focalOffset.clone(), this._spherical = new Y.Spherical().setFromVector3(G.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)), this._sphericalEnd = this._spherical.clone(), this._lastDistance = this._spherical.radius, this._zoom = this._camera.zoom, this._zoomEnd = this._zoom, this._lastZoom = this._zoom, this._nearPlaneCorners = [
|
|
3377
3377
|
new Y.Vector3(),
|
|
3378
3378
|
new Y.Vector3(),
|
|
@@ -3382,10 +3382,10 @@ class ot extends gr {
|
|
|
3382
3382
|
left: P.ROTATE,
|
|
3383
3383
|
middle: P.DOLLY,
|
|
3384
3384
|
right: P.TRUCK,
|
|
3385
|
-
wheel:
|
|
3385
|
+
wheel: Zt(this._camera) ? P.DOLLY : bt(this._camera) ? P.ZOOM : P.NONE
|
|
3386
3386
|
}, this.touches = {
|
|
3387
3387
|
one: P.TOUCH_ROTATE,
|
|
3388
|
-
two:
|
|
3388
|
+
two: Zt(this._camera) ? P.TOUCH_DOLLY_TRUCK : bt(this._camera) ? P.TOUCH_ZOOM_TRUCK : P.NONE,
|
|
3389
3389
|
three: P.TOUCH_TRUCK
|
|
3390
3390
|
};
|
|
3391
3391
|
const e = new Y.Vector2(), i = new Y.Vector2(), o = new Y.Vector2(), n = (f) => {
|
|
@@ -3396,9 +3396,9 @@ class ot extends gr {
|
|
|
3396
3396
|
if (_ < this._interactiveArea.left || _ > this._interactiveArea.right || N < this._interactiveArea.top || N > this._interactiveArea.bottom)
|
|
3397
3397
|
return;
|
|
3398
3398
|
}
|
|
3399
|
-
const
|
|
3400
|
-
if (
|
|
3401
|
-
const S = this._findPointerByMouseButton(
|
|
3399
|
+
const T = f.pointerType !== "mouse" ? null : (f.buttons & V.LEFT) === V.LEFT ? V.LEFT : (f.buttons & V.MIDDLE) === V.MIDDLE ? V.MIDDLE : (f.buttons & V.RIGHT) === V.RIGHT ? V.RIGHT : null;
|
|
3400
|
+
if (T !== null) {
|
|
3401
|
+
const S = this._findPointerByMouseButton(T);
|
|
3402
3402
|
S && this._disposePointer(S);
|
|
3403
3403
|
}
|
|
3404
3404
|
if ((f.buttons & V.LEFT) === V.LEFT && this._lockedPointer)
|
|
@@ -3409,7 +3409,7 @@ class ot extends gr {
|
|
|
3409
3409
|
clientY: f.clientY,
|
|
3410
3410
|
deltaX: 0,
|
|
3411
3411
|
deltaY: 0,
|
|
3412
|
-
mouseButton:
|
|
3412
|
+
mouseButton: T
|
|
3413
3413
|
};
|
|
3414
3414
|
this._activePointers.push(O), this._domElement.ownerDocument.removeEventListener("pointermove", a, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", h), this._domElement.ownerDocument.addEventListener("pointermove", a, { passive: !1 }), this._domElement.ownerDocument.addEventListener("pointerup", h), this._isDragging = !0, A(f);
|
|
3415
3415
|
}, r = (f) => {
|
|
@@ -3420,9 +3420,9 @@ class ot extends gr {
|
|
|
3420
3420
|
if (_ < this._interactiveArea.left || _ > this._interactiveArea.right || N < this._interactiveArea.top || N > this._interactiveArea.bottom)
|
|
3421
3421
|
return;
|
|
3422
3422
|
}
|
|
3423
|
-
const
|
|
3424
|
-
if (
|
|
3425
|
-
const S = this._findPointerByMouseButton(
|
|
3423
|
+
const T = (f.buttons & V.LEFT) === V.LEFT ? V.LEFT : (f.buttons & V.MIDDLE) === V.MIDDLE ? V.MIDDLE : (f.buttons & V.RIGHT) === V.RIGHT ? V.RIGHT : null;
|
|
3424
|
+
if (T !== null) {
|
|
3425
|
+
const S = this._findPointerByMouseButton(T);
|
|
3426
3426
|
S && this._disposePointer(S);
|
|
3427
3427
|
}
|
|
3428
3428
|
const O = {
|
|
@@ -3436,7 +3436,7 @@ class ot extends gr {
|
|
|
3436
3436
|
this._activePointers.push(O), this._domElement.ownerDocument.removeEventListener("mousemove", c), this._domElement.ownerDocument.removeEventListener("mouseup", d), this._domElement.ownerDocument.addEventListener("mousemove", c), this._domElement.ownerDocument.addEventListener("mouseup", d), this._isDragging = !0, A(f);
|
|
3437
3437
|
}, a = (f) => {
|
|
3438
3438
|
f.cancelable && f.preventDefault();
|
|
3439
|
-
const
|
|
3439
|
+
const T = f.pointerId, O = this._lockedPointer || this._findPointerById(T);
|
|
3440
3440
|
if (O) {
|
|
3441
3441
|
if (O.clientX = f.clientX, O.clientY = f.clientY, O.deltaX = f.movementX, O.deltaY = f.movementY, this._state = 0, f.pointerType === "touch")
|
|
3442
3442
|
switch (this._activePointers.length) {
|
|
@@ -3452,15 +3452,15 @@ class ot extends gr {
|
|
|
3452
3452
|
}
|
|
3453
3453
|
else
|
|
3454
3454
|
(!this._isDragging && this._lockedPointer || this._isDragging && (f.buttons & V.LEFT) === V.LEFT) && (this._state = this._state | this.mouseButtons.left), this._isDragging && (f.buttons & V.MIDDLE) === V.MIDDLE && (this._state = this._state | this.mouseButtons.middle), this._isDragging && (f.buttons & V.RIGHT) === V.RIGHT && (this._state = this._state | this.mouseButtons.right);
|
|
3455
|
-
|
|
3455
|
+
m();
|
|
3456
3456
|
}
|
|
3457
3457
|
}, c = (f) => {
|
|
3458
|
-
const
|
|
3459
|
-
|
|
3458
|
+
const T = this._lockedPointer || this._findPointerById(1);
|
|
3459
|
+
T && (T.clientX = f.clientX, T.clientY = f.clientY, T.deltaX = f.movementX, T.deltaY = f.movementY, this._state = 0, (this._lockedPointer || (f.buttons & V.LEFT) === V.LEFT) && (this._state = this._state | this.mouseButtons.left), (f.buttons & V.MIDDLE) === V.MIDDLE && (this._state = this._state | this.mouseButtons.middle), (f.buttons & V.RIGHT) === V.RIGHT && (this._state = this._state | this.mouseButtons.right), m());
|
|
3460
3460
|
}, h = (f) => {
|
|
3461
|
-
const
|
|
3462
|
-
if (!(
|
|
3463
|
-
if (
|
|
3461
|
+
const T = this._findPointerById(f.pointerId);
|
|
3462
|
+
if (!(T && T === this._lockedPointer)) {
|
|
3463
|
+
if (T && this._disposePointer(T), f.pointerType === "touch")
|
|
3464
3464
|
switch (this._activePointers.length) {
|
|
3465
3465
|
case 0:
|
|
3466
3466
|
this._state = P.NONE;
|
|
@@ -3496,7 +3496,7 @@ class ot extends gr {
|
|
|
3496
3496
|
const N = performance.now();
|
|
3497
3497
|
E - N < 1e3 && this._getClientRect(this._elementRect), E = N;
|
|
3498
3498
|
}
|
|
3499
|
-
const
|
|
3499
|
+
const T = _r ? -1 : -3, O = f.deltaMode === 1 ? f.deltaY / T : f.deltaY / (T * 10), S = this.dollyToCursor ? (f.clientX - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, _ = this.dollyToCursor ? (f.clientY - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
|
|
3500
3500
|
switch (this.mouseButtons.wheel) {
|
|
3501
3501
|
case P.ROTATE: {
|
|
3502
3502
|
this._rotateInternal(f.deltaX, f.deltaY), this._isUserControllingRotate = !0;
|
|
@@ -3523,7 +3523,7 @@ class ot extends gr {
|
|
|
3523
3523
|
}, p = (f) => {
|
|
3524
3524
|
if (!(!this._domElement || !this._enabled)) {
|
|
3525
3525
|
if (this.mouseButtons.right === ot.ACTION.NONE) {
|
|
3526
|
-
const
|
|
3526
|
+
const T = f instanceof PointerEvent ? f.pointerId : (f instanceof MouseEvent, 0), O = this._findPointerById(T);
|
|
3527
3527
|
O && this._disposePointer(O), this._domElement.ownerDocument.removeEventListener("pointermove", a, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", h), this._domElement.ownerDocument.removeEventListener("mousemove", c), this._domElement.ownerDocument.removeEventListener("mouseup", d);
|
|
3528
3528
|
return;
|
|
3529
3529
|
}
|
|
@@ -3555,11 +3555,11 @@ class ot extends gr {
|
|
|
3555
3555
|
else
|
|
3556
3556
|
!this._lockedPointer && (f.buttons & V.LEFT) === V.LEFT && (this._state = this._state | this.mouseButtons.left), (f.buttons & V.MIDDLE) === V.MIDDLE && (this._state = this._state | this.mouseButtons.middle), (f.buttons & V.RIGHT) === V.RIGHT && (this._state = this._state | this.mouseButtons.right);
|
|
3557
3557
|
((this._state & P.ROTATE) === P.ROTATE || (this._state & P.TOUCH_ROTATE) === P.TOUCH_ROTATE || (this._state & P.TOUCH_DOLLY_ROTATE) === P.TOUCH_DOLLY_ROTATE || (this._state & P.TOUCH_ZOOM_ROTATE) === P.TOUCH_ZOOM_ROTATE) && (this._sphericalEnd.theta = this._spherical.theta, this._sphericalEnd.phi = this._spherical.phi, this._thetaVelocity.value = 0, this._phiVelocity.value = 0), ((this._state & P.TRUCK) === P.TRUCK || (this._state & P.TOUCH_TRUCK) === P.TOUCH_TRUCK || (this._state & P.TOUCH_DOLLY_TRUCK) === P.TOUCH_DOLLY_TRUCK || (this._state & P.TOUCH_ZOOM_TRUCK) === P.TOUCH_ZOOM_TRUCK) && (this._targetEnd.copy(this._target), this._targetVelocity.set(0, 0, 0)), ((this._state & P.DOLLY) === P.DOLLY || (this._state & P.TOUCH_DOLLY) === P.TOUCH_DOLLY || (this._state & P.TOUCH_DOLLY_TRUCK) === P.TOUCH_DOLLY_TRUCK || (this._state & P.TOUCH_DOLLY_OFFSET) === P.TOUCH_DOLLY_OFFSET || (this._state & P.TOUCH_DOLLY_ROTATE) === P.TOUCH_DOLLY_ROTATE) && (this._sphericalEnd.radius = this._spherical.radius, this._radiusVelocity.value = 0), ((this._state & P.ZOOM) === P.ZOOM || (this._state & P.TOUCH_ZOOM) === P.TOUCH_ZOOM || (this._state & P.TOUCH_ZOOM_TRUCK) === P.TOUCH_ZOOM_TRUCK || (this._state & P.TOUCH_ZOOM_OFFSET) === P.TOUCH_ZOOM_OFFSET || (this._state & P.TOUCH_ZOOM_ROTATE) === P.TOUCH_ZOOM_ROTATE) && (this._zoomEnd = this._zoom, this._zoomVelocity.value = 0), ((this._state & P.OFFSET) === P.OFFSET || (this._state & P.TOUCH_OFFSET) === P.TOUCH_OFFSET || (this._state & P.TOUCH_DOLLY_OFFSET) === P.TOUCH_DOLLY_OFFSET || (this._state & P.TOUCH_ZOOM_OFFSET) === P.TOUCH_ZOOM_OFFSET) && (this._focalOffsetEnd.copy(this._focalOffset), this._focalOffsetVelocity.set(0, 0, 0)), this.dispatchEvent({ type: "controlstart" });
|
|
3558
|
-
},
|
|
3558
|
+
}, m = () => {
|
|
3559
3559
|
if (!this._enabled || !this._dragNeedsUpdate)
|
|
3560
3560
|
return;
|
|
3561
3561
|
this._dragNeedsUpdate = !1, Ks(this._activePointers, lt);
|
|
3562
|
-
const
|
|
3562
|
+
const T = this._domElement && document.pointerLockElement === this._domElement ? this._lockedPointer || this._activePointers[0] : null, O = T ? -T.deltaX : i.x - lt.x, S = T ? -T.deltaY : i.y - lt.y;
|
|
3563
3563
|
if (i.copy(lt), ((this._state & P.ROTATE) === P.ROTATE || (this._state & P.TOUCH_ROTATE) === P.TOUCH_ROTATE || (this._state & P.TOUCH_DOLLY_ROTATE) === P.TOUCH_DOLLY_ROTATE || (this._state & P.TOUCH_ZOOM_ROTATE) === P.TOUCH_ZOOM_ROTATE) && (this._rotateInternal(O, S), this._isUserControllingRotate = !0), (this._state & P.DOLLY) === P.DOLLY || (this._state & P.ZOOM) === P.ZOOM) {
|
|
3564
3564
|
const _ = this.dollyToCursor ? (e.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, N = this.dollyToCursor ? (e.y - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0, L = this.dollyDragInverted ? -1 : 1;
|
|
3565
3565
|
(this._state & P.DOLLY) === P.DOLLY ? (this._dollyInternal(L * S * ds, _, N), this._isUserControllingDolly = !0) : (this._zoomInternal(L * S * ds, _, N), this._isUserControllingZoom = !0);
|
|
@@ -3582,11 +3582,11 @@ class ot extends gr {
|
|
|
3582
3582
|
deltaX: 0,
|
|
3583
3583
|
deltaY: 0,
|
|
3584
3584
|
mouseButton: null
|
|
3585
|
-
}, this._activePointers.push(this._lockedPointer), this._domElement.ownerDocument.removeEventListener("pointermove", a, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", h), this._domElement.requestPointerLock(), this._domElement.ownerDocument.addEventListener("pointerlockchange",
|
|
3585
|
+
}, this._activePointers.push(this._lockedPointer), this._domElement.ownerDocument.removeEventListener("pointermove", a, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", h), this._domElement.requestPointerLock(), this._domElement.ownerDocument.addEventListener("pointerlockchange", R), this._domElement.ownerDocument.addEventListener("pointerlockerror", F), this._domElement.ownerDocument.addEventListener("pointermove", a, { passive: !1 }), this._domElement.ownerDocument.addEventListener("pointerup", h), A());
|
|
3586
3586
|
}, this.unlockPointer = () => {
|
|
3587
|
-
this._lockedPointer !== null && (this._disposePointer(this._lockedPointer), this._lockedPointer = null), document.exitPointerLock(), this.cancel(), this._domElement && (this._domElement.ownerDocument.removeEventListener("pointerlockchange",
|
|
3587
|
+
this._lockedPointer !== null && (this._disposePointer(this._lockedPointer), this._lockedPointer = null), document.exitPointerLock(), this.cancel(), this._domElement && (this._domElement.ownerDocument.removeEventListener("pointerlockchange", R), this._domElement.ownerDocument.removeEventListener("pointerlockerror", F));
|
|
3588
3588
|
};
|
|
3589
|
-
const
|
|
3589
|
+
const R = () => {
|
|
3590
3590
|
this._domElement && this._domElement.ownerDocument.pointerLockElement === this._domElement || this.unlockPointer();
|
|
3591
3591
|
}, F = () => {
|
|
3592
3592
|
this.unlockPointer();
|
|
@@ -3594,7 +3594,7 @@ class ot extends gr {
|
|
|
3594
3594
|
this._addAllEventListeners = (f) => {
|
|
3595
3595
|
this._domElement = f, this._domElement.style.touchAction = "none", this._domElement.style.userSelect = "none", this._domElement.style.webkitUserSelect = "none", this._domElement.addEventListener("pointerdown", n), Nr && this._domElement.addEventListener("mousedown", r), this._domElement.addEventListener("pointercancel", h), this._domElement.addEventListener("wheel", u, { passive: !1 }), this._domElement.addEventListener("contextmenu", p);
|
|
3596
3596
|
}, this._removeAllEventListeners = () => {
|
|
3597
|
-
this._domElement && (this._domElement.style.touchAction = "", this._domElement.style.userSelect = "", this._domElement.style.webkitUserSelect = "", this._domElement.removeEventListener("pointerdown", n), this._domElement.removeEventListener("mousedown", r), this._domElement.removeEventListener("pointercancel", h), this._domElement.removeEventListener("wheel", u, { passive: !1 }), this._domElement.removeEventListener("contextmenu", p), this._domElement.ownerDocument.removeEventListener("pointermove", a, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("mousemove", c), this._domElement.ownerDocument.removeEventListener("pointerup", h), this._domElement.ownerDocument.removeEventListener("mouseup", d), this._domElement.ownerDocument.removeEventListener("pointerlockchange",
|
|
3597
|
+
this._domElement && (this._domElement.style.touchAction = "", this._domElement.style.userSelect = "", this._domElement.style.webkitUserSelect = "", this._domElement.removeEventListener("pointerdown", n), this._domElement.removeEventListener("mousedown", r), this._domElement.removeEventListener("pointercancel", h), this._domElement.removeEventListener("wheel", u, { passive: !1 }), this._domElement.removeEventListener("contextmenu", p), this._domElement.ownerDocument.removeEventListener("pointermove", a, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("mousemove", c), this._domElement.ownerDocument.removeEventListener("pointerup", h), this._domElement.ownerDocument.removeEventListener("mouseup", d), this._domElement.ownerDocument.removeEventListener("pointerlockchange", R), this._domElement.ownerDocument.removeEventListener("pointerlockerror", F));
|
|
3598
3598
|
}, this.cancel = () => {
|
|
3599
3599
|
this._state !== P.NONE && (this._state = P.NONE, this._activePointers.length = 0, C());
|
|
3600
3600
|
}, t && this.connect(t), this.update(0);
|
|
@@ -3967,13 +3967,13 @@ class ot extends gr {
|
|
|
3967
3967
|
p && u.multiply(si.setFromAxisAngle(us, h)), u.multiply(this._yAxisUpSpaceInverse);
|
|
3968
3968
|
const A = En.makeEmpty();
|
|
3969
3969
|
z.copy(c.min).applyQuaternion(u), A.expandByPoint(z), z.copy(c.min).setX(c.max.x).applyQuaternion(u), A.expandByPoint(z), z.copy(c.min).setY(c.max.y).applyQuaternion(u), A.expandByPoint(z), z.copy(c.max).setZ(c.min.z).applyQuaternion(u), A.expandByPoint(z), z.copy(c.min).setZ(c.max.z).applyQuaternion(u), A.expandByPoint(z), z.copy(c.max).setY(c.min.y).applyQuaternion(u), A.expandByPoint(z), z.copy(c.max).setX(c.min.x).applyQuaternion(u), A.expandByPoint(z), z.copy(c.max).applyQuaternion(u), A.expandByPoint(z), A.min.x -= i, A.min.y -= n, A.max.x += o, A.max.y += r, u.setFromUnitVectors(ti, E), p && u.premultiply(si.invert()), u.premultiply(this._yAxisUpSpace);
|
|
3970
|
-
const
|
|
3971
|
-
if (
|
|
3972
|
-
const
|
|
3973
|
-
a.push(this.moveTo(C.x, C.y, C.z, t)), a.push(this.dollyTo(
|
|
3970
|
+
const m = A.getSize(G), C = A.getCenter(z).applyQuaternion(u);
|
|
3971
|
+
if (Zt(this._camera)) {
|
|
3972
|
+
const R = this.getDistanceToFitBox(m.x, m.y, m.z, e);
|
|
3973
|
+
a.push(this.moveTo(C.x, C.y, C.z, t)), a.push(this.dollyTo(R, t)), a.push(this.setFocalOffset(0, 0, 0, t));
|
|
3974
3974
|
} else if (bt(this._camera)) {
|
|
3975
|
-
const
|
|
3976
|
-
a.push(this.moveTo(C.x, C.y, C.z, t)), a.push(this.zoomTo(
|
|
3975
|
+
const R = this._camera, F = R.right - R.left, f = R.top - R.bottom, T = e ? Math.max(F / m.x, f / m.y) : Math.min(F / m.x, f / m.y);
|
|
3976
|
+
a.push(this.moveTo(C.x, C.y, C.z, t)), a.push(this.zoomTo(T, t)), a.push(this.setFocalOffset(0, 0, 0, t));
|
|
3977
3977
|
}
|
|
3978
3978
|
return Promise.all(a);
|
|
3979
3979
|
}
|
|
@@ -3985,7 +3985,7 @@ class ot extends gr {
|
|
|
3985
3985
|
*/
|
|
3986
3986
|
fitToSphere(s, t) {
|
|
3987
3987
|
const e = [], o = s instanceof Y.Sphere ? ei.copy(s) : ot.createBoundingSphere(s, ei);
|
|
3988
|
-
if (e.push(this.moveTo(o.center.x, o.center.y, o.center.z, t)),
|
|
3988
|
+
if (e.push(this.moveTo(o.center.x, o.center.y, o.center.z, t)), Zt(this._camera)) {
|
|
3989
3989
|
const n = this.getDistanceToFitSphere(o.radius);
|
|
3990
3990
|
e.push(this.dollyTo(n, t));
|
|
3991
3991
|
} else if (bt(this._camera)) {
|
|
@@ -4032,12 +4032,12 @@ class ot extends gr {
|
|
|
4032
4032
|
*/
|
|
4033
4033
|
lerpLookAt(s, t, e, i, o, n, r, a, c, h, d, E, u, p = !1) {
|
|
4034
4034
|
this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._lastDollyDirection = he.NONE, this._changedDolly = 0;
|
|
4035
|
-
const A = G.set(i, o, n),
|
|
4036
|
-
dt.setFromVector3(
|
|
4037
|
-
const C = de.set(h, d, E),
|
|
4038
|
-
we.setFromVector3(
|
|
4039
|
-
const F = we.theta - dt.theta, f = we.phi - dt.phi,
|
|
4040
|
-
this._sphericalEnd.set(dt.radius +
|
|
4035
|
+
const A = G.set(i, o, n), m = z.set(s, t, e);
|
|
4036
|
+
dt.setFromVector3(m.sub(A).applyQuaternion(this._yAxisUpSpace));
|
|
4037
|
+
const C = de.set(h, d, E), R = z.set(r, a, c);
|
|
4038
|
+
we.setFromVector3(R.sub(C).applyQuaternion(this._yAxisUpSpace)), this._targetEnd.copy(A.lerp(C, u));
|
|
4039
|
+
const F = we.theta - dt.theta, f = we.phi - dt.phi, T = we.radius - dt.radius;
|
|
4040
|
+
this._sphericalEnd.set(dt.radius + T * u, dt.phi + f * u, dt.theta + F * u), this.normalizeRotations(), this._needsUpdate = !0, p || (this._target.copy(this._targetEnd), this._spherical.copy(this._sphericalEnd));
|
|
4041
4041
|
const O = !p || k(this._target.x, this._targetEnd.x, this.restThreshold) && k(this._target.y, this._targetEnd.y, this.restThreshold) && k(this._target.z, this._targetEnd.z, this.restThreshold) && k(this._spherical.theta, this._sphericalEnd.theta, this.restThreshold) && k(this._spherical.phi, this._sphericalEnd.phi, this.restThreshold) && k(this._spherical.radius, this._sphericalEnd.radius, this.restThreshold);
|
|
4042
4042
|
return this._createOnRestPromise(O);
|
|
4043
4043
|
}
|
|
@@ -4088,9 +4088,9 @@ class ot extends gr {
|
|
|
4088
4088
|
* @category Methods
|
|
4089
4089
|
*/
|
|
4090
4090
|
setOrbitPoint(s, t, e) {
|
|
4091
|
-
this._camera.updateMatrixWorld(), gt.setFromMatrixColumn(this._camera.matrixWorldInverse, 0), St.setFromMatrixColumn(this._camera.matrixWorldInverse, 1),
|
|
4091
|
+
this._camera.updateMatrixWorld(), gt.setFromMatrixColumn(this._camera.matrixWorldInverse, 0), St.setFromMatrixColumn(this._camera.matrixWorldInverse, 1), Qt.setFromMatrixColumn(this._camera.matrixWorldInverse, 2);
|
|
4092
4092
|
const i = G.set(s, t, e), o = i.distanceTo(this._camera.position), n = i.sub(this._camera.position);
|
|
4093
|
-
gt.multiplyScalar(n.x), St.multiplyScalar(n.y),
|
|
4093
|
+
gt.multiplyScalar(n.x), St.multiplyScalar(n.y), Qt.multiplyScalar(n.z), G.copy(gt).add(St).add(Qt), G.z = G.z + o, this.dollyTo(o, !1), this.setFocalOffset(-G.x, G.y, -G.z, !1), this.moveTo(s, t, e, !1);
|
|
4094
4094
|
}
|
|
4095
4095
|
/**
|
|
4096
4096
|
* Set the boundary box that encloses the target of the camera. box3 is in THREE.Box3
|
|
@@ -4279,11 +4279,11 @@ class ot extends gr {
|
|
|
4279
4279
|
this._zoom = Es(this._zoom, this._zoomEnd, this._zoomVelocity, d, 1 / 0, s);
|
|
4280
4280
|
}
|
|
4281
4281
|
if (this.dollyToCursor) {
|
|
4282
|
-
if (
|
|
4282
|
+
if (Zt(this._camera) && this._changedDolly !== 0) {
|
|
4283
4283
|
const d = this._spherical.radius - this._lastDistance, E = this._camera, u = this._getCameraDirection(ye), p = G.copy(u).cross(E.up).normalize();
|
|
4284
4284
|
p.lengthSq() === 0 && (p.x = 1);
|
|
4285
|
-
const A = z.crossVectors(p, u),
|
|
4286
|
-
if (this.infinityDolly && (
|
|
4285
|
+
const A = z.crossVectors(p, u), m = this._sphericalEnd.radius * Math.tan(E.getEffectiveFOV() * Ne * 0.5), R = (this._sphericalEnd.radius - d - this._sphericalEnd.radius) / this._sphericalEnd.radius, F = de.copy(this._targetEnd).add(p.multiplyScalar(this._dollyControlCoord.x * m * E.aspect)).add(A.multiplyScalar(this._dollyControlCoord.y * m)), f = G.copy(this._targetEnd).lerp(F, R), T = this._lastDollyDirection === he.IN && this._spherical.radius <= this.minDistance, O = this._lastDollyDirection === he.OUT && this.maxDistance <= this._spherical.radius;
|
|
4286
|
+
if (this.infinityDolly && (T || O)) {
|
|
4287
4287
|
this._sphericalEnd.radius -= d, this._spherical.radius -= d;
|
|
4288
4288
|
const _ = z.copy(u).multiplyScalar(-d);
|
|
4289
4289
|
f.add(_);
|
|
@@ -4292,7 +4292,7 @@ class ot extends gr {
|
|
|
4292
4292
|
const S = z.subVectors(f, this._targetEnd);
|
|
4293
4293
|
this._targetEnd.copy(f), this._target.add(S), this._changedDolly -= d, X(this._changedDolly) && (this._changedDolly = 0);
|
|
4294
4294
|
} else if (bt(this._camera) && this._changedZoom !== 0) {
|
|
4295
|
-
const d = this._zoom - this._lastZoom, E = this._camera, u = G.set(this._dollyControlCoord.x, this._dollyControlCoord.y, (E.near + E.far) / (E.near - E.far)).unproject(E), p = z.set(0, 0, -1).applyQuaternion(E.quaternion), A = de.copy(u).add(p.multiplyScalar(-u.dot(E.up))), C = -(this._zoom - d - this._zoom) / this._zoom,
|
|
4295
|
+
const d = this._zoom - this._lastZoom, E = this._camera, u = G.set(this._dollyControlCoord.x, this._dollyControlCoord.y, (E.near + E.far) / (E.near - E.far)).unproject(E), p = z.set(0, 0, -1).applyQuaternion(E.quaternion), A = de.copy(u).add(p.multiplyScalar(-u.dot(E.up))), C = -(this._zoom - d - this._zoom) / this._zoom, R = this._getCameraDirection(ye), F = this._targetEnd.dot(R), f = G.copy(this._targetEnd).lerp(A, C), T = f.dot(R), O = R.multiplyScalar(T - F);
|
|
4296
4296
|
f.sub(O), this._boundary.clampPoint(f, f);
|
|
4297
4297
|
const S = z.subVectors(f, this._targetEnd);
|
|
4298
4298
|
this._targetEnd.copy(f), this._target.add(S), this._changedZoom -= d, X(this._changedZoom) && (this._changedZoom = 0);
|
|
@@ -4300,7 +4300,7 @@ class ot extends gr {
|
|
|
4300
4300
|
}
|
|
4301
4301
|
this._camera.zoom !== this._zoom && (this._camera.zoom = this._zoom, this._camera.updateProjectionMatrix(), this._updateNearPlaneCorners(), this._needsUpdate = !0), this._dragNeedsUpdate = !0;
|
|
4302
4302
|
const a = this._collisionTest();
|
|
4303
|
-
this._spherical.radius = Math.min(this._spherical.radius, a), this._spherical.makeSafe(), this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target), this._camera.lookAt(this._target), (!X(this._focalOffset.x) || !X(this._focalOffset.y) || !X(this._focalOffset.z)) && (this._camera.updateMatrixWorld(), gt.setFromMatrixColumn(this._camera.matrix, 0), St.setFromMatrixColumn(this._camera.matrix, 1),
|
|
4303
|
+
this._spherical.radius = Math.min(this._spherical.radius, a), this._spherical.makeSafe(), this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target), this._camera.lookAt(this._target), (!X(this._focalOffset.x) || !X(this._focalOffset.y) || !X(this._focalOffset.z)) && (this._camera.updateMatrixWorld(), gt.setFromMatrixColumn(this._camera.matrix, 0), St.setFromMatrixColumn(this._camera.matrix, 1), Qt.setFromMatrixColumn(this._camera.matrix, 2), gt.multiplyScalar(this._focalOffset.x), St.multiplyScalar(-this._focalOffset.y), Qt.multiplyScalar(this._focalOffset.z), G.copy(gt).add(St).add(Qt), this._camera.position.add(G)), this._boundaryEnclosesCamera && this._encloseToBoundary(this._camera.position.copy(this._target), G.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse), 1);
|
|
4304
4304
|
const h = this._needsUpdate;
|
|
4305
4305
|
return h && !this._updatedLastTime ? (this._hasRested = !1, this.dispatchEvent({ type: "wake" }), this.dispatchEvent({ type: "update" })) : h ? (this.dispatchEvent({ type: "update" }), X(t, this.restThreshold) && X(e, this.restThreshold) && X(i, this.restThreshold) && X(o.x, this.restThreshold) && X(o.y, this.restThreshold) && X(o.z, this.restThreshold) && X(n.x, this.restThreshold) && X(n.y, this.restThreshold) && X(n.z, this.restThreshold) && X(r, this.restThreshold) && !this._hasRested && (this._hasRested = !0, this.dispatchEvent({ type: "rest" }))) : !h && this._updatedLastTime && this.dispatchEvent({ type: "sleep" }), this._lastDistance = this._spherical.radius, this._lastZoom = this._zoom, this._updatedLastTime = h, this._needsUpdate = !1, h;
|
|
4306
4306
|
}
|
|
@@ -4403,7 +4403,7 @@ class ot extends gr {
|
|
|
4403
4403
|
}
|
|
4404
4404
|
}
|
|
4405
4405
|
_updateNearPlaneCorners() {
|
|
4406
|
-
if (
|
|
4406
|
+
if (Zt(this._camera)) {
|
|
4407
4407
|
const s = this._camera, t = s.near, e = s.getEffectiveFOV() * Ne, i = Math.tan(e * 0.5) * t, o = i * s.aspect;
|
|
4408
4408
|
this._nearPlaneCorners[0].set(-o, -i, 0), this._nearPlaneCorners[1].set(o, -i, 0), this._nearPlaneCorners[2].set(o, i, 0), this._nearPlaneCorners[3].set(-o, i, 0);
|
|
4409
4409
|
} else if (bt(this._camera)) {
|
|
@@ -4806,7 +4806,7 @@ class Pr {
|
|
|
4806
4806
|
}
|
|
4807
4807
|
/** {@link Disposable.dispose} */
|
|
4808
4808
|
dispose() {
|
|
4809
|
-
this.setupEvents(!1), this.components.get(
|
|
4809
|
+
this.setupEvents(!1), this.components.get(zt).destroy(this.three), this.onDisposed.trigger(), this.onDisposed.reset(), this.world = null, this.components = null;
|
|
4810
4810
|
}
|
|
4811
4811
|
setupEvents(s) {
|
|
4812
4812
|
if (this.world.isDisposing || !(this.world.camera instanceof ke))
|
|
@@ -4850,7 +4850,7 @@ const Ss = class Ss extends J {
|
|
|
4850
4850
|
};
|
|
4851
4851
|
I(Ss, "uuid", "d1e814d5-b81c-4452-87a2-f039375e0489");
|
|
4852
4852
|
let un = Ss;
|
|
4853
|
-
const
|
|
4853
|
+
const jt = new qn(), nt = new w(), xt = new w(), j = new Pt(), In = {
|
|
4854
4854
|
X: new w(1, 0, 0),
|
|
4855
4855
|
Y: new w(0, 1, 0),
|
|
4856
4856
|
Z: new w(0, 0, 1)
|
|
@@ -4863,20 +4863,20 @@ class Lr extends ri {
|
|
|
4863
4863
|
const i = new br();
|
|
4864
4864
|
this._plane = i, this.add(i);
|
|
4865
4865
|
const o = this;
|
|
4866
|
-
function n(
|
|
4866
|
+
function n(R, F) {
|
|
4867
4867
|
let f = F;
|
|
4868
|
-
Object.defineProperty(o,
|
|
4868
|
+
Object.defineProperty(o, R, {
|
|
4869
4869
|
get: function() {
|
|
4870
4870
|
return f !== void 0 ? f : F;
|
|
4871
4871
|
},
|
|
4872
|
-
set: function(
|
|
4873
|
-
f !==
|
|
4872
|
+
set: function(T) {
|
|
4873
|
+
f !== T && (f = T, i[R] = T, e[R] = T, o.dispatchEvent({ type: R + "-changed", value: T }), o.dispatchEvent(ni));
|
|
4874
4874
|
}
|
|
4875
|
-
}), o[
|
|
4875
|
+
}), o[R] = F, i[R] = F, e[R] = F;
|
|
4876
4876
|
}
|
|
4877
4877
|
n("camera", s), n("object", void 0), n("enabled", !0), n("axis", null), n("mode", "translate"), n("translationSnap", null), n("rotationSnap", null), n("scaleSnap", null), n("space", "world"), n("size", 1), n("dragging", !1), n("showX", !0), n("showY", !0), n("showZ", !0);
|
|
4878
|
-
const r = new w(), a = new w(), c = new Pt(), h = new Pt(), d = new w(), E = new Pt(), u = new w(), p = new w(), A = new w(),
|
|
4879
|
-
n("worldPosition", r), n("worldPositionStart", a), n("worldQuaternion", c), n("worldQuaternionStart", h), n("cameraPosition", d), n("cameraQuaternion", E), n("pointStart", u), n("pointEnd", p), n("rotationAxis", A), n("rotationAngle",
|
|
4878
|
+
const r = new w(), a = new w(), c = new Pt(), h = new Pt(), d = new w(), E = new Pt(), u = new w(), p = new w(), A = new w(), m = 0, C = new w();
|
|
4879
|
+
n("worldPosition", r), n("worldPositionStart", a), n("worldQuaternion", c), n("worldQuaternionStart", h), n("cameraPosition", d), n("cameraQuaternion", E), n("pointStart", u), n("pointEnd", p), n("rotationAxis", A), n("rotationAngle", m), n("eye", C), this._offset = new w(), this._startNorm = new w(), this._endNorm = new w(), this._cameraScale = new w(), this._parentPosition = new w(), this._parentQuaternion = new Pt(), this._parentQuaternionInv = new Pt(), this._parentScale = new w(), this._worldScaleStart = new w(), this._worldQuaternionInv = new Pt(), this._worldScale = new w(), this._positionStart = new w(), this._quaternionStart = new Pt(), this._scaleStart = new w(), this._getPointer = yr.bind(this), this._onPointerDown = Mr.bind(this), this._onPointerHover = wr.bind(this), this._onPointerMove = Dr.bind(this), this._onPointerUp = Ur.bind(this), this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointermove", this._onPointerHover), this.domElement.addEventListener("pointerup", this._onPointerUp);
|
|
4880
4880
|
}
|
|
4881
4881
|
// updateMatrixWorld updates key transformation variables
|
|
4882
4882
|
updateMatrixWorld() {
|
|
@@ -4885,14 +4885,14 @@ class Lr extends ri {
|
|
|
4885
4885
|
pointerHover(s) {
|
|
4886
4886
|
if (this.object === void 0 || this.dragging === !0)
|
|
4887
4887
|
return;
|
|
4888
|
-
|
|
4889
|
-
const t = oi(this._gizmo.picker[this.mode],
|
|
4888
|
+
jt.setFromCamera(s, this.camera);
|
|
4889
|
+
const t = oi(this._gizmo.picker[this.mode], jt);
|
|
4890
4890
|
t ? this.axis = t.object.name : this.axis = null;
|
|
4891
4891
|
}
|
|
4892
4892
|
pointerDown(s) {
|
|
4893
4893
|
if (!(this.object === void 0 || this.dragging === !0 || s.button !== 0) && this.axis !== null) {
|
|
4894
|
-
|
|
4895
|
-
const t = oi(this._plane,
|
|
4894
|
+
jt.setFromCamera(s, this.camera);
|
|
4895
|
+
const t = oi(this._plane, jt, !0);
|
|
4896
4896
|
t && (this.object.updateMatrixWorld(), this.object.parent.updateMatrixWorld(), this._positionStart.copy(this.object.position), this._quaternionStart.copy(this.object.quaternion), this._scaleStart.copy(this.object.scale), this.object.matrixWorld.decompose(this.worldPositionStart, this.worldQuaternionStart, this._worldScaleStart), this.pointStart.copy(t.point).sub(this.worldPositionStart)), this.dragging = !0, fn.mode = this.mode, this.dispatchEvent(fn);
|
|
4897
4897
|
}
|
|
4898
4898
|
}
|
|
@@ -4901,8 +4901,8 @@ class Lr extends ri {
|
|
|
4901
4901
|
let o = this.space;
|
|
4902
4902
|
if (e === "scale" ? o = "local" : (t === "E" || t === "XYZE" || t === "XYZ") && (o = "world"), i === void 0 || t === null || this.dragging === !1 || s.button !== -1)
|
|
4903
4903
|
return;
|
|
4904
|
-
|
|
4905
|
-
const n = oi(this._plane,
|
|
4904
|
+
jt.setFromCamera(s, this.camera);
|
|
4905
|
+
const n = oi(this._plane, jt, !0);
|
|
4906
4906
|
if (n) {
|
|
4907
4907
|
if (this.pointEnd.copy(n.point).sub(this.worldPositionStart), e === "translate")
|
|
4908
4908
|
this._offset.copy(this.pointEnd).sub(this.pointStart), o === "local" && t !== "XYZ" && this._offset.applyQuaternion(this._worldQuaternionInv), t.indexOf("X") === -1 && (this._offset.x = 0), t.indexOf("Y") === -1 && (this._offset.y = 0), t.indexOf("Z") === -1 && (this._offset.z = 0), o === "local" && t !== "XYZ" ? this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale) : this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale), i.position.copy(this._offset).add(this._positionStart), this.translationSnap && (o === "local" && (i.position.applyQuaternion(j.copy(this._quaternionStart).invert()), t.search("X") !== -1 && (i.position.x = Math.round(i.position.x / this.translationSnap) * this.translationSnap), t.search("Y") !== -1 && (i.position.y = Math.round(i.position.y / this.translationSnap) * this.translationSnap), t.search("Z") !== -1 && (i.position.z = Math.round(i.position.z / this.translationSnap) * this.translationSnap), i.position.applyQuaternion(this._quaternionStart)), o === "world" && (i.parent && i.position.add(nt.setFromMatrixPosition(i.parent.matrixWorld)), t.search("X") !== -1 && (i.position.x = Math.round(i.position.x / this.translationSnap) * this.translationSnap), t.search("Y") !== -1 && (i.position.y = Math.round(i.position.y / this.translationSnap) * this.translationSnap), t.search("Z") !== -1 && (i.position.z = Math.round(i.position.z / this.translationSnap) * this.translationSnap), i.parent && i.position.sub(nt.setFromMatrixPosition(i.parent.matrixWorld))));
|
|
@@ -4942,7 +4942,7 @@ class Lr extends ri {
|
|
|
4942
4942
|
this.enabled && this.dragging && (this.object.position.copy(this._positionStart), this.object.quaternion.copy(this._quaternionStart), this.object.scale.copy(this._scaleStart), this.dispatchEvent(ni), this.dispatchEvent(Cn), this.pointStart.copy(this.pointEnd));
|
|
4943
4943
|
}
|
|
4944
4944
|
getRaycaster() {
|
|
4945
|
-
return
|
|
4945
|
+
return jt;
|
|
4946
4946
|
}
|
|
4947
4947
|
// TODO: deprecate
|
|
4948
4948
|
getMode() {
|
|
@@ -5008,7 +5008,7 @@ function oi(l, s, t) {
|
|
|
5008
5008
|
return e[i];
|
|
5009
5009
|
return !1;
|
|
5010
5010
|
}
|
|
5011
|
-
const fs = new $n(), W = new w(0, 1, 0), Tn = new w(0, 0, 0), mn = new yt(), ps = new Pt(), Rs = new Pt(), _t = new w(), Rn = new yt(), Ue = new w(1, 0, 0),
|
|
5011
|
+
const fs = new $n(), W = new w(0, 1, 0), Tn = new w(0, 0, 0), mn = new yt(), ps = new Pt(), Rs = new Pt(), _t = new w(), Rn = new yt(), Ue = new w(1, 0, 0), qt = new w(0, 1, 0), xe = new w(0, 0, 1), Cs = new w(), Me = new w(), De = new w();
|
|
5012
5012
|
class xr extends ri {
|
|
5013
5013
|
constructor() {
|
|
5014
5014
|
super(), this.isTransformControlsGizmo = !0, this.type = "TransformControlsGizmo";
|
|
@@ -5048,12 +5048,12 @@ class xr extends ri {
|
|
|
5048
5048
|
p.color.setHex(7895160);
|
|
5049
5049
|
const A = new ct(0, 0.04, 0.1, 12);
|
|
5050
5050
|
A.translate(0, 0.05, 0);
|
|
5051
|
-
const
|
|
5052
|
-
|
|
5051
|
+
const m = new rt(0.08, 0.08, 0.08);
|
|
5052
|
+
m.translate(0, 0.04, 0);
|
|
5053
5053
|
const C = new Ui();
|
|
5054
5054
|
C.setAttribute("position", new xi([0, 0, 0, 1, 0, 0], 3));
|
|
5055
|
-
const
|
|
5056
|
-
|
|
5055
|
+
const R = new ct(75e-4, 75e-4, 0.5, 3);
|
|
5056
|
+
R.translate(0, 0.25, 0);
|
|
5057
5057
|
function F(B, H) {
|
|
5058
5058
|
const q = new Re(B, 75e-4, 3, 64, H * Math.PI * 2);
|
|
5059
5059
|
return q.rotateY(Math.PI / 2), q.rotateX(Math.PI / 2), q;
|
|
@@ -5062,21 +5062,21 @@ class xr extends ri {
|
|
|
5062
5062
|
const B = new Ui();
|
|
5063
5063
|
return B.setAttribute("position", new xi([0, 0, 0, 1, 1, 1], 3)), B;
|
|
5064
5064
|
}
|
|
5065
|
-
const
|
|
5065
|
+
const T = {
|
|
5066
5066
|
X: [
|
|
5067
5067
|
[new v(A, o), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
|
|
5068
5068
|
[new v(A, o), [-0.5, 0, 0], [0, 0, Math.PI / 2]],
|
|
5069
|
-
[new v(
|
|
5069
|
+
[new v(R, o), [0, 0, 0], [0, 0, -Math.PI / 2]]
|
|
5070
5070
|
],
|
|
5071
5071
|
Y: [
|
|
5072
5072
|
[new v(A, n), [0, 0.5, 0]],
|
|
5073
5073
|
[new v(A, n), [0, -0.5, 0], [Math.PI, 0, 0]],
|
|
5074
|
-
[new v(
|
|
5074
|
+
[new v(R, n)]
|
|
5075
5075
|
],
|
|
5076
5076
|
Z: [
|
|
5077
5077
|
[new v(A, r), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
|
|
5078
5078
|
[new v(A, r), [0, 0, -0.5], [-Math.PI / 2, 0, 0]],
|
|
5079
|
-
[new v(
|
|
5079
|
+
[new v(R, r), null, [Math.PI / 2, 0, 0]]
|
|
5080
5080
|
],
|
|
5081
5081
|
XYZ: [
|
|
5082
5082
|
[new v(new Qe(0.1, 0), d.clone()), [0, 0, 0]]
|
|
@@ -5172,19 +5172,19 @@ class xr extends ri {
|
|
|
5172
5172
|
]
|
|
5173
5173
|
}, M = {
|
|
5174
5174
|
X: [
|
|
5175
|
-
[new v(
|
|
5176
|
-
[new v(
|
|
5177
|
-
[new v(
|
|
5175
|
+
[new v(m, o), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
|
|
5176
|
+
[new v(R, o), [0, 0, 0], [0, 0, -Math.PI / 2]],
|
|
5177
|
+
[new v(m, o), [-0.5, 0, 0], [0, 0, Math.PI / 2]]
|
|
5178
5178
|
],
|
|
5179
5179
|
Y: [
|
|
5180
|
-
[new v(
|
|
5181
|
-
[new v(
|
|
5182
|
-
[new v(
|
|
5180
|
+
[new v(m, n), [0, 0.5, 0]],
|
|
5181
|
+
[new v(R, n)],
|
|
5182
|
+
[new v(m, n), [0, -0.5, 0], [0, 0, Math.PI]]
|
|
5183
5183
|
],
|
|
5184
5184
|
Z: [
|
|
5185
|
-
[new v(
|
|
5186
|
-
[new v(
|
|
5187
|
-
[new v(
|
|
5185
|
+
[new v(m, r), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
|
|
5186
|
+
[new v(R, r), [0, 0, 0], [Math.PI / 2, 0, 0]],
|
|
5187
|
+
[new v(m, r), [0, 0, -0.5], [-Math.PI / 2, 0, 0]]
|
|
5188
5188
|
],
|
|
5189
5189
|
XY: [
|
|
5190
5190
|
[new v(new rt(0.15, 0.15, 0.01), h), [0.15, 0.15, 0]]
|
|
@@ -5238,14 +5238,14 @@ class xr extends ri {
|
|
|
5238
5238
|
const H = new ri();
|
|
5239
5239
|
for (const q in B)
|
|
5240
5240
|
for (let st = B[q].length; st--; ) {
|
|
5241
|
-
const Q = B[q][st][0].clone(),
|
|
5242
|
-
Q.name = q, Q.tag = Xe,
|
|
5241
|
+
const Q = B[q][st][0].clone(), Ht = B[q][st][1], kt = B[q][st][2], Wt = B[q][st][3], Xe = B[q][st][4];
|
|
5242
|
+
Q.name = q, Q.tag = Xe, Ht && Q.position.set(Ht[0], Ht[1], Ht[2]), kt && Q.rotation.set(kt[0], kt[1], kt[2]), Wt && Q.scale.set(Wt[0], Wt[1], Wt[2]), Q.updateMatrix();
|
|
5243
5243
|
const Te = Q.geometry.clone();
|
|
5244
5244
|
Te.applyMatrix4(Q.matrix), Q.geometry = Te, Q.renderOrder = 1 / 0, Q.position.set(0, 0, 0), Q.rotation.set(0, 0, 0), Q.scale.set(1, 1, 1), H.add(Q);
|
|
5245
5245
|
}
|
|
5246
5246
|
return H;
|
|
5247
5247
|
}
|
|
5248
|
-
this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = b(
|
|
5248
|
+
this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = b(T)), this.add(this.gizmo.rotate = b(_)), this.add(this.gizmo.scale = b(M)), this.add(this.picker.translate = b(O)), this.add(this.picker.rotate = b(L)), this.add(this.picker.scale = b(y)), this.add(this.helper.translate = b(S)), this.add(this.helper.rotate = b(N)), this.add(this.helper.scale = b(x)), this.picker.translate.visible = !1, this.picker.rotate.visible = !1, this.picker.scale.visible = !1;
|
|
5249
5249
|
}
|
|
5250
5250
|
// updateMatrixWorld will update transformations and appearance of individual handles
|
|
5251
5251
|
updateMatrixWorld(s) {
|
|
@@ -5258,10 +5258,10 @@ class xr extends ri {
|
|
|
5258
5258
|
n.visible = !0, n.rotation.set(0, 0, 0), n.position.copy(this.worldPosition);
|
|
5259
5259
|
let r;
|
|
5260
5260
|
if (this.camera.isOrthographicCamera ? r = (this.camera.top - this.camera.bottom) / this.camera.zoom : r = this.worldPosition.distanceTo(this.cameraPosition) * Math.min(1.9 * Math.tan(Math.PI * this.camera.fov / 360) / this.camera.zoom, 7), n.scale.set(1, 1, 1).multiplyScalar(r * this.size / 4), n.tag === "helper") {
|
|
5261
|
-
n.visible = !1, n.name === "AXIS" ? (n.visible = !!this.axis, this.axis === "X" && (j.setFromEuler(fs.set(0, 0, 0)), n.quaternion.copy(e).multiply(j), Math.abs(W.copy(Ue).applyQuaternion(e).dot(this.eye)) > 0.9 && (n.visible = !1)), this.axis === "Y" && (j.setFromEuler(fs.set(0, 0, Math.PI / 2)), n.quaternion.copy(e).multiply(j), Math.abs(W.copy(
|
|
5261
|
+
n.visible = !1, n.name === "AXIS" ? (n.visible = !!this.axis, this.axis === "X" && (j.setFromEuler(fs.set(0, 0, 0)), n.quaternion.copy(e).multiply(j), Math.abs(W.copy(Ue).applyQuaternion(e).dot(this.eye)) > 0.9 && (n.visible = !1)), this.axis === "Y" && (j.setFromEuler(fs.set(0, 0, Math.PI / 2)), n.quaternion.copy(e).multiply(j), Math.abs(W.copy(qt).applyQuaternion(e).dot(this.eye)) > 0.9 && (n.visible = !1)), this.axis === "Z" && (j.setFromEuler(fs.set(0, Math.PI / 2, 0)), n.quaternion.copy(e).multiply(j), Math.abs(W.copy(xe).applyQuaternion(e).dot(this.eye)) > 0.9 && (n.visible = !1)), this.axis === "XYZE" && (j.setFromEuler(fs.set(0, Math.PI / 2, 0)), W.copy(this.rotationAxis), n.quaternion.setFromRotationMatrix(mn.lookAt(Tn, W, qt)), n.quaternion.multiply(j), n.visible = this.dragging), this.axis === "E" && (n.visible = !1)) : n.name === "START" ? (n.position.copy(this.worldPositionStart), n.visible = this.dragging) : n.name === "END" ? (n.position.copy(this.worldPosition), n.visible = this.dragging) : n.name === "DELTA" ? (n.position.copy(this.worldPositionStart), n.quaternion.copy(this.worldQuaternionStart), nt.set(1e-10, 1e-10, 1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1), nt.applyQuaternion(this.worldQuaternionStart.clone().invert()), n.scale.copy(nt), n.visible = this.dragging) : (n.quaternion.copy(e), this.dragging ? n.position.copy(this.worldPositionStart) : n.position.copy(this.worldPosition), this.axis && (n.visible = this.axis.search(n.name) !== -1));
|
|
5262
5262
|
continue;
|
|
5263
5263
|
}
|
|
5264
|
-
n.quaternion.copy(e), this.mode === "translate" || this.mode === "scale" ? (n.name === "X" && Math.abs(W.copy(Ue).applyQuaternion(e).dot(this.eye)) > 0.99 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "Y" && Math.abs(W.copy(
|
|
5264
|
+
n.quaternion.copy(e), this.mode === "translate" || this.mode === "scale" ? (n.name === "X" && Math.abs(W.copy(Ue).applyQuaternion(e).dot(this.eye)) > 0.99 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "Y" && Math.abs(W.copy(qt).applyQuaternion(e).dot(this.eye)) > 0.99 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "Z" && Math.abs(W.copy(xe).applyQuaternion(e).dot(this.eye)) > 0.99 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "XY" && Math.abs(W.copy(xe).applyQuaternion(e).dot(this.eye)) < 0.2 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "YZ" && Math.abs(W.copy(Ue).applyQuaternion(e).dot(this.eye)) < 0.2 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "XZ" && Math.abs(W.copy(qt).applyQuaternion(e).dot(this.eye)) < 0.2 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1)) : this.mode === "rotate" && (ps.copy(e), W.copy(this.eye).applyQuaternion(j.copy(e).invert()), n.name.search("E") !== -1 && n.quaternion.setFromRotationMatrix(mn.lookAt(this.eye, Tn, qt)), n.name === "X" && (j.setFromAxisAngle(Ue, Math.atan2(-W.y, W.z)), j.multiplyQuaternions(ps, j), n.quaternion.copy(j)), n.name === "Y" && (j.setFromAxisAngle(qt, Math.atan2(W.x, W.z)), j.multiplyQuaternions(ps, j), n.quaternion.copy(j)), n.name === "Z" && (j.setFromAxisAngle(xe, Math.atan2(W.y, W.x)), j.multiplyQuaternions(ps, j), n.quaternion.copy(j))), n.visible = n.visible && (n.name.indexOf("X") === -1 || this.showX), n.visible = n.visible && (n.name.indexOf("Y") === -1 || this.showY), n.visible = n.visible && (n.name.indexOf("Z") === -1 || this.showZ), n.visible = n.visible && (n.name.indexOf("E") === -1 || this.showX && this.showY && this.showZ), n.material._color = n.material._color || n.material.color.clone(), n.material._opacity = n.material._opacity || n.material.opacity, n.material.color.copy(n.material._color), n.material.opacity = n.material._opacity, this.enabled && this.axis && (n.name === this.axis || this.axis.split("").some(function(a) {
|
|
5265
5265
|
return n.name === a;
|
|
5266
5266
|
})) && (n.material.color.setHex(16776960), n.material.opacity = 1);
|
|
5267
5267
|
}
|
|
@@ -5277,7 +5277,7 @@ class br extends v {
|
|
|
5277
5277
|
}
|
|
5278
5278
|
updateMatrixWorld(s) {
|
|
5279
5279
|
let t = this.space;
|
|
5280
|
-
switch (this.position.copy(this.worldPosition), this.mode === "scale" && (t = "local"), Cs.copy(Ue).applyQuaternion(t === "local" ? this.worldQuaternion : Rs), Me.copy(
|
|
5280
|
+
switch (this.position.copy(this.worldPosition), this.mode === "scale" && (t = "local"), Cs.copy(Ue).applyQuaternion(t === "local" ? this.worldQuaternion : Rs), Me.copy(qt).applyQuaternion(t === "local" ? this.worldQuaternion : Rs), De.copy(xe).applyQuaternion(t === "local" ? this.worldQuaternion : Rs), W.copy(Me), this.mode) {
|
|
5281
5281
|
case "translate":
|
|
5282
5282
|
case "scale":
|
|
5283
5283
|
switch (this.axis) {
|
|
@@ -5677,7 +5677,7 @@ class Vr {
|
|
|
5677
5677
|
* meshes that are currently visible, and the ones that were visible
|
|
5678
5678
|
* just before but not anymore.
|
|
5679
5679
|
*/
|
|
5680
|
-
I(this, "onViewUpdated", new
|
|
5680
|
+
I(this, "onViewUpdated", new $t());
|
|
5681
5681
|
/** {@link Component.enabled} */
|
|
5682
5682
|
I(this, "enabled", !0);
|
|
5683
5683
|
/**
|
|
@@ -5834,7 +5834,7 @@ class Gr extends Vr {
|
|
|
5834
5834
|
}
|
|
5835
5835
|
dispose() {
|
|
5836
5836
|
super.dispose(), this._intervalID !== null && (window.clearInterval(this._intervalID), this._intervalID = null), this._currentVisibleMeshes.clear(), this._recentlyHiddenMeshes.clear(), this._meshIDColorCodeMap.clear(), this._transparentMat.dispose(), this._colorCodeMeshMap.clear();
|
|
5837
|
-
const t = this.components.get(
|
|
5837
|
+
const t = this.components.get(zt);
|
|
5838
5838
|
for (const e in this.colorMeshes) {
|
|
5839
5839
|
const i = this.colorMeshes.get(e);
|
|
5840
5840
|
i && t.destroy(i, !0);
|
|
@@ -5876,7 +5876,7 @@ class Gr extends Vr {
|
|
|
5876
5876
|
return;
|
|
5877
5877
|
}
|
|
5878
5878
|
this.isProcessing = !0;
|
|
5879
|
-
const e = this.components.get(
|
|
5879
|
+
const e = this.components.get(zt);
|
|
5880
5880
|
this._currentVisibleMeshes.delete(t), this._recentlyHiddenMeshes.delete(t);
|
|
5881
5881
|
const i = this.colorMeshes.get(t.uuid), o = this._meshIDColorCodeMap.get(t.uuid);
|
|
5882
5882
|
if (!i || !o) {
|
|
@@ -6357,7 +6357,7 @@ const At = class At extends J {
|
|
|
6357
6357
|
}
|
|
6358
6358
|
/** {@link Disposable.dispose} */
|
|
6359
6359
|
dispose() {
|
|
6360
|
-
const t = this.components.get(
|
|
6360
|
+
const t = this.components.get(zt);
|
|
6361
6361
|
for (const e of this._meshes)
|
|
6362
6362
|
t.destroy(e);
|
|
6363
6363
|
this._meshes = [], this.onDisposed.trigger(At.uuid), this.onDisposed.reset();
|
|
@@ -6673,164 +6673,474 @@ const Ps = class Ps extends J {
|
|
|
6673
6673
|
};
|
|
6674
6674
|
I(Ps, "uuid", "fef46874-46a3-461b-8c44-2922ab77c806");
|
|
6675
6675
|
let ut = Ps;
|
|
6676
|
-
const Zr =
|
|
6677
|
-
|
|
6678
|
-
|
|
6679
|
-
|
|
6680
|
-
|
|
6681
|
-
|
|
6682
|
-
1674181508: "IFCANNOTATION",
|
|
6683
|
-
25142252: "IFCCONTROLLER",
|
|
6684
|
-
32344328: "IFCBOILER",
|
|
6685
|
-
76236018: "IFCLAMP",
|
|
6686
|
-
90941305: "IFCPUMP",
|
|
6687
|
-
177149247: "IFCAIRTERMINALBOX",
|
|
6688
|
-
182646315: "IFCFLOWINSTRUMENT",
|
|
6689
|
-
263784265: "IFCFURNISHINGELEMENT",
|
|
6690
|
-
264262732: "IFCELECTRICGENERATOR",
|
|
6691
|
-
277319702: "IFCAUDIOVISUALAPPLIANCE",
|
|
6692
|
-
310824031: "IFCPIPEFITTING",
|
|
6693
|
-
331165859: "IFCSTAIR",
|
|
6694
|
-
342316401: "IFCDUCTFITTING",
|
|
6695
|
-
377706215: "IFCMECHANICALFASTENER",
|
|
6696
|
-
395920057: "IFCDOOR",
|
|
6697
|
-
402227799: "IFCELECTRICMOTOR",
|
|
6698
|
-
413509423: "IFCSYSTEMFURNITUREELEMENT",
|
|
6699
|
-
484807127: "IFCEVAPORATOR",
|
|
6700
|
-
486154966: "IFCWINDOWSTANDARDCASE",
|
|
6701
|
-
629592764: "IFCLIGHTFIXTURE",
|
|
6702
|
-
630975310: "IFCUNITARYCONTROLELEMENT",
|
|
6703
|
-
635142910: "IFCCABLECARRIERFITTING",
|
|
6704
|
-
639361253: "IFCCOIL",
|
|
6705
|
-
647756555: "IFCFASTENER",
|
|
6706
|
-
707683696: "IFCFLOWSTORAGEDEVICE",
|
|
6707
|
-
738039164: "IFCPROTECTIVEDEVICE",
|
|
6708
|
-
753842376: "IFCBEAM",
|
|
6709
|
-
812556717: "IFCTANK",
|
|
6710
|
-
819412036: "IFCFILTER",
|
|
6711
|
-
843113511: "IFCCOLUMN",
|
|
6712
|
-
862014818: "IFCELECTRICDISTRIBUTIONBOARD",
|
|
6713
|
-
900683007: "IFCFOOTING",
|
|
6714
|
-
905975707: "IFCCOLUMNSTANDARDCASE",
|
|
6715
|
-
926996030: "IFCVOIDINGFEATURE",
|
|
6716
|
-
979691226: "IFCREINFORCINGBAR",
|
|
6717
|
-
987401354: "IFCFLOWSEGMENT",
|
|
6718
|
-
1003880860: "IFCELECTRICTIMECONTROL",
|
|
6719
|
-
1051757585: "IFCCABLEFITTING",
|
|
6720
|
-
1052013943: "IFCDISTRIBUTIONCHAMBERELEMENT",
|
|
6721
|
-
1062813311: "IFCDISTRIBUTIONCONTROLELEMENT",
|
|
6722
|
-
1073191201: "IFCMEMBER",
|
|
6723
|
-
1095909175: "IFCBUILDINGELEMENTPROXY",
|
|
6724
|
-
1156407060: "IFCPLATESTANDARDCASE",
|
|
6725
|
-
1162798199: "IFCSWITCHINGDEVICE",
|
|
6726
|
-
1329646415: "IFCSHADINGDEVICE",
|
|
6727
|
-
1335981549: "IFCDISCRETEACCESSORY",
|
|
6728
|
-
1360408905: "IFCDUCTSILENCER",
|
|
6729
|
-
1404847402: "IFCSTACKTERMINAL",
|
|
6730
|
-
1426591983: "IFCFIRESUPPRESSIONTERMINAL",
|
|
6731
|
-
1437502449: "IFCMEDICALDEVICE",
|
|
6732
|
-
1509553395: "IFCFURNITURE",
|
|
6733
|
-
1529196076: "IFCSLAB",
|
|
6734
|
-
1620046519: "IFCTRANSPORTELEMENT",
|
|
6735
|
-
1634111441: "IFCAIRTERMINAL",
|
|
6736
|
-
1658829314: "IFCENERGYCONVERSIONDEVICE",
|
|
6737
|
-
1677625105: "IFCCIVILELEMENT",
|
|
6738
|
-
1687234759: "IFCPILE",
|
|
6739
|
-
1904799276: "IFCELECTRICAPPLIANCE",
|
|
6740
|
-
1911478936: "IFCMEMBERSTANDARDCASE",
|
|
6741
|
-
1945004755: "IFCDISTRIBUTIONELEMENT",
|
|
6742
|
-
1973544240: "IFCCOVERING",
|
|
6743
|
-
1999602285: "IFCSPACEHEATER",
|
|
6744
|
-
2016517767: "IFCROOF",
|
|
6745
|
-
2056796094: "IFCAIRTOAIRHEATRECOVERY",
|
|
6746
|
-
2058353004: "IFCFLOWCONTROLLER",
|
|
6747
|
-
2068733104: "IFCHUMIDIFIER",
|
|
6748
|
-
2176052936: "IFCJUNCTIONBOX",
|
|
6749
|
-
2188021234: "IFCFLOWMETER",
|
|
6750
|
-
2223149337: "IFCFLOWTERMINAL",
|
|
6751
|
-
2262370178: "IFCRAILING",
|
|
6752
|
-
2272882330: "IFCCONDENSER",
|
|
6753
|
-
2295281155: "IFCPROTECTIVEDEVICETRIPPINGUNIT",
|
|
6754
|
-
2320036040: "IFCREINFORCINGMESH",
|
|
6755
|
-
2347447852: "IFCTENDONANCHOR",
|
|
6756
|
-
2391383451: "IFCVIBRATIONISOLATOR",
|
|
6757
|
-
2391406946: "IFCWALL",
|
|
6758
|
-
2474470126: "IFCMOTORCONNECTION",
|
|
6759
|
-
2769231204: "IFCVIRTUALELEMENT",
|
|
6760
|
-
2814081492: "IFCENGINE",
|
|
6761
|
-
2906023776: "IFCBEAMSTANDARDCASE",
|
|
6762
|
-
2938176219: "IFCBURNER",
|
|
6763
|
-
2979338954: "IFCBUILDINGELEMENTPART",
|
|
6764
|
-
3024970846: "IFCRAMP",
|
|
6765
|
-
3026737570: "IFCTUBEBUNDLE",
|
|
6766
|
-
3027962421: "IFCSLABSTANDARDCASE",
|
|
6767
|
-
3040386961: "IFCDISTRIBUTIONFLOWELEMENT",
|
|
6768
|
-
3053780830: "IFCSANITARYTERMINAL",
|
|
6769
|
-
3079942009: "IFCOPENINGSTANDARDCASE",
|
|
6770
|
-
3087945054: "IFCALARM",
|
|
6771
|
-
3101698114: "IFCSURFACEFEATURE",
|
|
6772
|
-
3127900445: "IFCSLABELEMENTEDCASE",
|
|
6773
|
-
3132237377: "IFCFLOWMOVINGDEVICE",
|
|
6774
|
-
3171933400: "IFCPLATE",
|
|
6775
|
-
3221913625: "IFCCOMMUNICATIONSAPPLIANCE",
|
|
6776
|
-
3242481149: "IFCDOORSTANDARDCASE",
|
|
6777
|
-
3283111854: "IFCRAMPFLIGHT",
|
|
6778
|
-
3296154744: "IFCCHIMNEY",
|
|
6779
|
-
3304561284: "IFCWINDOW",
|
|
6780
|
-
3310460725: "IFCELECTRICFLOWSTORAGEDEVICE",
|
|
6781
|
-
3319311131: "IFCHEATEXCHANGER",
|
|
6782
|
-
3415622556: "IFCFAN",
|
|
6783
|
-
3420628829: "IFCSOLARDEVICE",
|
|
6784
|
-
3493046030: "IFCGEOGRAPHICELEMENT",
|
|
6785
|
-
3495092785: "IFCCURTAINWALL",
|
|
6786
|
-
3508470533: "IFCFLOWTREATMENTDEVICE",
|
|
6787
|
-
3512223829: "IFCWALLSTANDARDCASE",
|
|
6788
|
-
3518393246: "IFCDUCTSEGMENT",
|
|
6789
|
-
3571504051: "IFCCOMPRESSOR",
|
|
6790
|
-
3588315303: "IFCOPENINGELEMENT",
|
|
6791
|
-
3612865200: "IFCPIPESEGMENT",
|
|
6792
|
-
3640358203: "IFCCOOLINGTOWER",
|
|
6793
|
-
3651124850: "IFCPROJECTIONELEMENT",
|
|
6794
|
-
3694346114: "IFCOUTLET",
|
|
6795
|
-
3747195512: "IFCEVAPORATIVECOOLER",
|
|
6796
|
-
3758799889: "IFCCABLECARRIERSEGMENT",
|
|
6797
|
-
3824725483: "IFCTENDON",
|
|
6798
|
-
3825984169: "IFCTRANSFORMER",
|
|
6799
|
-
3902619387: "IFCCHILLER",
|
|
6800
|
-
4074379575: "IFCDAMPER",
|
|
6801
|
-
4086658281: "IFCSENSOR",
|
|
6802
|
-
4123344466: "IFCELEMENTASSEMBLY",
|
|
6803
|
-
4136498852: "IFCCOOLEDBEAM",
|
|
6804
|
-
4156078855: "IFCWALLELEMENTEDCASE",
|
|
6805
|
-
4175244083: "IFCINTERCEPTOR",
|
|
6806
|
-
4207607924: "IFCVALVE",
|
|
6807
|
-
4217484030: "IFCCABLESEGMENT",
|
|
6808
|
-
4237592921: "IFCWASTETERMINAL",
|
|
6809
|
-
4252922144: "IFCSTAIRFLIGHT",
|
|
6810
|
-
4278956645: "IFCFLOWFITTING",
|
|
6811
|
-
4288193352: "IFCACTUATOR",
|
|
6812
|
-
4292641817: "IFCUNITARYEQUIPMENT",
|
|
6813
|
-
3009204131: "IFCGRID"
|
|
6814
|
-
};
|
|
6815
|
-
class ra {
|
|
6816
|
-
getAll(s, t) {
|
|
6817
|
-
const e = {}, i = Object.keys(Zr).map((o) => parseInt(o, 10));
|
|
6818
|
-
for (let o = 0; o < i.length; o++) {
|
|
6819
|
-
const n = i[o], r = s.GetLineIDsWithType(t, n), a = r.size();
|
|
6820
|
-
for (let c = 0; c < a; c++)
|
|
6821
|
-
e[r.get(c)] = n;
|
|
6676
|
+
const Zr = /* @__PURE__ */ new Map([
|
|
6677
|
+
[
|
|
6678
|
+
U.IFCRELAGGREGATES,
|
|
6679
|
+
{
|
|
6680
|
+
forRelating: "IsDecomposedBy",
|
|
6681
|
+
forRelated: "Decomposes"
|
|
6822
6682
|
}
|
|
6823
|
-
|
|
6683
|
+
],
|
|
6684
|
+
[
|
|
6685
|
+
U.IFCRELASSOCIATESMATERIAL,
|
|
6686
|
+
{
|
|
6687
|
+
forRelating: "AssociatedTo",
|
|
6688
|
+
forRelated: "HasAssociations"
|
|
6689
|
+
}
|
|
6690
|
+
],
|
|
6691
|
+
[
|
|
6692
|
+
U.IFCRELASSOCIATESCLASSIFICATION,
|
|
6693
|
+
{
|
|
6694
|
+
forRelating: "ClassificationForObjects",
|
|
6695
|
+
forRelated: "HasAssociations"
|
|
6696
|
+
}
|
|
6697
|
+
],
|
|
6698
|
+
[
|
|
6699
|
+
U.IFCRELASSIGNSTOGROUP,
|
|
6700
|
+
{
|
|
6701
|
+
forRelating: "IsGroupedBy",
|
|
6702
|
+
forRelated: "HasAssignments"
|
|
6703
|
+
}
|
|
6704
|
+
],
|
|
6705
|
+
[
|
|
6706
|
+
U.IFCRELDEFINESBYPROPERTIES,
|
|
6707
|
+
{
|
|
6708
|
+
forRelated: "IsDefinedBy",
|
|
6709
|
+
forRelating: "DefinesOcurrence"
|
|
6710
|
+
}
|
|
6711
|
+
],
|
|
6712
|
+
[
|
|
6713
|
+
U.IFCRELDEFINESBYTYPE,
|
|
6714
|
+
{
|
|
6715
|
+
forRelated: "IsTypedBy",
|
|
6716
|
+
forRelating: "Types"
|
|
6717
|
+
}
|
|
6718
|
+
],
|
|
6719
|
+
[
|
|
6720
|
+
U.IFCRELDEFINESBYTEMPLATE,
|
|
6721
|
+
{
|
|
6722
|
+
forRelated: "IsDefinedBy",
|
|
6723
|
+
forRelating: "Defines"
|
|
6724
|
+
}
|
|
6725
|
+
],
|
|
6726
|
+
[
|
|
6727
|
+
U.IFCRELCONTAINEDINSPATIALSTRUCTURE,
|
|
6728
|
+
{
|
|
6729
|
+
forRelated: "ContainedInStructure",
|
|
6730
|
+
forRelating: "ContainsElements"
|
|
6731
|
+
}
|
|
6732
|
+
]
|
|
6733
|
+
]), Ve = class Ve extends J {
|
|
6734
|
+
constructor(t) {
|
|
6735
|
+
super(t);
|
|
6736
|
+
/** {@link Disposable.onDisposed} */
|
|
6737
|
+
I(this, "onDisposed", new D());
|
|
6738
|
+
I(this, "enabled", !0);
|
|
6739
|
+
I(this, "onRelationsIndexed", new D());
|
|
6740
|
+
I(this, "_relToAttributesMap", Zr);
|
|
6741
|
+
I(this, "_inverseAttributes", [
|
|
6742
|
+
"IsDecomposedBy",
|
|
6743
|
+
"Decomposes",
|
|
6744
|
+
"AssociatedTo",
|
|
6745
|
+
"HasAssociations",
|
|
6746
|
+
"ClassificationForObjects",
|
|
6747
|
+
"IsGroupedBy",
|
|
6748
|
+
"HasAssignments",
|
|
6749
|
+
"IsDefinedBy",
|
|
6750
|
+
"DefinesOcurrence",
|
|
6751
|
+
"IsTypedBy",
|
|
6752
|
+
"Types",
|
|
6753
|
+
"Defines",
|
|
6754
|
+
"ContainedInStructure",
|
|
6755
|
+
"ContainsElements"
|
|
6756
|
+
]);
|
|
6757
|
+
I(this, "_ifcRels", [
|
|
6758
|
+
U.IFCRELAGGREGATES,
|
|
6759
|
+
U.IFCRELASSOCIATESMATERIAL,
|
|
6760
|
+
U.IFCRELASSOCIATESCLASSIFICATION,
|
|
6761
|
+
U.IFCRELASSIGNSTOGROUP,
|
|
6762
|
+
U.IFCRELDEFINESBYPROPERTIES,
|
|
6763
|
+
U.IFCRELDEFINESBYTYPE,
|
|
6764
|
+
U.IFCRELDEFINESBYTEMPLATE,
|
|
6765
|
+
U.IFCRELCONTAINEDINSPATIALSTRUCTURE
|
|
6766
|
+
]);
|
|
6767
|
+
/**
|
|
6768
|
+
* Holds the relationship mappings for each model processed by the indexer.
|
|
6769
|
+
* The structure is a map where each key is a model's UUID, and the value is another map.
|
|
6770
|
+
* This inner map's keys are entity expressIDs, and its values are maps where each key is an index
|
|
6771
|
+
* representing a specific relation type, and the value is an array of expressIDs of entities
|
|
6772
|
+
* that are related through that relation type. This structure allows for efficient querying
|
|
6773
|
+
* of entity relationships within a model.
|
|
6774
|
+
*/
|
|
6775
|
+
I(this, "relationMaps", {});
|
|
6776
|
+
I(this, "onFragmentsDisposed", (t) => {
|
|
6777
|
+
delete this.relationMaps[t.groupID];
|
|
6778
|
+
});
|
|
6779
|
+
this.components.add(Ve.uuid, this), t.get(ut).onFragmentsDisposed.add(this.onFragmentsDisposed);
|
|
6824
6780
|
}
|
|
6825
|
-
|
|
6826
|
-
const
|
|
6827
|
-
|
|
6828
|
-
|
|
6829
|
-
|
|
6830
|
-
|
|
6831
|
-
|
|
6832
|
-
|
|
6833
|
-
|
|
6781
|
+
indexRelations(t, e, i, o) {
|
|
6782
|
+
const n = Object.keys(e).find(
|
|
6783
|
+
(E) => E.startsWith("Relating")
|
|
6784
|
+
), r = Object.keys(e).find(
|
|
6785
|
+
(E) => E.startsWith("Related")
|
|
6786
|
+
);
|
|
6787
|
+
if (!(n && r))
|
|
6788
|
+
return;
|
|
6789
|
+
const a = e[n].value, c = e[r].map((E) => E.value), h = t.get(a) ?? /* @__PURE__ */ new Map(), d = this._inverseAttributes.indexOf(o);
|
|
6790
|
+
h.set(d, c), t.set(a, h);
|
|
6791
|
+
for (const E of c) {
|
|
6792
|
+
const u = t.get(E) ?? /* @__PURE__ */ new Map(), p = this._inverseAttributes.indexOf(i), A = u.get(p) ?? [];
|
|
6793
|
+
A.push(a), u.set(p, A), t.set(E, u);
|
|
6794
|
+
}
|
|
6795
|
+
}
|
|
6796
|
+
/**
|
|
6797
|
+
* Adds a relation map to the model's relations map.
|
|
6798
|
+
*
|
|
6799
|
+
* @param model - The `FragmentsGroup` model to which the relation map will be added.
|
|
6800
|
+
* @param relationMap - The `RelationsMap` to be added to the model's relations map.
|
|
6801
|
+
*
|
|
6802
|
+
* @fires onRelationsIndexed - Triggers an event with the model's UUID and the added relation map.
|
|
6803
|
+
*/
|
|
6804
|
+
setRelationMap(t, e) {
|
|
6805
|
+
this.relationMaps[t.uuid] = e, this.onRelationsIndexed.trigger({
|
|
6806
|
+
modelID: t.uuid,
|
|
6807
|
+
relationsMap: e
|
|
6808
|
+
});
|
|
6809
|
+
}
|
|
6810
|
+
/**
|
|
6811
|
+
* Processes a given model to index its IFC entities relations based on predefined inverse attributes.
|
|
6812
|
+
* This method iterates through each specified inverse attribute, retrieves the corresponding relations,
|
|
6813
|
+
* and maps them in a structured way to facilitate quick access to related entities.
|
|
6814
|
+
*
|
|
6815
|
+
* The process involves querying the model for each relation type associated with the inverse attributes
|
|
6816
|
+
* and updating the internal relationMaps with the relationships found. This map is keyed by the model's UUID
|
|
6817
|
+
* and contains a nested map where each key is an entity's expressID and its value is another map.
|
|
6818
|
+
* This inner map's keys are the indices of the inverse attributes, and its values are arrays of expressIDs
|
|
6819
|
+
* of entities that are related through that attribute.
|
|
6820
|
+
*
|
|
6821
|
+
* @param model The `FragmentsGroup` model to be processed. It must have properties loaded.
|
|
6822
|
+
* @returns A promise that resolves to the relations map for the processed model. This map is a detailed
|
|
6823
|
+
* representation of the relations indexed by entity expressIDs and relation types.
|
|
6824
|
+
* @throws An error if the model does not have properties loaded.
|
|
6825
|
+
*/
|
|
6826
|
+
async process(t) {
|
|
6827
|
+
if (!t.hasProperties)
|
|
6828
|
+
throw new Error("FragmentsGroup properties not found");
|
|
6829
|
+
let e = this.relationMaps[t.uuid];
|
|
6830
|
+
if (e)
|
|
6831
|
+
return e;
|
|
6832
|
+
e = /* @__PURE__ */ new Map();
|
|
6833
|
+
for (const i of this._ifcRels) {
|
|
6834
|
+
const o = await t.getAllPropertiesOfType(i);
|
|
6835
|
+
if (!o)
|
|
6836
|
+
continue;
|
|
6837
|
+
const n = this._relToAttributesMap.get(i);
|
|
6838
|
+
if (!n)
|
|
6839
|
+
continue;
|
|
6840
|
+
const { forRelated: r, forRelating: a } = n;
|
|
6841
|
+
for (const c in o) {
|
|
6842
|
+
const h = o[c];
|
|
6843
|
+
this.indexRelations(e, h, r, a);
|
|
6844
|
+
}
|
|
6845
|
+
}
|
|
6846
|
+
return this.setRelationMap(t, e), e;
|
|
6847
|
+
}
|
|
6848
|
+
/**
|
|
6849
|
+
* Processes a given model from a WebIfc API to index its IFC entities relations.
|
|
6850
|
+
*
|
|
6851
|
+
* @param ifcApi - The WebIfc API instance from which to retrieve the model's properties.
|
|
6852
|
+
* @param modelID - The unique identifier of the model within the WebIfc API.
|
|
6853
|
+
* @returns A promise that resolves to the relations map for the processed model.
|
|
6854
|
+
* This map is a detailed representation of the relations indexed by entity expressIDs and relation types.
|
|
6855
|
+
*/
|
|
6856
|
+
async processFromWebIfc(t, e) {
|
|
6857
|
+
const i = /* @__PURE__ */ new Map();
|
|
6858
|
+
for (const o of this._ifcRels) {
|
|
6859
|
+
const n = this._relToAttributesMap.get(o);
|
|
6860
|
+
if (!n)
|
|
6861
|
+
continue;
|
|
6862
|
+
const { forRelated: r, forRelating: a } = n, c = t.GetLineIDsWithType(e, o);
|
|
6863
|
+
for (let h = 0; h < c.size(); h++) {
|
|
6864
|
+
const d = await t.properties.getItemProperties(
|
|
6865
|
+
e,
|
|
6866
|
+
c.get(h)
|
|
6867
|
+
);
|
|
6868
|
+
this.indexRelations(i, d, r, a);
|
|
6869
|
+
}
|
|
6870
|
+
}
|
|
6871
|
+
return this.onRelationsIndexed.trigger({
|
|
6872
|
+
modelID: e.toString(),
|
|
6873
|
+
relationsMap: i
|
|
6874
|
+
}), i;
|
|
6875
|
+
}
|
|
6876
|
+
/**
|
|
6877
|
+
* Retrieves the relations of a specific entity within a model based on the given relation name.
|
|
6878
|
+
* This method searches the indexed relation maps for the specified model and entity,
|
|
6879
|
+
* returning the IDs of related entities if a match is found.
|
|
6880
|
+
*
|
|
6881
|
+
* @param model The `FragmentsGroup` model containing the entity.
|
|
6882
|
+
* @param expressID The unique identifier of the entity within the model.
|
|
6883
|
+
* @param relationName The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
|
|
6884
|
+
* @returns An array of express IDs representing the related entities, or `null` if no relations are found
|
|
6885
|
+
* or the specified relation name is not indexed.
|
|
6886
|
+
*/
|
|
6887
|
+
getEntityRelations(t, e, i) {
|
|
6888
|
+
const o = this.relationMaps[t.uuid];
|
|
6889
|
+
if (!o)
|
|
6890
|
+
return null;
|
|
6891
|
+
const n = o.get(e), r = this._inverseAttributes.indexOf(i);
|
|
6892
|
+
if (!n || r === -1)
|
|
6893
|
+
return null;
|
|
6894
|
+
const a = n.get(r);
|
|
6895
|
+
return a || null;
|
|
6896
|
+
}
|
|
6897
|
+
/**
|
|
6898
|
+
* Serializes the relations of a given relation map into a JSON string.
|
|
6899
|
+
* This method iterates through the relations in the given map, organizing them into a structured object where each key is an expressID of an entity,
|
|
6900
|
+
* and its value is another object mapping relation indices to arrays of related entity expressIDs.
|
|
6901
|
+
* The resulting object is then serialized into a JSON string.
|
|
6902
|
+
*
|
|
6903
|
+
* @param relationMap - The map of relations to be serialized. The map keys are expressIDs of entities, and the values are maps where each key is a relation type ID and its value is an array of expressIDs of entities related through that relation type.
|
|
6904
|
+
* @returns A JSON string representing the serialized relations of the given relation map.
|
|
6905
|
+
*/
|
|
6906
|
+
serializeRelations(t) {
|
|
6907
|
+
const e = {};
|
|
6908
|
+
for (const [i, o] of t.entries()) {
|
|
6909
|
+
e[i] || (e[i] = {});
|
|
6910
|
+
for (const [n, r] of o.entries())
|
|
6911
|
+
e[i][n] = r;
|
|
6912
|
+
}
|
|
6913
|
+
return JSON.stringify(e);
|
|
6914
|
+
}
|
|
6915
|
+
/**
|
|
6916
|
+
* Serializes the relations of a specific model into a JSON string.
|
|
6917
|
+
* This method iterates through the relations indexed for the given model,
|
|
6918
|
+
* organizing them into a structured object where each key is an expressID of an entity,
|
|
6919
|
+
* and its value is another object mapping relation indices to arrays of related entity expressIDs.
|
|
6920
|
+
* The resulting object is then serialized into a JSON string.
|
|
6921
|
+
*
|
|
6922
|
+
* @param model The `FragmentsGroup` model whose relations are to be serialized.
|
|
6923
|
+
* @returns A JSON string representing the serialized relations of the specified model.
|
|
6924
|
+
* If the model has no indexed relations, `null` is returned.
|
|
6925
|
+
*/
|
|
6926
|
+
serializeModelRelations(t) {
|
|
6927
|
+
const e = this.relationMaps[t.uuid];
|
|
6928
|
+
return e ? this.serializeRelations(e) : null;
|
|
6929
|
+
}
|
|
6930
|
+
/**
|
|
6931
|
+
* Serializes all relations of every model processed by the indexer into a JSON string.
|
|
6932
|
+
* This method iterates through each model's relations indexed in `relationMaps`, organizing them
|
|
6933
|
+
* into a structured JSON object. Each top-level key in this object corresponds to a model's UUID,
|
|
6934
|
+
* and its value is another object mapping entity expressIDs to their related entities, categorized
|
|
6935
|
+
* by relation types. The structure facilitates easy access to any entity's relations across all models.
|
|
6936
|
+
*
|
|
6937
|
+
* @returns A JSON string representing the serialized relations of all models processed by the indexer.
|
|
6938
|
+
* If no relations have been indexed, an empty object is returned as a JSON string.
|
|
6939
|
+
*/
|
|
6940
|
+
serializeAllRelations() {
|
|
6941
|
+
const t = {};
|
|
6942
|
+
for (const e in this.relationMaps) {
|
|
6943
|
+
const i = this.relationMaps[e], o = {};
|
|
6944
|
+
for (const [n, r] of i.entries()) {
|
|
6945
|
+
o[n] || (o[n] = {});
|
|
6946
|
+
for (const [a, c] of r.entries())
|
|
6947
|
+
o[n][a] = c;
|
|
6948
|
+
}
|
|
6949
|
+
t[e] = o;
|
|
6950
|
+
}
|
|
6951
|
+
return JSON.stringify(t);
|
|
6952
|
+
}
|
|
6953
|
+
/**
|
|
6954
|
+
* Converts a JSON string representing relations between entities into a structured map.
|
|
6955
|
+
* This method parses the JSON string to reconstruct the relations map that indexes
|
|
6956
|
+
* entity relations by their express IDs. The outer map keys are the express IDs of entities,
|
|
6957
|
+
* and the values are maps where each key is a relation type ID and its value is an array
|
|
6958
|
+
* of express IDs of entities related through that relation type.
|
|
6959
|
+
*
|
|
6960
|
+
* @param json The JSON string to be parsed into the relations map.
|
|
6961
|
+
* @returns A `Map` where the key is the express ID of an entity as a number, and the value
|
|
6962
|
+
* is another `Map`. This inner map's key is the relation type ID as a number, and its value
|
|
6963
|
+
* is an array of express IDs (as numbers) of entities related through that relation type.
|
|
6964
|
+
*/
|
|
6965
|
+
getRelationsMapFromJSON(t) {
|
|
6966
|
+
const e = JSON.parse(t), i = /* @__PURE__ */ new Map();
|
|
6967
|
+
for (const o in e) {
|
|
6968
|
+
const n = e[o], r = /* @__PURE__ */ new Map();
|
|
6969
|
+
for (const a in n)
|
|
6970
|
+
r.set(Number(a), n[a]);
|
|
6971
|
+
i.set(Number(o), r);
|
|
6972
|
+
}
|
|
6973
|
+
return i;
|
|
6974
|
+
}
|
|
6975
|
+
/**
|
|
6976
|
+
* Disposes the component, cleaning up resources and detaching event listeners.
|
|
6977
|
+
* This ensures that the component is properly cleaned up and does not leave behind any
|
|
6978
|
+
* references that could prevent garbage collection.
|
|
6979
|
+
*/
|
|
6980
|
+
dispose() {
|
|
6981
|
+
this.relationMaps = {}, this.components.get(ut).onFragmentsDisposed.remove(this.onFragmentsDisposed), this.onDisposed.trigger(Ve.uuid), this.onDisposed.reset();
|
|
6982
|
+
}
|
|
6983
|
+
};
|
|
6984
|
+
I(Ve, "uuid", "23a889ab-83b3-44a4-8bee-ead83438370b");
|
|
6985
|
+
let We = Ve;
|
|
6986
|
+
const Qr = {
|
|
6987
|
+
103090709: "IFCPROJECT",
|
|
6988
|
+
4097777520: "IFCSITE",
|
|
6989
|
+
4031249490: "IFCBUILDING",
|
|
6990
|
+
3124254112: "IFCBUILDINGSTOREY",
|
|
6991
|
+
3856911033: "IFCSPACE",
|
|
6992
|
+
1674181508: "IFCANNOTATION",
|
|
6993
|
+
25142252: "IFCCONTROLLER",
|
|
6994
|
+
32344328: "IFCBOILER",
|
|
6995
|
+
76236018: "IFCLAMP",
|
|
6996
|
+
90941305: "IFCPUMP",
|
|
6997
|
+
177149247: "IFCAIRTERMINALBOX",
|
|
6998
|
+
182646315: "IFCFLOWINSTRUMENT",
|
|
6999
|
+
263784265: "IFCFURNISHINGELEMENT",
|
|
7000
|
+
264262732: "IFCELECTRICGENERATOR",
|
|
7001
|
+
277319702: "IFCAUDIOVISUALAPPLIANCE",
|
|
7002
|
+
310824031: "IFCPIPEFITTING",
|
|
7003
|
+
331165859: "IFCSTAIR",
|
|
7004
|
+
342316401: "IFCDUCTFITTING",
|
|
7005
|
+
377706215: "IFCMECHANICALFASTENER",
|
|
7006
|
+
395920057: "IFCDOOR",
|
|
7007
|
+
402227799: "IFCELECTRICMOTOR",
|
|
7008
|
+
413509423: "IFCSYSTEMFURNITUREELEMENT",
|
|
7009
|
+
484807127: "IFCEVAPORATOR",
|
|
7010
|
+
486154966: "IFCWINDOWSTANDARDCASE",
|
|
7011
|
+
629592764: "IFCLIGHTFIXTURE",
|
|
7012
|
+
630975310: "IFCUNITARYCONTROLELEMENT",
|
|
7013
|
+
635142910: "IFCCABLECARRIERFITTING",
|
|
7014
|
+
639361253: "IFCCOIL",
|
|
7015
|
+
647756555: "IFCFASTENER",
|
|
7016
|
+
707683696: "IFCFLOWSTORAGEDEVICE",
|
|
7017
|
+
738039164: "IFCPROTECTIVEDEVICE",
|
|
7018
|
+
753842376: "IFCBEAM",
|
|
7019
|
+
812556717: "IFCTANK",
|
|
7020
|
+
819412036: "IFCFILTER",
|
|
7021
|
+
843113511: "IFCCOLUMN",
|
|
7022
|
+
862014818: "IFCELECTRICDISTRIBUTIONBOARD",
|
|
7023
|
+
900683007: "IFCFOOTING",
|
|
7024
|
+
905975707: "IFCCOLUMNSTANDARDCASE",
|
|
7025
|
+
926996030: "IFCVOIDINGFEATURE",
|
|
7026
|
+
979691226: "IFCREINFORCINGBAR",
|
|
7027
|
+
987401354: "IFCFLOWSEGMENT",
|
|
7028
|
+
1003880860: "IFCELECTRICTIMECONTROL",
|
|
7029
|
+
1051757585: "IFCCABLEFITTING",
|
|
7030
|
+
1052013943: "IFCDISTRIBUTIONCHAMBERELEMENT",
|
|
7031
|
+
1062813311: "IFCDISTRIBUTIONCONTROLELEMENT",
|
|
7032
|
+
1073191201: "IFCMEMBER",
|
|
7033
|
+
1095909175: "IFCBUILDINGELEMENTPROXY",
|
|
7034
|
+
1156407060: "IFCPLATESTANDARDCASE",
|
|
7035
|
+
1162798199: "IFCSWITCHINGDEVICE",
|
|
7036
|
+
1329646415: "IFCSHADINGDEVICE",
|
|
7037
|
+
1335981549: "IFCDISCRETEACCESSORY",
|
|
7038
|
+
1360408905: "IFCDUCTSILENCER",
|
|
7039
|
+
1404847402: "IFCSTACKTERMINAL",
|
|
7040
|
+
1426591983: "IFCFIRESUPPRESSIONTERMINAL",
|
|
7041
|
+
1437502449: "IFCMEDICALDEVICE",
|
|
7042
|
+
1509553395: "IFCFURNITURE",
|
|
7043
|
+
1529196076: "IFCSLAB",
|
|
7044
|
+
1620046519: "IFCTRANSPORTELEMENT",
|
|
7045
|
+
1634111441: "IFCAIRTERMINAL",
|
|
7046
|
+
1658829314: "IFCENERGYCONVERSIONDEVICE",
|
|
7047
|
+
1677625105: "IFCCIVILELEMENT",
|
|
7048
|
+
1687234759: "IFCPILE",
|
|
7049
|
+
1904799276: "IFCELECTRICAPPLIANCE",
|
|
7050
|
+
1911478936: "IFCMEMBERSTANDARDCASE",
|
|
7051
|
+
1945004755: "IFCDISTRIBUTIONELEMENT",
|
|
7052
|
+
1973544240: "IFCCOVERING",
|
|
7053
|
+
1999602285: "IFCSPACEHEATER",
|
|
7054
|
+
2016517767: "IFCROOF",
|
|
7055
|
+
2056796094: "IFCAIRTOAIRHEATRECOVERY",
|
|
7056
|
+
2058353004: "IFCFLOWCONTROLLER",
|
|
7057
|
+
2068733104: "IFCHUMIDIFIER",
|
|
7058
|
+
2176052936: "IFCJUNCTIONBOX",
|
|
7059
|
+
2188021234: "IFCFLOWMETER",
|
|
7060
|
+
2223149337: "IFCFLOWTERMINAL",
|
|
7061
|
+
2262370178: "IFCRAILING",
|
|
7062
|
+
2272882330: "IFCCONDENSER",
|
|
7063
|
+
2295281155: "IFCPROTECTIVEDEVICETRIPPINGUNIT",
|
|
7064
|
+
2320036040: "IFCREINFORCINGMESH",
|
|
7065
|
+
2347447852: "IFCTENDONANCHOR",
|
|
7066
|
+
2391383451: "IFCVIBRATIONISOLATOR",
|
|
7067
|
+
2391406946: "IFCWALL",
|
|
7068
|
+
2474470126: "IFCMOTORCONNECTION",
|
|
7069
|
+
2769231204: "IFCVIRTUALELEMENT",
|
|
7070
|
+
2814081492: "IFCENGINE",
|
|
7071
|
+
2906023776: "IFCBEAMSTANDARDCASE",
|
|
7072
|
+
2938176219: "IFCBURNER",
|
|
7073
|
+
2979338954: "IFCBUILDINGELEMENTPART",
|
|
7074
|
+
3024970846: "IFCRAMP",
|
|
7075
|
+
3026737570: "IFCTUBEBUNDLE",
|
|
7076
|
+
3027962421: "IFCSLABSTANDARDCASE",
|
|
7077
|
+
3040386961: "IFCDISTRIBUTIONFLOWELEMENT",
|
|
7078
|
+
3053780830: "IFCSANITARYTERMINAL",
|
|
7079
|
+
3079942009: "IFCOPENINGSTANDARDCASE",
|
|
7080
|
+
3087945054: "IFCALARM",
|
|
7081
|
+
3101698114: "IFCSURFACEFEATURE",
|
|
7082
|
+
3127900445: "IFCSLABELEMENTEDCASE",
|
|
7083
|
+
3132237377: "IFCFLOWMOVINGDEVICE",
|
|
7084
|
+
3171933400: "IFCPLATE",
|
|
7085
|
+
3221913625: "IFCCOMMUNICATIONSAPPLIANCE",
|
|
7086
|
+
3242481149: "IFCDOORSTANDARDCASE",
|
|
7087
|
+
3283111854: "IFCRAMPFLIGHT",
|
|
7088
|
+
3296154744: "IFCCHIMNEY",
|
|
7089
|
+
3304561284: "IFCWINDOW",
|
|
7090
|
+
3310460725: "IFCELECTRICFLOWSTORAGEDEVICE",
|
|
7091
|
+
3319311131: "IFCHEATEXCHANGER",
|
|
7092
|
+
3415622556: "IFCFAN",
|
|
7093
|
+
3420628829: "IFCSOLARDEVICE",
|
|
7094
|
+
3493046030: "IFCGEOGRAPHICELEMENT",
|
|
7095
|
+
3495092785: "IFCCURTAINWALL",
|
|
7096
|
+
3508470533: "IFCFLOWTREATMENTDEVICE",
|
|
7097
|
+
3512223829: "IFCWALLSTANDARDCASE",
|
|
7098
|
+
3518393246: "IFCDUCTSEGMENT",
|
|
7099
|
+
3571504051: "IFCCOMPRESSOR",
|
|
7100
|
+
3588315303: "IFCOPENINGELEMENT",
|
|
7101
|
+
3612865200: "IFCPIPESEGMENT",
|
|
7102
|
+
3640358203: "IFCCOOLINGTOWER",
|
|
7103
|
+
3651124850: "IFCPROJECTIONELEMENT",
|
|
7104
|
+
3694346114: "IFCOUTLET",
|
|
7105
|
+
3747195512: "IFCEVAPORATIVECOOLER",
|
|
7106
|
+
3758799889: "IFCCABLECARRIERSEGMENT",
|
|
7107
|
+
3824725483: "IFCTENDON",
|
|
7108
|
+
3825984169: "IFCTRANSFORMER",
|
|
7109
|
+
3902619387: "IFCCHILLER",
|
|
7110
|
+
4074379575: "IFCDAMPER",
|
|
7111
|
+
4086658281: "IFCSENSOR",
|
|
7112
|
+
4123344466: "IFCELEMENTASSEMBLY",
|
|
7113
|
+
4136498852: "IFCCOOLEDBEAM",
|
|
7114
|
+
4156078855: "IFCWALLELEMENTEDCASE",
|
|
7115
|
+
4175244083: "IFCINTERCEPTOR",
|
|
7116
|
+
4207607924: "IFCVALVE",
|
|
7117
|
+
4217484030: "IFCCABLESEGMENT",
|
|
7118
|
+
4237592921: "IFCWASTETERMINAL",
|
|
7119
|
+
4252922144: "IFCSTAIRFLIGHT",
|
|
7120
|
+
4278956645: "IFCFLOWFITTING",
|
|
7121
|
+
4288193352: "IFCACTUATOR",
|
|
7122
|
+
4292641817: "IFCUNITARYEQUIPMENT",
|
|
7123
|
+
3009204131: "IFCGRID"
|
|
7124
|
+
};
|
|
7125
|
+
class ra {
|
|
7126
|
+
getAll(s, t) {
|
|
7127
|
+
const e = {}, i = Object.keys(Qr).map((o) => parseInt(o, 10));
|
|
7128
|
+
for (let o = 0; o < i.length; o++) {
|
|
7129
|
+
const n = i[o], r = s.GetLineIDsWithType(t, n), a = r.size();
|
|
7130
|
+
for (let c = 0; c < a; c++)
|
|
7131
|
+
e[r.get(c)] = n;
|
|
7132
|
+
}
|
|
7133
|
+
return e;
|
|
7134
|
+
}
|
|
7135
|
+
}
|
|
7136
|
+
const Bn = {
|
|
7137
|
+
950732822: "IFCURIREFERENCE",
|
|
7138
|
+
4075327185: "IFCTIME",
|
|
7139
|
+
1209108979: "IFCTEMPERATURERATEOFCHANGEMEASURE",
|
|
7140
|
+
3457685358: "IFCSOUNDPRESSURELEVELMEASURE",
|
|
7141
|
+
4157543285: "IFCSOUNDPOWERLEVELMEASURE",
|
|
7142
|
+
2798247006: "IFCPROPERTYSETDEFINITIONSET",
|
|
7143
|
+
1790229001: "IFCPOSITIVEINTEGER",
|
|
6834
7144
|
525895558: "IFCNONNEGATIVELENGTHMEASURE",
|
|
6835
7145
|
1774176899: "IFCLINEINDEX",
|
|
6836
7146
|
1275358634: "IFCLANGUAGEID",
|
|
@@ -7965,7 +8275,7 @@ const Bn = {
|
|
|
7965
8275
|
1390159747: "FILE_NAME",
|
|
7966
8276
|
1109904537: "FILE_SCHEMA"
|
|
7967
8277
|
};
|
|
7968
|
-
class
|
|
8278
|
+
class Kt {
|
|
7969
8279
|
static async getUnits(s) {
|
|
7970
8280
|
var n;
|
|
7971
8281
|
const { IFCUNITASSIGNMENT: t } = U, e = await s.getAllPropertiesOfType(t);
|
|
@@ -7985,430 +8295,121 @@ class Gt {
|
|
|
7985
8295
|
}
|
|
7986
8296
|
static async findItemByGuid(s, t) {
|
|
7987
8297
|
var i;
|
|
7988
|
-
const e = s.getAllPropertiesIDs();
|
|
7989
|
-
for (const o of e) {
|
|
7990
|
-
const n = await s.getProperties(o);
|
|
7991
|
-
if (n && ((i = n.GlobalId) == null ? void 0 : i.value) === t)
|
|
7992
|
-
return n;
|
|
7993
|
-
}
|
|
7994
|
-
return null;
|
|
7995
|
-
}
|
|
7996
|
-
static async getRelationMap(s, t, e) {
|
|
7997
|
-
var a;
|
|
7998
|
-
const o = e ?? (async () => {
|
|
7999
|
-
}), n = {}, r = s.getAllPropertiesIDs();
|
|
8000
|
-
for (const c of r) {
|
|
8001
|
-
const h = await s.getProperties(c);
|
|
8002
|
-
if (!h)
|
|
8003
|
-
continue;
|
|
8004
|
-
const d = h.type === t, E = Object.keys(h).find(
|
|
8005
|
-
(C) => C.startsWith("Relating")
|
|
8006
|
-
), u = Object.keys(h).find(
|
|
8007
|
-
(C) => C.startsWith("Related")
|
|
8008
|
-
);
|
|
8009
|
-
if (!(d && E && u))
|
|
8010
|
-
continue;
|
|
8011
|
-
const p = await s.getProperties((a = h[E]) == null ? void 0 : a.value), A = h[u];
|
|
8012
|
-
if (!p || !A || !(A && Array.isArray(A)))
|
|
8013
|
-
continue;
|
|
8014
|
-
const R = A.map((C) => C.value);
|
|
8015
|
-
await o(p.expressID, R), n[p.expressID] = R;
|
|
8016
|
-
}
|
|
8017
|
-
return n;
|
|
8018
|
-
}
|
|
8019
|
-
static async getQsetQuantities(s, t, e) {
|
|
8020
|
-
const o = e ?? (() => {
|
|
8021
|
-
}), n = await s.getProperties(t);
|
|
8022
|
-
return !n || n.type !== U.IFCELEMENTQUANTITY ? null : (n.Quantities ?? [{}]).map((c) => (c.value && o(c.value), c.value)).filter((c) => c !== null);
|
|
8023
|
-
}
|
|
8024
|
-
static async getPsetProps(s, t, e) {
|
|
8025
|
-
const o = e ?? (() => {
|
|
8026
|
-
}), n = await s.getProperties(t);
|
|
8027
|
-
return !n || n.type !== U.IFCPROPERTYSET ? null : (n.HasProperties ?? [{}]).map((c) => (c.value && o(c.value), c.value)).filter((c) => c !== null);
|
|
8028
|
-
}
|
|
8029
|
-
static async getPsetRel(s, t) {
|
|
8030
|
-
var r;
|
|
8031
|
-
if (!await s.getProperties(t))
|
|
8032
|
-
return null;
|
|
8033
|
-
const i = await s.getAllPropertiesOfType(
|
|
8034
|
-
U.IFCRELDEFINESBYPROPERTIES
|
|
8035
|
-
);
|
|
8036
|
-
if (!i)
|
|
8037
|
-
return null;
|
|
8038
|
-
const o = Object.values(i);
|
|
8039
|
-
let n = null;
|
|
8040
|
-
for (const a of o)
|
|
8041
|
-
((r = a.RelatingPropertyDefinition) == null ? void 0 : r.value) === t && (n = a.expressID);
|
|
8042
|
-
return n;
|
|
8043
|
-
}
|
|
8044
|
-
static async getQsetRel(s, t) {
|
|
8045
|
-
return Gt.getPsetRel(s, t);
|
|
8046
|
-
}
|
|
8047
|
-
static async getEntityName(s, t) {
|
|
8048
|
-
var n;
|
|
8049
|
-
const e = await s.getProperties(t);
|
|
8050
|
-
if (!e)
|
|
8051
|
-
return { key: null, name: null };
|
|
8052
|
-
const i = Object.keys(e).find((r) => r.endsWith("Name")) ?? null, o = i ? (n = e[i]) == null ? void 0 : n.value : null;
|
|
8053
|
-
return { key: i, name: o };
|
|
8054
|
-
}
|
|
8055
|
-
static async getQuantityValue(s, t) {
|
|
8056
|
-
const e = await s.getProperties(t);
|
|
8057
|
-
if (!e)
|
|
8058
|
-
return { key: null, value: null };
|
|
8059
|
-
const i = Object.keys(e).find((n) => n.endsWith("Value")) ?? null;
|
|
8060
|
-
let o;
|
|
8061
|
-
return i === null || e[i] === void 0 || e[i] === null ? o = null : o = e[i].value, { key: i, value: o };
|
|
8062
|
-
}
|
|
8063
|
-
static isRel(s) {
|
|
8064
|
-
return Bn[s].startsWith("IFCREL");
|
|
8065
|
-
}
|
|
8066
|
-
static async attributeExists(s, t, e) {
|
|
8067
|
-
const i = await s.getProperties(t);
|
|
8068
|
-
return i ? Object.keys(i).includes(e) : !1;
|
|
8069
|
-
}
|
|
8070
|
-
static async groupEntitiesByType(s, t) {
|
|
8071
|
-
var i;
|
|
8072
|
-
const e = /* @__PURE__ */ new Map();
|
|
8073
|
-
for (const o of t) {
|
|
8074
|
-
const n = await s.getProperties(o);
|
|
8075
|
-
if (!n)
|
|
8076
|
-
continue;
|
|
8077
|
-
const r = n.type;
|
|
8078
|
-
e.get(r) || e.set(r, /* @__PURE__ */ new Set()), (i = e.get(r)) == null || i.add(o);
|
|
8079
|
-
}
|
|
8080
|
-
return e;
|
|
8081
|
-
}
|
|
8082
|
-
// static getPropertyUnits(properties: IfcProperties, expressID: number) {
|
|
8083
|
-
// const entity = properties[expressID];
|
|
8084
|
-
// if (!entity) return null;
|
|
8085
|
-
// const propertyInstance =
|
|
8086
|
-
// entity instanceof WEBIFC.IFC2X3.IfcProperty ||
|
|
8087
|
-
// entity instanceof WEBIFC.IFC4.IfcProperty ||
|
|
8088
|
-
// entity instanceof WEBIFC.IFC4X3.IfcProperty;
|
|
8089
|
-
// if (!propertyInstance) return null;
|
|
8090
|
-
// const { key: valueKey } = IfcPropertiesUtils.getQuantityValue(
|
|
8091
|
-
// properties,
|
|
8092
|
-
// expressID
|
|
8093
|
-
// );
|
|
8094
|
-
// if (!valueKey) return null;
|
|
8095
|
-
// // @ts-ignore
|
|
8096
|
-
// const measureName = entity[valueKey].constructor.name as string;
|
|
8097
|
-
// const isMeasureAttribute = measureName.endsWith("Measure");
|
|
8098
|
-
// if (!isMeasureAttribute) return null;
|
|
8099
|
-
// const measureType = measureName.slice(3, measureName.length - 7);
|
|
8100
|
-
// return propertyInstance;
|
|
8101
|
-
// }
|
|
8102
|
-
}
|
|
8103
|
-
const Qr = /* @__PURE__ */ new Map([
|
|
8104
|
-
[
|
|
8105
|
-
U.IFCRELAGGREGATES,
|
|
8106
|
-
{
|
|
8107
|
-
forRelating: "IsDecomposedBy",
|
|
8108
|
-
forRelated: "Decomposes"
|
|
8109
|
-
}
|
|
8110
|
-
],
|
|
8111
|
-
[
|
|
8112
|
-
U.IFCRELASSOCIATESMATERIAL,
|
|
8113
|
-
{
|
|
8114
|
-
forRelating: "AssociatedTo",
|
|
8115
|
-
forRelated: "HasAssociations"
|
|
8116
|
-
}
|
|
8117
|
-
],
|
|
8118
|
-
[
|
|
8119
|
-
U.IFCRELASSOCIATESCLASSIFICATION,
|
|
8120
|
-
{
|
|
8121
|
-
forRelating: "ClassificationForObjects",
|
|
8122
|
-
forRelated: "HasAssociations"
|
|
8123
|
-
}
|
|
8124
|
-
],
|
|
8125
|
-
[
|
|
8126
|
-
U.IFCRELASSIGNSTOGROUP,
|
|
8127
|
-
{
|
|
8128
|
-
forRelating: "IsGroupedBy",
|
|
8129
|
-
forRelated: "HasAssignments"
|
|
8130
|
-
}
|
|
8131
|
-
],
|
|
8132
|
-
[
|
|
8133
|
-
U.IFCRELDEFINESBYPROPERTIES,
|
|
8134
|
-
{
|
|
8135
|
-
forRelated: "IsDefinedBy",
|
|
8136
|
-
forRelating: "DefinesOcurrence"
|
|
8137
|
-
}
|
|
8138
|
-
],
|
|
8139
|
-
[
|
|
8140
|
-
U.IFCRELDEFINESBYTYPE,
|
|
8141
|
-
{
|
|
8142
|
-
forRelated: "IsTypedBy",
|
|
8143
|
-
forRelating: "Types"
|
|
8144
|
-
}
|
|
8145
|
-
],
|
|
8146
|
-
[
|
|
8147
|
-
U.IFCRELDEFINESBYTEMPLATE,
|
|
8148
|
-
{
|
|
8149
|
-
forRelated: "IsDefinedBy",
|
|
8150
|
-
forRelating: "Defines"
|
|
8151
|
-
}
|
|
8152
|
-
],
|
|
8153
|
-
[
|
|
8154
|
-
U.IFCRELCONTAINEDINSPATIALSTRUCTURE,
|
|
8155
|
-
{
|
|
8156
|
-
forRelated: "ContainedInStructure",
|
|
8157
|
-
forRelating: "ContainsElements"
|
|
8158
|
-
}
|
|
8159
|
-
]
|
|
8160
|
-
]), Ve = class Ve extends J {
|
|
8161
|
-
constructor(t) {
|
|
8162
|
-
super(t);
|
|
8163
|
-
/** {@link Disposable.onDisposed} */
|
|
8164
|
-
I(this, "onDisposed", new D());
|
|
8165
|
-
I(this, "enabled", !0);
|
|
8166
|
-
I(this, "onRelationsIndexed", new D());
|
|
8167
|
-
I(this, "_relToAttributesMap", Qr);
|
|
8168
|
-
I(this, "_inverseAttributes", [
|
|
8169
|
-
"IsDecomposedBy",
|
|
8170
|
-
"Decomposes",
|
|
8171
|
-
"AssociatedTo",
|
|
8172
|
-
"HasAssociations",
|
|
8173
|
-
"ClassificationForObjects",
|
|
8174
|
-
"IsGroupedBy",
|
|
8175
|
-
"HasAssignments",
|
|
8176
|
-
"IsDefinedBy",
|
|
8177
|
-
"DefinesOcurrence",
|
|
8178
|
-
"IsTypedBy",
|
|
8179
|
-
"Types",
|
|
8180
|
-
"Defines",
|
|
8181
|
-
"ContainedInStructure",
|
|
8182
|
-
"ContainsElements"
|
|
8183
|
-
]);
|
|
8184
|
-
I(this, "_ifcRels", [
|
|
8185
|
-
U.IFCRELAGGREGATES,
|
|
8186
|
-
U.IFCRELASSOCIATESMATERIAL,
|
|
8187
|
-
U.IFCRELASSOCIATESCLASSIFICATION,
|
|
8188
|
-
U.IFCRELASSIGNSTOGROUP,
|
|
8189
|
-
U.IFCRELDEFINESBYPROPERTIES,
|
|
8190
|
-
U.IFCRELDEFINESBYTYPE,
|
|
8191
|
-
U.IFCRELDEFINESBYTEMPLATE,
|
|
8192
|
-
U.IFCRELCONTAINEDINSPATIALSTRUCTURE
|
|
8193
|
-
]);
|
|
8194
|
-
/**
|
|
8195
|
-
* Holds the relationship mappings for each model processed by the indexer.
|
|
8196
|
-
* The structure is a map where each key is a model's UUID, and the value is another map.
|
|
8197
|
-
* This inner map's keys are entity expressIDs, and its values are maps where each key is an index
|
|
8198
|
-
* representing a specific relation type, and the value is an array of expressIDs of entities
|
|
8199
|
-
* that are related through that relation type. This structure allows for efficient querying
|
|
8200
|
-
* of entity relationships within a model.
|
|
8201
|
-
*/
|
|
8202
|
-
I(this, "relationMaps", {});
|
|
8203
|
-
I(this, "onFragmentsDisposed", (t) => {
|
|
8204
|
-
delete this.relationMaps[t.groupID];
|
|
8205
|
-
});
|
|
8206
|
-
this.components.add(Ve.uuid, this), t.get(ut).onFragmentsDisposed.add(this.onFragmentsDisposed);
|
|
8207
|
-
}
|
|
8208
|
-
/**
|
|
8209
|
-
* Adds a relation map to the model's relations map.
|
|
8210
|
-
*
|
|
8211
|
-
* @param model - The `FragmentsGroup` model to which the relation map will be added.
|
|
8212
|
-
* @param relationMap - The `RelationsMap` to be added to the model's relations map.
|
|
8213
|
-
*
|
|
8214
|
-
* @fires onRelationsIndexed - Triggers an event with the model's UUID and the added relation map.
|
|
8215
|
-
*/
|
|
8216
|
-
setRelationMap(t, e) {
|
|
8217
|
-
this.relationMaps[t.uuid] = e, this.onRelationsIndexed.trigger({
|
|
8218
|
-
modelID: t.uuid,
|
|
8219
|
-
relationsMap: e
|
|
8220
|
-
});
|
|
8298
|
+
const e = s.getAllPropertiesIDs();
|
|
8299
|
+
for (const o of e) {
|
|
8300
|
+
const n = await s.getProperties(o);
|
|
8301
|
+
if (n && ((i = n.GlobalId) == null ? void 0 : i.value) === t)
|
|
8302
|
+
return n;
|
|
8303
|
+
}
|
|
8304
|
+
return null;
|
|
8221
8305
|
}
|
|
8222
|
-
|
|
8223
|
-
|
|
8224
|
-
|
|
8225
|
-
|
|
8226
|
-
|
|
8227
|
-
|
|
8228
|
-
|
|
8229
|
-
|
|
8230
|
-
|
|
8231
|
-
|
|
8232
|
-
|
|
8233
|
-
|
|
8234
|
-
* @returns A promise that resolves to the relations map for the processed model. This map is a detailed
|
|
8235
|
-
* representation of the relations indexed by entity expressIDs and relation types.
|
|
8236
|
-
* @throws An error if the model does not have properties loaded.
|
|
8237
|
-
*/
|
|
8238
|
-
async process(t) {
|
|
8239
|
-
if (!t.hasProperties)
|
|
8240
|
-
throw new Error("FragmentsGroup properties not found");
|
|
8241
|
-
let e = this.relationMaps[t.uuid];
|
|
8242
|
-
if (e)
|
|
8243
|
-
return e;
|
|
8244
|
-
e = /* @__PURE__ */ new Map();
|
|
8245
|
-
for (const i of this._ifcRels)
|
|
8246
|
-
await Gt.getRelationMap(
|
|
8247
|
-
t,
|
|
8248
|
-
i,
|
|
8249
|
-
async (o, n) => {
|
|
8250
|
-
const r = this._relToAttributesMap.get(i);
|
|
8251
|
-
if (!r)
|
|
8252
|
-
return;
|
|
8253
|
-
const { forRelated: a, forRelating: c } = r, h = e.get(o) ?? /* @__PURE__ */ new Map(), d = this._inverseAttributes.indexOf(c);
|
|
8254
|
-
h.set(d, n), e.set(o, h);
|
|
8255
|
-
for (const E of n) {
|
|
8256
|
-
const u = e.get(E) ?? /* @__PURE__ */ new Map(), p = this._inverseAttributes.indexOf(a), A = u.get(p) ?? [];
|
|
8257
|
-
A.push(o), u.set(p, A), e.set(E, u);
|
|
8258
|
-
}
|
|
8259
|
-
}
|
|
8306
|
+
static async getRelationMap(s, t, e) {
|
|
8307
|
+
var a;
|
|
8308
|
+
const o = e ?? (async () => {
|
|
8309
|
+
}), n = {}, r = s.getAllPropertiesIDs();
|
|
8310
|
+
for (const c of r) {
|
|
8311
|
+
const h = await s.getProperties(c);
|
|
8312
|
+
if (!h)
|
|
8313
|
+
continue;
|
|
8314
|
+
const d = h.type === t, E = Object.keys(h).find(
|
|
8315
|
+
(C) => C.startsWith("Relating")
|
|
8316
|
+
), u = Object.keys(h).find(
|
|
8317
|
+
(C) => C.startsWith("Related")
|
|
8260
8318
|
);
|
|
8261
|
-
|
|
8262
|
-
}
|
|
8263
|
-
/**
|
|
8264
|
-
* Processes a given model from a WebIfc API to index its IFC entities relations.
|
|
8265
|
-
*
|
|
8266
|
-
* @param ifcApi - The WebIfc API instance from which to retrieve the model's properties.
|
|
8267
|
-
* @param modelID - The unique identifier of the model within the WebIfc API.
|
|
8268
|
-
* @returns A promise that resolves to the relations map for the processed model.
|
|
8269
|
-
* This map is a detailed representation of the relations indexed by entity expressIDs and relation types.
|
|
8270
|
-
*/
|
|
8271
|
-
async processFromWebIfc(t, e) {
|
|
8272
|
-
const i = /* @__PURE__ */ new Map();
|
|
8273
|
-
for (const o of this._ifcRels) {
|
|
8274
|
-
const n = this._relToAttributesMap.get(o);
|
|
8275
|
-
if (!n)
|
|
8319
|
+
if (!(d && E && u))
|
|
8276
8320
|
continue;
|
|
8277
|
-
const
|
|
8278
|
-
|
|
8279
|
-
|
|
8280
|
-
|
|
8281
|
-
|
|
8282
|
-
), E = Object.keys(d).find(
|
|
8283
|
-
(T) => T.startsWith("Relating")
|
|
8284
|
-
), u = Object.keys(d).find(
|
|
8285
|
-
(T) => T.startsWith("Related")
|
|
8286
|
-
);
|
|
8287
|
-
if (!(E && u))
|
|
8288
|
-
continue;
|
|
8289
|
-
const p = d[E].value, A = d[u].map((T) => T.value), R = i.get(p) ?? /* @__PURE__ */ new Map(), C = this._inverseAttributes.indexOf(a);
|
|
8290
|
-
R.set(C, A), i.set(p, R);
|
|
8291
|
-
for (const T of A) {
|
|
8292
|
-
const F = i.get(T) ?? /* @__PURE__ */ new Map(), f = this._inverseAttributes.indexOf(r), m = F.get(f) ?? [];
|
|
8293
|
-
m.push(p), F.set(f, m), i.set(T, F);
|
|
8294
|
-
}
|
|
8295
|
-
}
|
|
8321
|
+
const p = await s.getProperties((a = h[E]) == null ? void 0 : a.value), A = h[u];
|
|
8322
|
+
if (!p || !A || !(A && Array.isArray(A)))
|
|
8323
|
+
continue;
|
|
8324
|
+
const m = A.map((C) => C.value);
|
|
8325
|
+
await o(p.expressID, m), n[p.expressID] = m;
|
|
8296
8326
|
}
|
|
8297
|
-
return
|
|
8298
|
-
modelID: e.toString(),
|
|
8299
|
-
relationsMap: i
|
|
8300
|
-
}), i;
|
|
8327
|
+
return n;
|
|
8301
8328
|
}
|
|
8302
|
-
|
|
8303
|
-
|
|
8304
|
-
|
|
8305
|
-
|
|
8306
|
-
|
|
8307
|
-
|
|
8308
|
-
|
|
8309
|
-
|
|
8310
|
-
|
|
8311
|
-
|
|
8312
|
-
|
|
8313
|
-
|
|
8314
|
-
|
|
8315
|
-
if (!o)
|
|
8329
|
+
static async getQsetQuantities(s, t, e) {
|
|
8330
|
+
const o = e ?? (() => {
|
|
8331
|
+
}), n = await s.getProperties(t);
|
|
8332
|
+
return !n || n.type !== U.IFCELEMENTQUANTITY ? null : (n.Quantities ?? [{}]).map((c) => (c.value && o(c.value), c.value)).filter((c) => c !== null);
|
|
8333
|
+
}
|
|
8334
|
+
static async getPsetProps(s, t, e) {
|
|
8335
|
+
const o = e ?? (() => {
|
|
8336
|
+
}), n = await s.getProperties(t);
|
|
8337
|
+
return !n || n.type !== U.IFCPROPERTYSET ? null : (n.HasProperties ?? [{}]).map((c) => (c.value && o(c.value), c.value)).filter((c) => c !== null);
|
|
8338
|
+
}
|
|
8339
|
+
static async getPsetRel(s, t) {
|
|
8340
|
+
var r;
|
|
8341
|
+
if (!await s.getProperties(t))
|
|
8316
8342
|
return null;
|
|
8317
|
-
const
|
|
8318
|
-
|
|
8343
|
+
const i = await s.getAllPropertiesOfType(
|
|
8344
|
+
U.IFCRELDEFINESBYPROPERTIES
|
|
8345
|
+
);
|
|
8346
|
+
if (!i)
|
|
8319
8347
|
return null;
|
|
8320
|
-
const
|
|
8321
|
-
|
|
8348
|
+
const o = Object.values(i);
|
|
8349
|
+
let n = null;
|
|
8350
|
+
for (const a of o)
|
|
8351
|
+
((r = a.RelatingPropertyDefinition) == null ? void 0 : r.value) === t && (n = a.expressID);
|
|
8352
|
+
return n;
|
|
8322
8353
|
}
|
|
8323
|
-
|
|
8324
|
-
|
|
8325
|
-
* This method iterates through the relations in the given map, organizing them into a structured object where each key is an expressID of an entity,
|
|
8326
|
-
* and its value is another object mapping relation indices to arrays of related entity expressIDs.
|
|
8327
|
-
* The resulting object is then serialized into a JSON string.
|
|
8328
|
-
*
|
|
8329
|
-
* @param relationMap - The map of relations to be serialized. The map keys are expressIDs of entities, and the values are maps where each key is a relation type ID and its value is an array of expressIDs of entities related through that relation type.
|
|
8330
|
-
* @returns A JSON string representing the serialized relations of the given relation map.
|
|
8331
|
-
*/
|
|
8332
|
-
serializeRelations(t) {
|
|
8333
|
-
const e = {};
|
|
8334
|
-
for (const [i, o] of t.entries()) {
|
|
8335
|
-
e[i] || (e[i] = {});
|
|
8336
|
-
for (const [n, r] of o.entries())
|
|
8337
|
-
e[i][n] = r;
|
|
8338
|
-
}
|
|
8339
|
-
return JSON.stringify(e);
|
|
8354
|
+
static async getQsetRel(s, t) {
|
|
8355
|
+
return Kt.getPsetRel(s, t);
|
|
8340
8356
|
}
|
|
8341
|
-
|
|
8342
|
-
|
|
8343
|
-
|
|
8344
|
-
|
|
8345
|
-
|
|
8346
|
-
|
|
8347
|
-
|
|
8348
|
-
* @param model The `FragmentsGroup` model whose relations are to be serialized.
|
|
8349
|
-
* @returns A JSON string representing the serialized relations of the specified model.
|
|
8350
|
-
* If the model has no indexed relations, `null` is returned.
|
|
8351
|
-
*/
|
|
8352
|
-
serializeModelRelations(t) {
|
|
8353
|
-
const e = this.relationMaps[t.uuid];
|
|
8354
|
-
return e ? this.serializeRelations(e) : null;
|
|
8357
|
+
static async getEntityName(s, t) {
|
|
8358
|
+
var n;
|
|
8359
|
+
const e = await s.getProperties(t);
|
|
8360
|
+
if (!e)
|
|
8361
|
+
return { key: null, name: null };
|
|
8362
|
+
const i = Object.keys(e).find((r) => r.endsWith("Name")) ?? null, o = i ? (n = e[i]) == null ? void 0 : n.value : null;
|
|
8363
|
+
return { key: i, name: o };
|
|
8355
8364
|
}
|
|
8356
|
-
|
|
8357
|
-
|
|
8358
|
-
|
|
8359
|
-
|
|
8360
|
-
|
|
8361
|
-
|
|
8362
|
-
|
|
8363
|
-
* @returns A JSON string representing the serialized relations of all models processed by the indexer.
|
|
8364
|
-
* If no relations have been indexed, an empty object is returned as a JSON string.
|
|
8365
|
-
*/
|
|
8366
|
-
serializeAllRelations() {
|
|
8367
|
-
const t = {};
|
|
8368
|
-
for (const e in this.relationMaps) {
|
|
8369
|
-
const i = this.relationMaps[e], o = {};
|
|
8370
|
-
for (const [n, r] of i.entries()) {
|
|
8371
|
-
o[n] || (o[n] = {});
|
|
8372
|
-
for (const [a, c] of r.entries())
|
|
8373
|
-
o[n][a] = c;
|
|
8374
|
-
}
|
|
8375
|
-
t[e] = o;
|
|
8376
|
-
}
|
|
8377
|
-
return JSON.stringify(t);
|
|
8365
|
+
static async getQuantityValue(s, t) {
|
|
8366
|
+
const e = await s.getProperties(t);
|
|
8367
|
+
if (!e)
|
|
8368
|
+
return { key: null, value: null };
|
|
8369
|
+
const i = Object.keys(e).find((n) => n.endsWith("Value")) ?? null;
|
|
8370
|
+
let o;
|
|
8371
|
+
return i === null || e[i] === void 0 || e[i] === null ? o = null : o = e[i].value, { key: i, value: o };
|
|
8378
8372
|
}
|
|
8379
|
-
|
|
8380
|
-
|
|
8381
|
-
* This method parses the JSON string to reconstruct the relations map that indexes
|
|
8382
|
-
* entity relations by their express IDs. The outer map keys are the express IDs of entities,
|
|
8383
|
-
* and the values are maps where each key is a relation type ID and its value is an array
|
|
8384
|
-
* of express IDs of entities related through that relation type.
|
|
8385
|
-
*
|
|
8386
|
-
* @param json The JSON string to be parsed into the relations map.
|
|
8387
|
-
* @returns A `Map` where the key is the express ID of an entity as a number, and the value
|
|
8388
|
-
* is another `Map`. This inner map's key is the relation type ID as a number, and its value
|
|
8389
|
-
* is an array of express IDs (as numbers) of entities related through that relation type.
|
|
8390
|
-
*/
|
|
8391
|
-
getRelationsMapFromJSON(t) {
|
|
8392
|
-
const e = JSON.parse(t), i = /* @__PURE__ */ new Map();
|
|
8393
|
-
for (const o in e) {
|
|
8394
|
-
const n = e[o], r = /* @__PURE__ */ new Map();
|
|
8395
|
-
for (const a in n)
|
|
8396
|
-
r.set(Number(a), n[a]);
|
|
8397
|
-
i.set(Number(o), r);
|
|
8398
|
-
}
|
|
8399
|
-
return i;
|
|
8373
|
+
static isRel(s) {
|
|
8374
|
+
return Bn[s].startsWith("IFCREL");
|
|
8400
8375
|
}
|
|
8401
|
-
|
|
8402
|
-
|
|
8403
|
-
|
|
8404
|
-
* references that could prevent garbage collection.
|
|
8405
|
-
*/
|
|
8406
|
-
dispose() {
|
|
8407
|
-
this.relationMaps = {}, this.components.get(ut).onFragmentsDisposed.remove(this.onFragmentsDisposed), this.onDisposed.trigger(Ve.uuid), this.onDisposed.reset();
|
|
8376
|
+
static async attributeExists(s, t, e) {
|
|
8377
|
+
const i = await s.getProperties(t);
|
|
8378
|
+
return i ? Object.keys(i).includes(e) : !1;
|
|
8408
8379
|
}
|
|
8409
|
-
|
|
8410
|
-
|
|
8411
|
-
|
|
8380
|
+
static async groupEntitiesByType(s, t) {
|
|
8381
|
+
var i;
|
|
8382
|
+
const e = /* @__PURE__ */ new Map();
|
|
8383
|
+
for (const o of t) {
|
|
8384
|
+
const n = await s.getProperties(o);
|
|
8385
|
+
if (!n)
|
|
8386
|
+
continue;
|
|
8387
|
+
const r = n.type;
|
|
8388
|
+
e.get(r) || e.set(r, /* @__PURE__ */ new Set()), (i = e.get(r)) == null || i.add(o);
|
|
8389
|
+
}
|
|
8390
|
+
return e;
|
|
8391
|
+
}
|
|
8392
|
+
// static getPropertyUnits(properties: IfcProperties, expressID: number) {
|
|
8393
|
+
// const entity = properties[expressID];
|
|
8394
|
+
// if (!entity) return null;
|
|
8395
|
+
// const propertyInstance =
|
|
8396
|
+
// entity instanceof WEBIFC.IFC2X3.IfcProperty ||
|
|
8397
|
+
// entity instanceof WEBIFC.IFC4.IfcProperty ||
|
|
8398
|
+
// entity instanceof WEBIFC.IFC4X3.IfcProperty;
|
|
8399
|
+
// if (!propertyInstance) return null;
|
|
8400
|
+
// const { key: valueKey } = IfcPropertiesUtils.getQuantityValue(
|
|
8401
|
+
// properties,
|
|
8402
|
+
// expressID
|
|
8403
|
+
// );
|
|
8404
|
+
// if (!valueKey) return null;
|
|
8405
|
+
// // @ts-ignore
|
|
8406
|
+
// const measureName = entity[valueKey].constructor.name as string;
|
|
8407
|
+
// const isMeasureAttribute = measureName.endsWith("Measure");
|
|
8408
|
+
// if (!isMeasureAttribute) return null;
|
|
8409
|
+
// const measureType = measureName.slice(3, measureName.length - 7);
|
|
8410
|
+
// return propertyInstance;
|
|
8411
|
+
// }
|
|
8412
|
+
}
|
|
8412
8413
|
class jr {
|
|
8413
8414
|
constructor() {
|
|
8414
8415
|
I(this, "factor", 1);
|
|
@@ -8525,8 +8526,8 @@ class Yn {
|
|
|
8525
8526
|
continue;
|
|
8526
8527
|
const E = d.RelatingObject.value, u = d.RelatedObjects;
|
|
8527
8528
|
for (const p of u) {
|
|
8528
|
-
const A = p.value,
|
|
8529
|
-
|
|
8529
|
+
const A = p.value, m = this.itemsByFloor[E];
|
|
8530
|
+
m !== void 0 && (this.itemsByFloor[A] = m);
|
|
8530
8531
|
}
|
|
8531
8532
|
}
|
|
8532
8533
|
} catch {
|
|
@@ -8746,32 +8747,32 @@ const Ge = class Ge extends J {
|
|
|
8746
8747
|
for (let n = 0; n < i; n++) {
|
|
8747
8748
|
const r = t.geometries.get(n), { x: a, y: c, z: h, w: d } = r.color, E = d !== 1, { geometryExpressID: u } = r, p = `${u}-${E}`;
|
|
8748
8749
|
if (!this._visitedFragments.has(p)) {
|
|
8749
|
-
const
|
|
8750
|
+
const T = this.getGeometry(this.webIfc, u), O = E ? this._materialT : this._material, S = new Vt.Fragment(T, O, 1);
|
|
8750
8751
|
e.add(S.mesh), e.items.push(S);
|
|
8751
8752
|
const _ = this._visitedFragments.size;
|
|
8752
8753
|
this._visitedFragments.set(p, { index: _, fragment: S });
|
|
8753
8754
|
}
|
|
8754
|
-
const A = new g.Color().setRGB(a, c, h, "srgb"),
|
|
8755
|
-
|
|
8755
|
+
const A = new g.Color().setRGB(a, c, h, "srgb"), m = new g.Matrix4();
|
|
8756
|
+
m.fromArray(r.flatTransformation);
|
|
8756
8757
|
const C = this._visitedFragments.get(p);
|
|
8757
8758
|
if (C === void 0)
|
|
8758
8759
|
throw new Error("Error getting geometry data for streaming!");
|
|
8759
|
-
const
|
|
8760
|
-
if (!
|
|
8760
|
+
const R = e.data.get(o);
|
|
8761
|
+
if (!R)
|
|
8761
8762
|
throw new Error("Data not found!");
|
|
8762
|
-
|
|
8763
|
+
R[0].push(C.index);
|
|
8763
8764
|
const { fragment: F } = C;
|
|
8764
8765
|
this._fragmentInstances.has(F.id) || this._fragmentInstances.set(F.id, /* @__PURE__ */ new Map());
|
|
8765
8766
|
const f = this._fragmentInstances.get(F.id);
|
|
8766
8767
|
if (!f)
|
|
8767
8768
|
throw new Error("Instances not found!");
|
|
8768
8769
|
if (f.has(o)) {
|
|
8769
|
-
const
|
|
8770
|
-
if (!
|
|
8770
|
+
const T = f.get(o);
|
|
8771
|
+
if (!T)
|
|
8771
8772
|
throw new Error("Instance not found!");
|
|
8772
|
-
|
|
8773
|
+
T.transforms.push(m), T.colors && T.colors.push(A);
|
|
8773
8774
|
} else
|
|
8774
|
-
f.set(o, { id: o, transforms: [
|
|
8775
|
+
f.set(o, { id: o, transforms: [m], colors: [A] });
|
|
8775
8776
|
}
|
|
8776
8777
|
}
|
|
8777
8778
|
getGeometry(t, e) {
|
|
@@ -8891,7 +8892,7 @@ const Bt = class Bt extends J {
|
|
|
8891
8892
|
const o = await t.getProperties(i);
|
|
8892
8893
|
if ((o == null ? void 0 : o.type) !== U.IFCPROPERTYSET)
|
|
8893
8894
|
continue;
|
|
8894
|
-
const n = await
|
|
8895
|
+
const n = await Kt.getPsetRel(t, i);
|
|
8895
8896
|
if (n && (await t.setProperties(n, null), this.registerChange(t, n)), o) {
|
|
8896
8897
|
for (const r of o.HasProperties)
|
|
8897
8898
|
await t.setProperties(r.value, null);
|
|
@@ -8922,7 +8923,7 @@ const Bt = class Bt extends J {
|
|
|
8922
8923
|
!o || !n || o.type === U.IFCPROPERTYSET && n && (o.HasProperties = o.HasProperties.filter((r) => r.value !== i), await t.setProperties(i, null), this.registerChange(t, e, i));
|
|
8923
8924
|
}
|
|
8924
8925
|
async addElementToPset(t, e, ...i) {
|
|
8925
|
-
const o = await
|
|
8926
|
+
const o = await Kt.getPsetRel(t, e);
|
|
8926
8927
|
if (!o)
|
|
8927
8928
|
return;
|
|
8928
8929
|
const n = await t.getProperties(o);
|
|
@@ -9115,11 +9116,11 @@ const Ls = class Ls extends J {
|
|
|
9115
9116
|
}
|
|
9116
9117
|
}
|
|
9117
9118
|
async byIfcRel(t, e, i) {
|
|
9118
|
-
|
|
9119
|
+
Kt.isRel(e) && await Kt.getRelationMap(
|
|
9119
9120
|
t,
|
|
9120
9121
|
e,
|
|
9121
9122
|
async (o, n) => {
|
|
9122
|
-
const { name: r } = await
|
|
9123
|
+
const { name: r } = await Kt.getEntityName(
|
|
9123
9124
|
t,
|
|
9124
9125
|
o
|
|
9125
9126
|
);
|
|
@@ -9283,9 +9284,9 @@ class zn extends yi {
|
|
|
9283
9284
|
class $r extends J {
|
|
9284
9285
|
constructor() {
|
|
9285
9286
|
super(...arguments);
|
|
9286
|
-
I(this, "onPropertiesStreamed", new
|
|
9287
|
-
I(this, "onProgress", new
|
|
9288
|
-
I(this, "onIndicesStreamed", new
|
|
9287
|
+
I(this, "onPropertiesStreamed", new $t());
|
|
9288
|
+
I(this, "onProgress", new $t());
|
|
9289
|
+
I(this, "onIndicesStreamed", new $t());
|
|
9289
9290
|
/** {@link Disposable.onDisposed} */
|
|
9290
9291
|
I(this, "onDisposed", new D());
|
|
9291
9292
|
I(this, "enabled", !0);
|
|
@@ -9334,11 +9335,11 @@ class $r extends J {
|
|
|
9334
9335
|
continue;
|
|
9335
9336
|
const d = n.has(h), E = this.webIfc.GetLineIDsWithType(0, h), u = E.size();
|
|
9336
9337
|
let p = 0;
|
|
9337
|
-
for (let
|
|
9338
|
+
for (let m = 0; m < u - t; m += t) {
|
|
9338
9339
|
const C = {};
|
|
9339
|
-
for (let
|
|
9340
|
+
for (let R = 0; R < t; R++) {
|
|
9340
9341
|
p++;
|
|
9341
|
-
const F = E.get(
|
|
9342
|
+
const F = E.get(m + R);
|
|
9342
9343
|
try {
|
|
9343
9344
|
const f = this.webIfc.GetLine(0, F, d);
|
|
9344
9345
|
i.includes(h) && this.getIndices(f, F, o), C[f.expressID] = f;
|
|
@@ -9349,17 +9350,17 @@ class $r extends J {
|
|
|
9349
9350
|
await this.onPropertiesStreamed.trigger({ type: h, data: C });
|
|
9350
9351
|
}
|
|
9351
9352
|
if (p !== u) {
|
|
9352
|
-
const
|
|
9353
|
+
const m = {};
|
|
9353
9354
|
for (let C = p; C < u; C++) {
|
|
9354
|
-
const
|
|
9355
|
+
const R = E.get(C);
|
|
9355
9356
|
try {
|
|
9356
|
-
const F = this.webIfc.GetLine(0,
|
|
9357
|
-
i.includes(h) && this.getIndices(F,
|
|
9357
|
+
const F = this.webIfc.GetLine(0, R, d);
|
|
9358
|
+
i.includes(h) && this.getIndices(F, R, o), m[F.expressID] = F;
|
|
9358
9359
|
} catch {
|
|
9359
|
-
console.log(`Could not get property: ${
|
|
9360
|
+
console.log(`Could not get property: ${R}`);
|
|
9360
9361
|
}
|
|
9361
9362
|
}
|
|
9362
|
-
await this.onPropertiesStreamed.trigger({ type: h, data:
|
|
9363
|
+
await this.onPropertiesStreamed.trigger({ type: h, data: m });
|
|
9363
9364
|
}
|
|
9364
9365
|
const A = a / e.size;
|
|
9365
9366
|
A > r && (r += 0.01, r = Math.max(r, A), await this.onProgress.trigger(Math.round(r * 100) / 100));
|
|
@@ -9451,35 +9452,35 @@ const Ms = class Ms extends J {
|
|
|
9451
9452
|
maxExpressID: this.webIfc.GetMaxExpressID(0)
|
|
9452
9453
|
};
|
|
9453
9454
|
let r = 0, a = 0;
|
|
9454
|
-
for (const
|
|
9455
|
-
if (!this.webIfc.IsIfcElement(
|
|
9455
|
+
for (const m of i) {
|
|
9456
|
+
if (!this.webIfc.IsIfcElement(m) && m !== U.IFCSPACE || this.settings.excludedCategories.has(m))
|
|
9456
9457
|
continue;
|
|
9457
|
-
const C = this.webIfc.GetLineIDsWithType(0,
|
|
9458
|
-
for (let F = 0; F <
|
|
9458
|
+
const C = this.webIfc.GetLineIDsWithType(0, m), R = C.size();
|
|
9459
|
+
for (let F = 0; F < R; F++) {
|
|
9459
9460
|
r > t && (r = 0, a++, o.push([]));
|
|
9460
9461
|
const f = C.get(F);
|
|
9461
9462
|
o[a].push(f);
|
|
9462
|
-
const
|
|
9463
|
-
n.data.set(f, [[], [
|
|
9463
|
+
const T = this._spatialTree.itemsByFloor[f] || 0;
|
|
9464
|
+
n.data.set(f, [[], [T, m]]), r++;
|
|
9464
9465
|
}
|
|
9465
9466
|
}
|
|
9466
9467
|
this._spatialTree.cleanUp();
|
|
9467
9468
|
let c = 0.01, h = 0;
|
|
9468
|
-
for (const
|
|
9469
|
-
h++, this.webIfc.StreamMeshes(0,
|
|
9470
|
-
this.getMesh(this.webIfc,
|
|
9469
|
+
for (const m of o) {
|
|
9470
|
+
h++, this.webIfc.StreamMeshes(0, m, (R) => {
|
|
9471
|
+
this.getMesh(this.webIfc, R, n);
|
|
9471
9472
|
}), this._geometryCount > t && await this.streamGeometries(), this._assets.length > e && await this.streamAssets();
|
|
9472
9473
|
const C = h / o.length;
|
|
9473
9474
|
C > c && (c += 0.01, c = Math.max(c, C), this.onProgress.trigger(Math.round(c * 100) / 100));
|
|
9474
9475
|
}
|
|
9475
9476
|
this._geometryCount && await this.streamGeometries(), this._assets.length && await this.streamAssets();
|
|
9476
9477
|
const { opaque: d, transparent: E } = n.geometryIDs;
|
|
9477
|
-
for (const [
|
|
9478
|
-
n.keyFragments.set(C,
|
|
9478
|
+
for (const [m, { index: C, uuid: R }] of this._visitedGeometries)
|
|
9479
|
+
n.keyFragments.set(C, R), (m > 1 ? d : E).set(m, C);
|
|
9479
9480
|
const u = n.data.keys();
|
|
9480
|
-
for (const
|
|
9481
|
-
const [C] = n.data.get(
|
|
9482
|
-
C.length || n.data.delete(
|
|
9481
|
+
for (const m of u) {
|
|
9482
|
+
const [C] = n.data.get(m);
|
|
9483
|
+
C.length || n.data.delete(m);
|
|
9483
9484
|
}
|
|
9484
9485
|
const p = this.webIfc.GetCoordinationMatrix(0);
|
|
9485
9486
|
n.coordinationMatrix.fromArray(p), n.civilData = this._civil.read(this.webIfc);
|
|
@@ -9495,8 +9496,8 @@ const Ms = class Ms extends J {
|
|
|
9495
9496
|
const c = e.geometries.get(a), h = c.geometryExpressID, d = c.color.w === 1 ? 1 : -1, E = h * d;
|
|
9496
9497
|
if (!this._visitedGeometries.has(E)) {
|
|
9497
9498
|
this._visitedGeometries.has(h) || this.getGeometry(t, h);
|
|
9498
|
-
const
|
|
9499
|
-
this._visitedGeometries.set(E, { uuid: O, index:
|
|
9499
|
+
const T = this._visitedGeometries.size, O = g.MathUtils.generateUUID();
|
|
9500
|
+
this._visitedGeometries.set(E, { uuid: O, index: T });
|
|
9500
9501
|
}
|
|
9501
9502
|
const u = this._visitedGeometries.get(E);
|
|
9502
9503
|
if (u === void 0)
|
|
@@ -9505,7 +9506,7 @@ const Ms = class Ms extends J {
|
|
|
9505
9506
|
if (!p)
|
|
9506
9507
|
throw new Error("Data not found!");
|
|
9507
9508
|
p[0].push(u.index);
|
|
9508
|
-
const { x: A, y:
|
|
9509
|
+
const { x: A, y: m, z: C, w: R } = c.color, F = [A, m, C, R], f = c.flatTransformation;
|
|
9509
9510
|
r.geometries.push({ color: F, geometryID: h, transformation: f });
|
|
9510
9511
|
}
|
|
9511
9512
|
this._assets.push(r);
|
|
@@ -9523,8 +9524,8 @@ const Ms = class Ms extends J {
|
|
|
9523
9524
|
const c = mr(r), h = new Float32Array(c.transformation.elements), d = [c.center.x, c.center.y, c.center.z];
|
|
9524
9525
|
let E = !1;
|
|
9525
9526
|
for (let u = 0; u < r.length - 2; u += 3) {
|
|
9526
|
-
const p = r[u], A = r[u + 1],
|
|
9527
|
-
if (Rr(d, [p, A,
|
|
9527
|
+
const p = r[u], A = r[u + 1], m = r[u + 2], C = a[u], R = a[u + 1], F = a[u + 2];
|
|
9528
|
+
if (Rr(d, [p, A, m], [C, R, F])) {
|
|
9528
9529
|
E = !0;
|
|
9529
9530
|
break;
|
|
9530
9531
|
}
|
|
@@ -9552,9 +9553,9 @@ let Nn = Ms;
|
|
|
9552
9553
|
class Kr extends J {
|
|
9553
9554
|
constructor() {
|
|
9554
9555
|
super(...arguments);
|
|
9555
|
-
I(this, "onPropertiesStreamed", new
|
|
9556
|
-
I(this, "onProgress", new
|
|
9557
|
-
I(this, "onIndicesStreamed", new
|
|
9556
|
+
I(this, "onPropertiesStreamed", new $t());
|
|
9557
|
+
I(this, "onProgress", new $t());
|
|
9558
|
+
I(this, "onIndicesStreamed", new $t());
|
|
9558
9559
|
/** {@link Disposable.onDisposed} */
|
|
9559
9560
|
I(this, "onDisposed", new D());
|
|
9560
9561
|
I(this, "enabled", !0);
|
|
@@ -9597,26 +9598,26 @@ class Kr extends J {
|
|
|
9597
9598
|
const h = i.has(c), d = this.webIfc.GetLineIDsWithType(0, c), E = d.size();
|
|
9598
9599
|
let u = 0;
|
|
9599
9600
|
for (let A = 0; A < E - t; A += t) {
|
|
9600
|
-
const
|
|
9601
|
+
const m = {};
|
|
9601
9602
|
for (let C = 0; C < t; C++) {
|
|
9602
9603
|
u++;
|
|
9603
|
-
const
|
|
9604
|
+
const R = d.get(A + C);
|
|
9604
9605
|
try {
|
|
9605
|
-
const F = this.webIfc.GetLine(0,
|
|
9606
|
-
|
|
9606
|
+
const F = this.webIfc.GetLine(0, R, h);
|
|
9607
|
+
m[F.expressID] = F;
|
|
9607
9608
|
} catch {
|
|
9608
|
-
console.log(`Could not get property: ${
|
|
9609
|
+
console.log(`Could not get property: ${R}`);
|
|
9609
9610
|
}
|
|
9610
9611
|
}
|
|
9611
|
-
await this.onPropertiesStreamed.trigger({ type: c, data:
|
|
9612
|
+
await this.onPropertiesStreamed.trigger({ type: c, data: m });
|
|
9612
9613
|
}
|
|
9613
9614
|
if (u !== E) {
|
|
9614
9615
|
const A = {};
|
|
9615
|
-
for (let
|
|
9616
|
-
const C = d.get(
|
|
9616
|
+
for (let m = u; m < E; m++) {
|
|
9617
|
+
const C = d.get(m);
|
|
9617
9618
|
try {
|
|
9618
|
-
const
|
|
9619
|
-
A[
|
|
9619
|
+
const R = this.webIfc.GetLine(0, C, h);
|
|
9620
|
+
A[R.expressID] = R;
|
|
9620
9621
|
} catch {
|
|
9621
9622
|
console.log(`Could not get property: ${C}`);
|
|
9622
9623
|
}
|
|
@@ -9652,60 +9653,60 @@ const Ds = class Ds extends J {
|
|
|
9652
9653
|
const { plane: u, edges: p } = this.getFaceData(E, i, t);
|
|
9653
9654
|
if (u.equals(r)) {
|
|
9654
9655
|
a.push({ index: E, edges: p });
|
|
9655
|
-
for (const { id: A, points:
|
|
9656
|
-
o.set(A, { points:
|
|
9656
|
+
for (const { id: A, points: m, distance: C } of p)
|
|
9657
|
+
o.set(A, { points: m, distance: C });
|
|
9657
9658
|
}
|
|
9658
9659
|
}
|
|
9659
9660
|
let c = 0;
|
|
9660
9661
|
const h = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map();
|
|
9661
9662
|
for (const { index: E, edges: u } of a) {
|
|
9662
9663
|
const p = /* @__PURE__ */ new Map();
|
|
9663
|
-
for (const { id:
|
|
9664
|
-
if (h.has(
|
|
9665
|
-
const O = h.get(
|
|
9666
|
-
p.set(
|
|
9664
|
+
for (const { id: T } of u)
|
|
9665
|
+
if (h.has(T)) {
|
|
9666
|
+
const O = h.get(T);
|
|
9667
|
+
p.set(T, O);
|
|
9667
9668
|
}
|
|
9668
|
-
const A = u.map((
|
|
9669
|
+
const A = u.map((T) => T.id);
|
|
9669
9670
|
if (!p.size) {
|
|
9670
|
-
const
|
|
9671
|
+
const T = c++;
|
|
9671
9672
|
for (const { id: O } of u)
|
|
9672
|
-
h.set(O,
|
|
9673
|
-
d.set(
|
|
9673
|
+
h.set(O, T);
|
|
9674
|
+
d.set(T, {
|
|
9674
9675
|
edges: new Set(A),
|
|
9675
9676
|
indices: /* @__PURE__ */ new Set([E])
|
|
9676
9677
|
});
|
|
9677
9678
|
continue;
|
|
9678
9679
|
}
|
|
9679
|
-
let
|
|
9680
|
-
const C = /* @__PURE__ */ new Set(),
|
|
9681
|
-
for (const [
|
|
9682
|
-
|
|
9680
|
+
let m = null;
|
|
9681
|
+
const C = /* @__PURE__ */ new Set(), R = new Set(A);
|
|
9682
|
+
for (const [T, O] of p) {
|
|
9683
|
+
m === null ? m = O : O !== m && C.add(O), h.delete(T);
|
|
9683
9684
|
const { edges: S } = d.get(O);
|
|
9684
|
-
S.delete(
|
|
9685
|
+
S.delete(T), R.delete(T);
|
|
9685
9686
|
}
|
|
9686
|
-
if (
|
|
9687
|
+
if (m === null)
|
|
9687
9688
|
throw new Error("Error computing face!");
|
|
9688
|
-
const F = d.get(
|
|
9689
|
+
const F = d.get(m), { indices: f } = F;
|
|
9689
9690
|
f.add(E);
|
|
9690
|
-
for (const
|
|
9691
|
-
h.set(
|
|
9691
|
+
for (const T of R) {
|
|
9692
|
+
h.set(T, m);
|
|
9692
9693
|
const { edges: O } = F;
|
|
9693
|
-
O.add(
|
|
9694
|
+
O.add(T);
|
|
9694
9695
|
}
|
|
9695
|
-
for (const
|
|
9696
|
-
const O = d.get(
|
|
9696
|
+
for (const T of C) {
|
|
9697
|
+
const O = d.get(T), { edges: S, indices: _ } = O, N = d.get(m), { edges: L, indices: M } = N;
|
|
9697
9698
|
for (const y of S)
|
|
9698
|
-
L.add(y), h.set(y,
|
|
9699
|
+
L.add(y), h.set(y, m);
|
|
9699
9700
|
for (const y of _)
|
|
9700
9701
|
M.add(y);
|
|
9701
|
-
d.delete(
|
|
9702
|
+
d.delete(T);
|
|
9702
9703
|
}
|
|
9703
9704
|
}
|
|
9704
9705
|
for (const [E, { indices: u, edges: p }] of d)
|
|
9705
9706
|
if (u.has(e)) {
|
|
9706
9707
|
const A = [];
|
|
9707
|
-
for (const
|
|
9708
|
-
const C = o.get(
|
|
9708
|
+
for (const m of p) {
|
|
9709
|
+
const C = o.get(m);
|
|
9709
9710
|
A.push(C);
|
|
9710
9711
|
}
|
|
9711
9712
|
return { edges: A, indices: u };
|
|
@@ -9728,7 +9729,7 @@ const Ds = class Ds extends J {
|
|
|
9728
9729
|
const [
|
|
9729
9730
|
{ id: d, value: E },
|
|
9730
9731
|
{ id: u, value: p },
|
|
9731
|
-
{ id: A, value:
|
|
9732
|
+
{ id: A, value: m }
|
|
9732
9733
|
] = h, C = [
|
|
9733
9734
|
{
|
|
9734
9735
|
id: `${d}|${u}`,
|
|
@@ -9737,26 +9738,26 @@ const Ds = class Ds extends J {
|
|
|
9737
9738
|
},
|
|
9738
9739
|
{
|
|
9739
9740
|
id: `${u}|${A}`,
|
|
9740
|
-
distance: p.distanceTo(
|
|
9741
|
-
points: [p,
|
|
9741
|
+
distance: p.distanceTo(m),
|
|
9742
|
+
points: [p, m]
|
|
9742
9743
|
},
|
|
9743
9744
|
{
|
|
9744
9745
|
id: `${d}|${A}`,
|
|
9745
|
-
distance: E.distanceTo(
|
|
9746
|
-
points: [E,
|
|
9746
|
+
distance: E.distanceTo(m),
|
|
9747
|
+
points: [E, m]
|
|
9747
9748
|
}
|
|
9748
|
-
],
|
|
9749
|
-
return
|
|
9749
|
+
], R = new g.Plane();
|
|
9750
|
+
return R.setFromNormalAndCoplanarPoint(c, n), R.constant = Math.round(R.constant * 10) / 10, { plane: R, edges: C };
|
|
9750
9751
|
}
|
|
9751
9752
|
getVerticesAndNormal(t, e, i) {
|
|
9752
9753
|
if (!t.geometry.index)
|
|
9753
9754
|
throw new Error("Geometry must be indexed!");
|
|
9754
|
-
const o = t.geometry.index.array, n = t.geometry.attributes.position.array, r = t.geometry.attributes.normal.array, a = o[e * 3] * 3, c = o[e * 3 + 1] * 3, h = o[e * 3 + 2] * 3, d = new g.Vector3(n[a], n[a + 1], n[a + 2]), E = new g.Vector3(n[c], n[c + 1], n[c + 2]), u = new g.Vector3(n[h], n[h + 1], n[h + 2]), p = new g.Vector3(r[a], r[a + 1], r[a + 2]), A = new g.Vector3(r[c], r[c + 1], r[c + 2]),
|
|
9755
|
+
const o = t.geometry.index.array, n = t.geometry.attributes.position.array, r = t.geometry.attributes.normal.array, a = o[e * 3] * 3, c = o[e * 3 + 1] * 3, h = o[e * 3 + 2] * 3, d = new g.Vector3(n[a], n[a + 1], n[a + 2]), E = new g.Vector3(n[c], n[c + 1], n[c + 2]), u = new g.Vector3(n[h], n[h + 1], n[h + 2]), p = new g.Vector3(r[a], r[a + 1], r[a + 2]), A = new g.Vector3(r[c], r[c + 1], r[c + 2]), m = new g.Vector3(r[h], r[h + 1], r[h + 2]), C = (p.x + A.x + m.x) / 3, R = (p.y + A.y + m.y) / 3, F = (p.z + A.z + m.z) / 3, f = new g.Vector3(C, R, F);
|
|
9755
9756
|
if (i !== void 0 && t instanceof g.InstancedMesh) {
|
|
9756
|
-
const
|
|
9757
|
-
t.getMatrixAt(i,
|
|
9757
|
+
const T = new g.Matrix4();
|
|
9758
|
+
t.getMatrixAt(i, T);
|
|
9758
9759
|
const O = new g.Matrix4();
|
|
9759
|
-
O.extractRotation(
|
|
9760
|
+
O.extractRotation(T), f.applyMatrix4(O), d.applyMatrix4(T), E.applyMatrix4(T), u.applyMatrix4(T);
|
|
9760
9761
|
}
|
|
9761
9762
|
return { p1: d, p2: E, p3: u, faceNormal: f };
|
|
9762
9763
|
}
|
|
@@ -9767,7 +9768,7 @@ const Ds = class Ds extends J {
|
|
|
9767
9768
|
I(Ds, "uuid", "267ca032-672f-4cb0-afa9-d24e904f39d6");
|
|
9768
9769
|
let Pn = Ds;
|
|
9769
9770
|
export {
|
|
9770
|
-
|
|
9771
|
+
$t as AsyncEvent,
|
|
9771
9772
|
_i as Base,
|
|
9772
9773
|
cr as BaseCamera,
|
|
9773
9774
|
lr as BaseRenderer,
|
|
@@ -9780,7 +9781,7 @@ export {
|
|
|
9780
9781
|
pi as Components,
|
|
9781
9782
|
Vr as CullerRenderer,
|
|
9782
9783
|
Ti as Cullers,
|
|
9783
|
-
|
|
9784
|
+
zt as Disposer,
|
|
9784
9785
|
D as Event,
|
|
9785
9786
|
Sn as Exploder,
|
|
9786
9787
|
Hr as FirstPersonMode,
|
|
@@ -9790,13 +9791,13 @@ export {
|
|
|
9790
9791
|
_n as Hider,
|
|
9791
9792
|
ra as IfcCategories,
|
|
9792
9793
|
Bn as IfcCategoryMap,
|
|
9793
|
-
|
|
9794
|
+
Qr as IfcElements,
|
|
9794
9795
|
Nn as IfcGeometryTiler,
|
|
9795
9796
|
mi as IfcJsonExporter,
|
|
9796
9797
|
Ri as IfcLoader,
|
|
9797
9798
|
gn as IfcPropertiesManager,
|
|
9798
9799
|
Kr as IfcPropertiesTiler,
|
|
9799
|
-
|
|
9800
|
+
Kt as IfcPropertiesUtils,
|
|
9800
9801
|
We as IfcRelationsIndexer,
|
|
9801
9802
|
qr as IfcStreamingSettings,
|
|
9802
9803
|
nn as MaterialsUtils,
|