@maqiuyao/dxf-viewer 0.2.8 → 0.2.10
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 +14 -14
- package/dist/dxf-viewer.js +903 -873
- package/dist/src/dxfViewer/core/dxf/DxfConstants.d.ts +10 -0
- package/package.json +1 -1
package/dist/dxf-viewer.js
CHANGED
|
@@ -2,7 +2,7 @@ var il = Object.defineProperty;
|
|
|
2
2
|
var sl = (c, t, e) => t in c ? il(c, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : c[t] = e;
|
|
3
3
|
var g = (c, t, e) => sl(c, typeof t != "symbol" ? t + "" : t, e);
|
|
4
4
|
import * as p from "three";
|
|
5
|
-
import { Box3 as De, Matrix4 as ot, BufferAttribute as wr, Vector3 as G, Line3 as
|
|
5
|
+
import { Box3 as De, Matrix4 as ot, BufferAttribute as wr, Vector3 as G, Line3 as _t, Plane as fo, Vector2 as jt, Triangle as Oi, BackSide as nl, DoubleSide as rl, REVISION as po, Ray as al, FrontSide as Ar, Mesh as mn, LineSegments as mo, LineLoop as go, Line as yo, Points as xo, Sphere as ol, BatchedMesh as ll, Layers as cl, Object3D as hl } from "three";
|
|
6
6
|
import { Mesh as ef } from "three";
|
|
7
7
|
import * as Ir from "loglevel";
|
|
8
8
|
import { CSS2DObject as dl, CSS2DRenderer as ul } from "three/examples/jsm/renderers/CSS2DRenderer.js";
|
|
@@ -12,7 +12,7 @@ import { OBJExporter as ml } from "three/examples/jsm/exporters/OBJExporter.js";
|
|
|
12
12
|
import { STLExporter as gl } from "three/examples/jsm/exporters/STLExporter.js";
|
|
13
13
|
import { extrudePolylines as yl } from "poly-extrude";
|
|
14
14
|
import xl from "i18next";
|
|
15
|
-
import { mergeGeometries as
|
|
15
|
+
import { mergeGeometries as Oe } from "three/examples/jsm/utils/BufferGeometryUtils.js";
|
|
16
16
|
import { Earcut as bl } from "three/src/extras/Earcut.js";
|
|
17
17
|
import wl from "2d-polygon-self-intersections";
|
|
18
18
|
import { SimplifyModifier as vl } from "three/examples/jsm/modifiers/SimplifyModifier.js";
|
|
@@ -104,7 +104,7 @@ function ws(c, t, e, i, s, n, r) {
|
|
|
104
104
|
object: c
|
|
105
105
|
}), !0);
|
|
106
106
|
}
|
|
107
|
-
const w0 = p.Line, bo = 0, Ql = 1, ec = 2, Dr = 2, Sn = 1.25, Lr = 1,
|
|
107
|
+
const w0 = p.Line, bo = 0, Ql = 1, ec = 2, Dr = 2, Sn = 1.25, Lr = 1, _e = 32, xe = _e / 4, wo = 65535, en = Math.pow(2, -24), Mr = /* @__PURE__ */ Symbol("SKIP_GENERATION"), vo = {
|
|
108
108
|
strategy: bo,
|
|
109
109
|
maxDepth: 40,
|
|
110
110
|
targetLeafSize: 10,
|
|
@@ -150,10 +150,10 @@ function Wi(c) {
|
|
|
150
150
|
function he(c, t) {
|
|
151
151
|
return t[c + 15] === wo;
|
|
152
152
|
}
|
|
153
|
-
function
|
|
153
|
+
function Ce(c, t) {
|
|
154
154
|
return t[c + 6];
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function Pe(c, t) {
|
|
157
157
|
return t[c + 14];
|
|
158
158
|
}
|
|
159
159
|
function be(c) {
|
|
@@ -170,8 +170,8 @@ 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
171
|
const C = c.offset || 0;
|
|
172
172
|
for (let w = (t - C) * 6, x = (t + e - C) * 6; w < x; w += 6) {
|
|
173
|
-
const
|
|
174
|
-
O < n && (n = O),
|
|
173
|
+
const S = c[w + 0], M = c[w + 1], O = S - M, E = S + M;
|
|
174
|
+
O < n && (n = O), E > o && (o = E), S < d && (d = S), S > m && (m = S);
|
|
175
175
|
const v = c[w + 2], T = c[w + 3], _ = v - T, A = v + T;
|
|
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;
|
|
@@ -179,7 +179,7 @@ function En(c, t, e, i, s) {
|
|
|
179
179
|
}
|
|
180
180
|
i[0] = n, i[1] = r, i[2] = a, i[3] = o, i[4] = l, i[5] = h, s[0] = d, s[1] = u, s[2] = f, s[3] = m, s[4] = b, s[5] = y;
|
|
181
181
|
}
|
|
182
|
-
const
|
|
182
|
+
const vt = 32, tc = (c, t) => c.candidate - t.candidate, It = /* @__PURE__ */ new Array(vt).fill().map(() => ({
|
|
183
183
|
count: 0,
|
|
184
184
|
bounds: new Float32Array(6),
|
|
185
185
|
rightCacheBounds: new Float32Array(6),
|
|
@@ -197,70 +197,70 @@ 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], C = (t[f + 3] - m) /
|
|
201
|
-
if (s <
|
|
202
|
-
const w = [...
|
|
200
|
+
const m = t[f], C = (t[f + 3] - m) / vt;
|
|
201
|
+
if (s < vt / 4) {
|
|
202
|
+
const w = [...It];
|
|
203
203
|
w.length = s;
|
|
204
204
|
let x = 0;
|
|
205
205
|
for (let M = d; M < u; M += 6, x++) {
|
|
206
206
|
const O = w[x];
|
|
207
207
|
O.candidate = e[M + 2 * f], O.count = 0;
|
|
208
208
|
const {
|
|
209
|
-
bounds:
|
|
209
|
+
bounds: E,
|
|
210
210
|
leftCacheBounds: v,
|
|
211
211
|
rightCacheBounds: T
|
|
212
212
|
} = O;
|
|
213
213
|
for (let _ = 0; _ < 3; _++)
|
|
214
|
-
T[_] = 1 / 0, T[_ + 3] = -1 / 0, v[_] = 1 / 0, v[_ + 3] = -1 / 0,
|
|
215
|
-
vs(M, e,
|
|
214
|
+
T[_] = 1 / 0, T[_ + 3] = -1 / 0, v[_] = 1 / 0, v[_ + 3] = -1 / 0, E[_] = 1 / 0, E[_ + 3] = -1 / 0;
|
|
215
|
+
vs(M, e, E);
|
|
216
216
|
}
|
|
217
217
|
w.sort(tc);
|
|
218
|
-
let
|
|
219
|
-
for (let M = 0; M <
|
|
218
|
+
let S = s;
|
|
219
|
+
for (let M = 0; M < S; M++) {
|
|
220
220
|
const O = w[M];
|
|
221
|
-
for (; M + 1 <
|
|
222
|
-
w.splice(M + 1, 1),
|
|
221
|
+
for (; M + 1 < S && w[M + 1].candidate === O.candidate; )
|
|
222
|
+
w.splice(M + 1, 1), S--;
|
|
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 E = 0; E < S; E++) {
|
|
227
|
+
const v = w[E];
|
|
228
228
|
O >= v.candidate ? vs(M, e, v.rightCacheBounds) : (vs(M, e, v.leftCacheBounds), v.count++);
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
|
-
for (let M = 0; M <
|
|
232
|
-
const O = w[M],
|
|
231
|
+
for (let M = 0; M < S; M++) {
|
|
232
|
+
const O = w[M], E = O.count, v = s - O.count, T = O.leftCacheBounds, _ = O.rightCacheBounds;
|
|
233
233
|
let A = 0;
|
|
234
|
-
|
|
234
|
+
E !== 0 && (A = Wi(T) / 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 * E + I * v);
|
|
238
238
|
B < l && (r = f, l = B, a = O.candidate);
|
|
239
239
|
}
|
|
240
240
|
} else {
|
|
241
|
-
for (let
|
|
242
|
-
const M =
|
|
243
|
-
M.count = 0, M.candidate = m + C +
|
|
241
|
+
for (let S = 0; S < vt; S++) {
|
|
242
|
+
const M = It[S];
|
|
243
|
+
M.count = 0, M.candidate = m + C + S * C;
|
|
244
244
|
const O = M.bounds;
|
|
245
|
-
for (let
|
|
246
|
-
O[
|
|
245
|
+
for (let E = 0; E < 3; E++)
|
|
246
|
+
O[E] = 1 / 0, O[E + 3] = -1 / 0;
|
|
247
247
|
}
|
|
248
|
-
for (let
|
|
249
|
-
let
|
|
250
|
-
|
|
251
|
-
const v =
|
|
252
|
-
v.count++, vs(
|
|
248
|
+
for (let S = d; S < u; S += 6) {
|
|
249
|
+
let E = ~~((e[S + 2 * f] - m) / C);
|
|
250
|
+
E >= vt && (E = vt - 1);
|
|
251
|
+
const v = It[E];
|
|
252
|
+
v.count++, vs(S, e, v.bounds);
|
|
253
253
|
}
|
|
254
|
-
const w =
|
|
254
|
+
const w = It[vt - 1];
|
|
255
255
|
Rr(w.bounds, w.rightCacheBounds);
|
|
256
|
-
for (let
|
|
257
|
-
const M =
|
|
256
|
+
for (let S = vt - 2; S >= 0; S--) {
|
|
257
|
+
const M = It[S], O = It[S + 1];
|
|
258
258
|
Fr(M.bounds, O.rightCacheBounds, M.rightCacheBounds);
|
|
259
259
|
}
|
|
260
260
|
let x = 0;
|
|
261
|
-
for (let
|
|
262
|
-
const M =
|
|
263
|
-
O !== 0 && (x === 0 ? Rr(
|
|
261
|
+
for (let S = 0; S < vt - 1; S++) {
|
|
262
|
+
const M = It[S], O = M.count, E = M.bounds, T = It[S + 1].rightCacheBounds;
|
|
263
|
+
O !== 0 && (x === 0 ? Rr(E, Ms) : Fr(E, Ms, Ms)), x += O;
|
|
264
264
|
let _ = 0, A = 0;
|
|
265
265
|
x !== 0 && (_ = Wi(Ms) / o);
|
|
266
266
|
const I = s - x;
|
|
@@ -321,11 +321,11 @@ function dr(c, t) {
|
|
|
321
321
|
for (let r = 0; r < 6; r++)
|
|
322
322
|
Mo[e + r] = n[r];
|
|
323
323
|
if (s)
|
|
324
|
-
return t.buffer ? (To.set(new Uint8Array(t.buffer), c), c + t.buffer.byteLength) : (tn[e + 6] = t.offset, cr[i + 14] = t.count, cr[i + 15] = wo, c +
|
|
324
|
+
return t.buffer ? (To.set(new Uint8Array(t.buffer), c), c + t.buffer.byteLength) : (tn[e + 6] = t.offset, cr[i + 14] = t.count, cr[i + 15] = wo, c + _e);
|
|
325
325
|
{
|
|
326
|
-
const { left: r, right: a, splitAxis: o } = t, l = c +
|
|
326
|
+
const { left: r, right: a, splitAxis: o } = t, l = c + _e;
|
|
327
327
|
let h = dr(l, r);
|
|
328
|
-
const d = c /
|
|
328
|
+
const d = c / _e, f = h / _e - d;
|
|
329
329
|
if (f > rc)
|
|
330
330
|
throw new Error("MeshBVH: Cannot store relative child node offset greater than 32 bits.");
|
|
331
331
|
return tn[e + 6] = f, tn[e + 7] = o, dr(h, a);
|
|
@@ -346,23 +346,23 @@ function oc(c, t, e, i, s, n) {
|
|
|
346
346
|
function C(x) {
|
|
347
347
|
d && d((x - n.offset) / n.count);
|
|
348
348
|
}
|
|
349
|
-
function w(x,
|
|
350
|
-
!b &&
|
|
349
|
+
function w(x, S, M, O = null, E = 0) {
|
|
350
|
+
!b && E >= 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 C(
|
|
354
|
-
const T = ic(x.boundingData, O, t,
|
|
355
|
-
let _ = T.axis === -1 ? -1 : nc(u, f, t,
|
|
356
|
-
if (T.axis === -1 || _ ===
|
|
352
|
+
if (M <= o && !v || E >= r)
|
|
353
|
+
return C(S + M), x.offset = S, x.count = M, x;
|
|
354
|
+
const T = ic(x.boundingData, O, t, S, M, h);
|
|
355
|
+
let _ = T.axis === -1 ? -1 : nc(u, f, t, S, M, T);
|
|
356
|
+
if (T.axis === -1 || _ === S || _ === S + M) {
|
|
357
357
|
if (!v)
|
|
358
|
-
return C(
|
|
359
|
-
T.axis = Math.max(0, lr(x.boundingData)), _ =
|
|
358
|
+
return C(S + M), x.offset = S, x.count = M, x;
|
|
359
|
+
T.axis = Math.max(0, lr(x.boundingData)), _ = S + Math.max(1, Math.floor(M / 2));
|
|
360
360
|
}
|
|
361
361
|
x.splitAxis = T.axis;
|
|
362
|
-
const A = new On(), I =
|
|
363
|
-
x.left = A, En(t, I, B, A.boundingData, m), w(A, I, B, m,
|
|
362
|
+
const A = new On(), I = S, B = _ - S;
|
|
363
|
+
x.left = A, En(t, I, B, A.boundingData, m), w(A, I, B, m, E + 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, E + 1), x;
|
|
366
366
|
}
|
|
367
367
|
}
|
|
368
368
|
function lc(c, t) {
|
|
@@ -371,7 +371,7 @@ function lc(c, t) {
|
|
|
371
371
|
count: n.offset + n.count - s.offset
|
|
372
372
|
}, a = new Float32Array(6 * r.count);
|
|
373
373
|
a.offset = r.offset, c.computePrimitiveBounds(r.offset, r.count, a), c._roots = i.map((o) => {
|
|
374
|
-
const l = oc(c, a, o.offset, o.count, t, r), h = hr(l), d = new e(
|
|
374
|
+
const l = oc(c, a, o.offset, o.count, t, r), h = hr(l), d = new e(_e * h);
|
|
375
375
|
return ac(0, l, d), d;
|
|
376
376
|
});
|
|
377
377
|
}
|
|
@@ -413,7 +413,7 @@ function ur(c, t, e, i, s = null, n = 0, r = 0) {
|
|
|
413
413
|
const { float32Array: a, uint16Array: o, uint32Array: l } = ne;
|
|
414
414
|
let h = c * 2;
|
|
415
415
|
if (he(h, o)) {
|
|
416
|
-
const u =
|
|
416
|
+
const u = Ce(c, l), f = Pe(h, o);
|
|
417
417
|
return le(c, a, Ut), i(u, f, !1, r, n + c / xe, Ut);
|
|
418
418
|
} else {
|
|
419
419
|
let _ = function(I) {
|
|
@@ -421,13 +421,13 @@ function ur(c, t, e, i, s = null, n = 0, r = 0) {
|
|
|
421
421
|
let D = I * 2;
|
|
422
422
|
for (; !he(D, B); )
|
|
423
423
|
I = be(I), D = I * 2;
|
|
424
|
-
return
|
|
424
|
+
return Ce(I, k);
|
|
425
425
|
}, A = function(I) {
|
|
426
426
|
const { uint16Array: B, uint32Array: k } = ne;
|
|
427
427
|
let D = I * 2;
|
|
428
428
|
for (; !he(D, B); )
|
|
429
429
|
I = we(I, k), D = I * 2;
|
|
430
|
-
return
|
|
430
|
+
return Ce(I, k) + Pe(D, B);
|
|
431
431
|
};
|
|
432
432
|
const u = be(c), f = we(c, l);
|
|
433
433
|
let m = u, b = f, y, C, w, x;
|
|
@@ -437,7 +437,7 @@ function ur(c, t, e, i, s = null, n = 0, r = 0) {
|
|
|
437
437
|
y = C, C = I, w = x;
|
|
438
438
|
}
|
|
439
439
|
w || (w = Ut, le(m, a, w));
|
|
440
|
-
const
|
|
440
|
+
const S = he(m * 2, o), M = e(w, S, y, r + 1, n + m / xe);
|
|
441
441
|
let O;
|
|
442
442
|
if (M === Dr) {
|
|
443
443
|
const I = _(m), k = A(m) - I;
|
|
@@ -454,7 +454,7 @@ 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
|
|
457
|
+
const E = he(b * 2, o), v = e(x, E, C, r + 1, n + b / xe);
|
|
458
458
|
let T;
|
|
459
459
|
if (v === Dr) {
|
|
460
460
|
const I = _(b), k = A(b) - I;
|
|
@@ -472,7 +472,7 @@ function ur(c, t, e, i, s = null, n = 0, r = 0) {
|
|
|
472
472
|
return !!T;
|
|
473
473
|
}
|
|
474
474
|
}
|
|
475
|
-
const ls = /* @__PURE__ */ new ne.constructor(), ln = /* @__PURE__ */ new ne.constructor(),
|
|
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();
|
|
476
476
|
let An = !1;
|
|
477
477
|
function dc(c, t, e, i) {
|
|
478
478
|
if (An)
|
|
@@ -483,7 +483,7 @@ function dc(c, t, e, i) {
|
|
|
483
483
|
const l = new ot().copy(e).invert();
|
|
484
484
|
for (let h = 0, d = s.length; h < d; h++) {
|
|
485
485
|
ls.setBuffer(s[h]), o = 0;
|
|
486
|
-
const u =
|
|
486
|
+
const u = Lt.getPrimitive();
|
|
487
487
|
le(0, ls.float32Array, u), u.applyMatrix4(l);
|
|
488
488
|
for (let f = 0, m = n.length; f < m && (ln.setBuffer(n[f]), r = st(
|
|
489
489
|
0,
|
|
@@ -496,9 +496,9 @@ function dc(c, t, e, i) {
|
|
|
496
496
|
0,
|
|
497
497
|
0,
|
|
498
498
|
u
|
|
499
|
-
), ln.clearBuffer(), o += n[f].byteLength /
|
|
499
|
+
), ln.clearBuffer(), o += n[f].byteLength / _e, !r); f++)
|
|
500
500
|
;
|
|
501
|
-
if (
|
|
501
|
+
if (Lt.releasePrimitive(u), ls.clearBuffer(), a += s[h].byteLength / _e, r)
|
|
502
502
|
break;
|
|
503
503
|
}
|
|
504
504
|
return An = !1, r;
|
|
@@ -506,35 +506,35 @@ 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, C = u.uint32Array, w = u.uint16Array, x = c * 2,
|
|
510
|
-
let
|
|
509
|
+
const f = d.float32Array, m = d.uint32Array, b = d.uint16Array, y = u.float32Array, C = u.uint32Array, w = u.uint16Array, x = c * 2, S = t * 2, M = he(x, b), O = he(S, w);
|
|
510
|
+
let E = !1;
|
|
511
511
|
if (O && M)
|
|
512
|
-
h ?
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
512
|
+
h ? E = s(
|
|
513
|
+
Ce(t, C),
|
|
514
|
+
Pe(t * 2, w),
|
|
515
|
+
Ce(c, m),
|
|
516
|
+
Pe(c * 2, b),
|
|
517
517
|
o,
|
|
518
518
|
r + t / xe,
|
|
519
519
|
a,
|
|
520
520
|
n + c / xe
|
|
521
|
-
) :
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
521
|
+
) : E = s(
|
|
522
|
+
Ce(c, m),
|
|
523
|
+
Pe(c * 2, b),
|
|
524
|
+
Ce(t, C),
|
|
525
|
+
Pe(t * 2, w),
|
|
526
526
|
a,
|
|
527
527
|
n + c / xe,
|
|
528
528
|
o,
|
|
529
529
|
r + t / xe
|
|
530
530
|
);
|
|
531
531
|
else if (O) {
|
|
532
|
-
const v =
|
|
532
|
+
const v = Lt.getPrimitive();
|
|
533
533
|
le(t, y, v), v.applyMatrix4(e);
|
|
534
534
|
const T = be(c), _ = we(c, m);
|
|
535
535
|
le(T, f, ui), le(_, f, fi);
|
|
536
536
|
const A = v.intersectsBox(ui), I = v.intersectsBox(fi);
|
|
537
|
-
|
|
537
|
+
E = A && st(
|
|
538
538
|
t,
|
|
539
539
|
T,
|
|
540
540
|
i,
|
|
@@ -558,13 +558,13 @@ function st(c, t, e, i, s, n = 0, r = 0, a = 0, o = 0, l = null, h = !1) {
|
|
|
558
558
|
a + 1,
|
|
559
559
|
v,
|
|
560
560
|
!h
|
|
561
|
-
),
|
|
561
|
+
), Lt.releasePrimitive(v);
|
|
562
562
|
} else {
|
|
563
563
|
const v = be(t), T = we(t, C);
|
|
564
564
|
le(v, y, _n), le(T, y, Pn);
|
|
565
565
|
const _ = l.intersectsBox(_n), A = l.intersectsBox(Pn);
|
|
566
566
|
if (_ && A)
|
|
567
|
-
|
|
567
|
+
E = st(
|
|
568
568
|
c,
|
|
569
569
|
v,
|
|
570
570
|
e,
|
|
@@ -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
|
+
E = st(
|
|
595
595
|
c,
|
|
596
596
|
v,
|
|
597
597
|
e,
|
|
@@ -605,12 +605,12 @@ function st(c, t, e, i, s, n = 0, r = 0, a = 0, o = 0, l = null, h = !1) {
|
|
|
605
605
|
h
|
|
606
606
|
);
|
|
607
607
|
else {
|
|
608
|
-
const I =
|
|
608
|
+
const I = Lt.getPrimitive();
|
|
609
609
|
I.copy(_n).applyMatrix4(e);
|
|
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
|
+
E = D && st(
|
|
614
614
|
v,
|
|
615
615
|
B,
|
|
616
616
|
i,
|
|
@@ -634,11 +634,11 @@ function st(c, t, e, i, s, n = 0, r = 0, a = 0, o = 0, l = null, h = !1) {
|
|
|
634
634
|
a + 1,
|
|
635
635
|
I,
|
|
636
636
|
!h
|
|
637
|
-
),
|
|
637
|
+
), Lt.releasePrimitive(I);
|
|
638
638
|
}
|
|
639
639
|
else if (A)
|
|
640
640
|
if (M)
|
|
641
|
-
|
|
641
|
+
E = st(
|
|
642
642
|
c,
|
|
643
643
|
T,
|
|
644
644
|
e,
|
|
@@ -652,12 +652,12 @@ function st(c, t, e, i, s, n = 0, r = 0, a = 0, o = 0, l = null, h = !1) {
|
|
|
652
652
|
h
|
|
653
653
|
);
|
|
654
654
|
else {
|
|
655
|
-
const I =
|
|
655
|
+
const I = Lt.getPrimitive();
|
|
656
656
|
I.copy(Pn).applyMatrix4(e);
|
|
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
|
-
|
|
660
|
+
E = D && st(
|
|
661
661
|
T,
|
|
662
662
|
B,
|
|
663
663
|
i,
|
|
@@ -681,10 +681,10 @@ function st(c, t, e, i, s, n = 0, r = 0, a = 0, o = 0, l = null, h = !1) {
|
|
|
681
681
|
a + 1,
|
|
682
682
|
I,
|
|
683
683
|
!h
|
|
684
|
-
),
|
|
684
|
+
), Lt.releasePrimitive(I);
|
|
685
685
|
}
|
|
686
686
|
}
|
|
687
|
-
return
|
|
687
|
+
return E;
|
|
688
688
|
}
|
|
689
689
|
const In = new class {
|
|
690
690
|
constructor() {
|
|
@@ -699,12 +699,12 @@ const In = new class {
|
|
|
699
699
|
let r = n * 2;
|
|
700
700
|
for (; !he(r, e); )
|
|
701
701
|
n = be(n), r = n * 2;
|
|
702
|
-
return
|
|
702
|
+
return Ce(n, t);
|
|
703
703
|
}, this.getRangeEnd = (n) => {
|
|
704
704
|
let r = n * 2;
|
|
705
705
|
for (; !he(r, e); )
|
|
706
706
|
n = we(n, t), r = n * 2;
|
|
707
|
-
return
|
|
707
|
+
return Ce(n, t) + Pe(r, e);
|
|
708
708
|
};
|
|
709
709
|
const s = (n, r, a) => {
|
|
710
710
|
const o = r * 2, l = he(o, e);
|
|
@@ -789,7 +789,7 @@ class uc {
|
|
|
789
789
|
else {
|
|
790
790
|
const i = this._roots;
|
|
791
791
|
for (let s = 0; s < i.length; s++) {
|
|
792
|
-
const n = i[s], r = new Uint32Array(n), a = new Uint16Array(n), o = n.byteLength /
|
|
792
|
+
const n = i[s], r = new Uint32Array(n), a = new Uint16Array(n), o = n.byteLength / _e;
|
|
793
793
|
for (let l = 0; l < o; l++) {
|
|
794
794
|
const h = xe * l, d = 2 * h;
|
|
795
795
|
he(d, a) && (r[h + 6] += t);
|
|
@@ -817,11 +817,11 @@ class uc {
|
|
|
817
817
|
refit() {
|
|
818
818
|
const t = this._roots;
|
|
819
819
|
for (let e = 0, i = t.length; e < i; e++) {
|
|
820
|
-
const s = t[e], n = new Uint32Array(s), r = new Uint16Array(s), a = new Float32Array(s), o = s.byteLength /
|
|
820
|
+
const s = t[e], n = new Uint32Array(s), r = new Uint16Array(s), a = new Float32Array(s), o = s.byteLength / _e;
|
|
821
821
|
for (let l = o - 1; l >= 0; l--) {
|
|
822
822
|
const h = l * xe, d = h * 2;
|
|
823
823
|
if (he(d, r)) {
|
|
824
|
-
const f =
|
|
824
|
+
const f = Ce(h, n), m = Pe(d, r);
|
|
825
825
|
this.writePrimitiveRangeBounds(f, m, pi, 0), a.set(pi, h);
|
|
826
826
|
} else {
|
|
827
827
|
const f = be(h), m = we(h, n);
|
|
@@ -877,7 +877,7 @@ class uc {
|
|
|
877
877
|
const f = h[d];
|
|
878
878
|
if (o = hc(this, d, i, s, e, l), o)
|
|
879
879
|
break;
|
|
880
|
-
l += f.byteLength /
|
|
880
|
+
l += f.byteLength / _e;
|
|
881
881
|
}
|
|
882
882
|
return o;
|
|
883
883
|
}
|
|
@@ -1012,7 +1012,7 @@ class bc extends uc {
|
|
|
1012
1012
|
throw new Error("BVH: raycastObject3D() not implemented");
|
|
1013
1013
|
}
|
|
1014
1014
|
}
|
|
1015
|
-
class
|
|
1015
|
+
class Pt {
|
|
1016
1016
|
constructor() {
|
|
1017
1017
|
this.min = 1 / 0, this.max = -1 / 0;
|
|
1018
1018
|
}
|
|
@@ -1036,7 +1036,7 @@ class _t {
|
|
|
1036
1036
|
return this.min > t.max || t.min > this.max;
|
|
1037
1037
|
}
|
|
1038
1038
|
}
|
|
1039
|
-
|
|
1039
|
+
Pt.prototype.setFromBox = /* @__PURE__ */ (function() {
|
|
1040
1040
|
const c = /* @__PURE__ */ new G();
|
|
1041
1041
|
return function(e, i) {
|
|
1042
1042
|
const s = i.min, n = i.max;
|
|
@@ -1090,7 +1090,7 @@ const wc = /* @__PURE__ */ (function() {
|
|
|
1090
1090
|
}
|
|
1091
1091
|
};
|
|
1092
1092
|
})(), vc = /* @__PURE__ */ (function() {
|
|
1093
|
-
const c = /* @__PURE__ */ new G(), t = /* @__PURE__ */ new G(), e = /* @__PURE__ */ new fo(), i = /* @__PURE__ */ new
|
|
1093
|
+
const c = /* @__PURE__ */ new G(), t = /* @__PURE__ */ new G(), e = /* @__PURE__ */ new fo(), i = /* @__PURE__ */ new _t();
|
|
1094
1094
|
return function(n, r) {
|
|
1095
1095
|
const { radius: a, center: o } = n, { a: l, b: h, c: d } = r;
|
|
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;
|
|
@@ -1101,13 +1101,13 @@ const wc = /* @__PURE__ */ (function() {
|
|
|
1101
1101
|
}
|
|
1102
1102
|
return !1;
|
|
1103
1103
|
};
|
|
1104
|
-
})(), Mc = ["x", "y", "z"],
|
|
1104
|
+
})(), Mc = ["x", "y", "z"], Tt = 1e-15, Ur = Tt * Tt;
|
|
1105
1105
|
function Ye(c) {
|
|
1106
|
-
return Math.abs(c) <
|
|
1106
|
+
return Math.abs(c) < Tt;
|
|
1107
1107
|
}
|
|
1108
1108
|
class lt extends Oi {
|
|
1109
1109
|
constructor(...t) {
|
|
1110
|
-
super(...t), this.isExtendedTriangle = !0, this.satAxes = new Array(4).fill().map(() => new G()), this.satBounds = new Array(4).fill().map(() => new
|
|
1110
|
+
super(...t), this.isExtendedTriangle = !0, this.satAxes = new Array(4).fill().map(() => new G()), this.satBounds = new Array(4).fill().map(() => new Pt()), this.points = [this.a, this.b, this.c], this.plane = new fo(), this.isDegenerateIntoSegment = !1, this.isDegenerateIntoPoint = !1, this.degenerateSegment = new _t(), this.needsUpdate = !0;
|
|
1111
1111
|
}
|
|
1112
1112
|
/**
|
|
1113
1113
|
* Returns whether the triangle intersects the given sphere.
|
|
@@ -1127,11 +1127,11 @@ class lt extends Oi {
|
|
|
1127
1127
|
const f = n[3], m = r[3];
|
|
1128
1128
|
f.subVectors(i, t), m.setFromPoints(f, s);
|
|
1129
1129
|
const b = l.length(), y = d.length(), C = f.length();
|
|
1130
|
-
this.isDegenerateIntoPoint = !1, this.isDegenerateIntoSegment = !1, b <
|
|
1130
|
+
this.isDegenerateIntoPoint = !1, this.isDegenerateIntoSegment = !1, b < Tt ? y < Tt || C < Tt ? this.isDegenerateIntoPoint = !0 : (this.isDegenerateIntoSegment = !0, this.degenerateSegment.start.copy(t), this.degenerateSegment.end.copy(i)) : y < Tt ? C < Tt ? this.isDegenerateIntoPoint = !0 : (this.isDegenerateIntoSegment = !0, this.degenerateSegment.start.copy(e), this.degenerateSegment.end.copy(t)) : C < 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() {
|
|
1134
|
-
const c = /* @__PURE__ */ new G(), t = /* @__PURE__ */ new G(), e = /* @__PURE__ */ new
|
|
1134
|
+
const c = /* @__PURE__ */ new G(), t = /* @__PURE__ */ new G(), e = /* @__PURE__ */ new _t();
|
|
1135
1135
|
return function(s, n = null, r = null) {
|
|
1136
1136
|
const { start: a, end: o } = s, l = this.points;
|
|
1137
1137
|
let h, d = 1 / 0;
|
|
@@ -1143,88 +1143,88 @@ lt.prototype.closestPointToSegment = /* @__PURE__ */ (function() {
|
|
|
1143
1143
|
};
|
|
1144
1144
|
})();
|
|
1145
1145
|
lt.prototype.intersectsTriangle = /* @__PURE__ */ (function() {
|
|
1146
|
-
const c = /* @__PURE__ */ new lt(), t = /* @__PURE__ */ new
|
|
1147
|
-
function u(x,
|
|
1148
|
-
const
|
|
1149
|
-
!x.isDegenerateIntoPoint && !x.isDegenerateIntoSegment ?
|
|
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
|
+
function u(x, S, M, O) {
|
|
1148
|
+
const E = i;
|
|
1149
|
+
!x.isDegenerateIntoPoint && !x.isDegenerateIntoSegment ? E.copy(x.plane.normal) : E.copy(S.plane.normal);
|
|
1150
1150
|
const v = x.satBounds, T = x.satAxes;
|
|
1151
1151
|
for (let I = 1; I < 4; I++) {
|
|
1152
1152
|
const B = v[I], k = T[I];
|
|
1153
|
-
if (t.setFromPoints(k,
|
|
1153
|
+
if (t.setFromPoints(k, S.points), B.isSeparated(t) || (r.copy(E).cross(k), t.setFromPoints(r, x.points), e.setFromPoints(r, S.points), t.isSeparated(e))) return !1;
|
|
1154
1154
|
}
|
|
1155
|
-
const _ =
|
|
1155
|
+
const _ = S.satBounds, A = S.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(E, k), t.setFromPoints(r, x.points), e.setFromPoints(r, S.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,
|
|
1162
|
+
function f(x, S, M, O, E, v, T, _, A, I, B) {
|
|
1163
1163
|
let k = T / (T - _);
|
|
1164
|
-
I.x = O + (
|
|
1164
|
+
I.x = O + (E - O) * k, B.start.subVectors(S, x).multiplyScalar(k).add(x), k = T / (T - A), I.y = O + (v - O) * k, B.end.subVectors(M, x).multiplyScalar(k).add(x);
|
|
1165
1165
|
}
|
|
1166
|
-
function m(x,
|
|
1167
|
-
if (
|
|
1168
|
-
f(x.c, x.a, x.b, O,
|
|
1166
|
+
function m(x, S, M, O, E, v, T, _, A, I, B) {
|
|
1167
|
+
if (E > 0)
|
|
1168
|
+
f(x.c, x.a, x.b, O, S, M, A, T, _, I, B);
|
|
1169
1169
|
else if (v > 0)
|
|
1170
|
-
f(x.b, x.a, x.c, M,
|
|
1170
|
+
f(x.b, x.a, x.c, M, S, O, _, T, A, I, B);
|
|
1171
1171
|
else if (_ * A > 0 || T != 0)
|
|
1172
|
-
f(x.a, x.b, x.c,
|
|
1172
|
+
f(x.a, x.b, x.c, S, M, O, T, _, A, I, B);
|
|
1173
1173
|
else if (_ != 0)
|
|
1174
|
-
f(x.b, x.a, x.c, M,
|
|
1174
|
+
f(x.b, x.a, x.c, M, S, O, _, T, A, I, B);
|
|
1175
1175
|
else if (A != 0)
|
|
1176
|
-
f(x.c, x.a, x.b, O,
|
|
1176
|
+
f(x.c, x.a, x.b, O, S, M, A, T, _, I, B);
|
|
1177
1177
|
else
|
|
1178
1178
|
return !0;
|
|
1179
1179
|
return !1;
|
|
1180
1180
|
}
|
|
1181
|
-
function b(x,
|
|
1182
|
-
const
|
|
1183
|
-
return Ye(v) ? Ye(T) ? u(x,
|
|
1181
|
+
function b(x, S, M, O) {
|
|
1182
|
+
const E = S.degenerateSegment, v = x.plane.distanceToPoint(E.start), T = x.plane.distanceToPoint(E.end);
|
|
1183
|
+
return Ye(v) ? Ye(T) ? u(x, S, M, O) : (M && (M.start.copy(E.start), M.end.copy(E.start)), x.containsPoint(E.start)) : Ye(T) ? (M && (M.start.copy(E.end), M.end.copy(E.end)), x.containsPoint(E.end)) : x.plane.intersectLine(E, i) != null ? (M && (M.start.copy(i), M.end.copy(i)), x.containsPoint(i)) : !1;
|
|
1184
1184
|
}
|
|
1185
|
-
function y(x,
|
|
1186
|
-
const O =
|
|
1185
|
+
function y(x, S, M) {
|
|
1186
|
+
const O = S.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 C(x,
|
|
1190
|
-
const O = x.degenerateSegment,
|
|
1191
|
-
return O.closestPointToPoint(
|
|
1189
|
+
function C(x, S, M) {
|
|
1190
|
+
const O = x.degenerateSegment, E = S.a;
|
|
1191
|
+
return O.closestPointToPoint(E, !0, i), E.distanceToSquared(i) < Ur ? (M && (M.start.copy(E), M.end.copy(E)), !0) : !1;
|
|
1192
1192
|
}
|
|
1193
|
-
function w(x,
|
|
1193
|
+
function w(x, S, M, O) {
|
|
1194
1194
|
if (x.isDegenerateIntoSegment)
|
|
1195
|
-
if (
|
|
1196
|
-
const
|
|
1197
|
-
|
|
1198
|
-
const A = i.subVectors(v.start,
|
|
1195
|
+
if (S.isDegenerateIntoSegment) {
|
|
1196
|
+
const E = x.degenerateSegment, v = S.degenerateSegment, T = s, _ = n;
|
|
1197
|
+
E.delta(T), v.delta(_);
|
|
1198
|
+
const A = i.subVectors(v.start, E.start), I = T.x * _.y - T.y * _.x;
|
|
1199
1199
|
if (Ye(I))
|
|
1200
1200
|
return !1;
|
|
1201
1201
|
const B = (A.x * _.y - A.y * _.x) / I, k = -(T.x * A.y - T.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
|
|
1204
|
+
const D = E.start.z + T.z * B, R = v.start.z + _.z * k;
|
|
1205
|
+
return Ye(D - R) ? (M && (M.start.copy(E.start).addScaledVector(T, B), M.end.copy(E.start).addScaledVector(T, B)), !0) : !1;
|
|
1206
|
+
} else return S.isDegenerateIntoPoint ? C(x, S, M) : b(S, x, M, O);
|
|
1207
1207
|
else {
|
|
1208
1208
|
if (x.isDegenerateIntoPoint)
|
|
1209
|
-
return
|
|
1210
|
-
if (
|
|
1211
|
-
return y(x,
|
|
1212
|
-
if (
|
|
1213
|
-
return b(x,
|
|
1214
|
-
}
|
|
1215
|
-
}
|
|
1216
|
-
return function(
|
|
1217
|
-
this.needsUpdate && this.update(),
|
|
1218
|
-
const
|
|
1219
|
-
if (
|
|
1220
|
-
return
|
|
1221
|
-
const v = this.plane, T =
|
|
1209
|
+
return S.isDegenerateIntoPoint ? S.a.distanceToSquared(x.a) < Ur ? (M && (M.start.copy(x.a), M.end.copy(x.a)), !0) : !1 : S.isDegenerateIntoSegment ? C(S, x, M) : y(S, x, M);
|
|
1210
|
+
if (S.isDegenerateIntoPoint)
|
|
1211
|
+
return y(x, S, M);
|
|
1212
|
+
if (S.isDegenerateIntoSegment)
|
|
1213
|
+
return b(x, S, M, O);
|
|
1214
|
+
}
|
|
1215
|
+
}
|
|
1216
|
+
return function(S, M = null, O = !1) {
|
|
1217
|
+
this.needsUpdate && this.update(), S.isExtendedTriangle ? S.needsUpdate && S.update() : (c.copy(S), c.update(), S = c);
|
|
1218
|
+
const E = w(this, S, M, O);
|
|
1219
|
+
if (E !== void 0)
|
|
1220
|
+
return E;
|
|
1221
|
+
const v = this.plane, T = S.plane;
|
|
1222
1222
|
let _ = T.distanceToPoint(this.a), A = T.distanceToPoint(this.b), I = T.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)
|
|
1226
1226
|
return !1;
|
|
1227
|
-
let D = v.distanceToPoint(
|
|
1227
|
+
let D = v.distanceToPoint(S.a), R = v.distanceToPoint(S.b), ie = v.distanceToPoint(S.c);
|
|
1228
1228
|
Ye(D) && (D = 0), Ye(R) && (R = 0), Ye(ie) && (ie = 0);
|
|
1229
1229
|
const se = D * R, ze = D * ie;
|
|
1230
1230
|
if (se > 0 && ze > 0)
|
|
@@ -1234,11 +1234,11 @@ lt.prototype.intersectsTriangle = /* @__PURE__ */ (function() {
|
|
|
1234
1234
|
let ve = 0, Ni = Math.abs(ct.x);
|
|
1235
1235
|
const Qe = Math.abs(ct.y);
|
|
1236
1236
|
Qe > Ni && (Ni = Qe, ve = 1), Math.abs(ct.z) > Ni && (ve = 2);
|
|
1237
|
-
const
|
|
1238
|
-
if (m(this,
|
|
1239
|
-
return u(this,
|
|
1240
|
-
if (m(
|
|
1241
|
-
return u(this,
|
|
1237
|
+
const Ie = Mc[ve], At = this.a[Ie], Hi = this.b[Ie], Ht = this.c[Ie], Gt = S.a[Ie], Wt = S.b[Ie], qt = S.c[Ie];
|
|
1238
|
+
if (m(this, At, Hi, Ht, B, k, _, A, I, h, a))
|
|
1239
|
+
return u(this, S, M, O);
|
|
1240
|
+
if (m(S, Gt, Wt, qt, se, ze, D, R, ie, d, o))
|
|
1241
|
+
return u(this, S, M, O);
|
|
1242
1242
|
if (h.y < h.x) {
|
|
1243
1243
|
const Mn = h.y;
|
|
1244
1244
|
h.y = h.x, h.x = Mn, l.copy(a.start), a.start.copy(a.end), a.end.copy(l);
|
|
@@ -1257,7 +1257,7 @@ lt.prototype.distanceToPoint = /* @__PURE__ */ (function() {
|
|
|
1257
1257
|
};
|
|
1258
1258
|
})();
|
|
1259
1259
|
lt.prototype.distanceToTriangle = /* @__PURE__ */ (function() {
|
|
1260
|
-
const c = /* @__PURE__ */ new G(), t = /* @__PURE__ */ new G(), e = ["a", "b", "c"], i = /* @__PURE__ */ new
|
|
1260
|
+
const c = /* @__PURE__ */ new G(), t = /* @__PURE__ */ new G(), e = ["a", "b", "c"], i = /* @__PURE__ */ new _t(), s = /* @__PURE__ */ new _t();
|
|
1261
1261
|
return function(r, a = null, o = null) {
|
|
1262
1262
|
const l = a || o ? i : null;
|
|
1263
1263
|
if (this.intersectsTriangle(r, l, !0))
|
|
@@ -1285,7 +1285,7 @@ lt.prototype.distanceToTriangle = /* @__PURE__ */ (function() {
|
|
|
1285
1285
|
})();
|
|
1286
1286
|
class Re {
|
|
1287
1287
|
constructor(t, e, i) {
|
|
1288
|
-
this.isOrientedBox = !0, this.min = new G(), this.max = new G(), this.matrix = new ot(), this.invMatrix = new ot(), this.points = new Array(8).fill().map(() => new G()), this.satAxes = new Array(3).fill().map(() => new G()), this.satBounds = new Array(3).fill().map(() => new
|
|
1288
|
+
this.isOrientedBox = !0, this.min = new G(), this.max = new G(), this.matrix = new ot(), this.invMatrix = new ot(), this.points = new Array(8).fill().map(() => new G()), this.satAxes = new Array(3).fill().map(() => new G()), this.satBounds = new Array(3).fill().map(() => new Pt()), this.alignedSatBounds = new Array(3).fill().map(() => new Pt()), this.needsUpdate = !1, t && this.min.copy(t), e && this.max.copy(e), i && this.matrix.copy(i);
|
|
1289
1289
|
}
|
|
1290
1290
|
/**
|
|
1291
1291
|
* Sets the oriented box parameters.
|
|
@@ -1319,7 +1319,7 @@ Re.prototype.update = /* @__PURE__ */ (function() {
|
|
|
1319
1319
|
};
|
|
1320
1320
|
})();
|
|
1321
1321
|
Re.prototype.intersectsBox = /* @__PURE__ */ (function() {
|
|
1322
|
-
const c = /* @__PURE__ */ new
|
|
1322
|
+
const c = /* @__PURE__ */ new Pt();
|
|
1323
1323
|
return function(e) {
|
|
1324
1324
|
this.needsUpdate && this.update();
|
|
1325
1325
|
const i = e.min, s = e.max, n = this.satBounds, r = this.satAxes, a = this.alignedSatBounds;
|
|
@@ -1332,7 +1332,7 @@ Re.prototype.intersectsBox = /* @__PURE__ */ (function() {
|
|
|
1332
1332
|
};
|
|
1333
1333
|
})();
|
|
1334
1334
|
Re.prototype.intersectsTriangle = /* @__PURE__ */ (function() {
|
|
1335
|
-
const c = /* @__PURE__ */ new lt(), t = /* @__PURE__ */ new Array(3), e = /* @__PURE__ */ new
|
|
1335
|
+
const c = /* @__PURE__ */ new lt(), t = /* @__PURE__ */ new Array(3), e = /* @__PURE__ */ new Pt(), i = /* @__PURE__ */ new Pt(), s = /* @__PURE__ */ new G();
|
|
1336
1336
|
return function(r) {
|
|
1337
1337
|
this.needsUpdate && this.update(), r.isExtendedTriangle ? r.needsUpdate && r.update() : (c.copy(r), c.update(), r = c);
|
|
1338
1338
|
const a = this.satBounds, o = this.satAxes;
|
|
@@ -1368,7 +1368,7 @@ Re.prototype.distanceToPoint = (function() {
|
|
|
1368
1368
|
};
|
|
1369
1369
|
})();
|
|
1370
1370
|
Re.prototype.distanceToBox = /* @__PURE__ */ (function() {
|
|
1371
|
-
const c = ["x", "y", "z"], t = /* @__PURE__ */ new Array(12).fill().map(() => new
|
|
1371
|
+
const c = ["x", "y", "z"], t = /* @__PURE__ */ new Array(12).fill().map(() => new _t()), e = /* @__PURE__ */ new Array(12).fill().map(() => new _t()), i = /* @__PURE__ */ new G(), s = /* @__PURE__ */ new G();
|
|
1372
1372
|
return function(r, a = 0, o = null, l = null) {
|
|
1373
1373
|
if (this.needsUpdate && this.update(), this.intersectsBox(r))
|
|
1374
1374
|
return (o || l) && (r.getCenter(s), this.closestPointToPoint(s, i), r.closestPointToPoint(i, s), o && o.copy(i), l && l.copy(s)), 0;
|
|
@@ -1385,9 +1385,9 @@ Re.prototype.distanceToBox = /* @__PURE__ */ (function() {
|
|
|
1385
1385
|
for (let y = 0; y < 3; y++)
|
|
1386
1386
|
for (let C = 0; C <= 1; C++)
|
|
1387
1387
|
for (let w = 0; w <= 1; w++) {
|
|
1388
|
-
const x = (y + 1) % 3,
|
|
1389
|
-
t[b].set(
|
|
1390
|
-
const _ = c[y], A = c[x], I = c[
|
|
1388
|
+
const x = (y + 1) % 3, S = (y + 2) % 3, M = C << x | w << S, O = 1 << y | C << x | w << S, E = f[M], v = f[O];
|
|
1389
|
+
t[b].set(E, v);
|
|
1390
|
+
const _ = c[y], A = c[x], I = c[S], B = e[b], k = B.start, D = B.end;
|
|
1391
1391
|
k[_] = d[_], k[A] = C ? d[A] : u[A], k[I] = w ? d[I] : u[A], D[_] = u[_], D[A] = C ? d[A] : u[A], D[I] = w ? d[I] : u[A], b++;
|
|
1392
1392
|
}
|
|
1393
1393
|
for (let y = 0; y <= 1; y++)
|
|
@@ -1403,9 +1403,9 @@ Re.prototype.distanceToBox = /* @__PURE__ */ (function() {
|
|
|
1403
1403
|
for (let w = 0; w < 12; w++) {
|
|
1404
1404
|
const x = e[w];
|
|
1405
1405
|
Er(C, x, i, s);
|
|
1406
|
-
const
|
|
1407
|
-
if (
|
|
1408
|
-
return Math.sqrt(
|
|
1406
|
+
const S = i.distanceToSquared(s);
|
|
1407
|
+
if (S < m && (m = S, o && o.copy(i), l && l.copy(s), S < h))
|
|
1408
|
+
return Math.sqrt(S);
|
|
1409
1409
|
}
|
|
1410
1410
|
}
|
|
1411
1411
|
return Math.sqrt(m);
|
|
@@ -1489,9 +1489,9 @@ function yn(c, t, e, i, s, n, r) {
|
|
|
1489
1489
|
if (Array.isArray(t)) {
|
|
1490
1490
|
const C = i * 3;
|
|
1491
1491
|
for (let w = 0, x = u.length; w < x; w++) {
|
|
1492
|
-
const { start:
|
|
1493
|
-
if (C >=
|
|
1494
|
-
const
|
|
1492
|
+
const { start: S, count: M, materialIndex: O } = u[w];
|
|
1493
|
+
if (C >= S && C < S + M) {
|
|
1494
|
+
const E = Wr(t[O]), v = Gr(e, f, m, b, y, o, l, h, E, n, r);
|
|
1495
1495
|
if (v)
|
|
1496
1496
|
if (v.faceIndex = i, v.face.materialIndex = O, s)
|
|
1497
1497
|
s.push(v);
|
|
@@ -1547,30 +1547,30 @@ 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 =
|
|
1551
|
-
let w = 1 / 0, x = 1 / 0,
|
|
1550
|
+
const y = Ce(u, r), C = Pe(b, a);
|
|
1551
|
+
let w = 1 / 0, x = 1 / 0, S = 1 / 0, M = -1 / 0, O = -1 / 0, E = -1 / 0;
|
|
1552
1552
|
for (let v = 3 * y, T = 3 * (y + C); v < T; 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 <
|
|
1555
|
+
A < w && (w = A), A > M && (M = A), I < x && (x = I), I > O && (O = I), B < S && (S = B), B > E && (E = B);
|
|
1556
1556
|
}
|
|
1557
|
-
return o[u + 0] !== w || o[u + 1] !== x || o[u + 2] !==
|
|
1557
|
+
return o[u + 0] !== w || o[u + 1] !== x || o[u + 2] !== S || o[u + 3] !== M || o[u + 4] !== O || o[u + 5] !== E ? (o[u + 0] = w, o[u + 1] = x, o[u + 2] = S, o[u + 3] = M, o[u + 4] = O, o[u + 5] = E, !0) : !1;
|
|
1558
1558
|
} else {
|
|
1559
1559
|
const y = be(u), C = we(u, r);
|
|
1560
|
-
let w = m, x = !1,
|
|
1560
|
+
let w = m, x = !1, S = !1;
|
|
1561
1561
|
if (t) {
|
|
1562
1562
|
if (!w) {
|
|
1563
|
-
const _ = y / xe + f /
|
|
1564
|
-
x = t.has(_),
|
|
1563
|
+
const _ = y / xe + f / _e, A = C / xe + f / _e;
|
|
1564
|
+
x = t.has(_), S = t.has(A), w = !x && !S;
|
|
1565
1565
|
}
|
|
1566
1566
|
} else
|
|
1567
|
-
x = !0,
|
|
1568
|
-
const M = w || x, O = w ||
|
|
1569
|
-
let
|
|
1570
|
-
M && (
|
|
1567
|
+
x = !0, S = !0;
|
|
1568
|
+
const M = w || x, O = w || S;
|
|
1569
|
+
let E = !1;
|
|
1570
|
+
M && (E = d(y, f, w));
|
|
1571
1571
|
let v = !1;
|
|
1572
1572
|
O && (v = d(C, f, w));
|
|
1573
|
-
const T =
|
|
1573
|
+
const T = E || v;
|
|
1574
1574
|
if (T)
|
|
1575
1575
|
for (let _ = 0; _ < 3; _++) {
|
|
1576
1576
|
const A = y + _, I = C + _, B = o[A], k = o[A + 3], D = o[I], R = o[I + 3];
|
|
@@ -1583,8 +1583,8 @@ function Ac(c, t = null) {
|
|
|
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 C = t[c], w = t[c + 3], x = t[c + 1],
|
|
1587
|
-
return d >= 0 ? (n = (C - m) * d, r = (w - m) * d) : (n = (w - m) * d, r = (C - m) * d), u >= 0 ? (a = (x - b) * u, o = (
|
|
1586
|
+
let C = t[c], w = t[c + 3], x = t[c + 1], S = t[c + 3 + 1], M = t[c + 2], O = t[c + 3 + 2];
|
|
1587
|
+
return d >= 0 ? (n = (C - m) * d, r = (w - m) * d) : (n = (w - m) * d, r = (C - m) * d), u >= 0 ? (a = (x - b) * u, o = (S - b) * u) : (a = (S - 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;
|
|
@@ -1617,7 +1617,7 @@ function Dc(c, t, e, i, s, n, r) {
|
|
|
1617
1617
|
function fr(c, t, e, i, s, n, r) {
|
|
1618
1618
|
const { float32Array: a, uint16Array: o, uint32Array: l } = ne, h = c * 2;
|
|
1619
1619
|
if (he(h, o)) {
|
|
1620
|
-
const u =
|
|
1620
|
+
const u = Ce(c, l), f = Pe(h, o);
|
|
1621
1621
|
Oc(t, e, i, u, f, s, n, r);
|
|
1622
1622
|
} else {
|
|
1623
1623
|
const u = be(c);
|
|
@@ -1636,7 +1636,7 @@ function pr(c, t, e, i, s, n) {
|
|
|
1636
1636
|
const { float32Array: r, uint16Array: a, uint32Array: o } = ne;
|
|
1637
1637
|
let l = c * 2;
|
|
1638
1638
|
if (he(l, a)) {
|
|
1639
|
-
const d =
|
|
1639
|
+
const d = Ce(c, o), u = Pe(l, a);
|
|
1640
1640
|
return _c(t, e, i, d, u, s, n);
|
|
1641
1641
|
} else {
|
|
1642
1642
|
const d = Tr(c, o), u = Lc[d], m = i.direction[u] >= 0;
|
|
@@ -1651,8 +1651,8 @@ function pr(c, t, e, i, s, n) {
|
|
|
1651
1651
|
))
|
|
1652
1652
|
return w;
|
|
1653
1653
|
}
|
|
1654
|
-
const
|
|
1655
|
-
return w &&
|
|
1654
|
+
const S = Nt(y, r, i, s, n) ? pr(y, t, e, i, s, n) : null;
|
|
1655
|
+
return w && S ? w.distance <= S.distance ? w : S : w || S || null;
|
|
1656
1656
|
}
|
|
1657
1657
|
}
|
|
1658
1658
|
const _s = /* @__PURE__ */ new De(), mi = /* @__PURE__ */ new lt(), gi = /* @__PURE__ */ new lt(), Xi = /* @__PURE__ */ new ot(), qr = /* @__PURE__ */ new Re(), Ps = /* @__PURE__ */ new Re();
|
|
@@ -1665,13 +1665,13 @@ function mr(c, t, e, i, s = null) {
|
|
|
1665
1665
|
const { float32Array: n, uint16Array: r, uint32Array: a } = ne;
|
|
1666
1666
|
let o = c * 2;
|
|
1667
1667
|
if (s === null && (e.boundingBox || e.computeBoundingBox(), qr.set(e.boundingBox.min, e.boundingBox.max, i), s = qr), he(o, r)) {
|
|
1668
|
-
const h = t.geometry, d = h.index, u = h.attributes.position, f = e.index, m = e.attributes.position, b =
|
|
1668
|
+
const h = t.geometry, d = h.index, u = h.attributes.position, f = e.index, m = e.attributes.position, b = Ce(c, a), y = Pe(o, r);
|
|
1669
1669
|
if (Xi.copy(i).invert(), e.boundsTree)
|
|
1670
1670
|
return le(c, n, Ps), Ps.matrix.copy(Xi), Ps.needsUpdate = !0, e.boundsTree.shapecast({
|
|
1671
1671
|
intersectsBounds: (w) => Ps.intersectsBox(w),
|
|
1672
1672
|
intersectsTriangle: (w) => {
|
|
1673
1673
|
w.a.applyMatrix4(i), w.b.applyMatrix4(i), w.c.applyMatrix4(i), w.needsUpdate = !0;
|
|
1674
|
-
for (let x = b * 3,
|
|
1674
|
+
for (let x = b * 3, S = (y + b) * 3; x < S; x += 3)
|
|
1675
1675
|
if (fe(gi, x, d, u), gi.needsUpdate = !0, w.intersectsTriangle(gi))
|
|
1676
1676
|
return !0;
|
|
1677
1677
|
return !1;
|
|
@@ -1681,8 +1681,8 @@ function mr(c, t, e, i, s = null) {
|
|
|
1681
1681
|
const C = 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
|
|
1685
|
-
if (fe(gi,
|
|
1684
|
+
for (let S = 0, M = C * 3; S < M; S += 3)
|
|
1685
|
+
if (fe(gi, S, f, m), gi.needsUpdate = !0, mi.intersectsTriangle(gi))
|
|
1686
1686
|
return !0;
|
|
1687
1687
|
}
|
|
1688
1688
|
}
|
|
@@ -1697,11 +1697,11 @@ function Nc(c, t, e, i = {}, s = {}, n = 0, r = 1 / 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
1698
|
let m = zc, b = Vc, y = null, C = null;
|
|
1699
1699
|
s && (y = Uc, C = jc);
|
|
1700
|
-
let w = 1 / 0, x = null,
|
|
1700
|
+
let w = 1 / 0, x = null, S = 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, E) => E < w && E < 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({
|
|
@@ -1713,27 +1713,27 @@ function Nc(c, t, e, i = {}, s = {}, n = 0, r = 1 / 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), C && C.copy(y), w = k, x = I,
|
|
1716
|
+
if (k < w && (b.copy(m), C && C.copy(y), w = k, x = I, S = _), k < n)
|
|
1717
1717
|
return !0;
|
|
1718
1718
|
}
|
|
1719
1719
|
}
|
|
1720
1720
|
}
|
|
1721
1721
|
});
|
|
1722
1722
|
{
|
|
1723
|
-
const
|
|
1724
|
-
for (let v = 0, T =
|
|
1723
|
+
const E = gn(t);
|
|
1724
|
+
for (let v = 0, T = E; v < T; 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), C && C.copy(y), w = I, x = _,
|
|
1729
|
+
if (I < w && (b.copy(m), C && C.copy(y), w = I, x = _, S = 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(C) : s.point = C.clone(), s.point.applyMatrix4(As), b.applyMatrix4(As), s.distance = b.sub(s.point).length(), s.faceIndex =
|
|
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(C) : s.point = C.clone(), s.point.applyMatrix4(As), b.applyMatrix4(As), s.distance = b.sub(s.point).length(), s.faceIndex = S), i);
|
|
1737
1737
|
}
|
|
1738
1738
|
function Hc(c, t = null) {
|
|
1739
1739
|
t && Array.isArray(t) && (t = new Set(t));
|
|
@@ -1745,34 +1745,34 @@ 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 =
|
|
1749
|
-
let w = 1 / 0, x = 1 / 0,
|
|
1748
|
+
const y = Ce(u, r), C = Pe(b, a);
|
|
1749
|
+
let w = 1 / 0, x = 1 / 0, S = 1 / 0, M = -1 / 0, O = -1 / 0, E = -1 / 0;
|
|
1750
1750
|
for (let v = y, T = y + C; v < T; 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 <
|
|
1756
|
+
B < w && (w = B), B > M && (M = B), k < x && (x = k), k > O && (O = k), D < S && (S = D), D > E && (E = D);
|
|
1757
1757
|
}
|
|
1758
1758
|
}
|
|
1759
|
-
return o[u + 0] !== w || o[u + 1] !== x || o[u + 2] !==
|
|
1759
|
+
return o[u + 0] !== w || o[u + 1] !== x || o[u + 2] !== S || o[u + 3] !== M || o[u + 4] !== O || o[u + 5] !== E ? (o[u + 0] = w, o[u + 1] = x, o[u + 2] = S, o[u + 3] = M, o[u + 4] = O, o[u + 5] = E, !0) : !1;
|
|
1760
1760
|
} else {
|
|
1761
1761
|
const y = be(u), C = we(u, r);
|
|
1762
|
-
let w = m, x = !1,
|
|
1762
|
+
let w = m, x = !1, S = !1;
|
|
1763
1763
|
if (t) {
|
|
1764
1764
|
if (!w) {
|
|
1765
|
-
const _ = y / xe + f /
|
|
1766
|
-
x = t.has(_),
|
|
1765
|
+
const _ = y / xe + f / _e, A = C / xe + f / _e;
|
|
1766
|
+
x = t.has(_), S = t.has(A), w = !x && !S;
|
|
1767
1767
|
}
|
|
1768
1768
|
} else
|
|
1769
|
-
x = !0,
|
|
1770
|
-
const M = w || x, O = w ||
|
|
1771
|
-
let
|
|
1772
|
-
M && (
|
|
1769
|
+
x = !0, S = !0;
|
|
1770
|
+
const M = w || x, O = w || S;
|
|
1771
|
+
let E = !1;
|
|
1772
|
+
M && (E = d(y, f, w));
|
|
1773
1773
|
let v = !1;
|
|
1774
1774
|
O && (v = d(C, f, w));
|
|
1775
|
-
const T =
|
|
1775
|
+
const T = E || v;
|
|
1776
1776
|
if (T)
|
|
1777
1777
|
for (let _ = 0; _ < 3; _++) {
|
|
1778
1778
|
const A = y + _, I = C + _, B = o[A], k = o[A + 3], D = o[I], R = o[I + 3];
|
|
@@ -1788,7 +1788,7 @@ function Gc(c, t, e, i, s, n, r) {
|
|
|
1788
1788
|
function gr(c, t, e, i, s, n, r) {
|
|
1789
1789
|
const { float32Array: a, uint16Array: o, uint32Array: l } = ne, h = c * 2;
|
|
1790
1790
|
if (he(h, o)) {
|
|
1791
|
-
const u =
|
|
1791
|
+
const u = Ce(c, l), f = Pe(h, o);
|
|
1792
1792
|
Ic(t, e, i, u, f, s, n, r);
|
|
1793
1793
|
} else {
|
|
1794
1794
|
const u = be(c);
|
|
@@ -1807,7 +1807,7 @@ function yr(c, t, e, i, s, n) {
|
|
|
1807
1807
|
const { float32Array: r, uint16Array: a, uint32Array: o } = ne;
|
|
1808
1808
|
let l = c * 2;
|
|
1809
1809
|
if (he(l, a)) {
|
|
1810
|
-
const d =
|
|
1810
|
+
const d = Ce(c, o), u = Pe(l, a);
|
|
1811
1811
|
return Bc(t, e, i, d, u, s, n);
|
|
1812
1812
|
} else {
|
|
1813
1813
|
const d = Tr(c, o), u = Wc[d], m = i.direction[u] >= 0;
|
|
@@ -1822,8 +1822,8 @@ function yr(c, t, e, i, s, n) {
|
|
|
1822
1822
|
))
|
|
1823
1823
|
return w;
|
|
1824
1824
|
}
|
|
1825
|
-
const
|
|
1826
|
-
return w &&
|
|
1825
|
+
const S = Nt(y, r, i, s, n) ? yr(y, t, e, i, s, n) : null;
|
|
1826
|
+
return w && S ? w.distance <= S.distance ? w : S : w || S || null;
|
|
1827
1827
|
}
|
|
1828
1828
|
}
|
|
1829
1829
|
const Is = /* @__PURE__ */ new De(), yi = /* @__PURE__ */ new lt(), xi = /* @__PURE__ */ new lt(), Ki = /* @__PURE__ */ new ot(), Yr = /* @__PURE__ */ new Re(), Bs = /* @__PURE__ */ new Re();
|
|
@@ -1836,13 +1836,13 @@ function xr(c, t, e, i, s = null) {
|
|
|
1836
1836
|
const { float32Array: n, uint16Array: r, uint32Array: a } = ne;
|
|
1837
1837
|
let o = c * 2;
|
|
1838
1838
|
if (s === null && (e.boundingBox || e.computeBoundingBox(), Yr.set(e.boundingBox.min, e.boundingBox.max, i), s = Yr), he(o, r)) {
|
|
1839
|
-
const h = t.geometry, d = h.index, u = h.attributes.position, f = e.index, m = e.attributes.position, b =
|
|
1839
|
+
const h = t.geometry, d = h.index, u = h.attributes.position, f = e.index, m = e.attributes.position, b = Ce(c, a), y = Pe(o, r);
|
|
1840
1840
|
if (Ki.copy(i).invert(), e.boundsTree)
|
|
1841
1841
|
return le(c, n, Bs), Bs.matrix.copy(Ki), Bs.needsUpdate = !0, e.boundsTree.shapecast({
|
|
1842
1842
|
intersectsBounds: (w) => Bs.intersectsBox(w),
|
|
1843
1843
|
intersectsTriangle: (w) => {
|
|
1844
1844
|
w.a.applyMatrix4(i), w.b.applyMatrix4(i), w.c.applyMatrix4(i), w.needsUpdate = !0;
|
|
1845
|
-
for (let x = b,
|
|
1845
|
+
for (let x = b, S = y + b; x < S; x++)
|
|
1846
1846
|
if (fe(xi, 3 * t.resolveTriangleIndex(x), d, u), xi.needsUpdate = !0, w.intersectsTriangle(xi))
|
|
1847
1847
|
return !0;
|
|
1848
1848
|
return !1;
|
|
@@ -1851,8 +1851,8 @@ function xr(c, t, e, i, s = null) {
|
|
|
1851
1851
|
{
|
|
1852
1852
|
const C = gn(e);
|
|
1853
1853
|
for (let w = b, x = y + b; w < x; w++) {
|
|
1854
|
-
const
|
|
1855
|
-
fe(yi, 3 *
|
|
1854
|
+
const S = t.resolveTriangleIndex(w);
|
|
1855
|
+
fe(yi, 3 * S, d, u), yi.a.applyMatrix4(Ki), yi.b.applyMatrix4(Ki), yi.c.applyMatrix4(Ki), yi.needsUpdate = !0;
|
|
1856
1856
|
for (let M = 0, O = C * 3; M < O; M += 3)
|
|
1857
1857
|
if (fe(xi, M, f, m), xi.needsUpdate = !0, yi.intersectsTriangle(xi))
|
|
1858
1858
|
return !0;
|
|
@@ -1869,47 +1869,47 @@ function Jc(c, t, e, i = {}, s = {}, n = 0, r = 1 / 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
1870
|
let m = Xc, b = Zc, y = null, C = null;
|
|
1871
1871
|
s && (y = Kc, C = $c);
|
|
1872
|
-
let w = 1 / 0, x = null,
|
|
1872
|
+
let w = 1 / 0, x = null, S = 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, E) => E < w && E < 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 E = t.boundsTree;
|
|
1880
|
+
return E.shapecast({
|
|
1881
1881
|
boundsTraverseOrder: (v) => $i.distanceToBox(v),
|
|
1882
1882
|
intersectsBounds: (v, T, _) => _ < w && _ < r,
|
|
1883
1883
|
intersectsRange: (v, T) => {
|
|
1884
1884
|
for (let _ = v, A = v + T; _ < A; _++) {
|
|
1885
|
-
const I =
|
|
1885
|
+
const I = E.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), C && C.copy(y), w = R, x = B,
|
|
1891
|
+
if (R < w && (b.copy(m), C && C.copy(y), w = R, x = B, S = _), R < n)
|
|
1892
1892
|
return !0;
|
|
1893
1893
|
}
|
|
1894
1894
|
}
|
|
1895
1895
|
}
|
|
1896
1896
|
});
|
|
1897
1897
|
} else {
|
|
1898
|
-
const
|
|
1899
|
-
for (let v = 0, T =
|
|
1898
|
+
const E = gn(t);
|
|
1899
|
+
for (let v = 0, T = E; v < T; 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), C && C.copy(y), w = B, x = _,
|
|
1905
|
+
if (B < w && (b.copy(m), C && C.copy(y), w = B, x = _, S = 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(C) : s.point = C.clone(), s.point.applyMatrix4(ks), b.applyMatrix4(ks), s.distance = b.sub(s.point).length(), s.faceIndex =
|
|
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(C) : s.point = C.clone(), s.point.applyMatrix4(ks), b.applyMatrix4(ks), s.distance = b.sub(s.point).length(), s.faceIndex = S), 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);
|
|
@@ -1980,7 +1980,7 @@ class ms extends bc {
|
|
|
1980
1980
|
function o(l) {
|
|
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
|
-
for (let m = 0, b = d.byteLength /
|
|
1983
|
+
for (let m = 0, b = d.byteLength / _e; m < b; m++) {
|
|
1984
1984
|
const y = xe * m, C = 2 * y;
|
|
1985
1985
|
he(C, f) || (u[y + 6] = u[y + 6] / xe - m);
|
|
1986
1986
|
}
|
|
@@ -2048,14 +2048,14 @@ class ms extends bc {
|
|
|
2048
2048
|
const u = ["getX", "getY", "getZ"], f = i.offset;
|
|
2049
2049
|
for (let m = t, b = t + e; m < b; m++) {
|
|
2050
2050
|
const C = (n ? n[m] : m) * 3, w = (m - f) * 6;
|
|
2051
|
-
let x = C + 0,
|
|
2052
|
-
a && (x = a[x],
|
|
2051
|
+
let x = C + 0, S = C + 1, M = C + 2;
|
|
2052
|
+
a && (x = a[x], S = a[S], M = a[M]), o || (x = x * d + h, S = S * d + h, M = M * d + h);
|
|
2053
2053
|
for (let O = 0; O < 3; O++) {
|
|
2054
|
-
let
|
|
2055
|
-
o ? (
|
|
2056
|
-
let _ =
|
|
2054
|
+
let E, v, T;
|
|
2055
|
+
o ? (E = r[u[O]](x), v = r[u[O]](S), T = r[u[O]](M)) : (E = l[x + O], v = l[S + O], T = l[M + O]);
|
|
2056
|
+
let _ = E;
|
|
2057
2057
|
v < _ && (_ = v), T < _ && (_ = T);
|
|
2058
|
-
let A =
|
|
2058
|
+
let A = E;
|
|
2059
2059
|
v > A && (A = v), T > A && (A = T);
|
|
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;
|
|
@@ -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, C, w, x,
|
|
2232
|
-
for (let
|
|
2233
|
-
f(
|
|
2231
|
+
const m = (b, y, C, w, x, S, M, O) => {
|
|
2232
|
+
for (let E = C, v = C + w; E < v; E++) {
|
|
2233
|
+
f(E), h.a.applyMatrix4(e), h.b.applyMatrix4(e), h.c.applyMatrix4(e), h.needsUpdate = !0;
|
|
2234
2234
|
for (let T = b, _ = b + y; T < _; T++)
|
|
2235
|
-
if (l(T), r.needsUpdate = !0, n(r, h, T,
|
|
2235
|
+
if (l(T), r.needsUpdate = !0, n(r, h, T, E, x, S, 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, C, w, x,
|
|
2243
|
-
return b(y, C, w, x,
|
|
2242
|
+
s = function(y, C, w, x, S, M, O, E) {
|
|
2243
|
+
return b(y, C, w, x, S, M, O, E) ? !0 : m(y, C, w, x, S, M, O, E);
|
|
2244
2244
|
};
|
|
2245
2245
|
} else
|
|
2246
2246
|
s = m;
|
|
@@ -2355,7 +2355,7 @@ const _i = {
|
|
|
2355
2355
|
LineLoop: go.prototype.raycast,
|
|
2356
2356
|
Points: xo.prototype.raycast,
|
|
2357
2357
|
BatchedMesh: ll.prototype.raycast
|
|
2358
|
-
},
|
|
2358
|
+
}, Se = /* @__PURE__ */ new mn(), Rs = [];
|
|
2359
2359
|
function Qc(c, t) {
|
|
2360
2360
|
if (this.isBatchedMesh)
|
|
2361
2361
|
eh.call(this, c, t);
|
|
@@ -2384,26 +2384,26 @@ function Qc(c, t) {
|
|
|
2384
2384
|
function eh(c, t) {
|
|
2385
2385
|
if (this.boundsTrees) {
|
|
2386
2386
|
const e = this.boundsTrees, i = this._drawInfo || this._instanceInfo, s = this._drawRanges || this._geometryInfo, n = this.matrixWorld;
|
|
2387
|
-
|
|
2388
|
-
const r =
|
|
2389
|
-
|
|
2387
|
+
Se.material = this.material, Se.geometry = this.geometry;
|
|
2388
|
+
const r = Se.geometry.boundsTree, a = Se.geometry.drawRange;
|
|
2389
|
+
Se.geometry.boundingSphere === null && (Se.geometry.boundingSphere = new ol());
|
|
2390
2390
|
for (let o = 0, l = i.length; o < l; o++) {
|
|
2391
2391
|
if (!this.getVisibleAt(o))
|
|
2392
2392
|
continue;
|
|
2393
2393
|
const h = i[o].geometryIndex;
|
|
2394
|
-
if (
|
|
2395
|
-
this.getBoundingBoxAt(h,
|
|
2394
|
+
if (Se.geometry.boundsTree = e[h], this.getMatrixAt(o, Se.matrixWorld).premultiply(n), !Se.geometry.boundsTree) {
|
|
2395
|
+
this.getBoundingBoxAt(h, Se.geometry.boundingBox), this.getBoundingSphereAt(h, Se.geometry.boundingSphere);
|
|
2396
2396
|
const d = s[h];
|
|
2397
|
-
|
|
2397
|
+
Se.geometry.setDrawRange(d.start, d.count);
|
|
2398
2398
|
}
|
|
2399
|
-
|
|
2399
|
+
Se.raycast(c, Rs);
|
|
2400
2400
|
for (let d = 0, u = Rs.length; d < u; d++) {
|
|
2401
2401
|
const f = Rs[d];
|
|
2402
2402
|
f.object = this, f.batchId = o, t.push(f);
|
|
2403
2403
|
}
|
|
2404
2404
|
Rs.length = 0;
|
|
2405
2405
|
}
|
|
2406
|
-
|
|
2406
|
+
Se.geometry.boundsTree = r, Se.geometry.drawRange = a, Se.material = null, Se.geometry = null;
|
|
2407
2407
|
} else
|
|
2408
2408
|
_i.BatchedMesh.call(this, c, t);
|
|
2409
2409
|
}
|
|
@@ -3417,7 +3417,7 @@ class gs {
|
|
|
3417
3417
|
return e = Math.min(t, 255), e / 255;
|
|
3418
3418
|
}
|
|
3419
3419
|
}
|
|
3420
|
-
class
|
|
3420
|
+
class Ae {
|
|
3421
3421
|
/**
|
|
3422
3422
|
* Gets screen coordinate by pointer event.
|
|
3423
3423
|
*/
|
|
@@ -3453,7 +3453,7 @@ class Pe {
|
|
|
3453
3453
|
* Converts screen to world coordinate.
|
|
3454
3454
|
*/
|
|
3455
3455
|
static screen2World(t, e, i) {
|
|
3456
|
-
const s =
|
|
3456
|
+
const s = Ae.screen2Ndc(t, e, i);
|
|
3457
3457
|
return new p.Vector3(s.x, s.y, 1).unproject(e);
|
|
3458
3458
|
}
|
|
3459
3459
|
/**
|
|
@@ -3476,7 +3476,7 @@ class Pe {
|
|
|
3476
3476
|
static world2NormalizedScreen(t, e, i) {
|
|
3477
3477
|
const s = new p.Vector3(), n = t instanceof p.Vector2 ? 0 : t.z;
|
|
3478
3478
|
s.set(t.x, t.y, n);
|
|
3479
|
-
const r =
|
|
3479
|
+
const r = Ae.world2Screen(s, e, i);
|
|
3480
3480
|
return r.x /= i.clientWidth, r.y /= i.clientHeight, r;
|
|
3481
3481
|
}
|
|
3482
3482
|
}
|
|
@@ -3519,7 +3519,7 @@ class S0 {
|
|
|
3519
3519
|
}
|
|
3520
3520
|
const xh = {
|
|
3521
3521
|
"Precision from file": 99
|
|
3522
|
-
}, E0 = (c, t) => c.toFixed(t === xh["Precision from file"] ? 2 : t), bh = "en",
|
|
3522
|
+
}, E0 = (c, t) => c.toFixed(t === xh["Precision from file"] ? 2 : t), bh = "en", bt = !1, wh = 10, qe = 11, li = 12, Co = 583902, O0 = [0.031, 0.906, 0.867, 0.5], Rn = [0.3, 0.3, 0.3, 0.8], So = 0.5, Fn = 0.1, zn = 5e3, vh = 45, _0 = "x-viewer-iconfont", P0 = "x-viewer-iconfont2", Eo = 10, Qr = new p.Vector3(), ea = new p.Vector3(), ta = new p.Vector3(), cs = new p.Vector3(), St = new p.Vector3(), ia = new p.Triangle();
|
|
3523
3523
|
function Mh(c, t, e, i, s) {
|
|
3524
3524
|
const n = [], r = {};
|
|
3525
3525
|
let a, o, l, h;
|
|
@@ -3540,7 +3540,7 @@ function Th(c, t, e, i) {
|
|
|
3540
3540
|
}
|
|
3541
3541
|
const Vn = [new p.Vector3(1, 0, 0), new p.Vector3(0, 1, 0), new p.Vector3(0, 0, 1), new p.Vector3(1, 1, 0), new p.Vector3(0, 1, 1), new p.Vector3(1, 0, 1), new p.Vector3(1, 1, 1), new p.Vector3(0, 0, 0)];
|
|
3542
3542
|
function Ch(c, t) {
|
|
3543
|
-
return
|
|
3543
|
+
return St.addVectors(c, t), St.x === 0 || St.y === 0 || St.z === 0;
|
|
3544
3544
|
}
|
|
3545
3545
|
class Sh {
|
|
3546
3546
|
/**
|
|
@@ -3556,13 +3556,13 @@ 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], C = r[u + (b + 1) % 3], w = Math.min(y, C), x = Math.max(y, C),
|
|
3560
|
-
h[
|
|
3559
|
+
const y = r[u + b], C = r[u + (b + 1) % 3], w = Math.min(y, C), x = Math.max(y, C), S = w + "," + x;
|
|
3560
|
+
h[S] === void 0 ? h[S] = {
|
|
3561
3561
|
index1: w,
|
|
3562
3562
|
index2: x,
|
|
3563
3563
|
face1: m,
|
|
3564
3564
|
face2: void 0
|
|
3565
|
-
} : h[
|
|
3565
|
+
} : h[S].face2 = m;
|
|
3566
3566
|
}
|
|
3567
3567
|
}
|
|
3568
3568
|
for (const u in h) {
|
|
@@ -3661,10 +3661,10 @@ class Sh {
|
|
|
3661
3661
|
C.splice(x, 1), x = 0;
|
|
3662
3662
|
} else break;
|
|
3663
3663
|
}
|
|
3664
|
-
const
|
|
3664
|
+
const S = /* @__PURE__ */ new Set();
|
|
3665
3665
|
for (let T = 0; T < y.length; T++)
|
|
3666
3666
|
y[T].forEach((A) => {
|
|
3667
|
-
|
|
3667
|
+
S.has(A) ? P.warn("[Edge] " + A + " is already in positionIndexSet!") : S.add(A);
|
|
3668
3668
|
});
|
|
3669
3669
|
const M = (T, _) => {
|
|
3670
3670
|
let A = !1;
|
|
@@ -3682,7 +3682,7 @@ class Sh {
|
|
|
3682
3682
|
}, O = (T, _, A) => {
|
|
3683
3683
|
const I = [];
|
|
3684
3684
|
return I.push(M(T, _)), I.push(M(_, A)), I.push(M(A, T)), I.filter((B) => B === !0).length >= 2;
|
|
3685
|
-
},
|
|
3685
|
+
}, E = (T, _) => {
|
|
3686
3686
|
if (!u[T]) return P.warn("[Edge] " + T + " position isn't used!"), !0;
|
|
3687
3687
|
const A = u[T];
|
|
3688
3688
|
for (const B of A) {
|
|
@@ -3697,7 +3697,7 @@ class Sh {
|
|
|
3697
3697
|
let D = d[B.b], R = d[B.c];
|
|
3698
3698
|
if (B.b === T ? D = d[B.a] : B.c === T && (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
|
-
if (!(!D.inited || !R.inited) && (
|
|
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;
|
|
3702
3702
|
}
|
|
3703
3703
|
return !0;
|
|
@@ -3710,7 +3710,7 @@ class Sh {
|
|
|
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 && !E(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) {
|
|
@@ -4040,7 +4040,7 @@ class F {
|
|
|
4040
4040
|
}
|
|
4041
4041
|
}
|
|
4042
4042
|
}
|
|
4043
|
-
const jn = 1e7, aa = new p.Box2(), oa = new p.Box2(), la = new p.Vector3(), ca = new p.Vector3(), ha = new p.Vector3(),
|
|
4043
|
+
const jn = 1e7, aa = new p.Box2(), oa = new p.Box2(), la = new p.Vector3(), ca = new p.Vector3(), ha = new p.Vector3(), Bt = new p.Triangle(), Eh = /not find (pre|next) vertex|has repeat vertex|translateLine line eror|not find Intersection/;
|
|
4044
4044
|
function Oh(c) {
|
|
4045
4045
|
const t = console.error;
|
|
4046
4046
|
console.error = (...e) => {
|
|
@@ -4208,10 +4208,10 @@ class N {
|
|
|
4208
4208
|
const i = t.getAttribute("position"), s = t.index;
|
|
4209
4209
|
if (s)
|
|
4210
4210
|
for (let n = 0; n < s.count; n += 3)
|
|
4211
|
-
|
|
4211
|
+
Bt.a.fromBufferAttribute(i, s.getX(n)), Bt.b.fromBufferAttribute(i, s.getX(n + 1)), Bt.c.fromBufferAttribute(i, s.getX(n + 2)), e += Bt.getArea();
|
|
4212
4212
|
else
|
|
4213
4213
|
for (let n = 0; n < i.count; n += 3)
|
|
4214
|
-
|
|
4214
|
+
Bt.a.fromBufferAttribute(i, n), Bt.b.fromBufferAttribute(i, n + 1), Bt.c.fromBufferAttribute(i, n + 2), e += Bt.getArea();
|
|
4215
4215
|
return e;
|
|
4216
4216
|
}
|
|
4217
4217
|
/**
|
|
@@ -4294,7 +4294,7 @@ class N {
|
|
|
4294
4294
|
static convertSimpleWidthLineToMeshGeometry(t, e) {
|
|
4295
4295
|
let i, s = !1, n = !1, r = [], a = [], o, l, h = new p.Vector2(), d = new p.Vector2(), u = new p.Vector2(), f = new p.Vector2();
|
|
4296
4296
|
const m = [], b = e / 2;
|
|
4297
|
-
for (let x = 0,
|
|
4297
|
+
for (let x = 0, S = t.length - 1; x < S; x++)
|
|
4298
4298
|
s = !x, n = x === t.length - 2, i = this.getOffsetPoint(t[x], t[x + 1], b), h = new p.Vector2(t[x].x + i.x, t[x].y + i.y), d = new p.Vector2(t[x + 1].x + i.x, t[x + 1].y + i.y), u = new p.Vector2(t[x].x - i.x, t[x].y - i.y), f = new p.Vector2(t[x + 1].x - i.x, t[x + 1].y - i.y), s || (o = this.getLineLineIntersectionPoint(
|
|
4299
4299
|
r[0],
|
|
4300
4300
|
r[1],
|
|
@@ -4394,7 +4394,7 @@ Je.init({
|
|
|
4394
4394
|
}
|
|
4395
4395
|
}
|
|
4396
4396
|
});
|
|
4397
|
-
class
|
|
4397
|
+
class Te {
|
|
4398
4398
|
/**
|
|
4399
4399
|
* Compares two materials
|
|
4400
4400
|
*/
|
|
@@ -4938,7 +4938,7 @@ const Ih = new p.Vector3(0, 1, 0), Ze = class Ze {
|
|
|
4938
4938
|
return n.layers.enableAll(), Ze.disableLayerChannels(n, [
|
|
4939
4939
|
li,
|
|
4940
4940
|
qe
|
|
4941
|
-
]), n.userData.isOutline = !0, n.matrixAutoUpdate =
|
|
4941
|
+
]), n.userData.isOutline = !0, n.matrixAutoUpdate = bt, i && n.applyMatrix4(i), n;
|
|
4942
4942
|
}
|
|
4943
4943
|
/**
|
|
4944
4944
|
* Clones object
|
|
@@ -4951,7 +4951,7 @@ const Ih = new p.Vector3(0, 1, 0), Ze = class Ze {
|
|
|
4951
4951
|
return e && i.traverse((s) => {
|
|
4952
4952
|
if (s instanceof p.Mesh || s instanceof p.Line) {
|
|
4953
4953
|
const n = s;
|
|
4954
|
-
n.material =
|
|
4954
|
+
n.material = Te.cloneMaterial(n.material);
|
|
4955
4955
|
}
|
|
4956
4956
|
}), i;
|
|
4957
4957
|
}
|
|
@@ -5167,22 +5167,22 @@ const Vs = new p.Matrix4(), Bh = new p.Matrix4(), us = class us {
|
|
|
5167
5167
|
let f = [], m = 0, b = 0, y = 0;
|
|
5168
5168
|
const C = [];
|
|
5169
5169
|
if (d.forEach((x) => {
|
|
5170
|
-
const
|
|
5171
|
-
if (M.applyMatrix4(
|
|
5172
|
-
const O =
|
|
5170
|
+
const S = t.children[x], M = S.geometry.clone();
|
|
5171
|
+
if (M.applyMatrix4(S.matrix), N.tryConvertInterleavedBufferAttributes(M), M.userData.isLineSegments = S.isLineSegments === !0, f.push(M), e) {
|
|
5172
|
+
const O = S.name, E = M.attributes?.position?.count, v = M.index?.count || 0, T = {
|
|
5173
5173
|
batchId: m,
|
|
5174
5174
|
name: O,
|
|
5175
5175
|
positionStart: b,
|
|
5176
|
-
positionCount:
|
|
5176
|
+
positionCount: E,
|
|
5177
5177
|
indexStart: y,
|
|
5178
5178
|
indexCount: v
|
|
5179
5179
|
};
|
|
5180
|
-
Object.keys(
|
|
5180
|
+
Object.keys(S.userData).length !== 0 && (T.userData = S.userData), C.push(T), b += E, y += v, m++;
|
|
5181
5181
|
}
|
|
5182
5182
|
}), f.length === 0) return;
|
|
5183
5183
|
let w;
|
|
5184
5184
|
if (u.isMesh) {
|
|
5185
|
-
const x =
|
|
5185
|
+
const x = Oe(f);
|
|
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) {
|
|
@@ -5190,11 +5190,11 @@ const Vs = new p.Matrix4(), Bh = new p.Matrix4(), us = class us {
|
|
|
5190
5190
|
if (!x) return;
|
|
5191
5191
|
w = new p.LineSegments(x, u.material), a.push(w);
|
|
5192
5192
|
} else if (u.isPoints) {
|
|
5193
|
-
const x =
|
|
5193
|
+
const x = Oe(f);
|
|
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 = C : (w.userData = u.userData, w.userData.batches = void 0), w.userData.layerName = u.userData.layerName, w.name = "[Merged] " + u.name, w.matrixAutoUpdate =
|
|
5197
|
+
w && (e ? w.userData.batches = C : (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) => {
|
|
@@ -5216,7 +5216,7 @@ const Vs = new p.Matrix4(), Bh = new p.Matrix4(), us = class us {
|
|
|
5216
5216
|
const a = Array.isArray(t), o = a ? t.length : t.children.length;
|
|
5217
5217
|
if (e === i || e >= o || i >= o) return r;
|
|
5218
5218
|
const l = a ? t[e] : t.children[e], h = a ? t[i] : t.children[i];
|
|
5219
|
-
return this.areObjectsMergeable(l, h) && this.areGeometriesMergeable(l.geometry, h.geometry) &&
|
|
5219
|
+
return this.areObjectsMergeable(l, h) && this.areGeometriesMergeable(l.geometry, h.geometry) && Te.materialsEquals(l.material, h.material) && (!s[i] && (s[i] = { indexes: [i] }, this.removeFromArray(n, i)), s[i].indexes.push(e), r = !0), r;
|
|
5220
5220
|
}
|
|
5221
5221
|
/**
|
|
5222
5222
|
* TODO: Filters XC etc.
|
|
@@ -5241,12 +5241,12 @@ const Vs = new p.Matrix4(), Bh = new p.Matrix4(), us = class us {
|
|
|
5241
5241
|
if (C.isInstancedMesh || !C.geometry || !(C.geometry instanceof p.BufferGeometry)) continue;
|
|
5242
5242
|
let w = !1;
|
|
5243
5243
|
const x = Object.values(o);
|
|
5244
|
-
for (let
|
|
5245
|
-
const M = x[
|
|
5244
|
+
for (let S = x.length - 1; S >= 0; --S) {
|
|
5245
|
+
const M = x[S].indexes[0];
|
|
5246
5246
|
if (w = this.tryHandleMergeableObjects(t, y, M, o, l), w) break;
|
|
5247
5247
|
}
|
|
5248
|
-
for (let
|
|
5249
|
-
const M = l[
|
|
5248
|
+
for (let S = l.length - 1; !w && S >= 0; --S) {
|
|
5249
|
+
const M = l[S];
|
|
5250
5250
|
if (w = this.tryHandleMergeableObjects(t, y, M, o, l), w) break;
|
|
5251
5251
|
}
|
|
5252
5252
|
!w && l.push(y);
|
|
@@ -5258,8 +5258,8 @@ const Vs = new p.Matrix4(), Bh = new p.Matrix4(), us = class us {
|
|
|
5258
5258
|
const C = y.indexes;
|
|
5259
5259
|
if (C.length < 2) return;
|
|
5260
5260
|
const w = t[C[0]];
|
|
5261
|
-
let x = [],
|
|
5262
|
-
const
|
|
5261
|
+
let x = [], S = 0, M = 0, O = 0;
|
|
5262
|
+
const E = [];
|
|
5263
5263
|
if (C.forEach((T) => {
|
|
5264
5264
|
const _ = t[T], 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) {
|
|
@@ -5267,7 +5267,7 @@ const Vs = new p.Matrix4(), Bh = new p.Matrix4(), us = class us {
|
|
|
5267
5267
|
let D;
|
|
5268
5268
|
w.isLine && (!A.boundingSphere && A.computeBoundingSphere(), D = A.boundingSphere.clone());
|
|
5269
5269
|
const R = {
|
|
5270
|
-
batchId:
|
|
5270
|
+
batchId: S,
|
|
5271
5271
|
name: I,
|
|
5272
5272
|
positionStart: M,
|
|
5273
5273
|
positionCount: B,
|
|
@@ -5275,24 +5275,24 @@ 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), E.push(R), M += B, O += k, S++;
|
|
5279
5279
|
}
|
|
5280
5280
|
}), x.length === 0) return;
|
|
5281
5281
|
let v;
|
|
5282
5282
|
if (w.isMesh) {
|
|
5283
|
-
const T =
|
|
5283
|
+
const T = Oe(x);
|
|
5284
5284
|
if (!T) return;
|
|
5285
5285
|
T.userData = {}, v = new p.Mesh(T, w.material), h.push(v);
|
|
5286
5286
|
} else if (w.isLine) {
|
|
5287
|
-
const T = this.mergeLineGeometries(x, n, w.material instanceof p.LineDashedMaterial || w.material instanceof p.ShaderMaterial,
|
|
5287
|
+
const T = this.mergeLineGeometries(x, n, w.material instanceof p.LineDashedMaterial || w.material instanceof p.ShaderMaterial, E);
|
|
5288
5288
|
if (!T) return;
|
|
5289
5289
|
v = new p.LineSegments(T, w.material), d.push(v);
|
|
5290
5290
|
} else if (w.isPoints) {
|
|
5291
|
-
const T =
|
|
5291
|
+
const T = Oe(x);
|
|
5292
5292
|
if (!T) return;
|
|
5293
5293
|
T.userData = {}, v = new p.Points(T, w.material), u.push(v);
|
|
5294
5294
|
}
|
|
5295
|
-
v && (n ? v.userData.batches =
|
|
5295
|
+
v && (n ? v.userData.batches = E : (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, C.forEach((T) => f.push(T))), x.forEach((T) => {
|
|
5296
5296
|
T.dispose(), N.releaseGeometryManually(T);
|
|
5297
5297
|
}), x = [];
|
|
5298
5298
|
}), P.debug("[Merge] Ran deepMerge() in " + (Date.now() - a) / 1e3 + "s");
|
|
@@ -5327,7 +5327,7 @@ const Vs = new p.Matrix4(), Bh = new p.Matrix4(), us = class us {
|
|
|
5327
5327
|
if (i)
|
|
5328
5328
|
n = us.mergeBufferGeometriesWithLinesToLineSegments(t, e, s);
|
|
5329
5329
|
else {
|
|
5330
|
-
if (n =
|
|
5330
|
+
if (n = Oe(t), !n) return;
|
|
5331
5331
|
n.userData = {};
|
|
5332
5332
|
const r = [];
|
|
5333
5333
|
let a = 0;
|
|
@@ -5392,8 +5392,8 @@ const Vs = new p.Matrix4(), Bh = new p.Matrix4(), us = class us {
|
|
|
5392
5392
|
let y = 0;
|
|
5393
5393
|
for (let C = 0; C < d.count; C++) {
|
|
5394
5394
|
const w = C * m, x = C !== 0 && C !== d.count - 1 && !h;
|
|
5395
|
-
for (let
|
|
5396
|
-
b[y +
|
|
5395
|
+
for (let S = 0; S < m; S++)
|
|
5396
|
+
b[y + S] = d.array[w + S], x && (b[y + m + S] = d.array[w + S]);
|
|
5397
5397
|
y += x ? 2 * m : m;
|
|
5398
5398
|
}
|
|
5399
5399
|
a.set(b, o), o += f * m;
|
|
@@ -5686,7 +5686,7 @@ class B0 {
|
|
|
5686
5686
|
}
|
|
5687
5687
|
}
|
|
5688
5688
|
const k0 = 10;
|
|
5689
|
-
var
|
|
5689
|
+
var Rt = /* @__PURE__ */ ((c) => (c.TripleCross = "TripleCross", c.Square = "Square", c.Triangle = "Triangle", c.CircleWithCross = "CircleWithCross", c.Cross = "Cross", c.Perpendicular = "Perpendicular", c))(Rt || {});
|
|
5690
5690
|
class D0 {
|
|
5691
5691
|
static createSVGObject(t) {
|
|
5692
5692
|
return new Ml(t);
|
|
@@ -14201,7 +14201,7 @@ class ci extends hi {
|
|
|
14201
14201
|
return this.getBounds().getCenter(new p.Vector3());
|
|
14202
14202
|
}
|
|
14203
14203
|
transToScreenCoord(e, i) {
|
|
14204
|
-
return this.ctx ?
|
|
14204
|
+
return this.ctx ? Ae.world2Screen(e, i, this.ctx.canvas) : new p.Vector2();
|
|
14205
14205
|
}
|
|
14206
14206
|
/**
|
|
14207
14207
|
*
|
|
@@ -14232,7 +14232,7 @@ class ci extends hi {
|
|
|
14232
14232
|
}
|
|
14233
14233
|
}
|
|
14234
14234
|
const Nn = new p.Vector3();
|
|
14235
|
-
class
|
|
14235
|
+
class Ot extends ci {
|
|
14236
14236
|
/**
|
|
14237
14237
|
* @param id
|
|
14238
14238
|
* @param boxes 需要绘制云线框的包围盒集合
|
|
@@ -14243,7 +14243,7 @@ class Et extends ci {
|
|
|
14243
14243
|
super(e);
|
|
14244
14244
|
g(this, "boxes");
|
|
14245
14245
|
g(this, "lineSegments");
|
|
14246
|
-
this.lineSegments = [], this.boxes =
|
|
14246
|
+
this.lineSegments = [], this.boxes = Ot.expandBoxesWithGap(i), this.lineColor = s, this.fillColor = n ?? [s[0], s[1], s[2], 0.12], this.lineWidth = 2, this.calculateCloudLineSegments(this.boxes);
|
|
14247
14247
|
}
|
|
14248
14248
|
/**
|
|
14249
14249
|
* 按包围盒尺寸比例向外扩张,使云线框与变动内容之间留出间隙,避免框线压住文字/图形。
|
|
@@ -14288,7 +14288,7 @@ class Et extends ci {
|
|
|
14288
14288
|
drawBox(e, i, s) {
|
|
14289
14289
|
e.beginPath();
|
|
14290
14290
|
for (let n = 0; n < s.length - 1; n++) {
|
|
14291
|
-
const r = this.transToScreenCoord(s[n], i), a = this.transToScreenCoord(s[n + 1], i), o =
|
|
14291
|
+
const r = this.transToScreenCoord(s[n], i), a = this.transToScreenCoord(s[n + 1], i), o = Ot.getControlPointByTwoPoints(a, r);
|
|
14292
14292
|
n === 0 && e.moveTo(r.x, r.y), e.quadraticCurveTo(o.x, o.y, a.x, a.y);
|
|
14293
14293
|
}
|
|
14294
14294
|
e.stroke();
|
|
@@ -14315,7 +14315,7 @@ class Et extends ci {
|
|
|
14315
14315
|
return "CompareDrawable";
|
|
14316
14316
|
}
|
|
14317
14317
|
}
|
|
14318
|
-
xn._registerDrawableClass(
|
|
14318
|
+
xn._registerDrawableClass(Ot);
|
|
14319
14319
|
const Fh = [
|
|
14320
14320
|
0,
|
|
14321
14321
|
16711680,
|
|
@@ -14690,7 +14690,7 @@ function ji(c, t) {
|
|
|
14690
14690
|
return !0;
|
|
14691
14691
|
}
|
|
14692
14692
|
const _o = "BYLAYER", hn = "BYBLOCK";
|
|
14693
|
-
var
|
|
14693
|
+
var Me = /* @__PURE__ */ ((c) => (c[c.Mesh = -1] = "Mesh", c[c.MeshWithPattern = 0] = "MeshWithPattern", c[c.LineWithWidth = 1] = "LineWithWidth", c[c.Line = 2] = "Line", c[c.LineWithPattern = 3] = "LineWithPattern", c[c.Point = 4] = "Point", c[c.InsertLine = 4.4] = "InsertLine", c[c.InsertSymbol = 4.6] = "InsertSymbol", c[c.Text = 5] = "Text", c))(Me || {});
|
|
14694
14694
|
const sn = ["INSERT", "DIMENSION"];
|
|
14695
14695
|
function Nh(c, t, e, i, s) {
|
|
14696
14696
|
if (!t) return 0;
|
|
@@ -14748,8 +14748,8 @@ function Gh(c, t) {
|
|
|
14748
14748
|
return e === i;
|
|
14749
14749
|
}
|
|
14750
14750
|
var We = /* @__PURE__ */ ((c) => (c.Added = "Added", c.Removed = "Removed", c.Modified = "Modified", c.NoChange = "NoChange", c))(We || {});
|
|
14751
|
-
let
|
|
14752
|
-
const
|
|
14751
|
+
let Be = 1;
|
|
14752
|
+
const Mt = class Mt {
|
|
14753
14753
|
constructor(t, e, i = {}) {
|
|
14754
14754
|
g(this, "dxf1");
|
|
14755
14755
|
g(this, "dxf2");
|
|
@@ -14787,12 +14787,12 @@ const vt = class vt {
|
|
|
14787
14787
|
return this.dxf1.entities.forEach((s) => {
|
|
14788
14788
|
if (!s.inPaperSpace) {
|
|
14789
14789
|
const n = this.getLayerFrozen(this.dxf1, s) === !0;
|
|
14790
|
-
!
|
|
14790
|
+
!Mt.ENTITY_TYPES_TO_IGNORE.includes(s.type) && !n && e.push(s);
|
|
14791
14791
|
}
|
|
14792
14792
|
}), this.dxf2.entities.forEach((s) => {
|
|
14793
14793
|
if (!s.inPaperSpace) {
|
|
14794
14794
|
const n = this.getLayerFrozen(this.dxf2, s) === !0;
|
|
14795
|
-
!
|
|
14795
|
+
!Mt.ENTITY_TYPES_TO_IGNORE.includes(s.type) && !n && i.set(s.handle, s);
|
|
14796
14796
|
}
|
|
14797
14797
|
}), await this.compareEntities(e, i, t), Promise.resolve(this.changes);
|
|
14798
14798
|
}
|
|
@@ -14818,7 +14818,7 @@ const vt = class vt {
|
|
|
14818
14818
|
a.type === "Added" ? a.parentHandles.push(s) : a.type === "Removed" && a.parentHandles.push(i);
|
|
14819
14819
|
else {
|
|
14820
14820
|
const o = [...a.parentHandles, t.handle];
|
|
14821
|
-
a.type === "Added" ? this.changes[
|
|
14821
|
+
a.type === "Added" ? this.changes[Be] = { id: Be, ...a, parentHandles: o } : a.type === "Removed" && (this.changes[Be] = { id: Be, ...a, parentHandles: o }), Be++;
|
|
14822
14822
|
}
|
|
14823
14823
|
}), !i && !s && (this.isComparingBlock = !1), r;
|
|
14824
14824
|
}
|
|
@@ -14869,11 +14869,11 @@ const vt = class vt {
|
|
|
14869
14869
|
const s = U.getUpdateProgressFuncForLoop(t.length, i);
|
|
14870
14870
|
for (let n = 0; n < t.length; n++) {
|
|
14871
14871
|
const r = t[n].handle;
|
|
14872
|
-
if (!e.has(r)) this.changes[
|
|
14873
|
-
id:
|
|
14872
|
+
if (!e.has(r)) this.changes[Be] = {
|
|
14873
|
+
id: Be,
|
|
14874
14874
|
type: "Removed",
|
|
14875
14875
|
handle: r
|
|
14876
|
-
},
|
|
14876
|
+
}, Be++;
|
|
14877
14877
|
else {
|
|
14878
14878
|
const a = t[n], o = e.get(r), l = {};
|
|
14879
14879
|
if (this.entitiesEqual(a, o, void 0, void 0, l)) {
|
|
@@ -14889,11 +14889,11 @@ const vt = class vt {
|
|
|
14889
14889
|
e.delete(r);
|
|
14890
14890
|
continue;
|
|
14891
14891
|
}
|
|
14892
|
-
this.changes[
|
|
14893
|
-
id:
|
|
14892
|
+
this.changes[Be] = {
|
|
14893
|
+
id: Be,
|
|
14894
14894
|
type: "Modified",
|
|
14895
14895
|
handle: r
|
|
14896
|
-
}, this.enableDetailComparision && Object.keys(l).length > 0 && (this.changes[
|
|
14896
|
+
}, this.enableDetailComparision && Object.keys(l).length > 0 && (this.changes[Be].detailChanges = l), Be++;
|
|
14897
14897
|
}
|
|
14898
14898
|
e.delete(r);
|
|
14899
14899
|
}
|
|
@@ -14901,11 +14901,11 @@ const vt = class vt {
|
|
|
14901
14901
|
}
|
|
14902
14902
|
for (const n of e) {
|
|
14903
14903
|
const r = n[0];
|
|
14904
|
-
this.changes[
|
|
14905
|
-
id:
|
|
14904
|
+
this.changes[Be] = {
|
|
14905
|
+
id: Be,
|
|
14906
14906
|
type: "Added",
|
|
14907
14907
|
handle: r
|
|
14908
|
-
},
|
|
14908
|
+
}, Be++;
|
|
14909
14909
|
}
|
|
14910
14910
|
}
|
|
14911
14911
|
bIgnoreChildEntitiesOriginalType(t) {
|
|
@@ -15259,8 +15259,8 @@ const vt = class vt {
|
|
|
15259
15259
|
return parseInt(t, 16) - parseInt(e, 16);
|
|
15260
15260
|
}
|
|
15261
15261
|
};
|
|
15262
|
-
g(
|
|
15263
|
-
let
|
|
15262
|
+
g(Mt, "ENTITY_COLOR_ADDED", 65280), g(Mt, "ENTITY_COLOR_REMOVED", 16711680), g(Mt, "ENTITY_COLOR_NO_CHANGE", 10066329), g(Mt, "ENTITY_COLOR_MARKUP", 16744231), g(Mt, "ENTITY_TYPES_TO_IGNORE", ["ATTRIB", "SEQEND"]);
|
|
15263
|
+
let yt = Mt;
|
|
15264
15264
|
var H = /* @__PURE__ */ ((c) => (c[c.Object = 0] = "Object", c[c.Point = 1] = "Point", c[c.Line = 2] = "Line", c[c.LineSegment = 3] = "LineSegment", c[c.Mesh = 4] = "Mesh", c))(H || {});
|
|
15265
15265
|
const Hn = new De(), Gn = new ot();
|
|
15266
15266
|
class z {
|
|
@@ -15342,7 +15342,7 @@ class z {
|
|
|
15342
15342
|
break;
|
|
15343
15343
|
}
|
|
15344
15344
|
if (e) {
|
|
15345
|
-
if (e.name = this.name, e.matrixAutoUpdate =
|
|
15345
|
+
if (e.name = this.name, e.matrixAutoUpdate = bt, e.applyMatrix4(this.matrix), e.layers.mask = this.layers.mask, e.renderOrder = this.renderOrder, e.userData = this.userData, t === !0)
|
|
15346
15346
|
for (let i = 0; i < this.children.length; i++) {
|
|
15347
15347
|
const s = this.children[i], n = s.convertToThreejsObject(t);
|
|
15348
15348
|
n && e.add(n);
|
|
@@ -15467,7 +15467,7 @@ class z {
|
|
|
15467
15467
|
}
|
|
15468
15468
|
}
|
|
15469
15469
|
const Us = new p.Matrix4(), Wh = new p.Matrix4();
|
|
15470
|
-
class
|
|
15470
|
+
class Dt {
|
|
15471
15471
|
static resetMergeInfo() {
|
|
15472
15472
|
this.MergeInfo.removedObjects = 0, this.MergeInfo.mergedMeshes = 0, this.MergeInfo.mergedLines = 0, this.MergeInfo.mergedPoints = 0, this.MergeInfo.mergedUnknownTypeObjects = 0, this.MergeInfo.elapsedTime = 0;
|
|
15473
15473
|
}
|
|
@@ -15515,21 +15515,21 @@ class kt {
|
|
|
15515
15515
|
let f = [], m = 0, b = 0, y = 0;
|
|
15516
15516
|
const C = [];
|
|
15517
15517
|
if (d.forEach((x) => {
|
|
15518
|
-
const
|
|
15519
|
-
if (M.applyMatrix4(
|
|
15520
|
-
const O = M.attributes?.position?.count,
|
|
15518
|
+
const S = t.children[x], M = S.geometry?.clone();
|
|
15519
|
+
if (M.applyMatrix4(S.matrix), M.userData.isLineSegments = S.type === H.LineSegment, f.push(M), e) {
|
|
15520
|
+
const O = M.attributes?.position?.count, E = M.index?.count || 0;
|
|
15521
15521
|
C.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: E
|
|
15527
|
+
}), b += O, y += E, m++;
|
|
15528
15528
|
}
|
|
15529
15529
|
}), f.length === 0) return;
|
|
15530
15530
|
let w;
|
|
15531
15531
|
if (u.type === H.Mesh) {
|
|
15532
|
-
const x =
|
|
15532
|
+
const x = Oe(f);
|
|
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) {
|
|
@@ -15537,7 +15537,7 @@ class kt {
|
|
|
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) {
|
|
15540
|
-
const x =
|
|
15540
|
+
const x = Oe(f);
|
|
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
|
}
|
|
@@ -15563,7 +15563,7 @@ class kt {
|
|
|
15563
15563
|
const a = Array.isArray(t), o = a ? t.length : t.children.length;
|
|
15564
15564
|
if (e === i || e >= o || i >= o) return r;
|
|
15565
15565
|
const l = a ? t[e] : t.children[e], h = a ? t[i] : t.children[i];
|
|
15566
|
-
return this.areObjectsMergeable(l, h) && ye.areGeometriesMergeable(l.geometry, h.geometry) &&
|
|
15566
|
+
return this.areObjectsMergeable(l, h) && ye.areGeometriesMergeable(l.geometry, h.geometry) && Te.materialsEquals(l.material, h.material) && (!s[i] && (s[i] = {
|
|
15567
15567
|
indexes: [i]
|
|
15568
15568
|
}, this.removeFromArray(n, i)), s[i].indexes.push(e), r = !0), r;
|
|
15569
15569
|
}
|
|
@@ -15603,12 +15603,12 @@ class kt {
|
|
|
15603
15603
|
if (!t[y].geometry || this.isFilteredByOtherFactors(t[y], e)) continue;
|
|
15604
15604
|
let w = !1;
|
|
15605
15605
|
const x = Object.values(o);
|
|
15606
|
-
for (let
|
|
15607
|
-
const M = x[
|
|
15606
|
+
for (let S = x.length - 1; S >= 0; --S) {
|
|
15607
|
+
const M = x[S].indexes[0];
|
|
15608
15608
|
if (w = this.tryHandleMergeableObjects(t, y, M, o, l), w) break;
|
|
15609
15609
|
}
|
|
15610
|
-
for (let
|
|
15611
|
-
const M = l[
|
|
15610
|
+
for (let S = l.length - 1; !w && S >= 0; --S) {
|
|
15611
|
+
const M = l[S];
|
|
15612
15612
|
if (w = this.tryHandleMergeableObjects(t, y, M, o, l), w) break;
|
|
15613
15613
|
}
|
|
15614
15614
|
!w && l.push(y);
|
|
@@ -15620,8 +15620,8 @@ class kt {
|
|
|
15620
15620
|
const C = y.indexes;
|
|
15621
15621
|
if (C.length < 2) return;
|
|
15622
15622
|
const w = t[C[0]];
|
|
15623
|
-
let x = [],
|
|
15624
|
-
const
|
|
15623
|
+
let x = [], S = 0, M = 0, O = 0;
|
|
15624
|
+
const E = [];
|
|
15625
15625
|
if (C.forEach((T) => {
|
|
15626
15626
|
const _ = t[T], 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) {
|
|
@@ -15629,31 +15629,31 @@ class kt {
|
|
|
15629
15629
|
let k;
|
|
15630
15630
|
(w.type === H.Line || w.type === H.LineSegment) && (!A.boundingSphere && A.computeBoundingSphere(), k = A.boundingSphere?.clone());
|
|
15631
15631
|
const D = {
|
|
15632
|
-
batchId:
|
|
15632
|
+
batchId: S,
|
|
15633
15633
|
positionStart: M,
|
|
15634
15634
|
positionCount: I,
|
|
15635
15635
|
indexStart: O,
|
|
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), E.push(D), M += I, O += B, S++;
|
|
15640
15640
|
}
|
|
15641
15641
|
}), x.length === 0) return;
|
|
15642
15642
|
let v;
|
|
15643
15643
|
if (w.type === H.Mesh) {
|
|
15644
|
-
const T =
|
|
15644
|
+
const T = Oe(x);
|
|
15645
15645
|
if (!T) return;
|
|
15646
15646
|
T.userData = {}, v = new z(w.type), v.geometry = T, v.material = w.material, h.push(v);
|
|
15647
15647
|
} else if (w.type === H.Line || w.type === H.LineSegment) {
|
|
15648
|
-
const T = ye.mergeLineGeometries(x, n, w.material instanceof p.LineDashedMaterial || w.material instanceof p.ShaderMaterial,
|
|
15648
|
+
const T = ye.mergeLineGeometries(x, n, w.material instanceof p.LineDashedMaterial || w.material instanceof p.ShaderMaterial, E);
|
|
15649
15649
|
if (!T) return;
|
|
15650
15650
|
v = new z(H.LineSegment), v.geometry = T, v.material = w.material, d.push(v);
|
|
15651
15651
|
} else if (w.type === H.Point) {
|
|
15652
|
-
const T =
|
|
15652
|
+
const T = Oe(x);
|
|
15653
15653
|
if (!T) return;
|
|
15654
15654
|
T.userData = {}, v = new z(w.type), v.geometry = T, v.material = w.material, u.push(v);
|
|
15655
15655
|
}
|
|
15656
|
-
v && (n ? v.userData.batches =
|
|
15656
|
+
v && (n ? v.userData.batches = E : (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, C.forEach((T) => f.push(T))), x.forEach((T) => {
|
|
15657
15657
|
T.dispose(), N.releaseGeometryManually(T);
|
|
15658
15658
|
}), x = [];
|
|
15659
15659
|
}), P.debug("[Merge] Ran deepMerge() in " + (Date.now() - a) / 1e3 + "s");
|
|
@@ -15708,7 +15708,7 @@ class kt {
|
|
|
15708
15708
|
return t.layers.mask !== e.layers.mask || t.renderOrder !== e.renderOrder || t.userData.layerName !== e.userData.layerName ? !1 : t.type === e.type ? !0 : (t.type === H.Line || t.type === H.LineSegment) && (e.type === H.Line || e.type === H.LineSegment);
|
|
15709
15709
|
}
|
|
15710
15710
|
}
|
|
15711
|
-
g(
|
|
15711
|
+
g(Dt, "MergeInfo", {
|
|
15712
15712
|
removedObjects: 0,
|
|
15713
15713
|
mergedMeshes: 0,
|
|
15714
15714
|
mergedLines: 0,
|
|
@@ -19190,28 +19190,28 @@ class $d {
|
|
|
19190
19190
|
s.orthographicType = e.value, e = t.next();
|
|
19191
19191
|
break;
|
|
19192
19192
|
case 10:
|
|
19193
|
-
s.minLimit =
|
|
19193
|
+
s.minLimit = kt(t), e = t.lastReadGroup;
|
|
19194
19194
|
break;
|
|
19195
19195
|
case 11:
|
|
19196
|
-
s.maxLimit =
|
|
19196
|
+
s.maxLimit = kt(t), e = t.lastReadGroup;
|
|
19197
19197
|
break;
|
|
19198
19198
|
case 12:
|
|
19199
|
-
s.basePoint =
|
|
19199
|
+
s.basePoint = kt(t), e = t.lastReadGroup;
|
|
19200
19200
|
break;
|
|
19201
19201
|
case 13:
|
|
19202
|
-
s.origin =
|
|
19202
|
+
s.origin = kt(t), e = t.lastReadGroup;
|
|
19203
19203
|
break;
|
|
19204
19204
|
case 14:
|
|
19205
|
-
s.minExtent =
|
|
19205
|
+
s.minExtent = kt(t), e = t.lastReadGroup;
|
|
19206
19206
|
break;
|
|
19207
19207
|
case 15:
|
|
19208
|
-
s.maxExtent =
|
|
19208
|
+
s.maxExtent = kt(t), e = t.lastReadGroup;
|
|
19209
19209
|
break;
|
|
19210
19210
|
case 16:
|
|
19211
|
-
s.XAxis =
|
|
19211
|
+
s.XAxis = kt(t), e = t.lastReadGroup;
|
|
19212
19212
|
break;
|
|
19213
19213
|
case 17:
|
|
19214
|
-
s.YAxis =
|
|
19214
|
+
s.YAxis = kt(t), e = t.lastReadGroup;
|
|
19215
19215
|
break;
|
|
19216
19216
|
case 146:
|
|
19217
19217
|
s.elevation = e.value, e = t.next();
|
|
@@ -19226,7 +19226,7 @@ class $d {
|
|
|
19226
19226
|
return s.blockTableHandle = s.ownerHandle, s;
|
|
19227
19227
|
}
|
|
19228
19228
|
}
|
|
19229
|
-
function
|
|
19229
|
+
function kt(c) {
|
|
19230
19230
|
const t = {};
|
|
19231
19231
|
let e = c.lastReadGroup || c.next();
|
|
19232
19232
|
const i = e.code;
|
|
@@ -19484,86 +19484,86 @@ class r1 {
|
|
|
19484
19484
|
else if (n.value === "BLOCKS")
|
|
19485
19485
|
P.trace("> BLOCKS"), e.blocks = o(), P.trace("<");
|
|
19486
19486
|
else if (n.value === "ENTITIES")
|
|
19487
|
-
P.trace("> ENTITIES"), e.entities =
|
|
19487
|
+
P.trace("> ENTITIES"), e.entities = S(!1), P.trace("<");
|
|
19488
19488
|
else if (n.value === "OBJECTS")
|
|
19489
19489
|
P.trace("> OBJECTS"), e.objects = M(), P.trace("<");
|
|
19490
19490
|
else if (n.value === "EOF")
|
|
19491
19491
|
P.trace("EOF");
|
|
19492
19492
|
else {
|
|
19493
|
-
const
|
|
19494
|
-
s.unhandledSections[
|
|
19493
|
+
const E = n.value;
|
|
19494
|
+
s.unhandledSections[E] ? s.unhandledSections[E]++ : s.unhandledSections[E] = 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
|
|
19501
|
+
let E = null, v = null;
|
|
19502
19502
|
const T = {};
|
|
19503
19503
|
for (n = t.next(); ; ) {
|
|
19504
19504
|
if (He(n, 0, "ENDSEC")) {
|
|
19505
|
-
|
|
19505
|
+
E && (T[E] = v);
|
|
19506
19506
|
break;
|
|
19507
19507
|
} else
|
|
19508
|
-
n.code === 9 ? (
|
|
19508
|
+
n.code === 9 ? (E && (T[E] = v), E = 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
19511
|
return n = t.next(), T;
|
|
19512
19512
|
}
|
|
19513
19513
|
function o() {
|
|
19514
|
-
const
|
|
19514
|
+
const E = {};
|
|
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 ? E[v.name] = v : console.error("[DxfParser] Block with handle '" + v.handle + "' is missing a name, ignored!");
|
|
19520
19520
|
} else
|
|
19521
|
-
|
|
19522
|
-
return
|
|
19521
|
+
wt(n), n = t.next();
|
|
19522
|
+
return E;
|
|
19523
19523
|
}
|
|
19524
19524
|
function l() {
|
|
19525
|
-
const
|
|
19525
|
+
const E = {};
|
|
19526
19526
|
for (n = t.next(); n.value !== "EOF"; ) {
|
|
19527
19527
|
switch (n.code) {
|
|
19528
19528
|
case 1:
|
|
19529
|
-
|
|
19529
|
+
E.xrefPath = n.value, n = t.next();
|
|
19530
19530
|
break;
|
|
19531
19531
|
case 2:
|
|
19532
|
-
|
|
19532
|
+
E.name = n.value, n = t.next();
|
|
19533
19533
|
break;
|
|
19534
19534
|
case 3:
|
|
19535
|
-
|
|
19535
|
+
E.name2 = n.value, n = t.next();
|
|
19536
19536
|
break;
|
|
19537
19537
|
case 4:
|
|
19538
|
-
|
|
19538
|
+
E.description = n.value, n = t.next();
|
|
19539
19539
|
break;
|
|
19540
19540
|
case 5:
|
|
19541
|
-
|
|
19541
|
+
E.handle = n.value, n = t.next();
|
|
19542
19542
|
break;
|
|
19543
19543
|
case 8:
|
|
19544
|
-
|
|
19544
|
+
E.layer = n.value, n = t.next();
|
|
19545
19545
|
break;
|
|
19546
19546
|
case 10:
|
|
19547
|
-
|
|
19547
|
+
E.position = Xe(t), n = t.lastReadGroup;
|
|
19548
19548
|
break;
|
|
19549
19549
|
case 67:
|
|
19550
|
-
|
|
19550
|
+
E.paperSpace = !!(n.value && n.value === 1), n = t.next();
|
|
19551
19551
|
break;
|
|
19552
19552
|
case 70:
|
|
19553
|
-
|
|
19553
|
+
E.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
|
+
E.ownerHandle = n.value, n = t.next();
|
|
19560
19560
|
break;
|
|
19561
19561
|
case 0:
|
|
19562
19562
|
if (n.value === "ENDBLK") break;
|
|
19563
|
-
|
|
19563
|
+
E.entities = S(!0);
|
|
19564
19564
|
break;
|
|
19565
19565
|
default:
|
|
19566
|
-
|
|
19566
|
+
wt(n), n = t.next();
|
|
19567
19567
|
break;
|
|
19568
19568
|
}
|
|
19569
19569
|
if (He(n, 0, "ENDBLK")) {
|
|
@@ -19571,17 +19571,17 @@ class r1 {
|
|
|
19571
19571
|
break;
|
|
19572
19572
|
}
|
|
19573
19573
|
}
|
|
19574
|
-
return
|
|
19574
|
+
return E;
|
|
19575
19575
|
}
|
|
19576
19576
|
function h() {
|
|
19577
|
-
const
|
|
19577
|
+
const E = {};
|
|
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 {"), E[x[n.value].tableName] = u(n), P.trace("}")) : P.trace("Unhandled Table " + n.value)) : n = t.next();
|
|
19580
|
+
return n = t.next(), E;
|
|
19581
19581
|
}
|
|
19582
19582
|
const d = "ENDTAB";
|
|
19583
|
-
function u(
|
|
19584
|
-
const v = x[
|
|
19583
|
+
function u(E) {
|
|
19584
|
+
const v = x[E.value], T = {};
|
|
19585
19585
|
let _ = 0;
|
|
19586
19586
|
for (n = t.next(); !He(n, 0, d); )
|
|
19587
19587
|
switch (n.code) {
|
|
@@ -19592,16 +19592,16 @@ class r1 {
|
|
|
19592
19592
|
T.ownerHandle = n.value, n = t.next();
|
|
19593
19593
|
break;
|
|
19594
19594
|
case 100:
|
|
19595
|
-
n.value === "AcDbSymbolTable" ||
|
|
19595
|
+
n.value === "AcDbSymbolTable" || wt(n), n = t.next();
|
|
19596
19596
|
break;
|
|
19597
19597
|
case 70:
|
|
19598
19598
|
_ = n.value, n = t.next();
|
|
19599
19599
|
break;
|
|
19600
19600
|
case 0:
|
|
19601
|
-
n.value === v.dxfSymbolName ? T[v.tableRecordsProperty] = v.parseTableRecords() : (
|
|
19601
|
+
n.value === v.dxfSymbolName ? T[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
19607
|
const A = T[v.tableRecordsProperty];
|
|
@@ -19615,7 +19615,7 @@ class r1 {
|
|
|
19615
19615
|
return n = t.next(), T;
|
|
19616
19616
|
}
|
|
19617
19617
|
function f() {
|
|
19618
|
-
const
|
|
19618
|
+
const E = [];
|
|
19619
19619
|
let v = {};
|
|
19620
19620
|
for (P.trace("Viewport {"), n = t.next(); !He(n, 0, d); )
|
|
19621
19621
|
switch (n.code) {
|
|
@@ -19700,16 +19700,16 @@ 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("}"), E.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("}"), E.push(v), E;
|
|
19710
19710
|
}
|
|
19711
19711
|
function m() {
|
|
19712
|
-
const
|
|
19712
|
+
const E = {};
|
|
19713
19713
|
let v = {}, T = 0, _ = "", A = !1;
|
|
19714
19714
|
for (P.trace("LType {"), n = t.next(); !He(n, 0, "ENDTAB"); )
|
|
19715
19715
|
switch (n.code) {
|
|
@@ -19751,16 +19751,16 @@ class r1 {
|
|
|
19751
19751
|
n = t.next();
|
|
19752
19752
|
break;
|
|
19753
19753
|
case 0:
|
|
19754
|
-
P.trace("}"), T > 0 && T !== v.pattern.length && console.warn("[DxfParser] lengths do not match on LTYPE pattern"),
|
|
19754
|
+
P.trace("}"), T > 0 && T !== v.pattern.length && console.warn("[DxfParser] lengths do not match on LTYPE pattern"), E[_] = 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("}"), E[_] = v, E;
|
|
19761
19761
|
}
|
|
19762
19762
|
function b() {
|
|
19763
|
-
const
|
|
19763
|
+
const E = {};
|
|
19764
19764
|
let v = {}, T;
|
|
19765
19765
|
for (P.trace("Layer {"), n = t.next(); !He(n, 0, "ENDTAB"); )
|
|
19766
19766
|
switch (n.code) {
|
|
@@ -19786,16 +19786,16 @@ class r1 {
|
|
|
19786
19786
|
v.lineweight = n.value, n = t.next();
|
|
19787
19787
|
break;
|
|
19788
19788
|
case 0:
|
|
19789
|
-
n.value === "LAYER" && (P.trace("}"), T && (
|
|
19789
|
+
n.value === "LAYER" && (P.trace("}"), T && (E[T] = v), P.trace("Layer {"), v = {}, T = 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("}"), T && (
|
|
19795
|
+
return P.trace("}"), T && (E[T] = v), E;
|
|
19796
19796
|
}
|
|
19797
19797
|
function y() {
|
|
19798
|
-
const
|
|
19798
|
+
const E = {};
|
|
19799
19799
|
let v = {}, T;
|
|
19800
19800
|
for (P.trace("Style {"), n = t.next(); !He(n, 0, "ENDTAB"); )
|
|
19801
19801
|
switch (n.code) {
|
|
@@ -19833,16 +19833,16 @@ class r1 {
|
|
|
19833
19833
|
v.ownerHandle = n.value, n = t.next();
|
|
19834
19834
|
break;
|
|
19835
19835
|
case 0:
|
|
19836
|
-
n.value === "STYLE" && (P.trace("}"), T && (
|
|
19836
|
+
n.value === "STYLE" && (P.trace("}"), T && (E[T] = v), P.trace("Style {"), v = {}, T = 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("}"), T && (
|
|
19842
|
+
return P.trace("}"), T && (E[T] = v), E;
|
|
19843
19843
|
}
|
|
19844
19844
|
function C() {
|
|
19845
|
-
const
|
|
19845
|
+
const E = {};
|
|
19846
19846
|
let v = {}, T;
|
|
19847
19847
|
for (P.trace("DimStyle {"), n = t.next(); !He(n, 0, "ENDTAB"); )
|
|
19848
19848
|
switch (n.code) {
|
|
@@ -19895,16 +19895,16 @@ class r1 {
|
|
|
19895
19895
|
n = t.next();
|
|
19896
19896
|
break;
|
|
19897
19897
|
case 0:
|
|
19898
|
-
n.value === "DIMSTYLE" && (P.trace("}"), T && (
|
|
19898
|
+
n.value === "DIMSTYLE" && (P.trace("}"), T && (E[T] = v), P.trace("DimStyle {"), v = {}, T = 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("}"), T && (
|
|
19904
|
+
return P.trace("}"), T && (E[T] = v), E;
|
|
19905
19905
|
}
|
|
19906
19906
|
function w() {
|
|
19907
|
-
const
|
|
19907
|
+
const E = {};
|
|
19908
19908
|
let v = {}, T;
|
|
19909
19909
|
for (P.trace("BlockRecord {"), n = t.next(); !He(n, 0, "ENDTAB"); )
|
|
19910
19910
|
switch (n.code) {
|
|
@@ -19934,19 +19934,19 @@ class r1 {
|
|
|
19934
19934
|
break;
|
|
19935
19935
|
case 0:
|
|
19936
19936
|
if (n.value === "BLOCK_RECORD") {
|
|
19937
|
-
P.trace("}"), T && (
|
|
19937
|
+
P.trace("}"), T && (E[T] = v);
|
|
19938
19938
|
const A = v.layoutHandle;
|
|
19939
19939
|
T && A && A.length > 0 && A !== "0" && (s._layoutBlocks[A] = v), P.trace("BlockRecord {"), v = {}, T = void 0, n = t.next();
|
|
19940
19940
|
} else
|
|
19941
|
-
|
|
19941
|
+
wt(n), n = t.next();
|
|
19942
19942
|
break;
|
|
19943
19943
|
default:
|
|
19944
|
-
|
|
19944
|
+
wt(n), n = t.next();
|
|
19945
19945
|
break;
|
|
19946
19946
|
}
|
|
19947
|
-
P.trace("}"), T && (
|
|
19947
|
+
P.trace("}"), T && (E[T] = v);
|
|
19948
19948
|
const _ = v.layoutHandle;
|
|
19949
|
-
return T && _ && _.length > 0 && _ !== "0" && (s._layoutBlocks[_] = v),
|
|
19949
|
+
return T && _ && _.length > 0 && _ !== "0" && (s._layoutBlocks[_] = v), E;
|
|
19950
19950
|
}
|
|
19951
19951
|
const x = {
|
|
19952
19952
|
VPORT: {
|
|
@@ -19986,9 +19986,9 @@ class r1 {
|
|
|
19986
19986
|
parseTableRecords: C
|
|
19987
19987
|
}
|
|
19988
19988
|
};
|
|
19989
|
-
function E
|
|
19990
|
-
const v = [], T =
|
|
19991
|
-
for (
|
|
19989
|
+
function S(E) {
|
|
19990
|
+
const v = [], T = E ? "ENDBLK" : "ENDSEC";
|
|
19991
|
+
for (E || (n = t.next()); ; )
|
|
19992
19992
|
if (n.code === 0) {
|
|
19993
19993
|
if (n.value === T) break;
|
|
19994
19994
|
const _ = s._entityHandlers[n.value];
|
|
@@ -20006,7 +20006,7 @@ class r1 {
|
|
|
20006
20006
|
return T === "ENDSEC" && (n = t.next()), v;
|
|
20007
20007
|
}
|
|
20008
20008
|
function M() {
|
|
20009
|
-
const
|
|
20009
|
+
const E = {}, v = "ENDSEC";
|
|
20010
20010
|
for (n = t.next(); n.value !== "EOF"; )
|
|
20011
20011
|
if (n.code === 0) {
|
|
20012
20012
|
if (n.value === v) break;
|
|
@@ -20014,7 +20014,7 @@ class r1 {
|
|
|
20014
20014
|
if (T != null) {
|
|
20015
20015
|
P.trace(n.value + " {");
|
|
20016
20016
|
const _ = T.parseObject(t, n), A = n.value;
|
|
20017
|
-
n = t.lastReadGroup, P.trace("}"), O(_),
|
|
20017
|
+
n = t.lastReadGroup, P.trace("}"), O(_), E[A] || (E[A] = []), E[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(),
|
|
20025
|
+
return n = t.next(), E.LAYOUT && (Object.keys(s._layoutBlocks).length !== E.LAYOUT.length && console.warn("[DxfParser] The number of layout and block associations does not match!"), E.LAYOUT.forEach((T) => {
|
|
20026
20026
|
s._layoutBlocks[T.handle] && (T.associatedBlockName = s._layoutBlocks[T.handle].blockName);
|
|
20027
|
-
}),
|
|
20027
|
+
}), E.LAYOUT.sort((T, _) => T.tabOrder - _.tabOrder)), E;
|
|
20028
20028
|
}
|
|
20029
|
-
function O(
|
|
20030
|
-
if (!
|
|
20031
|
-
|
|
20029
|
+
function O(E) {
|
|
20030
|
+
if (!E) throw new TypeError("entity cannot be undefined or null");
|
|
20031
|
+
E.handle || (E.handle = (i++).toString());
|
|
20032
20032
|
}
|
|
20033
20033
|
return r(), e;
|
|
20034
20034
|
}
|
|
@@ -20050,7 +20050,7 @@ class r1 {
|
|
|
20050
20050
|
function He(c, t, e) {
|
|
20051
20051
|
return c.code === t && c.value === e;
|
|
20052
20052
|
}
|
|
20053
|
-
function
|
|
20053
|
+
function wt(c) {
|
|
20054
20054
|
P.trace("unhandled group " + Io(c));
|
|
20055
20055
|
}
|
|
20056
20056
|
function Io(c) {
|
|
@@ -20666,25 +20666,25 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
20666
20666
|
const a = U.getUpdateProgressFuncForLoop(r, i);
|
|
20667
20667
|
let o = {};
|
|
20668
20668
|
const l = (x) => {
|
|
20669
|
-
const
|
|
20670
|
-
let M = o[
|
|
20671
|
-
!M && (M = [], o[
|
|
20669
|
+
const S = x.userData.layerName;
|
|
20670
|
+
let M = o[S];
|
|
20671
|
+
!M && (M = [], o[S] = M), M.push(x);
|
|
20672
20672
|
}, h = {}, d = {}, u = new z();
|
|
20673
20673
|
for (let x = 0; x < r && !this.aborted; x++) {
|
|
20674
|
-
const
|
|
20675
|
-
this.addViewport(
|
|
20676
|
-
const M = this.loadEntity(
|
|
20674
|
+
const S = e.entities[x];
|
|
20675
|
+
this.addViewport(S, h);
|
|
20676
|
+
const M = this.loadEntity(S, e);
|
|
20677
20677
|
if (!M && await a(x), !M) continue;
|
|
20678
|
-
const O = this.getLayout(e,
|
|
20679
|
-
let v = u.children.find((T) => T.name ===
|
|
20680
|
-
if (!v && (v = new z(), v.name =
|
|
20681
|
-
T.userData.isSnapObject && (!this.layoutsSnapObjectsMap[
|
|
20678
|
+
const O = this.getLayout(e, S), E = O.layoutName;
|
|
20679
|
+
let v = u.children.find((T) => T.name === E);
|
|
20680
|
+
if (!v && (v = new z(), v.name = E, v.userData.isLayoutLevelObject = !0, u.add(v)), M.traverse((T) => {
|
|
20681
|
+
T.userData.isSnapObject && (!this.layoutsSnapObjectsMap[E] && (this.layoutsSnapObjectsMap[E] = []), this.layoutsSnapObjectsMap[E].push(T));
|
|
20682
20682
|
}), this.enableMerge) {
|
|
20683
|
-
|
|
20683
|
+
Dt.merge(M, !1), !d[E] && (d[E] = {
|
|
20684
20684
|
object: v,
|
|
20685
20685
|
layerObjects: {}
|
|
20686
20686
|
});
|
|
20687
|
-
const _ = d[
|
|
20687
|
+
const _ = d[E];
|
|
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) => {
|
|
@@ -20700,17 +20700,17 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
20700
20700
|
n++, await a(x);
|
|
20701
20701
|
}
|
|
20702
20702
|
e.objects.LAYOUT.forEach((x) => {
|
|
20703
|
-
const
|
|
20703
|
+
const S = x, M = S.layoutName;
|
|
20704
20704
|
if (this.ignorePaperSpace && M !== j.MODEL_LAYOUT_NAME) return;
|
|
20705
|
-
const O =
|
|
20706
|
-
|
|
20705
|
+
const O = S.associatedBlockName, E = e.blocks[O];
|
|
20706
|
+
E && this.loadLayout(E, e, S, 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
|
|
20710
|
-
M.name = j.SNAP_GROUP_NAME, M.userData.isSnapGroup = !0,
|
|
20709
|
+
const S = u.children.find((E) => E.name === x), M = new z();
|
|
20710
|
+
M.name = j.SNAP_GROUP_NAME, M.userData.isSnapGroup = !0, S.add(M);
|
|
20711
20711
|
const O = this.layoutsSnapObjectsMap[x];
|
|
20712
|
-
for (let
|
|
20713
|
-
const v = O[
|
|
20712
|
+
for (let E = 0; E < O.length; E++) {
|
|
20713
|
+
const v = O[E], T = v.userData.layerName;
|
|
20714
20714
|
this.getLayerVisible(e, T) === !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();
|
|
@@ -20721,15 +20721,15 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
20721
20721
|
}
|
|
20722
20722
|
if (this.enableMerge)
|
|
20723
20723
|
for (const x in d) {
|
|
20724
|
-
const
|
|
20725
|
-
for (const O in
|
|
20726
|
-
const
|
|
20727
|
-
if (_.length !==
|
|
20724
|
+
const S = d[x], M = S.object;
|
|
20725
|
+
for (const O in S.layerObjects) {
|
|
20726
|
+
const E = S.layerObjects[O], v = Dt.deepMerge(E, void 0, !1, !1, !0), T = v.added, _ = v.removed;
|
|
20727
|
+
if (_.length !== E.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 = E.length; B < k; B++) {
|
|
20732
|
+
const D = E[B];
|
|
20733
20733
|
!I(D) && (M.add(D), l(D));
|
|
20734
20734
|
}
|
|
20735
20735
|
}
|
|
@@ -20737,7 +20737,7 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
20737
20737
|
const I = T[A];
|
|
20738
20738
|
M.add(I), l(I);
|
|
20739
20739
|
}
|
|
20740
|
-
|
|
20740
|
+
S.layerObjects[O] = [];
|
|
20741
20741
|
}
|
|
20742
20742
|
}
|
|
20743
20743
|
this.printStatsInfo(), this.enableReleaseData && (this.releaseCachedData(), this.releaseDxfData(e)), this.enableMerge && j.mergeDxfObjects({
|
|
@@ -20749,26 +20749,26 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
20749
20749
|
u.clear(), o = {};
|
|
20750
20750
|
const b = {};
|
|
20751
20751
|
e.objects.LAYOUT.forEach((x) => {
|
|
20752
|
-
const
|
|
20753
|
-
b[
|
|
20752
|
+
const S = x;
|
|
20753
|
+
b[S.layoutName] = S;
|
|
20754
20754
|
});
|
|
20755
20755
|
const y = {}, C = (x) => {
|
|
20756
|
-
const
|
|
20757
|
-
let M = y[
|
|
20758
|
-
!M && (M = [], y[
|
|
20756
|
+
const S = x.userData.layerName;
|
|
20757
|
+
let M = y[S];
|
|
20758
|
+
!M && (M = [], y[S] = M), M.push(x);
|
|
20759
20759
|
};
|
|
20760
20760
|
m.children.forEach((x) => {
|
|
20761
20761
|
if (Q.setSharedVariablesOfObject(x), !x.userData.isLayoutLevelObject) return;
|
|
20762
|
-
const
|
|
20762
|
+
const S = x.name;
|
|
20763
20763
|
let M;
|
|
20764
|
-
if (
|
|
20765
|
-
const O = b[
|
|
20764
|
+
if (S !== j.MODEL_LAYOUT_NAME) {
|
|
20765
|
+
const O = b[S];
|
|
20766
20766
|
!O.directAssociatedLeafObjectSet && (O.directAssociatedLeafObjectSet = /* @__PURE__ */ new Set()), M = O.directAssociatedLeafObjectSet;
|
|
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 E = O.userData.layerName;
|
|
20771
|
+
this.getLayerVisible(e, E) === !1 && (O.visible = !1, O.userData.layerVisible = !1), C(O), M && M.add(O);
|
|
20772
20772
|
}
|
|
20773
20773
|
});
|
|
20774
20774
|
}), P.info("[Dxf] loadEntities() done in " + (Date.now() - s) / 1e3 + "s");
|
|
@@ -20779,27 +20779,27 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
20779
20779
|
layoutViewportsMap: h
|
|
20780
20780
|
});
|
|
20781
20781
|
if (j.LOADLLDATA) {
|
|
20782
|
-
const x = m.children[0].children,
|
|
20782
|
+
const x = m.children[0].children, S = [];
|
|
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
|
-
|
|
20790
|
-
} else if (O.children && O.children.some((
|
|
20791
|
-
for (let
|
|
20792
|
-
const v = O.children[
|
|
20786
|
+
const E = new p.Box3().setFromObject(O);
|
|
20787
|
+
E.getSize(new p.Vector3());
|
|
20788
|
+
const v = E.getCenter(new p.Vector3());
|
|
20789
|
+
S.push({ ...O, boundingBox: { max: E.max, min: E.min, center: v } });
|
|
20790
|
+
} else if (O.children && O.children.some((E) => E.userData?.llbData))
|
|
20791
|
+
for (let E = 0; E < O.children.length; E++) {
|
|
20792
|
+
const v = O.children[E];
|
|
20793
20793
|
if (v.userData?.llbData) {
|
|
20794
20794
|
v.updateWorldMatrix(!0, !0);
|
|
20795
20795
|
const T = new p.Box3().setFromObject(v);
|
|
20796
20796
|
T.getSize(new p.Vector3());
|
|
20797
20797
|
const _ = T.getCenter(new p.Vector3());
|
|
20798
|
-
|
|
20798
|
+
S.push({ ...v, boundingBox: { max: T.max, min: T.min, center: _ } });
|
|
20799
20799
|
}
|
|
20800
20800
|
}
|
|
20801
20801
|
}
|
|
20802
|
-
w.llbMesh =
|
|
20802
|
+
w.llbMesh = S;
|
|
20803
20803
|
}
|
|
20804
20804
|
return Promise.resolve(w);
|
|
20805
20805
|
}
|
|
@@ -20906,14 +20906,14 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
20906
20906
|
layersAndObjects: x
|
|
20907
20907
|
/* 类型桥接:形参类型滞后,实际为 DxfObject[] */
|
|
20908
20908
|
});
|
|
20909
|
-
const
|
|
20909
|
+
const S = m.convertToThreejsObject();
|
|
20910
20910
|
m.clear(), x = {};
|
|
20911
20911
|
const M = {}, O = (v) => {
|
|
20912
20912
|
const T = v.userData.layerName;
|
|
20913
20913
|
let _ = M[T];
|
|
20914
20914
|
!_ && (_ = [], M[T] = _), _.push(v);
|
|
20915
20915
|
};
|
|
20916
|
-
|
|
20916
|
+
S.children.forEach((v) => {
|
|
20917
20917
|
Q.setSharedVariablesOfObject(v), v.userData.isLayoutLevelObject && v.traverse((T) => {
|
|
20918
20918
|
if (Q.setSharedVariablesOfObject(T), T.userData.isSnapGroup && (T.visible = j.SHOW_SNAP_OBJECT), T.geometry) {
|
|
20919
20919
|
const _ = T.userData.layerName;
|
|
@@ -20921,8 +20921,8 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
20921
20921
|
}
|
|
20922
20922
|
});
|
|
20923
20923
|
});
|
|
20924
|
-
const
|
|
20925
|
-
|
|
20924
|
+
const E = f;
|
|
20925
|
+
E.threejsObject = S, E.layersAndThreejsObjects = M, E.layoutViewportsMap = {};
|
|
20926
20926
|
};
|
|
20927
20927
|
let h = Date.now();
|
|
20928
20928
|
this.compareContext = {
|
|
@@ -20935,8 +20935,8 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
20935
20935
|
}
|
|
20936
20936
|
setObjectColorByChange(e, i) {
|
|
20937
20937
|
const s = (a) => {
|
|
20938
|
-
let o =
|
|
20939
|
-
return a.type === We.Added ? o =
|
|
20938
|
+
let o = yt.ENTITY_COLOR_NO_CHANGE;
|
|
20939
|
+
return a.type === We.Added ? o = yt.ENTITY_COLOR_ADDED : a.type === We.Removed ? o = yt.ENTITY_COLOR_REMOVED : a.type === We.Modified && (o = this.compareContext?.isTheFirstFile ? yt.ENTITY_COLOR_REMOVED : yt.ENTITY_COLOR_ADDED), o;
|
|
20940
20940
|
}, n = (a, o) => {
|
|
20941
20941
|
a.traverse((l) => {
|
|
20942
20942
|
if (l.material) {
|
|
@@ -21038,11 +21038,36 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
21038
21038
|
}
|
|
21039
21039
|
if (o) {
|
|
21040
21040
|
const f = this.getLayerName(e, i, s);
|
|
21041
|
-
o.userData.handle = e.handle, e.type !== "INSERT" && e.type !== "DIMENSION" && o.traverse((m) => {
|
|
21041
|
+
if (o.userData.handle = e.handle, e.type !== "INSERT" && e.type !== "DIMENSION" && o.traverse((m) => {
|
|
21042
21042
|
m.geometry && (m.userData.layerName = f, m.userData.handle = e.handle, m.userData.dxfType = e.type, this.setMaterial(m, e, i, s));
|
|
21043
21043
|
}), !l && (this.nonSnapableTypes.has(e.type) && o.traverse((m) => {
|
|
21044
21044
|
m.layers.disable(qe);
|
|
21045
|
-
}), this.enableRenderOrder && (this.entityHandlesWithRenderOrder[e.handle] ? o.renderOrder = parseInt(this.entityHandlesWithRenderOrder[e.handle], 16) + 0.1 : o.renderOrder = parseInt(e.handle, 16)))
|
|
21045
|
+
}), this.enableRenderOrder && (this.entityHandlesWithRenderOrder[e.handle] ? o.renderOrder = parseInt(this.entityHandlesWithRenderOrder[e.handle], 16) + 0.1 : o.renderOrder = parseInt(e.handle, 16))), e.type === "INSERT" && !s && !this.enableRenderOrder) {
|
|
21046
|
+
const m = e.block ? i.blocks[e.block]?.entities : void 0;
|
|
21047
|
+
let b = !0;
|
|
21048
|
+
if (m?.length)
|
|
21049
|
+
for (const w of m) {
|
|
21050
|
+
const x = w;
|
|
21051
|
+
if (x.type === "ATTDEF" || x.type === "SEQEND") continue;
|
|
21052
|
+
if (!(x.type === "LINE" || x.type === "SPLINE" || (x.type === "LWPOLYLINE" || x.type === "POLYLINE") && !x.shape)) {
|
|
21053
|
+
b = !1;
|
|
21054
|
+
break;
|
|
21055
|
+
}
|
|
21056
|
+
}
|
|
21057
|
+
else b = !1;
|
|
21058
|
+
const y = Math.min(parseInt(e.handle, 16) || 0, 3999), C = b ? Me.InsertLine + y * 1e-5 : Me.InsertSymbol + y * 1e-4;
|
|
21059
|
+
o.traverse((w) => {
|
|
21060
|
+
if (w.geometry && w.renderOrder < Me.Text && (w.renderOrder = C, b)) {
|
|
21061
|
+
const x = w.geometry.getAttribute("position");
|
|
21062
|
+
if (x) {
|
|
21063
|
+
let S = !1;
|
|
21064
|
+
for (let M = 0; M < x.count; M++)
|
|
21065
|
+
x.getZ(M) !== 0 && (x.setZ(M, 0), S = !0);
|
|
21066
|
+
S && (x.needsUpdate = !0, w.geometry.computeBoundingBox(), w.geometry.computeBoundingSphere());
|
|
21067
|
+
}
|
|
21068
|
+
}
|
|
21069
|
+
});
|
|
21070
|
+
}
|
|
21046
21071
|
}
|
|
21047
21072
|
const h = e.type, d = e.handle, u = sn.includes(h);
|
|
21048
21073
|
if (!u) {
|
|
@@ -21069,14 +21094,14 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
21069
21094
|
const f = s;
|
|
21070
21095
|
f?.xScale && f?.yScale && (u = Math.max(Math.abs(f.xScale), Math.abs(f.yScale)));
|
|
21071
21096
|
const m = this.getDivision(n, r, Math.max(o, l) * u), b = d.getPoints(m), y = [], C = b.length;
|
|
21072
|
-
for (let
|
|
21073
|
-
F.areVector2sEqual(b[
|
|
21097
|
+
for (let E = 0; E < C - 1; E++)
|
|
21098
|
+
F.areVector2sEqual(b[E], b[E + 1], 1e-9) || y.push(b[E]);
|
|
21074
21099
|
if (y.push(b[C - 1]), y.length < 2) return P.warn("[Dxf] Ellipse entity (handle '%s') contains less than 2 points, ignored!", e.handle), void 0;
|
|
21075
21100
|
const w = new p.Vector3();
|
|
21076
21101
|
let x = !1;
|
|
21077
21102
|
this.enableRTC && (x = N.checkAndRebasePositionsOnRTC(y, w));
|
|
21078
|
-
const
|
|
21079
|
-
M.geometry =
|
|
21103
|
+
const S = new p.BufferGeometry().setFromPoints(y), M = new z(H.Line);
|
|
21104
|
+
M.geometry = S, M.material = pe;
|
|
21080
21105
|
const O = new z(H.Point);
|
|
21081
21106
|
return O.geometry = Ba, O.material = js, O.matrix.setPosition(e.center.x, e.center.y, e.center.z), O.userData.isSnapObject = !0, O.userData.type = "CircleCenter", O.layers.set(qe), M.add(O), x && (this.setRTCUserData(M), M.matrix.setPosition(w.x, w.y, 0)), M.layers.enableAll(), M;
|
|
21082
21107
|
}
|
|
@@ -21298,7 +21323,7 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
21298
21323
|
N.shouldRebasePositionOnRTC(K) && this.setRTCUserData(o), o.matrix.compose(K, me, tt);
|
|
21299
21324
|
const x = e.position ? K.clone().sub(e.position) : K;
|
|
21300
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 = {});
|
|
21301
|
-
const
|
|
21326
|
+
const S = o.matrix.elements, M = S && S[12] || 0, O = S && S[13] || 0, E = S && S[14] || 0, v = new p.Box3();
|
|
21302
21327
|
z.getBox(o, v);
|
|
21303
21328
|
const T = new p.Vector3();
|
|
21304
21329
|
v.getCenter(T);
|
|
@@ -21307,7 +21332,7 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
21307
21332
|
position: {
|
|
21308
21333
|
x: M,
|
|
21309
21334
|
y: O,
|
|
21310
|
-
z:
|
|
21335
|
+
z: E
|
|
21311
21336
|
},
|
|
21312
21337
|
bbox: {
|
|
21313
21338
|
min: {
|
|
@@ -21406,8 +21431,8 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
21406
21431
|
});
|
|
21407
21432
|
let y = 0;
|
|
21408
21433
|
if (e.rotation && (y = e.rotation * Math.PI / 180), e.directionVector) {
|
|
21409
|
-
const w = e.directionVector, x = new p.Vector3(w.x, w.y, w.z),
|
|
21410
|
-
y =
|
|
21434
|
+
const w = e.directionVector, x = new p.Vector3(w.x, w.y, w.z), S = x.clone().cross(Ge), M = Ge.angleTo(x);
|
|
21435
|
+
y = S.z > 0 ? -M : M;
|
|
21411
21436
|
}
|
|
21412
21437
|
N.shouldRebasePositionOnRTC(K) && this.setRTCUserData(o), o.matrix.compose(K, me, tt);
|
|
21413
21438
|
const C = e.position ? K.clone().sub(e.position) : K;
|
|
@@ -21426,11 +21451,11 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
21426
21451
|
let d = "Left";
|
|
21427
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"));
|
|
21428
21453
|
const u = i.width || 0, f = new z();
|
|
21429
|
-
let m, b = s.fontFile, y = 1, C = 1, w = 256, x = h * 0.8,
|
|
21454
|
+
let m, b = s.fontFile, y = 1, C = 1, w = 256, x = h * 0.8, S = x + h;
|
|
21430
21455
|
for (let M = 0; M < e.length; M++) {
|
|
21431
21456
|
const O = e[M];
|
|
21432
21457
|
if (typeof O == "string") {
|
|
21433
|
-
const
|
|
21458
|
+
const E = [], v = (A) => {
|
|
21434
21459
|
let I;
|
|
21435
21460
|
if (A.forEach((B, k) => {
|
|
21436
21461
|
!B.boundingBox && B.computeBoundingBox(), k === 0 ? I = B.boundingBox : I.union(B.boundingBox);
|
|
@@ -21447,21 +21472,21 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
21447
21472
|
break;
|
|
21448
21473
|
}
|
|
21449
21474
|
}
|
|
21450
|
-
|
|
21475
|
+
E.push(...A);
|
|
21451
21476
|
};
|
|
21452
21477
|
let T;
|
|
21453
21478
|
for (let A = 0; A < O.length; A++) {
|
|
21454
21479
|
const I = O[A];
|
|
21455
21480
|
if (I === `
|
|
21456
21481
|
`) {
|
|
21457
|
-
a = 0, o -=
|
|
21482
|
+
a = 0, o -= S, l.length > 0 && v(l), l = [];
|
|
21458
21483
|
continue;
|
|
21459
21484
|
}
|
|
21460
|
-
if (x = h * 0.8,
|
|
21485
|
+
if (x = h * 0.8, S = x + h, T = this.font?.getCharShape(I, b, h), s.bigFontFile && !T && (T = this.font?.getCharShape(I, s.bigFontFile, h)), !T && (T = this.font?.getCharShape(I, "", h)), !T && (T = this.font?.getNotFoundTextShape(h)), !T) {
|
|
21461
21486
|
a += h + C * (h / 3.5);
|
|
21462
21487
|
continue;
|
|
21463
21488
|
}
|
|
21464
|
-
a > (u || 1 / 0) && (l.length > 0 && v(l), a = 0, o -=
|
|
21489
|
+
a > (u || 1 / 0) && (l.length > 0 && v(l), a = 0, o -= S, l = []), T.translate(a, o, 0), T.scale(y, 1, 1), T.boundingBox || T.computeBoundingBox(), O.T && (C = O.T);
|
|
21465
21490
|
const B = Nh(
|
|
21466
21491
|
I,
|
|
21467
21492
|
T,
|
|
@@ -21475,26 +21500,26 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
21475
21500
|
}
|
|
21476
21501
|
l.length > 0 && (v(l), l = []);
|
|
21477
21502
|
const _ = new z();
|
|
21478
|
-
if (
|
|
21503
|
+
if (E.length > 0) {
|
|
21479
21504
|
!m && (m = i.colorIndex), w !== void 0 && w !== 256 ? (i.color = zi(w), i.colorIndex = w) : i.colorIndex = m;
|
|
21480
|
-
const A = this.getColor(i, n, r), I =
|
|
21505
|
+
const A = this.getColor(i, n, r), I = E.filter((k) => k instanceof p.ExtrudeGeometry), B = E.filter((k) => !(k instanceof p.ExtrudeGeometry));
|
|
21481
21506
|
if (I.length > 0) {
|
|
21482
21507
|
const k = new z(H.Mesh);
|
|
21483
|
-
k.geometry =
|
|
21508
|
+
k.geometry = Oe(I), k.material = this.getMeshBasicMaterial(A), _.add(k);
|
|
21484
21509
|
}
|
|
21485
21510
|
if (B.length > 0) {
|
|
21486
21511
|
const k = new z(H.LineSegment);
|
|
21487
|
-
k.geometry =
|
|
21512
|
+
k.geometry = Oe(B), k.material = this.getLineBasicMaterial(A), _.add(k);
|
|
21488
21513
|
}
|
|
21489
21514
|
}
|
|
21490
21515
|
_.matrix.makeTranslation(0, -h, 0), f.add(_), y = 1, C = 1, w = 256;
|
|
21491
21516
|
} else if (Array.isArray(O)) {
|
|
21492
|
-
const
|
|
21493
|
-
|
|
21517
|
+
const E = this.getMTextGroup(O, i, s, n, r, a, o, l);
|
|
21518
|
+
E && (f.add(E.object), a = E.hOffset, o = E.vOffset);
|
|
21494
21519
|
} 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 && (C = O.T));
|
|
21495
21520
|
}
|
|
21496
21521
|
if (f.children.length !== 0)
|
|
21497
|
-
return
|
|
21522
|
+
return Dt.merge(f, !1), m && (i.colorIndex = m), f.children.length === 1 ? {
|
|
21498
21523
|
object: f.children[0],
|
|
21499
21524
|
hOffset: a,
|
|
21500
21525
|
vOffset: o
|
|
@@ -21707,19 +21732,19 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
21707
21732
|
let C = pe;
|
|
21708
21733
|
if (b && h(b)) {
|
|
21709
21734
|
let w = function(O) {
|
|
21710
|
-
const
|
|
21735
|
+
const E = O.attributes.position, v = E.count, T = new Float32Array(v);
|
|
21711
21736
|
for (let _ = 0; _ < v; _ += 2) {
|
|
21712
|
-
const A = _ * 3, I = (_ + 1) * 3, B =
|
|
21737
|
+
const A = _ * 3, I = (_ + 1) * 3, B = E.array[I] - E.array[A], k = E.array[I + 1] - E.array[A + 1], D = E.array[I + 2] - E.array[A + 2], R = Math.sqrt(B * B + k * k + D * D);
|
|
21713
21738
|
T[_] = _ === 0 ? 0 : T[_ - 1], T[_ + 1] = T[_] + R;
|
|
21714
21739
|
}
|
|
21715
21740
|
O.setAttribute("lineDistance", new p.Float32BufferAttribute(T, 1));
|
|
21716
21741
|
};
|
|
21717
|
-
const x = b.pattern?.[0] || 0.5,
|
|
21742
|
+
const x = b.pattern?.[0] || 0.5, S = b.pattern?.[1] || 0.5, M = 0.1;
|
|
21718
21743
|
C = new p.LineDashedMaterial({
|
|
21719
21744
|
color: pe.color,
|
|
21720
21745
|
linewidth: pe.linewidth || 1,
|
|
21721
21746
|
dashSize: x * M,
|
|
21722
|
-
gapSize:
|
|
21747
|
+
gapSize: S * M,
|
|
21723
21748
|
scale: M
|
|
21724
21749
|
}), w(y);
|
|
21725
21750
|
} else
|
|
@@ -21764,12 +21789,12 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
21764
21789
|
if (o?.outlines) {
|
|
21765
21790
|
const b = o.outlines, y = [];
|
|
21766
21791
|
b.forEach((x) => {
|
|
21767
|
-
const
|
|
21792
|
+
const S = new p.Shape();
|
|
21768
21793
|
x.forEach((M, O) => {
|
|
21769
|
-
O === 0 ?
|
|
21770
|
-
}),
|
|
21794
|
+
O === 0 ? S.moveTo(M[0], M[1]) : S.lineTo(M[0], M[1]);
|
|
21795
|
+
}), S.closePath(), y.push(new p.ShapeGeometry(S));
|
|
21771
21796
|
});
|
|
21772
|
-
const C =
|
|
21797
|
+
const C = Oe(y), w = new z(H.Mesh);
|
|
21773
21798
|
w.geometry = C, w.material = wi, w.layers.enableAll(), w.layers.disable(qe), a.add(w);
|
|
21774
21799
|
}
|
|
21775
21800
|
let l = !1;
|
|
@@ -21790,9 +21815,9 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
21790
21815
|
if (this.statsInfo.unsupportedPolylineCount++, b ? y = this.createTaperedPolylineGeometry(n) : y = N.convertWidthLineToMeshGeometry(d, u), !y)
|
|
21791
21816
|
P.warn("[Dxf] Failed to convert line with width to mesh geometry: %s", e.handle);
|
|
21792
21817
|
else {
|
|
21793
|
-
const
|
|
21794
|
-
|
|
21795
|
-
const M = Q.createOutline(y, pe,
|
|
21818
|
+
const S = new z(H.Mesh);
|
|
21819
|
+
S.geometry = y, S.material = wi, S.layers.enableAll(), S.layers.disable(qe), a.add(S);
|
|
21820
|
+
const M = Q.createOutline(y, pe, S.matrix), O = new z(H.LineSegment);
|
|
21796
21821
|
O.geometry = M.geometry, O.material = M.material, O.matrix = M.matrix, O.layers.enableAll(), O.layers.disable(qe), a.add(O);
|
|
21797
21822
|
}
|
|
21798
21823
|
}
|
|
@@ -21812,9 +21837,9 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
21812
21837
|
for (let l = 0; l < e.length - 1; l++) {
|
|
21813
21838
|
const h = e[l], d = e[l + 1], u = d.x - h.x, f = d.y - h.y, m = Math.hypot(u, f);
|
|
21814
21839
|
if (m === 0) continue;
|
|
21815
|
-
const b = -f / m, y = u / m, C = l === 0 ? h.startWidth : h.endWidth, w = d.startWidth, x = C / 2,
|
|
21840
|
+
const b = -f / m, y = u / m, C = l === 0 ? h.startWidth : h.endWidth, w = d.startWidth, x = C / 2, S = w / 2;
|
|
21816
21841
|
h.x + b * x, h.y + y * x, h.x - b * x, h.y - y * x;
|
|
21817
|
-
const M = { x: d.x + b *
|
|
21842
|
+
const M = { x: d.x + b * S, y: d.y + y * S }, O = { x: d.x - b * S, y: d.y - y * S };
|
|
21818
21843
|
n.push(M), r.push(O);
|
|
21819
21844
|
}
|
|
21820
21845
|
const a = n.length;
|
|
@@ -21866,32 +21891,32 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
21866
21891
|
default:
|
|
21867
21892
|
return;
|
|
21868
21893
|
}
|
|
21869
|
-
d.traverse((
|
|
21870
|
-
|
|
21894
|
+
d.traverse((S) => {
|
|
21895
|
+
S.geometry && S.geometry.translate(y, C, 0);
|
|
21871
21896
|
});
|
|
21872
21897
|
let w = 0;
|
|
21873
21898
|
if (e.contextData?.textRotation && (w = e.contextData.textRotation * Math.PI / 180), e.contextData?.textDirection) {
|
|
21874
|
-
const
|
|
21875
|
-
w += O.z > 0 ? -
|
|
21899
|
+
const S = e.contextData.textDirection, M = new p.Vector3(S.x, S.y, S.z), O = M.clone().cross(Ge), E = Ge.angleTo(M);
|
|
21900
|
+
w += O.z > 0 ? -E : E;
|
|
21876
21901
|
}
|
|
21877
21902
|
N.shouldRebasePositionOnRTC(K) && this.setRTCUserData(d), d.matrix.compose(K, me, tt), e.contextData?.textLocation ? V.set(e.contextData.textLocation.x, e.contextData.textLocation.y, 0) : V.set(0, 0, 0);
|
|
21878
21903
|
const x = K.clone().sub(V);
|
|
21879
|
-
et.makeTranslation(-x.x, -x.y, 0), de.makeRotationZ(w), d.matrix.multiply(et), d.matrix.multiply(de), d.matrix.multiply(et.invert()), d.renderOrder =
|
|
21904
|
+
et.makeTranslation(-x.x, -x.y, 0), de.makeRotationZ(w), d.matrix.multiply(et), d.matrix.multiply(de), d.matrix.multiply(et.invert()), d.renderOrder = Me.Text, a.add(d);
|
|
21880
21905
|
}
|
|
21881
21906
|
if (e.leaderLineType !== 0) {
|
|
21882
21907
|
const u = [], f = e.contextData?.leaders[0];
|
|
21883
21908
|
if (!f) return a;
|
|
21884
21909
|
const m = f.lastLeaderLinePoint;
|
|
21885
21910
|
if (e.enableDogLeg) {
|
|
21886
|
-
const
|
|
21887
|
-
u.push(v,
|
|
21911
|
+
const S = 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), E = O.multiplyScalar(M), v = S.clone().add(E);
|
|
21912
|
+
u.push(v, S);
|
|
21888
21913
|
}
|
|
21889
21914
|
const b = e.contextData?.leaders[0].leaderLines || [];
|
|
21890
|
-
for (let
|
|
21891
|
-
const M = b[
|
|
21892
|
-
let
|
|
21915
|
+
for (let S = 0; S < b.length; S++) {
|
|
21916
|
+
const M = b[S].vertices[0], O = M.reverse().map((B) => new p.Vector3(B.x, B.y, B.z));
|
|
21917
|
+
let E = new p.Vector3(m.x, m.y, m.z);
|
|
21893
21918
|
for (let B = 0; B < O.length; B++)
|
|
21894
|
-
u.push(
|
|
21919
|
+
u.push(E, O[B]), E = O[B];
|
|
21895
21920
|
const v = V.subVectors(u[0], u[1]).length(), T = e.arrowHeadSize || n.DIMASZ || 2.5, _ = e.arrowHeadScale || n.DIMSCALE || 1, A = T * _;
|
|
21896
21921
|
e.leaderLineType;
|
|
21897
21922
|
let I = "";
|
|
@@ -21911,11 +21936,11 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
21911
21936
|
let C = !1;
|
|
21912
21937
|
this.enableRTC && (C = N.checkAndRebasePositionsOnRTC(u, y));
|
|
21913
21938
|
const w = new p.BufferGeometry().setFromPoints(u), x = new z(H.LineSegment);
|
|
21914
|
-
x.geometry = w, x.material = pe, x.renderOrder =
|
|
21939
|
+
x.geometry = w, x.material = pe, x.renderOrder = Me.Line, C && (this.setRTCUserData(x), x.matrix.setPosition(y.x, y.y, 0)), a.add(x);
|
|
21915
21940
|
} else return d?.traverse((u) => {
|
|
21916
21941
|
u.layers.enableAll();
|
|
21917
21942
|
}), d;
|
|
21918
|
-
return
|
|
21943
|
+
return Dt.merge(a, !1), a.traverse((u) => {
|
|
21919
21944
|
u.layers.enableAll();
|
|
21920
21945
|
}), a.children.length === 1 ? a.children[0] : a;
|
|
21921
21946
|
}
|
|
@@ -21947,10 +21972,10 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
21947
21972
|
if (w && w.entities) {
|
|
21948
21973
|
r && (e.colorIndex = r.DIMCLRD || 256, e.color = zi(e.colorIndex));
|
|
21949
21974
|
for (let x = 0; x < w.entities.length; x++) {
|
|
21950
|
-
const
|
|
21951
|
-
if (
|
|
21952
|
-
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),
|
|
21953
|
-
V.copy(M), K.setScalar(d), me.setFromAxisAngle(bi,
|
|
21975
|
+
const S = this.loadEntity(w.entities[x], i, e);
|
|
21976
|
+
if (S) {
|
|
21977
|
+
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), E = Math.atan2(M.y - O.y, M.x - O.x);
|
|
21978
|
+
V.copy(M), K.setScalar(d), me.setFromAxisAngle(bi, E), S.matrix.compose(V, me, K), u.add(S);
|
|
21954
21979
|
}
|
|
21955
21980
|
}
|
|
21956
21981
|
} else this.loadDefaultLeadArrow(n[1], n[0], d / o / 2, n);
|
|
@@ -21960,7 +21985,7 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
21960
21985
|
let m = !1;
|
|
21961
21986
|
this.enableRTC && (m = N.checkAndRebasePositionsOnRTC(n, f));
|
|
21962
21987
|
const b = new p.BufferGeometry().setFromPoints(n), y = new z(H.Line);
|
|
21963
|
-
return y.geometry = b, y.material = pe, y.renderOrder =
|
|
21988
|
+
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((C) => {
|
|
21964
21989
|
C.layers.enableAll();
|
|
21965
21990
|
}), u.children.length === 1 ? u.children[0] : u) : (y.layers.enableAll(), y);
|
|
21966
21991
|
}
|
|
@@ -22115,12 +22140,12 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
22115
22140
|
for (let C = 0; C < o; C++) {
|
|
22116
22141
|
const w = d[y][C];
|
|
22117
22142
|
if (!w || w.mergedValue !== 0) continue;
|
|
22118
|
-
let x = 1,
|
|
22143
|
+
let x = 1, S = 1;
|
|
22119
22144
|
for (; y + x < a && d[y + x][C] && d[y + x][C].mergedValue === 1; )
|
|
22120
22145
|
x++;
|
|
22121
|
-
for (; C +
|
|
22122
|
-
|
|
22123
|
-
w.rowSpan = x, w.colSpan =
|
|
22146
|
+
for (; C + S < o && d[y][C + S] && d[y][C + S].mergedValue === 1; )
|
|
22147
|
+
S++;
|
|
22148
|
+
w.rowSpan = x, w.colSpan = S;
|
|
22124
22149
|
}
|
|
22125
22150
|
const f = [0];
|
|
22126
22151
|
for (let y = 0; y < a; y++)
|
|
@@ -22133,14 +22158,14 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
22133
22158
|
let C = m[0], w = !1;
|
|
22134
22159
|
for (let x = 0; x < o; x++) {
|
|
22135
22160
|
y > 0 && d[y - 1][x], y < a && d[y][x];
|
|
22136
|
-
let
|
|
22161
|
+
let S = !0;
|
|
22137
22162
|
if (y === 0 || y === a)
|
|
22138
|
-
|
|
22163
|
+
S = !0;
|
|
22139
22164
|
else {
|
|
22140
22165
|
const M = this._getMergeOwner(d, y - 1, x, a, o), O = this._getMergeOwner(d, y, x, a, o);
|
|
22141
|
-
|
|
22166
|
+
S = M !== O;
|
|
22142
22167
|
}
|
|
22143
|
-
|
|
22168
|
+
S ? w || (w = !0, C = m[x]) : w && (b.push(new p.Vector3(C, f[y], 0), new p.Vector3(m[x], f[y], 0)), w = !1);
|
|
22144
22169
|
}
|
|
22145
22170
|
w && b.push(new p.Vector3(C, f[y], 0), new p.Vector3(m[o], f[y], 0));
|
|
22146
22171
|
}
|
|
@@ -22148,14 +22173,14 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
22148
22173
|
let C = f[0], w = !1;
|
|
22149
22174
|
for (let x = 0; x < a; x++) {
|
|
22150
22175
|
y > 0 && d[x][y - 1], y < o && d[x][y];
|
|
22151
|
-
let
|
|
22176
|
+
let S = !0;
|
|
22152
22177
|
if (y === 0 || y === o)
|
|
22153
|
-
|
|
22178
|
+
S = !0;
|
|
22154
22179
|
else {
|
|
22155
22180
|
const M = this._getMergeOwner(d, x, y - 1, a, o), O = this._getMergeOwner(d, x, y, a, o);
|
|
22156
|
-
|
|
22181
|
+
S = M !== O;
|
|
22157
22182
|
}
|
|
22158
|
-
|
|
22183
|
+
S ? w || (w = !0, C = f[x]) : w && (b.push(new p.Vector3(m[y], C, 0), new p.Vector3(m[y], f[x], 0)), w = !1);
|
|
22159
22184
|
}
|
|
22160
22185
|
w && b.push(new p.Vector3(m[y], C, 0), new p.Vector3(m[y], f[a], 0));
|
|
22161
22186
|
}
|
|
@@ -22167,7 +22192,7 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
22167
22192
|
for (let C = 0; C < o; C++) {
|
|
22168
22193
|
const w = d[y][C];
|
|
22169
22194
|
if (!w || w.mergedValue !== 0) continue;
|
|
22170
|
-
const x = m[C],
|
|
22195
|
+
const x = m[C], S = f[y];
|
|
22171
22196
|
let M = 0;
|
|
22172
22197
|
for (let T = 0; T < (w.colSpan || 1); T++)
|
|
22173
22198
|
M += h[C + T];
|
|
@@ -22175,8 +22200,8 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
22175
22200
|
for (let T = 0; T < (w.rowSpan || 1); T++)
|
|
22176
22201
|
O += l[y + T];
|
|
22177
22202
|
w.colorIndex = e.colorIndex, w.height = w.textHeight || 2.5;
|
|
22178
|
-
const
|
|
22179
|
-
V.set(x,
|
|
22203
|
+
const E = this.getTableTextOffset(w.attachmentPoint || 1, M, O);
|
|
22204
|
+
V.set(x, S, 0), V.add(E), w.position = V.clone();
|
|
22180
22205
|
const v = this.loadMText(w, i, s);
|
|
22181
22206
|
v && n.add(v);
|
|
22182
22207
|
}
|
|
@@ -22272,8 +22297,8 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
22272
22297
|
e.center && (w.x = e.center.x, w.y = e.center.y);
|
|
22273
22298
|
const x = new p.Vector3(e.center?.x, e.center?.y, e.center?.z).applyMatrix4(r.invert());
|
|
22274
22299
|
w.x = x.x, w.y = x.y;
|
|
22275
|
-
const
|
|
22276
|
-
return M.geometry = Ba, M.material = js, M.userData.handle = e.handle, M.userData.isSnapObject = !0, M.userData.type = "CircleCenter", M.layers.set(qe), C.add(M), b ? (this.setRTCUserData(C),
|
|
22300
|
+
const S = w, M = new z(H.Point);
|
|
22301
|
+
return M.geometry = Ba, M.material = js, M.userData.handle = e.handle, M.userData.isSnapObject = !0, M.userData.type = "CircleCenter", M.layers.set(qe), C.add(M), b ? (this.setRTCUserData(C), S.x += m.x, S.y += m.y) : N.shouldRebasePositionOnRTC(S) && this.setRTCUserData(C), C.matrix.setPosition(S), C.layers.enableAll(), C;
|
|
22277
22302
|
}
|
|
22278
22303
|
addTriangleFacingCamera(e, i, s, n) {
|
|
22279
22304
|
const r = new p.Vector3(), a = new p.Vector3();
|
|
@@ -22341,7 +22366,7 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
22341
22366
|
` && w.push(M);
|
|
22342
22367
|
}
|
|
22343
22368
|
const x = w.length;
|
|
22344
|
-
let
|
|
22369
|
+
let S = 0;
|
|
22345
22370
|
for (let M = 0; M < e.length; M++) {
|
|
22346
22371
|
const O = e[M];
|
|
22347
22372
|
if (O === " ") {
|
|
@@ -22353,37 +22378,37 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
22353
22378
|
u = 0, f -= m * 0.5;
|
|
22354
22379
|
continue;
|
|
22355
22380
|
}
|
|
22356
|
-
let
|
|
22357
|
-
if (!
|
|
22381
|
+
let E = this.font?.getCharShape?.(O, i?.fontFile, s);
|
|
22382
|
+
if (!E && i?.bigFontFile && (E = this.font?.getCharShape?.(O, i.bigFontFile, s)), !E && this.font?.fileNames) {
|
|
22358
22383
|
const v = this.font.fileNames.filter((T) => T !== i?.fontFile);
|
|
22359
|
-
for (let T = v.length - 1; T >= 0 && (i.fontFile = v[T], i.styleName = "Standard",
|
|
22384
|
+
for (let T = v.length - 1; T >= 0 && (i.fontFile = v[T], i.styleName = "Standard", E = this.font?.getCharShape?.(O, i.fontFile, s), !E); T--)
|
|
22360
22385
|
;
|
|
22361
22386
|
}
|
|
22362
|
-
if (
|
|
22363
|
-
if (
|
|
22387
|
+
if (E || (E = this.font?.getNotFoundTextShape?.(s)), !!E) {
|
|
22388
|
+
if (E.translate(u, f, 0), u > o)
|
|
22364
22389
|
u = 0, f -= m;
|
|
22365
22390
|
else {
|
|
22366
|
-
!
|
|
22367
|
-
const v =
|
|
22391
|
+
!E.boundingBox && E.computeBoundingBox();
|
|
22392
|
+
const v = E.boundingBox.getSize(V).x, T = O.charCodeAt(0), A = T >= 19968 && T <= 40959 || // CJK 统一汉字
|
|
22368
22393
|
T >= 13312 && T <= 19903 || // 扩展 A
|
|
22369
22394
|
T >= 63744 && T <= 64255 || // 兼容汉字
|
|
22370
22395
|
T >= 12288 && T <= 12351 || // CJK 符号与标点(、。《》等)
|
|
22371
22396
|
T >= 65280 && T <= 65519 || // 全角 ASCII 与标点
|
|
22372
22397
|
[8216, 8217, 8220, 8221].includes(T) ? Math.max(v, s) : v + C;
|
|
22373
|
-
|
|
22398
|
+
S++, u += A + (S === x ? 0 : l);
|
|
22374
22399
|
}
|
|
22375
|
-
d.push(
|
|
22400
|
+
d.push(E);
|
|
22376
22401
|
}
|
|
22377
22402
|
}
|
|
22378
22403
|
if (d.length > 0) {
|
|
22379
|
-
const M = d.filter((
|
|
22404
|
+
const M = d.filter((E) => E instanceof p.ExtrudeGeometry), O = d.filter((E) => !(E instanceof p.ExtrudeGeometry));
|
|
22380
22405
|
if (M.length > 0) {
|
|
22381
|
-
const
|
|
22382
|
-
|
|
22406
|
+
const E = new z(H.Mesh);
|
|
22407
|
+
E.geometry = Oe(M), E.material = wi, h.add(E);
|
|
22383
22408
|
}
|
|
22384
22409
|
if (O.length > 0) {
|
|
22385
|
-
const
|
|
22386
|
-
|
|
22410
|
+
const E = new z(H.LineSegment);
|
|
22411
|
+
E.geometry = Oe(O), E.material = pe, h.add(E);
|
|
22387
22412
|
}
|
|
22388
22413
|
}
|
|
22389
22414
|
return h;
|
|
@@ -22427,8 +22452,8 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
22427
22452
|
if (e.startPoint && e.endPoint) {
|
|
22428
22453
|
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, C = (e.text || "").length;
|
|
22429
22454
|
if (C > 1) {
|
|
22430
|
-
const
|
|
22431
|
-
o.userData.letterSpacing =
|
|
22455
|
+
const S = (m - l) / (C - 1);
|
|
22456
|
+
o.userData.letterSpacing = S;
|
|
22432
22457
|
} else
|
|
22433
22458
|
b < 3 && o.scale.setX(b);
|
|
22434
22459
|
const w = f.clone().cross(Ge), x = f.angleTo(Ge);
|
|
@@ -22714,7 +22739,7 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
22714
22739
|
const u = e.entities[d];
|
|
22715
22740
|
this.addViewport(u, a);
|
|
22716
22741
|
const f = this.loadEntity(u, i);
|
|
22717
|
-
f && (this.enableMerge &&
|
|
22742
|
+
f && (this.enableMerge && Dt.merge(f, !1), o.add(f), f.traverse((m) => {
|
|
22718
22743
|
if (m.geometry) {
|
|
22719
22744
|
const b = m.userData.layerName;
|
|
22720
22745
|
let y = r[b];
|
|
@@ -22778,52 +22803,52 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
22778
22803
|
const n = e;
|
|
22779
22804
|
let r = [];
|
|
22780
22805
|
function a(M, O) {
|
|
22781
|
-
const { startPoint:
|
|
22806
|
+
const { startPoint: E, endPoint: v } = M, { startPoint: T, endPoint: _ } = O, A = v.x - E.x, I = v.y - E.y, B = _.x - T.x, k = _.y - T.y, D = A * k - I * B;
|
|
22782
22807
|
if (Math.abs(D) < 1e-10) return null;
|
|
22783
|
-
const R =
|
|
22808
|
+
const R = E.x - T.x, ie = E.y - T.y, se = (B * ie - k * R) / D, ze = (A * ie - I * R) / D;
|
|
22784
22809
|
return se >= 0 && se <= 1 && ze >= 0 && ze <= 1 ? {
|
|
22785
|
-
x:
|
|
22786
|
-
y:
|
|
22810
|
+
x: E.x + se * A,
|
|
22811
|
+
y: E.y + se * I
|
|
22787
22812
|
} : null;
|
|
22788
22813
|
}
|
|
22789
22814
|
function o(M) {
|
|
22790
|
-
const { edges: O } = M,
|
|
22815
|
+
const { edges: O } = M, E = [], v = O.length;
|
|
22791
22816
|
if ({ ...M }, v !== 4) return [M];
|
|
22792
22817
|
for (let T = 0; T < v; T++)
|
|
22793
22818
|
for (let _ = T + 2; _ < v; _++) {
|
|
22794
22819
|
if (_ === T + 1 || T === 0 && _ === v - 1) continue;
|
|
22795
22820
|
const A = a(O[T], O[_]);
|
|
22796
|
-
A &&
|
|
22821
|
+
A && E.push({
|
|
22797
22822
|
edgeIndex1: T,
|
|
22798
22823
|
edgeIndex2: _,
|
|
22799
22824
|
point: { x: A.x, y: A.y }
|
|
22800
22825
|
});
|
|
22801
22826
|
}
|
|
22802
|
-
if (
|
|
22827
|
+
if (E.length && E.length === 1) {
|
|
22803
22828
|
const T = {
|
|
22804
22829
|
pathTypeFlag: M.pathTypeFlag,
|
|
22805
22830
|
edges: [
|
|
22806
|
-
O[
|
|
22831
|
+
O[E[0].edgeIndex1 - 1],
|
|
22807
22832
|
{
|
|
22808
22833
|
startPoint: {
|
|
22809
|
-
...O[
|
|
22834
|
+
...O[E[0].edgeIndex1].startPoint
|
|
22810
22835
|
},
|
|
22811
22836
|
endPoint: {
|
|
22812
|
-
x:
|
|
22813
|
-
y:
|
|
22837
|
+
x: E[0].point.x,
|
|
22838
|
+
y: E[0].point.y
|
|
22814
22839
|
},
|
|
22815
|
-
type: O[
|
|
22840
|
+
type: O[E[0].edgeIndex1].type
|
|
22816
22841
|
},
|
|
22817
22842
|
{
|
|
22818
22843
|
startPoint: {
|
|
22819
|
-
x:
|
|
22820
|
-
y:
|
|
22844
|
+
x: E[0].point.x,
|
|
22845
|
+
y: E[0].point.y
|
|
22821
22846
|
},
|
|
22822
22847
|
endPoint: {
|
|
22823
|
-
x: O[
|
|
22824
|
-
y: O[
|
|
22848
|
+
x: O[E[0].edgeIndex2].startPoint.x,
|
|
22849
|
+
y: O[E[0].edgeIndex2].startPoint.y
|
|
22825
22850
|
},
|
|
22826
|
-
type: O[
|
|
22851
|
+
type: O[E[0].edgeIndex2].type
|
|
22827
22852
|
}
|
|
22828
22853
|
]
|
|
22829
22854
|
}, _ = {
|
|
@@ -22831,22 +22856,22 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
22831
22856
|
edges: [
|
|
22832
22857
|
{
|
|
22833
22858
|
startPoint: {
|
|
22834
|
-
x:
|
|
22835
|
-
y:
|
|
22859
|
+
x: E[0].point.x - 1e-5,
|
|
22860
|
+
y: E[0].point.y - 1e-5
|
|
22836
22861
|
},
|
|
22837
22862
|
endPoint: {
|
|
22838
|
-
...O[
|
|
22863
|
+
...O[E[0].edgeIndex1].endPoint
|
|
22839
22864
|
},
|
|
22840
|
-
type: O[
|
|
22865
|
+
type: O[E[0].edgeIndex1].type
|
|
22841
22866
|
},
|
|
22842
|
-
{ ...O[
|
|
22867
|
+
{ ...O[E[0].edgeIndex2 - 1] },
|
|
22843
22868
|
{
|
|
22844
|
-
startPoint: O[
|
|
22869
|
+
startPoint: O[E[0].edgeIndex2].startPoint,
|
|
22845
22870
|
endPoint: {
|
|
22846
|
-
x:
|
|
22847
|
-
y:
|
|
22871
|
+
x: E[0].point.x - 1e-5,
|
|
22872
|
+
y: E[0].point.y - 1e-5
|
|
22848
22873
|
},
|
|
22849
|
-
type: O[
|
|
22874
|
+
type: O[E[0].edgeIndex2].type
|
|
22850
22875
|
}
|
|
22851
22876
|
]
|
|
22852
22877
|
};
|
|
@@ -22856,8 +22881,8 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
22856
22881
|
}
|
|
22857
22882
|
if (n.boundaryPaths.length == 0) return;
|
|
22858
22883
|
for (let M = 0; M < n.boundaryPaths.length; M++) {
|
|
22859
|
-
const O = n.boundaryPaths[M],
|
|
22860
|
-
r = [...r, ...
|
|
22884
|
+
const O = n.boundaryPaths[M], E = o(O);
|
|
22885
|
+
r = [...r, ...E];
|
|
22861
22886
|
}
|
|
22862
22887
|
if (n.boundaryPaths = r, !n.solidFill && !n.patternLines?.length) {
|
|
22863
22888
|
P.warn("[Dxf] Hatch entity(handle: '" + n.handle + "') doesn't have solid fill, nor patternLines, ignored!");
|
|
@@ -22865,19 +22890,19 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
22865
22890
|
}
|
|
22866
22891
|
const l = [], h = [], d = [], u = (M) => {
|
|
22867
22892
|
const O = [];
|
|
22868
|
-
let
|
|
22869
|
-
|
|
22893
|
+
let E = [];
|
|
22894
|
+
E.push(...this.convertEdgeToPoints(M[0]));
|
|
22870
22895
|
for (let v = 1; v < M.length; v++) {
|
|
22871
22896
|
const T = this.convertEdgeToPoints(M[v]);
|
|
22872
|
-
if (
|
|
22897
|
+
if (E.push(...T), E.length > 2) {
|
|
22873
22898
|
const _ = this.convertEdgeToPoints(M[v - 1]);
|
|
22874
|
-
F.areVector2sEqual(_[_.length - 1], T[0]) ? F.areVector2sEqual(
|
|
22899
|
+
F.areVector2sEqual(_[_.length - 1], T[0]) ? F.areVector2sEqual(E[0], T[T.length - 1], 1e-5) && (O.push(E), E = []) : F.areVector2sEqual(_[0], T[T.length - 1]) ? F.areVector2sEqual(E[1], T[0], 1e-5) && (O.push(E), E = []) : E = [];
|
|
22875
22900
|
}
|
|
22876
22901
|
}
|
|
22877
22902
|
return O;
|
|
22878
22903
|
};
|
|
22879
22904
|
if (n.boundaryPaths.forEach((M, O) => {
|
|
22880
|
-
let
|
|
22905
|
+
let E = [];
|
|
22881
22906
|
if (this.IsfilteredByPathTypeFlag(M.pathTypeFlag)) {
|
|
22882
22907
|
P.info("[Dxf] The %d path type flag is filtered at the %dth boundrayPath (hatch handle '%s')", M.pathTypeFlag, O, n.handle);
|
|
22883
22908
|
return;
|
|
@@ -22897,17 +22922,17 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
22897
22922
|
P.warn("[Dxf] The %dth boundaryPath (hatch handle '%s') has less than 3 points, ignored!", O, n.handle);
|
|
22898
22923
|
return;
|
|
22899
22924
|
}
|
|
22900
|
-
if (
|
|
22925
|
+
if (E.push(T), M.pathTypeFlag > Ao.MaxFlags && (!((A) => {
|
|
22901
22926
|
for (let I = 1; I < A.length; ++I) {
|
|
22902
22927
|
const B = A[I - 1].endPoint, k = A[I].startPoint;
|
|
22903
22928
|
if (!B || !k || !F.areVector2sEqual(B, k)) return !1;
|
|
22904
22929
|
}
|
|
22905
22930
|
return !0;
|
|
22906
|
-
})(M.edges) || !n.associativity) && (
|
|
22931
|
+
})(M.edges) || !n.associativity) && (E = u(v), E.length < 2)) {
|
|
22907
22932
|
P.warn("[Dxf] The %dth boundaryPath (hatch handle '%s') has unknown path, ignored!", O, n.handle);
|
|
22908
22933
|
return;
|
|
22909
22934
|
}
|
|
22910
|
-
|
|
22935
|
+
E.forEach((_) => {
|
|
22911
22936
|
!F.areVector2sEqual(_[0], _[_.length - 1]) && _.push(_[0]);
|
|
22912
22937
|
const A = _.map((I) => new p.Vector2(U.roundNumber(I.x, 7), U.roundNumber(I.y, 7)));
|
|
22913
22938
|
if (A?.length > 0) {
|
|
@@ -22931,13 +22956,13 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
22931
22956
|
const y = this.buildContainHierarchyTree(l, h, b), C = [];
|
|
22932
22957
|
this.buildHatchGeometry(l, y, C);
|
|
22933
22958
|
let w;
|
|
22934
|
-
if (C.length > 0 && (w =
|
|
22959
|
+
if (C.length > 0 && (w = Oe(C)), !w || !w.getIndex() || w.getIndex()?.count === 0) return P.warn("[Dxf] Failed to convert hatch boundaries!"), void 0;
|
|
22935
22960
|
const x = new z(H.Mesh);
|
|
22936
22961
|
x.geometry = w, x.material = wi, this.setHatchMaterial(x, n, i, f, s);
|
|
22937
|
-
const
|
|
22938
|
-
return m && (this.setRTCUserData(
|
|
22962
|
+
const S = x;
|
|
22963
|
+
return m && (this.setRTCUserData(S), S.matrix.setPosition(f.x, f.y, 0)), S.traverse((M) => {
|
|
22939
22964
|
M.layers.enableAll(), M.layers.disable(qe);
|
|
22940
|
-
}),
|
|
22965
|
+
}), S;
|
|
22941
22966
|
}
|
|
22942
22967
|
loadOle2frame(e, i) {
|
|
22943
22968
|
const {
|
|
@@ -22969,19 +22994,19 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
22969
22994
|
for (let w = 0; w < i.objects.XRECORD.length; w++) {
|
|
22970
22995
|
const x = i.objects.XRECORD[w];
|
|
22971
22996
|
if (x.handle === b) {
|
|
22972
|
-
const
|
|
22973
|
-
|
|
22997
|
+
const S = x.binaryData, M = U.hexToBase64(S), O = "data:image/jpg;base64," + M, E = new p.TextureLoader(this.manager).load(O);
|
|
22998
|
+
E.colorSpace = p.SRGBColorSpace;
|
|
22974
22999
|
const v = new p.MeshBasicMaterial({
|
|
22975
23000
|
transparent: !0,
|
|
22976
|
-
map:
|
|
23001
|
+
map: E
|
|
22977
23002
|
});
|
|
22978
23003
|
this.meshTextureMaterials[b] = v, C = v;
|
|
22979
23004
|
break;
|
|
22980
23005
|
}
|
|
22981
23006
|
}
|
|
22982
23007
|
if (C) {
|
|
22983
|
-
const w = new p.Box2().setFromPoints(o), x = w.getSize(ts),
|
|
22984
|
-
M.geometry =
|
|
23008
|
+
const w = new p.Box2().setFromPoints(o), x = w.getSize(ts), S = new p.PlaneGeometry(x.x, x.y), M = new z(H.Mesh);
|
|
23009
|
+
M.geometry = S, M.material = C;
|
|
22985
23010
|
const O = w.getCenter(ts);
|
|
22986
23011
|
V.set(O.x, O.y, 0), h && (this.setRTCUserData(M), V.x += l.x, V.y += l.y), M.matrix.setPosition(V), M.layers.enableAll(), m.add(M);
|
|
22987
23012
|
}
|
|
@@ -23064,7 +23089,7 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
23064
23089
|
* (DxfEntity 未收录),此处做类型桥接。
|
|
23065
23090
|
*/
|
|
23066
23091
|
getColor(e, i, s) {
|
|
23067
|
-
if (this.compareContext) return
|
|
23092
|
+
if (this.compareContext) return yt.ENTITY_COLOR_NO_CHANGE;
|
|
23068
23093
|
if (this.overrideColor != null) return this.overrideColor;
|
|
23069
23094
|
const n = e;
|
|
23070
23095
|
if (n && n.isGradientColor) {
|
|
@@ -23123,7 +23148,7 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
23123
23148
|
const r = e;
|
|
23124
23149
|
if (!r.geometry || (this.setRenderOrderByObjectType(e), i.type === "OLE2FRAME")) return;
|
|
23125
23150
|
if (i.type === "MTEXT") {
|
|
23126
|
-
e.renderOrder =
|
|
23151
|
+
e.renderOrder = Me.Text;
|
|
23127
23152
|
return;
|
|
23128
23153
|
}
|
|
23129
23154
|
if (i.type === "HATCH") {
|
|
@@ -23133,12 +23158,12 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
23133
23158
|
if (i.type === "IMAGE") return;
|
|
23134
23159
|
let a;
|
|
23135
23160
|
const o = this.getColor(i, s, n);
|
|
23136
|
-
if (i.type === "LWPOLYLINE" && (r.isMesh ? (a = this.getMeshBasicMaterial(o), e.renderOrder =
|
|
23161
|
+
if (i.type === "LWPOLYLINE" && (r.isMesh ? (a = this.getMeshBasicMaterial(o), e.renderOrder = Me.LineWithWidth) : e.userData.isOutline && (a = this.getLineBasicMaterial(o), e.renderOrder = Me.LineWithPattern), a)) {
|
|
23137
23162
|
r.material = a;
|
|
23138
23163
|
return;
|
|
23139
23164
|
}
|
|
23140
23165
|
if (i.type === "SOLID") a = this.getMeshBasicMaterial(o);
|
|
23141
|
-
else if (i.type === "TEXT" || i.type === "ATTDEF" || i.type === "ATTRIB") a = this.getLineBasicMaterial(o), e.renderOrder =
|
|
23166
|
+
else if (i.type === "TEXT" || i.type === "ATTDEF" || i.type === "ATTRIB") a = this.getLineBasicMaterial(o), e.renderOrder = Me.Text;
|
|
23142
23167
|
else if (i.type === "LEADER" || i.type === "MULTILEADER" || i.type === "VIEWPORT") a = this.getLineBasicMaterial(o);
|
|
23143
23168
|
else if (i.type === "POINT") a = this.getPointsMaterial(o);
|
|
23144
23169
|
else {
|
|
@@ -23149,7 +23174,7 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
23149
23174
|
const l = s.tables?.lineType?.lineTypes, h = l && l[this.getLineType(i, s, n)];
|
|
23150
23175
|
if (h && h.pattern && h.pattern.length !== 0) {
|
|
23151
23176
|
const d = i.lineTypeScale || 1;
|
|
23152
|
-
a = this.getLineShaderMaterial(h, o, d), e.renderOrder =
|
|
23177
|
+
a = this.getLineShaderMaterial(h, o, d), e.renderOrder = Me.LineWithPattern;
|
|
23153
23178
|
} else a = this.getLineBasicMaterial(o);
|
|
23154
23179
|
}
|
|
23155
23180
|
r.material = a;
|
|
@@ -23166,7 +23191,7 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
23166
23191
|
a.material = this.getLineBasicMaterial(o);
|
|
23167
23192
|
return;
|
|
23168
23193
|
}
|
|
23169
|
-
let l =
|
|
23194
|
+
let l = Me.Mesh, h;
|
|
23170
23195
|
if (i.solidFill) h = this.getMeshBasicMaterial(o);
|
|
23171
23196
|
else {
|
|
23172
23197
|
if (a.material instanceof p.ShaderMaterial) {
|
|
@@ -23174,9 +23199,9 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
23174
23199
|
const d = new p.Color(o);
|
|
23175
23200
|
!a.material.uniforms.u_color.value.equals(d) && (h = a.material.clone(), j.updateMaterialUniforms(h), h.uniforms.u_color.value.set(o));
|
|
23176
23201
|
} else h = this.getHatchShaderMaterial(i, o, n);
|
|
23177
|
-
l =
|
|
23202
|
+
l = Me.MeshWithPattern;
|
|
23178
23203
|
}
|
|
23179
|
-
!h && (h = this.getMeshBasicMaterial(o), l =
|
|
23204
|
+
!h && (h = this.getMeshBasicMaterial(o), l = Me.Mesh), a.material = h, a.renderOrder = l;
|
|
23180
23205
|
}
|
|
23181
23206
|
/**
|
|
23182
23207
|
* 说明:isMesh/isLine/isPoints 仅存在于 THREE.Object3D 上,DxfObject 运行期恒为 undefined
|
|
@@ -23185,7 +23210,7 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
23185
23210
|
setRenderOrderByObjectType(e) {
|
|
23186
23211
|
const i = e;
|
|
23187
23212
|
let s = 0;
|
|
23188
|
-
i.isMesh ? s =
|
|
23213
|
+
i.isMesh ? s = Me.Mesh : i.isLine ? s = Me.Line : i.isPoints && (s = Me.Point), e.renderOrder = s;
|
|
23189
23214
|
}
|
|
23190
23215
|
getPointsMaterial(e) {
|
|
23191
23216
|
return !this.pointsMaterials[e] && (this.pointsMaterials[e] = new p.PointsMaterial({
|
|
@@ -23231,20 +23256,20 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
23231
23256
|
const T = f.dashPattern[v];
|
|
23232
23257
|
T > 0 && (C = !1), w += Math.abs(T);
|
|
23233
23258
|
}
|
|
23234
|
-
const x = C ? a : r,
|
|
23259
|
+
const x = C ? a : r, S = [], M = [];
|
|
23235
23260
|
let O = 0;
|
|
23236
23261
|
M[0] = O;
|
|
23237
23262
|
for (let v = 0; v < y; ++v)
|
|
23238
|
-
|
|
23263
|
+
S[v] = f.dashPattern[v], S[v] === 0 && (S[v] = x * w), O += Math.abs(S[v]), M[v + 1] = O;
|
|
23239
23264
|
for (let v = y; v < o; ++v)
|
|
23240
|
-
|
|
23265
|
+
S[v] = 0;
|
|
23241
23266
|
for (let v = M.length; v < o + 1; ++v)
|
|
23242
23267
|
M[v] = O;
|
|
23243
|
-
const
|
|
23268
|
+
const E = {
|
|
23244
23269
|
origin: m,
|
|
23245
23270
|
delta: b,
|
|
23246
23271
|
angle: f.angle - e.patternAngle,
|
|
23247
|
-
pattern:
|
|
23272
|
+
pattern: S,
|
|
23248
23273
|
patternSum: M,
|
|
23249
23274
|
patternLength: O
|
|
23250
23275
|
};
|
|
@@ -23252,7 +23277,7 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
23252
23277
|
P.warn("[Dxf] There will be warning in fragment shader when number of uniforms exceeds 1024, so extra hatch line patterns are ignored here!");
|
|
23253
23278
|
break;
|
|
23254
23279
|
}
|
|
23255
|
-
h.push(
|
|
23280
|
+
h.push(E);
|
|
23256
23281
|
}
|
|
23257
23282
|
const u = ed(h, e.patternAngle, j.CameraZoomUniform, new p.Color(i), this.overrideHatchPatternLineThickness);
|
|
23258
23283
|
return u.defines = {
|
|
@@ -23377,9 +23402,9 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
23377
23402
|
regions: [o(e[y])],
|
|
23378
23403
|
inverted: !1
|
|
23379
23404
|
}), x = Yt.combine(b, w);
|
|
23380
|
-
d = Yt.polygon(Yt.selectUnion(x)), d.regions.length > 0 ? d.regions.forEach((
|
|
23381
|
-
if (
|
|
23382
|
-
const M =
|
|
23405
|
+
d = Yt.polygon(Yt.selectUnion(x)), d.regions.length > 0 ? d.regions.forEach((S) => {
|
|
23406
|
+
if (S.length === 0) return;
|
|
23407
|
+
const M = S.map((O) => new p.Vector2(O[0], O[1]));
|
|
23383
23408
|
h.holes.push(new p.Path(M));
|
|
23384
23409
|
}) : P.warn("[Dxf] mergedHoles.regions is empty");
|
|
23385
23410
|
}
|
|
@@ -23664,7 +23689,7 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
23664
23689
|
}), m[x].children.push(y);
|
|
23665
23690
|
}
|
|
23666
23691
|
for (const y in m) {
|
|
23667
|
-
const C = m[y], w =
|
|
23692
|
+
const C = m[y], w = Dt.deepMerge(C.children, C.object, !1, !1, !0), x = w.added, S = w.removed;
|
|
23668
23693
|
!s[y] && (s[y] = {
|
|
23669
23694
|
object: C.object,
|
|
23670
23695
|
children: []
|
|
@@ -23672,26 +23697,26 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
23672
23697
|
object: C.object,
|
|
23673
23698
|
children: []
|
|
23674
23699
|
});
|
|
23675
|
-
const M =
|
|
23700
|
+
const M = S.length > r;
|
|
23676
23701
|
if (M) {
|
|
23677
23702
|
const O = Date.now();
|
|
23678
|
-
j.removeEmptyObjectsFromRemovingMarkedObjects2(
|
|
23679
|
-
} else a +=
|
|
23680
|
-
if (
|
|
23703
|
+
j.removeEmptyObjectsFromRemovingMarkedObjects2(S, C.object), o += Date.now() - O;
|
|
23704
|
+
} else a += S.length;
|
|
23705
|
+
if (S.length === C.children.length) !M && S.forEach((O) => {
|
|
23681
23706
|
s[y].children.push(O);
|
|
23682
23707
|
});
|
|
23683
23708
|
else {
|
|
23684
|
-
let O =
|
|
23685
|
-
|
|
23686
|
-
const
|
|
23709
|
+
let O = S;
|
|
23710
|
+
S.length >= 100 && (O = new Set(S));
|
|
23711
|
+
const E = (v) => Array.isArray(O) ? O.indexOf(v) >= 0 : O.has(v);
|
|
23687
23712
|
for (let v = 0; v < C.children.length; v++) {
|
|
23688
23713
|
const T = C.children[v];
|
|
23689
|
-
|
|
23714
|
+
E(T) ? !M && s[y].children.push(T) : b.push(T);
|
|
23690
23715
|
}
|
|
23691
23716
|
}
|
|
23692
23717
|
for (let O = 0; O < x.length; O++) {
|
|
23693
|
-
const
|
|
23694
|
-
b.push(
|
|
23718
|
+
const E = x[O];
|
|
23719
|
+
b.push(E), n[y].children.push(E);
|
|
23695
23720
|
}
|
|
23696
23721
|
a > r && l();
|
|
23697
23722
|
}
|
|
@@ -23731,13 +23756,13 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
23731
23756
|
await s(++m / f * 100);
|
|
23732
23757
|
continue;
|
|
23733
23758
|
}
|
|
23734
|
-
const w = Date.now(), x = {},
|
|
23735
|
-
for (const
|
|
23736
|
-
if (
|
|
23737
|
-
|
|
23759
|
+
const w = Date.now(), x = {}, S = [];
|
|
23760
|
+
for (const E of C) {
|
|
23761
|
+
if (E.userData.isSnapObject) {
|
|
23762
|
+
S.push(E);
|
|
23738
23763
|
continue;
|
|
23739
23764
|
}
|
|
23740
|
-
let v, T =
|
|
23765
|
+
let v, T = E;
|
|
23741
23766
|
for (; T; ) {
|
|
23742
23767
|
if (T.userData.isLayoutLevelObject) {
|
|
23743
23768
|
v = T;
|
|
@@ -23750,21 +23775,21 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
23750
23775
|
!x[_] && (x[_] = {
|
|
23751
23776
|
object: v,
|
|
23752
23777
|
children: []
|
|
23753
|
-
}), x[_].children.push(
|
|
23778
|
+
}), x[_].children.push(E);
|
|
23754
23779
|
}
|
|
23755
23780
|
const M = Object.keys(x).length;
|
|
23756
23781
|
let O = 0;
|
|
23757
|
-
for (const
|
|
23782
|
+
for (const E in x) {
|
|
23758
23783
|
let v;
|
|
23759
|
-
if (
|
|
23760
|
-
const k = n[
|
|
23784
|
+
if (E !== j.MODEL_LAYOUT_NAME) {
|
|
23785
|
+
const k = n[E];
|
|
23761
23786
|
!k.directAssociatedLeafObjectSet && (k.directAssociatedLeafObjectSet = /* @__PURE__ */ new Set()), v = k.directAssociatedLeafObjectSet;
|
|
23762
23787
|
}
|
|
23763
|
-
const T = x[
|
|
23764
|
-
!a[
|
|
23788
|
+
const T = x[E], _ = ye.deepMerge(T.children, T.object, !1, !1, !0), A = _.added, I = _.removed;
|
|
23789
|
+
!a[E] && (a[E] = {
|
|
23765
23790
|
object: T.object,
|
|
23766
23791
|
children: []
|
|
23767
|
-
}), !o[
|
|
23792
|
+
}), !o[E] && (o[E] = {
|
|
23768
23793
|
object: T.object,
|
|
23769
23794
|
children: []
|
|
23770
23795
|
});
|
|
@@ -23774,7 +23799,7 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
23774
23799
|
j.removeEmptyObjectsFromRemovingMarkedObjects(I, T.object), d += Date.now() - k;
|
|
23775
23800
|
} else h += I.length;
|
|
23776
23801
|
if (I.length === T.children.length) !B && I.forEach((k) => {
|
|
23777
|
-
a[
|
|
23802
|
+
a[E].children.push(k);
|
|
23778
23803
|
});
|
|
23779
23804
|
else {
|
|
23780
23805
|
let k = I;
|
|
@@ -23782,25 +23807,25 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
23782
23807
|
const D = (R) => Array.isArray(k) ? k.indexOf(R) >= 0 : k.has(R);
|
|
23783
23808
|
for (let R = 0; R < T.children.length; R++) {
|
|
23784
23809
|
const ie = T.children[R];
|
|
23785
|
-
D(ie) ? !B && a[
|
|
23810
|
+
D(ie) ? !B && a[E].children.push(ie) : (S.push(ie), v && v.add(ie));
|
|
23786
23811
|
}
|
|
23787
23812
|
}
|
|
23788
23813
|
for (let k = 0; k < A.length; k++) {
|
|
23789
23814
|
const D = A[k];
|
|
23790
|
-
Q.setSharedVariablesOfObject(D),
|
|
23815
|
+
Q.setSharedVariablesOfObject(D), S.push(D), o[E].children.push(D), v && v.add(D);
|
|
23791
23816
|
}
|
|
23792
23817
|
h > l && u(), await s((m + ++O / M) / f * 100);
|
|
23793
23818
|
}
|
|
23794
|
-
await s(++m / f * 100), e.layersAndThreejsObjects[y] =
|
|
23819
|
+
await s(++m / f * 100), e.layersAndThreejsObjects[y] = S, P.debug("[Dxf] Merged layer '" + y + "' in " + (Date.now() - w) / 1e3 + "s");
|
|
23795
23820
|
}
|
|
23796
23821
|
h > 0 && u();
|
|
23797
23822
|
for (const y in o) {
|
|
23798
23823
|
const C = o[y], w = e.threejsObject.children.find((x) => x.name === y);
|
|
23799
23824
|
if (w) {
|
|
23800
|
-
const x = w.children.find((
|
|
23825
|
+
const x = w.children.find((S) => S.name === j.SNAP_GROUP_NAME);
|
|
23801
23826
|
if (x && y !== j.MODEL_LAYOUT_NAME) {
|
|
23802
|
-
const
|
|
23803
|
-
!
|
|
23827
|
+
const S = n[y];
|
|
23828
|
+
!S.directAssociatedLeafObjectSet && (S.directAssociatedLeafObjectSet = /* @__PURE__ */ new Set()), x.children.forEach((M) => S.directAssociatedLeafObjectSet?.add(M));
|
|
23804
23829
|
}
|
|
23805
23830
|
}
|
|
23806
23831
|
!w && e.threejsObject.add(C.object), C.children.forEach((x) => {
|
|
@@ -23923,7 +23948,7 @@ class Ua extends hi {
|
|
|
23923
23948
|
h && (l.type === We.Added ? i.push(h) : l.type === We.Removed ? s.push(h) : n.push(h));
|
|
23924
23949
|
}
|
|
23925
23950
|
const r = N.mergeBBoxes(i), a = N.mergeBBoxes(s), o = N.mergeBBoxes(n);
|
|
23926
|
-
this.drawableList.addDrawable(new
|
|
23951
|
+
this.drawableList.addDrawable(new Ot(U.guid(), r, [0.1, 0.9, 0.2, 1])), this.drawableList.addDrawable(new Ot(U.guid(), a, [1, 0.15, 0.15, 1])), this.drawableList.addDrawable(new Ot(U.guid(), o, [1, 0.85, 0.1, 1])), this.viewer.enableRender();
|
|
23927
23952
|
}
|
|
23928
23953
|
setCompareDrawableVisible(e) {
|
|
23929
23954
|
this.drawableList.getDrawables().forEach((i) => i.visible = e), this.viewer.enableRender();
|
|
@@ -24156,9 +24181,9 @@ class ys extends Or {
|
|
|
24156
24181
|
n ? n.forEach((r) => {
|
|
24157
24182
|
const a = r;
|
|
24158
24183
|
if (a.material) {
|
|
24159
|
-
!a.userData.originalMaterial && (a.userData.originalMaterial =
|
|
24160
|
-
const o =
|
|
24161
|
-
|
|
24184
|
+
!a.userData.originalMaterial && (a.userData.originalMaterial = Te.cloneMaterial(a.material));
|
|
24185
|
+
const o = Te.cloneMaterial(a.material);
|
|
24186
|
+
Te.setMaterialOpacity(o, i), X.updateMaterialUniforms(o), a.material = o;
|
|
24162
24187
|
}
|
|
24163
24188
|
}) : P.info("[Viewer] No object found for layer '" + e + "'");
|
|
24164
24189
|
}
|
|
@@ -24171,9 +24196,9 @@ class ys extends Or {
|
|
|
24171
24196
|
n ? n.forEach((r) => {
|
|
24172
24197
|
const a = r;
|
|
24173
24198
|
if (a.material) {
|
|
24174
|
-
!a.userData.originalMaterial && (a.userData.originalMaterial =
|
|
24175
|
-
const o =
|
|
24176
|
-
|
|
24199
|
+
!a.userData.originalMaterial && (a.userData.originalMaterial = Te.cloneMaterial(a.material));
|
|
24200
|
+
const o = Te.cloneMaterial(a.material);
|
|
24201
|
+
Te.setMaterialColor(o, new p.Color(i)), X.updateMaterialUniforms(o), a.material = o;
|
|
24177
24202
|
}
|
|
24178
24203
|
}) : P.info("[Viewer] No object found for layer '" + e + "'");
|
|
24179
24204
|
}
|
|
@@ -24292,12 +24317,12 @@ class ys extends Or {
|
|
|
24292
24317
|
}
|
|
24293
24318
|
}), w.add(_);
|
|
24294
24319
|
}), C && C.size === 0) return;
|
|
24295
|
-
const
|
|
24320
|
+
const S = s.getModelObject();
|
|
24296
24321
|
let M = s.getLayoutLevelObject(e);
|
|
24297
|
-
!M && (M = new p.Group(), Q.setSharedVariablesOfObject(M), M.name = e,
|
|
24322
|
+
!M && (M = new p.Group(), Q.setSharedVariablesOfObject(M), M.name = e, S?.add(M)), M.add(w), w.applyMatrix4(r.msToPsMatrix), w.updateMatrixWorld(!0);
|
|
24298
24323
|
let O = M.children.find((T) => T.name === X.SNAP_GROUP_NAME);
|
|
24299
24324
|
!O && (O = new p.Group(), O.visible = X.SHOW_SNAP_OBJECT, O.name = X.SNAP_GROUP_NAME, M.add(O));
|
|
24300
|
-
const
|
|
24325
|
+
const E = s.getLayoutLevelObject(X.MODEL_LAYOUT_NAME), v = E?.children.find((T) => T.name === X.SNAP_GROUP_NAME);
|
|
24301
24326
|
v && v.traverse((T) => {
|
|
24302
24327
|
if (!T.geometry) return;
|
|
24303
24328
|
const _ = T.userData.layerName;
|
|
@@ -24427,7 +24452,7 @@ class ys extends Or {
|
|
|
24427
24452
|
*/
|
|
24428
24453
|
highlightObject(e) {
|
|
24429
24454
|
if (!this.hasObject(e)) return;
|
|
24430
|
-
const i =
|
|
24455
|
+
const i = Te.clonedHighlightMaterials(e, {
|
|
24431
24456
|
depthTest: !1
|
|
24432
24457
|
// 禁用深度测试,确保高亮层显示在最前面
|
|
24433
24458
|
});
|
|
@@ -24582,14 +24607,14 @@ class Lo extends Or {
|
|
|
24582
24607
|
const r = this.createInstanceMeshById(e, s, {
|
|
24583
24608
|
depthTest: !1
|
|
24584
24609
|
});
|
|
24585
|
-
r.material.opacity = 0.7,
|
|
24610
|
+
r.material.opacity = 0.7, Te.setMaterialColor(r.material, n), e.userData.instanceId = s, e.userData.clonedMesh = r, this.highlighUsage.add(r);
|
|
24586
24611
|
} else if (ye.isMergedMesh(e) && i) {
|
|
24587
24612
|
const r = this.createBatchMeshById(e, i, {
|
|
24588
24613
|
depthTest: !1
|
|
24589
24614
|
});
|
|
24590
|
-
r.material.opacity = 0.7,
|
|
24615
|
+
r.material.opacity = 0.7, Te.setMaterialColor(r.material, n), e.userData.batchId = i, e.userData.clonedMesh = r, this.highlighUsage.add(r);
|
|
24591
24616
|
} else {
|
|
24592
|
-
const r =
|
|
24617
|
+
const r = Te.clonedHighlightMaterials(e, {
|
|
24593
24618
|
depthTest: !1
|
|
24594
24619
|
});
|
|
24595
24620
|
r && (e.userData.originalMaterial = e.material, e.material = r);
|
|
@@ -24646,7 +24671,7 @@ class Lo extends Or {
|
|
|
24646
24671
|
a += " batchId: " + i + ", object name: " + r?.name, r?.userData && (a += `
|
|
24647
24672
|
userData: ` + JSON.stringify(r.userData)), r?.parentUserData && (a += `
|
|
24648
24673
|
parentUserData: ` + JSON.stringify(r.parentUserData)), P.info(a);
|
|
24649
|
-
const o =
|
|
24674
|
+
const o = Te.cloneMaterial(e.material);
|
|
24650
24675
|
o.opacity = s, o.transparent = s < 1, !n && (o.depthTest = n, o.depthWrite = n, o.side = p.DoubleSide);
|
|
24651
24676
|
const l = ye.cloneGeometryForBatch(e, r), h = new p.Mesh(l, o);
|
|
24652
24677
|
return h.applyMatrix4(e.matrixWorld), h.matrixWorldNeedsUpdate = !0, h.name = "Cloned mesh for highlighting", h.layers.enableAll(), h;
|
|
@@ -24654,7 +24679,7 @@ parentUserData: ` + JSON.stringify(r.parentUserData)), P.info(a);
|
|
|
24654
24679
|
createInstanceMeshById(e, i, { opacity: s = 1, depthTest: n = !0 }) {
|
|
24655
24680
|
const r = e, a = new p.Matrix4(), o = new p.Matrix4();
|
|
24656
24681
|
o.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), r.getMatrixAt(i, a);
|
|
24657
|
-
const l =
|
|
24682
|
+
const l = Te.cloneMaterial(r.material);
|
|
24658
24683
|
l.opacity = s, l.transparent = s < 1, !n && (l.depthTest = n, l.depthWrite = n, l.side = p.DoubleSide);
|
|
24659
24684
|
const h = new p.Mesh(r.geometry.clone(), l);
|
|
24660
24685
|
h.applyMatrix4(e.matrixWorld.multiply(a)), h.matrixWorldNeedsUpdate = !0, h.name = "Cloned mesh for highlighting", h.layers.enableAll();
|
|
@@ -26473,10 +26498,10 @@ class U1 extends El {
|
|
|
26473
26498
|
w.instanceMatrix = new p.InstancedBufferAttribute(new Float32Array(l), 16);
|
|
26474
26499
|
let x = n;
|
|
26475
26500
|
x.length === 0 && (x = this.getVertexColorArray(f * 3, y?.color)), w.instanceColor = new p.InstancedBufferAttribute(x, 3);
|
|
26476
|
-
const
|
|
26477
|
-
return
|
|
26501
|
+
const S = new p.InstancedMesh(m, this.materialManager?.pickMaterial, f);
|
|
26502
|
+
return S.instanceMatrix = new p.InstancedBufferAttribute(new Float32Array(l), 16), {
|
|
26478
26503
|
mesh: w,
|
|
26479
|
-
pickMesh:
|
|
26504
|
+
pickMesh: S,
|
|
26480
26505
|
userIds: h
|
|
26481
26506
|
};
|
|
26482
26507
|
}
|
|
@@ -26508,16 +26533,16 @@ class U1 extends El {
|
|
|
26508
26533
|
)
|
|
26509
26534
|
), b && f.setIndex(b), f.applyMatrix4(C);
|
|
26510
26535
|
} else {
|
|
26511
|
-
const { indexStart: C, indexCount: w, positionStart: x, positionCount:
|
|
26536
|
+
const { indexStart: C, indexCount: w, positionStart: x, positionCount: S } = o.userData.batchTable.find(
|
|
26512
26537
|
(_) => _.userId === d
|
|
26513
26538
|
), M = m.itemSize, O = m.array.slice(
|
|
26514
26539
|
x * M,
|
|
26515
|
-
x * M +
|
|
26516
|
-
),
|
|
26517
|
-
f.setAttribute("position",
|
|
26540
|
+
x * M + S * M
|
|
26541
|
+
), E = new p.Float32BufferAttribute(O, M);
|
|
26542
|
+
f.setAttribute("position", E);
|
|
26518
26543
|
const v = y.array.slice(
|
|
26519
26544
|
x,
|
|
26520
|
-
x +
|
|
26545
|
+
x + S
|
|
26521
26546
|
), T = new p.Int32BufferAttribute(v, 1);
|
|
26522
26547
|
if (f.setAttribute("tileObjectId", T), b) {
|
|
26523
26548
|
const _ = b.array.slice(C, C + w);
|
|
@@ -26530,7 +26555,7 @@ class U1 extends El {
|
|
|
26530
26555
|
}
|
|
26531
26556
|
}
|
|
26532
26557
|
}
|
|
26533
|
-
}), P.info("[BimTiles] getGeometryByUserIds took " + (Date.now() - i) / 1e3 + "s"), s.length > 1 ?
|
|
26558
|
+
}), P.info("[BimTiles] getGeometryByUserIds took " + (Date.now() - i) / 1e3 + "s"), s.length > 1 ? Oe(s) : s[0];
|
|
26534
26559
|
}
|
|
26535
26560
|
parseTile(e, i, s) {
|
|
26536
26561
|
this.onBeforeParseTile && this.onBeforeParseTile(i), i._loadIndex = i._loadIndex || 0, i._loadIndex++;
|
|
@@ -27041,7 +27066,7 @@ class Go {
|
|
|
27041
27066
|
}), this.progressItems.clear(), this.element.remove();
|
|
27042
27067
|
}
|
|
27043
27068
|
}
|
|
27044
|
-
var at = /* @__PURE__ */ ((c) => (c.BaseViewer = "BaseViewer", c.Viewer3d = "Viewer3d", c.Viewer2d = "Viewer2d", c.BimTilesViewer = "BimTilesViewer", c))(at || {}),
|
|
27069
|
+
var at = /* @__PURE__ */ ((c) => (c.BaseViewer = "BaseViewer", c.Viewer3d = "Viewer3d", c.Viewer2d = "Viewer2d", c.BimTilesViewer = "BimTilesViewer", c))(at || {}), Et = /* @__PURE__ */ ((c) => (c.Perspective = "Perspective", c.Orthographic = "Orthographic", c))(Et || {});
|
|
27045
27070
|
const V0 = {
|
|
27046
27071
|
enableSpinner: !0,
|
|
27047
27072
|
containerId: "myCanvas"
|
|
@@ -27182,14 +27207,14 @@ function Ya(c, t, e, i, s = 1 / 0, n, r) {
|
|
|
27182
27207
|
i = Math.max(1e-4, i);
|
|
27183
27208
|
const a = 2 / i, o = a * n, l = 1 / (1 + o + 0.48 * o * o + 0.235 * o * o * o);
|
|
27184
27209
|
let h = t.x, d = t.y, u = t.z, f = c.x - h, m = c.y - d, b = c.z - u;
|
|
27185
|
-
const y = h, C = d, w = u, x = s * i,
|
|
27186
|
-
if (M >
|
|
27210
|
+
const y = h, C = d, w = u, x = s * i, S = x * x, M = f * f + m * m + b * b;
|
|
27211
|
+
if (M > S) {
|
|
27187
27212
|
const D = Math.sqrt(M);
|
|
27188
27213
|
f = f / D * x, m = m / D * x, b = b / D * x;
|
|
27189
27214
|
}
|
|
27190
27215
|
h = c.x - f, d = c.y - m, u = c.z - b;
|
|
27191
|
-
const O = (e.x + a * f) * n,
|
|
27192
|
-
e.x = (e.x - a * O) * l, e.y = (e.y - a *
|
|
27216
|
+
const O = (e.x + a * f) * n, E = (e.y + a * m) * n, v = (e.z + a * b) * n;
|
|
27217
|
+
e.x = (e.x - a * O) * l, e.y = (e.y - a * E) * l, e.z = (e.z - a * v) * l, r.x = h + (f + O) * l, r.y = d + (m + E) * l, r.z = u + (b + v) * l;
|
|
27193
27218
|
const T = y - c.x, _ = C - c.y, A = w - c.z, I = r.x - y, B = r.y - C, k = r.z - w;
|
|
27194
27219
|
return T * I + _ * B + A * k > 0 && (r.x = y, r.y = C, r.z = w, e.x = (r.x - y) / n, e.y = (r.y - C) / n, e.z = (r.z - w) / n), r;
|
|
27195
27220
|
}
|
|
@@ -27450,23 +27475,23 @@ class $ extends W1 {
|
|
|
27450
27475
|
right: 0,
|
|
27451
27476
|
top: 0,
|
|
27452
27477
|
bottom: 0
|
|
27453
|
-
}, 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,
|
|
27478
|
+
}, 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, S, M) => {
|
|
27454
27479
|
if (rt(this._camera)) {
|
|
27455
|
-
const O = Y.copy(this._camera.position).sub(this._target),
|
|
27480
|
+
const O = Y.copy(this._camera.position).sub(this._target), E = this._camera.getEffectiveFOV() * is, v = O.length() * Math.tan(E * 0.5), T = this.truckSpeed * x * v / this._elementRect.height, _ = this.truckSpeed * S * v / this._elementRect.height;
|
|
27456
27481
|
this.verticalDragToForward ? (M ? this.setFocalOffset(this._focalOffsetEnd.x + T, this._focalOffsetEnd.y, this._focalOffsetEnd.z, !0) : this.truck(T, 0, !0), this.forward(-_, !0)) : M ? this.setFocalOffset(this._focalOffsetEnd.x + T, this._focalOffsetEnd.y + _, this._focalOffsetEnd.z, !0) : this.truck(T, _, !0);
|
|
27457
27482
|
} else if (Ue(this._camera)) {
|
|
27458
|
-
const O = this._camera,
|
|
27459
|
-
M ? this.setFocalOffset(this._focalOffsetEnd.x +
|
|
27483
|
+
const O = this._camera, E = this.truckSpeed * x * (O.right - O.left) / O.zoom / this._elementRect.width, v = this.truckSpeed * S * (O.top - O.bottom) / O.zoom / this._elementRect.height;
|
|
27484
|
+
M ? this.setFocalOffset(this._focalOffsetEnd.x + E, this._focalOffsetEnd.y + v, this._focalOffsetEnd.z, !0) : this.truck(E, v, !0);
|
|
27460
27485
|
}
|
|
27461
|
-
}, this._rotateInternal = (x,
|
|
27462
|
-
const M = Mi * this.azimuthRotateSpeed * x / this._elementRect.height, O = Mi * this.polarRotateSpeed *
|
|
27486
|
+
}, this._rotateInternal = (x, S) => {
|
|
27487
|
+
const M = Mi * this.azimuthRotateSpeed * x / this._elementRect.height, O = Mi * this.polarRotateSpeed * S / this._elementRect.height;
|
|
27463
27488
|
this.rotate(M, O, !0);
|
|
27464
|
-
}, this._dollyInternal = (x,
|
|
27465
|
-
const O = Math.pow(0.95, -x * this.dollySpeed),
|
|
27466
|
-
this.dollyTo(
|
|
27467
|
-
}, this._zoomInternal = (x,
|
|
27468
|
-
const O = Math.pow(0.95, x * this.dollySpeed),
|
|
27469
|
-
this.zoomTo(this._zoom * O), this.dollyToCursor && (this._dollyControlAmount += this._zoomEnd -
|
|
27489
|
+
}, this._dollyInternal = (x, S, M) => {
|
|
27490
|
+
const O = Math.pow(0.95, -x * this.dollySpeed), E = this._sphericalEnd.radius * O, v = this._sphericalEnd.radius, T = v * (x >= 0 ? -1 : 1);
|
|
27491
|
+
this.dollyTo(E), this.infinityDolly && (E < this.minDistance || this.maxDistance === this.minDistance) && (this._camera.getWorldDirection(Y), this._targetEnd.add(Y.normalize().multiplyScalar(T)), this._target.add(Y.normalize().multiplyScalar(T))), this.dollyToCursor && (this._dollyControlAmount += this._sphericalEnd.radius - v, this.infinityDolly && (E < this.minDistance || this.maxDistance === this.minDistance) && (this._dollyControlAmount -= T), this._dollyControlCoord.set(S, M));
|
|
27492
|
+
}, this._zoomInternal = (x, S, M) => {
|
|
27493
|
+
const O = Math.pow(0.95, x * this.dollySpeed), E = this._zoomEnd;
|
|
27494
|
+
this.zoomTo(this._zoom * O), this.dollyToCursor && (this._dollyControlAmount += this._zoomEnd - E, this._dollyControlCoord.set(S, M));
|
|
27470
27495
|
}, 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 = {
|
|
27471
27496
|
left: L.ROTATE,
|
|
27472
27497
|
middle: L.DOLLY,
|
|
@@ -27479,9 +27504,9 @@ class $ extends W1 {
|
|
|
27479
27504
|
};
|
|
27480
27505
|
const s = new W.Vector2(), n = new W.Vector2(), r = new W.Vector2(), a = (x) => {
|
|
27481
27506
|
if (!this._enabled || !this._domElement) return;
|
|
27482
|
-
const
|
|
27483
|
-
if (
|
|
27484
|
-
const O = this._findPointerByMouseButton(
|
|
27507
|
+
const S = x.pointerType !== "mouse" ? null : (x.buttons & q.LEFT) === q.LEFT ? q.LEFT : (x.buttons & q.MIDDLE) === q.MIDDLE ? q.MIDDLE : (x.buttons & q.RIGHT) === q.RIGHT ? q.RIGHT : null;
|
|
27508
|
+
if (S !== null) {
|
|
27509
|
+
const O = this._findPointerByMouseButton(S);
|
|
27485
27510
|
O && this._activePointers.splice(this._activePointers.indexOf(O), 1);
|
|
27486
27511
|
}
|
|
27487
27512
|
const M = {
|
|
@@ -27490,14 +27515,14 @@ class $ extends W1 {
|
|
|
27490
27515
|
clientY: x.clientY,
|
|
27491
27516
|
deltaX: 0,
|
|
27492
27517
|
deltaY: 0,
|
|
27493
|
-
mouseButton:
|
|
27518
|
+
mouseButton: S
|
|
27494
27519
|
};
|
|
27495
27520
|
this._activePointers.push(M), this._domElement.removeEventListener("pointermove", l), this._domElement.removeEventListener("pointerup", d), this._domElement.addEventListener("pointermove", l), this._domElement.addEventListener("pointerup", d), y(x);
|
|
27496
27521
|
}, o = (x) => {
|
|
27497
27522
|
if (!this._enabled || !this._domElement) return;
|
|
27498
|
-
const
|
|
27499
|
-
if (
|
|
27500
|
-
const O = this._findPointerByMouseButton(
|
|
27523
|
+
const S = (x.buttons & q.LEFT) === q.LEFT ? q.LEFT : (x.buttons & q.MIDDLE) === q.MIDDLE ? q.MIDDLE : (x.buttons & q.RIGHT) === q.RIGHT ? q.RIGHT : null;
|
|
27524
|
+
if (S !== null) {
|
|
27525
|
+
const O = this._findPointerByMouseButton(S);
|
|
27501
27526
|
O && this._activePointers.splice(this._activePointers.indexOf(O), 1);
|
|
27502
27527
|
}
|
|
27503
27528
|
const M = {
|
|
@@ -27510,7 +27535,7 @@ class $ extends W1 {
|
|
|
27510
27535
|
};
|
|
27511
27536
|
this._activePointers.push(M), this._domElement.removeEventListener("mousemove", h), this._domElement.removeEventListener("mouseup", u), this._domElement.addEventListener("mousemove", h), this._domElement.addEventListener("mouseup", u), y(x);
|
|
27512
27537
|
}, l = (x) => {
|
|
27513
|
-
const
|
|
27538
|
+
const S = x.pointerId, M = this._findPointerById(S);
|
|
27514
27539
|
if (M) {
|
|
27515
27540
|
if (M.clientX = x.clientX, M.clientY = x.clientY, M.deltaX = x.movementX, M.deltaY = x.movementY, x.pointerType === "touch")
|
|
27516
27541
|
switch (this._activePointers.length) {
|
|
@@ -27529,10 +27554,10 @@ class $ extends W1 {
|
|
|
27529
27554
|
C();
|
|
27530
27555
|
}
|
|
27531
27556
|
}, h = (x) => {
|
|
27532
|
-
const
|
|
27533
|
-
|
|
27557
|
+
const S = this._findPointerById(0);
|
|
27558
|
+
S && (S.clientX = x.clientX, S.clientY = x.clientY, S.deltaX = x.movementX, S.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), C());
|
|
27534
27559
|
}, d = (x) => {
|
|
27535
|
-
const
|
|
27560
|
+
const S = x.pointerId, M = this._findPointerById(S);
|
|
27536
27561
|
if (M && this._activePointers.splice(this._activePointers.indexOf(M), 1), x.pointerType === "touch")
|
|
27537
27562
|
switch (this._activePointers.length) {
|
|
27538
27563
|
case 0:
|
|
@@ -27562,7 +27587,7 @@ class $ extends W1 {
|
|
|
27562
27587
|
const v = performance.now();
|
|
27563
27588
|
f - v < 1e3 && this._getClientRect(this._elementRect), f = v;
|
|
27564
27589
|
}
|
|
27565
|
-
const
|
|
27590
|
+
const S = q1 ? -1 : -3, M = x.deltaMode === 1 ? x.deltaY / S : x.deltaY / (S * 10), O = this.dollyToCursor ? (x.clientX - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, E = this.dollyToCursor ? (x.clientY - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
|
|
27566
27591
|
switch (this.mouseButtons.wheel) {
|
|
27567
27592
|
case L.ROTATE: {
|
|
27568
27593
|
this._rotateInternal(x.deltaX, x.deltaY), this._isUserControllingRotate = !0;
|
|
@@ -27577,26 +27602,26 @@ class $ extends W1 {
|
|
|
27577
27602
|
break;
|
|
27578
27603
|
}
|
|
27579
27604
|
case L.DOLLY: {
|
|
27580
|
-
this._dollyInternal(-M, O,
|
|
27605
|
+
this._dollyInternal(-M, O, E), this._isUserControllingDolly = !0;
|
|
27581
27606
|
break;
|
|
27582
27607
|
}
|
|
27583
27608
|
case L.ZOOM: {
|
|
27584
|
-
this._zoomInternal(-M, O,
|
|
27609
|
+
this._zoomInternal(-M, O, E), this._isUserControllingZoom = !0;
|
|
27585
27610
|
break;
|
|
27586
27611
|
}
|
|
27587
27612
|
}
|
|
27588
27613
|
this.dispatchEvent({ type: "control" });
|
|
27589
27614
|
}, b = (x) => {
|
|
27590
27615
|
if (!(!this._domElement || !this._enabled) && this.mouseButtons.right === $.ACTION.NONE) {
|
|
27591
|
-
const
|
|
27616
|
+
const S = x instanceof PointerEvent ? x.pointerId : (x instanceof MouseEvent, 0), M = this._findPointerById(S);
|
|
27592
27617
|
M && this._activePointers.splice(this._activePointers.indexOf(M), 1), this._domElement.removeEventListener("pointermove", l), this._domElement.removeEventListener("pointerup", d), this._domElement.removeEventListener("mousemove", h), this._domElement.removeEventListener("mouseup", u);
|
|
27593
27618
|
return;
|
|
27594
27619
|
}
|
|
27595
27620
|
}, y = (x) => {
|
|
27596
27621
|
if (!this._enabled) return;
|
|
27597
27622
|
if (Jn(this._activePointers, Ve), this._getClientRect(this._elementRect), s.copy(Ve), n.copy(Ve), this._activePointers.length >= 2) {
|
|
27598
|
-
const M = Ve.x - this._activePointers[1].clientX, O = Ve.y - this._activePointers[1].clientY,
|
|
27599
|
-
r.set(0,
|
|
27623
|
+
const M = Ve.x - this._activePointers[1].clientX, O = Ve.y - this._activePointers[1].clientY, E = Math.sqrt(M * M + O * O);
|
|
27624
|
+
r.set(0, E);
|
|
27600
27625
|
const v = (this._activePointers[0].clientX + this._activePointers[1].clientX) * 0.5, T = (this._activePointers[0].clientY + this._activePointers[1].clientY) * 0.5;
|
|
27601
27626
|
n.set(v, T);
|
|
27602
27627
|
}
|
|
@@ -27618,18 +27643,18 @@ class $ extends W1 {
|
|
|
27618
27643
|
}, C = () => {
|
|
27619
27644
|
if (!this._enabled) return;
|
|
27620
27645
|
Jn(this._activePointers, Ve);
|
|
27621
|
-
const x = Le.isBrowser ? this._domElement && document.pointerLockElement === this._domElement : !1,
|
|
27622
|
-
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(
|
|
27623
|
-
const O = this.dollyToCursor ? (s.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0,
|
|
27624
|
-
(this._state & L.DOLLY) === L.DOLLY ? (this._dollyInternal(M * qs, O,
|
|
27646
|
+
const x = Le.isBrowser ? this._domElement && document.pointerLockElement === this._domElement : !1, S = x ? -this._activePointers[0].deltaX : n.x - Ve.x, M = x ? -this._activePointers[0].deltaY : n.y - Ve.y;
|
|
27647
|
+
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(S, M), this._isUserControllingRotate = !0), (this._state & L.DOLLY) === L.DOLLY || (this._state & L.ZOOM) === L.ZOOM) {
|
|
27648
|
+
const O = this.dollyToCursor ? (s.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, E = this.dollyToCursor ? (s.y - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
|
|
27649
|
+
(this._state & L.DOLLY) === L.DOLLY ? (this._dollyInternal(M * qs, O, E), this._isUserControllingDolly = !0) : (this._zoomInternal(M * qs, O, E), this._isUserControllingZoom = !0);
|
|
27625
27650
|
}
|
|
27626
27651
|
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) {
|
|
27627
|
-
const O = Ve.x - this._activePointers[1].clientX,
|
|
27652
|
+
const O = Ve.x - this._activePointers[1].clientX, E = Ve.y - this._activePointers[1].clientY, v = Math.sqrt(O * O + E * E), T = r.y - v;
|
|
27628
27653
|
r.set(0, v);
|
|
27629
27654
|
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;
|
|
27630
27655
|
(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(T * qs, _, A), this._isUserControllingDolly = !0) : (this._zoomInternal(T * qs, _, A), this._isUserControllingZoom = !0);
|
|
27631
27656
|
}
|
|
27632
|
-
((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(
|
|
27657
|
+
((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(S, 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(S, M, !0), this._isUserControllingOffset = !0), this.dispatchEvent({ type: "control" });
|
|
27633
27658
|
}, w = () => {
|
|
27634
27659
|
Jn(this._activePointers, Ve), n.copy(Ve), this._activePointers.length === 0 && this._domElement && (this._domElement.removeEventListener("pointermove", l), this._domElement.removeEventListener("mousemove", h), this._domElement.removeEventListener("pointerup", d), this._domElement.removeEventListener("mouseup", u), this.dispatchEvent({ type: "controlend" }));
|
|
27635
27660
|
};
|
|
@@ -28037,7 +28062,7 @@ class $ extends W1 {
|
|
|
28037
28062
|
const x = this.getDistanceToFitBox(C.x, C.y, C.z, s);
|
|
28038
28063
|
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));
|
|
28039
28064
|
} else if (Ue(this._camera)) {
|
|
28040
|
-
const x = this._camera,
|
|
28065
|
+
const x = this._camera, S = x.right - x.left, M = x.top - x.bottom, O = s ? Math.max(S / C.x, M / C.y) : Math.min(S / C.x, M / C.y);
|
|
28041
28066
|
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));
|
|
28042
28067
|
}
|
|
28043
28068
|
return Promise.all(l);
|
|
@@ -28101,14 +28126,14 @@ class $ extends W1 {
|
|
|
28101
28126
|
it.setFromVector3(C.sub(y).applyQuaternion(this._yAxisUpSpace));
|
|
28102
28127
|
const w = Ti.set(d, u, f), x = te.set(o, l, h);
|
|
28103
28128
|
rs.setFromVector3(x.sub(w).applyQuaternion(this._yAxisUpSpace)), this._targetEnd.copy(y.lerp(w, m));
|
|
28104
|
-
const
|
|
28129
|
+
const S = rs.theta - it.theta, M = rs.phi - it.phi, O = rs.radius - it.radius;
|
|
28105
28130
|
this._sphericalEnd.set(
|
|
28106
28131
|
it.radius + O * m,
|
|
28107
28132
|
it.phi + M * m,
|
|
28108
|
-
it.theta +
|
|
28133
|
+
it.theta + S * m
|
|
28109
28134
|
), this.normalizeRotations(), this._needsUpdate = !0, b || (this._target.copy(this._targetEnd), this._spherical.copy(this._sphericalEnd));
|
|
28110
|
-
const
|
|
28111
|
-
return this._createOnRestPromise(
|
|
28135
|
+
const E = !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);
|
|
28136
|
+
return this._createOnRestPromise(E);
|
|
28112
28137
|
}
|
|
28113
28138
|
/**
|
|
28114
28139
|
* Set angle and distance by given position.
|
|
@@ -28324,7 +28349,7 @@ class $ extends W1 {
|
|
|
28324
28349
|
(u.near + u.far) / (u.near - u.far)
|
|
28325
28350
|
).unproject(u), m = te.set(0, 0, -1).applyQuaternion(u.quaternion), b = Ti.copy(f).add(m.multiplyScalar(-f.dot(u.up))), C = -(this._zoom - this._dollyControlAmount - this._zoomEnd) / this._zoom, w = Y.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).normalize().negate(), x = this._targetEnd.dot(w);
|
|
28326
28351
|
this._targetEnd.lerp(b, C);
|
|
28327
|
-
const
|
|
28352
|
+
const S = this._targetEnd.dot(w), M = w.multiplyScalar(S - x);
|
|
28328
28353
|
this._targetEnd.sub(M);
|
|
28329
28354
|
}
|
|
28330
28355
|
this._target.copy(this._targetEnd), this._boundary.clampPoint(this._targetEnd, this._targetEnd), this._dollyControlAmount = 0;
|
|
@@ -28496,12 +28521,12 @@ class $ extends W1 {
|
|
|
28496
28521
|
}), s.radius = Math.sqrt(r), s;
|
|
28497
28522
|
}
|
|
28498
28523
|
}
|
|
28499
|
-
var
|
|
28524
|
+
var xt = /* @__PURE__ */ ((c) => (c[c.Orbit = 0] = "Orbit", c[c.FirstPerson = 1] = "FirstPerson", c[c.Plan = 2] = "Plan", c))(xt || {});
|
|
28500
28525
|
class X1 {
|
|
28501
28526
|
constructor(t) {
|
|
28502
28527
|
g(this, "mode");
|
|
28503
28528
|
g(this, "cameraManager");
|
|
28504
|
-
this.mode =
|
|
28529
|
+
this.mode = xt.Orbit, this.cameraManager = t;
|
|
28505
28530
|
}
|
|
28506
28531
|
setupControl() {
|
|
28507
28532
|
const t = this.cameraManager.camera, e = this.cameraManager.cameraControls;
|
|
@@ -28527,7 +28552,7 @@ class Z1 {
|
|
|
28527
28552
|
constructor(t) {
|
|
28528
28553
|
g(this, "mode");
|
|
28529
28554
|
g(this, "cameraManager");
|
|
28530
|
-
this.mode =
|
|
28555
|
+
this.mode = xt.Plan, this.cameraManager = t;
|
|
28531
28556
|
}
|
|
28532
28557
|
setupControl() {
|
|
28533
28558
|
const t = this.cameraManager.camera, e = this.cameraManager.cameraControls;
|
|
@@ -28574,7 +28599,7 @@ class K1 {
|
|
|
28574
28599
|
g(this, "anchor");
|
|
28575
28600
|
g(this, "onKeyDown");
|
|
28576
28601
|
g(this, "onChange");
|
|
28577
|
-
this.previousDistance = -1, this.previousAzimuthRotateSpeed = 1, this.previousPolarRotateSpeed = 1, this.previousDollySpeed = 1, this.previousTruckSpeed = 2, this.previousMouseLeft = $.ACTION.NONE, this.enableKeyDown = !0, this.projection =
|
|
28602
|
+
this.previousDistance = -1, this.previousAzimuthRotateSpeed = 1, this.previousPolarRotateSpeed = 1, this.previousDollySpeed = 1, this.previousTruckSpeed = 2, this.previousMouseLeft = $.ACTION.NONE, this.enableKeyDown = !0, this.projection = Et.Perspective, this.onKeyDown = (s) => {
|
|
28578
28603
|
if (!this.enableKeyDown) return;
|
|
28579
28604
|
const n = this.cameraControls, r = this.viewer.getPixelSizeInWorldCoord() * 10, a = this.viewer.name === at.Viewer3d || this.viewer.name === at.BimTilesViewer;
|
|
28580
28605
|
switch (s.code) {
|
|
@@ -28629,9 +28654,9 @@ class K1 {
|
|
|
28629
28654
|
this.perspectiveCamera,
|
|
28630
28655
|
t.getInputManager()
|
|
28631
28656
|
), this.controlsMap = {
|
|
28632
|
-
[
|
|
28633
|
-
[
|
|
28634
|
-
}, this.activeControls = this.controlsMap[
|
|
28657
|
+
[xt.Orbit]: new X1(this),
|
|
28658
|
+
[xt.Plan]: new Z1(this)
|
|
28659
|
+
}, this.activeControls = this.controlsMap[xt.Orbit], this.setupControls(), this.setProjection(Et.Perspective), this.anchor = this.createAnchor();
|
|
28635
28660
|
}
|
|
28636
28661
|
get viewerContainer() {
|
|
28637
28662
|
return this.viewer.viewerContainer;
|
|
@@ -28643,7 +28668,7 @@ class K1 {
|
|
|
28643
28668
|
const t = document.createElement("div");
|
|
28644
28669
|
return t.className = "anchor", this.viewerContainer?.appendChild(t), this.cameraControls.addEventListener("control", () => {
|
|
28645
28670
|
if (this.isOrbitPointVisible()) {
|
|
28646
|
-
const e = this.getTarget(), i =
|
|
28671
|
+
const e = this.getTarget(), i = Ae.world2Screen(e, this.activeCamera, this.viewerContainer);
|
|
28647
28672
|
this.setAnchorPosition(i.x, i.y);
|
|
28648
28673
|
}
|
|
28649
28674
|
}), t;
|
|
@@ -28676,10 +28701,10 @@ class K1 {
|
|
|
28676
28701
|
);
|
|
28677
28702
|
}
|
|
28678
28703
|
setOrthoCamera() {
|
|
28679
|
-
if (this.activeControls.mode ===
|
|
28704
|
+
if (this.activeControls.mode === xt.FirstPerson) return;
|
|
28680
28705
|
this.previousDistance = this.cameraControls.distance, this.cameraControls.distance = 200;
|
|
28681
28706
|
const { width: t, height: e } = this.getDims();
|
|
28682
|
-
this.setupOrthoCamera(e, t), this.activeCamera = this.orthographicCamera, this.projection =
|
|
28707
|
+
this.setupOrthoCamera(e, t), this.activeCamera = this.orthographicCamera, this.projection = Et.Orthographic;
|
|
28683
28708
|
}
|
|
28684
28709
|
getDims() {
|
|
28685
28710
|
const t = new p.Vector3();
|
|
@@ -28701,7 +28726,7 @@ class K1 {
|
|
|
28701
28726
|
const t = this.cameraControls;
|
|
28702
28727
|
t.mouseButtons.wheel = $.ACTION.DOLLY;
|
|
28703
28728
|
const e = this.perspectiveCamera, i = this.orthographicCamera;
|
|
28704
|
-
e.position.copy(i.position), e.quaternion.copy(i.quaternion), e.updateProjectionMatrix(), t.camera = e, t.mouseButtons.wheel = $.ACTION.DOLLY, this.activeCamera = e, this.projection =
|
|
28729
|
+
e.position.copy(i.position), e.quaternion.copy(i.quaternion), e.updateProjectionMatrix(), t.camera = e, t.mouseButtons.wheel = $.ACTION.DOLLY, this.activeCamera = e, this.projection = Et.Perspective, t.distance = this.previousDistance, t.zoomTo(1);
|
|
28705
28730
|
}
|
|
28706
28731
|
update(t) {
|
|
28707
28732
|
const e = this.cameraControls.update(t);
|
|
@@ -28805,7 +28830,7 @@ class K1 {
|
|
|
28805
28830
|
return this.projection;
|
|
28806
28831
|
}
|
|
28807
28832
|
setProjection(t) {
|
|
28808
|
-
this.projection !== t && (this.projection = t, t ===
|
|
28833
|
+
this.projection !== t && (this.projection = t, t === Et.Orthographic ? this.setOrthoCamera() : this.setPerspectiveCamera());
|
|
28809
28834
|
}
|
|
28810
28835
|
setOrbitPoint(t) {
|
|
28811
28836
|
this.cameraControls.setOrbitPoint(t.x, t.y, t.z);
|
|
@@ -29289,7 +29314,7 @@ class xs extends p.Shape {
|
|
|
29289
29314
|
return r.userData = { advanceWidth: this.width }, r.setAttribute("position", new p.Float32BufferAttribute(i, 3)), r.setIndex(s), r;
|
|
29290
29315
|
}
|
|
29291
29316
|
}
|
|
29292
|
-
const
|
|
29317
|
+
const gt = class gt {
|
|
29293
29318
|
static parserHeader(t, e) {
|
|
29294
29319
|
let i = "", s = !1, n = 0;
|
|
29295
29320
|
const r = !0;
|
|
@@ -29385,14 +29410,14 @@ const mt = class mt {
|
|
|
29385
29410
|
let m = u & 7;
|
|
29386
29411
|
m == 0 && (m = 8);
|
|
29387
29412
|
const b = Math.PI / 4;
|
|
29388
|
-
let y = b * m, C =
|
|
29413
|
+
let y = b * m, C = gt.CIRCLE_SPAN;
|
|
29389
29414
|
u < 0 && (C = -C, y = -y);
|
|
29390
|
-
const w = b * f, x = w + y,
|
|
29391
|
-
if (s =
|
|
29415
|
+
const w = b * f, x = w + y, S = s.clone().sub(new p.Vector2(Math.cos(w) * d, Math.sin(w) * d));
|
|
29416
|
+
if (s = S.clone().add(new p.Vector2(Math.cos(x) * d, Math.sin(x) * d)), o) {
|
|
29392
29417
|
let M = w;
|
|
29393
29418
|
const O = !0;
|
|
29394
29419
|
for (; O && (M += C, !!Number.isFinite(M)); )
|
|
29395
|
-
if (u >= 0 && M < x || u < 0 && M > x) r.push(
|
|
29420
|
+
if (u >= 0 && M < x || u < 0 && M > x) r.push(S.clone().add(new p.Vector2(d * Math.cos(M), d * Math.sin(M))));
|
|
29396
29421
|
else break;
|
|
29397
29422
|
r.push(s.clone());
|
|
29398
29423
|
}
|
|
@@ -29404,13 +29429,13 @@ const mt = class mt {
|
|
|
29404
29429
|
let w = y & 7;
|
|
29405
29430
|
w == 0 && (w = 8), u != 0 && w--;
|
|
29406
29431
|
const x = Math.PI / 4;
|
|
29407
|
-
let
|
|
29408
|
-
y < 0 && (M = -M,
|
|
29409
|
-
let
|
|
29410
|
-
|
|
29411
|
-
const T = s.clone().sub(new p.Vector2(b * Math.cos(
|
|
29432
|
+
let S = x * w, M = gt.CIRCLE_SPAN, O = 1;
|
|
29433
|
+
y < 0 && (M = -M, S = -S, O = -1);
|
|
29434
|
+
let E = x * C, v = E + S;
|
|
29435
|
+
E += x * d / 256 * O, v += x * u / 256 * O;
|
|
29436
|
+
const T = s.clone().sub(new p.Vector2(b * Math.cos(E), b * Math.sin(E)));
|
|
29412
29437
|
if (s = T.clone().add(new p.Vector2(b * Math.cos(v), b * Math.sin(v))), o) {
|
|
29413
|
-
let _ =
|
|
29438
|
+
let _ = E;
|
|
29414
29439
|
const A = !0;
|
|
29415
29440
|
for (; A && (_ += M, !!Number.isFinite(_)); )
|
|
29416
29441
|
if (y > 0 && _ < v || y < 0 && _ > v) r.push(T.clone().add(new p.Vector2(b * Math.cos(_), b * Math.sin(_))));
|
|
@@ -29424,7 +29449,7 @@ const mt = class mt {
|
|
|
29424
29449
|
const d = new p.Vector2();
|
|
29425
29450
|
d.x = J.byteTosbyte(e[++l]) * i, d.y = J.byteTosbyte(e[++l]) * i;
|
|
29426
29451
|
let u = J.byteTosbyte(e[++l]);
|
|
29427
|
-
u < -127 && (u = -127), o && (u == 0 ? r.push(s.clone().add(d)) : r.push(
|
|
29452
|
+
u < -127 && (u = -127), o && (u == 0 ? r.push(s.clone().add(d)) : r.push(gt.generateArcPoints(s, d, u / 127))), s.add(d);
|
|
29428
29453
|
}
|
|
29429
29454
|
break;
|
|
29430
29455
|
case 13:
|
|
@@ -29432,11 +29457,11 @@ const mt = class mt {
|
|
|
29432
29457
|
const u = new p.Vector2();
|
|
29433
29458
|
if (u.x = J.byteTosbyte(e[++l]) * i, u.y = J.byteTosbyte(e[++l]) * i, !Number.isFinite(u.x) || !Number.isFinite(u.y) || u.x == 0 && u.y == 0) break;
|
|
29434
29459
|
let f = J.byteTosbyte(e[++l]);
|
|
29435
|
-
f < -127 && (f = -127), o && (f == 0 ? r.push(s.clone().add(u)) : r.push(
|
|
29460
|
+
f < -127 && (f = -127), o && (f == 0 ? r.push(s.clone().add(u)) : r.push(gt.generateArcPoints(s.clone(), u, f / 127))), s.add(u);
|
|
29436
29461
|
}
|
|
29437
29462
|
break;
|
|
29438
29463
|
case 14:
|
|
29439
|
-
l =
|
|
29464
|
+
l = gt.skipCode(t, e, ++l);
|
|
29440
29465
|
break;
|
|
29441
29466
|
default:
|
|
29442
29467
|
if (h > 15) {
|
|
@@ -29565,7 +29590,7 @@ const mt = class mt {
|
|
|
29565
29590
|
const f = t.sub(u), m = s.sub(u);
|
|
29566
29591
|
let b = Math.atan2(f.y, f.x);
|
|
29567
29592
|
const y = Math.atan2(m.y, m.x);
|
|
29568
|
-
let C =
|
|
29593
|
+
let C = gt.CIRCLE_SPAN;
|
|
29569
29594
|
n ? (C = -C, b < y && (b += 2 * Math.PI)) : b > y && (b -= 2 * Math.PI);
|
|
29570
29595
|
let w = b;
|
|
29571
29596
|
const x = !0;
|
|
@@ -29576,9 +29601,9 @@ const mt = class mt {
|
|
|
29576
29601
|
return s;
|
|
29577
29602
|
}
|
|
29578
29603
|
};
|
|
29579
|
-
g(
|
|
29580
|
-
`, ""]), g(
|
|
29581
|
-
let
|
|
29604
|
+
g(gt, "FILE_STOP_FLAG", ["\r", `
|
|
29605
|
+
`, ""]), g(gt, "CIRCLE_SPAN", Math.PI / 18);
|
|
29606
|
+
let Ft = gt;
|
|
29582
29607
|
const rr = {
|
|
29583
29608
|
130: [
|
|
29584
29609
|
[
|
|
@@ -30280,7 +30305,7 @@ const rr = {
|
|
|
30280
30305
|
g(this, "textShapesCache");
|
|
30281
30306
|
g(this, "graphicData");
|
|
30282
30307
|
if (this.isExtend = !1, this.isUniCode = !0, this.isEmbedded = !1, this.fontType = je.Unifont, this.textShapesCache = /* @__PURE__ */ new Map(), this.graphicData = /* @__PURE__ */ new Map(), i instanceof ArrayBuffer) {
|
|
30283
|
-
const s = new wn(i), n =
|
|
30308
|
+
const s = new wn(i), n = Ft.parserHeader(s, Ft.FILE_STOP_FLAG), r = n.split(" ");
|
|
30284
30309
|
switch (r[1]) {
|
|
30285
30310
|
case "shapes":
|
|
30286
30311
|
this.parseShapeFont(s), this.fontType = je.Shapes;
|
|
@@ -30317,7 +30342,7 @@ const rr = {
|
|
|
30317
30342
|
* Gets TextShape by a char
|
|
30318
30343
|
*/
|
|
30319
30344
|
getCharShape(e, i) {
|
|
30320
|
-
let s =
|
|
30345
|
+
let s = Ft.getCode(e);
|
|
30321
30346
|
s === 0 && (s = e.charCodeAt(0));
|
|
30322
30347
|
const n = this.getGraphicDataByCode(s, i);
|
|
30323
30348
|
if (!n)
|
|
@@ -30340,7 +30365,7 @@ const rr = {
|
|
|
30340
30365
|
if (!this.graphicData.has(e)) {
|
|
30341
30366
|
if (n[e]) {
|
|
30342
30367
|
const a = n[e], o = fs.DEFAULT_SIZE / this.baseUp;
|
|
30343
|
-
r =
|
|
30368
|
+
r = Ft.parserCode(this, a, o), this.graphicData.set(e, r);
|
|
30344
30369
|
} else if (rr[e]) {
|
|
30345
30370
|
const a = [];
|
|
30346
30371
|
for (let o = 0; o < rr[e].length; o++)
|
|
@@ -30417,7 +30442,7 @@ const rr = {
|
|
|
30417
30442
|
*/
|
|
30418
30443
|
getNotFoundTextShape(e) {
|
|
30419
30444
|
let i = 0;
|
|
30420
|
-
return this.fontType === je.Bigfont && (i =
|
|
30445
|
+
return this.fontType === je.Bigfont && (i = Ft.getCode("?")), this.fontType === je.Unifont && (i = Ft.getCode("?")), this.getGraphicDataByCode(i, e);
|
|
30421
30446
|
}
|
|
30422
30447
|
getFontFile() {
|
|
30423
30448
|
return {
|
|
@@ -30441,7 +30466,7 @@ const rr = {
|
|
|
30441
30466
|
}
|
|
30442
30467
|
};
|
|
30443
30468
|
g(fs, "DEFAULT_SIZE", 12);
|
|
30444
|
-
let
|
|
30469
|
+
let mt = fs;
|
|
30445
30470
|
function Q1(c) {
|
|
30446
30471
|
let t, e, i, s, n;
|
|
30447
30472
|
t = "";
|
|
@@ -30468,7 +30493,7 @@ function Q1(c) {
|
|
|
30468
30493
|
}
|
|
30469
30494
|
return t;
|
|
30470
30495
|
}
|
|
30471
|
-
class
|
|
30496
|
+
class Ct {
|
|
30472
30497
|
constructor() {
|
|
30473
30498
|
g(this, "loader");
|
|
30474
30499
|
g(this, "fontMap");
|
|
@@ -30488,11 +30513,11 @@ class Tt {
|
|
|
30488
30513
|
* @example font-family: Helvetica, Tahoma, Arial, "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
|
|
30489
30514
|
*/
|
|
30490
30515
|
async loadFonts(t) {
|
|
30491
|
-
if (t = Array.isArray(t) ? t : [t], this.fileNames = t.map((e) => typeof e == "object" ? Object.keys(e)[0] :
|
|
30516
|
+
if (t = Array.isArray(t) ? t : [t], this.fileNames = t.map((e) => typeof e == "object" ? Object.keys(e)[0] : Ct.getFileName(e.toLowerCase())), !await this.checkAllFontsLoaded(t)) {
|
|
30492
30517
|
for (let e = 0; e < t.length; e++) {
|
|
30493
30518
|
const i = t[e];
|
|
30494
30519
|
let s = null, n = [], r = [];
|
|
30495
|
-
typeof i == "object" ? (n = Object.keys(i), r = Object.values(i), s = n[0]) : s =
|
|
30520
|
+
typeof i == "object" ? (n = Object.keys(i), r = Object.values(i), s = n[0]) : s = Ct.getFileName(i.toLowerCase());
|
|
30496
30521
|
let a;
|
|
30497
30522
|
if (n.length) {
|
|
30498
30523
|
const o = n[0];
|
|
@@ -30507,7 +30532,7 @@ class Tt {
|
|
|
30507
30532
|
} else if (o.lastIndexOf(".shx") > -1) {
|
|
30508
30533
|
this.loader.setResponseType("arraybuffer");
|
|
30509
30534
|
const l = await this.loader.loadAsync(r[0]);
|
|
30510
|
-
a = new
|
|
30535
|
+
a = new mt(
|
|
30511
30536
|
s,
|
|
30512
30537
|
l
|
|
30513
30538
|
/* 类型桥接:同上 */
|
|
@@ -30521,7 +30546,7 @@ class Tt {
|
|
|
30521
30546
|
/* 类型桥接:loadAsync 返回 string|ArrayBuffer */
|
|
30522
30547
|
);
|
|
30523
30548
|
}
|
|
30524
|
-
} else if (
|
|
30549
|
+
} else if (Ct.isJsonFile(i)) {
|
|
30525
30550
|
this.loader.setResponseType("json");
|
|
30526
30551
|
const o = await this.loader.loadAsync(i);
|
|
30527
30552
|
a = new Qt(
|
|
@@ -30529,15 +30554,15 @@ class Tt {
|
|
|
30529
30554
|
o
|
|
30530
30555
|
/* 类型桥接:loadAsync 返回 string|ArrayBuffer */
|
|
30531
30556
|
);
|
|
30532
|
-
} else if (
|
|
30557
|
+
} else if (Ct.isShxFile(i)) {
|
|
30533
30558
|
this.loader.setResponseType("arraybuffer");
|
|
30534
30559
|
const o = await this.loader.loadAsync(i);
|
|
30535
|
-
a = new
|
|
30560
|
+
a = new mt(
|
|
30536
30561
|
s,
|
|
30537
30562
|
o
|
|
30538
30563
|
/* 类型桥接:同上 */
|
|
30539
30564
|
);
|
|
30540
|
-
} else if (
|
|
30565
|
+
} else if (Ct.isTtfFile(i)) {
|
|
30541
30566
|
this.loader.setResponseType("arraybuffer");
|
|
30542
30567
|
const o = await this.loader.loadAsync(i);
|
|
30543
30568
|
a = new Qt(
|
|
@@ -30582,29 +30607,34 @@ class Tt {
|
|
|
30582
30607
|
return;
|
|
30583
30608
|
}
|
|
30584
30609
|
e == null && (e = "");
|
|
30585
|
-
|
|
30586
|
-
|
|
30610
|
+
const s = t.charCodeAt(0) > 255, n = (o) => {
|
|
30611
|
+
const l = o.getCharShape(t, i);
|
|
30612
|
+
if (l && !(s && o instanceof mt && l.width < i * 0.5))
|
|
30613
|
+
return l;
|
|
30614
|
+
};
|
|
30615
|
+
let r = this.fontMap.get(e.toLowerCase());
|
|
30616
|
+
if (!r) {
|
|
30587
30617
|
!this.missingFonts[e] && (this.missingFonts[e] = 0), this.missingFonts[e]++;
|
|
30588
|
-
for (const [,
|
|
30589
|
-
if (
|
|
30590
|
-
|
|
30618
|
+
for (const [, o] of this.fontMap)
|
|
30619
|
+
if (n(o)) {
|
|
30620
|
+
r = o;
|
|
30591
30621
|
break;
|
|
30592
30622
|
}
|
|
30593
30623
|
}
|
|
30594
|
-
let
|
|
30595
|
-
if (!
|
|
30596
|
-
for (const [,
|
|
30597
|
-
if (
|
|
30598
|
-
const
|
|
30599
|
-
if (
|
|
30600
|
-
|
|
30624
|
+
let a = r?.getCharShape(t, i);
|
|
30625
|
+
if (a && s && r instanceof mt && a.width < i * 0.5 && (a = void 0), !a)
|
|
30626
|
+
for (const [, o] of this.fontMap) {
|
|
30627
|
+
if (o === r) continue;
|
|
30628
|
+
const l = n(o);
|
|
30629
|
+
if (l) {
|
|
30630
|
+
r = o, a = l;
|
|
30601
30631
|
break;
|
|
30602
30632
|
}
|
|
30603
30633
|
}
|
|
30604
|
-
if (
|
|
30605
|
-
if (
|
|
30606
|
-
if (
|
|
30607
|
-
font:
|
|
30634
|
+
if (a) {
|
|
30635
|
+
if (r instanceof mt) return a.toThreeGeometry();
|
|
30636
|
+
if (r instanceof Qt) return new Pl(t, {
|
|
30637
|
+
font: r,
|
|
30608
30638
|
depth: 0,
|
|
30609
30639
|
size: i || 12,
|
|
30610
30640
|
curveSegments: 3,
|
|
@@ -30621,7 +30651,7 @@ class Tt {
|
|
|
30621
30651
|
break;
|
|
30622
30652
|
}
|
|
30623
30653
|
}
|
|
30624
|
-
if (i instanceof
|
|
30654
|
+
if (i instanceof mt) return e.toThreeGeometry();
|
|
30625
30655
|
if (i instanceof Qt) return new p.ExtrudeGeometry(e.toShapes(!1), {
|
|
30626
30656
|
/* 类型桥接:toShapes 为 Shape 运行时方法,@types 未声明 */
|
|
30627
30657
|
curveSegments: 3,
|
|
@@ -30634,7 +30664,7 @@ class Tt {
|
|
|
30634
30664
|
for (let i = 0; i < t.length; i++) {
|
|
30635
30665
|
const s = t[i];
|
|
30636
30666
|
let n = null;
|
|
30637
|
-
typeof s == "object" ? n = Object.keys(s)[0] : n =
|
|
30667
|
+
typeof s == "object" ? n = Object.keys(s)[0] : n = Ct.getFileName(s.toLowerCase());
|
|
30638
30668
|
const r = await Ui.instance().query(n);
|
|
30639
30669
|
if (r) e = !0;
|
|
30640
30670
|
else {
|
|
@@ -30658,7 +30688,7 @@ class Tt {
|
|
|
30658
30688
|
} = i;
|
|
30659
30689
|
if (this.fileNames && !this.fileNames.includes(s)) continue;
|
|
30660
30690
|
let r;
|
|
30661
|
-
n ? r = new
|
|
30691
|
+
n ? r = new mt(s, i) : r = new Qt(s, i), this.fontMap.set(s, r);
|
|
30662
30692
|
}
|
|
30663
30693
|
P.debug("[FontManager] Loaded font data from cache.");
|
|
30664
30694
|
}
|
|
@@ -30668,7 +30698,7 @@ class Tt {
|
|
|
30668
30698
|
return;
|
|
30669
30699
|
}
|
|
30670
30700
|
let e = this.fontMap.get(t);
|
|
30671
|
-
return !e && (e = this.fontMap.get(this.fontMap.keys().next().value), !this.missingFonts[t] && (this.missingFonts[t] = 0), this.missingFonts[t]++), e instanceof
|
|
30701
|
+
return !e && (e = this.fontMap.get(this.fontMap.keys().next().value), !this.missingFonts[t] && (this.missingFonts[t] = 0), this.missingFonts[t]++), e instanceof mt;
|
|
30672
30702
|
}
|
|
30673
30703
|
/**
|
|
30674
30704
|
* Just for log usage
|
|
@@ -30726,14 +30756,14 @@ class U0 {
|
|
|
30726
30756
|
const h = Object.values(i);
|
|
30727
30757
|
for (let d = h.length - 1; d >= 0; --d) {
|
|
30728
30758
|
const u = h[d].indexes[0], f = t.children[u];
|
|
30729
|
-
if (this.geometryEquals(o.geometry, f.geometry) &&
|
|
30759
|
+
if (this.geometryEquals(o.geometry, f.geometry) && Te.materialsEquals(o.material, f.material)) {
|
|
30730
30760
|
!i[u] && (i[u] = { indexes: [u] }, this.removeFromArray(s, u)), i[u].indexes.push(a), l = !0;
|
|
30731
30761
|
break;
|
|
30732
30762
|
}
|
|
30733
30763
|
}
|
|
30734
30764
|
for (let d = s.length - 1; !l && d >= 0; --d) {
|
|
30735
30765
|
const u = s[d], f = t.children[u];
|
|
30736
|
-
if (this.geometryEquals(o.geometry, f.geometry) &&
|
|
30766
|
+
if (this.geometryEquals(o.geometry, f.geometry) && Te.materialsEquals(o.material, f.material)) {
|
|
30737
30767
|
!i[u] && (i[u] = { indexes: [u] }, this.removeFromArray(s, u)), i[u].indexes.push(a), l = !0;
|
|
30738
30768
|
break;
|
|
30739
30769
|
}
|
|
@@ -30758,7 +30788,7 @@ class U0 {
|
|
|
30758
30788
|
const f = o[u], m = t.children[f];
|
|
30759
30789
|
m.updateMatrix(), d.setMatrixAt(u, m.matrix);
|
|
30760
30790
|
}
|
|
30761
|
-
d.matrixAutoUpdate =
|
|
30791
|
+
d.matrixAutoUpdate = bt, d.updateMatrix(), n.push(d);
|
|
30762
30792
|
}), r.sort((a, o) => o - a), r.forEach((a) => t.remove(t.children[a])), n.forEach((a) => {
|
|
30763
30793
|
a.parent = t, t.children.push(a);
|
|
30764
30794
|
}), t.updateMatrix(), console.log("[Inst] " + r.length + "(out of " + e + ") objects instanced to " + n.length + " InstancedMesh");
|
|
@@ -31492,7 +31522,7 @@ const au = (c, t, e = 800, i = 45) => {
|
|
|
31492
31522
|
g(this, "osnapInfo");
|
|
31493
31523
|
g(this, "drawSnapFunctions");
|
|
31494
31524
|
g(this, "snapLineVisible");
|
|
31495
|
-
this.needsFrustumCulled = !1, this.renderOrder = 1e3, this.snapType =
|
|
31525
|
+
this.needsFrustumCulled = !1, this.renderOrder = 1e3, this.snapType = Rt.TripleCross, this.snapLineVisible = !1, this.snapType = e, this.drawSnapFunctions = {
|
|
31496
31526
|
TripleCross: this.drawTripleCorss.bind(this),
|
|
31497
31527
|
Square: this.drawSquare.bind(this),
|
|
31498
31528
|
Triangle: this.drawTriangle.bind(this),
|
|
@@ -31575,7 +31605,7 @@ g(ge, "lineColor", "rgba(255, 119, 0, 1)"), g(ge, "FILL_COLOR_NONE", "rgba(0, 0,
|
|
|
31575
31605
|
let ke = ge;
|
|
31576
31606
|
xn._registerDrawableClass(ke);
|
|
31577
31607
|
var cu = /* @__PURE__ */ ((c) => (c[c.None = 0] = "None", c[c.Vertex = 1] = "Vertex", c[c.MiddlePoint = 2] = "MiddlePoint", c[c.Edge = 4] = "Edge", c[c.Face = 8] = "Face", c[c.FootOfPerpendicular = 16] = "FootOfPerpendicular", c[c.Intersection = 32] = "Intersection", c[c.CircleCenter = 64] = "CircleCenter", c))(cu || {});
|
|
31578
|
-
const hu = 1e-5, oe = new p.Vector3(),
|
|
31608
|
+
const hu = 1e-5, oe = new p.Vector3(), Ee = new p.Vector3(), Vi = new p.Vector3(), hs = new p.Vector3(), ei = new p.Matrix4(), ds = new p.Line3();
|
|
31579
31609
|
function du(c, t) {
|
|
31580
31610
|
let e = Number.MAX_VALUE, i = 0;
|
|
31581
31611
|
for (let s = 0; s < c.vertices.length; s++) {
|
|
@@ -31615,13 +31645,13 @@ function uu(c) {
|
|
|
31615
31645
|
let l = Number.MAX_VALUE, h = 0;
|
|
31616
31646
|
for (let f = 0; f < o.length; f += 2) {
|
|
31617
31647
|
const m = o[f], b = o[f + 1];
|
|
31618
|
-
oe.set(a[m * 3], a[m * 3 + 1], a[m * 3 + 2]), oe.applyMatrix4(ei),
|
|
31648
|
+
oe.set(a[m * 3], a[m * 3 + 1], a[m * 3 + 2]), oe.applyMatrix4(ei), Ee.set(a[b * 3], a[b * 3 + 1], a[b * 3 + 2]), Ee.applyMatrix4(ei), ds.set(oe, Ee), ds.closestPointToPoint(c.point, !0, Vi);
|
|
31619
31649
|
const y = c.point.distanceTo(Vi);
|
|
31620
31650
|
y < l && (h = f, l = y, hs.copy(Vi));
|
|
31621
31651
|
}
|
|
31622
31652
|
const d = o[h], u = o[h + 1];
|
|
31623
|
-
return oe.set(a[d * 3], a[d * 3 + 1], a[d * 3 + 2]), oe.applyMatrix4(ei),
|
|
31624
|
-
vertices: [oe.clone(),
|
|
31653
|
+
return oe.set(a[d * 3], a[d * 3 + 1], a[d * 3 + 2]), oe.applyMatrix4(ei), Ee.set(a[u * 3], a[u * 3 + 1], a[u * 3 + 2]), Ee.applyMatrix4(ei), {
|
|
31654
|
+
vertices: [oe.clone(), Ee.clone()],
|
|
31625
31655
|
vertex: hs.clone(),
|
|
31626
31656
|
distance: l
|
|
31627
31657
|
};
|
|
@@ -31651,7 +31681,7 @@ class N0 {
|
|
|
31651
31681
|
this.overlayRender = t, this.overlayRender?.addDrawableList(this.drawableList), this.initOSnapMarkers();
|
|
31652
31682
|
}
|
|
31653
31683
|
initOSnapMarkers() {
|
|
31654
|
-
const t = new ke(
|
|
31684
|
+
const t = new ke(Rt.TripleCross), e = new ke(Rt.Square), i = new ke(Rt.Triangle), s = new ke(Rt.CircleWithCross), n = new ke(Rt.Cross), r = new ke(Rt.Perpendicular);
|
|
31655
31685
|
this.markers[
|
|
31656
31686
|
1
|
|
31657
31687
|
/* Vertex */
|
|
@@ -31999,17 +32029,17 @@ class N0 {
|
|
|
31999
32029
|
let b = Math.max(0, f.start), y = Math.min(d.count, f.start + f.count);
|
|
32000
32030
|
m && (b = Math.max(b, m.indexStart), y = Math.min(y, m.indexStart + m.indexCount));
|
|
32001
32031
|
for (let C = b, w = y; C < w - 1; C += h) {
|
|
32002
|
-
const x = d.getX(C),
|
|
32003
|
-
oe.fromBufferAttribute(u, x),
|
|
32004
|
-
const M = this.getOsnapInfoFromSegment(t, oe,
|
|
32032
|
+
const x = d.getX(C), S = d.getX(C + 1);
|
|
32033
|
+
oe.fromBufferAttribute(u, x), Ee.fromBufferAttribute(u, S), oe.applyMatrix4(l.matrixWorld), Ee.applyMatrix4(l.matrixWorld), !i && (oe.setZ(0), Ee.setZ(0));
|
|
32034
|
+
const M = this.getOsnapInfoFromSegment(t, oe, Ee, s, n, r, a);
|
|
32005
32035
|
M && (r = this.osnapTypePriorities[M.type], o.push(M));
|
|
32006
32036
|
}
|
|
32007
32037
|
} else {
|
|
32008
32038
|
let b = Math.max(0, f.start), y = Math.min(u.count, f.start + f.count);
|
|
32009
32039
|
m && (b = Math.max(b, m.positionStart), y = Math.min(y, m.positionStart + m.positionCount));
|
|
32010
32040
|
for (let C = b, w = y; C < w - 1; C += h) {
|
|
32011
|
-
oe.fromBufferAttribute(u, C),
|
|
32012
|
-
const x = this.getOsnapInfoFromSegment(t, oe,
|
|
32041
|
+
oe.fromBufferAttribute(u, C), Ee.fromBufferAttribute(u, C + 1), oe.applyMatrix4(l.matrixWorld), Ee.applyMatrix4(l.matrixWorld), !i && (oe.setZ(0), Ee.setZ(0));
|
|
32042
|
+
const x = this.getOsnapInfoFromSegment(t, oe, Ee, s, n, r, a);
|
|
32013
32043
|
x && (r = this.osnapTypePriorities[x.type], o.push(x));
|
|
32014
32044
|
}
|
|
32015
32045
|
}
|
|
@@ -32025,8 +32055,8 @@ class N0 {
|
|
|
32025
32055
|
/* Vertex */
|
|
32026
32056
|
]) return;
|
|
32027
32057
|
const r = e.object, a = r.geometry.getAttribute("position");
|
|
32028
|
-
oe.fromBufferAttribute(a, e.index), oe.applyMatrix4(r.matrixWorld),
|
|
32029
|
-
const o =
|
|
32058
|
+
oe.fromBufferAttribute(a, e.index), oe.applyMatrix4(r.matrixWorld), Ee.copy(t), !i && (oe.setZ(0), Ee.setZ(0));
|
|
32059
|
+
const o = Ee.distanceTo(oe);
|
|
32030
32060
|
if (o > s) return;
|
|
32031
32061
|
const l = {
|
|
32032
32062
|
distance: o,
|
|
@@ -32110,7 +32140,7 @@ class H0 {
|
|
|
32110
32140
|
if (s) {
|
|
32111
32141
|
let n = s.getBounds();
|
|
32112
32142
|
n = n.clone().expandByScalar(20 * this.viewer.getPixelSizeInWorldCoord());
|
|
32113
|
-
const r =
|
|
32143
|
+
const r = Ae.world2NormalizedScreen(n.min, this.camera, this.viewerContainer), a = Ae.world2NormalizedScreen(n.max, this.camera, this.viewerContainer), o = new p.Box2(
|
|
32114
32144
|
new p.Vector2(Math.min(r.x, a.x), Math.min(r.y, a.y)),
|
|
32115
32145
|
new p.Vector2(Math.max(r.x, a.x), Math.max(r.y, a.y))
|
|
32116
32146
|
);
|
|
@@ -32441,7 +32471,7 @@ class no {
|
|
|
32441
32471
|
* 在叠加层用云线框高亮指定结果(替换上一个高亮)。
|
|
32442
32472
|
*/
|
|
32443
32473
|
highlight(t) {
|
|
32444
|
-
this.overlayRender && (!this.drawableList && (this.drawableList = new bn("text-search"), this.overlayRender.addDrawableList(this.drawableList)), this.clearHighlight(), this.drawableList.addDrawable(new
|
|
32474
|
+
this.overlayRender && (!this.drawableList && (this.drawableList = new bn("text-search"), this.overlayRender.addDrawableList(this.drawableList)), this.clearHighlight(), this.drawableList.addDrawable(new Ot(U.guid(), [t.box.clone()], [1, 0.55, 0, 1], [1, 0.55, 0, 0.15])), this.viewer.enableRender());
|
|
32445
32475
|
}
|
|
32446
32476
|
/**
|
|
32447
32477
|
* 清除当前高亮。
|
|
@@ -32615,7 +32645,7 @@ class yu extends hi {
|
|
|
32615
32645
|
if (s.timestamp = i.timeStamp, Qs(i, "clientX"))
|
|
32616
32646
|
if (s.altKey = i.altKey, s.ctrlKey = i.ctrlKey, s.shiftKey = i.shiftKey, s.clientX = i.clientX, s.clientY = i.clientY, s.button = i.button, Qs(i, "pointerId")) {
|
|
32617
32647
|
s.pointerType = i.pointerType, s.buttons = i.buttons, s.pageX = i.pageX, s.pageY = i.pageY, s.pointerId = i.pointerId;
|
|
32618
|
-
const n =
|
|
32648
|
+
const n = Ae.getScreenCoordinateByEvent(i, this.element);
|
|
32619
32649
|
s.x = n.x, s.y = n.y, s.movementX = i.movementX, s.movementY = i.movementY;
|
|
32620
32650
|
} else Qs(i, "deltaX") && (s.deltaMode = i.deltaMode, s.deltaX = i.deltaX, s.deltaY = i.deltaY);
|
|
32621
32651
|
else Qs(i, "code") && (s.altKey = i.altKey, s.ctrlKey = i.ctrlKey, s.shiftKey = i.shiftKey, s.metaKey = i.metaKey, s.code = i.code);
|
|
@@ -32705,9 +32735,9 @@ class xu {
|
|
|
32705
32735
|
* @param {* @param {Number} [radius=0] - 容差半径(像素),默认为 0 表示绝对精准的单点拾取}
|
|
32706
32736
|
*/
|
|
32707
32737
|
pickObjects(t, e, i, s = 0) {
|
|
32708
|
-
const n =
|
|
32738
|
+
const n = Ae.screen2Ndc(t, this.camera, this.viewerContainer);
|
|
32709
32739
|
if (s > 0) {
|
|
32710
|
-
const r = [], a = /* @__PURE__ */ new Map(), o =
|
|
32740
|
+
const r = [], a = /* @__PURE__ */ new Map(), o = Ae.screen2Ndc(t, this.camera, this.viewerContainer), l = Ae.screen2Ndc(
|
|
32711
32741
|
{ x: t.x + s, y: t.y },
|
|
32712
32742
|
this.camera,
|
|
32713
32743
|
this.viewerContainer
|
|
@@ -32715,14 +32745,14 @@ class xu {
|
|
|
32715
32745
|
this.raycaster.params.Line.threshold = u, this.setLayerChannels(i);
|
|
32716
32746
|
const m = 8;
|
|
32717
32747
|
for (let y = 0; y < m; y++) {
|
|
32718
|
-
const C = y / m * Math.PI * 2, w = Math.cos(C) * s, x = Math.sin(C) * s,
|
|
32748
|
+
const C = y / m * Math.PI * 2, w = Math.cos(C) * s, x = Math.sin(C) * s, S = {
|
|
32719
32749
|
x: t.x + w,
|
|
32720
32750
|
y: t.y + x
|
|
32721
|
-
}, M =
|
|
32751
|
+
}, M = Ae.screen2Ndc(S, this.camera, this.viewerContainer);
|
|
32722
32752
|
this.raycaster.setFromCamera(M, this.camera), this.raycaster.layers.enableAll();
|
|
32723
32753
|
const O = this.raycaster.intersectObjects(e, !0) || [];
|
|
32724
|
-
for (const
|
|
32725
|
-
|
|
32754
|
+
for (const E of O)
|
|
32755
|
+
E.object && !a.has(E.object.uuid) && (a.set(E.object.uuid, E), r.push(E));
|
|
32726
32756
|
}
|
|
32727
32757
|
this.raycaster.setFromCamera(o, this.camera);
|
|
32728
32758
|
const b = this.raycaster.intersectObjects(e, !0) || [];
|
|
@@ -32731,8 +32761,8 @@ class xu {
|
|
|
32731
32761
|
if (this.raycaster.params.Line.threshold = f, r.length > 1) {
|
|
32732
32762
|
const y = this.raycaster.ray.origin.clone();
|
|
32733
32763
|
r.sort((C, w) => {
|
|
32734
|
-
const x = C.point || C.object.getWorldPosition(new p.Vector3()),
|
|
32735
|
-
return x.distanceTo(y) -
|
|
32764
|
+
const x = C.point || C.object.getWorldPosition(new p.Vector3()), S = w.point || w.object.getWorldPosition(new p.Vector3());
|
|
32765
|
+
return x.distanceTo(y) - S.distanceTo(y);
|
|
32736
32766
|
});
|
|
32737
32767
|
}
|
|
32738
32768
|
return r;
|
|
@@ -32797,7 +32827,7 @@ class bu {
|
|
|
32797
32827
|
g(this, "modelGroup");
|
|
32798
32828
|
this.viewer = t;
|
|
32799
32829
|
const e = new p.Scene();
|
|
32800
|
-
e.matrixAutoUpdate =
|
|
32830
|
+
e.matrixAutoUpdate = bt, e.matrixWorldAutoUpdate = bt, this.scene = e, this.modelGroup = new p.Group(), this.modelGroup.name = "models", this.scene.add(this.modelGroup);
|
|
32801
32831
|
const { width: i, height: s, viewerContainer: n } = t.container;
|
|
32802
32832
|
let r;
|
|
32803
32833
|
try {
|
|
@@ -33161,10 +33191,10 @@ class Pr extends hi {
|
|
|
33161
33191
|
}
|
|
33162
33192
|
addModel(e) {
|
|
33163
33193
|
const i = e.getModelObject();
|
|
33164
|
-
i.name = e.modelId, this.sceneManager.addModel(e), i.matrixAutoUpdate =
|
|
33194
|
+
i.name = e.modelId, this.sceneManager.addModel(e), i.matrixAutoUpdate = bt, i.updateMatrix(), i.updateMatrixWorld(!0), this.loadedModels.push(e), this.enableRender(0);
|
|
33165
33195
|
}
|
|
33166
33196
|
async setFont(e) {
|
|
33167
|
-
!this.fontManager && (this.fontManager = new
|
|
33197
|
+
!this.fontManager && (this.fontManager = new Ct()), await this.fontManager.loadFonts(e);
|
|
33168
33198
|
}
|
|
33169
33199
|
/**
|
|
33170
33200
|
*
|
|
@@ -33464,7 +33494,7 @@ class $o extends Pr {
|
|
|
33464
33494
|
g(this, "requestHeaders");
|
|
33465
33495
|
/** 打印截图进行中:临时强制显示所有图符/文字,避免低缩放时被"视觉过小"逻辑隐藏 */
|
|
33466
33496
|
g(this, "_printCaptureMode", !1);
|
|
33467
|
-
this.name = at.Viewer2d, this.loadedModels = [], this.masterModelId = "", this.activeLayoutName = "", this.layoutInfos = {}, this.units = void 0, this.enableHideVisuallySmallObjects = e.enableHideVisuallySmallObjects !== !1, this.sortedHidableObjects = {}, this.lastCameraZoom = 1 / 0, this.loadingDxfCount = 0, e.enableLayoutBar && (this.dxfLayoutBar = new N1(this)), this.cameraManager.setProjection(
|
|
33497
|
+
this.name = at.Viewer2d, this.loadedModels = [], this.masterModelId = "", this.activeLayoutName = "", this.layoutInfos = {}, this.units = void 0, this.enableHideVisuallySmallObjects = e.enableHideVisuallySmallObjects !== !1, 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);
|
|
33468
33498
|
const i = new p.Vector3(0, 0, 100), s = new p.Vector3(0, 0, 0);
|
|
33469
33499
|
this.cameraManager.setCameraConfig({
|
|
33470
33500
|
eye: i,
|
|
@@ -33563,7 +33593,7 @@ class $o extends Pr {
|
|
|
33563
33593
|
*/
|
|
33564
33594
|
highlightEntityBox(e) {
|
|
33565
33595
|
const i = this.getOverlayRender();
|
|
33566
|
-
i && (!this.clickHighlightList && (this.clickHighlightList = new bn("entity-click-highlight"), i.addDrawableList(this.clickHighlightList)), this.clickHighlightList.clear(), this.clickHighlightList.addDrawable(new
|
|
33596
|
+
i && (!this.clickHighlightList && (this.clickHighlightList = new bn("entity-click-highlight"), i.addDrawableList(this.clickHighlightList)), this.clickHighlightList.clear(), this.clickHighlightList.addDrawable(new Ot(U.guid(), [e.clone()], [0.031, 0.906, 0.867, 1], [0.031, 0.906, 0.867, 0.15])), this.enableRender());
|
|
33567
33597
|
}
|
|
33568
33598
|
/**
|
|
33569
33599
|
* Gets if click-to-highlight entity is enabled. Default is false.
|
|
@@ -33709,7 +33739,7 @@ class $o extends Pr {
|
|
|
33709
33739
|
this.layoutInfos[this.activeLayoutName] = {
|
|
33710
33740
|
homeViewExtent: n,
|
|
33711
33741
|
extent: n
|
|
33712
|
-
}, s.matrixAutoUpdate =
|
|
33742
|
+
}, s.matrixAutoUpdate = bt, this.scene.add(s);
|
|
33713
33743
|
const r = n.max.z;
|
|
33714
33744
|
r > this.camera.position.z && (this.camera.position.z = r, this.camera.updateProjectionMatrix()), this.flyToObject(s);
|
|
33715
33745
|
}
|
|
@@ -34003,7 +34033,7 @@ class $o extends Pr {
|
|
|
34003
34033
|
* @internal
|
|
34004
34034
|
*/
|
|
34005
34035
|
getHitResult(e) {
|
|
34006
|
-
const i = this.viewerContainer, s =
|
|
34036
|
+
const i = this.viewerContainer, s = Ae.getScreenCoordinateByEvent(e, i), n = Ae.screen2Ndc(s, this.camera, i);
|
|
34007
34037
|
return this.getHitResultByNdcCoordinate(n);
|
|
34008
34038
|
}
|
|
34009
34039
|
/**
|
|
@@ -34117,8 +34147,8 @@ class $o extends Pr {
|
|
|
34117
34147
|
y > l && n.setPixelRatio(y), this.cameraManager.update(0), this.dispatchEvent(ce.BeforeRender), n.render(this.scene, this.camera), this.dispatchEvent(ce.AfterRender);
|
|
34118
34148
|
const C = n.domElement, w = this.overlayRender.getCanvas(), x = document.createElement("canvas");
|
|
34119
34149
|
x.width = C.width, x.height = C.height;
|
|
34120
|
-
const
|
|
34121
|
-
if (
|
|
34150
|
+
const S = x.getContext("2d");
|
|
34151
|
+
if (S.drawImage(C, 0, 0), w && w.width > 0 && w.height > 0 && S.drawImage(w, 0, 0, x.width, x.height), i) {
|
|
34122
34152
|
const O = new p.Color(1973806);
|
|
34123
34153
|
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)), {
|
|
34124
34154
|
r: O.r * 255,
|
|
@@ -34132,7 +34162,7 @@ class $o extends Pr {
|
|
|
34132
34162
|
O && (M = O);
|
|
34133
34163
|
}
|
|
34134
34164
|
this._printCaptureMode = !1;
|
|
34135
|
-
for (const { object: O, visible:
|
|
34165
|
+
for (const { object: O, visible: E } of u) O.visible = E;
|
|
34136
34166
|
return n.setPixelRatio(l), s.zoomTo(o), s.setLookAt(
|
|
34137
34167
|
r.x,
|
|
34138
34168
|
r.y,
|
|
@@ -34153,23 +34183,23 @@ class $o extends Pr {
|
|
|
34153
34183
|
const n = e.getContext("2d", { willReadFrequently: !0 });
|
|
34154
34184
|
if (!n) return;
|
|
34155
34185
|
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);
|
|
34156
|
-
for (let
|
|
34186
|
+
for (let E = 0, v = 0; E < h; E++, v += 4) {
|
|
34157
34187
|
const T = l[v], _ = l[v + 1], A = l[v + 2], I = T - s.r, B = _ - s.g, k = A - s.b;
|
|
34158
34188
|
if (Math.sqrt(I * I + B * B + k * k) < d) {
|
|
34159
|
-
l[v] = 255, l[v + 1] = 255, l[v + 2] = 255, f[
|
|
34189
|
+
l[v] = 255, l[v + 1] = 255, l[v + 2] = 255, f[E] = 255;
|
|
34160
34190
|
continue;
|
|
34161
34191
|
}
|
|
34162
34192
|
const D = T / 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));
|
|
34163
34193
|
let Qe = 0;
|
|
34164
34194
|
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));
|
|
34165
|
-
const vn = Math.min(0.55, (1 - ct) * u),
|
|
34195
|
+
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;
|
|
34166
34196
|
let Ht = 0, Gt = 0, Wt = 0;
|
|
34167
34197
|
const qt = Math.floor(Qe * 6) % 6;
|
|
34168
|
-
qt === 0 ? (Ht =
|
|
34198
|
+
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[E] = 0.299 * l[v] + 0.587 * l[v + 1] + 0.114 * l[v + 2];
|
|
34169
34199
|
}
|
|
34170
34200
|
const m = Math.max(1, i), b = new Float32Array(h), y = new Uint8ClampedArray(h), C = new Uint8ClampedArray(h), w = new Uint8ClampedArray(h);
|
|
34171
|
-
for (let
|
|
34172
|
-
const v =
|
|
34201
|
+
for (let E = 0; E < a; E++) {
|
|
34202
|
+
const v = E * r;
|
|
34173
34203
|
for (let T = 0; T < r; T++) {
|
|
34174
34204
|
let _ = 255, A = v + T;
|
|
34175
34205
|
const I = Math.max(0, T - m), B = Math.min(r - 1, T + m);
|
|
@@ -34180,20 +34210,20 @@ class $o extends Pr {
|
|
|
34180
34210
|
b[v + T] = _, y[v + T] = l[A * 4], C[v + T] = l[A * 4 + 1], w[v + T] = l[A * 4 + 2];
|
|
34181
34211
|
}
|
|
34182
34212
|
}
|
|
34183
|
-
const x = new Float32Array(h),
|
|
34184
|
-
for (let
|
|
34213
|
+
const x = new Float32Array(h), S = new Uint8ClampedArray(h), M = new Uint8ClampedArray(h), O = new Uint8ClampedArray(h);
|
|
34214
|
+
for (let E = 0; E < r; E++)
|
|
34185
34215
|
for (let v = 0; v < a; v++) {
|
|
34186
|
-
let T = 255, _ = v * r +
|
|
34216
|
+
let T = 255, _ = v * r + E;
|
|
34187
34217
|
const A = Math.max(0, v - m), I = Math.min(a - 1, v + m);
|
|
34188
34218
|
for (let k = A; k <= I; k++) {
|
|
34189
|
-
const D = b[k * r +
|
|
34190
|
-
D < T && (T = D, _ = k * r +
|
|
34219
|
+
const D = b[k * r + E];
|
|
34220
|
+
D < T && (T = D, _ = k * r + E);
|
|
34191
34221
|
}
|
|
34192
|
-
const B = v * r +
|
|
34193
|
-
x[B] = T,
|
|
34222
|
+
const B = v * r + E;
|
|
34223
|
+
x[B] = T, S[B] = y[_], M[B] = C[_], O[B] = w[_];
|
|
34194
34224
|
}
|
|
34195
|
-
for (let
|
|
34196
|
-
f[
|
|
34225
|
+
for (let E = 0, v = 0; E < h; E++, v += 4)
|
|
34226
|
+
f[E] > 250 && x[E] < 250 && (l[v] = S[E], l[v + 1] = M[E], l[v + 2] = O[E]);
|
|
34197
34227
|
n.putImageData(o, 0, 0);
|
|
34198
34228
|
}
|
|
34199
34229
|
/**
|
|
@@ -34203,10 +34233,10 @@ class $o extends Pr {
|
|
|
34203
34233
|
cropCanvasToBox(e, i) {
|
|
34204
34234
|
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;
|
|
34205
34235
|
if (u <= 0 || f <= 0) return;
|
|
34206
|
-
const m = (v) => (v - o) / u * e.width, b = (v) => (d - v) / f * e.height, y = Math.max(u, f) * 0.01, C = 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))),
|
|
34236
|
+
const m = (v) => (v - o) / u * e.width, b = (v) => (d - v) / f * e.height, y = Math.max(u, f) * 0.01, C = 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))), S = Math.min(e.height, Math.ceil(b(i.min.y - y))), M = w - C, O = S - x;
|
|
34207
34237
|
if (M < 16 || O < 16) return;
|
|
34208
|
-
const
|
|
34209
|
-
return
|
|
34238
|
+
const E = document.createElement("canvas");
|
|
34239
|
+
return E.width = M, E.height = O, E.getContext("2d").drawImage(e, C, x, M, O, 0, 0, M, O), E.toDataURL("image/png");
|
|
34210
34240
|
}
|
|
34211
34241
|
/**
|
|
34212
34242
|
* Opens the browser print dialog with the image laid out on the selected paper size,
|
|
@@ -34229,15 +34259,15 @@ class $o extends Pr {
|
|
|
34229
34259
|
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;`;
|
|
34230
34260
|
const C = (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>${C(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="${C(d)}"></body></html>`;
|
|
34231
34261
|
document.body.appendChild(b);
|
|
34232
|
-
const
|
|
34233
|
-
b.contentWindow?.removeEventListener("afterprint",
|
|
34262
|
+
const S = () => {
|
|
34263
|
+
b.contentWindow?.removeEventListener("afterprint", S), setTimeout(() => b.remove(), 100);
|
|
34234
34264
|
}, M = b.contentDocument;
|
|
34235
34265
|
M.open(), M.write(x), M.close();
|
|
34236
|
-
const O = M.querySelector("img"),
|
|
34266
|
+
const O = M.querySelector("img"), E = () => {
|
|
34237
34267
|
const v = b.contentWindow;
|
|
34238
|
-
v.addEventListener("afterprint",
|
|
34268
|
+
v.addEventListener("afterprint", S), v.focus(), v.print(), setTimeout(S, 6e4);
|
|
34239
34269
|
};
|
|
34240
|
-
O.complete ?
|
|
34270
|
+
O.complete ? E() : (O.onload = E, O.onerror = S);
|
|
34241
34271
|
}
|
|
34242
34272
|
/**
|
|
34243
34273
|
* @description {en} Gets dxf layers.
|
|
@@ -34475,7 +34505,7 @@ class Mu {
|
|
|
34475
34505
|
*/
|
|
34476
34506
|
async setFont(t) {
|
|
34477
34507
|
const e = Date.now();
|
|
34478
|
-
!this.fontManager && (this.fontManager = new
|
|
34508
|
+
!this.fontManager && (this.fontManager = new Ct()), await this.fontManager.loadFonts(t), P.info("[DxfCompareHelper] Font file(s) load time in " + (Date.now() - e) / 1e3 + "s");
|
|
34479
34509
|
}
|
|
34480
34510
|
/**
|
|
34481
34511
|
* Compares two dxf files. Note that:
|
|
@@ -34510,16 +34540,16 @@ class Mu {
|
|
|
34510
34540
|
}, f = (B) => u(B, 0, 15), m = (B) => u(B, 15, 30), b = (B) => u(B, 30, 60), y = (B) => u(B, 60, 95);
|
|
34511
34541
|
U.printMemory("Before comparing"), this.loadingProgressBar?.addProgressItem(l), d(0);
|
|
34512
34542
|
let C = Date.now();
|
|
34513
|
-
const w = this.loader.parse(n, f), x = this.loader.parse(a, m), [
|
|
34514
|
-
if (
|
|
34543
|
+
const w = this.loader.parse(n, f), x = this.loader.parse(a, m), [S, M] = await Promise.allSettled([w, x]);
|
|
34544
|
+
if (S.status === "rejected") return Promise.reject("[DxfCompareHelper] Failed to parse " + n);
|
|
34515
34545
|
if (M.status === "rejected") return Promise.reject("[DxfCompareHelper] Failed to parse " + a);
|
|
34516
34546
|
if (P.info("[DxfCompareHelper] loadFiles in " + (Date.now() - C) / 1e3 + "s"), this.loader.isAborted()) return Promise.reject("[DxfCompareHelper] compare loadFile aborted");
|
|
34517
|
-
const O =
|
|
34547
|
+
const O = S.value, E = M.value;
|
|
34518
34548
|
C = Date.now();
|
|
34519
|
-
const v = await new
|
|
34549
|
+
const v = await new yt(O, E, i).compare(b);
|
|
34520
34550
|
if (P.info("[DxfCompareHelper] Compared in " + (Date.now() - C) / 1e3 + "s"), P.debug("[DxfCompareHelper] Compared results:", v), this.loader.isAborted()) return Promise.reject("[DxfCompareHelper] compare change aborted");
|
|
34521
|
-
U.printMemory("After getting the comparison results"), C = Date.now(), await this.loader.loadEntitiesForCompare(O,
|
|
34522
|
-
const T = O, _ =
|
|
34551
|
+
U.printMemory("After getting the comparison results"), C = Date.now(), await this.loader.loadEntitiesForCompare(O, E, v, !0, y), U.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() - C) / 1e3 + "s");
|
|
34552
|
+
const T = O, _ = E;
|
|
34523
34553
|
if (this.decreaseJobCount(), !Object.keys(v).length && P.info("[DxfCompareHelper] No change found"), T.threejsObject?.children.length === 0 && _.threejsObject?.children.length === 0) {
|
|
34524
34554
|
const B = "[DxfCompareHelper] Nothing was loaded from " + n + " and " + a;
|
|
34525
34555
|
return P.warn(B), Promise.reject(B);
|
|
@@ -34670,13 +34700,13 @@ class W0 extends Mu {
|
|
|
34670
34700
|
}, b = (D) => m(D, 0, 15), y = (D) => m(D, 15, 30), C = (D) => m(D, 30, 60), w = (D) => m(D, 60, 95);
|
|
34671
34701
|
U.printMemory("Before comparing"), this.loadingProgressBar?.addProgressItem(d), f(0);
|
|
34672
34702
|
let x = Date.now();
|
|
34673
|
-
const
|
|
34703
|
+
const S = this.loader.parse(r, b), M = this.loader.parse(o, y), [O, E] = await Promise.allSettled([S, M]);
|
|
34674
34704
|
if (O.status === "rejected") return Promise.reject("[DxfCompareHelper] Failed to parse " + r);
|
|
34675
|
-
if (
|
|
34705
|
+
if (E.status === "rejected") return Promise.reject("[DxfCompareHelper] Failed to parse " + o);
|
|
34676
34706
|
if (P.info("[DxfCompareHelper] loadFiles in " + (Date.now() - x) / 1e3 + "s"), this.loader.isAborted()) return Promise.reject("[DxfCompareHelper] compare loadFile aborted");
|
|
34677
|
-
const v = O.value, T =
|
|
34707
|
+
const v = O.value, T = E.value;
|
|
34678
34708
|
x = Date.now();
|
|
34679
|
-
const _ = await new
|
|
34709
|
+
const _ = await new yt(v, T, s).compare(C);
|
|
34680
34710
|
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");
|
|
34681
34711
|
U.printMemory("After getting the comparison results"), x = Date.now(), await this.loader.loadEntitiesForCompare(v, T, _, !1, w), U.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");
|
|
34682
34712
|
const A = v, I = T;
|
|
@@ -35088,7 +35118,7 @@ class Y0 extends Pr {
|
|
|
35088
35118
|
};
|
|
35089
35119
|
this.cameraManager.flyToViewpoint(r);
|
|
35090
35120
|
}
|
|
35091
|
-
this.cameraManager.setProjection(
|
|
35121
|
+
this.cameraManager.setProjection(Et.Perspective), this.cameraManager.setNavigationMode(xt.Orbit), this.setupDefaultEvents(), this.setDefaultBackground();
|
|
35092
35122
|
}
|
|
35093
35123
|
setupDefaultEvents() {
|
|
35094
35124
|
let e = !1, i, s = 0, n = 0, r = 0;
|
|
@@ -35143,9 +35173,9 @@ class Y0 extends Pr {
|
|
|
35143
35173
|
);
|
|
35144
35174
|
};
|
|
35145
35175
|
let h = !1;
|
|
35146
|
-
const d = (x,
|
|
35176
|
+
const d = (x, S, M) => {
|
|
35147
35177
|
let O = x.loaded * 100 / x.total;
|
|
35148
|
-
O = O * (M -
|
|
35178
|
+
O = O * (M - S) / 100 + S, O > M && (h || (P.warn("[Progress] Invalid ProgressEvent:", x), h = !0), O = M), this.progressBar?.updateProgress(a, o, O), i?.(
|
|
35149
35179
|
new ProgressEvent("LoadProgress", {
|
|
35150
35180
|
loaded: O,
|
|
35151
35181
|
total: 100
|
|
@@ -35430,7 +35460,7 @@ class X0 extends Pr {
|
|
|
35430
35460
|
};
|
|
35431
35461
|
this.cameraManager.flyToViewpoint(r);
|
|
35432
35462
|
}
|
|
35433
|
-
this.cameraManager.setProjection(
|
|
35463
|
+
this.cameraManager.setProjection(Et.Perspective), this.cameraManager.setNavigationMode(xt.Orbit), this.setupDefaultEvents(), this.setDefaultBackground(), this.addEventListener(ce.BeforeRender, () => {
|
|
35434
35464
|
this.update3dTiles();
|
|
35435
35465
|
});
|
|
35436
35466
|
}
|
|
@@ -35607,7 +35637,7 @@ class X0 extends Pr {
|
|
|
35607
35637
|
this.spinner.increaseJobCount();
|
|
35608
35638
|
}, l.onLoadModel = (d) => {
|
|
35609
35639
|
d.traverse((u) => {
|
|
35610
|
-
u.matrixAutoUpdate && (u.matrixAutoUpdate =
|
|
35640
|
+
u.matrixAutoUpdate && (u.matrixAutoUpdate = bt, u.updateMatrix()), u.isMesh && (u.castShadow = !0, u.receiveShadow = !0), u.geometry && u.layers.enableAll();
|
|
35611
35641
|
}), this.enableRender(), setTimeout(() => this.spinner.decreaseJobCount(), 100);
|
|
35612
35642
|
}, l.setCamera(this.camera), l.setResolutionFromRenderer(this.camera, this.renderer), l.update(), h) {
|
|
35613
35643
|
h.applyMatrix4(s.getView().transform), o.pickUsageGroup.applyMatrix4(s.getView().transform), this.pickUsageScene.add(o.pickUsageGroup), this.addModel(o), this.cameraManager.adjustCameraByBBox(a);
|
|
@@ -36051,8 +36081,8 @@ class K0 {
|
|
|
36051
36081
|
getIntersections(t) {
|
|
36052
36082
|
if (!this.raycaster || !this.camera || !this.scene) return [];
|
|
36053
36083
|
let e = new p.Vector2();
|
|
36054
|
-
t && (e =
|
|
36055
|
-
const i =
|
|
36084
|
+
t && (e = Ae.getScreenCoordinateByEvent(t, this.containerOrCanvas));
|
|
36085
|
+
const i = Ae.screen2Ndc(e, this.camera, this.containerOrCanvas);
|
|
36056
36086
|
this.raycaster.setFromCamera(i, this.camera);
|
|
36057
36087
|
const s = [];
|
|
36058
36088
|
return this.loadedModels.forEach((n) => {
|
|
@@ -36085,7 +36115,7 @@ class K0 {
|
|
|
36085
36115
|
this.selectedObject = void 0;
|
|
36086
36116
|
}
|
|
36087
36117
|
if (!this.scene || !t) return;
|
|
36088
|
-
const e =
|
|
36118
|
+
const e = Te.clonedHighlightMaterials(t);
|
|
36089
36119
|
e && (this.selectedObject = t, this.selectedObject.userData.originalMaterial = this.selectedObject.material, this.selectedObject.material = e);
|
|
36090
36120
|
}
|
|
36091
36121
|
/**
|
|
@@ -36246,15 +36276,15 @@ export {
|
|
|
36246
36276
|
hn as ByBlock,
|
|
36247
36277
|
_o as ByLayer,
|
|
36248
36278
|
S0 as CSS2DObjectUtils,
|
|
36249
|
-
|
|
36279
|
+
Et as CameraProjection,
|
|
36250
36280
|
T0 as CancelablePromise,
|
|
36251
36281
|
xn as CanvasRender,
|
|
36252
36282
|
gs as ColorUtils,
|
|
36253
36283
|
U as CommonUtils,
|
|
36254
|
-
|
|
36284
|
+
Ot as CompareDrawable,
|
|
36255
36285
|
Ho as Container,
|
|
36256
|
-
|
|
36257
|
-
|
|
36286
|
+
xt as ControlsMode,
|
|
36287
|
+
Ae as CoordinateUtils,
|
|
36258
36288
|
xh as DecimalPrecisionRange,
|
|
36259
36289
|
zn as DefaultCameraFar,
|
|
36260
36290
|
vh as DefaultCameraFov,
|
|
@@ -36266,17 +36296,17 @@ export {
|
|
|
36266
36296
|
ci as Drawable,
|
|
36267
36297
|
bn as DrawableList,
|
|
36268
36298
|
We as DxfChangeType,
|
|
36269
|
-
|
|
36299
|
+
yt as DxfCompare,
|
|
36270
36300
|
W0 as DxfCompareHelper,
|
|
36271
36301
|
Ua as DxfCompareMarkupManager,
|
|
36272
36302
|
X as DxfLoader,
|
|
36273
36303
|
r1 as DxfParser,
|
|
36274
|
-
|
|
36275
|
-
|
|
36304
|
+
Me as DxfRenderOrder,
|
|
36305
|
+
Dt as DxfUtils,
|
|
36276
36306
|
Sh as EdgeUtils,
|
|
36277
36307
|
hi as Event,
|
|
36278
36308
|
sa as ExportUtils,
|
|
36279
|
-
|
|
36309
|
+
Ct as FontManager,
|
|
36280
36310
|
A0 as FpsUtils,
|
|
36281
36311
|
ru as GenerateMeshBvhWorker,
|
|
36282
36312
|
N as GeometryUtils,
|
|
@@ -36293,9 +36323,9 @@ export {
|
|
|
36293
36323
|
w0 as Line,
|
|
36294
36324
|
Qh as LinePatternShaders,
|
|
36295
36325
|
oi as LoadingHelper,
|
|
36296
|
-
|
|
36326
|
+
Te as MaterialUtils,
|
|
36297
36327
|
F as MathUtils,
|
|
36298
|
-
|
|
36328
|
+
bt as MatrixAutoUpdate,
|
|
36299
36329
|
ye as MergeUtils,
|
|
36300
36330
|
ef as Mesh,
|
|
36301
36331
|
Zo as MeshBvhHelper,
|
|
@@ -36306,7 +36336,7 @@ export {
|
|
|
36306
36336
|
sn as NestedCompareTypes,
|
|
36307
36337
|
N0 as OSnapHelper,
|
|
36308
36338
|
k0 as OSnapIconSize,
|
|
36309
|
-
|
|
36339
|
+
Rt as OSnapMarkerType,
|
|
36310
36340
|
cu as OSnapType,
|
|
36311
36341
|
j0 as ObjectPixelSizeHelper,
|
|
36312
36342
|
Q as ObjectUtils,
|