@maqiuyao/dxf-viewer 0.2.11 → 0.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/dxf-viewer.cjs +10 -10
- package/dist/dxf-viewer.js +908 -900
- package/dist/src/dxfViewer/core/Configs.d.ts +8 -0
- package/package.json +1 -1
package/dist/dxf-viewer.js
CHANGED
|
@@ -62,16 +62,16 @@ p.Line.prototype.raycast = function(c, t) {
|
|
|
62
62
|
const m = u[f];
|
|
63
63
|
if (ht.copy(m.boundingSphere), ht.applyMatrix4(i), c.ray.intersectsSphere(ht) !== !1)
|
|
64
64
|
for (let b = m.indexStart, y = m.indexStart + m.indexCount - 1; b < y; b += a) {
|
|
65
|
-
const
|
|
66
|
-
if (ws(this, h, c,
|
|
65
|
+
const S = o.getX(b), w = o.getX(b + 1);
|
|
66
|
+
if (ws(this, h, c, S, w, r, t) && (t[t.length - 1].index = b, t.length - d >= Bi))
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
else {
|
|
71
71
|
const f = Math.max(0, n.start), m = Math.min(o.count, n.start + n.count);
|
|
72
72
|
for (let b = f, y = m - 1; b < y; b += a) {
|
|
73
|
-
const
|
|
74
|
-
if (ws(this, h, c,
|
|
73
|
+
const S = o.getX(b), w = o.getX(b + 1);
|
|
74
|
+
if (ws(this, h, c, S, w, r, t) && (t[t.length - 1].index = b, t.length - d >= Bi))
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
77
|
}
|
|
@@ -168,11 +168,11 @@ function Tr(c, t) {
|
|
|
168
168
|
}
|
|
169
169
|
function En(c, t, e, i, s) {
|
|
170
170
|
let n = 1 / 0, r = 1 / 0, a = 1 / 0, o = -1 / 0, l = -1 / 0, h = -1 / 0, d = 1 / 0, u = 1 / 0, f = 1 / 0, m = -1 / 0, b = -1 / 0, y = -1 / 0;
|
|
171
|
-
const
|
|
172
|
-
for (let w = (t -
|
|
173
|
-
const E = c[w + 0], M = c[w + 1], O = E - M,
|
|
174
|
-
O < n && (n = O),
|
|
175
|
-
const v = c[w + 2],
|
|
171
|
+
const S = c.offset || 0;
|
|
172
|
+
for (let w = (t - S) * 6, x = (t + e - S) * 6; w < x; w += 6) {
|
|
173
|
+
const E = c[w + 0], M = c[w + 1], O = E - M, T = E + M;
|
|
174
|
+
O < n && (n = O), T > o && (o = T), E < d && (d = E), E > m && (m = E);
|
|
175
|
+
const v = c[w + 2], C = c[w + 3], _ = v - C, A = v + C;
|
|
176
176
|
_ < r && (r = _), A > l && (l = A), v < u && (u = v), v > b && (b = v);
|
|
177
177
|
const I = c[w + 4], B = c[w + 5], k = I - B, D = I + B;
|
|
178
178
|
k < a && (a = k), D > h && (h = D), I < f && (f = I), I > y && (y = I);
|
|
@@ -197,7 +197,7 @@ function ic(c, t, e, i, s, n) {
|
|
|
197
197
|
let l = Sn * s;
|
|
198
198
|
const h = e.offset || 0, d = (i - h) * 6, u = (i + s - h) * 6;
|
|
199
199
|
for (let f = 0; f < 3; f++) {
|
|
200
|
-
const m = t[f],
|
|
200
|
+
const m = t[f], S = (t[f + 3] - m) / vt;
|
|
201
201
|
if (s < vt / 4) {
|
|
202
202
|
const w = [...It];
|
|
203
203
|
w.length = s;
|
|
@@ -206,13 +206,13 @@ function ic(c, t, e, i, s, n) {
|
|
|
206
206
|
const O = w[x];
|
|
207
207
|
O.candidate = e[M + 2 * f], O.count = 0;
|
|
208
208
|
const {
|
|
209
|
-
bounds:
|
|
209
|
+
bounds: T,
|
|
210
210
|
leftCacheBounds: v,
|
|
211
|
-
rightCacheBounds:
|
|
211
|
+
rightCacheBounds: C
|
|
212
212
|
} = O;
|
|
213
213
|
for (let _ = 0; _ < 3; _++)
|
|
214
|
-
|
|
215
|
-
vs(M, e,
|
|
214
|
+
C[_] = 1 / 0, C[_ + 3] = -1 / 0, v[_] = 1 / 0, v[_ + 3] = -1 / 0, T[_] = 1 / 0, T[_ + 3] = -1 / 0;
|
|
215
|
+
vs(M, e, T);
|
|
216
216
|
}
|
|
217
217
|
w.sort(tc);
|
|
218
218
|
let E = s;
|
|
@@ -223,32 +223,32 @@ function ic(c, t, e, i, s, n) {
|
|
|
223
223
|
}
|
|
224
224
|
for (let M = d; M < u; M += 6) {
|
|
225
225
|
const O = e[M + 2 * f];
|
|
226
|
-
for (let
|
|
227
|
-
const v = w[
|
|
226
|
+
for (let T = 0; T < E; T++) {
|
|
227
|
+
const v = w[T];
|
|
228
228
|
O >= v.candidate ? vs(M, e, v.rightCacheBounds) : (vs(M, e, v.leftCacheBounds), v.count++);
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
231
|
for (let M = 0; M < E; M++) {
|
|
232
|
-
const O = w[M],
|
|
232
|
+
const O = w[M], T = O.count, v = s - O.count, C = O.leftCacheBounds, _ = O.rightCacheBounds;
|
|
233
233
|
let A = 0;
|
|
234
|
-
|
|
234
|
+
T !== 0 && (A = Wi(C) / o);
|
|
235
235
|
let I = 0;
|
|
236
236
|
v !== 0 && (I = Wi(_) / o);
|
|
237
|
-
const B = Lr + Sn * (A *
|
|
237
|
+
const B = Lr + Sn * (A * T + I * v);
|
|
238
238
|
B < l && (r = f, l = B, a = O.candidate);
|
|
239
239
|
}
|
|
240
240
|
} else {
|
|
241
241
|
for (let E = 0; E < vt; E++) {
|
|
242
242
|
const M = It[E];
|
|
243
|
-
M.count = 0, M.candidate = m +
|
|
243
|
+
M.count = 0, M.candidate = m + S + E * S;
|
|
244
244
|
const O = M.bounds;
|
|
245
|
-
for (let
|
|
246
|
-
O[
|
|
245
|
+
for (let T = 0; T < 3; T++)
|
|
246
|
+
O[T] = 1 / 0, O[T + 3] = -1 / 0;
|
|
247
247
|
}
|
|
248
248
|
for (let E = d; E < u; E += 6) {
|
|
249
|
-
let
|
|
250
|
-
|
|
251
|
-
const v = It[
|
|
249
|
+
let T = ~~((e[E + 2 * f] - m) / S);
|
|
250
|
+
T >= vt && (T = vt - 1);
|
|
251
|
+
const v = It[T];
|
|
252
252
|
v.count++, vs(E, e, v.bounds);
|
|
253
253
|
}
|
|
254
254
|
const w = It[vt - 1];
|
|
@@ -259,12 +259,12 @@ function ic(c, t, e, i, s, n) {
|
|
|
259
259
|
}
|
|
260
260
|
let x = 0;
|
|
261
261
|
for (let E = 0; E < vt - 1; E++) {
|
|
262
|
-
const M = It[E], O = M.count,
|
|
263
|
-
O !== 0 && (x === 0 ? Rr(
|
|
262
|
+
const M = It[E], O = M.count, T = M.bounds, C = It[E + 1].rightCacheBounds;
|
|
263
|
+
O !== 0 && (x === 0 ? Rr(T, Ms) : Fr(T, Ms, Ms)), x += O;
|
|
264
264
|
let _ = 0, A = 0;
|
|
265
265
|
x !== 0 && (_ = Wi(Ms) / o);
|
|
266
266
|
const I = s - x;
|
|
267
|
-
I !== 0 && (A = Wi(
|
|
267
|
+
I !== 0 && (A = Wi(C) / o);
|
|
268
268
|
const B = Lr + Sn * (_ * x + A * I);
|
|
269
269
|
B < l && (r = f, l = B, a = M.candidate);
|
|
270
270
|
}
|
|
@@ -343,26 +343,26 @@ function oc(c, t, e, i, s, n) {
|
|
|
343
343
|
let b = !1;
|
|
344
344
|
const y = new On();
|
|
345
345
|
return En(t, e, i, y.boundingData, m), w(y, e, i, m), y;
|
|
346
|
-
function
|
|
346
|
+
function S(x) {
|
|
347
347
|
d && d((x - n.offset) / n.count);
|
|
348
348
|
}
|
|
349
|
-
function w(x, E, M, O = null,
|
|
350
|
-
!b &&
|
|
349
|
+
function w(x, E, M, O = null, T = 0) {
|
|
350
|
+
!b && T >= r && (b = !0, a && console.warn(`BVH: Max depth of ${r} reached when generating BVH. Consider increasing maxDepth.`));
|
|
351
351
|
const v = M > l;
|
|
352
|
-
if (M <= o && !v ||
|
|
353
|
-
return
|
|
354
|
-
const
|
|
355
|
-
let _ =
|
|
356
|
-
if (
|
|
352
|
+
if (M <= o && !v || T >= r)
|
|
353
|
+
return S(E + M), x.offset = E, x.count = M, x;
|
|
354
|
+
const C = ic(x.boundingData, O, t, E, M, h);
|
|
355
|
+
let _ = C.axis === -1 ? -1 : nc(u, f, t, E, M, C);
|
|
356
|
+
if (C.axis === -1 || _ === E || _ === E + M) {
|
|
357
357
|
if (!v)
|
|
358
|
-
return
|
|
359
|
-
|
|
358
|
+
return S(E + M), x.offset = E, x.count = M, x;
|
|
359
|
+
C.axis = Math.max(0, lr(x.boundingData)), _ = E + Math.max(1, Math.floor(M / 2));
|
|
360
360
|
}
|
|
361
|
-
x.splitAxis =
|
|
361
|
+
x.splitAxis = C.axis;
|
|
362
362
|
const A = new On(), I = E, B = _ - E;
|
|
363
|
-
x.left = A, En(t, I, B, A.boundingData, m), w(A, I, B, m,
|
|
363
|
+
x.left = A, En(t, I, B, A.boundingData, m), w(A, I, B, m, T + 1);
|
|
364
364
|
const k = new On(), D = _, R = M - B;
|
|
365
|
-
return x.right = k, En(t, D, R, k.boundingData, m), w(k, D, R, m,
|
|
365
|
+
return x.right = k, En(t, D, R, k.boundingData, m), w(k, D, R, m, T + 1), x;
|
|
366
366
|
}
|
|
367
367
|
}
|
|
368
368
|
function lc(c, t) {
|
|
@@ -430,11 +430,11 @@ function ur(c, t, e, i, s = null, n = 0, r = 0) {
|
|
|
430
430
|
return Ce(I, k) + Pe(D, B);
|
|
431
431
|
};
|
|
432
432
|
const u = be(c), f = we(c, l);
|
|
433
|
-
let m = u, b = f, y,
|
|
434
|
-
if (s && (w = Ut, x = ki, le(m, a, w), le(b, a, x), y = s(w),
|
|
433
|
+
let m = u, b = f, y, S, w, x;
|
|
434
|
+
if (s && (w = Ut, x = ki, le(m, a, w), le(b, a, x), y = s(w), S = s(x), S < y)) {
|
|
435
435
|
m = f, b = u;
|
|
436
436
|
const I = y;
|
|
437
|
-
y =
|
|
437
|
+
y = S, S = I, w = x;
|
|
438
438
|
}
|
|
439
439
|
w || (w = Ut, le(m, a, w));
|
|
440
440
|
const E = he(m * 2, o), M = e(w, E, y, r + 1, n + m / xe);
|
|
@@ -454,13 +454,13 @@ function ur(c, t, e, i, s = null, n = 0, r = 0) {
|
|
|
454
454
|
);
|
|
455
455
|
if (O) return !0;
|
|
456
456
|
x = ki, le(b, a, x);
|
|
457
|
-
const
|
|
458
|
-
let
|
|
457
|
+
const T = he(b * 2, o), v = e(x, T, S, r + 1, n + b / xe);
|
|
458
|
+
let C;
|
|
459
459
|
if (v === Dr) {
|
|
460
460
|
const I = _(b), k = A(b) - I;
|
|
461
|
-
|
|
461
|
+
C = i(I, k, !0, r + 1, n + b / xe, x);
|
|
462
462
|
} else
|
|
463
|
-
|
|
463
|
+
C = v && ur(
|
|
464
464
|
b,
|
|
465
465
|
t,
|
|
466
466
|
e,
|
|
@@ -469,7 +469,7 @@ function ur(c, t, e, i, s = null, n = 0, r = 0) {
|
|
|
469
469
|
n,
|
|
470
470
|
r + 1
|
|
471
471
|
);
|
|
472
|
-
return !!
|
|
472
|
+
return !!C;
|
|
473
473
|
}
|
|
474
474
|
}
|
|
475
475
|
const ls = /* @__PURE__ */ new ne.constructor(), ln = /* @__PURE__ */ new ne.constructor(), Lt = /* @__PURE__ */ new Cr(() => new De()), ui = /* @__PURE__ */ new De(), fi = /* @__PURE__ */ new De(), _n = /* @__PURE__ */ new De(), Pn = /* @__PURE__ */ new De();
|
|
@@ -506,11 +506,11 @@ function dc(c, t, e, i) {
|
|
|
506
506
|
function st(c, t, e, i, s, n = 0, r = 0, a = 0, o = 0, l = null, h = !1) {
|
|
507
507
|
let d, u;
|
|
508
508
|
h ? (d = ln, u = ls) : (d = ls, u = ln);
|
|
509
|
-
const f = d.float32Array, m = d.uint32Array, b = d.uint16Array, y = u.float32Array,
|
|
510
|
-
let
|
|
509
|
+
const f = d.float32Array, m = d.uint32Array, b = d.uint16Array, y = u.float32Array, S = u.uint32Array, w = u.uint16Array, x = c * 2, E = t * 2, M = he(x, b), O = he(E, w);
|
|
510
|
+
let T = !1;
|
|
511
511
|
if (O && M)
|
|
512
|
-
h ?
|
|
513
|
-
Ce(t,
|
|
512
|
+
h ? T = s(
|
|
513
|
+
Ce(t, S),
|
|
514
514
|
Pe(t * 2, w),
|
|
515
515
|
Ce(c, m),
|
|
516
516
|
Pe(c * 2, b),
|
|
@@ -518,10 +518,10 @@ function st(c, t, e, i, s, n = 0, r = 0, a = 0, o = 0, l = null, h = !1) {
|
|
|
518
518
|
r + t / xe,
|
|
519
519
|
a,
|
|
520
520
|
n + c / xe
|
|
521
|
-
) :
|
|
521
|
+
) : T = s(
|
|
522
522
|
Ce(c, m),
|
|
523
523
|
Pe(c * 2, b),
|
|
524
|
-
Ce(t,
|
|
524
|
+
Ce(t, S),
|
|
525
525
|
Pe(t * 2, w),
|
|
526
526
|
a,
|
|
527
527
|
n + c / xe,
|
|
@@ -531,12 +531,12 @@ function st(c, t, e, i, s, n = 0, r = 0, a = 0, o = 0, l = null, h = !1) {
|
|
|
531
531
|
else if (O) {
|
|
532
532
|
const v = Lt.getPrimitive();
|
|
533
533
|
le(t, y, v), v.applyMatrix4(e);
|
|
534
|
-
const
|
|
535
|
-
le(
|
|
534
|
+
const C = be(c), _ = we(c, m);
|
|
535
|
+
le(C, f, ui), le(_, f, fi);
|
|
536
536
|
const A = v.intersectsBox(ui), I = v.intersectsBox(fi);
|
|
537
|
-
|
|
537
|
+
T = A && st(
|
|
538
538
|
t,
|
|
539
|
-
|
|
539
|
+
C,
|
|
540
540
|
i,
|
|
541
541
|
e,
|
|
542
542
|
s,
|
|
@@ -560,11 +560,11 @@ function st(c, t, e, i, s, n = 0, r = 0, a = 0, o = 0, l = null, h = !1) {
|
|
|
560
560
|
!h
|
|
561
561
|
), Lt.releasePrimitive(v);
|
|
562
562
|
} else {
|
|
563
|
-
const v = be(t),
|
|
564
|
-
le(v, y, _n), le(
|
|
563
|
+
const v = be(t), C = we(t, S);
|
|
564
|
+
le(v, y, _n), le(C, y, Pn);
|
|
565
565
|
const _ = l.intersectsBox(_n), A = l.intersectsBox(Pn);
|
|
566
566
|
if (_ && A)
|
|
567
|
-
|
|
567
|
+
T = st(
|
|
568
568
|
c,
|
|
569
569
|
v,
|
|
570
570
|
e,
|
|
@@ -578,7 +578,7 @@ function st(c, t, e, i, s, n = 0, r = 0, a = 0, o = 0, l = null, h = !1) {
|
|
|
578
578
|
h
|
|
579
579
|
) || st(
|
|
580
580
|
c,
|
|
581
|
-
|
|
581
|
+
C,
|
|
582
582
|
e,
|
|
583
583
|
i,
|
|
584
584
|
s,
|
|
@@ -591,7 +591,7 @@ function st(c, t, e, i, s, n = 0, r = 0, a = 0, o = 0, l = null, h = !1) {
|
|
|
591
591
|
);
|
|
592
592
|
else if (_)
|
|
593
593
|
if (M)
|
|
594
|
-
|
|
594
|
+
T = st(
|
|
595
595
|
c,
|
|
596
596
|
v,
|
|
597
597
|
e,
|
|
@@ -610,7 +610,7 @@ function st(c, t, e, i, s, n = 0, r = 0, a = 0, o = 0, l = null, h = !1) {
|
|
|
610
610
|
const B = be(c), k = we(c, m);
|
|
611
611
|
le(B, f, ui), le(k, f, fi);
|
|
612
612
|
const D = I.intersectsBox(ui), R = I.intersectsBox(fi);
|
|
613
|
-
|
|
613
|
+
T = D && st(
|
|
614
614
|
v,
|
|
615
615
|
B,
|
|
616
616
|
i,
|
|
@@ -638,9 +638,9 @@ function st(c, t, e, i, s, n = 0, r = 0, a = 0, o = 0, l = null, h = !1) {
|
|
|
638
638
|
}
|
|
639
639
|
else if (A)
|
|
640
640
|
if (M)
|
|
641
|
-
|
|
641
|
+
T = st(
|
|
642
642
|
c,
|
|
643
|
-
|
|
643
|
+
C,
|
|
644
644
|
e,
|
|
645
645
|
i,
|
|
646
646
|
s,
|
|
@@ -657,8 +657,8 @@ function st(c, t, e, i, s, n = 0, r = 0, a = 0, o = 0, l = null, h = !1) {
|
|
|
657
657
|
const B = be(c), k = we(c, m);
|
|
658
658
|
le(B, f, ui), le(k, f, fi);
|
|
659
659
|
const D = I.intersectsBox(ui), R = I.intersectsBox(fi);
|
|
660
|
-
|
|
661
|
-
|
|
660
|
+
T = D && st(
|
|
661
|
+
C,
|
|
662
662
|
B,
|
|
663
663
|
i,
|
|
664
664
|
e,
|
|
@@ -670,7 +670,7 @@ function st(c, t, e, i, s, n = 0, r = 0, a = 0, o = 0, l = null, h = !1) {
|
|
|
670
670
|
I,
|
|
671
671
|
!h
|
|
672
672
|
) || R && st(
|
|
673
|
-
|
|
673
|
+
C,
|
|
674
674
|
k,
|
|
675
675
|
i,
|
|
676
676
|
e,
|
|
@@ -684,7 +684,7 @@ function st(c, t, e, i, s, n = 0, r = 0, a = 0, o = 0, l = null, h = !1) {
|
|
|
684
684
|
), Lt.releasePrimitive(I);
|
|
685
685
|
}
|
|
686
686
|
}
|
|
687
|
-
return
|
|
687
|
+
return T;
|
|
688
688
|
}
|
|
689
689
|
const In = new class {
|
|
690
690
|
constructor() {
|
|
@@ -762,8 +762,8 @@ class uc {
|
|
|
762
762
|
let n = 1 / 0, r = 1 / 0, a = 1 / 0, o = -1 / 0, l = -1 / 0, h = -1 / 0;
|
|
763
763
|
for (let d = t, u = t + e; d < u; d++) {
|
|
764
764
|
this.writePrimitiveBounds(d, pi, 0);
|
|
765
|
-
const [f, m, b, y,
|
|
766
|
-
f < n && (n = f), y > o && (o = y), m < r && (r = m),
|
|
765
|
+
const [f, m, b, y, S, w] = pi;
|
|
766
|
+
f < n && (n = f), y > o && (o = y), m < r && (r = m), S > l && (l = S), b < a && (a = b), w > h && (h = w);
|
|
767
767
|
}
|
|
768
768
|
return i[s + 0] = n, i[s + 1] = r, i[s + 2] = a, i[s + 3] = o, i[s + 4] = l, i[s + 5] = h, i;
|
|
769
769
|
}
|
|
@@ -771,8 +771,8 @@ class uc {
|
|
|
771
771
|
const s = i.offset || 0;
|
|
772
772
|
for (let n = t, r = t + e; n < r; n++) {
|
|
773
773
|
this.writePrimitiveBounds(n, pi, 0);
|
|
774
|
-
const [a, o, l, h, d, u] = pi, f = (a + h) / 2, m = (o + d) / 2, b = (l + u) / 2, y = (h - a) / 2,
|
|
775
|
-
i[x + 0] = f, i[x + 1] = y + (Math.abs(f) + y) * en, i[x + 2] = m, i[x + 3] =
|
|
774
|
+
const [a, o, l, h, d, u] = pi, f = (a + h) / 2, m = (o + d) / 2, b = (l + u) / 2, y = (h - a) / 2, S = (d - o) / 2, w = (u - l) / 2, x = (n - s) * 6;
|
|
775
|
+
i[x + 0] = f, i[x + 1] = y + (Math.abs(f) + y) * en, i[x + 2] = m, i[x + 3] = S + (Math.abs(m) + S) * en, i[x + 4] = b, i[x + 5] = w + (Math.abs(b) + w) * en;
|
|
776
776
|
}
|
|
777
777
|
return i;
|
|
778
778
|
}
|
|
@@ -826,8 +826,8 @@ class uc {
|
|
|
826
826
|
} else {
|
|
827
827
|
const f = be(h), m = we(h, n);
|
|
828
828
|
for (let b = 0; b < 3; b++) {
|
|
829
|
-
const y = a[f + b],
|
|
830
|
-
a[h + b] = y < w ? y : w, a[h + b + 3] =
|
|
829
|
+
const y = a[f + b], S = a[f + b + 3], w = a[m + b], x = a[m + b + 3];
|
|
830
|
+
a[h + b] = y < w ? y : w, a[h + b + 3] = S > x ? S : x;
|
|
831
831
|
}
|
|
832
832
|
}
|
|
833
833
|
}
|
|
@@ -936,8 +936,8 @@ function Vr(c, t, e) {
|
|
|
936
936
|
return [i];
|
|
937
937
|
const n = [], r = i.offset, a = i.offset + i.count, o = Sr(c) / e, l = [];
|
|
938
938
|
for (const u of s) {
|
|
939
|
-
const { offset: f, count: m } = u, b = f, y = isFinite(m) ? m : o - f,
|
|
940
|
-
b < a &&
|
|
939
|
+
const { offset: f, count: m } = u, b = f, y = isFinite(m) ? m : o - f, S = f + y;
|
|
940
|
+
b < a && S > r && (l.push({ pos: Math.max(r, b), isStart: !0 }), l.push({ pos: Math.min(a, S), isStart: !1 }));
|
|
941
941
|
}
|
|
942
942
|
l.sort((u, f) => u.pos !== f.pos ? u.pos - f.pos : u.type === "end" ? -1 : 1);
|
|
943
943
|
let h = 0, d = null;
|
|
@@ -1057,8 +1057,8 @@ const wc = /* @__PURE__ */ (function() {
|
|
|
1057
1057
|
const a = s.start, o = c, l = n.start, h = t;
|
|
1058
1058
|
e.subVectors(a, l), c.subVectors(s.end, s.start), t.subVectors(n.end, n.start);
|
|
1059
1059
|
const d = e.dot(h), u = h.dot(o), f = h.dot(h), m = e.dot(o), y = o.dot(o) * f - u * u;
|
|
1060
|
-
let
|
|
1061
|
-
y !== 0 ?
|
|
1060
|
+
let S, w;
|
|
1061
|
+
y !== 0 ? S = (d * u - m * f) / y : S = 0, w = (d + S * u) / f, r.x = S, r.y = w;
|
|
1062
1062
|
};
|
|
1063
1063
|
})(), Er = /* @__PURE__ */ (function() {
|
|
1064
1064
|
const c = /* @__PURE__ */ new jt(), t = /* @__PURE__ */ new G(), e = /* @__PURE__ */ new G();
|
|
@@ -1096,8 +1096,8 @@ const wc = /* @__PURE__ */ (function() {
|
|
|
1096
1096
|
if (i.start = l, i.end = h, i.closestPointToPoint(o, !0, c).distanceTo(o) <= a || (i.start = l, i.end = d, i.closestPointToPoint(o, !0, c).distanceTo(o) <= a) || (i.start = h, i.end = d, i.closestPointToPoint(o, !0, c).distanceTo(o) <= a)) return !0;
|
|
1097
1097
|
const b = r.getPlane(e);
|
|
1098
1098
|
if (Math.abs(b.distanceToPoint(o)) <= a) {
|
|
1099
|
-
const
|
|
1100
|
-
if (r.containsPoint(
|
|
1099
|
+
const S = b.projectPoint(o, t);
|
|
1100
|
+
if (r.containsPoint(S)) return !0;
|
|
1101
1101
|
}
|
|
1102
1102
|
return !1;
|
|
1103
1103
|
};
|
|
@@ -1126,8 +1126,8 @@ class lt extends Oi {
|
|
|
1126
1126
|
d.subVectors(e, i), u.setFromPoints(d, s);
|
|
1127
1127
|
const f = n[3], m = r[3];
|
|
1128
1128
|
f.subVectors(i, t), m.setFromPoints(f, s);
|
|
1129
|
-
const b = l.length(), y = d.length(),
|
|
1130
|
-
this.isDegenerateIntoPoint = !1, this.isDegenerateIntoSegment = !1, b < Tt ? y < Tt ||
|
|
1129
|
+
const b = l.length(), y = d.length(), S = f.length();
|
|
1130
|
+
this.isDegenerateIntoPoint = !1, this.isDegenerateIntoSegment = !1, b < Tt ? y < Tt || S < Tt ? this.isDegenerateIntoPoint = !0 : (this.isDegenerateIntoSegment = !0, this.degenerateSegment.start.copy(t), this.degenerateSegment.end.copy(i)) : y < Tt ? S < Tt ? this.isDegenerateIntoPoint = !0 : (this.isDegenerateIntoSegment = !0, this.degenerateSegment.start.copy(e), this.degenerateSegment.end.copy(t)) : S < Tt && (this.isDegenerateIntoSegment = !0, this.degenerateSegment.start.copy(i), this.degenerateSegment.end.copy(e)), this.plane.setFromNormalAndCoplanarPoint(a, t), this.needsUpdate = !1;
|
|
1131
1131
|
}
|
|
1132
1132
|
}
|
|
1133
1133
|
lt.prototype.closestPointToSegment = /* @__PURE__ */ (function() {
|
|
@@ -1145,68 +1145,68 @@ lt.prototype.closestPointToSegment = /* @__PURE__ */ (function() {
|
|
|
1145
1145
|
lt.prototype.intersectsTriangle = /* @__PURE__ */ (function() {
|
|
1146
1146
|
const c = /* @__PURE__ */ new lt(), t = /* @__PURE__ */ new Pt(), e = /* @__PURE__ */ new Pt(), i = /* @__PURE__ */ new G(), s = /* @__PURE__ */ new G(), n = /* @__PURE__ */ new G(), r = /* @__PURE__ */ new G(), a = /* @__PURE__ */ new _t(), o = /* @__PURE__ */ new _t(), l = /* @__PURE__ */ new G(), h = /* @__PURE__ */ new jt(), d = /* @__PURE__ */ new jt();
|
|
1147
1147
|
function u(x, E, M, O) {
|
|
1148
|
-
const
|
|
1149
|
-
!x.isDegenerateIntoPoint && !x.isDegenerateIntoSegment ?
|
|
1150
|
-
const v = x.satBounds,
|
|
1148
|
+
const T = i;
|
|
1149
|
+
!x.isDegenerateIntoPoint && !x.isDegenerateIntoSegment ? T.copy(x.plane.normal) : T.copy(E.plane.normal);
|
|
1150
|
+
const v = x.satBounds, C = x.satAxes;
|
|
1151
1151
|
for (let I = 1; I < 4; I++) {
|
|
1152
|
-
const B = v[I], k =
|
|
1153
|
-
if (t.setFromPoints(k, E.points), B.isSeparated(t) || (r.copy(
|
|
1152
|
+
const B = v[I], k = C[I];
|
|
1153
|
+
if (t.setFromPoints(k, E.points), B.isSeparated(t) || (r.copy(T).cross(k), t.setFromPoints(r, x.points), e.setFromPoints(r, E.points), t.isSeparated(e))) return !1;
|
|
1154
1154
|
}
|
|
1155
1155
|
const _ = E.satBounds, A = E.satAxes;
|
|
1156
1156
|
for (let I = 1; I < 4; I++) {
|
|
1157
1157
|
const B = _[I], k = A[I];
|
|
1158
|
-
if (t.setFromPoints(k, x.points), B.isSeparated(t) || (r.crossVectors(
|
|
1158
|
+
if (t.setFromPoints(k, x.points), B.isSeparated(t) || (r.crossVectors(T, k), t.setFromPoints(r, x.points), e.setFromPoints(r, E.points), t.isSeparated(e))) return !1;
|
|
1159
1159
|
}
|
|
1160
1160
|
return M && (O || console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."), M.start.set(0, 0, 0), M.end.set(0, 0, 0)), !0;
|
|
1161
1161
|
}
|
|
1162
|
-
function f(x, E, M, O,
|
|
1163
|
-
let k =
|
|
1164
|
-
I.x = O + (
|
|
1162
|
+
function f(x, E, M, O, T, v, C, _, A, I, B) {
|
|
1163
|
+
let k = C / (C - _);
|
|
1164
|
+
I.x = O + (T - O) * k, B.start.subVectors(E, x).multiplyScalar(k).add(x), k = C / (C - A), I.y = O + (v - O) * k, B.end.subVectors(M, x).multiplyScalar(k).add(x);
|
|
1165
1165
|
}
|
|
1166
|
-
function m(x, E, M, O,
|
|
1167
|
-
if (
|
|
1168
|
-
f(x.c, x.a, x.b, O, E, M, A,
|
|
1166
|
+
function m(x, E, M, O, T, v, C, _, A, I, B) {
|
|
1167
|
+
if (T > 0)
|
|
1168
|
+
f(x.c, x.a, x.b, O, E, M, A, C, _, I, B);
|
|
1169
1169
|
else if (v > 0)
|
|
1170
|
-
f(x.b, x.a, x.c, M, E, O, _,
|
|
1171
|
-
else if (_ * A > 0 ||
|
|
1172
|
-
f(x.a, x.b, x.c, E, M, O,
|
|
1170
|
+
f(x.b, x.a, x.c, M, E, O, _, C, A, I, B);
|
|
1171
|
+
else if (_ * A > 0 || C != 0)
|
|
1172
|
+
f(x.a, x.b, x.c, E, M, O, C, _, A, I, B);
|
|
1173
1173
|
else if (_ != 0)
|
|
1174
|
-
f(x.b, x.a, x.c, M, E, O, _,
|
|
1174
|
+
f(x.b, x.a, x.c, M, E, O, _, C, A, I, B);
|
|
1175
1175
|
else if (A != 0)
|
|
1176
|
-
f(x.c, x.a, x.b, O, E, M, A,
|
|
1176
|
+
f(x.c, x.a, x.b, O, E, M, A, C, _, I, B);
|
|
1177
1177
|
else
|
|
1178
1178
|
return !0;
|
|
1179
1179
|
return !1;
|
|
1180
1180
|
}
|
|
1181
1181
|
function b(x, E, M, O) {
|
|
1182
|
-
const
|
|
1183
|
-
return Ye(v) ? Ye(
|
|
1182
|
+
const T = E.degenerateSegment, v = x.plane.distanceToPoint(T.start), C = x.plane.distanceToPoint(T.end);
|
|
1183
|
+
return Ye(v) ? Ye(C) ? u(x, E, M, O) : (M && (M.start.copy(T.start), M.end.copy(T.start)), x.containsPoint(T.start)) : Ye(C) ? (M && (M.start.copy(T.end), M.end.copy(T.end)), x.containsPoint(T.end)) : x.plane.intersectLine(T, i) != null ? (M && (M.start.copy(i), M.end.copy(i)), x.containsPoint(i)) : !1;
|
|
1184
1184
|
}
|
|
1185
1185
|
function y(x, E, M) {
|
|
1186
1186
|
const O = E.a;
|
|
1187
1187
|
return Ye(x.plane.distanceToPoint(O)) && x.containsPoint(O) ? (M && (M.start.copy(O), M.end.copy(O)), !0) : !1;
|
|
1188
1188
|
}
|
|
1189
|
-
function
|
|
1190
|
-
const O = x.degenerateSegment,
|
|
1191
|
-
return O.closestPointToPoint(
|
|
1189
|
+
function S(x, E, M) {
|
|
1190
|
+
const O = x.degenerateSegment, T = E.a;
|
|
1191
|
+
return O.closestPointToPoint(T, !0, i), T.distanceToSquared(i) < Ur ? (M && (M.start.copy(T), M.end.copy(T)), !0) : !1;
|
|
1192
1192
|
}
|
|
1193
1193
|
function w(x, E, M, O) {
|
|
1194
1194
|
if (x.isDegenerateIntoSegment)
|
|
1195
1195
|
if (E.isDegenerateIntoSegment) {
|
|
1196
|
-
const
|
|
1197
|
-
|
|
1198
|
-
const A = i.subVectors(v.start,
|
|
1196
|
+
const T = x.degenerateSegment, v = E.degenerateSegment, C = s, _ = n;
|
|
1197
|
+
T.delta(C), v.delta(_);
|
|
1198
|
+
const A = i.subVectors(v.start, T.start), I = C.x * _.y - C.y * _.x;
|
|
1199
1199
|
if (Ye(I))
|
|
1200
1200
|
return !1;
|
|
1201
|
-
const B = (A.x * _.y - A.y * _.x) / I, k = -(
|
|
1201
|
+
const B = (A.x * _.y - A.y * _.x) / I, k = -(C.x * A.y - C.y * A.x) / I;
|
|
1202
1202
|
if (B < 0 || B > 1 || k < 0 || k > 1)
|
|
1203
1203
|
return !1;
|
|
1204
|
-
const D =
|
|
1205
|
-
return Ye(D - R) ? (M && (M.start.copy(
|
|
1206
|
-
} else return E.isDegenerateIntoPoint ?
|
|
1204
|
+
const D = T.start.z + C.z * B, R = v.start.z + _.z * k;
|
|
1205
|
+
return Ye(D - R) ? (M && (M.start.copy(T.start).addScaledVector(C, B), M.end.copy(T.start).addScaledVector(C, B)), !0) : !1;
|
|
1206
|
+
} else return E.isDegenerateIntoPoint ? S(x, E, M) : b(E, x, M, O);
|
|
1207
1207
|
else {
|
|
1208
1208
|
if (x.isDegenerateIntoPoint)
|
|
1209
|
-
return E.isDegenerateIntoPoint ? E.a.distanceToSquared(x.a) < Ur ? (M && (M.start.copy(x.a), M.end.copy(x.a)), !0) : !1 : E.isDegenerateIntoSegment ?
|
|
1209
|
+
return E.isDegenerateIntoPoint ? E.a.distanceToSquared(x.a) < Ur ? (M && (M.start.copy(x.a), M.end.copy(x.a)), !0) : !1 : E.isDegenerateIntoSegment ? S(E, x, M) : y(E, x, M);
|
|
1210
1210
|
if (E.isDegenerateIntoPoint)
|
|
1211
1211
|
return y(x, E, M);
|
|
1212
1212
|
if (E.isDegenerateIntoSegment)
|
|
@@ -1215,11 +1215,11 @@ lt.prototype.intersectsTriangle = /* @__PURE__ */ (function() {
|
|
|
1215
1215
|
}
|
|
1216
1216
|
return function(E, M = null, O = !1) {
|
|
1217
1217
|
this.needsUpdate && this.update(), E.isExtendedTriangle ? E.needsUpdate && E.update() : (c.copy(E), c.update(), E = c);
|
|
1218
|
-
const
|
|
1219
|
-
if (
|
|
1220
|
-
return
|
|
1221
|
-
const v = this.plane,
|
|
1222
|
-
let _ =
|
|
1218
|
+
const T = w(this, E, M, O);
|
|
1219
|
+
if (T !== void 0)
|
|
1220
|
+
return T;
|
|
1221
|
+
const v = this.plane, C = E.plane;
|
|
1222
|
+
let _ = C.distanceToPoint(this.a), A = C.distanceToPoint(this.b), I = C.distanceToPoint(this.c);
|
|
1223
1223
|
Ye(_) && (_ = 0), Ye(A) && (A = 0), Ye(I) && (I = 0);
|
|
1224
1224
|
const B = _ * A, k = _ * I;
|
|
1225
1225
|
if (B > 0 && k > 0)
|
|
@@ -1229,7 +1229,7 @@ lt.prototype.intersectsTriangle = /* @__PURE__ */ (function() {
|
|
|
1229
1229
|
const se = D * R, ze = D * ie;
|
|
1230
1230
|
if (se > 0 && ze > 0)
|
|
1231
1231
|
return !1;
|
|
1232
|
-
s.copy(v.normal), n.copy(
|
|
1232
|
+
s.copy(v.normal), n.copy(C.normal);
|
|
1233
1233
|
const ct = s.cross(n);
|
|
1234
1234
|
let ve = 0, Ni = Math.abs(ct.x);
|
|
1235
1235
|
const Qe = Math.abs(ct.y);
|
|
@@ -1276,8 +1276,8 @@ lt.prototype.distanceToTriangle = /* @__PURE__ */ (function() {
|
|
|
1276
1276
|
for (let m = 0; m < 3; m++) {
|
|
1277
1277
|
const b = e[m], y = e[(m + 1) % 3];
|
|
1278
1278
|
s.set(r[b], r[y]), Er(i, s, c, t);
|
|
1279
|
-
const
|
|
1280
|
-
|
|
1279
|
+
const S = c.distanceToSquared(t);
|
|
1280
|
+
S < h && (h = S, a && a.copy(c), o && o.copy(t));
|
|
1281
1281
|
}
|
|
1282
1282
|
}
|
|
1283
1283
|
return Math.sqrt(h);
|
|
@@ -1375,34 +1375,34 @@ Re.prototype.distanceToBox = /* @__PURE__ */ (function() {
|
|
|
1375
1375
|
const h = a * a, d = r.min, u = r.max, f = this.points;
|
|
1376
1376
|
let m = 1 / 0;
|
|
1377
1377
|
for (let y = 0; y < 8; y++) {
|
|
1378
|
-
const
|
|
1379
|
-
s.copy(
|
|
1380
|
-
const w =
|
|
1381
|
-
if (w < m && (m = w, o && o.copy(
|
|
1378
|
+
const S = f[y];
|
|
1379
|
+
s.copy(S).clamp(d, u);
|
|
1380
|
+
const w = S.distanceToSquared(s);
|
|
1381
|
+
if (w < m && (m = w, o && o.copy(S), l && l.copy(s), w < h))
|
|
1382
1382
|
return Math.sqrt(w);
|
|
1383
1383
|
}
|
|
1384
1384
|
let b = 0;
|
|
1385
1385
|
for (let y = 0; y < 3; y++)
|
|
1386
|
-
for (let
|
|
1386
|
+
for (let S = 0; S <= 1; S++)
|
|
1387
1387
|
for (let w = 0; w <= 1; w++) {
|
|
1388
|
-
const x = (y + 1) % 3, E = (y + 2) % 3, M =
|
|
1389
|
-
t[b].set(
|
|
1388
|
+
const x = (y + 1) % 3, E = (y + 2) % 3, M = S << x | w << E, O = 1 << y | S << x | w << E, T = f[M], v = f[O];
|
|
1389
|
+
t[b].set(T, v);
|
|
1390
1390
|
const _ = c[y], A = c[x], I = c[E], B = e[b], k = B.start, D = B.end;
|
|
1391
|
-
k[_] = d[_], k[A] =
|
|
1391
|
+
k[_] = d[_], k[A] = S ? d[A] : u[A], k[I] = w ? d[I] : u[A], D[_] = u[_], D[A] = S ? d[A] : u[A], D[I] = w ? d[I] : u[A], b++;
|
|
1392
1392
|
}
|
|
1393
1393
|
for (let y = 0; y <= 1; y++)
|
|
1394
|
-
for (let
|
|
1394
|
+
for (let S = 0; S <= 1; S++)
|
|
1395
1395
|
for (let w = 0; w <= 1; w++) {
|
|
1396
|
-
s.x = y ? u.x : d.x, s.y =
|
|
1396
|
+
s.x = y ? u.x : d.x, s.y = S ? u.y : d.y, s.z = w ? u.z : d.z, this.closestPointToPoint(s, i);
|
|
1397
1397
|
const x = s.distanceToSquared(i);
|
|
1398
1398
|
if (x < m && (m = x, o && o.copy(i), l && l.copy(s), x < h))
|
|
1399
1399
|
return Math.sqrt(x);
|
|
1400
1400
|
}
|
|
1401
1401
|
for (let y = 0; y < 12; y++) {
|
|
1402
|
-
const
|
|
1402
|
+
const S = t[y];
|
|
1403
1403
|
for (let w = 0; w < 12; w++) {
|
|
1404
1404
|
const x = e[w];
|
|
1405
|
-
Er(
|
|
1405
|
+
Er(S, x, i, s);
|
|
1406
1406
|
const E = i.distanceToSquared(s);
|
|
1407
1407
|
if (E < m && (m = E, o && o.copy(i), l && l.copy(s), E < h))
|
|
1408
1408
|
return Math.sqrt(E);
|
|
@@ -1487,11 +1487,11 @@ function yn(c, t, e, i, s, n, r) {
|
|
|
1487
1487
|
c.index && (o = d.getX(o), l = d.getX(l), h = d.getX(h));
|
|
1488
1488
|
const { position: f, normal: m, uv: b, uv1: y } = c.attributes;
|
|
1489
1489
|
if (Array.isArray(t)) {
|
|
1490
|
-
const
|
|
1490
|
+
const S = i * 3;
|
|
1491
1491
|
for (let w = 0, x = u.length; w < x; w++) {
|
|
1492
1492
|
const { start: E, count: M, materialIndex: O } = u[w];
|
|
1493
|
-
if (
|
|
1494
|
-
const
|
|
1493
|
+
if (S >= E && S < E + M) {
|
|
1494
|
+
const T = Wr(t[O]), v = Gr(e, f, m, b, y, o, l, h, T, n, r);
|
|
1495
1495
|
if (v)
|
|
1496
1496
|
if (v.faceIndex = i, v.face.materialIndex = O, s)
|
|
1497
1497
|
s.push(v);
|
|
@@ -1500,7 +1500,7 @@ function yn(c, t, e, i, s, n, r) {
|
|
|
1500
1500
|
}
|
|
1501
1501
|
}
|
|
1502
1502
|
} else {
|
|
1503
|
-
const
|
|
1503
|
+
const S = Wr(t), w = Gr(e, f, m, b, y, o, l, h, S, n, r);
|
|
1504
1504
|
if (w)
|
|
1505
1505
|
if (w.faceIndex = i, w.face.materialIndex = 0, s)
|
|
1506
1506
|
s.push(w);
|
|
@@ -1547,44 +1547,44 @@ function Ac(c, t = null) {
|
|
|
1547
1547
|
function d(u, f, m = !1) {
|
|
1548
1548
|
const b = u * 2;
|
|
1549
1549
|
if (he(b, a)) {
|
|
1550
|
-
const y = Ce(u, r),
|
|
1551
|
-
let w = 1 / 0, x = 1 / 0, E = 1 / 0, M = -1 / 0, O = -1 / 0,
|
|
1552
|
-
for (let v = 3 * y,
|
|
1550
|
+
const y = Ce(u, r), S = Pe(b, a);
|
|
1551
|
+
let w = 1 / 0, x = 1 / 0, E = 1 / 0, M = -1 / 0, O = -1 / 0, T = -1 / 0;
|
|
1552
|
+
for (let v = 3 * y, C = 3 * (y + S); v < C; v++) {
|
|
1553
1553
|
let _ = i[v];
|
|
1554
1554
|
const A = s.getX(_), I = s.getY(_), B = s.getZ(_);
|
|
1555
|
-
A < w && (w = A), A > M && (M = A), I < x && (x = I), I > O && (O = I), B < E && (E = B), B >
|
|
1555
|
+
A < w && (w = A), A > M && (M = A), I < x && (x = I), I > O && (O = I), B < E && (E = B), B > T && (T = B);
|
|
1556
1556
|
}
|
|
1557
|
-
return o[u + 0] !== w || o[u + 1] !== x || o[u + 2] !== E || o[u + 3] !== M || o[u + 4] !== O || o[u + 5] !==
|
|
1557
|
+
return o[u + 0] !== w || o[u + 1] !== x || o[u + 2] !== E || o[u + 3] !== M || o[u + 4] !== O || o[u + 5] !== T ? (o[u + 0] = w, o[u + 1] = x, o[u + 2] = E, o[u + 3] = M, o[u + 4] = O, o[u + 5] = T, !0) : !1;
|
|
1558
1558
|
} else {
|
|
1559
|
-
const y = be(u),
|
|
1559
|
+
const y = be(u), S = we(u, r);
|
|
1560
1560
|
let w = m, x = !1, E = !1;
|
|
1561
1561
|
if (t) {
|
|
1562
1562
|
if (!w) {
|
|
1563
|
-
const _ = y / xe + f / _e, A =
|
|
1563
|
+
const _ = y / xe + f / _e, A = S / xe + f / _e;
|
|
1564
1564
|
x = t.has(_), E = t.has(A), w = !x && !E;
|
|
1565
1565
|
}
|
|
1566
1566
|
} else
|
|
1567
1567
|
x = !0, E = !0;
|
|
1568
1568
|
const M = w || x, O = w || E;
|
|
1569
|
-
let
|
|
1570
|
-
M && (
|
|
1569
|
+
let T = !1;
|
|
1570
|
+
M && (T = d(y, f, w));
|
|
1571
1571
|
let v = !1;
|
|
1572
|
-
O && (v = d(
|
|
1573
|
-
const
|
|
1574
|
-
if (
|
|
1572
|
+
O && (v = d(S, f, w));
|
|
1573
|
+
const C = T || v;
|
|
1574
|
+
if (C)
|
|
1575
1575
|
for (let _ = 0; _ < 3; _++) {
|
|
1576
|
-
const A = y + _, I =
|
|
1576
|
+
const A = y + _, I = S + _, B = o[A], k = o[A + 3], D = o[I], R = o[I + 3];
|
|
1577
1577
|
o[u + _] = B < D ? B : D, o[u + _ + 3] = k > R ? k : R;
|
|
1578
1578
|
}
|
|
1579
|
-
return
|
|
1579
|
+
return C;
|
|
1580
1580
|
}
|
|
1581
1581
|
}
|
|
1582
1582
|
}
|
|
1583
1583
|
function Nt(c, t, e, i, s) {
|
|
1584
1584
|
let n, r, a, o, l, h;
|
|
1585
1585
|
const d = 1 / e.direction.x, u = 1 / e.direction.y, f = 1 / e.direction.z, m = e.origin.x, b = e.origin.y, y = e.origin.z;
|
|
1586
|
-
let
|
|
1587
|
-
return d >= 0 ? (n = (
|
|
1586
|
+
let S = t[c], w = t[c + 3], x = t[c + 1], E = t[c + 3 + 1], M = t[c + 2], O = t[c + 3 + 2];
|
|
1587
|
+
return d >= 0 ? (n = (S - m) * d, r = (w - m) * d) : (n = (w - m) * d, r = (S - m) * d), u >= 0 ? (a = (x - b) * u, o = (E - b) * u) : (a = (E - b) * u, o = (x - b) * u), n > o || a > r || ((a > n || isNaN(n)) && (n = a), (o < r || isNaN(r)) && (r = o), f >= 0 ? (l = (M - y) * f, h = (O - y) * f) : (l = (O - y) * f, h = (M - y) * f), n > h || l > r) ? !1 : ((l > n || n !== n) && (n = l), (h < r || r !== r) && (r = h), n <= s && r >= i);
|
|
1588
1588
|
}
|
|
1589
1589
|
function Ic(c, t, e, i, s, n, r, a) {
|
|
1590
1590
|
const { geometry: o, _indirectBuffer: l } = c;
|
|
@@ -1678,10 +1678,10 @@ function mr(c, t, e, i, s = null) {
|
|
|
1678
1678
|
}
|
|
1679
1679
|
});
|
|
1680
1680
|
{
|
|
1681
|
-
const
|
|
1681
|
+
const S = gn(e);
|
|
1682
1682
|
for (let w = b * 3, x = (y + b) * 3; w < x; w += 3) {
|
|
1683
1683
|
fe(mi, w, d, u), mi.a.applyMatrix4(Xi), mi.b.applyMatrix4(Xi), mi.c.applyMatrix4(Xi), mi.needsUpdate = !0;
|
|
1684
|
-
for (let E = 0, M =
|
|
1684
|
+
for (let E = 0, M = S * 3; E < M; E += 3)
|
|
1685
1685
|
if (fe(gi, E, f, m), gi.needsUpdate = !0, mi.intersectsTriangle(gi))
|
|
1686
1686
|
return !0;
|
|
1687
1687
|
}
|
|
@@ -1695,45 +1695,45 @@ const As = /* @__PURE__ */ new ot(), kn = /* @__PURE__ */ new Re(), Zi = /* @__P
|
|
|
1695
1695
|
function Nc(c, t, e, i = {}, s = {}, n = 0, r = 1 / 0) {
|
|
1696
1696
|
t.boundingBox || t.computeBoundingBox(), kn.set(t.boundingBox.min, t.boundingBox.max, e), kn.needsUpdate = !0;
|
|
1697
1697
|
const a = c.geometry, o = a.attributes.position, l = a.index, h = t.attributes.position, d = t.index, u = $e.getPrimitive(), f = $e.getPrimitive();
|
|
1698
|
-
let m = zc, b = Vc, y = null,
|
|
1699
|
-
s && (y = Uc,
|
|
1698
|
+
let m = zc, b = Vc, y = null, S = null;
|
|
1699
|
+
s && (y = Uc, S = jc);
|
|
1700
1700
|
let w = 1 / 0, x = null, E = null;
|
|
1701
1701
|
return As.copy(e).invert(), Zi.matrix.copy(As), c.shapecast(
|
|
1702
1702
|
{
|
|
1703
1703
|
boundsTraverseOrder: (M) => kn.distanceToBox(M),
|
|
1704
|
-
intersectsBounds: (M, O,
|
|
1704
|
+
intersectsBounds: (M, O, T) => T < w && T < r ? (O && (Zi.min.copy(M.min), Zi.max.copy(M.max), Zi.needsUpdate = !0), !0) : !1,
|
|
1705
1705
|
intersectsRange: (M, O) => {
|
|
1706
1706
|
if (t.boundsTree)
|
|
1707
1707
|
return t.boundsTree.shapecast({
|
|
1708
1708
|
boundsTraverseOrder: (v) => Zi.distanceToBox(v),
|
|
1709
|
-
intersectsBounds: (v,
|
|
1710
|
-
intersectsRange: (v,
|
|
1711
|
-
for (let _ = v, A = v +
|
|
1709
|
+
intersectsBounds: (v, C, _) => _ < w && _ < r,
|
|
1710
|
+
intersectsRange: (v, C) => {
|
|
1711
|
+
for (let _ = v, A = v + C; _ < A; _++) {
|
|
1712
1712
|
fe(f, 3 * _, d, h), f.a.applyMatrix4(e), f.b.applyMatrix4(e), f.c.applyMatrix4(e), f.needsUpdate = !0;
|
|
1713
1713
|
for (let I = M, B = M + O; I < B; I++) {
|
|
1714
1714
|
fe(u, 3 * I, l, o), u.needsUpdate = !0;
|
|
1715
1715
|
const k = u.distanceToTriangle(f, m, y);
|
|
1716
|
-
if (k < w && (b.copy(m),
|
|
1716
|
+
if (k < w && (b.copy(m), S && S.copy(y), w = k, x = I, E = _), k < n)
|
|
1717
1717
|
return !0;
|
|
1718
1718
|
}
|
|
1719
1719
|
}
|
|
1720
1720
|
}
|
|
1721
1721
|
});
|
|
1722
1722
|
{
|
|
1723
|
-
const
|
|
1724
|
-
for (let v = 0,
|
|
1723
|
+
const T = gn(t);
|
|
1724
|
+
for (let v = 0, C = T; v < C; v++) {
|
|
1725
1725
|
fe(f, 3 * v, d, h), f.a.applyMatrix4(e), f.b.applyMatrix4(e), f.c.applyMatrix4(e), f.needsUpdate = !0;
|
|
1726
1726
|
for (let _ = M, A = M + O; _ < A; _++) {
|
|
1727
1727
|
fe(u, 3 * _, l, o), u.needsUpdate = !0;
|
|
1728
1728
|
const I = u.distanceToTriangle(f, m, y);
|
|
1729
|
-
if (I < w && (b.copy(m),
|
|
1729
|
+
if (I < w && (b.copy(m), S && S.copy(y), w = I, x = _, E = v), I < n)
|
|
1730
1730
|
return !0;
|
|
1731
1731
|
}
|
|
1732
1732
|
}
|
|
1733
1733
|
}
|
|
1734
1734
|
}
|
|
1735
1735
|
}
|
|
1736
|
-
), $e.releasePrimitive(u), $e.releasePrimitive(f), w === 1 / 0 ? null : (i.point ? i.point.copy(b) : i.point = b.clone(), i.distance = w, i.faceIndex = x, s && (s.point ? s.point.copy(
|
|
1736
|
+
), $e.releasePrimitive(u), $e.releasePrimitive(f), w === 1 / 0 ? null : (i.point ? i.point.copy(b) : i.point = b.clone(), i.distance = w, i.faceIndex = x, s && (s.point ? s.point.copy(S) : s.point = S.clone(), s.point.applyMatrix4(As), b.applyMatrix4(As), s.distance = b.sub(s.point).length(), s.faceIndex = E), i);
|
|
1737
1737
|
}
|
|
1738
1738
|
function Hc(c, t = null) {
|
|
1739
1739
|
t && Array.isArray(t) && (t = new Set(t));
|
|
@@ -1745,40 +1745,40 @@ function Hc(c, t = null) {
|
|
|
1745
1745
|
function d(u, f, m = !1) {
|
|
1746
1746
|
const b = u * 2;
|
|
1747
1747
|
if (he(b, a)) {
|
|
1748
|
-
const y = Ce(u, r),
|
|
1749
|
-
let w = 1 / 0, x = 1 / 0, E = 1 / 0, M = -1 / 0, O = -1 / 0,
|
|
1750
|
-
for (let v = y,
|
|
1748
|
+
const y = Ce(u, r), S = Pe(b, a);
|
|
1749
|
+
let w = 1 / 0, x = 1 / 0, E = 1 / 0, M = -1 / 0, O = -1 / 0, T = -1 / 0;
|
|
1750
|
+
for (let v = y, C = y + S; v < C; v++) {
|
|
1751
1751
|
const _ = 3 * c.resolveTriangleIndex(v);
|
|
1752
1752
|
for (let A = 0; A < 3; A++) {
|
|
1753
1753
|
let I = _ + A;
|
|
1754
1754
|
I = i ? i[I] : I;
|
|
1755
1755
|
const B = s.getX(I), k = s.getY(I), D = s.getZ(I);
|
|
1756
|
-
B < w && (w = B), B > M && (M = B), k < x && (x = k), k > O && (O = k), D < E && (E = D), D >
|
|
1756
|
+
B < w && (w = B), B > M && (M = B), k < x && (x = k), k > O && (O = k), D < E && (E = D), D > T && (T = D);
|
|
1757
1757
|
}
|
|
1758
1758
|
}
|
|
1759
|
-
return o[u + 0] !== w || o[u + 1] !== x || o[u + 2] !== E || o[u + 3] !== M || o[u + 4] !== O || o[u + 5] !==
|
|
1759
|
+
return o[u + 0] !== w || o[u + 1] !== x || o[u + 2] !== E || o[u + 3] !== M || o[u + 4] !== O || o[u + 5] !== T ? (o[u + 0] = w, o[u + 1] = x, o[u + 2] = E, o[u + 3] = M, o[u + 4] = O, o[u + 5] = T, !0) : !1;
|
|
1760
1760
|
} else {
|
|
1761
|
-
const y = be(u),
|
|
1761
|
+
const y = be(u), S = we(u, r);
|
|
1762
1762
|
let w = m, x = !1, E = !1;
|
|
1763
1763
|
if (t) {
|
|
1764
1764
|
if (!w) {
|
|
1765
|
-
const _ = y / xe + f / _e, A =
|
|
1765
|
+
const _ = y / xe + f / _e, A = S / xe + f / _e;
|
|
1766
1766
|
x = t.has(_), E = t.has(A), w = !x && !E;
|
|
1767
1767
|
}
|
|
1768
1768
|
} else
|
|
1769
1769
|
x = !0, E = !0;
|
|
1770
1770
|
const M = w || x, O = w || E;
|
|
1771
|
-
let
|
|
1772
|
-
M && (
|
|
1771
|
+
let T = !1;
|
|
1772
|
+
M && (T = d(y, f, w));
|
|
1773
1773
|
let v = !1;
|
|
1774
|
-
O && (v = d(
|
|
1775
|
-
const
|
|
1776
|
-
if (
|
|
1774
|
+
O && (v = d(S, f, w));
|
|
1775
|
+
const C = T || v;
|
|
1776
|
+
if (C)
|
|
1777
1777
|
for (let _ = 0; _ < 3; _++) {
|
|
1778
|
-
const A = y + _, I =
|
|
1778
|
+
const A = y + _, I = S + _, B = o[A], k = o[A + 3], D = o[I], R = o[I + 3];
|
|
1779
1779
|
o[u + _] = B < D ? B : D, o[u + _ + 3] = k > R ? k : R;
|
|
1780
1780
|
}
|
|
1781
|
-
return
|
|
1781
|
+
return C;
|
|
1782
1782
|
}
|
|
1783
1783
|
}
|
|
1784
1784
|
}
|
|
@@ -1849,11 +1849,11 @@ function xr(c, t, e, i, s = null) {
|
|
|
1849
1849
|
}
|
|
1850
1850
|
});
|
|
1851
1851
|
{
|
|
1852
|
-
const
|
|
1852
|
+
const S = gn(e);
|
|
1853
1853
|
for (let w = b, x = y + b; w < x; w++) {
|
|
1854
1854
|
const E = t.resolveTriangleIndex(w);
|
|
1855
1855
|
fe(yi, 3 * E, d, u), yi.a.applyMatrix4(Ki), yi.b.applyMatrix4(Ki), yi.c.applyMatrix4(Ki), yi.needsUpdate = !0;
|
|
1856
|
-
for (let M = 0, O =
|
|
1856
|
+
for (let M = 0, O = S * 3; M < O; M += 3)
|
|
1857
1857
|
if (fe(xi, M, f, m), xi.needsUpdate = !0, yi.intersectsTriangle(xi))
|
|
1858
1858
|
return !0;
|
|
1859
1859
|
}
|
|
@@ -1867,49 +1867,49 @@ const ks = /* @__PURE__ */ new ot(), Dn = /* @__PURE__ */ new Re(), $i = /* @__P
|
|
|
1867
1867
|
function Jc(c, t, e, i = {}, s = {}, n = 0, r = 1 / 0) {
|
|
1868
1868
|
t.boundingBox || t.computeBoundingBox(), Dn.set(t.boundingBox.min, t.boundingBox.max, e), Dn.needsUpdate = !0;
|
|
1869
1869
|
const a = c.geometry, o = a.attributes.position, l = a.index, h = t.attributes.position, d = t.index, u = $e.getPrimitive(), f = $e.getPrimitive();
|
|
1870
|
-
let m = Xc, b = Zc, y = null,
|
|
1871
|
-
s && (y = Kc,
|
|
1870
|
+
let m = Xc, b = Zc, y = null, S = null;
|
|
1871
|
+
s && (y = Kc, S = $c);
|
|
1872
1872
|
let w = 1 / 0, x = null, E = null;
|
|
1873
1873
|
return ks.copy(e).invert(), $i.matrix.copy(ks), c.shapecast(
|
|
1874
1874
|
{
|
|
1875
1875
|
boundsTraverseOrder: (M) => Dn.distanceToBox(M),
|
|
1876
|
-
intersectsBounds: (M, O,
|
|
1876
|
+
intersectsBounds: (M, O, T) => T < w && T < r ? (O && ($i.min.copy(M.min), $i.max.copy(M.max), $i.needsUpdate = !0), !0) : !1,
|
|
1877
1877
|
intersectsRange: (M, O) => {
|
|
1878
1878
|
if (t.boundsTree) {
|
|
1879
|
-
const
|
|
1880
|
-
return
|
|
1879
|
+
const T = t.boundsTree;
|
|
1880
|
+
return T.shapecast({
|
|
1881
1881
|
boundsTraverseOrder: (v) => $i.distanceToBox(v),
|
|
1882
|
-
intersectsBounds: (v,
|
|
1883
|
-
intersectsRange: (v,
|
|
1884
|
-
for (let _ = v, A = v +
|
|
1885
|
-
const I =
|
|
1882
|
+
intersectsBounds: (v, C, _) => _ < w && _ < r,
|
|
1883
|
+
intersectsRange: (v, C) => {
|
|
1884
|
+
for (let _ = v, A = v + C; _ < A; _++) {
|
|
1885
|
+
const I = T.resolveTriangleIndex(_);
|
|
1886
1886
|
fe(f, 3 * I, d, h), f.a.applyMatrix4(e), f.b.applyMatrix4(e), f.c.applyMatrix4(e), f.needsUpdate = !0;
|
|
1887
1887
|
for (let B = M, k = M + O; B < k; B++) {
|
|
1888
1888
|
const D = c.resolveTriangleIndex(B);
|
|
1889
1889
|
fe(u, 3 * D, l, o), u.needsUpdate = !0;
|
|
1890
1890
|
const R = u.distanceToTriangle(f, m, y);
|
|
1891
|
-
if (R < w && (b.copy(m),
|
|
1891
|
+
if (R < w && (b.copy(m), S && S.copy(y), w = R, x = B, E = _), R < n)
|
|
1892
1892
|
return !0;
|
|
1893
1893
|
}
|
|
1894
1894
|
}
|
|
1895
1895
|
}
|
|
1896
1896
|
});
|
|
1897
1897
|
} else {
|
|
1898
|
-
const
|
|
1899
|
-
for (let v = 0,
|
|
1898
|
+
const T = gn(t);
|
|
1899
|
+
for (let v = 0, C = T; v < C; v++) {
|
|
1900
1900
|
fe(f, 3 * v, d, h), f.a.applyMatrix4(e), f.b.applyMatrix4(e), f.c.applyMatrix4(e), f.needsUpdate = !0;
|
|
1901
1901
|
for (let _ = M, A = M + O; _ < A; _++) {
|
|
1902
1902
|
const I = c.resolveTriangleIndex(_);
|
|
1903
1903
|
fe(u, 3 * I, l, o), u.needsUpdate = !0;
|
|
1904
1904
|
const B = u.distanceToTriangle(f, m, y);
|
|
1905
|
-
if (B < w && (b.copy(m),
|
|
1905
|
+
if (B < w && (b.copy(m), S && S.copy(y), w = B, x = _, E = v), B < n)
|
|
1906
1906
|
return !0;
|
|
1907
1907
|
}
|
|
1908
1908
|
}
|
|
1909
1909
|
}
|
|
1910
1910
|
}
|
|
1911
1911
|
}
|
|
1912
|
-
), $e.releasePrimitive(u), $e.releasePrimitive(f), w === 1 / 0 ? null : (i.point ? i.point.copy(b) : i.point = b.clone(), i.distance = w, i.faceIndex = x, s && (s.point ? s.point.copy(
|
|
1912
|
+
), $e.releasePrimitive(u), $e.releasePrimitive(f), w === 1 / 0 ? null : (i.point ? i.point.copy(b) : i.point = b.clone(), i.distance = w, i.faceIndex = x, s && (s.point ? s.point.copy(S) : s.point = S.clone(), s.point.applyMatrix4(ks), b.applyMatrix4(ks), s.distance = b.sub(s.point).length(), s.faceIndex = E), i);
|
|
1913
1913
|
}
|
|
1914
1914
|
function Xr(c, t, e) {
|
|
1915
1915
|
return c === null ? null : (c.point.applyMatrix4(t.matrixWorld), c.distance = c.point.distanceTo(e.ray.origin), c.object = t, c);
|
|
@@ -1981,8 +1981,8 @@ class ms extends bc {
|
|
|
1981
1981
|
for (let h = 0; h < l.length; h++) {
|
|
1982
1982
|
const d = l[h], u = new Uint32Array(d), f = new Uint16Array(d);
|
|
1983
1983
|
for (let m = 0, b = d.byteLength / _e; m < b; m++) {
|
|
1984
|
-
const y = xe * m,
|
|
1985
|
-
he(
|
|
1984
|
+
const y = xe * m, S = 2 * y;
|
|
1985
|
+
he(S, f) || (u[y + 6] = u[y + 6] / xe - m);
|
|
1986
1986
|
}
|
|
1987
1987
|
}
|
|
1988
1988
|
}
|
|
@@ -2027,10 +2027,10 @@ class ms extends bc {
|
|
|
2027
2027
|
a && (h = a[h], d = a[d], u = a[u]);
|
|
2028
2028
|
for (let f = 0; f < 3; f++) {
|
|
2029
2029
|
const m = r[Ln[f]](h), b = r[Ln[f]](d), y = r[Ln[f]](u);
|
|
2030
|
-
let
|
|
2031
|
-
b <
|
|
2030
|
+
let S = m;
|
|
2031
|
+
b < S && (S = b), y < S && (S = y);
|
|
2032
2032
|
let w = m;
|
|
2033
|
-
b > w && (w = b), y > w && (w = y), e[i + f] =
|
|
2033
|
+
b > w && (w = b), y > w && (w = y), e[i + f] = S, e[i + f + 3] = w;
|
|
2034
2034
|
}
|
|
2035
2035
|
return e;
|
|
2036
2036
|
}
|
|
@@ -2047,16 +2047,16 @@ class ms extends bc {
|
|
|
2047
2047
|
r.isInterleavedBufferAttribute && (d = r.data.stride);
|
|
2048
2048
|
const u = ["getX", "getY", "getZ"], f = i.offset;
|
|
2049
2049
|
for (let m = t, b = t + e; m < b; m++) {
|
|
2050
|
-
const
|
|
2051
|
-
let x =
|
|
2050
|
+
const S = (n ? n[m] : m) * 3, w = (m - f) * 6;
|
|
2051
|
+
let x = S + 0, E = S + 1, M = S + 2;
|
|
2052
2052
|
a && (x = a[x], E = a[E], M = a[M]), o || (x = x * d + h, E = E * d + h, M = M * d + h);
|
|
2053
2053
|
for (let O = 0; O < 3; O++) {
|
|
2054
|
-
let
|
|
2055
|
-
o ? (
|
|
2056
|
-
let _ =
|
|
2057
|
-
v < _ && (_ = v),
|
|
2058
|
-
let A =
|
|
2059
|
-
v > A && (A = v),
|
|
2054
|
+
let T, v, C;
|
|
2055
|
+
o ? (T = r[u[O]](x), v = r[u[O]](E), C = r[u[O]](M)) : (T = l[x + O], v = l[E + O], C = l[M + O]);
|
|
2056
|
+
let _ = T;
|
|
2057
|
+
v < _ && (_ = v), C < _ && (_ = C);
|
|
2058
|
+
let A = T;
|
|
2059
|
+
v > A && (A = v), C > A && (A = C);
|
|
2060
2060
|
const I = (A - _) / 2, B = O * 2;
|
|
2061
2061
|
i[w + B + 0] = _ + I, i[w + B + 1] = I + (Math.abs(_) + I) * en;
|
|
2062
2062
|
}
|
|
@@ -2228,19 +2228,19 @@ class ms extends bc {
|
|
|
2228
2228
|
if (n) {
|
|
2229
2229
|
if (!(t instanceof ms))
|
|
2230
2230
|
throw new Error('MeshBVH: "intersectsTriangles" callback can only be used with another MeshBVH.');
|
|
2231
|
-
const m = (b, y,
|
|
2232
|
-
for (let
|
|
2233
|
-
f(
|
|
2234
|
-
for (let
|
|
2235
|
-
if (l(
|
|
2231
|
+
const m = (b, y, S, w, x, E, M, O) => {
|
|
2232
|
+
for (let T = S, v = S + w; T < v; T++) {
|
|
2233
|
+
f(T), h.a.applyMatrix4(e), h.b.applyMatrix4(e), h.c.applyMatrix4(e), h.needsUpdate = !0;
|
|
2234
|
+
for (let C = b, _ = b + y; C < _; C++)
|
|
2235
|
+
if (l(C), r.needsUpdate = !0, n(r, h, C, T, x, E, M, O))
|
|
2236
2236
|
return !0;
|
|
2237
2237
|
}
|
|
2238
2238
|
return !1;
|
|
2239
2239
|
};
|
|
2240
2240
|
if (s) {
|
|
2241
2241
|
const b = s;
|
|
2242
|
-
s = function(y,
|
|
2243
|
-
return b(y,
|
|
2242
|
+
s = function(y, S, w, x, E, M, O, T) {
|
|
2243
|
+
return b(y, S, w, x, E, M, O, T) ? !0 : m(y, S, w, x, E, M, O, T);
|
|
2244
2244
|
};
|
|
2245
2245
|
} else
|
|
2246
2246
|
s = m;
|
|
@@ -3556,7 +3556,7 @@ class Sh {
|
|
|
3556
3556
|
for (let u = 0, f = e.length; u < f; u += 3) {
|
|
3557
3557
|
const m = u / 3;
|
|
3558
3558
|
for (let b = 0; b < 3; b++) {
|
|
3559
|
-
const y = r[u + b],
|
|
3559
|
+
const y = r[u + b], S = r[u + (b + 1) % 3], w = Math.min(y, S), x = Math.max(y, S), E = w + "," + x;
|
|
3560
3560
|
h[E] === void 0 ? h[E] = {
|
|
3561
3561
|
index1: w,
|
|
3562
3562
|
index2: x,
|
|
@@ -3568,8 +3568,8 @@ class Sh {
|
|
|
3568
3568
|
for (const u in h) {
|
|
3569
3569
|
const f = h[u];
|
|
3570
3570
|
if (f.face2 !== void 0) {
|
|
3571
|
-
const y = a[f.face1].normal,
|
|
3572
|
-
if (y.dot(
|
|
3571
|
+
const y = a[f.face1].normal, S = a[f.face2].normal;
|
|
3572
|
+
if (y.dot(S) > l) continue;
|
|
3573
3573
|
}
|
|
3574
3574
|
const m = n[f.index1], b = n[f.index2];
|
|
3575
3575
|
(!d && m > 65535 || b > 65535) && (d = !0), o.push(m), o.push(b);
|
|
@@ -3586,15 +3586,15 @@ class Sh {
|
|
|
3586
3586
|
const e = t.getAttribute("position");
|
|
3587
3587
|
if (!e || e.count === 0) return console.warn(" no positions in geometry!"), !1;
|
|
3588
3588
|
const i = 4, s = Math.pow(10, i), n = Math.cos(p.MathUtils.DEG2RAD * 20), r = t.getIndex(), a = r ? r.count : e.count, o = [0, 0, 0], l = new Array(3), h = Vn.length, d = [];
|
|
3589
|
-
for (let
|
|
3589
|
+
for (let C = 0; C < e.count; C++)
|
|
3590
3590
|
d.push({
|
|
3591
3591
|
point: new p.Vector3(1, 1, 1),
|
|
3592
3592
|
inited: !1,
|
|
3593
3593
|
barycentricIndex: -1
|
|
3594
3594
|
});
|
|
3595
3595
|
const u = {}, f = {}, m = {}, b = {};
|
|
3596
|
-
for (let
|
|
3597
|
-
r ? (o[0] = r.getX(
|
|
3596
|
+
for (let C = 0; C < a; C += 3) {
|
|
3597
|
+
r ? (o[0] = r.getX(C), o[1] = r.getX(C + 1), o[2] = r.getX(C + 2)) : (o[0] = C, o[1] = C + 1, o[2] = C + 2);
|
|
3598
3598
|
const {
|
|
3599
3599
|
a: _,
|
|
3600
3600
|
b: A,
|
|
@@ -3629,47 +3629,47 @@ class Sh {
|
|
|
3629
3629
|
};
|
|
3630
3630
|
}
|
|
3631
3631
|
}
|
|
3632
|
-
for (const
|
|
3633
|
-
b[
|
|
3634
|
-
const y = [],
|
|
3635
|
-
for (const
|
|
3636
|
-
|
|
3632
|
+
for (const C in b)
|
|
3633
|
+
b[C] && !b[C].find && !b[C].outer && (b[C].outer = !0);
|
|
3634
|
+
const y = [], S = [];
|
|
3635
|
+
for (const C in f)
|
|
3636
|
+
S.push(f[C]);
|
|
3637
3637
|
let w = /* @__PURE__ */ new Set();
|
|
3638
|
-
for (const
|
|
3639
|
-
w.add(
|
|
3638
|
+
for (const C of S[0])
|
|
3639
|
+
w.add(C.a), w.add(C.b), w.add(C.c);
|
|
3640
3640
|
let x = 0;
|
|
3641
|
-
for (
|
|
3642
|
-
let
|
|
3643
|
-
for (let _ = 0; _ <
|
|
3644
|
-
for (const A of
|
|
3641
|
+
for (S.splice(x, 1); ; ) {
|
|
3642
|
+
let C = !1;
|
|
3643
|
+
for (let _ = 0; _ < S.length && !C; _++)
|
|
3644
|
+
for (const A of S[_])
|
|
3645
3645
|
if (w.has(A.a) || w.has(A.b) || w.has(A.c)) {
|
|
3646
|
-
x = _,
|
|
3646
|
+
x = _, C = !0;
|
|
3647
3647
|
break;
|
|
3648
3648
|
}
|
|
3649
|
-
if (
|
|
3650
|
-
for (const _ of
|
|
3649
|
+
if (C) {
|
|
3650
|
+
for (const _ of S[x])
|
|
3651
3651
|
w.add(_.a), w.add(_.b), w.add(_.c);
|
|
3652
|
-
if (
|
|
3652
|
+
if (S.splice(x, 1), x = 0, S.length === 0) {
|
|
3653
3653
|
y.push(w);
|
|
3654
3654
|
break;
|
|
3655
3655
|
}
|
|
3656
|
-
} else if (!
|
|
3657
|
-
if (y.push(w),
|
|
3656
|
+
} else if (!C)
|
|
3657
|
+
if (y.push(w), S.length > 0) {
|
|
3658
3658
|
w = /* @__PURE__ */ new Set();
|
|
3659
|
-
for (const _ of
|
|
3659
|
+
for (const _ of S[x])
|
|
3660
3660
|
w.add(_.a), w.add(_.b), w.add(_.c);
|
|
3661
|
-
|
|
3661
|
+
S.splice(x, 1), x = 0;
|
|
3662
3662
|
} else break;
|
|
3663
3663
|
}
|
|
3664
3664
|
const E = /* @__PURE__ */ new Set();
|
|
3665
|
-
for (let
|
|
3666
|
-
y[
|
|
3665
|
+
for (let C = 0; C < y.length; C++)
|
|
3666
|
+
y[C].forEach((A) => {
|
|
3667
3667
|
E.has(A) ? P.warn("[Edge] " + A + " is already in positionIndexSet!") : E.add(A);
|
|
3668
3668
|
});
|
|
3669
|
-
const M = (
|
|
3669
|
+
const M = (C, _) => {
|
|
3670
3670
|
let A = !1;
|
|
3671
|
-
const I = m[
|
|
3672
|
-
if (!I) return console.warn(
|
|
3671
|
+
const I = m[C];
|
|
3672
|
+
if (!I) return console.warn(C + " is not in positionIndexHash!"), A;
|
|
3673
3673
|
const B = m[_];
|
|
3674
3674
|
if (!B) return console.warn(_ + " is not in positionIndexHash!"), A;
|
|
3675
3675
|
const k = I + "_" + B;
|
|
@@ -3679,23 +3679,23 @@ class Sh {
|
|
|
3679
3679
|
b[D] && (A = b[D].outer);
|
|
3680
3680
|
}
|
|
3681
3681
|
return A;
|
|
3682
|
-
}, O = (
|
|
3682
|
+
}, O = (C, _, A) => {
|
|
3683
3683
|
const I = [];
|
|
3684
|
-
return I.push(M(
|
|
3685
|
-
},
|
|
3686
|
-
if (!u[
|
|
3687
|
-
const A = u[
|
|
3684
|
+
return I.push(M(C, _)), I.push(M(_, A)), I.push(M(A, C)), I.filter((B) => B === !0).length >= 2;
|
|
3685
|
+
}, T = (C, _) => {
|
|
3686
|
+
if (!u[C]) return P.warn("[Edge] " + C + " position isn't used!"), !0;
|
|
3687
|
+
const A = u[C];
|
|
3688
3688
|
for (const B of A) {
|
|
3689
|
-
const k = M(
|
|
3689
|
+
const k = M(C, B), D = d[B];
|
|
3690
3690
|
if (!D.inited) continue;
|
|
3691
3691
|
const R = Ch(_, D.point);
|
|
3692
3692
|
if (k && !R || !k && R) return !1;
|
|
3693
3693
|
}
|
|
3694
|
-
const I = f[
|
|
3694
|
+
const I = f[C];
|
|
3695
3695
|
for (const B of I) {
|
|
3696
3696
|
const k = _;
|
|
3697
3697
|
let D = d[B.b], R = d[B.c];
|
|
3698
|
-
if (B.b ===
|
|
3698
|
+
if (B.b === C ? D = d[B.a] : B.c === C && (R = d[B.a]), O(B.a, B.b, B.c) && (D.inited && k.equals(D.point) || R.inited && k.equals(R.point)))
|
|
3699
3699
|
return !1;
|
|
3700
3700
|
if (!(!D.inited || !R.inited) && (St.addVectors(k, D.point), St.add(R.point), St.x + St.y + St.z < 2))
|
|
3701
3701
|
return !1;
|
|
@@ -3703,14 +3703,14 @@ class Sh {
|
|
|
3703
3703
|
return !0;
|
|
3704
3704
|
};
|
|
3705
3705
|
let v = !1;
|
|
3706
|
-
for (let
|
|
3707
|
-
const _ = Array.from(y[
|
|
3706
|
+
for (let C = 0; C < y.length; C++) {
|
|
3707
|
+
const _ = Array.from(y[C]);
|
|
3708
3708
|
v = !1;
|
|
3709
3709
|
let A = 0, I = 0;
|
|
3710
3710
|
for (; I >= 0; ) {
|
|
3711
3711
|
A = _[I];
|
|
3712
3712
|
let B = d[A].inited ? d[A].barycentricIndex + 1 : 0;
|
|
3713
|
-
for (; B < h && !
|
|
3713
|
+
for (; B < h && !T(A, Vn[B]); B++)
|
|
3714
3714
|
;
|
|
3715
3715
|
if (B < h)
|
|
3716
3716
|
if (d[A].inited = !0, d[A].barycentricIndex = B, d[A].point.copy(Vn[B]), I == _.length - 1) {
|
|
@@ -3725,13 +3725,13 @@ class Sh {
|
|
|
3725
3725
|
}
|
|
3726
3726
|
}
|
|
3727
3727
|
if (v) {
|
|
3728
|
-
const
|
|
3728
|
+
const C = [];
|
|
3729
3729
|
for (let A = 0; A < d.length; A++) {
|
|
3730
3730
|
!d[A].inited && P.warn("[Edge] " + A + " is not initialized !");
|
|
3731
3731
|
let I = 0;
|
|
3732
|
-
I |= d[A].point.x, I |= d[A].point.y << 1, I |= d[A].point.z << 2,
|
|
3732
|
+
I |= d[A].point.x, I |= d[A].point.y << 1, I |= d[A].point.z << 2, C.push(I);
|
|
3733
3733
|
}
|
|
3734
|
-
const _ = new p.Uint8BufferAttribute(
|
|
3734
|
+
const _ = new p.Uint8BufferAttribute(C, 1, !1);
|
|
3735
3735
|
t.setAttribute("barycentric", _);
|
|
3736
3736
|
} else P.warn("[Edge] No suitable barycentric found!");
|
|
3737
3737
|
return v;
|
|
@@ -4307,11 +4307,11 @@ class N {
|
|
|
4307
4307
|
f
|
|
4308
4308
|
), l !== void 0 ? m.push(l) : m.push(u)), s && (m.unshift(h), m.push(u)), n && (m.unshift(d), m.push(f)), n || (r = [h, d], a = [u, f]);
|
|
4309
4309
|
if (m.length < 3) return;
|
|
4310
|
-
const y = p.ShapeUtils.triangulateShape(m, []),
|
|
4310
|
+
const y = p.ShapeUtils.triangulateShape(m, []), S = [];
|
|
4311
4311
|
for (let x = 0; x < y.length; x++)
|
|
4312
|
-
|
|
4312
|
+
S.push(...y[x]);
|
|
4313
4313
|
const w = new p.BufferGeometry().setFromPoints(m);
|
|
4314
|
-
return w.setIndex(
|
|
4314
|
+
return w.setIndex(S), w;
|
|
4315
4315
|
}
|
|
4316
4316
|
static convertWidthLineToMeshGeometry(t, e) {
|
|
4317
4317
|
if (t.length < 2) return;
|
|
@@ -5165,19 +5165,19 @@ const Vs = new p.Matrix4(), Bh = new p.Matrix4(), us = class us {
|
|
|
5165
5165
|
Object.values(s).forEach((h) => {
|
|
5166
5166
|
const d = h.indexes, u = t.children[d[0]];
|
|
5167
5167
|
let f = [], m = 0, b = 0, y = 0;
|
|
5168
|
-
const
|
|
5168
|
+
const S = [];
|
|
5169
5169
|
if (d.forEach((x) => {
|
|
5170
5170
|
const E = t.children[x], M = E.geometry.clone();
|
|
5171
5171
|
if (M.applyMatrix4(E.matrix), N.tryConvertInterleavedBufferAttributes(M), M.userData.isLineSegments = E.isLineSegments === !0, f.push(M), e) {
|
|
5172
|
-
const O = E.name,
|
|
5172
|
+
const O = E.name, T = M.attributes?.position?.count, v = M.index?.count || 0, C = {
|
|
5173
5173
|
batchId: m,
|
|
5174
5174
|
name: O,
|
|
5175
5175
|
positionStart: b,
|
|
5176
|
-
positionCount:
|
|
5176
|
+
positionCount: T,
|
|
5177
5177
|
indexStart: y,
|
|
5178
5178
|
indexCount: v
|
|
5179
5179
|
};
|
|
5180
|
-
Object.keys(E.userData).length !== 0 && (
|
|
5180
|
+
Object.keys(E.userData).length !== 0 && (C.userData = E.userData), S.push(C), b += T, y += v, m++;
|
|
5181
5181
|
}
|
|
5182
5182
|
}), f.length === 0) return;
|
|
5183
5183
|
let w;
|
|
@@ -5186,7 +5186,7 @@ const Vs = new p.Matrix4(), Bh = new p.Matrix4(), us = class us {
|
|
|
5186
5186
|
if (!x) return;
|
|
5187
5187
|
x.userData = {}, w = new p.Mesh(x, u.material), r.push(w);
|
|
5188
5188
|
} else if (u.isLine) {
|
|
5189
|
-
const x = this.mergeLineGeometries(f, e, u.material instanceof p.LineDashedMaterial || u.material instanceof p.ShaderMaterial,
|
|
5189
|
+
const x = this.mergeLineGeometries(f, e, u.material instanceof p.LineDashedMaterial || u.material instanceof p.ShaderMaterial, S);
|
|
5190
5190
|
if (!x) return;
|
|
5191
5191
|
w = new p.LineSegments(x, u.material), a.push(w);
|
|
5192
5192
|
} else if (u.isPoints) {
|
|
@@ -5194,7 +5194,7 @@ const Vs = new p.Matrix4(), Bh = new p.Matrix4(), us = class us {
|
|
|
5194
5194
|
if (!x) return;
|
|
5195
5195
|
x.userData = {}, w = new p.Points(x, u.material), o.push(w);
|
|
5196
5196
|
}
|
|
5197
|
-
w && (e ? w.userData.batches =
|
|
5197
|
+
w && (e ? w.userData.batches = S : (w.userData = u.userData, w.userData.batches = void 0), w.userData.layerName = u.userData.layerName, w.name = "[Merged] " + u.name, w.matrixAutoUpdate = bt, w.renderOrder = u.renderOrder, w.layers.mask = u.layers.mask, w.visible = u.visible, l.push(...d)), f.forEach((x) => {
|
|
5198
5198
|
x.dispose(), N.releaseGeometryManually(x);
|
|
5199
5199
|
}), f = [];
|
|
5200
5200
|
}), l.sort((h, d) => d - h), l.forEach((h) => {
|
|
@@ -5237,8 +5237,8 @@ const Vs = new p.Matrix4(), Bh = new p.Matrix4(), us = class us {
|
|
|
5237
5237
|
let a = Date.now();
|
|
5238
5238
|
const o = {}, l = [];
|
|
5239
5239
|
for (let y = 0; y < t.length; ++y) {
|
|
5240
|
-
const
|
|
5241
|
-
if (
|
|
5240
|
+
const S = t[y];
|
|
5241
|
+
if (S.isInstancedMesh || !S.geometry || !(S.geometry instanceof p.BufferGeometry)) continue;
|
|
5242
5242
|
let w = !1;
|
|
5243
5243
|
const x = Object.values(o);
|
|
5244
5244
|
for (let E = x.length - 1; E >= 0; --E) {
|
|
@@ -5255,13 +5255,13 @@ const Vs = new p.Matrix4(), Bh = new p.Matrix4(), us = class us {
|
|
|
5255
5255
|
P.debug("[Merge] Built merged indexes for " + t.length + " objects in " + (Date.now() - a) / 1e3 + "s"), a = Date.now();
|
|
5256
5256
|
const h = [], d = [], u = [], f = [];
|
|
5257
5257
|
Object.values(o).forEach((y) => {
|
|
5258
|
-
const
|
|
5259
|
-
if (
|
|
5260
|
-
const w = t[
|
|
5258
|
+
const S = y.indexes;
|
|
5259
|
+
if (S.length < 2) return;
|
|
5260
|
+
const w = t[S[0]];
|
|
5261
5261
|
let x = [], E = 0, M = 0, O = 0;
|
|
5262
|
-
const
|
|
5263
|
-
if (
|
|
5264
|
-
const _ = t[
|
|
5262
|
+
const T = [];
|
|
5263
|
+
if (S.forEach((C) => {
|
|
5264
|
+
const _ = t[C], A = _.geometry.clone();
|
|
5265
5265
|
if (w.material instanceof p.LineBasicMaterial && A.deleteAttribute("lineDistance"), this.applyMatrix(A, _, e), A.userData.isLineSegments = _.isLineSegments === !0, x.push(A), n) {
|
|
5266
5266
|
const I = _.name, B = A.attributes?.position?.count, k = A.index?.count || 0;
|
|
5267
5267
|
let D;
|
|
@@ -5275,31 +5275,31 @@ const Vs = new p.Matrix4(), Bh = new p.Matrix4(), us = class us {
|
|
|
5275
5275
|
indexCount: k,
|
|
5276
5276
|
boundingSphere: D
|
|
5277
5277
|
};
|
|
5278
|
-
!_.parent.geometry && Object.keys(_.parent.userData).length !== 0 && (R.parentUserData = _.parent.userData), Object.keys(_.userData).length !== 0 && (R.userData = _.userData),
|
|
5278
|
+
!_.parent.geometry && Object.keys(_.parent.userData).length !== 0 && (R.parentUserData = _.parent.userData), Object.keys(_.userData).length !== 0 && (R.userData = _.userData), T.push(R), M += B, O += k, E++;
|
|
5279
5279
|
}
|
|
5280
5280
|
}), x.length === 0) return;
|
|
5281
5281
|
let v;
|
|
5282
5282
|
if (w.isMesh) {
|
|
5283
|
-
const
|
|
5284
|
-
if (!
|
|
5285
|
-
|
|
5283
|
+
const C = Oe(x);
|
|
5284
|
+
if (!C) return;
|
|
5285
|
+
C.userData = {}, v = new p.Mesh(C, w.material), h.push(v);
|
|
5286
5286
|
} else if (w.isLine) {
|
|
5287
|
-
const
|
|
5288
|
-
if (!
|
|
5289
|
-
v = new p.LineSegments(
|
|
5287
|
+
const C = this.mergeLineGeometries(x, n, w.material instanceof p.LineDashedMaterial || w.material instanceof p.ShaderMaterial, T);
|
|
5288
|
+
if (!C) return;
|
|
5289
|
+
v = new p.LineSegments(C, w.material), d.push(v);
|
|
5290
5290
|
} else if (w.isPoints) {
|
|
5291
|
-
const
|
|
5292
|
-
if (!
|
|
5293
|
-
|
|
5291
|
+
const C = Oe(x);
|
|
5292
|
+
if (!C) return;
|
|
5293
|
+
C.userData = {}, v = new p.Points(C, w.material), u.push(v);
|
|
5294
5294
|
}
|
|
5295
|
-
v && (n ? v.userData.batches =
|
|
5296
|
-
|
|
5295
|
+
v && (n ? v.userData.batches = T : (v.userData = w.userData, v.userData.batches = void 0), v.userData.layerName = w.userData.layerName, v.name = "[Merged] " + w.name, v.matrixAutoUpdate = bt, v.renderOrder = w.renderOrder, v.layers.mask = w.layers.mask, v.visible = w.visible, S.forEach((C) => f.push(C))), x.forEach((C) => {
|
|
5296
|
+
C.dispose(), N.releaseGeometryManually(C);
|
|
5297
5297
|
}), x = [];
|
|
5298
5298
|
}), P.debug("[Merge] Ran deepMerge() in " + (Date.now() - a) / 1e3 + "s");
|
|
5299
5299
|
const m = r.removed;
|
|
5300
5300
|
f.forEach((y) => {
|
|
5301
|
-
const
|
|
5302
|
-
m.push(
|
|
5301
|
+
const S = t[y];
|
|
5302
|
+
m.push(S), i && S.removeFromParent();
|
|
5303
5303
|
});
|
|
5304
5304
|
const b = r.added;
|
|
5305
5305
|
return [...h, ...d, ...u].forEach((y) => {
|
|
@@ -5390,8 +5390,8 @@ const Vs = new p.Matrix4(), Bh = new p.Matrix4(), us = class us {
|
|
|
5390
5390
|
for (let l = 0; l < t.length; ++l) {
|
|
5391
5391
|
const h = e[l], d = t[l], u = h ? 0 : d.count - 2, f = d.count + u, m = d.itemSize, b = new i(f * m);
|
|
5392
5392
|
let y = 0;
|
|
5393
|
-
for (let
|
|
5394
|
-
const w =
|
|
5393
|
+
for (let S = 0; S < d.count; S++) {
|
|
5394
|
+
const w = S * m, x = S !== 0 && S !== d.count - 1 && !h;
|
|
5395
5395
|
for (let E = 0; E < m; E++)
|
|
5396
5396
|
b[y + E] = d.array[w + E], x && (b[y + m + E] = d.array[w + E]);
|
|
5397
5397
|
y += x ? 2 * m : m;
|
|
@@ -5513,8 +5513,8 @@ const Vs = new p.Matrix4(), Bh = new p.Matrix4(), us = class us {
|
|
|
5513
5513
|
if (!n || !r) return P.warn("[Merge]: Unexpected position: " + n + ", or index: " + r + "!"), void 0;
|
|
5514
5514
|
const a = new p.BufferGeometry(), o = e.positionStart, l = e.positionStart + e.positionCount, h = i.attributes;
|
|
5515
5515
|
for (const b in h) {
|
|
5516
|
-
const y = h[b],
|
|
5517
|
-
a.setAttribute(b, new p.BufferAttribute(w,
|
|
5516
|
+
const y = h[b], S = y.itemSize, w = y.array.slice(o * S, l * S);
|
|
5517
|
+
a.setAttribute(b, new p.BufferAttribute(w, S, y.normalized));
|
|
5518
5518
|
}
|
|
5519
5519
|
if (i.boundsTree && (r = i.userData.originalIndex, !r))
|
|
5520
5520
|
return P.warn("[Merge] After building bvh, the original index data is not preserved !"), void 0;
|
|
@@ -15513,18 +15513,18 @@ class Dt {
|
|
|
15513
15513
|
Object.values(s).forEach((h) => {
|
|
15514
15514
|
const d = h.indexes, u = t.children[d[0]];
|
|
15515
15515
|
let f = [], m = 0, b = 0, y = 0;
|
|
15516
|
-
const
|
|
15516
|
+
const S = [];
|
|
15517
15517
|
if (d.forEach((x) => {
|
|
15518
15518
|
const E = t.children[x], M = E.geometry?.clone();
|
|
15519
15519
|
if (M.applyMatrix4(E.matrix), M.userData.isLineSegments = E.type === H.LineSegment, f.push(M), e) {
|
|
15520
|
-
const O = M.attributes?.position?.count,
|
|
15521
|
-
|
|
15520
|
+
const O = M.attributes?.position?.count, T = M.index?.count || 0;
|
|
15521
|
+
S.push({
|
|
15522
15522
|
batchId: m,
|
|
15523
15523
|
positionStart: b,
|
|
15524
15524
|
positionCount: O,
|
|
15525
15525
|
indexStart: y,
|
|
15526
|
-
indexCount:
|
|
15527
|
-
}), b += O, y +=
|
|
15526
|
+
indexCount: T
|
|
15527
|
+
}), b += O, y += T, m++;
|
|
15528
15528
|
}
|
|
15529
15529
|
}), f.length === 0) return;
|
|
15530
15530
|
let w;
|
|
@@ -15533,7 +15533,7 @@ class Dt {
|
|
|
15533
15533
|
if (!x) return;
|
|
15534
15534
|
x.userData = {}, w = new z(u.type), w.geometry = x, w.material = u.material, r.push(w);
|
|
15535
15535
|
} else if (u.type === H.Line || u.type === H.LineSegment) {
|
|
15536
|
-
const x = ye.mergeLineGeometries(f, e, u.material instanceof p.LineDashedMaterial || u.material instanceof p.ShaderMaterial,
|
|
15536
|
+
const x = ye.mergeLineGeometries(f, e, u.material instanceof p.LineDashedMaterial || u.material instanceof p.ShaderMaterial, S);
|
|
15537
15537
|
if (!x) return;
|
|
15538
15538
|
w = new z(H.LineSegment), w.geometry = x, w.material = u.material, a.push(w);
|
|
15539
15539
|
} else if (u.type === H.Point) {
|
|
@@ -15541,7 +15541,7 @@ class Dt {
|
|
|
15541
15541
|
if (!x) return;
|
|
15542
15542
|
x.userData = {}, w = new z(u.type), w.geometry = x, w.material = u.material, o.push(w);
|
|
15543
15543
|
}
|
|
15544
|
-
w && (e ? w.userData.batches =
|
|
15544
|
+
w && (e ? w.userData.batches = S : (w.userData = u.userData, w.userData.batches = void 0), w.userData.layerName = u.userData.layerName, w.name = "[Merged] " + u.name, w.renderOrder = u.renderOrder, w.layers.mask = u.layers.mask, l.push(...d)), f.forEach((x) => {
|
|
15545
15545
|
x.dispose(), N.releaseGeometryManually(x);
|
|
15546
15546
|
}), f = [];
|
|
15547
15547
|
}), l.sort((h, d) => d - h), l.forEach((h) => {
|
|
@@ -15617,13 +15617,13 @@ class Dt {
|
|
|
15617
15617
|
P.debug("[Merge] Built merged indexes for " + t.length + " objects in " + (Date.now() - a) / 1e3 + "s"), a = Date.now();
|
|
15618
15618
|
const h = [], d = [], u = [], f = [];
|
|
15619
15619
|
Object.values(o).forEach((y) => {
|
|
15620
|
-
const
|
|
15621
|
-
if (
|
|
15622
|
-
const w = t[
|
|
15620
|
+
const S = y.indexes;
|
|
15621
|
+
if (S.length < 2) return;
|
|
15622
|
+
const w = t[S[0]];
|
|
15623
15623
|
let x = [], E = 0, M = 0, O = 0;
|
|
15624
|
-
const
|
|
15625
|
-
if (
|
|
15626
|
-
const _ = t[
|
|
15624
|
+
const T = [];
|
|
15625
|
+
if (S.forEach((C) => {
|
|
15626
|
+
const _ = t[C], A = _.geometry?.clone();
|
|
15627
15627
|
if (w.material instanceof p.LineBasicMaterial && A.deleteAttribute("lineDistance"), this.applyMatrix(A, _, e), A.userData.isLineSegments = _.type === H.LineSegment, x.push(A), n) {
|
|
15628
15628
|
const I = A.attributes?.position?.count, B = A.index?.count || 0;
|
|
15629
15629
|
let k;
|
|
@@ -15636,31 +15636,31 @@ class Dt {
|
|
|
15636
15636
|
indexCount: B,
|
|
15637
15637
|
boundingSphere: k
|
|
15638
15638
|
};
|
|
15639
|
-
Object.keys(_.userData).length !== 0 && (D.userData = _.userData),
|
|
15639
|
+
Object.keys(_.userData).length !== 0 && (D.userData = _.userData), T.push(D), M += I, O += B, E++;
|
|
15640
15640
|
}
|
|
15641
15641
|
}), x.length === 0) return;
|
|
15642
15642
|
let v;
|
|
15643
15643
|
if (w.type === H.Mesh) {
|
|
15644
|
-
const
|
|
15645
|
-
if (!
|
|
15646
|
-
|
|
15644
|
+
const C = Oe(x);
|
|
15645
|
+
if (!C) return;
|
|
15646
|
+
C.userData = {}, v = new z(w.type), v.geometry = C, v.material = w.material, h.push(v);
|
|
15647
15647
|
} else if (w.type === H.Line || w.type === H.LineSegment) {
|
|
15648
|
-
const
|
|
15649
|
-
if (!
|
|
15650
|
-
v = new z(H.LineSegment), v.geometry =
|
|
15648
|
+
const C = ye.mergeLineGeometries(x, n, w.material instanceof p.LineDashedMaterial || w.material instanceof p.ShaderMaterial, T);
|
|
15649
|
+
if (!C) return;
|
|
15650
|
+
v = new z(H.LineSegment), v.geometry = C, v.material = w.material, d.push(v);
|
|
15651
15651
|
} else if (w.type === H.Point) {
|
|
15652
|
-
const
|
|
15653
|
-
if (!
|
|
15654
|
-
|
|
15652
|
+
const C = Oe(x);
|
|
15653
|
+
if (!C) return;
|
|
15654
|
+
C.userData = {}, v = new z(w.type), v.geometry = C, v.material = w.material, u.push(v);
|
|
15655
15655
|
}
|
|
15656
|
-
v && (n ? v.userData.batches =
|
|
15657
|
-
|
|
15656
|
+
v && (n ? v.userData.batches = T : (v.userData = w.userData, v.userData.batches = void 0), v.userData.layerName = w.userData.layerName, v.name = "[Merged] " + w.name, v.renderOrder = w.renderOrder, v.layers.mask = w.layers.mask, S.forEach((C) => f.push(C))), x.forEach((C) => {
|
|
15657
|
+
C.dispose(), N.releaseGeometryManually(C);
|
|
15658
15658
|
}), x = [];
|
|
15659
15659
|
}), P.debug("[Merge] Ran deepMerge() in " + (Date.now() - a) / 1e3 + "s");
|
|
15660
15660
|
const m = r.removed;
|
|
15661
15661
|
f.forEach((y) => {
|
|
15662
|
-
const
|
|
15663
|
-
m.push(
|
|
15662
|
+
const S = t[y];
|
|
15663
|
+
m.push(S), i && S.removeFromParent();
|
|
15664
15664
|
});
|
|
15665
15665
|
const b = r.added;
|
|
15666
15666
|
return [...h, ...d, ...u].forEach((y) => {
|
|
@@ -19490,77 +19490,77 @@ class r1 {
|
|
|
19490
19490
|
else if (n.value === "EOF")
|
|
19491
19491
|
P.trace("EOF");
|
|
19492
19492
|
else {
|
|
19493
|
-
const
|
|
19494
|
-
s.unhandledSections[
|
|
19493
|
+
const T = n.value;
|
|
19494
|
+
s.unhandledSections[T] ? s.unhandledSections[T]++ : s.unhandledSections[T] = 1;
|
|
19495
19495
|
}
|
|
19496
19496
|
} else
|
|
19497
19497
|
n = t.next();
|
|
19498
19498
|
s.unhandledSections = {}, s.unhandledEntities = {}, s.unhandledObjects = {}, s.unsupportedLineTypes = {};
|
|
19499
19499
|
}
|
|
19500
19500
|
function a() {
|
|
19501
|
-
let
|
|
19502
|
-
const
|
|
19501
|
+
let T = null, v = null;
|
|
19502
|
+
const C = {};
|
|
19503
19503
|
for (n = t.next(); ; ) {
|
|
19504
19504
|
if (He(n, 0, "ENDSEC")) {
|
|
19505
|
-
|
|
19505
|
+
T && (C[T] = v);
|
|
19506
19506
|
break;
|
|
19507
19507
|
} else
|
|
19508
|
-
n.code === 9 ? (
|
|
19508
|
+
n.code === 9 ? (T && (C[T] = v), T = n.value) : n.code === 10 ? v = { x: n.value } : n.code === 20 ? v.y = n.value : n.code === 30 ? v.z = n.value : v = n.value;
|
|
19509
19509
|
n = t.next();
|
|
19510
19510
|
}
|
|
19511
|
-
return n = t.next(),
|
|
19511
|
+
return n = t.next(), C;
|
|
19512
19512
|
}
|
|
19513
19513
|
function o() {
|
|
19514
|
-
const
|
|
19514
|
+
const T = {};
|
|
19515
19515
|
for (n = t.next(); n.value !== "EOF" && !He(n, 0, "ENDSEC"); )
|
|
19516
19516
|
if (He(n, 0, "BLOCK")) {
|
|
19517
19517
|
P.trace("block {");
|
|
19518
19518
|
const v = l();
|
|
19519
|
-
P.trace("}"), O(v), v.name ?
|
|
19519
|
+
P.trace("}"), O(v), v.name ? T[v.name] = v : console.error("[DxfParser] Block with handle '" + v.handle + "' is missing a name, ignored!");
|
|
19520
19520
|
} else
|
|
19521
19521
|
wt(n), n = t.next();
|
|
19522
|
-
return
|
|
19522
|
+
return T;
|
|
19523
19523
|
}
|
|
19524
19524
|
function l() {
|
|
19525
|
-
const
|
|
19525
|
+
const T = {};
|
|
19526
19526
|
for (n = t.next(); n.value !== "EOF"; ) {
|
|
19527
19527
|
switch (n.code) {
|
|
19528
19528
|
case 1:
|
|
19529
|
-
|
|
19529
|
+
T.xrefPath = n.value, n = t.next();
|
|
19530
19530
|
break;
|
|
19531
19531
|
case 2:
|
|
19532
|
-
|
|
19532
|
+
T.name = n.value, n = t.next();
|
|
19533
19533
|
break;
|
|
19534
19534
|
case 3:
|
|
19535
|
-
|
|
19535
|
+
T.name2 = n.value, n = t.next();
|
|
19536
19536
|
break;
|
|
19537
19537
|
case 4:
|
|
19538
|
-
|
|
19538
|
+
T.description = n.value, n = t.next();
|
|
19539
19539
|
break;
|
|
19540
19540
|
case 5:
|
|
19541
|
-
|
|
19541
|
+
T.handle = n.value, n = t.next();
|
|
19542
19542
|
break;
|
|
19543
19543
|
case 8:
|
|
19544
|
-
|
|
19544
|
+
T.layer = n.value, n = t.next();
|
|
19545
19545
|
break;
|
|
19546
19546
|
case 10:
|
|
19547
|
-
|
|
19547
|
+
T.position = Xe(t), n = t.lastReadGroup;
|
|
19548
19548
|
break;
|
|
19549
19549
|
case 67:
|
|
19550
|
-
|
|
19550
|
+
T.paperSpace = !!(n.value && n.value === 1), n = t.next();
|
|
19551
19551
|
break;
|
|
19552
19552
|
case 70:
|
|
19553
|
-
|
|
19553
|
+
T.blockType = n.value, n = t.next();
|
|
19554
19554
|
break;
|
|
19555
19555
|
case 100:
|
|
19556
19556
|
n = t.next();
|
|
19557
19557
|
break;
|
|
19558
19558
|
case 330:
|
|
19559
|
-
|
|
19559
|
+
T.ownerHandle = n.value, n = t.next();
|
|
19560
19560
|
break;
|
|
19561
19561
|
case 0:
|
|
19562
19562
|
if (n.value === "ENDBLK") break;
|
|
19563
|
-
|
|
19563
|
+
T.entities = E(!0);
|
|
19564
19564
|
break;
|
|
19565
19565
|
default:
|
|
19566
19566
|
wt(n), n = t.next();
|
|
@@ -19571,25 +19571,25 @@ class r1 {
|
|
|
19571
19571
|
break;
|
|
19572
19572
|
}
|
|
19573
19573
|
}
|
|
19574
|
-
return
|
|
19574
|
+
return T;
|
|
19575
19575
|
}
|
|
19576
19576
|
function h() {
|
|
19577
|
-
const
|
|
19577
|
+
const T = {};
|
|
19578
19578
|
for (n = t.next(); n.value !== "EOF" && !He(n, 0, "ENDSEC"); )
|
|
19579
|
-
He(n, 0, "TABLE") ? (n = t.next(), x[n.value] ? (P.trace(n.value + " Table {"),
|
|
19580
|
-
return n = t.next(),
|
|
19579
|
+
He(n, 0, "TABLE") ? (n = t.next(), x[n.value] ? (P.trace(n.value + " Table {"), T[x[n.value].tableName] = u(n), P.trace("}")) : P.trace("Unhandled Table " + n.value)) : n = t.next();
|
|
19580
|
+
return n = t.next(), T;
|
|
19581
19581
|
}
|
|
19582
19582
|
const d = "ENDTAB";
|
|
19583
|
-
function u(
|
|
19584
|
-
const v = x[
|
|
19583
|
+
function u(T) {
|
|
19584
|
+
const v = x[T.value], C = {};
|
|
19585
19585
|
let _ = 0;
|
|
19586
19586
|
for (n = t.next(); !He(n, 0, d); )
|
|
19587
19587
|
switch (n.code) {
|
|
19588
19588
|
case 5:
|
|
19589
|
-
|
|
19589
|
+
C.handle = n.value, n = t.next();
|
|
19590
19590
|
break;
|
|
19591
19591
|
case 330:
|
|
19592
|
-
|
|
19592
|
+
C.ownerHandle = n.value, n = t.next();
|
|
19593
19593
|
break;
|
|
19594
19594
|
case 100:
|
|
19595
19595
|
n.value === "AcDbSymbolTable" || wt(n), n = t.next();
|
|
@@ -19598,13 +19598,13 @@ class r1 {
|
|
|
19598
19598
|
_ = n.value, n = t.next();
|
|
19599
19599
|
break;
|
|
19600
19600
|
case 0:
|
|
19601
|
-
n.value === v.dxfSymbolName ?
|
|
19601
|
+
n.value === v.dxfSymbolName ? C[v.tableRecordsProperty] = v.parseTableRecords() : (wt(n), n = t.next());
|
|
19602
19602
|
break;
|
|
19603
19603
|
default:
|
|
19604
19604
|
wt(n), n = t.next();
|
|
19605
19605
|
break;
|
|
19606
19606
|
}
|
|
19607
|
-
const A =
|
|
19607
|
+
const A = C[v.tableRecordsProperty];
|
|
19608
19608
|
if (A) {
|
|
19609
19609
|
const I = (() => {
|
|
19610
19610
|
if (A.constructor === Array) return A.length;
|
|
@@ -19612,10 +19612,10 @@ class r1 {
|
|
|
19612
19612
|
})();
|
|
19613
19613
|
_ !== I && console.warn("[DxfParser] Parsed " + I + " " + v.dxfSymbolName + "s but expected " + _);
|
|
19614
19614
|
}
|
|
19615
|
-
return n = t.next(),
|
|
19615
|
+
return n = t.next(), C;
|
|
19616
19616
|
}
|
|
19617
19617
|
function f() {
|
|
19618
|
-
const
|
|
19618
|
+
const T = [];
|
|
19619
19619
|
let v = {};
|
|
19620
19620
|
for (P.trace("Viewport {"), n = t.next(); !He(n, 0, d); )
|
|
19621
19621
|
switch (n.code) {
|
|
@@ -19700,17 +19700,17 @@ class r1 {
|
|
|
19700
19700
|
v.ambientColor = n.value, n = t.next();
|
|
19701
19701
|
break;
|
|
19702
19702
|
case 0:
|
|
19703
|
-
n.value === "VPORT" && (P.trace("}"),
|
|
19703
|
+
n.value === "VPORT" && (P.trace("}"), T.push(v), P.trace("Viewport {"), v = {}, n = t.next());
|
|
19704
19704
|
break;
|
|
19705
19705
|
default:
|
|
19706
19706
|
wt(n), n = t.next();
|
|
19707
19707
|
break;
|
|
19708
19708
|
}
|
|
19709
|
-
return P.trace("}"),
|
|
19709
|
+
return P.trace("}"), T.push(v), T;
|
|
19710
19710
|
}
|
|
19711
19711
|
function m() {
|
|
19712
|
-
const
|
|
19713
|
-
let v = {},
|
|
19712
|
+
const T = {};
|
|
19713
|
+
let v = {}, C = 0, _ = "", A = !1;
|
|
19714
19714
|
for (P.trace("LType {"), n = t.next(); !He(n, 0, "ENDTAB"); )
|
|
19715
19715
|
switch (n.code) {
|
|
19716
19716
|
case 2:
|
|
@@ -19742,7 +19742,7 @@ class r1 {
|
|
|
19742
19742
|
n = t.next();
|
|
19743
19743
|
break;
|
|
19744
19744
|
case 73:
|
|
19745
|
-
|
|
19745
|
+
C = n.value, C > 0 && (v.pattern = []), n = t.next();
|
|
19746
19746
|
break;
|
|
19747
19747
|
case 74:
|
|
19748
19748
|
n.value !== 0 && (A = !0, s.unsupportedLineTypes[v.name] ? s.unsupportedLineTypes[v.name]++ : s.unsupportedLineTypes[v.name] = 1), n = t.next();
|
|
@@ -19751,21 +19751,21 @@ class r1 {
|
|
|
19751
19751
|
n = t.next();
|
|
19752
19752
|
break;
|
|
19753
19753
|
case 0:
|
|
19754
|
-
P.trace("}"),
|
|
19754
|
+
P.trace("}"), C > 0 && C !== v.pattern.length && console.warn("[DxfParser] lengths do not match on LTYPE pattern"), T[_] = v, v = {}, P.trace("LType {"), n = t.next();
|
|
19755
19755
|
break;
|
|
19756
19756
|
default:
|
|
19757
19757
|
n = t.next();
|
|
19758
19758
|
break;
|
|
19759
19759
|
}
|
|
19760
|
-
return P.trace("}"),
|
|
19760
|
+
return P.trace("}"), T[_] = v, T;
|
|
19761
19761
|
}
|
|
19762
19762
|
function b() {
|
|
19763
|
-
const
|
|
19764
|
-
let v = {},
|
|
19763
|
+
const T = {};
|
|
19764
|
+
let v = {}, C;
|
|
19765
19765
|
for (P.trace("Layer {"), n = t.next(); !He(n, 0, "ENDTAB"); )
|
|
19766
19766
|
switch (n.code) {
|
|
19767
19767
|
case 2:
|
|
19768
|
-
v.name = n.value,
|
|
19768
|
+
v.name = n.value, C = n.value, n = t.next();
|
|
19769
19769
|
break;
|
|
19770
19770
|
case 5:
|
|
19771
19771
|
v.handle = n.value, n = t.next();
|
|
@@ -19786,21 +19786,21 @@ class r1 {
|
|
|
19786
19786
|
v.lineweight = n.value, n = t.next();
|
|
19787
19787
|
break;
|
|
19788
19788
|
case 0:
|
|
19789
|
-
n.value === "LAYER" && (P.trace("}"),
|
|
19789
|
+
n.value === "LAYER" && (P.trace("}"), C && (T[C] = v), P.trace("Layer {"), v = {}, C = void 0, n = t.next());
|
|
19790
19790
|
break;
|
|
19791
19791
|
default:
|
|
19792
19792
|
wt(n), n = t.next();
|
|
19793
19793
|
break;
|
|
19794
19794
|
}
|
|
19795
|
-
return P.trace("}"),
|
|
19795
|
+
return P.trace("}"), C && (T[C] = v), T;
|
|
19796
19796
|
}
|
|
19797
19797
|
function y() {
|
|
19798
|
-
const
|
|
19799
|
-
let v = {},
|
|
19798
|
+
const T = {};
|
|
19799
|
+
let v = {}, C;
|
|
19800
19800
|
for (P.trace("Style {"), n = t.next(); !He(n, 0, "ENDTAB"); )
|
|
19801
19801
|
switch (n.code) {
|
|
19802
19802
|
case 2:
|
|
19803
|
-
v.styleName = n.value,
|
|
19803
|
+
v.styleName = n.value, C = n.value, n = t.next();
|
|
19804
19804
|
break;
|
|
19805
19805
|
case 3:
|
|
19806
19806
|
v.fontFile = n.value, n = t.next();
|
|
@@ -19833,21 +19833,21 @@ class r1 {
|
|
|
19833
19833
|
v.ownerHandle = n.value, n = t.next();
|
|
19834
19834
|
break;
|
|
19835
19835
|
case 0:
|
|
19836
|
-
n.value === "STYLE" && (P.trace("}"),
|
|
19836
|
+
n.value === "STYLE" && (P.trace("}"), C && (T[C] = v), P.trace("Style {"), v = {}, C = void 0, n = t.next());
|
|
19837
19837
|
break;
|
|
19838
19838
|
default:
|
|
19839
19839
|
n = t.next();
|
|
19840
19840
|
break;
|
|
19841
19841
|
}
|
|
19842
|
-
return P.trace("}"),
|
|
19842
|
+
return P.trace("}"), C && (T[C] = v), T;
|
|
19843
19843
|
}
|
|
19844
|
-
function
|
|
19845
|
-
const
|
|
19846
|
-
let v = {},
|
|
19844
|
+
function S() {
|
|
19845
|
+
const T = {};
|
|
19846
|
+
let v = {}, C;
|
|
19847
19847
|
for (P.trace("DimStyle {"), n = t.next(); !He(n, 0, "ENDTAB"); )
|
|
19848
19848
|
switch (n.code) {
|
|
19849
19849
|
case 2:
|
|
19850
|
-
v.styleName = n.value,
|
|
19850
|
+
v.styleName = n.value, C = n.value, n = t.next();
|
|
19851
19851
|
break;
|
|
19852
19852
|
case 40:
|
|
19853
19853
|
v.DIMSCALE = n.value, n = t.next();
|
|
@@ -19895,17 +19895,17 @@ class r1 {
|
|
|
19895
19895
|
n = t.next();
|
|
19896
19896
|
break;
|
|
19897
19897
|
case 0:
|
|
19898
|
-
n.value === "DIMSTYLE" && (P.trace("}"),
|
|
19898
|
+
n.value === "DIMSTYLE" && (P.trace("}"), C && (T[C] = v), P.trace("DimStyle {"), v = {}, C = void 0, n = t.next());
|
|
19899
19899
|
break;
|
|
19900
19900
|
default:
|
|
19901
19901
|
n = t.next();
|
|
19902
19902
|
break;
|
|
19903
19903
|
}
|
|
19904
|
-
return P.trace("}"),
|
|
19904
|
+
return P.trace("}"), C && (T[C] = v), T;
|
|
19905
19905
|
}
|
|
19906
19906
|
function w() {
|
|
19907
|
-
const
|
|
19908
|
-
let v = {},
|
|
19907
|
+
const T = {};
|
|
19908
|
+
let v = {}, C;
|
|
19909
19909
|
for (P.trace("BlockRecord {"), n = t.next(); !He(n, 0, "ENDTAB"); )
|
|
19910
19910
|
switch (n.code) {
|
|
19911
19911
|
case 5:
|
|
@@ -19915,7 +19915,7 @@ class r1 {
|
|
|
19915
19915
|
v.ownerHandle = n.value, n = t.next();
|
|
19916
19916
|
break;
|
|
19917
19917
|
case 2:
|
|
19918
|
-
v.blockName = n.value,
|
|
19918
|
+
v.blockName = n.value, C = v.blockName, n = t.next();
|
|
19919
19919
|
break;
|
|
19920
19920
|
case 340:
|
|
19921
19921
|
v.layoutHandle = n.value, n = t.next();
|
|
@@ -19934,9 +19934,9 @@ class r1 {
|
|
|
19934
19934
|
break;
|
|
19935
19935
|
case 0:
|
|
19936
19936
|
if (n.value === "BLOCK_RECORD") {
|
|
19937
|
-
P.trace("}"),
|
|
19937
|
+
P.trace("}"), C && (T[C] = v);
|
|
19938
19938
|
const A = v.layoutHandle;
|
|
19939
|
-
|
|
19939
|
+
C && A && A.length > 0 && A !== "0" && (s._layoutBlocks[A] = v), P.trace("BlockRecord {"), v = {}, C = void 0, n = t.next();
|
|
19940
19940
|
} else
|
|
19941
19941
|
wt(n), n = t.next();
|
|
19942
19942
|
break;
|
|
@@ -19944,9 +19944,9 @@ class r1 {
|
|
|
19944
19944
|
wt(n), n = t.next();
|
|
19945
19945
|
break;
|
|
19946
19946
|
}
|
|
19947
|
-
P.trace("}"),
|
|
19947
|
+
P.trace("}"), C && (T[C] = v);
|
|
19948
19948
|
const _ = v.layoutHandle;
|
|
19949
|
-
return
|
|
19949
|
+
return C && _ && _.length > 0 && _ !== "0" && (s._layoutBlocks[_] = v), T;
|
|
19950
19950
|
}
|
|
19951
19951
|
const x = {
|
|
19952
19952
|
VPORT: {
|
|
@@ -19983,14 +19983,14 @@ class r1 {
|
|
|
19983
19983
|
tableRecordsProperty: "dimStyles",
|
|
19984
19984
|
tableName: "dimStyle",
|
|
19985
19985
|
dxfSymbolName: "DIMSTYLE",
|
|
19986
|
-
parseTableRecords:
|
|
19986
|
+
parseTableRecords: S
|
|
19987
19987
|
}
|
|
19988
19988
|
};
|
|
19989
|
-
function E(
|
|
19990
|
-
const v = [],
|
|
19991
|
-
for (
|
|
19989
|
+
function E(T) {
|
|
19990
|
+
const v = [], C = T ? "ENDBLK" : "ENDSEC";
|
|
19991
|
+
for (T || (n = t.next()); ; )
|
|
19992
19992
|
if (n.code === 0) {
|
|
19993
|
-
if (n.value ===
|
|
19993
|
+
if (n.value === C) break;
|
|
19994
19994
|
const _ = s._entityHandlers[n.value];
|
|
19995
19995
|
if (_ != null) {
|
|
19996
19996
|
P.trace(n.value + " {");
|
|
@@ -20003,18 +20003,18 @@ class r1 {
|
|
|
20003
20003
|
}
|
|
20004
20004
|
} else
|
|
20005
20005
|
n = t.next();
|
|
20006
|
-
return
|
|
20006
|
+
return C === "ENDSEC" && (n = t.next()), v;
|
|
20007
20007
|
}
|
|
20008
20008
|
function M() {
|
|
20009
|
-
const
|
|
20009
|
+
const T = {}, v = "ENDSEC";
|
|
20010
20010
|
for (n = t.next(); n.value !== "EOF"; )
|
|
20011
20011
|
if (n.code === 0) {
|
|
20012
20012
|
if (n.value === v) break;
|
|
20013
|
-
const
|
|
20014
|
-
if (
|
|
20013
|
+
const C = s._objectHandlers[n.value];
|
|
20014
|
+
if (C != null) {
|
|
20015
20015
|
P.trace(n.value + " {");
|
|
20016
|
-
const _ =
|
|
20017
|
-
n = t.lastReadGroup, P.trace("}"), O(_),
|
|
20016
|
+
const _ = C.parseObject(t, n), A = n.value;
|
|
20017
|
+
n = t.lastReadGroup, P.trace("}"), O(_), T[A] || (T[A] = []), T[A].push(_);
|
|
20018
20018
|
} else {
|
|
20019
20019
|
const _ = n.value;
|
|
20020
20020
|
s.unhandledObjects[_] || (s.unhandledObjects[_] = 0), s.unhandledObjects[_]++, n = t.next();
|
|
@@ -20022,13 +20022,13 @@ class r1 {
|
|
|
20022
20022
|
}
|
|
20023
20023
|
} else
|
|
20024
20024
|
n = t.next();
|
|
20025
|
-
return n = t.next(),
|
|
20026
|
-
s._layoutBlocks[
|
|
20027
|
-
}),
|
|
20025
|
+
return n = t.next(), T.LAYOUT && (Object.keys(s._layoutBlocks).length !== T.LAYOUT.length && console.warn("[DxfParser] The number of layout and block associations does not match!"), T.LAYOUT.forEach((C) => {
|
|
20026
|
+
s._layoutBlocks[C.handle] && (C.associatedBlockName = s._layoutBlocks[C.handle].blockName);
|
|
20027
|
+
}), T.LAYOUT.sort((C, _) => C.tabOrder - _.tabOrder)), T;
|
|
20028
20028
|
}
|
|
20029
|
-
function O(
|
|
20030
|
-
if (!
|
|
20031
|
-
|
|
20029
|
+
function O(T) {
|
|
20030
|
+
if (!T) throw new TypeError("entity cannot be undefined or null");
|
|
20031
|
+
T.handle || (T.handle = (i++).toString());
|
|
20032
20032
|
}
|
|
20033
20033
|
return r(), e;
|
|
20034
20034
|
}
|
|
@@ -20675,16 +20675,16 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
20675
20675
|
this.addViewport(E, h);
|
|
20676
20676
|
const M = this.loadEntity(E, e);
|
|
20677
20677
|
if (!M && await a(x), !M) continue;
|
|
20678
|
-
const O = this.getLayout(e, E),
|
|
20679
|
-
let v = u.children.find((
|
|
20680
|
-
if (!v && (v = new z(), v.name =
|
|
20681
|
-
|
|
20678
|
+
const O = this.getLayout(e, E), T = O.layoutName;
|
|
20679
|
+
let v = u.children.find((C) => C.name === T);
|
|
20680
|
+
if (!v && (v = new z(), v.name = T, v.userData.isLayoutLevelObject = !0, u.add(v)), M.traverse((C) => {
|
|
20681
|
+
C.userData.isSnapObject && (!this.layoutsSnapObjectsMap[T] && (this.layoutsSnapObjectsMap[T] = []), this.layoutsSnapObjectsMap[T].push(C));
|
|
20682
20682
|
}), this.enableMerge) {
|
|
20683
|
-
Dt.merge(M, !1), !d[
|
|
20683
|
+
Dt.merge(M, !1), !d[T] && (d[T] = {
|
|
20684
20684
|
object: v,
|
|
20685
20685
|
layerObjects: {}
|
|
20686
20686
|
});
|
|
20687
|
-
const _ = d[
|
|
20687
|
+
const _ = d[T];
|
|
20688
20688
|
if (M.geometry) {
|
|
20689
20689
|
const A = M.userData.layerName;
|
|
20690
20690
|
!_.layerObjects[A] && (_.layerObjects[A] = []), _.layerObjects[A].push(M), M.children.forEach((I) => {
|
|
@@ -20694,24 +20694,24 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
20694
20694
|
A.geometry && l(A);
|
|
20695
20695
|
}));
|
|
20696
20696
|
} else
|
|
20697
|
-
v.add(M), M.traverse((
|
|
20698
|
-
|
|
20697
|
+
v.add(M), M.traverse((C) => {
|
|
20698
|
+
C.geometry && l(C);
|
|
20699
20699
|
});
|
|
20700
20700
|
n++, await a(x);
|
|
20701
20701
|
}
|
|
20702
20702
|
e.objects.LAYOUT.forEach((x) => {
|
|
20703
20703
|
const E = x, M = E.layoutName;
|
|
20704
20704
|
if (this.ignorePaperSpace && M !== j.MODEL_LAYOUT_NAME) return;
|
|
20705
|
-
const O = E.associatedBlockName,
|
|
20706
|
-
|
|
20705
|
+
const O = E.associatedBlockName, T = e.blocks[O];
|
|
20706
|
+
T && this.loadLayout(T, e, E, u, o, h);
|
|
20707
20707
|
}), P.debug("[Dxf] Drew entities in " + (Date.now() - s) / 1e3 + "s");
|
|
20708
20708
|
for (const x in this.layoutsSnapObjectsMap) {
|
|
20709
|
-
const E = u.children.find((
|
|
20709
|
+
const E = u.children.find((T) => T.name === x), M = new z();
|
|
20710
20710
|
M.name = j.SNAP_GROUP_NAME, M.userData.isSnapGroup = !0, E.add(M);
|
|
20711
20711
|
const O = this.layoutsSnapObjectsMap[x];
|
|
20712
|
-
for (let
|
|
20713
|
-
const v = O[
|
|
20714
|
-
this.getLayerVisible(e,
|
|
20712
|
+
for (let T = 0; T < O.length; T++) {
|
|
20713
|
+
const v = O[T], C = v.userData.layerName;
|
|
20714
|
+
this.getLayerVisible(e, C) === !1 && v.layers.disable(qe), j.SHOW_SNAP_OBJECT && (v.layers.enableAll(), v.material instanceof p.PointsMaterial ? v.material = Da : v.material instanceof p.LineBasicMaterial ? v.material = La : v.material instanceof p.MeshBasicMaterial && (v.material = Ra));
|
|
20715
20715
|
let _ = v;
|
|
20716
20716
|
const A = de.identity();
|
|
20717
20717
|
for (; _ && _.userData.isLayoutLevelObject !== !0; )
|
|
@@ -20723,18 +20723,18 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
20723
20723
|
for (const x in d) {
|
|
20724
20724
|
const E = d[x], M = E.object;
|
|
20725
20725
|
for (const O in E.layerObjects) {
|
|
20726
|
-
const
|
|
20727
|
-
if (_.length !==
|
|
20726
|
+
const T = E.layerObjects[O], v = Dt.deepMerge(T, void 0, !1, !1, !0), C = v.added, _ = v.removed;
|
|
20727
|
+
if (_.length !== T.length) {
|
|
20728
20728
|
let A = _;
|
|
20729
20729
|
_.length >= 100 && (A = new Set(_));
|
|
20730
20730
|
const I = (B) => Array.isArray(A) ? A.indexOf(B) >= 0 : A.has(B);
|
|
20731
|
-
for (let B = 0, k =
|
|
20732
|
-
const D =
|
|
20731
|
+
for (let B = 0, k = T.length; B < k; B++) {
|
|
20732
|
+
const D = T[B];
|
|
20733
20733
|
!I(D) && (M.add(D), l(D));
|
|
20734
20734
|
}
|
|
20735
20735
|
}
|
|
20736
|
-
for (let A = 0; A <
|
|
20737
|
-
const I =
|
|
20736
|
+
for (let A = 0; A < C.length; A++) {
|
|
20737
|
+
const I = C[A];
|
|
20738
20738
|
M.add(I), l(I);
|
|
20739
20739
|
}
|
|
20740
20740
|
E.layerObjects[O] = [];
|
|
@@ -20752,7 +20752,7 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
20752
20752
|
const E = x;
|
|
20753
20753
|
b[E.layoutName] = E;
|
|
20754
20754
|
});
|
|
20755
|
-
const y = {},
|
|
20755
|
+
const y = {}, S = (x) => {
|
|
20756
20756
|
const E = x.userData.layerName;
|
|
20757
20757
|
let M = y[E];
|
|
20758
20758
|
!M && (M = [], y[E] = M), M.push(x);
|
|
@@ -20767,8 +20767,8 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
20767
20767
|
}
|
|
20768
20768
|
x.traverse((O) => {
|
|
20769
20769
|
if (Q.setSharedVariablesOfObject(O), O.userData.isSnapGroup && (O.visible = j.SHOW_SNAP_OBJECT), O.geometry) {
|
|
20770
|
-
const
|
|
20771
|
-
this.getLayerVisible(e,
|
|
20770
|
+
const T = O.userData.layerName;
|
|
20771
|
+
this.getLayerVisible(e, T) === !1 && (O.visible = !1, O.userData.layerVisible = !1), S(O), M && M.add(O);
|
|
20772
20772
|
}
|
|
20773
20773
|
});
|
|
20774
20774
|
}), P.info("[Dxf] loadEntities() done in " + (Date.now() - s) / 1e3 + "s");
|
|
@@ -20783,19 +20783,19 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
20783
20783
|
for (let M = 0; M < x.length; M++) {
|
|
20784
20784
|
const O = x[M];
|
|
20785
20785
|
if (O?.userData?.llbData) {
|
|
20786
|
-
const
|
|
20787
|
-
|
|
20788
|
-
const v =
|
|
20789
|
-
E.push({ ...O, boundingBox: { max:
|
|
20790
|
-
} else if (O.children && O.children.some((
|
|
20791
|
-
for (let
|
|
20792
|
-
const v = O.children[
|
|
20786
|
+
const T = new p.Box3().setFromObject(O);
|
|
20787
|
+
T.getSize(new p.Vector3());
|
|
20788
|
+
const v = T.getCenter(new p.Vector3());
|
|
20789
|
+
E.push({ ...O, boundingBox: { max: T.max, min: T.min, center: v } });
|
|
20790
|
+
} else if (O.children && O.children.some((T) => T.userData?.llbData))
|
|
20791
|
+
for (let T = 0; T < O.children.length; T++) {
|
|
20792
|
+
const v = O.children[T];
|
|
20793
20793
|
if (v.userData?.llbData) {
|
|
20794
20794
|
v.updateWorldMatrix(!0, !0);
|
|
20795
|
-
const
|
|
20796
|
-
|
|
20797
|
-
const _ =
|
|
20798
|
-
E.push({ ...v, boundingBox: { max:
|
|
20795
|
+
const C = new p.Box3().setFromObject(v);
|
|
20796
|
+
C.getSize(new p.Vector3());
|
|
20797
|
+
const _ = C.getCenter(new p.Vector3());
|
|
20798
|
+
E.push({ ...v, boundingBox: { max: C.max, min: C.min, center: _ } });
|
|
20799
20799
|
}
|
|
20800
20800
|
}
|
|
20801
20801
|
}
|
|
@@ -20823,28 +20823,28 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
20823
20823
|
this.entityCount += f.blocks[v].entities?.length || 0;
|
|
20824
20824
|
});
|
|
20825
20825
|
const y = Math.round(Math.pow(b, 0.5));
|
|
20826
|
-
let
|
|
20826
|
+
let S = Date.now();
|
|
20827
20827
|
const w = async (v) => {
|
|
20828
20828
|
if (r && (v % y === 0 || v === b - 1)) {
|
|
20829
|
-
let
|
|
20830
|
-
!u && (
|
|
20831
|
-
loaded:
|
|
20829
|
+
let C = v + 1;
|
|
20830
|
+
!u && (C += a), r(new ProgressEvent("parseProgress", {
|
|
20831
|
+
loaded: C,
|
|
20832
20832
|
total: a + o
|
|
20833
20833
|
}));
|
|
20834
20834
|
const _ = 500, A = Date.now();
|
|
20835
|
-
(A -
|
|
20835
|
+
(A - S > _ || v === b - 1) && (await V.sleep(0), S = A);
|
|
20836
20836
|
}
|
|
20837
20837
|
};
|
|
20838
20838
|
this.parseHeader(f.header);
|
|
20839
20839
|
let x = {};
|
|
20840
20840
|
for (let v = 0; v < b; v++) {
|
|
20841
20841
|
if (this.aborted) return;
|
|
20842
|
-
const
|
|
20842
|
+
const C = f.entities[v], _ = this.getLayout(f, C);
|
|
20843
20843
|
if (_.layoutName !== j.MODEL_LAYOUT_NAME) {
|
|
20844
20844
|
await w(v);
|
|
20845
20845
|
continue;
|
|
20846
20846
|
}
|
|
20847
|
-
const A = this.loadEntity(
|
|
20847
|
+
const A = this.loadEntity(C, f);
|
|
20848
20848
|
if (!A) {
|
|
20849
20849
|
await w(v);
|
|
20850
20850
|
continue;
|
|
@@ -20861,10 +20861,10 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
20861
20861
|
}
|
|
20862
20862
|
n && u && !d.preservedHandles && (d.preservedHandles = /* @__PURE__ */ new Set());
|
|
20863
20863
|
for (const v in s) {
|
|
20864
|
-
const
|
|
20865
|
-
u && (
|
|
20866
|
-
let _ = this.entityThreejsCache && this.entityThreejsCache[
|
|
20867
|
-
if (
|
|
20864
|
+
const C = s[v];
|
|
20865
|
+
u && (C.type === We.Added || C.type === We.Modified) && (d.preservedHandles?.add(C.handle), C.parentHandles && C.parentHandles.forEach((A) => d.preservedHandles?.add(A)));
|
|
20866
|
+
let _ = this.entityThreejsCache && this.entityThreejsCache[C.handle];
|
|
20867
|
+
if (C.parentHandles && (_ = this.entityThreejsCache && this.entityThreejsCache[C.parentHandles[C.parentHandles.length - 1]]), _) {
|
|
20868
20868
|
if (_.parent && _.parent.userData.originalType) {
|
|
20869
20869
|
this.setObjectColorByChange(
|
|
20870
20870
|
_,
|
|
@@ -20875,21 +20875,21 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
20875
20875
|
);
|
|
20876
20876
|
continue;
|
|
20877
20877
|
}
|
|
20878
|
-
_ = this.setObjectColorByChange(_,
|
|
20878
|
+
_ = this.setObjectColorByChange(_, C);
|
|
20879
20879
|
}
|
|
20880
|
-
if (
|
|
20880
|
+
if (C.type !== We.NoChange && _) {
|
|
20881
20881
|
let A = _.parent;
|
|
20882
20882
|
const I = de.identity();
|
|
20883
20883
|
for (; A && A.userData.isLayoutLevelObject !== !0; )
|
|
20884
20884
|
I.premultiply(A.matrix), A = A.parent;
|
|
20885
20885
|
ut.makeEmpty();
|
|
20886
20886
|
const B = z.getBox(_, ut);
|
|
20887
|
-
B.applyMatrix4(I),
|
|
20887
|
+
B.applyMatrix4(I), C.type === We.Added ? !u && (C.box = new p.Box3().copy(B)) : C.type === We.Removed ? u && (C.box = new p.Box3().copy(B)) : C.type === We.Modified && (C.box ? C.box.union(B) : C.box = new p.Box3().copy(B));
|
|
20888
20888
|
}
|
|
20889
20889
|
}
|
|
20890
20890
|
for (const v in this.layoutsSnapObjectsMap) {
|
|
20891
|
-
const
|
|
20892
|
-
_.name = j.SNAP_GROUP_NAME,
|
|
20891
|
+
const C = m.children.find((I) => I.name === v), _ = new z();
|
|
20892
|
+
_.name = j.SNAP_GROUP_NAME, C.add(_);
|
|
20893
20893
|
const A = this.layoutsSnapObjectsMap[v];
|
|
20894
20894
|
for (let I = 0; I < A.length; I++) {
|
|
20895
20895
|
const B = A[I];
|
|
@@ -20909,20 +20909,20 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
20909
20909
|
const E = m.convertToThreejsObject();
|
|
20910
20910
|
m.clear(), x = {};
|
|
20911
20911
|
const M = {}, O = (v) => {
|
|
20912
|
-
const
|
|
20913
|
-
let _ = M[
|
|
20914
|
-
!_ && (_ = [], M[
|
|
20912
|
+
const C = v.userData.layerName;
|
|
20913
|
+
let _ = M[C];
|
|
20914
|
+
!_ && (_ = [], M[C] = _), _.push(v);
|
|
20915
20915
|
};
|
|
20916
20916
|
E.children.forEach((v) => {
|
|
20917
|
-
Q.setSharedVariablesOfObject(v), v.userData.isLayoutLevelObject && v.traverse((
|
|
20918
|
-
if (Q.setSharedVariablesOfObject(
|
|
20919
|
-
const _ =
|
|
20920
|
-
this.getLayerVisible(f, _) === !1 && (
|
|
20917
|
+
Q.setSharedVariablesOfObject(v), v.userData.isLayoutLevelObject && v.traverse((C) => {
|
|
20918
|
+
if (Q.setSharedVariablesOfObject(C), C.userData.isSnapGroup && (C.visible = j.SHOW_SNAP_OBJECT), C.geometry) {
|
|
20919
|
+
const _ = C.userData.layerName;
|
|
20920
|
+
this.getLayerVisible(f, _) === !1 && (C.visible = !1, C.userData.layerVisible = !1), O(C);
|
|
20921
20921
|
}
|
|
20922
20922
|
});
|
|
20923
20923
|
});
|
|
20924
|
-
const
|
|
20925
|
-
|
|
20924
|
+
const T = f;
|
|
20925
|
+
T.threejsObject = E, T.layersAndThreejsObjects = M, T.layoutViewportsMap = {};
|
|
20926
20926
|
};
|
|
20927
20927
|
let h = Date.now();
|
|
20928
20928
|
this.compareContext = {
|
|
@@ -21055,9 +21055,9 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
21055
21055
|
}
|
|
21056
21056
|
}
|
|
21057
21057
|
else b = !1;
|
|
21058
|
-
const y = Math.min(parseInt(e.handle, 16) || 0, 3999),
|
|
21058
|
+
const y = Math.min(parseInt(e.handle, 16) || 0, 3999), S = b ? Me.InsertLine + y * 1e-5 : Me.InsertSymbol + y * 1e-4;
|
|
21059
21059
|
o.traverse((w) => {
|
|
21060
|
-
if (w.geometry && w.renderOrder < Me.Text && (w.renderOrder =
|
|
21060
|
+
if (w.geometry && w.renderOrder < Me.Text && (w.renderOrder = S, b)) {
|
|
21061
21061
|
const x = w.geometry.getAttribute("position");
|
|
21062
21062
|
if (x) {
|
|
21063
21063
|
let E = !1;
|
|
@@ -21093,10 +21093,10 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
21093
21093
|
let u = 1;
|
|
21094
21094
|
const f = s;
|
|
21095
21095
|
f?.xScale && f?.yScale && (u = Math.max(Math.abs(f.xScale), Math.abs(f.yScale)));
|
|
21096
|
-
const m = this.getDivision(n, r, Math.max(o, l) * u), b = d.getPoints(m), y = [],
|
|
21097
|
-
for (let
|
|
21098
|
-
F.areVector2sEqual(b[
|
|
21099
|
-
if (y.push(b[
|
|
21096
|
+
const m = this.getDivision(n, r, Math.max(o, l) * u), b = d.getPoints(m), y = [], S = b.length;
|
|
21097
|
+
for (let T = 0; T < S - 1; T++)
|
|
21098
|
+
F.areVector2sEqual(b[T], b[T + 1], 1e-9) || y.push(b[T]);
|
|
21099
|
+
if (y.push(b[S - 1]), y.length < 2) return P.warn("[Dxf] Ellipse entity (handle '%s') contains less than 2 points, ignored!", e.handle), void 0;
|
|
21100
21100
|
const w = new p.Vector3();
|
|
21101
21101
|
let x = !1;
|
|
21102
21102
|
this.enableRTC && (x = N.checkAndRebasePositionsOnRTC(y, w));
|
|
@@ -21323,16 +21323,16 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
21323
21323
|
N.shouldRebasePositionOnRTC(K) && this.setRTCUserData(o), o.matrix.compose(K, me, tt);
|
|
21324
21324
|
const x = e.position ? K.clone().sub(e.position) : K;
|
|
21325
21325
|
et.makeTranslation(-x.x, -x.y, 0), de.makeRotationZ(w), o.matrix.multiply(et), o.matrix.multiply(de), o.matrix.multiply(et.invert()), o.userData || (o.userData = {});
|
|
21326
|
-
const E = o.matrix.elements, M = E && E[12] || 0, O = E && E[13] || 0,
|
|
21326
|
+
const E = o.matrix.elements, M = E && E[12] || 0, O = E && E[13] || 0, T = E && E[14] || 0, v = new p.Box3();
|
|
21327
21327
|
z.getBox(o, v);
|
|
21328
|
-
const
|
|
21329
|
-
v.getCenter(
|
|
21328
|
+
const C = new p.Vector3();
|
|
21329
|
+
v.getCenter(C);
|
|
21330
21330
|
const _ = new p.Vector3();
|
|
21331
21331
|
v.getSize(_), o.userData.renderArea = {
|
|
21332
21332
|
position: {
|
|
21333
21333
|
x: M,
|
|
21334
21334
|
y: O,
|
|
21335
|
-
z:
|
|
21335
|
+
z: T
|
|
21336
21336
|
},
|
|
21337
21337
|
bbox: {
|
|
21338
21338
|
min: {
|
|
@@ -21346,9 +21346,9 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
21346
21346
|
z: v.max.z
|
|
21347
21347
|
},
|
|
21348
21348
|
center: {
|
|
21349
|
-
x:
|
|
21350
|
-
y:
|
|
21351
|
-
z:
|
|
21349
|
+
x: C.x,
|
|
21350
|
+
y: C.y,
|
|
21351
|
+
z: C.z
|
|
21352
21352
|
},
|
|
21353
21353
|
width: _.x,
|
|
21354
21354
|
height: _.y,
|
|
@@ -21435,8 +21435,8 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
21435
21435
|
y = E.z > 0 ? -M : M;
|
|
21436
21436
|
}
|
|
21437
21437
|
N.shouldRebasePositionOnRTC(K) && this.setRTCUserData(o), o.matrix.compose(K, me, tt);
|
|
21438
|
-
const
|
|
21439
|
-
return et.makeTranslation(-
|
|
21438
|
+
const S = e.position ? K.clone().sub(e.position) : K;
|
|
21439
|
+
return et.makeTranslation(-S.x, -S.y, 0), de.makeRotationZ(y), o.matrix.multiply(et), o.matrix.multiply(de), o.matrix.multiply(et.invert()), o;
|
|
21440
21440
|
}
|
|
21441
21441
|
getMTextGroup(e, i, s, n, r, a = 0, o = 0, l = []) {
|
|
21442
21442
|
if (e.length === 0) return;
|
|
@@ -21451,11 +21451,11 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
21451
21451
|
let d = "Left";
|
|
21452
21452
|
i.width && i.attachmentPoint && ([1, 4, 7].includes(i.attachmentPoint) ? d = "Left" : [2, 5, 8].includes(i.attachmentPoint) ? d = "Center" : [3, 6, 9].includes(i.attachmentPoint) && (d = "Right"));
|
|
21453
21453
|
const u = i.width || 0, f = new z();
|
|
21454
|
-
let m, b = s.fontFile, y = 1,
|
|
21454
|
+
let m, b = s.fontFile, y = 1, S = 1, w = 256, x = h * 0.8, E = x + h;
|
|
21455
21455
|
for (let M = 0; M < e.length; M++) {
|
|
21456
21456
|
const O = e[M];
|
|
21457
21457
|
if (typeof O == "string") {
|
|
21458
|
-
const
|
|
21458
|
+
const T = [], v = (A, I) => {
|
|
21459
21459
|
let B;
|
|
21460
21460
|
if (A.forEach((k, D) => {
|
|
21461
21461
|
!k.boundingBox && k.computeBoundingBox(), D === 0 ? B = k.boundingBox : B.union(k.boundingBox);
|
|
@@ -21473,9 +21473,9 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
21473
21473
|
A.forEach((k) => k.translate(u - I, 0, 0));
|
|
21474
21474
|
break;
|
|
21475
21475
|
}
|
|
21476
|
-
|
|
21476
|
+
T.push(...A);
|
|
21477
21477
|
};
|
|
21478
|
-
let
|
|
21478
|
+
let C;
|
|
21479
21479
|
for (let A = 0; A < O.length; A++) {
|
|
21480
21480
|
const I = O[A];
|
|
21481
21481
|
if (I === `
|
|
@@ -21484,27 +21484,27 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
21484
21484
|
a = 0, o -= E, l.length > 0 && v(l, k), l = [];
|
|
21485
21485
|
continue;
|
|
21486
21486
|
}
|
|
21487
|
-
if (x = h * 0.8, E = x + h,
|
|
21488
|
-
a += h +
|
|
21487
|
+
if (x = h * 0.8, E = x + h, C = this.font?.getCharShape(I, b, h), s.bigFontFile && !C && (C = this.font?.getCharShape(I, s.bigFontFile, h)), !C && (C = this.font?.getCharShape(I, "", h)), !C && (C = this.font?.getNotFoundTextShape(h)), !C) {
|
|
21488
|
+
a += h + S * (h / 3.5);
|
|
21489
21489
|
continue;
|
|
21490
21490
|
}
|
|
21491
|
-
a > (u || 1 / 0) && (l.length > 0 && v(l, a), a = 0, o -= E, l = []),
|
|
21491
|
+
a > (u || 1 / 0) && (l.length > 0 && v(l, a), a = 0, o -= E, l = []), C.translate(a, o, 0), C.scale(y, 1, 1), C.boundingBox || C.computeBoundingBox(), O.T && (S = O.T);
|
|
21492
21492
|
const B = Nh(
|
|
21493
21493
|
I,
|
|
21494
|
-
|
|
21494
|
+
C,
|
|
21495
21495
|
h,
|
|
21496
|
-
|
|
21496
|
+
S,
|
|
21497
21497
|
// trackingFactor
|
|
21498
21498
|
b
|
|
21499
21499
|
// fontFile
|
|
21500
21500
|
);
|
|
21501
|
-
a += B, l.push(
|
|
21501
|
+
a += B, l.push(C);
|
|
21502
21502
|
}
|
|
21503
21503
|
l.length > 0 && (v(l, a), l = []);
|
|
21504
21504
|
const _ = new z();
|
|
21505
|
-
if (
|
|
21505
|
+
if (T.length > 0) {
|
|
21506
21506
|
!m && (m = i.colorIndex), w !== void 0 && w !== 256 ? (i.color = zi(w), i.colorIndex = w) : i.colorIndex = m;
|
|
21507
|
-
const A = this.getColor(i, n, r), I =
|
|
21507
|
+
const A = this.getColor(i, n, r), I = T.filter((k) => k instanceof p.ExtrudeGeometry), B = T.filter((k) => !(k instanceof p.ExtrudeGeometry));
|
|
21508
21508
|
if (I.length > 0) {
|
|
21509
21509
|
const k = new z(H.Mesh);
|
|
21510
21510
|
k.geometry = Oe(I), k.material = this.getMeshBasicMaterial(A), _.add(k);
|
|
@@ -21514,11 +21514,11 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
21514
21514
|
k.geometry = Oe(B), k.material = this.getLineBasicMaterial(A), _.add(k);
|
|
21515
21515
|
}
|
|
21516
21516
|
}
|
|
21517
|
-
_.matrix.makeTranslation(0, -h, 0), f.add(_), y = 1,
|
|
21517
|
+
_.matrix.makeTranslation(0, -h, 0), f.add(_), y = 1, S = 1, w = 256;
|
|
21518
21518
|
} else if (Array.isArray(O)) {
|
|
21519
|
-
const
|
|
21520
|
-
|
|
21521
|
-
} else typeof O == "object" && (O.f && (b = O.f, b && b.includes(".shx") && P.info("[Dxf] Doesn't support custom fonts: " + b)), O.C && (w = O.C), O.W && (O.W[1] === "x" ? y = O.W[0] * i.width : y = O.W[0]), O.H && (O.H[1] === "x" ? h = O.H[0] * i.height : h = O.H[0]), O.T && (
|
|
21519
|
+
const T = this.getMTextGroup(O, i, s, n, r, a, o, l);
|
|
21520
|
+
T && (f.add(T.object), a = T.hOffset, o = T.vOffset);
|
|
21521
|
+
} else typeof O == "object" && (O.f && (b = O.f, b && b.includes(".shx") && P.info("[Dxf] Doesn't support custom fonts: " + b)), O.C && (w = O.C), O.W && (O.W[1] === "x" ? y = O.W[0] * i.width : y = O.W[0]), O.H && (O.H[1] === "x" ? h = O.H[0] * i.height : h = O.H[0]), O.T && (S = O.T));
|
|
21522
21522
|
}
|
|
21523
21523
|
if (f.children.length !== 0)
|
|
21524
21524
|
return Dt.merge(f, !1), m && (i.colorIndex = m), f.children.length === 1 ? {
|
|
@@ -21609,8 +21609,8 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
21609
21609
|
this.enableRTC && (m = N.checkAndRebasePositionsOnRTC(u, f));
|
|
21610
21610
|
const b = N.getAdjacentNonRepeatPoints(u);
|
|
21611
21611
|
if (b.length < 2) return P.warn("[Dxf] Spline entity (handle '%s') contains less than 2 points, ignored!", e.handle), void 0;
|
|
21612
|
-
const y = new p.BufferGeometry().setFromPoints(b),
|
|
21613
|
-
return
|
|
21612
|
+
const y = new p.BufferGeometry().setFromPoints(b), S = new z(H.Line);
|
|
21613
|
+
return S.geometry = y, S.material = pe, m && (this.setRTCUserData(S), S.matrix.setPosition(f.x, f.y, 0)), S.layers.enableAll(), S;
|
|
21614
21614
|
}
|
|
21615
21615
|
loadXLine(e) {
|
|
21616
21616
|
if (!e.vertices || e.vertices.length === 0) return P.warn("[Dxf] Entity is missing vertices:", e.handle), void 0;
|
|
@@ -21731,18 +21731,18 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
21731
21731
|
f += w.length;
|
|
21732
21732
|
});
|
|
21733
21733
|
const m = this.getLineType(e, i), b = i.tables?.lineType?.lineTypes?.[m], y = new p.BufferGeometry().setFromPoints(d);
|
|
21734
|
-
let
|
|
21734
|
+
let S = pe;
|
|
21735
21735
|
if (b && h(b)) {
|
|
21736
21736
|
let w = function(O) {
|
|
21737
|
-
const
|
|
21737
|
+
const T = O.attributes.position, v = T.count, C = new Float32Array(v);
|
|
21738
21738
|
for (let _ = 0; _ < v; _ += 2) {
|
|
21739
|
-
const A = _ * 3, I = (_ + 1) * 3, B =
|
|
21740
|
-
|
|
21739
|
+
const A = _ * 3, I = (_ + 1) * 3, B = T.array[I] - T.array[A], k = T.array[I + 1] - T.array[A + 1], D = T.array[I + 2] - T.array[A + 2], R = Math.sqrt(B * B + k * k + D * D);
|
|
21740
|
+
C[_] = _ === 0 ? 0 : C[_ - 1], C[_ + 1] = C[_] + R;
|
|
21741
21741
|
}
|
|
21742
|
-
O.setAttribute("lineDistance", new p.Float32BufferAttribute(
|
|
21742
|
+
O.setAttribute("lineDistance", new p.Float32BufferAttribute(C, 1));
|
|
21743
21743
|
};
|
|
21744
21744
|
const x = b.pattern?.[0] || 0.5, E = b.pattern?.[1] || 0.5, M = 0.1;
|
|
21745
|
-
|
|
21745
|
+
S = new p.LineDashedMaterial({
|
|
21746
21746
|
color: pe.color,
|
|
21747
21747
|
linewidth: pe.linewidth || 1,
|
|
21748
21748
|
dashSize: x * M,
|
|
@@ -21751,7 +21751,7 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
21751
21751
|
}), w(y);
|
|
21752
21752
|
} else
|
|
21753
21753
|
y.setIndex(u);
|
|
21754
|
-
l = new z(H.LineSegment), l.geometry = y, l.material =
|
|
21754
|
+
l = new z(H.LineSegment), l.geometry = y, l.material = S;
|
|
21755
21755
|
}
|
|
21756
21756
|
if (n.length > 0) {
|
|
21757
21757
|
a && N.checkAndRebasePositionsOnRTC(n, r);
|
|
@@ -21777,8 +21777,8 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
21777
21777
|
if (e.extrusionDirectionX !== void 0 && e.extrusionDirectionY !== void 0 && e.extrusionDirectionZ !== void 0) {
|
|
21778
21778
|
U.set(e.extrusionDirectionX, e.extrusionDirectionY, e.extrusionDirectionZ);
|
|
21779
21779
|
const b = j.getOcsMatrix(U).invert(), y = e.elevation !== void 0 ? e.elevation : 0;
|
|
21780
|
-
n.forEach((
|
|
21781
|
-
U.set(
|
|
21780
|
+
n.forEach((S) => {
|
|
21781
|
+
U.set(S.x, S.y, y).applyMatrix4(b), S.x = U.x, S.y = U.y;
|
|
21782
21782
|
});
|
|
21783
21783
|
}
|
|
21784
21784
|
let r = Zn(n, e.shape);
|
|
@@ -21796,8 +21796,8 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
21796
21796
|
O === 0 ? E.moveTo(M[0], M[1]) : E.lineTo(M[0], M[1]);
|
|
21797
21797
|
}), E.closePath(), y.push(new p.ShapeGeometry(E));
|
|
21798
21798
|
});
|
|
21799
|
-
const
|
|
21800
|
-
w.geometry =
|
|
21799
|
+
const S = Oe(y), w = new z(H.Mesh);
|
|
21800
|
+
w.geometry = S, w.material = wi, w.layers.enableAll(), w.layers.disable(qe), a.add(w);
|
|
21801
21801
|
}
|
|
21802
21802
|
let l = !1;
|
|
21803
21803
|
const h = new p.Vector3();
|
|
@@ -21812,7 +21812,7 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
21812
21812
|
const b = n.some((y) => y.startWidth !== void 0 || y.endWidth !== void 0);
|
|
21813
21813
|
if (b || u !== void 0 && u > 0) {
|
|
21814
21814
|
let y;
|
|
21815
|
-
const
|
|
21815
|
+
const S = i.tables?.lineType?.lineTypes, w = this.getLineType(e, i, s), x = S?.[w];
|
|
21816
21816
|
if (!x || !x.pattern || x.pattern.length === 0)
|
|
21817
21817
|
if (this.statsInfo.unsupportedPolylineCount++, b ? y = this.createTaperedPolylineGeometry(n, u) : y = N.convertWidthLineToMeshGeometry(d, u), !y)
|
|
21818
21818
|
P.warn("[Dxf] Failed to convert line with width to mesh geometry: %s", e.handle);
|
|
@@ -21841,8 +21841,8 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
21841
21841
|
if (u === 0) continue;
|
|
21842
21842
|
const f = o.startWidth ?? i ?? 0, m = o.endWidth ?? i ?? 0;
|
|
21843
21843
|
if (f <= 0 && m <= 0) continue;
|
|
21844
|
-
const b = -d / u, y = h / u,
|
|
21845
|
-
s.push(x.x, x.y, 0, E.x, E.y, 0, M.x, M.y, 0, O.x, O.y, 0), n.push(
|
|
21844
|
+
const b = -d / u, y = h / u, S = f / 2, w = m / 2, x = { x: o.x + b * S, y: o.y + y * S }, E = { x: o.x - b * S, y: o.y - y * S }, M = { x: l.x + b * w, y: l.y + y * w }, O = { x: l.x - b * w, y: l.y - y * w }, T = s.length / 3;
|
|
21845
|
+
s.push(x.x, x.y, 0, E.x, E.y, 0, M.x, M.y, 0, O.x, O.y, 0), n.push(T, T + 1, T + 2), n.push(T + 1, T + 3, T + 2);
|
|
21846
21846
|
}
|
|
21847
21847
|
if (!n.length) return null;
|
|
21848
21848
|
const r = new p.BufferGeometry();
|
|
@@ -21855,45 +21855,45 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
21855
21855
|
if (d) {
|
|
21856
21856
|
d.matrix.decompose(K, me, tt), e.contextData?.textLocation && (K.x += e.contextData.textLocation.x, K.y += e.contextData.textLocation.y, d.matrix.compose(K, me, tt)), ut.makeEmpty();
|
|
21857
21857
|
const u = z.getBox(d, ut), f = u.getSize(U), m = f.x, b = f.y;
|
|
21858
|
-
let y = 0,
|
|
21858
|
+
let y = 0, S = 0;
|
|
21859
21859
|
switch (e.contextData?.textAttachment) {
|
|
21860
21860
|
case 1:
|
|
21861
|
-
y = 0,
|
|
21861
|
+
y = 0, S = 0;
|
|
21862
21862
|
break;
|
|
21863
21863
|
case 2:
|
|
21864
|
-
y -= m / 2,
|
|
21864
|
+
y -= m / 2, S = 0;
|
|
21865
21865
|
break;
|
|
21866
21866
|
case 3:
|
|
21867
|
-
y -= m,
|
|
21867
|
+
y -= m, S = 0;
|
|
21868
21868
|
break;
|
|
21869
21869
|
case 4:
|
|
21870
|
-
y = 0,
|
|
21870
|
+
y = 0, S += b / 2;
|
|
21871
21871
|
break;
|
|
21872
21872
|
case 5:
|
|
21873
|
-
y -= m / 2,
|
|
21873
|
+
y -= m / 2, S += b / 2;
|
|
21874
21874
|
break;
|
|
21875
21875
|
case 6:
|
|
21876
|
-
y -= m,
|
|
21876
|
+
y -= m, S += b / 2;
|
|
21877
21877
|
break;
|
|
21878
21878
|
case 7:
|
|
21879
|
-
y = 0,
|
|
21879
|
+
y = 0, S += b;
|
|
21880
21880
|
break;
|
|
21881
21881
|
case 8:
|
|
21882
|
-
y -= m / 2,
|
|
21882
|
+
y -= m / 2, S += b;
|
|
21883
21883
|
break;
|
|
21884
21884
|
case 9:
|
|
21885
|
-
y -= m,
|
|
21885
|
+
y -= m, S += b;
|
|
21886
21886
|
break;
|
|
21887
21887
|
default:
|
|
21888
21888
|
return;
|
|
21889
21889
|
}
|
|
21890
21890
|
d.traverse((E) => {
|
|
21891
|
-
E.geometry && E.geometry.translate(y,
|
|
21891
|
+
E.geometry && E.geometry.translate(y, S, 0);
|
|
21892
21892
|
});
|
|
21893
21893
|
let w = 0;
|
|
21894
21894
|
if (e.contextData?.textRotation && (w = e.contextData.textRotation * Math.PI / 180), e.contextData?.textDirection) {
|
|
21895
|
-
const E = e.contextData.textDirection, M = new p.Vector3(E.x, E.y, E.z), O = M.clone().cross(Ge),
|
|
21896
|
-
w += O.z > 0 ? -
|
|
21895
|
+
const E = e.contextData.textDirection, M = new p.Vector3(E.x, E.y, E.z), O = M.clone().cross(Ge), T = Ge.angleTo(M);
|
|
21896
|
+
w += O.z > 0 ? -T : T;
|
|
21897
21897
|
}
|
|
21898
21898
|
N.shouldRebasePositionOnRTC(K) && this.setRTCUserData(d), d.matrix.compose(K, me, tt), e.contextData?.textLocation ? U.set(e.contextData.textLocation.x, e.contextData.textLocation.y, 0) : U.set(0, 0, 0);
|
|
21899
21899
|
const x = K.clone().sub(U);
|
|
@@ -21904,16 +21904,16 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
21904
21904
|
if (!f) return a;
|
|
21905
21905
|
const m = f.lastLeaderLinePoint;
|
|
21906
21906
|
if (e.enableDogLeg) {
|
|
21907
|
-
const E = new p.Vector3(m.x, m.y, m.z), M = f.doglegLength, O = new p.Vector3(f.doglegVector.x, f.doglegVector.y, f.doglegVector.z),
|
|
21907
|
+
const E = new p.Vector3(m.x, m.y, m.z), M = f.doglegLength, O = new p.Vector3(f.doglegVector.x, f.doglegVector.y, f.doglegVector.z), T = O.multiplyScalar(M), v = E.clone().add(T);
|
|
21908
21908
|
u.push(v, E);
|
|
21909
21909
|
}
|
|
21910
21910
|
const b = e.contextData?.leaders[0].leaderLines || [];
|
|
21911
21911
|
for (let E = 0; E < b.length; E++) {
|
|
21912
21912
|
const M = b[E].vertices[0], O = M.reverse().map((B) => new p.Vector3(B.x, B.y, B.z));
|
|
21913
|
-
let
|
|
21913
|
+
let T = new p.Vector3(m.x, m.y, m.z);
|
|
21914
21914
|
for (let B = 0; B < O.length; B++)
|
|
21915
|
-
u.push(
|
|
21916
|
-
const v = U.subVectors(u[0], u[1]).length(),
|
|
21915
|
+
u.push(T, O[B]), T = O[B];
|
|
21916
|
+
const v = U.subVectors(u[0], u[1]).length(), C = e.arrowHeadSize || n.DIMASZ || 2.5, _ = e.arrowHeadScale || n.DIMSCALE || 1, A = C * _;
|
|
21917
21917
|
e.leaderLineType;
|
|
21918
21918
|
let I = "";
|
|
21919
21919
|
if (e.arrowHeadId ? I = e.arrowHeadId : n && n.DIMLDRBLK && (I = n.DIMLDRBLK), I) {
|
|
@@ -21929,10 +21929,10 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
21929
21929
|
} else this.loadDefaultLeadArrow(u[u.length - 2], u[u.length - 1], v / 2e3, u);
|
|
21930
21930
|
}
|
|
21931
21931
|
const y = new p.Vector3();
|
|
21932
|
-
let
|
|
21933
|
-
this.enableRTC && (
|
|
21932
|
+
let S = !1;
|
|
21933
|
+
this.enableRTC && (S = N.checkAndRebasePositionsOnRTC(u, y));
|
|
21934
21934
|
const w = new p.BufferGeometry().setFromPoints(u), x = new z(H.LineSegment);
|
|
21935
|
-
x.geometry = w, x.material = pe, x.renderOrder = Me.Line,
|
|
21935
|
+
x.geometry = w, x.material = pe, x.renderOrder = Me.Line, S && (this.setRTCUserData(x), x.matrix.setPosition(y.x, y.y, 0)), a.add(x);
|
|
21936
21936
|
} else return d?.traverse((u) => {
|
|
21937
21937
|
u.layers.enableAll();
|
|
21938
21938
|
}), d;
|
|
@@ -21947,31 +21947,31 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
21947
21947
|
const r = i.tables.dimStyle.dimStyles[e.dimensionStyle] || this.getDefaultDimensionStyle(i);
|
|
21948
21948
|
let a = e.vertices;
|
|
21949
21949
|
if (e.pathType === 1 && (a = new p.SplineCurve(e.vertices).getPoints(50)), e.textWidth) {
|
|
21950
|
-
const
|
|
21950
|
+
const S = e.textWidth, w = new p.Vector3(a[a.length - 1].x, a[a.length - 1].y, a[a.length - 1].z);
|
|
21951
21951
|
if (e.direction === 0) {
|
|
21952
|
-
const x = new p.Vector3(1, 0, 0).multiplyScalar(
|
|
21952
|
+
const x = new p.Vector3(1, 0, 0).multiplyScalar(S);
|
|
21953
21953
|
a.push(x.add(w));
|
|
21954
21954
|
} else {
|
|
21955
|
-
const x = new p.Vector3(-1, 0, 0).multiplyScalar(
|
|
21955
|
+
const x = new p.Vector3(-1, 0, 0).multiplyScalar(S);
|
|
21956
21956
|
a.push(x.add(w));
|
|
21957
21957
|
}
|
|
21958
21958
|
}
|
|
21959
|
-
for (let
|
|
21960
|
-
const w = a[
|
|
21959
|
+
for (let S = 0; S < a.length - 1; S++) {
|
|
21960
|
+
const w = a[S], x = a[S + 1];
|
|
21961
21961
|
n.push(w, x);
|
|
21962
21962
|
}
|
|
21963
21963
|
const o = U.subVectors(n[0], n[1]).setZ(0).length(), l = e.arrowHeight || r.DIMASZ || 2.5, h = e.arrowHeadScale || r.DIMSCALE || 1, d = l * h, u = new z();
|
|
21964
21964
|
if (e.arrowFlag === 1) {
|
|
21965
|
-
let
|
|
21966
|
-
e.arrowHeadBlockHandle ?
|
|
21967
|
-
const w = this.getBlockByHandle(i.blocks,
|
|
21965
|
+
let S = "";
|
|
21966
|
+
e.arrowHeadBlockHandle ? S = e.arrowHeadBlockHandle : r && r.DIMLDRBLK && (S = r.DIMLDRBLK);
|
|
21967
|
+
const w = this.getBlockByHandle(i.blocks, S);
|
|
21968
21968
|
if (w && w.entities) {
|
|
21969
21969
|
r && (e.colorIndex = r.DIMCLRD || 256, e.color = zi(e.colorIndex));
|
|
21970
21970
|
for (let x = 0; x < w.entities.length; x++) {
|
|
21971
21971
|
const E = this.loadEntity(w.entities[x], i, e);
|
|
21972
21972
|
if (E) {
|
|
21973
|
-
const M = new p.Vector3(n[0].x, n[0].y, n[0].z), O = new p.Vector3(n[1].x, n[1].y, n[1].z),
|
|
21974
|
-
U.copy(M), K.setScalar(d), me.setFromAxisAngle(bi,
|
|
21973
|
+
const M = new p.Vector3(n[0].x, n[0].y, n[0].z), O = new p.Vector3(n[1].x, n[1].y, n[1].z), T = Math.atan2(M.y - O.y, M.x - O.x);
|
|
21974
|
+
U.copy(M), K.setScalar(d), me.setFromAxisAngle(bi, T), E.matrix.compose(U, me, K), u.add(E);
|
|
21975
21975
|
}
|
|
21976
21976
|
}
|
|
21977
21977
|
} else this.loadDefaultLeadArrow(n[1], n[0], d / o / 2, n);
|
|
@@ -21981,8 +21981,8 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
21981
21981
|
let m = !1;
|
|
21982
21982
|
this.enableRTC && (m = N.checkAndRebasePositionsOnRTC(n, f));
|
|
21983
21983
|
const b = new p.BufferGeometry().setFromPoints(n), y = new z(H.Line);
|
|
21984
|
-
return y.geometry = b, y.material = pe, y.renderOrder = Me.Line, m && (this.setRTCUserData(y), y.matrix.setPosition(f.x, f.y, 0)), u.children.length > 0 ? (u.add(y), Dt.merge(u, !1), u.traverse((
|
|
21985
|
-
|
|
21984
|
+
return y.geometry = b, y.material = pe, y.renderOrder = Me.Line, m && (this.setRTCUserData(y), y.matrix.setPosition(f.x, f.y, 0)), u.children.length > 0 ? (u.add(y), Dt.merge(u, !1), u.traverse((S) => {
|
|
21985
|
+
S.layers.enableAll();
|
|
21986
21986
|
}), u.children.length === 1 ? u.children[0] : u) : (y.layers.enableAll(), y);
|
|
21987
21987
|
}
|
|
21988
21988
|
getTableTextOffset(e, i, s) {
|
|
@@ -22129,17 +22129,17 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
22129
22129
|
let u = 0;
|
|
22130
22130
|
for (let y = 0; y < a; y++) {
|
|
22131
22131
|
d[y] = [];
|
|
22132
|
-
for (let
|
|
22133
|
-
d[y][
|
|
22132
|
+
for (let S = 0; S < o; S++)
|
|
22133
|
+
d[y][S] = u < r.length ? r[u++] : null;
|
|
22134
22134
|
}
|
|
22135
22135
|
for (let y = 0; y < a; y++)
|
|
22136
|
-
for (let
|
|
22137
|
-
const w = d[y][
|
|
22136
|
+
for (let S = 0; S < o; S++) {
|
|
22137
|
+
const w = d[y][S];
|
|
22138
22138
|
if (!w || w.mergedValue !== 0) continue;
|
|
22139
22139
|
let x = 1, E = 1;
|
|
22140
|
-
for (; y + x < a && d[y + x][
|
|
22140
|
+
for (; y + x < a && d[y + x][S] && d[y + x][S].mergedValue === 1; )
|
|
22141
22141
|
x++;
|
|
22142
|
-
for (;
|
|
22142
|
+
for (; S + E < o && d[y][S + E] && d[y][S + E].mergedValue === 1; )
|
|
22143
22143
|
E++;
|
|
22144
22144
|
w.rowSpan = x, w.colSpan = E;
|
|
22145
22145
|
}
|
|
@@ -22151,7 +22151,7 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
22151
22151
|
m.push(m[y] + h[y]);
|
|
22152
22152
|
const b = [];
|
|
22153
22153
|
for (let y = 0; y <= a; y++) {
|
|
22154
|
-
let
|
|
22154
|
+
let S = m[0], w = !1;
|
|
22155
22155
|
for (let x = 0; x < o; x++) {
|
|
22156
22156
|
y > 0 && d[y - 1][x], y < a && d[y][x];
|
|
22157
22157
|
let E = !0;
|
|
@@ -22161,12 +22161,12 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
22161
22161
|
const M = this._getMergeOwner(d, y - 1, x, a, o), O = this._getMergeOwner(d, y, x, a, o);
|
|
22162
22162
|
E = M !== O;
|
|
22163
22163
|
}
|
|
22164
|
-
E ? w || (w = !0,
|
|
22164
|
+
E ? w || (w = !0, S = m[x]) : w && (b.push(new p.Vector3(S, f[y], 0), new p.Vector3(m[x], f[y], 0)), w = !1);
|
|
22165
22165
|
}
|
|
22166
|
-
w && b.push(new p.Vector3(
|
|
22166
|
+
w && b.push(new p.Vector3(S, f[y], 0), new p.Vector3(m[o], f[y], 0));
|
|
22167
22167
|
}
|
|
22168
22168
|
for (let y = 0; y <= o; y++) {
|
|
22169
|
-
let
|
|
22169
|
+
let S = f[0], w = !1;
|
|
22170
22170
|
for (let x = 0; x < a; x++) {
|
|
22171
22171
|
y > 0 && d[x][y - 1], y < o && d[x][y];
|
|
22172
22172
|
let E = !0;
|
|
@@ -22176,37 +22176,37 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
22176
22176
|
const M = this._getMergeOwner(d, x, y - 1, a, o), O = this._getMergeOwner(d, x, y, a, o);
|
|
22177
22177
|
E = M !== O;
|
|
22178
22178
|
}
|
|
22179
|
-
E ? w || (w = !0,
|
|
22179
|
+
E ? w || (w = !0, S = f[x]) : w && (b.push(new p.Vector3(m[y], S, 0), new p.Vector3(m[y], f[x], 0)), w = !1);
|
|
22180
22180
|
}
|
|
22181
|
-
w && b.push(new p.Vector3(m[y],
|
|
22181
|
+
w && b.push(new p.Vector3(m[y], S, 0), new p.Vector3(m[y], f[a], 0));
|
|
22182
22182
|
}
|
|
22183
22183
|
if (b.length > 0) {
|
|
22184
|
-
const y = new p.BufferGeometry().setFromPoints(b),
|
|
22185
|
-
|
|
22184
|
+
const y = new p.BufferGeometry().setFromPoints(b), S = new z(H.LineSegment);
|
|
22185
|
+
S.geometry = y, S.material = pe, S.layers.enableAll(), n.add(S);
|
|
22186
22186
|
}
|
|
22187
22187
|
for (let y = 0; y < a; y++)
|
|
22188
|
-
for (let
|
|
22189
|
-
const w = d[y][
|
|
22188
|
+
for (let S = 0; S < o; S++) {
|
|
22189
|
+
const w = d[y][S];
|
|
22190
22190
|
if (!w || w.mergedValue !== 0) continue;
|
|
22191
|
-
const x = m[
|
|
22191
|
+
const x = m[S], E = f[y];
|
|
22192
22192
|
let M = 0;
|
|
22193
|
-
for (let
|
|
22194
|
-
M += h[
|
|
22193
|
+
for (let C = 0; C < (w.colSpan || 1); C++)
|
|
22194
|
+
M += h[S + C];
|
|
22195
22195
|
let O = 0;
|
|
22196
|
-
for (let
|
|
22197
|
-
O += l[y +
|
|
22196
|
+
for (let C = 0; C < (w.rowSpan || 1); C++)
|
|
22197
|
+
O += l[y + C];
|
|
22198
22198
|
w.colorIndex = e.colorIndex, w.height = w.textHeight || 2.5;
|
|
22199
|
-
const
|
|
22200
|
-
U.set(x, E, 0), U.add(
|
|
22199
|
+
const T = this.getTableTextOffset(w.attachmentPoint || 1, M, O);
|
|
22200
|
+
U.set(x, E, 0), U.add(T), w.position = U.clone();
|
|
22201
22201
|
const v = this.loadMText(w, i, s);
|
|
22202
22202
|
v && n.add(v);
|
|
22203
22203
|
}
|
|
22204
22204
|
if (e.blockRecordHandle) {
|
|
22205
22205
|
const y = this.getBlockByHandle(i.blocks, e.blockRecordHandle);
|
|
22206
22206
|
if (y && y.entities)
|
|
22207
|
-
for (const
|
|
22208
|
-
|
|
22209
|
-
const w = this.loadEntity(
|
|
22207
|
+
for (const S of y.entities) {
|
|
22208
|
+
S.isTable = !0;
|
|
22209
|
+
const w = this.loadEntity(S, i, e);
|
|
22210
22210
|
w && n.add(w);
|
|
22211
22211
|
}
|
|
22212
22212
|
}
|
|
@@ -22287,14 +22287,14 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
22287
22287
|
const u = this.getDivision(a, o, e.radius * h), f = l.getPoints(u), m = new p.Vector3();
|
|
22288
22288
|
let b = !1;
|
|
22289
22289
|
this.enableRTC && (b = N.checkAndRebasePositionsOnRTC(f, m));
|
|
22290
|
-
const y = new p.BufferGeometry().setFromPoints(f),
|
|
22291
|
-
|
|
22290
|
+
const y = new p.BufferGeometry().setFromPoints(f), S = new z(H.Line);
|
|
22291
|
+
S.geometry = y, S.material = pe;
|
|
22292
22292
|
const w = new p.Vector3();
|
|
22293
22293
|
e.center && (w.x = e.center.x, w.y = e.center.y);
|
|
22294
22294
|
const x = new p.Vector3(e.center?.x, e.center?.y, e.center?.z).applyMatrix4(r.invert());
|
|
22295
22295
|
w.x = x.x, w.y = x.y;
|
|
22296
22296
|
const E = w, M = new z(H.Point);
|
|
22297
|
-
return M.geometry = Ba, M.material = js, M.userData.handle = e.handle, M.userData.isSnapObject = !0, M.userData.type = "CircleCenter", M.layers.set(qe),
|
|
22297
|
+
return M.geometry = Ba, M.material = js, M.userData.handle = e.handle, M.userData.isSnapObject = !0, M.userData.type = "CircleCenter", M.layers.set(qe), S.add(M), b ? (this.setRTCUserData(S), E.x += m.x, E.y += m.y) : N.shouldRebasePositionOnRTC(E) && this.setRTCUserData(S), S.matrix.setPosition(E), S.layers.enableAll(), S;
|
|
22298
22298
|
}
|
|
22299
22299
|
addTriangleFacingCamera(e, i, s, n) {
|
|
22300
22300
|
const r = new p.Vector3(), a = new p.Vector3();
|
|
@@ -22355,7 +22355,7 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
22355
22355
|
const h = new z(), d = [];
|
|
22356
22356
|
let u = 0, f = 0;
|
|
22357
22357
|
i?.xScale;
|
|
22358
|
-
const m = n + s, b = i?.fontFile || "", y = typeof b == "string" && b.toLowerCase().endsWith(".shx"),
|
|
22358
|
+
const m = n + s, b = i?.fontFile || "", y = typeof b == "string" && b.toLowerCase().endsWith(".shx"), S = y ? s * 0.06 : s * 0.04, w = [];
|
|
22359
22359
|
for (let M = 0; M < e.length; M++) {
|
|
22360
22360
|
const O = e[M];
|
|
22361
22361
|
O !== " " && O !== `
|
|
@@ -22374,37 +22374,37 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
22374
22374
|
u = 0, f -= m * 0.5;
|
|
22375
22375
|
continue;
|
|
22376
22376
|
}
|
|
22377
|
-
let
|
|
22378
|
-
if (!
|
|
22379
|
-
const v = this.font.fileNames.filter((
|
|
22380
|
-
for (let
|
|
22377
|
+
let T = this.font?.getCharShape?.(O, i?.fontFile, s);
|
|
22378
|
+
if (!T && i?.bigFontFile && (T = this.font?.getCharShape?.(O, i.bigFontFile, s)), !T && this.font?.fileNames) {
|
|
22379
|
+
const v = this.font.fileNames.filter((C) => C !== i?.fontFile);
|
|
22380
|
+
for (let C = v.length - 1; C >= 0 && (i.fontFile = v[C], i.styleName = "Standard", T = this.font?.getCharShape?.(O, i.fontFile, s), !T); C--)
|
|
22381
22381
|
;
|
|
22382
22382
|
}
|
|
22383
|
-
if (
|
|
22384
|
-
if (
|
|
22383
|
+
if (T || (T = this.font?.getNotFoundTextShape?.(s)), !!T) {
|
|
22384
|
+
if (T.translate(u, f, 0), u > o)
|
|
22385
22385
|
u = 0, f -= m;
|
|
22386
22386
|
else {
|
|
22387
|
-
!
|
|
22388
|
-
const v =
|
|
22389
|
-
|
|
22390
|
-
|
|
22391
|
-
|
|
22392
|
-
|
|
22393
|
-
[8216, 8217, 8220, 8221].includes(
|
|
22387
|
+
!T.boundingBox && T.computeBoundingBox();
|
|
22388
|
+
const v = T.boundingBox.getSize(U).x, C = O.charCodeAt(0), A = C >= 19968 && C <= 40959 || // CJK 统一汉字
|
|
22389
|
+
C >= 13312 && C <= 19903 || // 扩展 A
|
|
22390
|
+
C >= 63744 && C <= 64255 || // 兼容汉字
|
|
22391
|
+
C >= 12288 && C <= 12351 || // CJK 符号与标点(、。《》等)
|
|
22392
|
+
C >= 65280 && C <= 65519 || // 全角 ASCII 与标点
|
|
22393
|
+
[8216, 8217, 8220, 8221].includes(C) ? Math.max(v, s) : v + S;
|
|
22394
22394
|
E++, u += A + (E === x ? 0 : l);
|
|
22395
22395
|
}
|
|
22396
|
-
d.push(
|
|
22396
|
+
d.push(T);
|
|
22397
22397
|
}
|
|
22398
22398
|
}
|
|
22399
22399
|
if (d.length > 0) {
|
|
22400
|
-
const M = d.filter((
|
|
22400
|
+
const M = d.filter((T) => T instanceof p.ExtrudeGeometry), O = d.filter((T) => !(T instanceof p.ExtrudeGeometry));
|
|
22401
22401
|
if (M.length > 0) {
|
|
22402
|
-
const
|
|
22403
|
-
|
|
22402
|
+
const T = new z(H.Mesh);
|
|
22403
|
+
T.geometry = Oe(M), T.material = wi, h.add(T);
|
|
22404
22404
|
}
|
|
22405
22405
|
if (O.length > 0) {
|
|
22406
|
-
const
|
|
22407
|
-
|
|
22406
|
+
const T = new z(H.LineSegment);
|
|
22407
|
+
T.geometry = Oe(O), T.material = pe, h.add(T);
|
|
22408
22408
|
}
|
|
22409
22409
|
}
|
|
22410
22410
|
return h;
|
|
@@ -22437,8 +22437,8 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
22437
22437
|
if (e.startPoint && e.endPoint) {
|
|
22438
22438
|
const d = new p.Vector3(e.startPoint.x, e.startPoint.y, e.startPoint.z), u = new p.Vector3(e.endPoint.x, e.endPoint.y, e.endPoint.z), f = new p.Vector3().subVectors(d, u), m = f.length(), b = m / l;
|
|
22439
22439
|
o.scale.multiplyScalar(b);
|
|
22440
|
-
const y = f.clone().cross(Ge),
|
|
22441
|
-
o.rotateZ(y.z > 0 ? Math.PI -
|
|
22440
|
+
const y = f.clone().cross(Ge), S = f.angleTo(Ge);
|
|
22441
|
+
o.rotateZ(y.z > 0 ? Math.PI - S : S - Math.PI), (e.mirrored === 2 || e.mirrored === 4) && o.rotateX(Math.PI);
|
|
22442
22442
|
}
|
|
22443
22443
|
break;
|
|
22444
22444
|
case 4:
|
|
@@ -22446,9 +22446,9 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
22446
22446
|
break;
|
|
22447
22447
|
case 5:
|
|
22448
22448
|
if (e.startPoint && e.endPoint) {
|
|
22449
|
-
const d = new p.Vector3(e.startPoint.x, e.startPoint.y, e.startPoint.z), u = new p.Vector3(e.endPoint.x, e.endPoint.y, e.endPoint.z), f = new p.Vector3().subVectors(d, u), m = f.length(), b = m / l,
|
|
22450
|
-
if (
|
|
22451
|
-
const E = (m - l) / (
|
|
22449
|
+
const d = new p.Vector3(e.startPoint.x, e.startPoint.y, e.startPoint.z), u = new p.Vector3(e.endPoint.x, e.endPoint.y, e.endPoint.z), f = new p.Vector3().subVectors(d, u), m = f.length(), b = m / l, S = (e.text || "").length;
|
|
22450
|
+
if (S > 1) {
|
|
22451
|
+
const E = (m - l) / (S - 1);
|
|
22452
22452
|
o.userData.letterSpacing = E;
|
|
22453
22453
|
} else
|
|
22454
22454
|
b < 3 && o.scale.setX(b);
|
|
@@ -22616,12 +22616,12 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
22616
22616
|
console.warn("Please upload the pictures in the same folder, or use url link in the dxf file.");
|
|
22617
22617
|
});
|
|
22618
22618
|
y.colorSpace = p.SRGBColorSpace;
|
|
22619
|
-
const
|
|
22619
|
+
const S = new p.MeshBasicMaterial({
|
|
22620
22620
|
transparent: !0,
|
|
22621
22621
|
side: p.FrontSide,
|
|
22622
22622
|
map: y
|
|
22623
22623
|
}), w = new z(H.Mesh);
|
|
22624
|
-
w.geometry = h, w.material =
|
|
22624
|
+
w.geometry = h, w.material = S, o.add(w);
|
|
22625
22625
|
}
|
|
22626
22626
|
const d = new p.EdgesGeometry(h), u = this.getColor(e, i, s), f = new z(H.Line);
|
|
22627
22627
|
f.geometry = d, f.material = this.getLineBasicMaterial(u);
|
|
@@ -22682,6 +22682,7 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
22682
22682
|
const i = e;
|
|
22683
22683
|
if (i.threejsObject) return i.threejsObject.clone();
|
|
22684
22684
|
const s = e.invertBlockMatrix;
|
|
22685
|
+
if (!Array.isArray(s) || s.length < 12) return P.warn("[Dxf] Spatial filter (handle '" + e.handle + "') has no invertBlockMatrix, ignored!"), void 0;
|
|
22685
22686
|
de.set(s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7], s[8], s[9], s[10], s[11], 0, 0, 0, 1);
|
|
22686
22687
|
const n = [];
|
|
22687
22688
|
e.vertices.forEach((o) => {
|
|
@@ -22700,8 +22701,8 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
22700
22701
|
for (let m = 0; m < o; m++) {
|
|
22701
22702
|
const b = n[m];
|
|
22702
22703
|
for (let y = o - 1; y > m; y--) {
|
|
22703
|
-
const
|
|
22704
|
-
if (F.areVector3sEqual(b,
|
|
22704
|
+
const S = n[y];
|
|
22705
|
+
if (F.areVector3sEqual(b, S) && m + 1 < y - 1 && m + 1 < o - 1 && F.areVector3sEqual(n[m + 1], n[y - 1])) {
|
|
22705
22706
|
h.push(b), d = y;
|
|
22706
22707
|
break;
|
|
22707
22708
|
}
|
|
@@ -22753,41 +22754,46 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
22753
22754
|
const i = [];
|
|
22754
22755
|
if (!e)
|
|
22755
22756
|
return i;
|
|
22756
|
-
|
|
22757
|
+
const s = e.type, n = (r) => !!r && Number.isFinite(r.x) && Number.isFinite(r.y);
|
|
22758
|
+
switch (s) {
|
|
22757
22759
|
case Pi.Line: {
|
|
22758
|
-
const
|
|
22759
|
-
|
|
22760
|
+
const r = e;
|
|
22761
|
+
if (!n(r.startPoint) || !n(r.endPoint)) break;
|
|
22762
|
+
i.push(new p.Vector2(r.startPoint.x, r.startPoint.y)), i.push(new p.Vector2(r.endPoint.x, r.endPoint.y));
|
|
22760
22763
|
break;
|
|
22761
22764
|
}
|
|
22762
22765
|
case Pi.Arc: {
|
|
22763
|
-
const
|
|
22764
|
-
|
|
22765
|
-
|
|
22766
|
-
|
|
22767
|
-
|
|
22766
|
+
const r = e;
|
|
22767
|
+
if (!n(r.center) || !Number.isFinite(r.radius) || r.radius <= 0 || !Number.isFinite(r.startAngle) || !Number.isFinite(r.endAngle)) break;
|
|
22768
|
+
let a = r.startAngle * p.MathUtils.DEG2RAD, o = r.endAngle * p.MathUtils.DEG2RAD;
|
|
22769
|
+
!r.bCounterclockwise && (a = Math.PI * 2 - a, o = Math.PI * 2 - o);
|
|
22770
|
+
const l = new p.ArcCurve(r.center.x, r.center.y, r.radius, a, o, !r.bCounterclockwise), h = this.getDivision(a, o, r.radius), d = l.getPoints(h);
|
|
22771
|
+
e.startPoint = d[0], e.endPoint = d[d.length - 1], i.push(...d);
|
|
22768
22772
|
break;
|
|
22769
22773
|
}
|
|
22770
22774
|
case Pi.Ellipse: {
|
|
22771
|
-
const
|
|
22772
|
-
|
|
22773
|
-
|
|
22774
|
-
|
|
22775
|
-
|
|
22775
|
+
const r = e;
|
|
22776
|
+
if (!n(r.center) || !n(r.majorAxisEndPoint) || !Number.isFinite(r.minorRatio) || !Number.isFinite(r.startAngle) || !Number.isFinite(r.endAngle)) break;
|
|
22777
|
+
const a = Math.sqrt(Math.pow(r.majorAxisEndPoint.x, 2) + Math.pow(r.majorAxisEndPoint.y, 2)), o = a * r.minorRatio, l = Math.atan2(r.majorAxisEndPoint.y, r.majorAxisEndPoint.x);
|
|
22778
|
+
let h = r.startAngle * p.MathUtils.DEG2RAD, d = r.endAngle * p.MathUtils.DEG2RAD;
|
|
22779
|
+
!r.bCounterclockwise && (h = Math.PI * 2 - h, d = Math.PI * 2 - d);
|
|
22780
|
+
const u = new p.EllipseCurve(r.center.x, r.center.y, a, o, h, d, !r.bCounterclockwise, l), f = this.getDivision(h, d, Math.max(a, o)), m = u.getPoints(f);
|
|
22781
|
+
e.startPoint = m[0], e.endPoint = m[m.length - 1], i.push(...m);
|
|
22776
22782
|
break;
|
|
22777
22783
|
}
|
|
22778
22784
|
case Pi.Spline: {
|
|
22779
|
-
const
|
|
22780
|
-
if (
|
|
22781
|
-
e.startPoint =
|
|
22782
|
-
...
|
|
22785
|
+
const r = e, a = Va(r.controlPoints, r.degreeOfSplineCurve, r.knotValues);
|
|
22786
|
+
if (a.length === 0) break;
|
|
22787
|
+
e.startPoint = a[0], e.endPoint = a[a.length - 1], i.push(
|
|
22788
|
+
...a
|
|
22783
22789
|
/* 类型桥接:getBSplinePolyline 返回 Vector3[],此处按二维点使用 */
|
|
22784
22790
|
);
|
|
22785
22791
|
break;
|
|
22786
22792
|
}
|
|
22787
22793
|
case Pi.Polyline: {
|
|
22788
|
-
const
|
|
22789
|
-
e.startPoint =
|
|
22790
|
-
...
|
|
22794
|
+
const r = e, a = Zn(r.points, r.isClosed);
|
|
22795
|
+
e.startPoint = a[0], e.endPoint = a[a.length - 1], i.push(
|
|
22796
|
+
...a
|
|
22791
22797
|
/* 类型桥接:getLinePoints 返回 Vector3[],此处按二维点使用 */
|
|
22792
22798
|
);
|
|
22793
22799
|
break;
|
|
@@ -22799,86 +22805,88 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
22799
22805
|
const n = e;
|
|
22800
22806
|
let r = [];
|
|
22801
22807
|
function a(M, O) {
|
|
22802
|
-
const { startPoint:
|
|
22808
|
+
const { startPoint: T, endPoint: v } = M, { startPoint: C, endPoint: _ } = O;
|
|
22809
|
+
if (!T || !v || !C || !_) return null;
|
|
22810
|
+
const A = v.x - T.x, I = v.y - T.y, B = _.x - C.x, k = _.y - C.y, D = A * k - I * B;
|
|
22803
22811
|
if (Math.abs(D) < 1e-10) return null;
|
|
22804
|
-
const R =
|
|
22812
|
+
const R = T.x - C.x, ie = T.y - C.y, se = (B * ie - k * R) / D, ze = (A * ie - I * R) / D;
|
|
22805
22813
|
return se >= 0 && se <= 1 && ze >= 0 && ze <= 1 ? {
|
|
22806
|
-
x:
|
|
22807
|
-
y:
|
|
22814
|
+
x: T.x + se * A,
|
|
22815
|
+
y: T.y + se * I
|
|
22808
22816
|
} : null;
|
|
22809
22817
|
}
|
|
22810
22818
|
function o(M) {
|
|
22811
|
-
const { edges: O } = M,
|
|
22819
|
+
const { edges: O } = M, T = [], v = O.length;
|
|
22812
22820
|
if ({ ...M }, v !== 4) return [M];
|
|
22813
|
-
for (let
|
|
22814
|
-
for (let _ =
|
|
22815
|
-
if (_ ===
|
|
22816
|
-
const A = a(O[
|
|
22817
|
-
A &&
|
|
22818
|
-
edgeIndex1:
|
|
22821
|
+
for (let C = 0; C < v; C++)
|
|
22822
|
+
for (let _ = C + 2; _ < v; _++) {
|
|
22823
|
+
if (_ === C + 1 || C === 0 && _ === v - 1) continue;
|
|
22824
|
+
const A = a(O[C], O[_]);
|
|
22825
|
+
A && T.push({
|
|
22826
|
+
edgeIndex1: C,
|
|
22819
22827
|
edgeIndex2: _,
|
|
22820
22828
|
point: { x: A.x, y: A.y }
|
|
22821
22829
|
});
|
|
22822
22830
|
}
|
|
22823
|
-
if (
|
|
22824
|
-
const
|
|
22831
|
+
if (T.length && T.length === 1) {
|
|
22832
|
+
const C = O[(T[0].edgeIndex1 - 1 + v) % v], _ = {
|
|
22825
22833
|
pathTypeFlag: M.pathTypeFlag,
|
|
22826
22834
|
edges: [
|
|
22827
|
-
|
|
22835
|
+
C,
|
|
22828
22836
|
{
|
|
22829
22837
|
startPoint: {
|
|
22830
|
-
...O[
|
|
22838
|
+
...O[T[0].edgeIndex1].startPoint
|
|
22831
22839
|
},
|
|
22832
22840
|
endPoint: {
|
|
22833
|
-
x:
|
|
22834
|
-
y:
|
|
22841
|
+
x: T[0].point.x,
|
|
22842
|
+
y: T[0].point.y
|
|
22835
22843
|
},
|
|
22836
|
-
type: O[
|
|
22844
|
+
type: O[T[0].edgeIndex1].type
|
|
22837
22845
|
},
|
|
22838
22846
|
{
|
|
22839
22847
|
startPoint: {
|
|
22840
|
-
x:
|
|
22841
|
-
y:
|
|
22848
|
+
x: T[0].point.x,
|
|
22849
|
+
y: T[0].point.y
|
|
22842
22850
|
},
|
|
22843
22851
|
endPoint: {
|
|
22844
|
-
x: O[
|
|
22845
|
-
y: O[
|
|
22852
|
+
x: O[T[0].edgeIndex2].startPoint.x,
|
|
22853
|
+
y: O[T[0].edgeIndex2].startPoint.y
|
|
22846
22854
|
},
|
|
22847
|
-
type: O[
|
|
22855
|
+
type: O[T[0].edgeIndex2].type
|
|
22848
22856
|
}
|
|
22849
22857
|
]
|
|
22850
|
-
},
|
|
22858
|
+
}, A = {
|
|
22851
22859
|
pathTypeFlag: M.pathTypeFlag,
|
|
22852
22860
|
edges: [
|
|
22853
22861
|
{
|
|
22854
22862
|
startPoint: {
|
|
22855
|
-
x:
|
|
22856
|
-
y:
|
|
22863
|
+
x: T[0].point.x - 1e-5,
|
|
22864
|
+
y: T[0].point.y - 1e-5
|
|
22857
22865
|
},
|
|
22858
22866
|
endPoint: {
|
|
22859
|
-
...O[
|
|
22867
|
+
...O[T[0].edgeIndex1].endPoint
|
|
22860
22868
|
},
|
|
22861
|
-
type: O[
|
|
22869
|
+
type: O[T[0].edgeIndex1].type
|
|
22862
22870
|
},
|
|
22863
|
-
{ ...O[
|
|
22871
|
+
{ ...O[T[0].edgeIndex2 - 1] },
|
|
22864
22872
|
{
|
|
22865
|
-
startPoint: O[
|
|
22873
|
+
startPoint: O[T[0].edgeIndex2].startPoint,
|
|
22866
22874
|
endPoint: {
|
|
22867
|
-
x:
|
|
22868
|
-
y:
|
|
22875
|
+
x: T[0].point.x - 1e-5,
|
|
22876
|
+
y: T[0].point.y - 1e-5
|
|
22869
22877
|
},
|
|
22870
|
-
type: O[
|
|
22878
|
+
type: O[T[0].edgeIndex2].type
|
|
22871
22879
|
}
|
|
22872
22880
|
]
|
|
22873
22881
|
};
|
|
22874
|
-
return [
|
|
22882
|
+
return [_, A];
|
|
22875
22883
|
}
|
|
22876
22884
|
return [M];
|
|
22877
22885
|
}
|
|
22878
22886
|
if (n.boundaryPaths.length == 0) return;
|
|
22879
22887
|
for (let M = 0; M < n.boundaryPaths.length; M++) {
|
|
22880
|
-
const O = n.boundaryPaths[M],
|
|
22881
|
-
r = [...r, ...
|
|
22888
|
+
const O = n.boundaryPaths[M], T = o(O);
|
|
22889
|
+
r = [...r, ...T];
|
|
22882
22890
|
}
|
|
22883
22891
|
if (n.boundaryPaths = r, !n.solidFill && !n.patternLines?.length) {
|
|
22884
22892
|
P.warn("[Dxf] Hatch entity(handle: '" + n.handle + "') doesn't have solid fill, nor patternLines, ignored!");
|
|
@@ -22886,49 +22894,49 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
22886
22894
|
}
|
|
22887
22895
|
const l = [], h = [], d = [], u = (M) => {
|
|
22888
22896
|
const O = [];
|
|
22889
|
-
let
|
|
22890
|
-
|
|
22897
|
+
let T = [];
|
|
22898
|
+
T.push(...this.convertEdgeToPoints(M[0]));
|
|
22891
22899
|
for (let v = 1; v < M.length; v++) {
|
|
22892
|
-
const
|
|
22893
|
-
if (
|
|
22900
|
+
const C = this.convertEdgeToPoints(M[v]);
|
|
22901
|
+
if (T.push(...C), T.length > 2) {
|
|
22894
22902
|
const _ = this.convertEdgeToPoints(M[v - 1]);
|
|
22895
|
-
F.areVector2sEqual(_[_.length - 1],
|
|
22903
|
+
F.areVector2sEqual(_[_.length - 1], C[0]) ? F.areVector2sEqual(T[0], C[C.length - 1], 1e-5) && (O.push(T), T = []) : F.areVector2sEqual(_[0], C[C.length - 1]) ? F.areVector2sEqual(T[1], C[0], 1e-5) && (O.push(T), T = []) : T = [];
|
|
22896
22904
|
}
|
|
22897
22905
|
}
|
|
22898
22906
|
return O;
|
|
22899
22907
|
};
|
|
22900
22908
|
if (n.boundaryPaths.forEach((M, O) => {
|
|
22901
|
-
let
|
|
22909
|
+
let T = [];
|
|
22902
22910
|
if (this.IsfilteredByPathTypeFlag(M.pathTypeFlag)) {
|
|
22903
22911
|
P.info("[Dxf] The %d path type flag is filtered at the %dth boundrayPath (hatch handle '%s')", M.pathTypeFlag, O, n.handle);
|
|
22904
22912
|
return;
|
|
22905
22913
|
}
|
|
22906
22914
|
const v = M.edges;
|
|
22907
22915
|
if (v.length === 0) return;
|
|
22908
|
-
const
|
|
22916
|
+
const C = [];
|
|
22909
22917
|
for (let _ = 0; _ < v.length; _++) {
|
|
22910
22918
|
const A = this.convertEdgeToPoints(v[_]);
|
|
22911
22919
|
if (A.length < 2) {
|
|
22912
22920
|
P.warn("[Dxf] The %dth edge of the %dth boundaryPath (hatch handle '%s') has less than 2 points, ignored!", _, O, n.handle);
|
|
22913
22921
|
continue;
|
|
22914
22922
|
}
|
|
22915
|
-
|
|
22923
|
+
C.push(...A);
|
|
22916
22924
|
}
|
|
22917
|
-
if (
|
|
22925
|
+
if (C.length < 3) {
|
|
22918
22926
|
P.warn("[Dxf] The %dth boundaryPath (hatch handle '%s') has less than 3 points, ignored!", O, n.handle);
|
|
22919
22927
|
return;
|
|
22920
22928
|
}
|
|
22921
|
-
if (
|
|
22929
|
+
if (T.push(C), M.pathTypeFlag > Ao.MaxFlags && (!((A) => {
|
|
22922
22930
|
for (let I = 1; I < A.length; ++I) {
|
|
22923
22931
|
const B = A[I - 1].endPoint, k = A[I].startPoint;
|
|
22924
22932
|
if (!B || !k || !F.areVector2sEqual(B, k)) return !1;
|
|
22925
22933
|
}
|
|
22926
22934
|
return !0;
|
|
22927
|
-
})(M.edges) || !n.associativity) && (
|
|
22935
|
+
})(M.edges) || !n.associativity) && (T = u(v), T.length < 2)) {
|
|
22928
22936
|
P.warn("[Dxf] The %dth boundaryPath (hatch handle '%s') has unknown path, ignored!", O, n.handle);
|
|
22929
22937
|
return;
|
|
22930
22938
|
}
|
|
22931
|
-
|
|
22939
|
+
T.forEach((_) => {
|
|
22932
22940
|
!F.areVector2sEqual(_[0], _[_.length - 1]) && _.push(_[0]);
|
|
22933
22941
|
const A = _.map((I) => new p.Vector2(V.roundNumber(I.x, 7), V.roundNumber(I.y, 7)));
|
|
22934
22942
|
if (A?.length > 0) {
|
|
@@ -22949,10 +22957,10 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
22949
22957
|
d.forEach((M) => {
|
|
22950
22958
|
b.push(M.index);
|
|
22951
22959
|
});
|
|
22952
|
-
const y = this.buildContainHierarchyTree(l, h, b),
|
|
22953
|
-
this.buildHatchGeometry(l, y,
|
|
22960
|
+
const y = this.buildContainHierarchyTree(l, h, b), S = [];
|
|
22961
|
+
this.buildHatchGeometry(l, y, S);
|
|
22954
22962
|
let w;
|
|
22955
|
-
if (
|
|
22963
|
+
if (S.length > 0 && (w = Oe(S)), !w || !w.getIndex() || w.getIndex()?.count === 0) return P.warn("[Dxf] Failed to convert hatch boundaries!"), void 0;
|
|
22956
22964
|
const x = new z(H.Mesh);
|
|
22957
22965
|
x.geometry = w, x.material = wi, this.setHatchMaterial(x, n, i, f, s);
|
|
22958
22966
|
const E = x;
|
|
@@ -22983,26 +22991,26 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
22983
22991
|
b = x;
|
|
22984
22992
|
break;
|
|
22985
22993
|
}
|
|
22986
|
-
let
|
|
22994
|
+
let S;
|
|
22987
22995
|
if (b)
|
|
22988
|
-
if (this.meshTextureMaterials[b])
|
|
22996
|
+
if (this.meshTextureMaterials[b]) S = this.meshTextureMaterials[b];
|
|
22989
22997
|
else
|
|
22990
22998
|
for (let w = 0; w < i.objects.XRECORD.length; w++) {
|
|
22991
22999
|
const x = i.objects.XRECORD[w];
|
|
22992
23000
|
if (x.handle === b) {
|
|
22993
|
-
const E = x.binaryData, M = V.hexToBase64(E), O = "data:image/jpg;base64," + M,
|
|
22994
|
-
|
|
23001
|
+
const E = x.binaryData, M = V.hexToBase64(E), O = "data:image/jpg;base64," + M, T = new p.TextureLoader(this.manager).load(O);
|
|
23002
|
+
T.colorSpace = p.SRGBColorSpace;
|
|
22995
23003
|
const v = new p.MeshBasicMaterial({
|
|
22996
23004
|
transparent: !0,
|
|
22997
|
-
map:
|
|
23005
|
+
map: T
|
|
22998
23006
|
});
|
|
22999
|
-
this.meshTextureMaterials[b] = v,
|
|
23007
|
+
this.meshTextureMaterials[b] = v, S = v;
|
|
23000
23008
|
break;
|
|
23001
23009
|
}
|
|
23002
23010
|
}
|
|
23003
|
-
if (
|
|
23011
|
+
if (S) {
|
|
23004
23012
|
const w = new p.Box2().setFromPoints(o), x = w.getSize(ts), E = new p.PlaneGeometry(x.x, x.y), M = new z(H.Mesh);
|
|
23005
|
-
M.geometry = E, M.material =
|
|
23013
|
+
M.geometry = E, M.material = S;
|
|
23006
23014
|
const O = w.getCenter(ts);
|
|
23007
23015
|
U.set(O.x, O.y, 0), h && (this.setRTCUserData(M), U.x += l.x, U.y += l.y), M.matrix.setPosition(U), M.layers.enableAll(), m.add(M);
|
|
23008
23016
|
}
|
|
@@ -23075,8 +23083,8 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
23075
23083
|
let b = !1;
|
|
23076
23084
|
const y = new p.Vector3();
|
|
23077
23085
|
this.enableRTC && (b = N.checkAndRebasePositionsOnRTC(m, y));
|
|
23078
|
-
const
|
|
23079
|
-
w.geometry =
|
|
23086
|
+
const S = new p.BufferGeometry().setFromPoints(m), w = new z(H.Line);
|
|
23087
|
+
w.geometry = S, w.material = pe, w.userData.entityType = e.type, w.userData.inPaperSpace = [], w.layers.enableAll(), b && (this.setRTCUserData(w), w.matrix.setPosition(y.x, y.y, 0));
|
|
23080
23088
|
const x = new z();
|
|
23081
23089
|
return x.add(u), x.add(w), u;
|
|
23082
23090
|
}
|
|
@@ -23247,12 +23255,12 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
23247
23255
|
const m = new p.Vector2(f.origin.x, f.origin.y).sub(s).rotateAround(d, -p.MathUtils.degToRad(e.patternAngle)), b = new p.Vector2(f.delta.x, f.delta.y).rotateAround(d, -p.MathUtils.degToRad(f.angle));
|
|
23248
23256
|
if (b.y === 0) return P.warn("[Dxf] delta.y is equal to zero !"), void 0;
|
|
23249
23257
|
const y = f.dashPattern.length;
|
|
23250
|
-
let
|
|
23258
|
+
let S = !0, w = 0;
|
|
23251
23259
|
for (let v = 0; v < y; ++v) {
|
|
23252
|
-
const
|
|
23253
|
-
|
|
23260
|
+
const C = f.dashPattern[v];
|
|
23261
|
+
C > 0 && (S = !1), w += Math.abs(C);
|
|
23254
23262
|
}
|
|
23255
|
-
const x =
|
|
23263
|
+
const x = S ? a : r, E = [], M = [];
|
|
23256
23264
|
let O = 0;
|
|
23257
23265
|
M[0] = O;
|
|
23258
23266
|
for (let v = 0; v < y; ++v)
|
|
@@ -23261,7 +23269,7 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
23261
23269
|
E[v] = 0;
|
|
23262
23270
|
for (let v = M.length; v < o + 1; ++v)
|
|
23263
23271
|
M[v] = O;
|
|
23264
|
-
const
|
|
23272
|
+
const T = {
|
|
23265
23273
|
origin: m,
|
|
23266
23274
|
delta: b,
|
|
23267
23275
|
angle: f.angle - e.patternAngle,
|
|
@@ -23273,7 +23281,7 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
23273
23281
|
P.warn("[Dxf] There will be warning in fragment shader when number of uniforms exceeds 1024, so extra hatch line patterns are ignored here!");
|
|
23274
23282
|
break;
|
|
23275
23283
|
}
|
|
23276
|
-
h.push(
|
|
23284
|
+
h.push(T);
|
|
23277
23285
|
}
|
|
23278
23286
|
const u = ed(h, e.patternAngle, j.CameraZoomUniform, new p.Color(i), this.overrideHatchPatternLineThickness);
|
|
23279
23287
|
return u.defines = {
|
|
@@ -23388,8 +23396,8 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
23388
23396
|
inverted: !1
|
|
23389
23397
|
};
|
|
23390
23398
|
try {
|
|
23391
|
-
m.forEach((y,
|
|
23392
|
-
if (Yt.epsilon(F.getVector2RelativeEps(e[y][0]), 1e-6),
|
|
23399
|
+
m.forEach((y, S) => {
|
|
23400
|
+
if (Yt.epsilon(F.getVector2RelativeEps(e[y][0]), 1e-6), S === 0) b = Yt.segments({
|
|
23393
23401
|
regions: [o(e[y])],
|
|
23394
23402
|
inverted: !1
|
|
23395
23403
|
});
|
|
@@ -23669,50 +23677,50 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
23669
23677
|
b.push(y);
|
|
23670
23678
|
continue;
|
|
23671
23679
|
}
|
|
23672
|
-
let
|
|
23680
|
+
let S, w = y;
|
|
23673
23681
|
for (; w; ) {
|
|
23674
23682
|
if (w.userData.isLayoutLevelObject) {
|
|
23675
|
-
|
|
23683
|
+
S = w;
|
|
23676
23684
|
break;
|
|
23677
23685
|
}
|
|
23678
23686
|
w = w.parent;
|
|
23679
23687
|
}
|
|
23680
|
-
if (!
|
|
23681
|
-
const x =
|
|
23688
|
+
if (!S) continue;
|
|
23689
|
+
const x = S.name;
|
|
23682
23690
|
!m[x] && (m[x] = {
|
|
23683
|
-
object:
|
|
23691
|
+
object: S,
|
|
23684
23692
|
children: []
|
|
23685
23693
|
}), m[x].children.push(y);
|
|
23686
23694
|
}
|
|
23687
23695
|
for (const y in m) {
|
|
23688
|
-
const
|
|
23696
|
+
const S = m[y], w = Dt.deepMerge(S.children, S.object, !1, !1, !0), x = w.added, E = w.removed;
|
|
23689
23697
|
!s[y] && (s[y] = {
|
|
23690
|
-
object:
|
|
23698
|
+
object: S.object,
|
|
23691
23699
|
children: []
|
|
23692
23700
|
}), !n[y] && (n[y] = {
|
|
23693
|
-
object:
|
|
23701
|
+
object: S.object,
|
|
23694
23702
|
children: []
|
|
23695
23703
|
});
|
|
23696
23704
|
const M = E.length > r;
|
|
23697
23705
|
if (M) {
|
|
23698
23706
|
const O = Date.now();
|
|
23699
|
-
j.removeEmptyObjectsFromRemovingMarkedObjects2(E,
|
|
23707
|
+
j.removeEmptyObjectsFromRemovingMarkedObjects2(E, S.object), o += Date.now() - O;
|
|
23700
23708
|
} else a += E.length;
|
|
23701
|
-
if (E.length ===
|
|
23709
|
+
if (E.length === S.children.length) !M && E.forEach((O) => {
|
|
23702
23710
|
s[y].children.push(O);
|
|
23703
23711
|
});
|
|
23704
23712
|
else {
|
|
23705
23713
|
let O = E;
|
|
23706
23714
|
E.length >= 100 && (O = new Set(E));
|
|
23707
|
-
const
|
|
23708
|
-
for (let v = 0; v <
|
|
23709
|
-
const
|
|
23710
|
-
C
|
|
23715
|
+
const T = (v) => Array.isArray(O) ? O.indexOf(v) >= 0 : O.has(v);
|
|
23716
|
+
for (let v = 0; v < S.children.length; v++) {
|
|
23717
|
+
const C = S.children[v];
|
|
23718
|
+
T(C) ? !M && s[y].children.push(C) : b.push(C);
|
|
23711
23719
|
}
|
|
23712
23720
|
}
|
|
23713
23721
|
for (let O = 0; O < x.length; O++) {
|
|
23714
|
-
const
|
|
23715
|
-
b.push(
|
|
23722
|
+
const T = x[O];
|
|
23723
|
+
b.push(T), n[y].children.push(T);
|
|
23716
23724
|
}
|
|
23717
23725
|
a > r && l();
|
|
23718
23726
|
}
|
|
@@ -23732,83 +23740,83 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
23732
23740
|
static async merge(e, i) {
|
|
23733
23741
|
const s = V.getUpdateProgressFuncAsync(i), n = {};
|
|
23734
23742
|
e.objects.LAYOUT.forEach((y) => {
|
|
23735
|
-
const
|
|
23736
|
-
n[
|
|
23743
|
+
const S = y;
|
|
23744
|
+
n[S.layoutName] = S, S.directAssociatedLeafObjectSet?.clear();
|
|
23737
23745
|
});
|
|
23738
23746
|
const r = Date.now(), a = {}, o = {}, l = 15e3;
|
|
23739
23747
|
let h = 0, d = 0;
|
|
23740
23748
|
const u = () => {
|
|
23741
23749
|
const y = Date.now();
|
|
23742
|
-
for (const
|
|
23743
|
-
const w = a[
|
|
23750
|
+
for (const S in a) {
|
|
23751
|
+
const w = a[S];
|
|
23744
23752
|
j.removeEmptyObjectsFromRemovingMarkedObjects(w.children, w.object), w.children = [];
|
|
23745
23753
|
}
|
|
23746
23754
|
h = 0, d += Date.now() - y;
|
|
23747
23755
|
}, f = Object.keys(e.layersAndThreejsObjects).length;
|
|
23748
23756
|
let m = 0;
|
|
23749
23757
|
for (const y in e.layersAndThreejsObjects) {
|
|
23750
|
-
const
|
|
23751
|
-
if (
|
|
23758
|
+
const S = e.layersAndThreejsObjects[y];
|
|
23759
|
+
if (S.length <= 1) {
|
|
23752
23760
|
await s(++m / f * 100);
|
|
23753
23761
|
continue;
|
|
23754
23762
|
}
|
|
23755
23763
|
const w = Date.now(), x = {}, E = [];
|
|
23756
|
-
for (const
|
|
23757
|
-
if (
|
|
23758
|
-
E.push(
|
|
23764
|
+
for (const T of S) {
|
|
23765
|
+
if (T.userData.isSnapObject) {
|
|
23766
|
+
E.push(T);
|
|
23759
23767
|
continue;
|
|
23760
23768
|
}
|
|
23761
|
-
let v,
|
|
23762
|
-
for (;
|
|
23763
|
-
if (
|
|
23764
|
-
v =
|
|
23769
|
+
let v, C = T;
|
|
23770
|
+
for (; C; ) {
|
|
23771
|
+
if (C.userData.isLayoutLevelObject) {
|
|
23772
|
+
v = C;
|
|
23765
23773
|
break;
|
|
23766
23774
|
}
|
|
23767
|
-
|
|
23775
|
+
C = C.parent;
|
|
23768
23776
|
}
|
|
23769
23777
|
if (!v) continue;
|
|
23770
23778
|
const _ = v.name;
|
|
23771
23779
|
!x[_] && (x[_] = {
|
|
23772
23780
|
object: v,
|
|
23773
23781
|
children: []
|
|
23774
|
-
}), x[_].children.push(
|
|
23782
|
+
}), x[_].children.push(T);
|
|
23775
23783
|
}
|
|
23776
23784
|
const M = Object.keys(x).length;
|
|
23777
23785
|
let O = 0;
|
|
23778
|
-
for (const
|
|
23786
|
+
for (const T in x) {
|
|
23779
23787
|
let v;
|
|
23780
|
-
if (
|
|
23781
|
-
const k = n[
|
|
23788
|
+
if (T !== j.MODEL_LAYOUT_NAME) {
|
|
23789
|
+
const k = n[T];
|
|
23782
23790
|
!k.directAssociatedLeafObjectSet && (k.directAssociatedLeafObjectSet = /* @__PURE__ */ new Set()), v = k.directAssociatedLeafObjectSet;
|
|
23783
23791
|
}
|
|
23784
|
-
const
|
|
23785
|
-
!a[
|
|
23786
|
-
object:
|
|
23792
|
+
const C = x[T], _ = ye.deepMerge(C.children, C.object, !1, !1, !0), A = _.added, I = _.removed;
|
|
23793
|
+
!a[T] && (a[T] = {
|
|
23794
|
+
object: C.object,
|
|
23787
23795
|
children: []
|
|
23788
|
-
}), !o[
|
|
23789
|
-
object:
|
|
23796
|
+
}), !o[T] && (o[T] = {
|
|
23797
|
+
object: C.object,
|
|
23790
23798
|
children: []
|
|
23791
23799
|
});
|
|
23792
23800
|
const B = I.length > l;
|
|
23793
23801
|
if (B) {
|
|
23794
23802
|
const k = Date.now();
|
|
23795
|
-
j.removeEmptyObjectsFromRemovingMarkedObjects(I,
|
|
23803
|
+
j.removeEmptyObjectsFromRemovingMarkedObjects(I, C.object), d += Date.now() - k;
|
|
23796
23804
|
} else h += I.length;
|
|
23797
|
-
if (I.length ===
|
|
23798
|
-
a[
|
|
23805
|
+
if (I.length === C.children.length) !B && I.forEach((k) => {
|
|
23806
|
+
a[T].children.push(k);
|
|
23799
23807
|
});
|
|
23800
23808
|
else {
|
|
23801
23809
|
let k = I;
|
|
23802
23810
|
I.length >= 100 && (k = new Set(I));
|
|
23803
23811
|
const D = (R) => Array.isArray(k) ? k.indexOf(R) >= 0 : k.has(R);
|
|
23804
|
-
for (let R = 0; R <
|
|
23805
|
-
const ie =
|
|
23806
|
-
D(ie) ? !B && a[
|
|
23812
|
+
for (let R = 0; R < C.children.length; R++) {
|
|
23813
|
+
const ie = C.children[R];
|
|
23814
|
+
D(ie) ? !B && a[T].children.push(ie) : (E.push(ie), v && v.add(ie));
|
|
23807
23815
|
}
|
|
23808
23816
|
}
|
|
23809
23817
|
for (let k = 0; k < A.length; k++) {
|
|
23810
23818
|
const D = A[k];
|
|
23811
|
-
Q.setSharedVariablesOfObject(D), E.push(D), o[
|
|
23819
|
+
Q.setSharedVariablesOfObject(D), E.push(D), o[T].children.push(D), v && v.add(D);
|
|
23812
23820
|
}
|
|
23813
23821
|
h > l && u(), await s((m + ++O / M) / f * 100);
|
|
23814
23822
|
}
|
|
@@ -23816,7 +23824,7 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
23816
23824
|
}
|
|
23817
23825
|
h > 0 && u();
|
|
23818
23826
|
for (const y in o) {
|
|
23819
|
-
const
|
|
23827
|
+
const S = o[y], w = e.threejsObject.children.find((x) => x.name === y);
|
|
23820
23828
|
if (w) {
|
|
23821
23829
|
const x = w.children.find((E) => E.name === j.SNAP_GROUP_NAME);
|
|
23822
23830
|
if (x && y !== j.MODEL_LAYOUT_NAME) {
|
|
@@ -23824,9 +23832,9 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
23824
23832
|
!E.directAssociatedLeafObjectSet && (E.directAssociatedLeafObjectSet = /* @__PURE__ */ new Set()), x.children.forEach((M) => E.directAssociatedLeafObjectSet?.add(M));
|
|
23825
23833
|
}
|
|
23826
23834
|
}
|
|
23827
|
-
!w && e.threejsObject.add(
|
|
23828
|
-
!x.visible && (x.userData.layerVisible = !1),
|
|
23829
|
-
}),
|
|
23835
|
+
!w && e.threejsObject.add(S.object), S.children.forEach((x) => {
|
|
23836
|
+
!x.visible && (x.userData.layerVisible = !1), S.object.add(x), x.updateWorldMatrix(!1, !1);
|
|
23837
|
+
}), S.children = [];
|
|
23830
23838
|
}
|
|
23831
23839
|
P.debug("[Dxf] MergeUtils.deepMerge took " + ye.MergeInfo.elapsedTime / 1e3 + "s"), P.debug("[Dxf] The remove operation of deep merge took " + d / 1e3 + "s"), P.debug("[Dxf] Deep merge totally took " + (Date.now() - r) / 1e3 + "s");
|
|
23832
23840
|
const b = ye.MergeInfo;
|
|
@@ -24117,7 +24125,7 @@ class ys extends Or {
|
|
|
24117
24125
|
let a = i.$PEXTMIN, o = i.$PEXTMAX;
|
|
24118
24126
|
const l = i.$ANGDIR;
|
|
24119
24127
|
if (r && r.length > 0) {
|
|
24120
|
-
const h = r.filter((
|
|
24128
|
+
const h = r.filter((S) => parseInt(S.viewportId) === 1);
|
|
24121
24129
|
let d;
|
|
24122
24130
|
h.length > 0 ? d = h[0] : d = r[0];
|
|
24123
24131
|
const { centerPoint: u, width_paperSpace: f, height_paperSpace: m } = d, b = X.getDcs2WcsMatrix(d, l), y = new p.Vector3(u.x, u.y, 0);
|
|
@@ -24278,25 +24286,25 @@ class ys extends Or {
|
|
|
24278
24286
|
const l = r.psBBox.min, h = r.psBBox.max, d = new p.Box2(
|
|
24279
24287
|
new p.Vector2(l.x, l.y),
|
|
24280
24288
|
new p.Vector2(h.x, h.y)
|
|
24281
|
-
), u = ai.generateSectionPlanesByBox(d), f = [], m = (
|
|
24282
|
-
if (Array.isArray(
|
|
24289
|
+
), u = ai.generateSectionPlanesByBox(d), f = [], m = (C) => (!f[C.id] && (f[C.id] = C.clone(), this.setMaterialUniforms(f[C.id], s.dxfData), ai.setMaterialSection(f[C.id], u)), f[C.id]), b = (C) => {
|
|
24290
|
+
if (Array.isArray(C)) {
|
|
24283
24291
|
const _ = [];
|
|
24284
|
-
return
|
|
24292
|
+
return C.forEach((A) => {
|
|
24285
24293
|
const I = m(A);
|
|
24286
24294
|
_.push(I);
|
|
24287
24295
|
}), _;
|
|
24288
|
-
} else return m(
|
|
24296
|
+
} else return m(C);
|
|
24289
24297
|
}, y = [...n, ...i.frozenLayerHandles || []];
|
|
24290
|
-
let
|
|
24298
|
+
let S;
|
|
24291
24299
|
if (e !== X.MODEL_LAYOUT_NAME) {
|
|
24292
|
-
const
|
|
24293
|
-
!
|
|
24300
|
+
const C = r;
|
|
24301
|
+
!C.associatedLeafObjectSet && (C.associatedLeafObjectSet = /* @__PURE__ */ new Set()), S = C.associatedLeafObjectSet;
|
|
24294
24302
|
}
|
|
24295
24303
|
const w = new p.Group();
|
|
24296
24304
|
w.name = r.viewportId;
|
|
24297
24305
|
const x = [];
|
|
24298
|
-
if (o.forEach((
|
|
24299
|
-
const _ =
|
|
24306
|
+
if (o.forEach((C) => {
|
|
24307
|
+
const _ = C.clone();
|
|
24300
24308
|
_.traverse((A) => {
|
|
24301
24309
|
const I = A;
|
|
24302
24310
|
if (I.material && I.geometry) {
|
|
@@ -24305,35 +24313,35 @@ class ys extends Or {
|
|
|
24305
24313
|
x.push(I);
|
|
24306
24314
|
return;
|
|
24307
24315
|
}
|
|
24308
|
-
I.userData.layerVisible !== !1 && (I.visible = !0), I.material = b(I.material),
|
|
24316
|
+
I.userData.layerVisible !== !1 && (I.visible = !0), I.material = b(I.material), S?.add(I);
|
|
24309
24317
|
const k = s.getObjectsByLayer(B);
|
|
24310
24318
|
k ? k.push(I) : P.warn(
|
|
24311
24319
|
"[Viewer] Failed to find object for modelId '" + this.modelId + "', layer '" + B + "', layout '" + e + "'"
|
|
24312
24320
|
);
|
|
24313
24321
|
}
|
|
24314
24322
|
}), w.add(_);
|
|
24315
|
-
}),
|
|
24323
|
+
}), S && S.size === 0) return;
|
|
24316
24324
|
const E = s.getModelObject();
|
|
24317
24325
|
let M = s.getLayoutLevelObject(e);
|
|
24318
24326
|
!M && (M = new p.Group(), Q.setSharedVariablesOfObject(M), M.name = e, E?.add(M)), M.add(w), w.applyMatrix4(r.msToPsMatrix), w.updateMatrixWorld(!0);
|
|
24319
|
-
let O = M.children.find((
|
|
24327
|
+
let O = M.children.find((C) => C.name === X.SNAP_GROUP_NAME);
|
|
24320
24328
|
!O && (O = new p.Group(), O.visible = X.SHOW_SNAP_OBJECT, O.name = X.SNAP_GROUP_NAME, M.add(O));
|
|
24321
|
-
const
|
|
24322
|
-
v && v.traverse((
|
|
24323
|
-
if (!
|
|
24324
|
-
const _ =
|
|
24325
|
-
if (this.isLayerFrozenForViewport(_, y) || (Kn.makeEmpty(), Kn.expandByObject(
|
|
24326
|
-
const A =
|
|
24329
|
+
const T = s.getLayoutLevelObject(X.MODEL_LAYOUT_NAME), v = T?.children.find((C) => C.name === X.SNAP_GROUP_NAME);
|
|
24330
|
+
v && v.traverse((C) => {
|
|
24331
|
+
if (!C.geometry) return;
|
|
24332
|
+
const _ = C.userData.layerName;
|
|
24333
|
+
if (this.isLayerFrozenForViewport(_, y) || (Kn.makeEmpty(), Kn.expandByObject(C), !a.intersectsBox(Kn))) return;
|
|
24334
|
+
const A = C.clone();
|
|
24327
24335
|
Q.setSharedVariablesOfObject(A);
|
|
24328
24336
|
let I = A.parent;
|
|
24329
24337
|
const B = vi.identity();
|
|
24330
24338
|
for (; I && I.userData.isLayoutLevelObject !== !0; )
|
|
24331
24339
|
B.premultiply(I.matrix), I = I.parent;
|
|
24332
|
-
B.premultiply(r.msToPsMatrix), A.applyMatrix4(B), O?.add(A),
|
|
24340
|
+
B.premultiply(r.msToPsMatrix), A.applyMatrix4(B), O?.add(A), S?.add(A);
|
|
24333
24341
|
const k = s.getObjectsByLayer(_);
|
|
24334
24342
|
k && k.push(A);
|
|
24335
|
-
}), x.length > 0 && Q.removeEmptyObjectsFromRemovingObjects(x, w), w.traverse((
|
|
24336
|
-
Q.setSharedVariablesOfObject(
|
|
24343
|
+
}), x.length > 0 && Q.removeEmptyObjectsFromRemovingObjects(x, w), w.traverse((C) => {
|
|
24344
|
+
Q.setSharedVariablesOfObject(C), this.addSpatialFilterSection(C, s.dxfData, !0);
|
|
24337
24345
|
});
|
|
24338
24346
|
}
|
|
24339
24347
|
setMaterialUniforms(e, i) {
|
|
@@ -26475,9 +26483,9 @@ class U1 extends El {
|
|
|
26475
26483
|
d.length === 0 && (d = this.getVertexColorArray(i.length, m?.color)), f.setAttribute("color", new p.Float32BufferAttribute(d, 3));
|
|
26476
26484
|
const b = a.length > 0;
|
|
26477
26485
|
b && f.setAttribute("barycentric", new p.BufferAttribute(a, 1));
|
|
26478
|
-
const y = this.materialManager?.createBatchMaterial(l, m, b),
|
|
26486
|
+
const y = this.materialManager?.createBatchMaterial(l, m, b), S = new p.Mesh(f, y), w = new p.Mesh(f, this.materialManager?.pickMaterial);
|
|
26479
26487
|
return {
|
|
26480
|
-
mesh:
|
|
26488
|
+
mesh: S,
|
|
26481
26489
|
pickMesh: w,
|
|
26482
26490
|
batchTable: h
|
|
26483
26491
|
};
|
|
@@ -26490,7 +26498,7 @@ class U1 extends El {
|
|
|
26490
26498
|
);
|
|
26491
26499
|
const b = o.length > 0;
|
|
26492
26500
|
b && m.setAttribute("barycentric", new p.BufferAttribute(o, 1));
|
|
26493
|
-
const y = this.propertyParser.getMaterialParameters(d),
|
|
26501
|
+
const y = this.propertyParser.getMaterialParameters(d), S = this.materialManager?.createInstanceMaterial(d, y, b), w = new p.InstancedMesh(m, S, f);
|
|
26494
26502
|
w.instanceMatrix = new p.InstancedBufferAttribute(new Float32Array(l), 16);
|
|
26495
26503
|
let x = n;
|
|
26496
26504
|
x.length === 0 && (x = this.getVertexColorArray(f * 3, y?.color)), w.instanceColor = new p.InstancedBufferAttribute(x, 3);
|
|
@@ -26518,8 +26526,8 @@ class U1 extends El {
|
|
|
26518
26526
|
if (u > -1) {
|
|
26519
26527
|
const f = new p.BufferGeometry(), m = o.geometry.getAttribute("position"), b = o.geometry.index, y = o.geometry.getAttribute("tileObjectId");
|
|
26520
26528
|
if (o instanceof p.InstancedMesh) {
|
|
26521
|
-
const
|
|
26522
|
-
o.getMatrixAt(u,
|
|
26529
|
+
const S = new p.Matrix4();
|
|
26530
|
+
o.getMatrixAt(u, S), f.setAttribute("position", m.clone());
|
|
26523
26531
|
const w = y.array[u * y.itemSize];
|
|
26524
26532
|
f.setAttribute(
|
|
26525
26533
|
"tileObjectId",
|
|
@@ -26527,21 +26535,21 @@ class U1 extends El {
|
|
|
26527
26535
|
new Array(m.array.length / 3).fill(w),
|
|
26528
26536
|
1
|
|
26529
26537
|
)
|
|
26530
|
-
), b && f.setIndex(b), f.applyMatrix4(
|
|
26538
|
+
), b && f.setIndex(b), f.applyMatrix4(S);
|
|
26531
26539
|
} else {
|
|
26532
|
-
const { indexStart:
|
|
26540
|
+
const { indexStart: S, indexCount: w, positionStart: x, positionCount: E } = o.userData.batchTable.find(
|
|
26533
26541
|
(_) => _.userId === d
|
|
26534
26542
|
), M = m.itemSize, O = m.array.slice(
|
|
26535
26543
|
x * M,
|
|
26536
26544
|
x * M + E * M
|
|
26537
|
-
),
|
|
26538
|
-
f.setAttribute("position",
|
|
26545
|
+
), T = new p.Float32BufferAttribute(O, M);
|
|
26546
|
+
f.setAttribute("position", T);
|
|
26539
26547
|
const v = y.array.slice(
|
|
26540
26548
|
x,
|
|
26541
26549
|
x + E
|
|
26542
|
-
),
|
|
26543
|
-
if (f.setAttribute("tileObjectId",
|
|
26544
|
-
const _ = b.array.slice(
|
|
26550
|
+
), C = new p.Int32BufferAttribute(v, 1);
|
|
26551
|
+
if (f.setAttribute("tileObjectId", C), b) {
|
|
26552
|
+
const _ = b.array.slice(S, S + w);
|
|
26545
26553
|
for (let A = 0; A < _.length; A++)
|
|
26546
26554
|
_[A] -= x;
|
|
26547
26555
|
f.setIndex(new p.BufferAttribute(_, 1));
|
|
@@ -26563,7 +26571,7 @@ class U1 extends El {
|
|
|
26563
26571
|
const d = new p.Group();
|
|
26564
26572
|
d.name = "TileGroup-pick", o.forEach((f) => {
|
|
26565
26573
|
const { mesh: m, pickMesh: b, batchTable: y } = this.createBatchedMesh(f);
|
|
26566
|
-
h.add(m), m.userData.batchTable = y, m.userData.userIds = y.map((
|
|
26574
|
+
h.add(m), m.userData.batchTable = y, m.userData.userIds = y.map((S) => S.userId), d.add(b);
|
|
26567
26575
|
}), l.forEach((f) => {
|
|
26568
26576
|
const { mesh: m, pickMesh: b, userIds: y } = this.createInstancedMesh(f);
|
|
26569
26577
|
h.add(m), m.userData.userIds = y, d.add(b);
|
|
@@ -26674,8 +26682,8 @@ class U1 extends El {
|
|
|
26674
26682
|
const b = u.pixelSize;
|
|
26675
26683
|
m = e.geometricError / (b * f);
|
|
26676
26684
|
} else {
|
|
26677
|
-
const b = a.distanceToPoint(u.position), y = b * f,
|
|
26678
|
-
m = e.geometricError / (y *
|
|
26685
|
+
const b = a.distanceToPoint(u.position), y = b * f, S = u.sseDenominator;
|
|
26686
|
+
m = e.geometricError / (y * S), l = Math.min(l, y);
|
|
26679
26687
|
}
|
|
26680
26688
|
o = Math.max(o, m);
|
|
26681
26689
|
}
|
|
@@ -27203,16 +27211,16 @@ function Ya(c, t, e, i, s = 1 / 0, n, r) {
|
|
|
27203
27211
|
i = Math.max(1e-4, i);
|
|
27204
27212
|
const a = 2 / i, o = a * n, l = 1 / (1 + o + 0.48 * o * o + 0.235 * o * o * o);
|
|
27205
27213
|
let h = t.x, d = t.y, u = t.z, f = c.x - h, m = c.y - d, b = c.z - u;
|
|
27206
|
-
const y = h,
|
|
27214
|
+
const y = h, S = d, w = u, x = s * i, E = x * x, M = f * f + m * m + b * b;
|
|
27207
27215
|
if (M > E) {
|
|
27208
27216
|
const D = Math.sqrt(M);
|
|
27209
27217
|
f = f / D * x, m = m / D * x, b = b / D * x;
|
|
27210
27218
|
}
|
|
27211
27219
|
h = c.x - f, d = c.y - m, u = c.z - b;
|
|
27212
|
-
const O = (e.x + a * f) * n,
|
|
27213
|
-
e.x = (e.x - a * O) * l, e.y = (e.y - a *
|
|
27214
|
-
const
|
|
27215
|
-
return
|
|
27220
|
+
const O = (e.x + a * f) * n, T = (e.y + a * m) * n, v = (e.z + a * b) * n;
|
|
27221
|
+
e.x = (e.x - a * O) * l, e.y = (e.y - a * T) * l, e.z = (e.z - a * v) * l, r.x = h + (f + O) * l, r.y = d + (m + T) * l, r.z = u + (b + v) * l;
|
|
27222
|
+
const C = y - c.x, _ = S - c.y, A = w - c.z, I = r.x - y, B = r.y - S, k = r.z - w;
|
|
27223
|
+
return C * I + _ * B + A * k > 0 && (r.x = y, r.y = S, r.z = w, e.x = (r.x - y) / n, e.y = (r.y - S) / n, e.z = (r.z - w) / n), r;
|
|
27216
27224
|
}
|
|
27217
27225
|
const qs = 1 / 8, q1 = Le.isBrowser && /Mac/.test(navigator.platform), Y1 = !(Le.isBrowser && "PointerEvent" in window);
|
|
27218
27226
|
let W, Xa, Ys, er, Ve, Y, te, Ti, ft, pt, Jt, Za, Ka, it, rs, Ci, $a, tr, Ja, ir, sr, Xs;
|
|
@@ -27473,21 +27481,21 @@ class $ extends W1 {
|
|
|
27473
27481
|
bottom: 0
|
|
27474
27482
|
}, this._activePointers = [], this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._isUserControllingOffset = !1, this._isUserControllingZoom = !1, this._thetaVelocity = { value: 0 }, this._phiVelocity = { value: 0 }, this._radiusVelocity = { value: 0 }, this._targetVelocity = new W.Vector3(), this._focalOffsetVelocity = new W.Vector3(), this._zoomVelocity = { value: 0 }, this._truckInternal = (x, E, M) => {
|
|
27475
27483
|
if (rt(this._camera)) {
|
|
27476
|
-
const O = Y.copy(this._camera.position).sub(this._target),
|
|
27477
|
-
this.verticalDragToForward ? (M ? this.setFocalOffset(this._focalOffsetEnd.x +
|
|
27484
|
+
const O = Y.copy(this._camera.position).sub(this._target), T = this._camera.getEffectiveFOV() * is, v = O.length() * Math.tan(T * 0.5), C = this.truckSpeed * x * v / this._elementRect.height, _ = this.truckSpeed * E * v / this._elementRect.height;
|
|
27485
|
+
this.verticalDragToForward ? (M ? this.setFocalOffset(this._focalOffsetEnd.x + C, this._focalOffsetEnd.y, this._focalOffsetEnd.z, !0) : this.truck(C, 0, !0), this.forward(-_, !0)) : M ? this.setFocalOffset(this._focalOffsetEnd.x + C, this._focalOffsetEnd.y + _, this._focalOffsetEnd.z, !0) : this.truck(C, _, !0);
|
|
27478
27486
|
} else if (Ue(this._camera)) {
|
|
27479
|
-
const O = this._camera,
|
|
27480
|
-
M ? this.setFocalOffset(this._focalOffsetEnd.x +
|
|
27487
|
+
const O = this._camera, T = this.truckSpeed * x * (O.right - O.left) / O.zoom / this._elementRect.width, v = this.truckSpeed * E * (O.top - O.bottom) / O.zoom / this._elementRect.height;
|
|
27488
|
+
M ? this.setFocalOffset(this._focalOffsetEnd.x + T, this._focalOffsetEnd.y + v, this._focalOffsetEnd.z, !0) : this.truck(T, v, !0);
|
|
27481
27489
|
}
|
|
27482
27490
|
}, this._rotateInternal = (x, E) => {
|
|
27483
27491
|
const M = Mi * this.azimuthRotateSpeed * x / this._elementRect.height, O = Mi * this.polarRotateSpeed * E / this._elementRect.height;
|
|
27484
27492
|
this.rotate(M, O, !0);
|
|
27485
27493
|
}, this._dollyInternal = (x, E, M) => {
|
|
27486
|
-
const O = Math.pow(0.95, -x * this.dollySpeed),
|
|
27487
|
-
this.dollyTo(
|
|
27494
|
+
const O = Math.pow(0.95, -x * this.dollySpeed), T = this._sphericalEnd.radius * O, v = this._sphericalEnd.radius, C = v * (x >= 0 ? -1 : 1);
|
|
27495
|
+
this.dollyTo(T), this.infinityDolly && (T < this.minDistance || this.maxDistance === this.minDistance) && (this._camera.getWorldDirection(Y), this._targetEnd.add(Y.normalize().multiplyScalar(C)), this._target.add(Y.normalize().multiplyScalar(C))), this.dollyToCursor && (this._dollyControlAmount += this._sphericalEnd.radius - v, this.infinityDolly && (T < this.minDistance || this.maxDistance === this.minDistance) && (this._dollyControlAmount -= C), this._dollyControlCoord.set(E, M));
|
|
27488
27496
|
}, this._zoomInternal = (x, E, M) => {
|
|
27489
|
-
const O = Math.pow(0.95, x * this.dollySpeed),
|
|
27490
|
-
this.zoomTo(this._zoom * O), this.dollyToCursor && (this._dollyControlAmount += this._zoomEnd -
|
|
27497
|
+
const O = Math.pow(0.95, x * this.dollySpeed), T = this._zoomEnd;
|
|
27498
|
+
this.zoomTo(this._zoom * O), this.dollyToCursor && (this._dollyControlAmount += this._zoomEnd - T, this._dollyControlCoord.set(E, M));
|
|
27491
27499
|
}, typeof W > "u" && console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."), this._camera = e, this._yAxisUpSpace = new W.Quaternion().setFromUnitVectors(this._camera.up, Ys), this._yAxisUpSpaceInverse = this._yAxisUpSpace.clone().invert(), this._state = L.NONE, this._target = new W.Vector3(), this._targetEnd = this._target.clone(), this._focalOffset = new W.Vector3(), this._focalOffsetEnd = this._focalOffset.clone(), this._spherical = new W.Spherical().setFromVector3(Y.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)), this._sphericalEnd = this._spherical.clone(), this._zoom = this._camera.zoom, this._zoomEnd = this._zoom, this._nearPlaneCorners = [new W.Vector3(), new W.Vector3(), new W.Vector3(), new W.Vector3()], this._updateNearPlaneCorners(), this._boundary = new W.Box3(new W.Vector3(-1 / 0, -1 / 0, -1 / 0), new W.Vector3(1 / 0, 1 / 0, 1 / 0)), this._target0 = this._target.clone(), this._position0 = this._camera.position.clone(), this._zoom0 = this._zoom, this._focalOffset0 = this._focalOffset.clone(), this._dollyControlAmount = 0, this._dollyControlCoord = new W.Vector2(), this.mouseButtons = {
|
|
27492
27500
|
left: L.ROTATE,
|
|
27493
27501
|
middle: L.DOLLY,
|
|
@@ -27547,11 +27555,11 @@ class $ extends W1 {
|
|
|
27547
27555
|
}
|
|
27548
27556
|
else
|
|
27549
27557
|
this._state = 0, (x.buttons & q.LEFT) === q.LEFT && (this._state = this._state | this.mouseButtons.left), (x.buttons & q.MIDDLE) === q.MIDDLE && (this._state = this._state | this.mouseButtons.middle), (x.buttons & q.RIGHT) === q.RIGHT && (this._state = this._state | this.mouseButtons.right);
|
|
27550
|
-
|
|
27558
|
+
S();
|
|
27551
27559
|
}
|
|
27552
27560
|
}, h = (x) => {
|
|
27553
27561
|
const E = this._findPointerById(0);
|
|
27554
|
-
E && (E.clientX = x.clientX, E.clientY = x.clientY, E.deltaX = x.movementX, E.deltaY = x.movementY, this._state = 0, (x.buttons & q.LEFT) === q.LEFT && (this._state = this._state | this.mouseButtons.left), (x.buttons & q.MIDDLE) === q.MIDDLE && (this._state = this._state | this.mouseButtons.middle), (x.buttons & q.RIGHT) === q.RIGHT && (this._state = this._state | this.mouseButtons.right),
|
|
27562
|
+
E && (E.clientX = x.clientX, E.clientY = x.clientY, E.deltaX = x.movementX, E.deltaY = x.movementY, this._state = 0, (x.buttons & q.LEFT) === q.LEFT && (this._state = this._state | this.mouseButtons.left), (x.buttons & q.MIDDLE) === q.MIDDLE && (this._state = this._state | this.mouseButtons.middle), (x.buttons & q.RIGHT) === q.RIGHT && (this._state = this._state | this.mouseButtons.right), S());
|
|
27555
27563
|
}, d = (x) => {
|
|
27556
27564
|
const E = x.pointerId, M = this._findPointerById(E);
|
|
27557
27565
|
if (M && this._activePointers.splice(this._activePointers.indexOf(M), 1), x.pointerType === "touch")
|
|
@@ -27583,7 +27591,7 @@ class $ extends W1 {
|
|
|
27583
27591
|
const v = performance.now();
|
|
27584
27592
|
f - v < 1e3 && this._getClientRect(this._elementRect), f = v;
|
|
27585
27593
|
}
|
|
27586
|
-
const E = q1 ? -1 : -3, M = x.deltaMode === 1 ? x.deltaY / E : x.deltaY / (E * 10), O = this.dollyToCursor ? (x.clientX - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0,
|
|
27594
|
+
const E = q1 ? -1 : -3, M = x.deltaMode === 1 ? x.deltaY / E : x.deltaY / (E * 10), O = this.dollyToCursor ? (x.clientX - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, T = this.dollyToCursor ? (x.clientY - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
|
|
27587
27595
|
switch (this.mouseButtons.wheel) {
|
|
27588
27596
|
case L.ROTATE: {
|
|
27589
27597
|
this._rotateInternal(x.deltaX, x.deltaY), this._isUserControllingRotate = !0;
|
|
@@ -27598,11 +27606,11 @@ class $ extends W1 {
|
|
|
27598
27606
|
break;
|
|
27599
27607
|
}
|
|
27600
27608
|
case L.DOLLY: {
|
|
27601
|
-
this._dollyInternal(-M, O,
|
|
27609
|
+
this._dollyInternal(-M, O, T), this._isUserControllingDolly = !0;
|
|
27602
27610
|
break;
|
|
27603
27611
|
}
|
|
27604
27612
|
case L.ZOOM: {
|
|
27605
|
-
this._zoomInternal(-M, O,
|
|
27613
|
+
this._zoomInternal(-M, O, T), this._isUserControllingZoom = !0;
|
|
27606
27614
|
break;
|
|
27607
27615
|
}
|
|
27608
27616
|
}
|
|
@@ -27616,10 +27624,10 @@ class $ extends W1 {
|
|
|
27616
27624
|
}, y = (x) => {
|
|
27617
27625
|
if (!this._enabled) return;
|
|
27618
27626
|
if (Jn(this._activePointers, Ve), this._getClientRect(this._elementRect), s.copy(Ve), n.copy(Ve), this._activePointers.length >= 2) {
|
|
27619
|
-
const M = Ve.x - this._activePointers[1].clientX, O = Ve.y - this._activePointers[1].clientY,
|
|
27620
|
-
r.set(0,
|
|
27621
|
-
const v = (this._activePointers[0].clientX + this._activePointers[1].clientX) * 0.5,
|
|
27622
|
-
n.set(v,
|
|
27627
|
+
const M = Ve.x - this._activePointers[1].clientX, O = Ve.y - this._activePointers[1].clientY, T = Math.sqrt(M * M + O * O);
|
|
27628
|
+
r.set(0, T);
|
|
27629
|
+
const v = (this._activePointers[0].clientX + this._activePointers[1].clientX) * 0.5, C = (this._activePointers[0].clientY + this._activePointers[1].clientY) * 0.5;
|
|
27630
|
+
n.set(v, C);
|
|
27623
27631
|
}
|
|
27624
27632
|
if ("pointerType" in x && x.pointerType === "touch")
|
|
27625
27633
|
switch (this._activePointers.length) {
|
|
@@ -27636,19 +27644,19 @@ class $ extends W1 {
|
|
|
27636
27644
|
else
|
|
27637
27645
|
this._state = 0, (x.buttons & q.LEFT) === q.LEFT && (this._state = this._state | this.mouseButtons.left), (x.buttons & q.MIDDLE) === q.MIDDLE && (this._state = this._state | this.mouseButtons.middle), (x.buttons & q.RIGHT) === q.RIGHT && (this._state = this._state | this.mouseButtons.right);
|
|
27638
27646
|
((this._state & L.ROTATE) === L.ROTATE || (this._state & L.TOUCH_ROTATE) === L.TOUCH_ROTATE || (this._state & L.TOUCH_DOLLY_ROTATE) === L.TOUCH_DOLLY_ROTATE || (this._state & L.TOUCH_ZOOM_ROTATE) === L.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 & L.TRUCK) === L.TRUCK || (this._state & L.TOUCH_TRUCK) === L.TOUCH_TRUCK || (this._state & L.TOUCH_DOLLY_TRUCK) === L.TOUCH_DOLLY_TRUCK || (this._state & L.TOUCH_ZOOM_TRUCK) === L.TOUCH_ZOOM_TRUCK) && (this._targetEnd.copy(this._target), this._targetVelocity.set(0, 0, 0)), ((this._state & L.DOLLY) === L.DOLLY || (this._state & L.TOUCH_DOLLY) === L.TOUCH_DOLLY || (this._state & L.TOUCH_DOLLY_TRUCK) === L.TOUCH_DOLLY_TRUCK || (this._state & L.TOUCH_DOLLY_OFFSET) === L.TOUCH_DOLLY_OFFSET || (this._state & L.TOUCH_DOLLY_ROTATE) === L.TOUCH_DOLLY_ROTATE) && (this._sphericalEnd.radius = this._spherical.radius, this._radiusVelocity.value = 0), ((this._state & L.ZOOM) === L.ZOOM || (this._state & L.TOUCH_ZOOM) === L.TOUCH_ZOOM || (this._state & L.TOUCH_ZOOM_TRUCK) === L.TOUCH_ZOOM_TRUCK || (this._state & L.TOUCH_ZOOM_OFFSET) === L.TOUCH_ZOOM_OFFSET || (this._state & L.TOUCH_ZOOM_ROTATE) === L.TOUCH_ZOOM_ROTATE) && (this._zoomEnd = this._zoom, this._zoomVelocity.value = 0), ((this._state & L.OFFSET) === L.OFFSET || (this._state & L.TOUCH_OFFSET) === L.TOUCH_OFFSET || (this._state & L.TOUCH_DOLLY_OFFSET) === L.TOUCH_DOLLY_OFFSET || (this._state & L.TOUCH_ZOOM_OFFSET) === L.TOUCH_ZOOM_OFFSET) && (this._focalOffsetEnd.copy(this._focalOffset), this._focalOffsetVelocity.set(0, 0, 0)), this.dispatchEvent({ type: "controlstart" });
|
|
27639
|
-
},
|
|
27647
|
+
}, S = () => {
|
|
27640
27648
|
if (!this._enabled) return;
|
|
27641
27649
|
Jn(this._activePointers, Ve);
|
|
27642
27650
|
const x = Le.isBrowser ? this._domElement && document.pointerLockElement === this._domElement : !1, E = x ? -this._activePointers[0].deltaX : n.x - Ve.x, M = x ? -this._activePointers[0].deltaY : n.y - Ve.y;
|
|
27643
27651
|
if (n.copy(Ve), ((this._state & L.ROTATE) === L.ROTATE || (this._state & L.TOUCH_ROTATE) === L.TOUCH_ROTATE || (this._state & L.TOUCH_DOLLY_ROTATE) === L.TOUCH_DOLLY_ROTATE || (this._state & L.TOUCH_ZOOM_ROTATE) === L.TOUCH_ZOOM_ROTATE) && (this._rotateInternal(E, M), this._isUserControllingRotate = !0), (this._state & L.DOLLY) === L.DOLLY || (this._state & L.ZOOM) === L.ZOOM) {
|
|
27644
|
-
const O = this.dollyToCursor ? (s.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0,
|
|
27645
|
-
(this._state & L.DOLLY) === L.DOLLY ? (this._dollyInternal(M * qs, O,
|
|
27652
|
+
const O = this.dollyToCursor ? (s.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, T = this.dollyToCursor ? (s.y - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
|
|
27653
|
+
(this._state & L.DOLLY) === L.DOLLY ? (this._dollyInternal(M * qs, O, T), this._isUserControllingDolly = !0) : (this._zoomInternal(M * qs, O, T), this._isUserControllingZoom = !0);
|
|
27646
27654
|
}
|
|
27647
27655
|
if ((this._state & L.TOUCH_DOLLY) === L.TOUCH_DOLLY || (this._state & L.TOUCH_ZOOM) === L.TOUCH_ZOOM || (this._state & L.TOUCH_DOLLY_TRUCK) === L.TOUCH_DOLLY_TRUCK || (this._state & L.TOUCH_ZOOM_TRUCK) === L.TOUCH_ZOOM_TRUCK || (this._state & L.TOUCH_DOLLY_OFFSET) === L.TOUCH_DOLLY_OFFSET || (this._state & L.TOUCH_ZOOM_OFFSET) === L.TOUCH_ZOOM_OFFSET || (this._state & L.TOUCH_DOLLY_ROTATE) === L.TOUCH_DOLLY_ROTATE || (this._state & L.TOUCH_ZOOM_ROTATE) === L.TOUCH_ZOOM_ROTATE) {
|
|
27648
|
-
const O = Ve.x - this._activePointers[1].clientX,
|
|
27656
|
+
const O = Ve.x - this._activePointers[1].clientX, T = Ve.y - this._activePointers[1].clientY, v = Math.sqrt(O * O + T * T), C = r.y - v;
|
|
27649
27657
|
r.set(0, v);
|
|
27650
27658
|
const _ = this.dollyToCursor ? (n.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, A = this.dollyToCursor ? (n.y - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
|
|
27651
|
-
(this._state & L.TOUCH_DOLLY) === L.TOUCH_DOLLY || (this._state & L.TOUCH_DOLLY_ROTATE) === L.TOUCH_DOLLY_ROTATE || (this._state & L.TOUCH_DOLLY_TRUCK) === L.TOUCH_DOLLY_TRUCK || (this._state & L.TOUCH_DOLLY_OFFSET) === L.TOUCH_DOLLY_OFFSET ? (this._dollyInternal(
|
|
27659
|
+
(this._state & L.TOUCH_DOLLY) === L.TOUCH_DOLLY || (this._state & L.TOUCH_DOLLY_ROTATE) === L.TOUCH_DOLLY_ROTATE || (this._state & L.TOUCH_DOLLY_TRUCK) === L.TOUCH_DOLLY_TRUCK || (this._state & L.TOUCH_DOLLY_OFFSET) === L.TOUCH_DOLLY_OFFSET ? (this._dollyInternal(C * qs, _, A), this._isUserControllingDolly = !0) : (this._zoomInternal(C * qs, _, A), this._isUserControllingZoom = !0);
|
|
27652
27660
|
}
|
|
27653
27661
|
((this._state & L.TRUCK) === L.TRUCK || (this._state & L.TOUCH_TRUCK) === L.TOUCH_TRUCK || (this._state & L.TOUCH_DOLLY_TRUCK) === L.TOUCH_DOLLY_TRUCK || (this._state & L.TOUCH_ZOOM_TRUCK) === L.TOUCH_ZOOM_TRUCK) && (this._truckInternal(E, M, !1), this._isUserControllingTruck = !0), ((this._state & L.OFFSET) === L.OFFSET || (this._state & L.TOUCH_OFFSET) === L.TOUCH_OFFSET || (this._state & L.TOUCH_DOLLY_OFFSET) === L.TOUCH_DOLLY_OFFSET || (this._state & L.TOUCH_ZOOM_OFFSET) === L.TOUCH_ZOOM_OFFSET) && (this._truckInternal(E, M, !0), this._isUserControllingOffset = !0), this.dispatchEvent({ type: "control" });
|
|
27654
27662
|
}, w = () => {
|
|
@@ -28053,12 +28061,12 @@ class $ extends W1 {
|
|
|
28053
28061
|
b && m.multiply(ir.setFromAxisAngle(Ys, d)), m.multiply(this._yAxisUpSpaceInverse);
|
|
28054
28062
|
const y = $a.makeEmpty();
|
|
28055
28063
|
te.copy(h.min).applyQuaternion(m), y.expandByPoint(te), te.copy(h.min).setX(h.max.x).applyQuaternion(m), y.expandByPoint(te), te.copy(h.min).setY(h.max.y).applyQuaternion(m), y.expandByPoint(te), te.copy(h.max).setZ(h.min.z).applyQuaternion(m), y.expandByPoint(te), te.copy(h.min).setZ(h.max.z).applyQuaternion(m), y.expandByPoint(te), te.copy(h.max).setY(h.min.y).applyQuaternion(m), y.expandByPoint(te), te.copy(h.max).setX(h.min.x).applyQuaternion(m), y.expandByPoint(te), te.copy(h.max).applyQuaternion(m), y.expandByPoint(te), y.min.x -= n, y.min.y -= a, y.max.x += r, y.max.y += o, m.setFromUnitVectors(er, f), b && m.premultiply(ir.invert()), m.premultiply(this._yAxisUpSpace);
|
|
28056
|
-
const
|
|
28064
|
+
const S = y.getSize(Y), w = y.getCenter(te).applyQuaternion(m);
|
|
28057
28065
|
if (rt(this._camera)) {
|
|
28058
|
-
const x = this.getDistanceToFitBox(
|
|
28066
|
+
const x = this.getDistanceToFitBox(S.x, S.y, S.z, s);
|
|
28059
28067
|
l.push(this.moveTo(w.x, w.y, w.z, i)), l.push(this.dollyTo(x, i)), l.push(this.setFocalOffset(0, 0, 0, i));
|
|
28060
28068
|
} else if (Ue(this._camera)) {
|
|
28061
|
-
const x = this._camera, E = x.right - x.left, M = x.top - x.bottom, O = s ? Math.max(E /
|
|
28069
|
+
const x = this._camera, E = x.right - x.left, M = x.top - x.bottom, O = s ? Math.max(E / S.x, M / S.y) : Math.min(E / S.x, M / S.y);
|
|
28062
28070
|
l.push(this.moveTo(w.x, w.y, w.z, i)), l.push(this.zoomTo(O, i)), l.push(this.setFocalOffset(0, 0, 0, i));
|
|
28063
28071
|
}
|
|
28064
28072
|
return Promise.all(l);
|
|
@@ -28118,8 +28126,8 @@ class $ extends W1 {
|
|
|
28118
28126
|
*/
|
|
28119
28127
|
lerpLookAt(e, i, s, n, r, a, o, l, h, d, u, f, m, b = !1) {
|
|
28120
28128
|
this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1;
|
|
28121
|
-
const y = Y.set(n, r, a),
|
|
28122
|
-
it.setFromVector3(
|
|
28129
|
+
const y = Y.set(n, r, a), S = te.set(e, i, s);
|
|
28130
|
+
it.setFromVector3(S.sub(y).applyQuaternion(this._yAxisUpSpace));
|
|
28123
28131
|
const w = Ti.set(d, u, f), x = te.set(o, l, h);
|
|
28124
28132
|
rs.setFromVector3(x.sub(w).applyQuaternion(this._yAxisUpSpace)), this._targetEnd.copy(y.lerp(w, m));
|
|
28125
28133
|
const E = rs.theta - it.theta, M = rs.phi - it.phi, O = rs.radius - it.radius;
|
|
@@ -28128,8 +28136,8 @@ class $ extends W1 {
|
|
|
28128
28136
|
it.phi + M * m,
|
|
28129
28137
|
it.theta + E * m
|
|
28130
28138
|
), this.normalizeRotations(), this._needsUpdate = !0, b || (this._target.copy(this._targetEnd), this._spherical.copy(this._sphericalEnd));
|
|
28131
|
-
const
|
|
28132
|
-
return this._createOnRestPromise(
|
|
28139
|
+
const T = !b || re(this._target.x, this._targetEnd.x, this.restThreshold) && re(this._target.y, this._targetEnd.y, this.restThreshold) && re(this._target.z, this._targetEnd.z, this.restThreshold) && re(this._spherical.theta, this._sphericalEnd.theta, this.restThreshold) && re(this._spherical.phi, this._sphericalEnd.phi, this.restThreshold) && re(this._spherical.radius, this._sphericalEnd.radius, this.restThreshold);
|
|
28140
|
+
return this._createOnRestPromise(T);
|
|
28133
28141
|
}
|
|
28134
28142
|
/**
|
|
28135
28143
|
* Set angle and distance by given position.
|
|
@@ -28343,8 +28351,8 @@ class $ extends W1 {
|
|
|
28343
28351
|
this._dollyControlCoord.x,
|
|
28344
28352
|
this._dollyControlCoord.y,
|
|
28345
28353
|
(u.near + u.far) / (u.near - u.far)
|
|
28346
|
-
).unproject(u), m = te.set(0, 0, -1).applyQuaternion(u.quaternion), b = Ti.copy(f).add(m.multiplyScalar(-f.dot(u.up))),
|
|
28347
|
-
this._targetEnd.lerp(b,
|
|
28354
|
+
).unproject(u), m = te.set(0, 0, -1).applyQuaternion(u.quaternion), b = Ti.copy(f).add(m.multiplyScalar(-f.dot(u.up))), S = -(this._zoom - this._dollyControlAmount - this._zoomEnd) / this._zoom, w = Y.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).normalize().negate(), x = this._targetEnd.dot(w);
|
|
28355
|
+
this._targetEnd.lerp(b, S);
|
|
28348
28356
|
const E = this._targetEnd.dot(w), M = w.multiplyScalar(E - x);
|
|
28349
28357
|
this._targetEnd.sub(M);
|
|
28350
28358
|
}
|
|
@@ -29057,7 +29065,7 @@ function Qa(c, t, e, i, s) {
|
|
|
29057
29065
|
let a, o, l, h, d, u, f, m;
|
|
29058
29066
|
if (n.o) {
|
|
29059
29067
|
const b = n._cachedOutline || (n._cachedOutline = n.o.split(" "));
|
|
29060
|
-
for (let y = 0,
|
|
29068
|
+
for (let y = 0, S = b.length; y < S; )
|
|
29061
29069
|
switch (b[y++]) {
|
|
29062
29070
|
case "m":
|
|
29063
29071
|
a = b[y++] * t + e, o = b[y++] * t + i, r.moveTo(a, o);
|
|
@@ -29406,13 +29414,13 @@ const gt = class gt {
|
|
|
29406
29414
|
let m = u & 7;
|
|
29407
29415
|
m == 0 && (m = 8);
|
|
29408
29416
|
const b = Math.PI / 4;
|
|
29409
|
-
let y = b * m,
|
|
29410
|
-
u < 0 && (
|
|
29417
|
+
let y = b * m, S = gt.CIRCLE_SPAN;
|
|
29418
|
+
u < 0 && (S = -S, y = -y);
|
|
29411
29419
|
const w = b * f, x = w + y, E = s.clone().sub(new p.Vector2(Math.cos(w) * d, Math.sin(w) * d));
|
|
29412
29420
|
if (s = E.clone().add(new p.Vector2(Math.cos(x) * d, Math.sin(x) * d)), o) {
|
|
29413
29421
|
let M = w;
|
|
29414
29422
|
const O = !0;
|
|
29415
|
-
for (; O && (M +=
|
|
29423
|
+
for (; O && (M += S, !!Number.isFinite(M)); )
|
|
29416
29424
|
if (u >= 0 && M < x || u < 0 && M > x) r.push(E.clone().add(new p.Vector2(d * Math.cos(M), d * Math.sin(M))));
|
|
29417
29425
|
else break;
|
|
29418
29426
|
r.push(s.clone());
|
|
@@ -29421,20 +29429,20 @@ const gt = class gt {
|
|
|
29421
29429
|
break;
|
|
29422
29430
|
case 11:
|
|
29423
29431
|
{
|
|
29424
|
-
const d = e[++l], u = e[++l], f = e[++l], m = e[++l], b = (f * 255 + m) * i, y = J.byteTosbyte(e[++l]),
|
|
29432
|
+
const d = e[++l], u = e[++l], f = e[++l], m = e[++l], b = (f * 255 + m) * i, y = J.byteTosbyte(e[++l]), S = (y & 112) >> 4;
|
|
29425
29433
|
let w = y & 7;
|
|
29426
29434
|
w == 0 && (w = 8), u != 0 && w--;
|
|
29427
29435
|
const x = Math.PI / 4;
|
|
29428
29436
|
let E = x * w, M = gt.CIRCLE_SPAN, O = 1;
|
|
29429
29437
|
y < 0 && (M = -M, E = -E, O = -1);
|
|
29430
|
-
let
|
|
29431
|
-
|
|
29432
|
-
const
|
|
29433
|
-
if (s =
|
|
29434
|
-
let _ =
|
|
29438
|
+
let T = x * S, v = T + E;
|
|
29439
|
+
T += x * d / 256 * O, v += x * u / 256 * O;
|
|
29440
|
+
const C = s.clone().sub(new p.Vector2(b * Math.cos(T), b * Math.sin(T)));
|
|
29441
|
+
if (s = C.clone().add(new p.Vector2(b * Math.cos(v), b * Math.sin(v))), o) {
|
|
29442
|
+
let _ = T;
|
|
29435
29443
|
const A = !0;
|
|
29436
29444
|
for (; A && (_ += M, !!Number.isFinite(_)); )
|
|
29437
|
-
if (y > 0 && _ < v || y < 0 && _ > v) r.push(
|
|
29445
|
+
if (y > 0 && _ < v || y < 0 && _ > v) r.push(C.clone().add(new p.Vector2(b * Math.cos(_), b * Math.sin(_))));
|
|
29438
29446
|
else break;
|
|
29439
29447
|
r.push(s.clone());
|
|
29440
29448
|
}
|
|
@@ -29586,12 +29594,12 @@ const gt = class gt {
|
|
|
29586
29594
|
const f = t.sub(u), m = s.sub(u);
|
|
29587
29595
|
let b = Math.atan2(f.y, f.x);
|
|
29588
29596
|
const y = Math.atan2(m.y, m.x);
|
|
29589
|
-
let
|
|
29590
|
-
n ? (
|
|
29597
|
+
let S = gt.CIRCLE_SPAN;
|
|
29598
|
+
n ? (S = -S, b < y && (b += 2 * Math.PI)) : b > y && (b -= 2 * Math.PI);
|
|
29591
29599
|
let w = b;
|
|
29592
29600
|
const x = !0;
|
|
29593
29601
|
for (; x; ) {
|
|
29594
|
-
if (w +=
|
|
29602
|
+
if (w += S, !n && w < y || n && w > y) return u.add(new p.Vector2(d * Math.cos(w), d * Math.sin(w)));
|
|
29595
29603
|
break;
|
|
29596
29604
|
}
|
|
29597
29605
|
return s;
|
|
@@ -30990,8 +30998,8 @@ class iu {
|
|
|
30990
30998
|
if (n.type === os.POLYGON) {
|
|
30991
30999
|
const b = p.ShapeUtils.triangulateShape(m, []), y = [];
|
|
30992
31000
|
b.forEach((x) => y.push(...x));
|
|
30993
|
-
const
|
|
30994
|
-
|
|
31001
|
+
const S = new p.BufferGeometry();
|
|
31002
|
+
S.setFromPoints(m), S.setIndex(y), e.push(S);
|
|
30995
31003
|
const w = new p.BufferGeometry();
|
|
30996
31004
|
m.length > 2 && !m[0].equals(m[m.length - 1]) && m.push(m[0]), w.setFromPoints(m), i.push(w);
|
|
30997
31005
|
} else {
|
|
@@ -31389,8 +31397,8 @@ class ru {
|
|
|
31389
31397
|
if (y.transferred && (m.attributes.position.array = u), m.index)
|
|
31390
31398
|
e.saveOriginalIndex && !m.userData.originalIndex && (m.userData.originalIndex = m.index.array), P.debug("before update, index:", m.index.array), m.index.array = d.index;
|
|
31391
31399
|
else {
|
|
31392
|
-
const
|
|
31393
|
-
m.setIndex(
|
|
31400
|
+
const S = new wr(d.index, 1, !1);
|
|
31401
|
+
m.setIndex(S);
|
|
31394
31402
|
}
|
|
31395
31403
|
m.index && (P.debug("after update, index:", m.index.array), m.index.needsUpdate = !0), y.setBoundingBox && !m.boundingBox && (m.boundingBox = b.getBoundingBox(new De())), m.boundsTree = b, o();
|
|
31396
31404
|
} else
|
|
@@ -31639,7 +31647,7 @@ function uu(c) {
|
|
|
31639
31647
|
s ? (f = Math.max(f, s.positionStart), m = Math.min(m, s.positionStart + s.positionCount), a = e.array.slice(s.positionStart * 3, (s.positionStart + s.positionCount) * 3)) : (f !== 0 || m !== e.count) && (a = e.array.slice(f * 3, m * 3));
|
|
31640
31648
|
const b = a.length / 3;
|
|
31641
31649
|
r = b > 65535 ? new Uint32Array(b) : new Uint16Array(b);
|
|
31642
|
-
for (let y = 0,
|
|
31650
|
+
for (let y = 0, S = b; y < S; y++)
|
|
31643
31651
|
r[y] = y;
|
|
31644
31652
|
}
|
|
31645
31653
|
const o = Sh.buildEdge(a, r, 20);
|
|
@@ -32029,8 +32037,8 @@ class N0 {
|
|
|
32029
32037
|
if (d) {
|
|
32030
32038
|
let b = Math.max(0, f.start), y = Math.min(d.count, f.start + f.count);
|
|
32031
32039
|
m && (b = Math.max(b, m.indexStart), y = Math.min(y, m.indexStart + m.indexCount));
|
|
32032
|
-
for (let
|
|
32033
|
-
const x = d.getX(
|
|
32040
|
+
for (let S = b, w = y; S < w - 1; S += h) {
|
|
32041
|
+
const x = d.getX(S), E = d.getX(S + 1);
|
|
32034
32042
|
oe.fromBufferAttribute(u, x), Ee.fromBufferAttribute(u, E), oe.applyMatrix4(l.matrixWorld), Ee.applyMatrix4(l.matrixWorld), !i && (oe.setZ(0), Ee.setZ(0));
|
|
32035
32043
|
const M = this.getOsnapInfoFromSegment(t, oe, Ee, s, n, r, a);
|
|
32036
32044
|
M && (r = this.osnapTypePriorities[M.type], o.push(M));
|
|
@@ -32038,16 +32046,16 @@ class N0 {
|
|
|
32038
32046
|
} else {
|
|
32039
32047
|
let b = Math.max(0, f.start), y = Math.min(u.count, f.start + f.count);
|
|
32040
32048
|
m && (b = Math.max(b, m.positionStart), y = Math.min(y, m.positionStart + m.positionCount));
|
|
32041
|
-
for (let
|
|
32042
|
-
oe.fromBufferAttribute(u,
|
|
32049
|
+
for (let S = b, w = y; S < w - 1; S += h) {
|
|
32050
|
+
oe.fromBufferAttribute(u, S), Ee.fromBufferAttribute(u, S + 1), oe.applyMatrix4(l.matrixWorld), Ee.applyMatrix4(l.matrixWorld), !i && (oe.setZ(0), Ee.setZ(0));
|
|
32043
32051
|
const x = this.getOsnapInfoFromSegment(t, oe, Ee, s, n, r, a);
|
|
32044
32052
|
x && (r = this.osnapTypePriorities[x.type], o.push(x));
|
|
32045
32053
|
}
|
|
32046
32054
|
}
|
|
32047
32055
|
if (o.length !== 0)
|
|
32048
32056
|
return o.sort((b, y) => {
|
|
32049
|
-
const
|
|
32050
|
-
return
|
|
32057
|
+
const S = this.osnapTypePriorities[b.type], w = this.osnapTypePriorities[y.type];
|
|
32058
|
+
return S !== w ? S - w : b.distance - y.distance;
|
|
32051
32059
|
}), o[0];
|
|
32052
32060
|
}
|
|
32053
32061
|
getOsnapInfoListFromPoint(t, e, i, s, n) {
|
|
@@ -32746,14 +32754,14 @@ class xu {
|
|
|
32746
32754
|
this.raycaster.params.Line.threshold = u, this.setLayerChannels(i);
|
|
32747
32755
|
const m = 8;
|
|
32748
32756
|
for (let y = 0; y < m; y++) {
|
|
32749
|
-
const
|
|
32757
|
+
const S = y / m * Math.PI * 2, w = Math.cos(S) * s, x = Math.sin(S) * s, E = {
|
|
32750
32758
|
x: t.x + w,
|
|
32751
32759
|
y: t.y + x
|
|
32752
32760
|
}, M = Ae.screen2Ndc(E, this.camera, this.viewerContainer);
|
|
32753
32761
|
this.raycaster.setFromCamera(M, this.camera), this.raycaster.layers.enableAll();
|
|
32754
32762
|
const O = this.raycaster.intersectObjects(e, !0) || [];
|
|
32755
|
-
for (const
|
|
32756
|
-
|
|
32763
|
+
for (const T of O)
|
|
32764
|
+
T.object && !a.has(T.object.uuid) && (a.set(T.object.uuid, T), r.push(T));
|
|
32757
32765
|
}
|
|
32758
32766
|
this.raycaster.setFromCamera(o, this.camera);
|
|
32759
32767
|
const b = this.raycaster.intersectObjects(e, !0) || [];
|
|
@@ -32761,8 +32769,8 @@ class xu {
|
|
|
32761
32769
|
y.object && !a.has(y.object.uuid) && (a.set(y.object.uuid, y), r.push(y));
|
|
32762
32770
|
if (this.raycaster.params.Line.threshold = f, r.length > 1) {
|
|
32763
32771
|
const y = this.raycaster.ray.origin.clone();
|
|
32764
|
-
r.sort((
|
|
32765
|
-
const x =
|
|
32772
|
+
r.sort((S, w) => {
|
|
32773
|
+
const x = S.point || S.object.getWorldPosition(new p.Vector3()), E = w.point || w.object.getWorldPosition(new p.Vector3());
|
|
32766
32774
|
return x.distanceTo(y) - E.distanceTo(y);
|
|
32767
32775
|
});
|
|
32768
32776
|
}
|
|
@@ -33495,7 +33503,7 @@ class $o extends Pr {
|
|
|
33495
33503
|
g(this, "requestHeaders");
|
|
33496
33504
|
/** 打印截图进行中:临时强制显示所有图符/文字,避免低缩放时被"视觉过小"逻辑隐藏 */
|
|
33497
33505
|
g(this, "_printCaptureMode", !1);
|
|
33498
|
-
this.name = at.Viewer2d, this.loadedModels = [], this.masterModelId = "", this.activeLayoutName = "", this.layoutInfos = {}, this.units = void 0, this.enableHideVisuallySmallObjects = e.enableHideVisuallySmallObjects
|
|
33506
|
+
this.name = at.Viewer2d, this.loadedModels = [], this.masterModelId = "", this.activeLayoutName = "", this.layoutInfos = {}, this.units = void 0, this.enableHideVisuallySmallObjects = e.enableHideVisuallySmallObjects === !0, this.sortedHidableObjects = {}, this.lastCameraZoom = 1 / 0, this.loadingDxfCount = 0, e.enableLayoutBar && (this.dxfLayoutBar = new N1(this)), this.cameraManager.setProjection(Et.Orthographic), this.cameraManager.setNavigationMode(xt.Plan);
|
|
33499
33507
|
const i = new p.Vector3(0, 0, 100), s = new p.Vector3(0, 0, 0);
|
|
33500
33508
|
this.cameraManager.setCameraConfig({
|
|
33501
33509
|
eye: i,
|
|
@@ -33693,9 +33701,9 @@ class $o extends Pr {
|
|
|
33693
33701
|
total: 100
|
|
33694
33702
|
})
|
|
33695
33703
|
);
|
|
33696
|
-
}, l = (b, y,
|
|
33704
|
+
}, l = (b, y, S) => {
|
|
33697
33705
|
let w = b.loaded * 100 / b.total;
|
|
33698
|
-
w = w * (
|
|
33706
|
+
w = w * (S - y) / 100 + y, this.progressBar?.updateProgress(r, a, w), i?.(
|
|
33699
33707
|
new ProgressEvent("LoadProgress", {
|
|
33700
33708
|
loaded: w,
|
|
33701
33709
|
total: 100
|
|
@@ -34146,10 +34154,10 @@ class $o extends Pr {
|
|
|
34146
34154
|
O.object.userData?.layerVisible !== !1 && (u.push({ object: O.object, visible: O.object.visible }), O.object.visible = !0);
|
|
34147
34155
|
const { clientWidth: f, clientHeight: m } = this.viewerContainer, b = Math.min(n.capabilities.maxTextureSize || 4096, 8192), y = Math.min(4, b / Math.max(f, m));
|
|
34148
34156
|
y > l && n.setPixelRatio(y), this.cameraManager.update(0), this.dispatchEvent(ce.BeforeRender), n.render(this.scene, this.camera), this.dispatchEvent(ce.AfterRender);
|
|
34149
|
-
const
|
|
34150
|
-
x.width =
|
|
34157
|
+
const S = n.domElement, w = this.overlayRender.getCanvas(), x = document.createElement("canvas");
|
|
34158
|
+
x.width = S.width, x.height = S.height;
|
|
34151
34159
|
const E = x.getContext("2d");
|
|
34152
|
-
if (E.drawImage(
|
|
34160
|
+
if (E.drawImage(S, 0, 0), w && w.width > 0 && w.height > 0 && E.drawImage(w, 0, 0, x.width, x.height), i) {
|
|
34153
34161
|
const O = new p.Color(1973806);
|
|
34154
34162
|
this.scene.background instanceof p.Color ? O.copy(this.scene.background) : n.getClearColor(O), O.convertLinearToSRGB(), this.invertForPrint(x, Math.max(1, Math.round(y / 2)), {
|
|
34155
34163
|
r: O.r * 255,
|
|
@@ -34163,7 +34171,7 @@ class $o extends Pr {
|
|
|
34163
34171
|
O && (M = O);
|
|
34164
34172
|
}
|
|
34165
34173
|
this._printCaptureMode = !1;
|
|
34166
|
-
for (const { object: O, visible:
|
|
34174
|
+
for (const { object: O, visible: T } of u) O.visible = T;
|
|
34167
34175
|
return n.setPixelRatio(l), s.zoomTo(o), s.setLookAt(
|
|
34168
34176
|
r.x,
|
|
34169
34177
|
r.y,
|
|
@@ -34184,47 +34192,47 @@ class $o extends Pr {
|
|
|
34184
34192
|
const n = e.getContext("2d", { willReadFrequently: !0 });
|
|
34185
34193
|
if (!n) return;
|
|
34186
34194
|
const r = e.width, a = e.height, o = n.getImageData(0, 0, r, a), l = o.data, h = r * a, d = 45, u = 0.72, f = new Float32Array(h);
|
|
34187
|
-
for (let
|
|
34188
|
-
const
|
|
34195
|
+
for (let T = 0, v = 0; T < h; T++, v += 4) {
|
|
34196
|
+
const C = l[v], _ = l[v + 1], A = l[v + 2], I = C - s.r, B = _ - s.g, k = A - s.b;
|
|
34189
34197
|
if (Math.sqrt(I * I + B * B + k * k) < d) {
|
|
34190
|
-
l[v] = 255, l[v + 1] = 255, l[v + 2] = 255, f[
|
|
34198
|
+
l[v] = 255, l[v + 1] = 255, l[v + 2] = 255, f[T] = 255;
|
|
34191
34199
|
continue;
|
|
34192
34200
|
}
|
|
34193
|
-
const D =
|
|
34201
|
+
const D = C / 255, R = _ / 255, ie = A / 255, se = Math.max(D, R, ie), ze = Math.min(D, R, ie), ct = (se + ze) / 2, ve = se - ze, Ni = ve === 0 ? 0 : ve / (1 - Math.abs(2 * ct - 1));
|
|
34194
34202
|
let Qe = 0;
|
|
34195
34203
|
ve !== 0 && (se === D ? Qe = (R - ie) / ve % 6 : se === R ? Qe = (ie - D) / ve + 2 : Qe = (D - R) / ve + 4, Qe /= 6, Qe < 0 && (Qe += 1));
|
|
34196
34204
|
const vn = Math.min(0.55, (1 - ct) * u), Ie = (1 - Math.abs(2 * vn - 1)) * Ni, At = Ie * (1 - Math.abs(Qe * 6 % 2 - 1)), Hi = vn - Ie / 2;
|
|
34197
34205
|
let Ht = 0, Gt = 0, Wt = 0;
|
|
34198
34206
|
const qt = Math.floor(Qe * 6) % 6;
|
|
34199
|
-
qt === 0 ? (Ht = Ie, Gt = At) : qt === 1 ? (Ht = At, Gt = Ie) : qt === 2 ? (Gt = Ie, Wt = At) : qt === 3 ? (Gt = At, Wt = Ie) : qt === 4 ? (Ht = At, Wt = Ie) : (Ht = Ie, Wt = At), l[v] = (Ht + Hi) * 255, l[v + 1] = (Gt + Hi) * 255, l[v + 2] = (Wt + Hi) * 255, f[
|
|
34200
|
-
}
|
|
34201
|
-
const m = Math.max(1, i), b = new Float32Array(h), y = new Uint8ClampedArray(h),
|
|
34202
|
-
for (let
|
|
34203
|
-
const v =
|
|
34204
|
-
for (let
|
|
34205
|
-
let _ = 255, A = v +
|
|
34206
|
-
const I = Math.max(0,
|
|
34207
|
+
qt === 0 ? (Ht = Ie, Gt = At) : qt === 1 ? (Ht = At, Gt = Ie) : qt === 2 ? (Gt = Ie, Wt = At) : qt === 3 ? (Gt = At, Wt = Ie) : qt === 4 ? (Ht = At, Wt = Ie) : (Ht = Ie, Wt = At), l[v] = (Ht + Hi) * 255, l[v + 1] = (Gt + Hi) * 255, l[v + 2] = (Wt + Hi) * 255, f[T] = 0.299 * l[v] + 0.587 * l[v + 1] + 0.114 * l[v + 2];
|
|
34208
|
+
}
|
|
34209
|
+
const m = Math.max(1, i), b = new Float32Array(h), y = new Uint8ClampedArray(h), S = new Uint8ClampedArray(h), w = new Uint8ClampedArray(h);
|
|
34210
|
+
for (let T = 0; T < a; T++) {
|
|
34211
|
+
const v = T * r;
|
|
34212
|
+
for (let C = 0; C < r; C++) {
|
|
34213
|
+
let _ = 255, A = v + C;
|
|
34214
|
+
const I = Math.max(0, C - m), B = Math.min(r - 1, C + m);
|
|
34207
34215
|
for (let k = I; k <= B; k++) {
|
|
34208
34216
|
const D = f[v + k];
|
|
34209
34217
|
D < _ && (_ = D, A = v + k);
|
|
34210
34218
|
}
|
|
34211
|
-
b[v +
|
|
34219
|
+
b[v + C] = _, y[v + C] = l[A * 4], S[v + C] = l[A * 4 + 1], w[v + C] = l[A * 4 + 2];
|
|
34212
34220
|
}
|
|
34213
34221
|
}
|
|
34214
34222
|
const x = new Float32Array(h), E = new Uint8ClampedArray(h), M = new Uint8ClampedArray(h), O = new Uint8ClampedArray(h);
|
|
34215
|
-
for (let
|
|
34223
|
+
for (let T = 0; T < r; T++)
|
|
34216
34224
|
for (let v = 0; v < a; v++) {
|
|
34217
|
-
let
|
|
34225
|
+
let C = 255, _ = v * r + T;
|
|
34218
34226
|
const A = Math.max(0, v - m), I = Math.min(a - 1, v + m);
|
|
34219
34227
|
for (let k = A; k <= I; k++) {
|
|
34220
|
-
const D = b[k * r +
|
|
34221
|
-
D <
|
|
34228
|
+
const D = b[k * r + T];
|
|
34229
|
+
D < C && (C = D, _ = k * r + T);
|
|
34222
34230
|
}
|
|
34223
|
-
const B = v * r +
|
|
34224
|
-
x[B] =
|
|
34231
|
+
const B = v * r + T;
|
|
34232
|
+
x[B] = C, E[B] = y[_], M[B] = S[_], O[B] = w[_];
|
|
34225
34233
|
}
|
|
34226
|
-
for (let
|
|
34227
|
-
f[
|
|
34234
|
+
for (let T = 0, v = 0; T < h; T++, v += 4)
|
|
34235
|
+
f[T] > 250 && x[T] < 250 && (l[v] = E[T], l[v + 1] = M[T], l[v + 2] = O[T]);
|
|
34228
34236
|
n.putImageData(o, 0, 0);
|
|
34229
34237
|
}
|
|
34230
34238
|
/**
|
|
@@ -34234,10 +34242,10 @@ class $o extends Pr {
|
|
|
34234
34242
|
cropCanvasToBox(e, i) {
|
|
34235
34243
|
const s = this.camera, n = s.zoom || 1, r = s.position.x, a = s.position.y, o = r + s.left / n, l = r + s.right / n, h = a + s.bottom / n, d = a + s.top / n, u = l - o, f = d - h;
|
|
34236
34244
|
if (u <= 0 || f <= 0) return;
|
|
34237
|
-
const m = (v) => (v - o) / u * e.width, b = (v) => (d - v) / f * e.height, y = Math.max(u, f) * 0.01,
|
|
34245
|
+
const m = (v) => (v - o) / u * e.width, b = (v) => (d - v) / f * e.height, y = Math.max(u, f) * 0.01, S = Math.max(0, Math.floor(m(i.min.x - y))), w = Math.min(e.width, Math.ceil(m(i.max.x + y))), x = Math.max(0, Math.floor(b(i.max.y + y))), E = Math.min(e.height, Math.ceil(b(i.min.y - y))), M = w - S, O = E - x;
|
|
34238
34246
|
if (M < 16 || O < 16) return;
|
|
34239
|
-
const
|
|
34240
|
-
return
|
|
34247
|
+
const T = document.createElement("canvas");
|
|
34248
|
+
return T.width = M, T.height = O, T.getContext("2d").drawImage(e, S, x, M, O, 0, 0, M, O), T.toDataURL("image/png");
|
|
34241
34249
|
}
|
|
34242
34250
|
/**
|
|
34243
34251
|
* Opens the browser print dialog with the image laid out on the selected paper size,
|
|
@@ -34258,17 +34266,17 @@ class $o extends Pr {
|
|
|
34258
34266
|
b.setAttribute("aria-hidden", "true");
|
|
34259
34267
|
const y = 96 / 25.4;
|
|
34260
34268
|
b.style.cssText = `position:fixed;left:-20000px;top:0;border:0;visibility:hidden;width:${Math.ceil(f * y)}px;height:${Math.ceil(m * y)}px;`;
|
|
34261
|
-
const
|
|
34269
|
+
const S = (v) => v.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"), w = l ? "max-width:100%;max-height:100%;width:auto;height:auto;" : "width:100%;height:auto;", x = `<!DOCTYPE html><html><head><meta charset="utf-8"><title>${S(d)}</title><style>@page{size:${r} ${a};margin:${h}mm;}html,body{margin:0;padding:0;background:#fff;}body{display:flex;align-items:center;justify-content:center;width:${f - 2 * h}mm;height:${m - 2 * h}mm;overflow:hidden;}img{display:block;${w}}</style></head><body><img src="${i}" alt="${S(d)}"></body></html>`;
|
|
34262
34270
|
document.body.appendChild(b);
|
|
34263
34271
|
const E = () => {
|
|
34264
34272
|
b.contentWindow?.removeEventListener("afterprint", E), setTimeout(() => b.remove(), 100);
|
|
34265
34273
|
}, M = b.contentDocument;
|
|
34266
34274
|
M.open(), M.write(x), M.close();
|
|
34267
|
-
const O = M.querySelector("img"),
|
|
34275
|
+
const O = M.querySelector("img"), T = () => {
|
|
34268
34276
|
const v = b.contentWindow;
|
|
34269
34277
|
v.addEventListener("afterprint", E), v.focus(), v.print(), setTimeout(E, 6e4);
|
|
34270
34278
|
};
|
|
34271
|
-
O.complete ?
|
|
34279
|
+
O.complete ? T() : (O.onload = T, O.onerror = E);
|
|
34272
34280
|
}
|
|
34273
34281
|
/**
|
|
34274
34282
|
* @description {en} Gets dxf layers.
|
|
@@ -34540,29 +34548,29 @@ class Mu {
|
|
|
34540
34548
|
}));
|
|
34541
34549
|
}, f = (B) => u(B, 0, 15), m = (B) => u(B, 15, 30), b = (B) => u(B, 30, 60), y = (B) => u(B, 60, 95);
|
|
34542
34550
|
V.printMemory("Before comparing"), this.loadingProgressBar?.addProgressItem(l), d(0);
|
|
34543
|
-
let
|
|
34551
|
+
let S = Date.now();
|
|
34544
34552
|
const w = this.loader.parse(n, f), x = this.loader.parse(a, m), [E, M] = await Promise.allSettled([w, x]);
|
|
34545
34553
|
if (E.status === "rejected") return Promise.reject("[DxfCompareHelper] Failed to parse " + n);
|
|
34546
34554
|
if (M.status === "rejected") return Promise.reject("[DxfCompareHelper] Failed to parse " + a);
|
|
34547
|
-
if (P.info("[DxfCompareHelper] loadFiles in " + (Date.now() -
|
|
34548
|
-
const O = E.value,
|
|
34549
|
-
|
|
34550
|
-
const v = await new yt(O,
|
|
34551
|
-
if (P.info("[DxfCompareHelper] Compared in " + (Date.now() -
|
|
34552
|
-
V.printMemory("After getting the comparison results"),
|
|
34553
|
-
const
|
|
34554
|
-
if (this.decreaseJobCount(), !Object.keys(v).length && P.info("[DxfCompareHelper] No change found"),
|
|
34555
|
+
if (P.info("[DxfCompareHelper] loadFiles in " + (Date.now() - S) / 1e3 + "s"), this.loader.isAborted()) return Promise.reject("[DxfCompareHelper] compare loadFile aborted");
|
|
34556
|
+
const O = E.value, T = M.value;
|
|
34557
|
+
S = Date.now();
|
|
34558
|
+
const v = await new yt(O, T, i).compare(b);
|
|
34559
|
+
if (P.info("[DxfCompareHelper] Compared in " + (Date.now() - S) / 1e3 + "s"), P.debug("[DxfCompareHelper] Compared results:", v), this.loader.isAborted()) return Promise.reject("[DxfCompareHelper] compare change aborted");
|
|
34560
|
+
V.printMemory("After getting the comparison results"), S = Date.now(), await this.loader.loadEntitiesForCompare(O, T, v, !0, y), V.printMemory("After Creating threejs objects based on comparison result"), this.fontManager?.releaseFontData(), this.changes = v, P.info("[DxfCompareHelper] Creates threejs objects based on comparison result in " + (Date.now() - S) / 1e3 + "s");
|
|
34561
|
+
const C = O, _ = T;
|
|
34562
|
+
if (this.decreaseJobCount(), !Object.keys(v).length && P.info("[DxfCompareHelper] No change found"), C.threejsObject?.children.length === 0 && _.threejsObject?.children.length === 0) {
|
|
34555
34563
|
const B = "[DxfCompareHelper] Nothing was loaded from " + n + " and " + a;
|
|
34556
34564
|
return P.warn(B), Promise.reject(B);
|
|
34557
34565
|
}
|
|
34558
|
-
const A =
|
|
34559
|
-
return A.name = n, I.name = a,
|
|
34566
|
+
const A = C.threejsObject, I = _.threejsObject;
|
|
34567
|
+
return A.name = n, I.name = a, S = Date.now(), this.viewer.addModel(new ys({
|
|
34560
34568
|
modelId: t.modelId || t.src,
|
|
34561
|
-
dxfData:
|
|
34569
|
+
dxfData: C
|
|
34562
34570
|
})), this.viewer.flyToObject(A), V.printMemory("After adding first loaded Model to scene"), d(95), this.viewer.addModel(new ys({
|
|
34563
34571
|
modelId: e.modelId || e.src,
|
|
34564
34572
|
dxfData: _
|
|
34565
|
-
})), V.printMemory("After adding second loaded Model to scene"), P.info("[DxfCompareHelper] Added compared objects to scene in " + (Date.now() -
|
|
34573
|
+
})), V.printMemory("After adding second loaded Model to scene"), P.info("[DxfCompareHelper] Added compared objects to scene in " + (Date.now() - S) / 1e3 + "s"), P.info("[DxfCompareHelper] The comparison between " + n + "' and '" + a + "' is completed in " + (Date.now() - o) / 1e3 + "s !"), d(100), this.loadingProgressBar?.delayRemoveProgressItem(l), Promise.resolve();
|
|
34566
34574
|
}
|
|
34567
34575
|
/**
|
|
34568
34576
|
* @description {en} Gets compare changes.
|
|
@@ -34698,19 +34706,19 @@ class W0 extends Mu {
|
|
|
34698
34706
|
loaded: se,
|
|
34699
34707
|
total: 100
|
|
34700
34708
|
}));
|
|
34701
|
-
}, b = (D) => m(D, 0, 15), y = (D) => m(D, 15, 30),
|
|
34709
|
+
}, b = (D) => m(D, 0, 15), y = (D) => m(D, 15, 30), S = (D) => m(D, 30, 60), w = (D) => m(D, 60, 95);
|
|
34702
34710
|
V.printMemory("Before comparing"), this.loadingProgressBar?.addProgressItem(d), f(0);
|
|
34703
34711
|
let x = Date.now();
|
|
34704
|
-
const E = this.loader.parse(r, b), M = this.loader.parse(o, y), [O,
|
|
34712
|
+
const E = this.loader.parse(r, b), M = this.loader.parse(o, y), [O, T] = await Promise.allSettled([E, M]);
|
|
34705
34713
|
if (O.status === "rejected") return Promise.reject("[DxfCompareHelper] Failed to parse " + r);
|
|
34706
|
-
if (
|
|
34714
|
+
if (T.status === "rejected") return Promise.reject("[DxfCompareHelper] Failed to parse " + o);
|
|
34707
34715
|
if (P.info("[DxfCompareHelper] loadFiles in " + (Date.now() - x) / 1e3 + "s"), this.loader.isAborted()) return Promise.reject("[DxfCompareHelper] compare loadFile aborted");
|
|
34708
|
-
const v = O.value,
|
|
34716
|
+
const v = O.value, C = T.value;
|
|
34709
34717
|
x = Date.now();
|
|
34710
|
-
const _ = await new yt(v,
|
|
34718
|
+
const _ = await new yt(v, C, s).compare(S);
|
|
34711
34719
|
if (P.info("[DxfCompareHelper] Compared in " + (Date.now() - x) / 1e3 + "s"), P.debug("Compared results:", _), this.loader.isAborted()) return Promise.reject("[DxfCompareHelper] compare change aborted");
|
|
34712
|
-
V.printMemory("After getting the comparison results"), x = Date.now(), await this.loader.loadEntitiesForCompare(v,
|
|
34713
|
-
const A = v, I =
|
|
34720
|
+
V.printMemory("After getting the comparison results"), x = Date.now(), await this.loader.loadEntitiesForCompare(v, C, _, !1, w), V.printMemory("After Creating threejs objects based on comparison result"), this.fontManager?.releaseFontData(), this.changes = _, P.info("[DxfCompareHelper] Creates threejs objects based on comparison result in " + (Date.now() - x) / 1e3 + "s");
|
|
34721
|
+
const A = v, I = C;
|
|
34714
34722
|
if (this.decreaseJobCount(), !Object.keys(_).length && P.info("[DxfCompareHelper] No change found"), A.threejsObject?.children.length === 0 && I.threejsObject?.children.length === 0) {
|
|
34715
34723
|
const D = "[DxfCompareHelper] Nothing was loaded from " + r + " and " + o;
|
|
34716
34724
|
return P.warn(D), Promise.reject(D);
|
|
@@ -35478,10 +35486,10 @@ class X0 extends Pr {
|
|
|
35478
35486
|
if (h = this.pickManager.pick(f, this.pickUsageScene), d = !!this.selectedObject && h?.tilesetId === this.selectedObject?.tilesetId && h?.userId === this.selectedObject?.userId, u.button === Ke.Left) {
|
|
35479
35487
|
let m = this.pickUsageScene;
|
|
35480
35488
|
if (h) {
|
|
35481
|
-
const y = this.loadedModels.find((
|
|
35489
|
+
const y = this.loadedModels.find((S) => S.modelId === "" + h?.tilesetId);
|
|
35482
35490
|
if (y) {
|
|
35483
|
-
const
|
|
35484
|
-
|
|
35491
|
+
const S = y.getObjectByUserId(h.userId);
|
|
35492
|
+
S && (m = S);
|
|
35485
35493
|
}
|
|
35486
35494
|
}
|
|
35487
35495
|
const b = this.pickManager.pickObject(f, [m]);
|