@maqiuyao/dxf-viewer 0.2.8 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/dxf-viewer.cjs +10 -10
- package/dist/dxf-viewer.js +177 -172
- 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";
|
|
@@ -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,9 +197,9 @@ 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++) {
|
|
@@ -238,8 +238,8 @@ function ic(c, t, e, i, s, n) {
|
|
|
238
238
|
B < l && (r = f, l = B, a = O.candidate);
|
|
239
239
|
}
|
|
240
240
|
} else {
|
|
241
|
-
for (let E = 0; E <
|
|
242
|
-
const M =
|
|
241
|
+
for (let E = 0; E < vt; E++) {
|
|
242
|
+
const M = It[E];
|
|
243
243
|
M.count = 0, M.candidate = m + C + E * C;
|
|
244
244
|
const O = M.bounds;
|
|
245
245
|
for (let S = 0; S < 3; S++)
|
|
@@ -247,19 +247,19 @@ function ic(c, t, e, i, s, n) {
|
|
|
247
247
|
}
|
|
248
248
|
for (let E = d; E < u; E += 6) {
|
|
249
249
|
let S = ~~((e[E + 2 * f] - m) / C);
|
|
250
|
-
S >=
|
|
251
|
-
const v =
|
|
250
|
+
S >= vt && (S = vt - 1);
|
|
251
|
+
const v = It[S];
|
|
252
252
|
v.count++, vs(E, e, v.bounds);
|
|
253
253
|
}
|
|
254
|
-
const w =
|
|
254
|
+
const w = It[vt - 1];
|
|
255
255
|
Rr(w.bounds, w.rightCacheBounds);
|
|
256
|
-
for (let E =
|
|
257
|
-
const M =
|
|
256
|
+
for (let E = vt - 2; E >= 0; E--) {
|
|
257
|
+
const M = It[E], O = It[E + 1];
|
|
258
258
|
Fr(M.bounds, O.rightCacheBounds, M.rightCacheBounds);
|
|
259
259
|
}
|
|
260
260
|
let x = 0;
|
|
261
|
-
for (let E = 0; E <
|
|
262
|
-
const M =
|
|
261
|
+
for (let E = 0; E < vt - 1; E++) {
|
|
262
|
+
const M = It[E], O = M.count, S = M.bounds, T = It[E + 1].rightCacheBounds;
|
|
263
263
|
O !== 0 && (x === 0 ? Rr(S, Ms) : Fr(S, Ms, Ms)), x += O;
|
|
264
264
|
let _ = 0, A = 0;
|
|
265
265
|
x !== 0 && (_ = Wi(Ms) / o);
|
|
@@ -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,
|
|
@@ -498,7 +498,7 @@ function dc(c, t, e, i) {
|
|
|
498
498
|
u
|
|
499
499
|
), ln.clearBuffer(), o += n[f].byteLength / Oe, !r); f++)
|
|
500
500
|
;
|
|
501
|
-
if (
|
|
501
|
+
if (Lt.releasePrimitive(u), ls.clearBuffer(), a += s[h].byteLength / Oe, r)
|
|
502
502
|
break;
|
|
503
503
|
}
|
|
504
504
|
return An = !1, r;
|
|
@@ -529,7 +529,7 @@ function st(c, t, e, i, s, n = 0, r = 0, a = 0, o = 0, l = null, h = !1) {
|
|
|
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);
|
|
@@ -558,7 +558,7 @@ 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);
|
|
@@ -605,7 +605,7 @@ 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);
|
|
@@ -634,7 +634,7 @@ 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)
|
|
@@ -652,7 +652,7 @@ 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);
|
|
@@ -681,7 +681,7 @@ 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
687
|
return S;
|
|
@@ -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,7 +1143,7 @@ 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
|
|
1146
|
+
const c = /* @__PURE__ */ new lt(), t = /* @__PURE__ */ new Pt(), e = /* @__PURE__ */ new Pt(), i = /* @__PURE__ */ new G(), s = /* @__PURE__ */ new G(), n = /* @__PURE__ */ new G(), r = /* @__PURE__ */ new G(), a = /* @__PURE__ */ new _t(), o = /* @__PURE__ */ new _t(), l = /* @__PURE__ */ new G(), h = /* @__PURE__ */ new jt(), d = /* @__PURE__ */ new jt();
|
|
1147
1147
|
function u(x, E, M, O) {
|
|
1148
1148
|
const S = i;
|
|
1149
1149
|
!x.isDegenerateIntoPoint && !x.isDegenerateIntoSegment ? S.copy(x.plane.normal) : S.copy(E.plane.normal);
|
|
@@ -1234,8 +1234,8 @@ 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 Ae = Mc[ve],
|
|
1238
|
-
if (m(this,
|
|
1237
|
+
const Ae = Mc[ve], At = this.a[Ae], Hi = this.b[Ae], Ht = this.c[Ae], Gt = E.a[Ae], Wt = E.b[Ae], qt = E.c[Ae];
|
|
1238
|
+
if (m(this, At, Hi, Ht, B, k, _, A, I, h, a))
|
|
1239
1239
|
return u(this, E, M, O);
|
|
1240
1240
|
if (m(E, Gt, Wt, qt, se, ze, D, R, ie, d, o))
|
|
1241
1241
|
return u(this, E, M, O);
|
|
@@ -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;
|
|
@@ -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
|
/**
|
|
@@ -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;
|
|
@@ -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
|
/**
|
|
@@ -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
|
|
@@ -5194,7 +5194,7 @@ const Vs = new p.Matrix4(), Bh = new p.Matrix4(), us = class us {
|
|
|
5194
5194
|
if (!x) return;
|
|
5195
5195
|
x.userData = {}, w = new p.Points(x, u.material), o.push(w);
|
|
5196
5196
|
}
|
|
5197
|
-
w && (e ? w.userData.batches = 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) => {
|
|
@@ -5292,7 +5292,7 @@ const Vs = new p.Matrix4(), Bh = new p.Matrix4(), us = class us {
|
|
|
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 = S : (v.userData = w.userData, v.userData.batches = void 0), v.userData.layerName = w.userData.layerName, v.name = "[Merged] " + w.name, v.matrixAutoUpdate =
|
|
5295
|
+
v && (n ? v.userData.batches = S : (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");
|
|
@@ -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);
|
|
@@ -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,
|
|
@@ -14749,7 +14749,7 @@ function Gh(c, t) {
|
|
|
14749
14749
|
}
|
|
14750
14750
|
var We = /* @__PURE__ */ ((c) => (c.Added = "Added", c.Removed = "Removed", c.Modified = "Modified", c.NoChange = "NoChange", c))(We || {});
|
|
14751
14751
|
let Ie = 1;
|
|
14752
|
-
const
|
|
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
|
}
|
|
@@ -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
|
}
|
|
@@ -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;
|
|
@@ -19518,7 +19518,7 @@ class r1 {
|
|
|
19518
19518
|
const v = l();
|
|
19519
19519
|
P.trace("}"), O(v), v.name ? S[v.name] = v : console.error("[DxfParser] Block with handle '" + v.handle + "' is missing a name, ignored!");
|
|
19520
19520
|
} else
|
|
19521
|
-
|
|
19521
|
+
wt(n), n = t.next();
|
|
19522
19522
|
return S;
|
|
19523
19523
|
}
|
|
19524
19524
|
function l() {
|
|
@@ -19563,7 +19563,7 @@ class r1 {
|
|
|
19563
19563
|
S.entities = E(!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")) {
|
|
@@ -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];
|
|
@@ -19703,7 +19703,7 @@ class r1 {
|
|
|
19703
19703
|
n.value === "VPORT" && (P.trace("}"), S.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
19709
|
return P.trace("}"), S.push(v), S;
|
|
@@ -19789,7 +19789,7 @@ class r1 {
|
|
|
19789
19789
|
n.value === "LAYER" && (P.trace("}"), T && (S[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
19795
|
return P.trace("}"), T && (S[T] = v), S;
|
|
@@ -19938,10 +19938,10 @@ class r1 {
|
|
|
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
19947
|
P.trace("}"), T && (S[T] = v);
|
|
@@ -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) {
|
|
@@ -20680,7 +20680,7 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
20680
20680
|
if (!v && (v = new z(), v.name = S, v.userData.isLayoutLevelObject = !0, u.add(v)), M.traverse((T) => {
|
|
20681
20681
|
T.userData.isSnapObject && (!this.layoutsSnapObjectsMap[S] && (this.layoutsSnapObjectsMap[S] = []), this.layoutsSnapObjectsMap[S].push(T));
|
|
20682
20682
|
}), this.enableMerge) {
|
|
20683
|
-
|
|
20683
|
+
Dt.merge(M, !1), !d[S] && (d[S] = {
|
|
20684
20684
|
object: v,
|
|
20685
20685
|
layerObjects: {}
|
|
20686
20686
|
});
|
|
@@ -20723,7 +20723,7 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
20723
20723
|
for (const x in d) {
|
|
20724
20724
|
const E = d[x], M = E.object;
|
|
20725
20725
|
for (const O in E.layerObjects) {
|
|
20726
|
-
const S = E.layerObjects[O], v =
|
|
20726
|
+
const S = E.layerObjects[O], v = Dt.deepMerge(S, void 0, !1, !1, !0), T = v.added, _ = v.removed;
|
|
20727
20727
|
if (_.length !== S.length) {
|
|
20728
20728
|
let A = _;
|
|
20729
20729
|
_.length >= 100 && (A = new Set(_));
|
|
@@ -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) {
|
|
@@ -21494,7 +21494,7 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
21494
21494
|
} 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
21495
|
}
|
|
21496
21496
|
if (f.children.length !== 0)
|
|
21497
|
-
return
|
|
21497
|
+
return Dt.merge(f, !1), m && (i.colorIndex = m), f.children.length === 1 ? {
|
|
21498
21498
|
object: f.children[0],
|
|
21499
21499
|
hOffset: a,
|
|
21500
21500
|
vOffset: o
|
|
@@ -21915,7 +21915,7 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
21915
21915
|
} else return d?.traverse((u) => {
|
|
21916
21916
|
u.layers.enableAll();
|
|
21917
21917
|
}), d;
|
|
21918
|
-
return
|
|
21918
|
+
return Dt.merge(a, !1), a.traverse((u) => {
|
|
21919
21919
|
u.layers.enableAll();
|
|
21920
21920
|
}), a.children.length === 1 ? a.children[0] : a;
|
|
21921
21921
|
}
|
|
@@ -21960,7 +21960,7 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
21960
21960
|
let m = !1;
|
|
21961
21961
|
this.enableRTC && (m = N.checkAndRebasePositionsOnRTC(n, f));
|
|
21962
21962
|
const b = new p.BufferGeometry().setFromPoints(n), y = new z(H.Line);
|
|
21963
|
-
return y.geometry = b, y.material = pe, y.renderOrder = Be.Line, m && (this.setRTCUserData(y), y.matrix.setPosition(f.x, f.y, 0)), u.children.length > 0 ? (u.add(y),
|
|
21963
|
+
return y.geometry = b, y.material = pe, y.renderOrder = Be.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
21964
|
C.layers.enableAll();
|
|
21965
21965
|
}), u.children.length === 1 ? u.children[0] : u) : (y.layers.enableAll(), y);
|
|
21966
21966
|
}
|
|
@@ -22714,7 +22714,7 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
22714
22714
|
const u = e.entities[d];
|
|
22715
22715
|
this.addViewport(u, a);
|
|
22716
22716
|
const f = this.loadEntity(u, i);
|
|
22717
|
-
f && (this.enableMerge &&
|
|
22717
|
+
f && (this.enableMerge && Dt.merge(f, !1), o.add(f), f.traverse((m) => {
|
|
22718
22718
|
if (m.geometry) {
|
|
22719
22719
|
const b = m.userData.layerName;
|
|
22720
22720
|
let y = r[b];
|
|
@@ -23064,7 +23064,7 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
23064
23064
|
* (DxfEntity 未收录),此处做类型桥接。
|
|
23065
23065
|
*/
|
|
23066
23066
|
getColor(e, i, s) {
|
|
23067
|
-
if (this.compareContext) return
|
|
23067
|
+
if (this.compareContext) return yt.ENTITY_COLOR_NO_CHANGE;
|
|
23068
23068
|
if (this.overrideColor != null) return this.overrideColor;
|
|
23069
23069
|
const n = e;
|
|
23070
23070
|
if (n && n.isGradientColor) {
|
|
@@ -23664,7 +23664,7 @@ const Ge = new p.Vector3(1, 0, 0), Xn = new p.Vector3(0, 1, 0), bi = new p.Vecto
|
|
|
23664
23664
|
}), m[x].children.push(y);
|
|
23665
23665
|
}
|
|
23666
23666
|
for (const y in m) {
|
|
23667
|
-
const C = m[y], w =
|
|
23667
|
+
const C = m[y], w = Dt.deepMerge(C.children, C.object, !1, !1, !0), x = w.added, E = w.removed;
|
|
23668
23668
|
!s[y] && (s[y] = {
|
|
23669
23669
|
object: C.object,
|
|
23670
23670
|
children: []
|
|
@@ -23923,7 +23923,7 @@ class Ua extends hi {
|
|
|
23923
23923
|
h && (l.type === We.Added ? i.push(h) : l.type === We.Removed ? s.push(h) : n.push(h));
|
|
23924
23924
|
}
|
|
23925
23925
|
const r = N.mergeBBoxes(i), a = N.mergeBBoxes(s), o = N.mergeBBoxes(n);
|
|
23926
|
-
this.drawableList.addDrawable(new
|
|
23926
|
+
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
23927
|
}
|
|
23928
23928
|
setCompareDrawableVisible(e) {
|
|
23929
23929
|
this.drawableList.getDrawables().forEach((i) => i.visible = e), this.viewer.enableRender();
|
|
@@ -27041,7 +27041,7 @@ class Go {
|
|
|
27041
27041
|
}), this.progressItems.clear(), this.element.remove();
|
|
27042
27042
|
}
|
|
27043
27043
|
}
|
|
27044
|
-
var at = /* @__PURE__ */ ((c) => (c.BaseViewer = "BaseViewer", c.Viewer3d = "Viewer3d", c.Viewer2d = "Viewer2d", c.BimTilesViewer = "BimTilesViewer", c))(at || {}),
|
|
27044
|
+
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
27045
|
const V0 = {
|
|
27046
27046
|
enableSpinner: !0,
|
|
27047
27047
|
containerId: "myCanvas"
|
|
@@ -28496,12 +28496,12 @@ class $ extends W1 {
|
|
|
28496
28496
|
}), s.radius = Math.sqrt(r), s;
|
|
28497
28497
|
}
|
|
28498
28498
|
}
|
|
28499
|
-
var
|
|
28499
|
+
var xt = /* @__PURE__ */ ((c) => (c[c.Orbit = 0] = "Orbit", c[c.FirstPerson = 1] = "FirstPerson", c[c.Plan = 2] = "Plan", c))(xt || {});
|
|
28500
28500
|
class X1 {
|
|
28501
28501
|
constructor(t) {
|
|
28502
28502
|
g(this, "mode");
|
|
28503
28503
|
g(this, "cameraManager");
|
|
28504
|
-
this.mode =
|
|
28504
|
+
this.mode = xt.Orbit, this.cameraManager = t;
|
|
28505
28505
|
}
|
|
28506
28506
|
setupControl() {
|
|
28507
28507
|
const t = this.cameraManager.camera, e = this.cameraManager.cameraControls;
|
|
@@ -28527,7 +28527,7 @@ class Z1 {
|
|
|
28527
28527
|
constructor(t) {
|
|
28528
28528
|
g(this, "mode");
|
|
28529
28529
|
g(this, "cameraManager");
|
|
28530
|
-
this.mode =
|
|
28530
|
+
this.mode = xt.Plan, this.cameraManager = t;
|
|
28531
28531
|
}
|
|
28532
28532
|
setupControl() {
|
|
28533
28533
|
const t = this.cameraManager.camera, e = this.cameraManager.cameraControls;
|
|
@@ -28574,7 +28574,7 @@ class K1 {
|
|
|
28574
28574
|
g(this, "anchor");
|
|
28575
28575
|
g(this, "onKeyDown");
|
|
28576
28576
|
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 =
|
|
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 = Et.Perspective, this.onKeyDown = (s) => {
|
|
28578
28578
|
if (!this.enableKeyDown) return;
|
|
28579
28579
|
const n = this.cameraControls, r = this.viewer.getPixelSizeInWorldCoord() * 10, a = this.viewer.name === at.Viewer3d || this.viewer.name === at.BimTilesViewer;
|
|
28580
28580
|
switch (s.code) {
|
|
@@ -28629,9 +28629,9 @@ class K1 {
|
|
|
28629
28629
|
this.perspectiveCamera,
|
|
28630
28630
|
t.getInputManager()
|
|
28631
28631
|
), this.controlsMap = {
|
|
28632
|
-
[
|
|
28633
|
-
[
|
|
28634
|
-
}, this.activeControls = this.controlsMap[
|
|
28632
|
+
[xt.Orbit]: new X1(this),
|
|
28633
|
+
[xt.Plan]: new Z1(this)
|
|
28634
|
+
}, this.activeControls = this.controlsMap[xt.Orbit], this.setupControls(), this.setProjection(Et.Perspective), this.anchor = this.createAnchor();
|
|
28635
28635
|
}
|
|
28636
28636
|
get viewerContainer() {
|
|
28637
28637
|
return this.viewer.viewerContainer;
|
|
@@ -28676,10 +28676,10 @@ class K1 {
|
|
|
28676
28676
|
);
|
|
28677
28677
|
}
|
|
28678
28678
|
setOrthoCamera() {
|
|
28679
|
-
if (this.activeControls.mode ===
|
|
28679
|
+
if (this.activeControls.mode === xt.FirstPerson) return;
|
|
28680
28680
|
this.previousDistance = this.cameraControls.distance, this.cameraControls.distance = 200;
|
|
28681
28681
|
const { width: t, height: e } = this.getDims();
|
|
28682
|
-
this.setupOrthoCamera(e, t), this.activeCamera = this.orthographicCamera, this.projection =
|
|
28682
|
+
this.setupOrthoCamera(e, t), this.activeCamera = this.orthographicCamera, this.projection = Et.Orthographic;
|
|
28683
28683
|
}
|
|
28684
28684
|
getDims() {
|
|
28685
28685
|
const t = new p.Vector3();
|
|
@@ -28701,7 +28701,7 @@ class K1 {
|
|
|
28701
28701
|
const t = this.cameraControls;
|
|
28702
28702
|
t.mouseButtons.wheel = $.ACTION.DOLLY;
|
|
28703
28703
|
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 =
|
|
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 = Et.Perspective, t.distance = this.previousDistance, t.zoomTo(1);
|
|
28705
28705
|
}
|
|
28706
28706
|
update(t) {
|
|
28707
28707
|
const e = this.cameraControls.update(t);
|
|
@@ -28805,7 +28805,7 @@ class K1 {
|
|
|
28805
28805
|
return this.projection;
|
|
28806
28806
|
}
|
|
28807
28807
|
setProjection(t) {
|
|
28808
|
-
this.projection !== t && (this.projection = t, t ===
|
|
28808
|
+
this.projection !== t && (this.projection = t, t === Et.Orthographic ? this.setOrthoCamera() : this.setPerspectiveCamera());
|
|
28809
28809
|
}
|
|
28810
28810
|
setOrbitPoint(t) {
|
|
28811
28811
|
this.cameraControls.setOrbitPoint(t.x, t.y, t.z);
|
|
@@ -29289,7 +29289,7 @@ class xs extends p.Shape {
|
|
|
29289
29289
|
return r.userData = { advanceWidth: this.width }, r.setAttribute("position", new p.Float32BufferAttribute(i, 3)), r.setIndex(s), r;
|
|
29290
29290
|
}
|
|
29291
29291
|
}
|
|
29292
|
-
const
|
|
29292
|
+
const gt = class gt {
|
|
29293
29293
|
static parserHeader(t, e) {
|
|
29294
29294
|
let i = "", s = !1, n = 0;
|
|
29295
29295
|
const r = !0;
|
|
@@ -29385,7 +29385,7 @@ const mt = class mt {
|
|
|
29385
29385
|
let m = u & 7;
|
|
29386
29386
|
m == 0 && (m = 8);
|
|
29387
29387
|
const b = Math.PI / 4;
|
|
29388
|
-
let y = b * m, C =
|
|
29388
|
+
let y = b * m, C = gt.CIRCLE_SPAN;
|
|
29389
29389
|
u < 0 && (C = -C, y = -y);
|
|
29390
29390
|
const w = b * f, x = w + y, E = s.clone().sub(new p.Vector2(Math.cos(w) * d, Math.sin(w) * d));
|
|
29391
29391
|
if (s = E.clone().add(new p.Vector2(Math.cos(x) * d, Math.sin(x) * d)), o) {
|
|
@@ -29404,7 +29404,7 @@ const mt = class mt {
|
|
|
29404
29404
|
let w = y & 7;
|
|
29405
29405
|
w == 0 && (w = 8), u != 0 && w--;
|
|
29406
29406
|
const x = Math.PI / 4;
|
|
29407
|
-
let E = x * w, M =
|
|
29407
|
+
let E = x * w, M = gt.CIRCLE_SPAN, O = 1;
|
|
29408
29408
|
y < 0 && (M = -M, E = -E, O = -1);
|
|
29409
29409
|
let S = x * C, v = S + E;
|
|
29410
29410
|
S += x * d / 256 * O, v += x * u / 256 * O;
|
|
@@ -29424,7 +29424,7 @@ const mt = class mt {
|
|
|
29424
29424
|
const d = new p.Vector2();
|
|
29425
29425
|
d.x = J.byteTosbyte(e[++l]) * i, d.y = J.byteTosbyte(e[++l]) * i;
|
|
29426
29426
|
let u = J.byteTosbyte(e[++l]);
|
|
29427
|
-
u < -127 && (u = -127), o && (u == 0 ? r.push(s.clone().add(d)) : r.push(
|
|
29427
|
+
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
29428
|
}
|
|
29429
29429
|
break;
|
|
29430
29430
|
case 13:
|
|
@@ -29432,11 +29432,11 @@ const mt = class mt {
|
|
|
29432
29432
|
const u = new p.Vector2();
|
|
29433
29433
|
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
29434
|
let f = J.byteTosbyte(e[++l]);
|
|
29435
|
-
f < -127 && (f = -127), o && (f == 0 ? r.push(s.clone().add(u)) : r.push(
|
|
29435
|
+
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
29436
|
}
|
|
29437
29437
|
break;
|
|
29438
29438
|
case 14:
|
|
29439
|
-
l =
|
|
29439
|
+
l = gt.skipCode(t, e, ++l);
|
|
29440
29440
|
break;
|
|
29441
29441
|
default:
|
|
29442
29442
|
if (h > 15) {
|
|
@@ -29565,7 +29565,7 @@ const mt = class mt {
|
|
|
29565
29565
|
const f = t.sub(u), m = s.sub(u);
|
|
29566
29566
|
let b = Math.atan2(f.y, f.x);
|
|
29567
29567
|
const y = Math.atan2(m.y, m.x);
|
|
29568
|
-
let C =
|
|
29568
|
+
let C = gt.CIRCLE_SPAN;
|
|
29569
29569
|
n ? (C = -C, b < y && (b += 2 * Math.PI)) : b > y && (b -= 2 * Math.PI);
|
|
29570
29570
|
let w = b;
|
|
29571
29571
|
const x = !0;
|
|
@@ -29576,9 +29576,9 @@ const mt = class mt {
|
|
|
29576
29576
|
return s;
|
|
29577
29577
|
}
|
|
29578
29578
|
};
|
|
29579
|
-
g(
|
|
29580
|
-
`, ""]), g(
|
|
29581
|
-
let
|
|
29579
|
+
g(gt, "FILE_STOP_FLAG", ["\r", `
|
|
29580
|
+
`, ""]), g(gt, "CIRCLE_SPAN", Math.PI / 18);
|
|
29581
|
+
let Ft = gt;
|
|
29582
29582
|
const rr = {
|
|
29583
29583
|
130: [
|
|
29584
29584
|
[
|
|
@@ -30280,7 +30280,7 @@ const rr = {
|
|
|
30280
30280
|
g(this, "textShapesCache");
|
|
30281
30281
|
g(this, "graphicData");
|
|
30282
30282
|
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 =
|
|
30283
|
+
const s = new wn(i), n = Ft.parserHeader(s, Ft.FILE_STOP_FLAG), r = n.split(" ");
|
|
30284
30284
|
switch (r[1]) {
|
|
30285
30285
|
case "shapes":
|
|
30286
30286
|
this.parseShapeFont(s), this.fontType = je.Shapes;
|
|
@@ -30317,7 +30317,7 @@ const rr = {
|
|
|
30317
30317
|
* Gets TextShape by a char
|
|
30318
30318
|
*/
|
|
30319
30319
|
getCharShape(e, i) {
|
|
30320
|
-
let s =
|
|
30320
|
+
let s = Ft.getCode(e);
|
|
30321
30321
|
s === 0 && (s = e.charCodeAt(0));
|
|
30322
30322
|
const n = this.getGraphicDataByCode(s, i);
|
|
30323
30323
|
if (!n)
|
|
@@ -30340,7 +30340,7 @@ const rr = {
|
|
|
30340
30340
|
if (!this.graphicData.has(e)) {
|
|
30341
30341
|
if (n[e]) {
|
|
30342
30342
|
const a = n[e], o = fs.DEFAULT_SIZE / this.baseUp;
|
|
30343
|
-
r =
|
|
30343
|
+
r = Ft.parserCode(this, a, o), this.graphicData.set(e, r);
|
|
30344
30344
|
} else if (rr[e]) {
|
|
30345
30345
|
const a = [];
|
|
30346
30346
|
for (let o = 0; o < rr[e].length; o++)
|
|
@@ -30417,7 +30417,7 @@ const rr = {
|
|
|
30417
30417
|
*/
|
|
30418
30418
|
getNotFoundTextShape(e) {
|
|
30419
30419
|
let i = 0;
|
|
30420
|
-
return this.fontType === je.Bigfont && (i =
|
|
30420
|
+
return this.fontType === je.Bigfont && (i = Ft.getCode("?")), this.fontType === je.Unifont && (i = Ft.getCode("?")), this.getGraphicDataByCode(i, e);
|
|
30421
30421
|
}
|
|
30422
30422
|
getFontFile() {
|
|
30423
30423
|
return {
|
|
@@ -30441,7 +30441,7 @@ const rr = {
|
|
|
30441
30441
|
}
|
|
30442
30442
|
};
|
|
30443
30443
|
g(fs, "DEFAULT_SIZE", 12);
|
|
30444
|
-
let
|
|
30444
|
+
let mt = fs;
|
|
30445
30445
|
function Q1(c) {
|
|
30446
30446
|
let t, e, i, s, n;
|
|
30447
30447
|
t = "";
|
|
@@ -30468,7 +30468,7 @@ function Q1(c) {
|
|
|
30468
30468
|
}
|
|
30469
30469
|
return t;
|
|
30470
30470
|
}
|
|
30471
|
-
class
|
|
30471
|
+
class Ct {
|
|
30472
30472
|
constructor() {
|
|
30473
30473
|
g(this, "loader");
|
|
30474
30474
|
g(this, "fontMap");
|
|
@@ -30488,11 +30488,11 @@ class Tt {
|
|
|
30488
30488
|
* @example font-family: Helvetica, Tahoma, Arial, "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
|
|
30489
30489
|
*/
|
|
30490
30490
|
async loadFonts(t) {
|
|
30491
|
-
if (t = Array.isArray(t) ? t : [t], this.fileNames = t.map((e) => typeof e == "object" ? Object.keys(e)[0] :
|
|
30491
|
+
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
30492
|
for (let e = 0; e < t.length; e++) {
|
|
30493
30493
|
const i = t[e];
|
|
30494
30494
|
let s = null, n = [], r = [];
|
|
30495
|
-
typeof i == "object" ? (n = Object.keys(i), r = Object.values(i), s = n[0]) : s =
|
|
30495
|
+
typeof i == "object" ? (n = Object.keys(i), r = Object.values(i), s = n[0]) : s = Ct.getFileName(i.toLowerCase());
|
|
30496
30496
|
let a;
|
|
30497
30497
|
if (n.length) {
|
|
30498
30498
|
const o = n[0];
|
|
@@ -30507,7 +30507,7 @@ class Tt {
|
|
|
30507
30507
|
} else if (o.lastIndexOf(".shx") > -1) {
|
|
30508
30508
|
this.loader.setResponseType("arraybuffer");
|
|
30509
30509
|
const l = await this.loader.loadAsync(r[0]);
|
|
30510
|
-
a = new
|
|
30510
|
+
a = new mt(
|
|
30511
30511
|
s,
|
|
30512
30512
|
l
|
|
30513
30513
|
/* 类型桥接:同上 */
|
|
@@ -30521,7 +30521,7 @@ class Tt {
|
|
|
30521
30521
|
/* 类型桥接:loadAsync 返回 string|ArrayBuffer */
|
|
30522
30522
|
);
|
|
30523
30523
|
}
|
|
30524
|
-
} else if (
|
|
30524
|
+
} else if (Ct.isJsonFile(i)) {
|
|
30525
30525
|
this.loader.setResponseType("json");
|
|
30526
30526
|
const o = await this.loader.loadAsync(i);
|
|
30527
30527
|
a = new Qt(
|
|
@@ -30529,15 +30529,15 @@ class Tt {
|
|
|
30529
30529
|
o
|
|
30530
30530
|
/* 类型桥接:loadAsync 返回 string|ArrayBuffer */
|
|
30531
30531
|
);
|
|
30532
|
-
} else if (
|
|
30532
|
+
} else if (Ct.isShxFile(i)) {
|
|
30533
30533
|
this.loader.setResponseType("arraybuffer");
|
|
30534
30534
|
const o = await this.loader.loadAsync(i);
|
|
30535
|
-
a = new
|
|
30535
|
+
a = new mt(
|
|
30536
30536
|
s,
|
|
30537
30537
|
o
|
|
30538
30538
|
/* 类型桥接:同上 */
|
|
30539
30539
|
);
|
|
30540
|
-
} else if (
|
|
30540
|
+
} else if (Ct.isTtfFile(i)) {
|
|
30541
30541
|
this.loader.setResponseType("arraybuffer");
|
|
30542
30542
|
const o = await this.loader.loadAsync(i);
|
|
30543
30543
|
a = new Qt(
|
|
@@ -30582,29 +30582,34 @@ class Tt {
|
|
|
30582
30582
|
return;
|
|
30583
30583
|
}
|
|
30584
30584
|
e == null && (e = "");
|
|
30585
|
-
|
|
30586
|
-
|
|
30585
|
+
const s = t.charCodeAt(0) > 255, n = (o) => {
|
|
30586
|
+
const l = o.getCharShape(t, i);
|
|
30587
|
+
if (l && !(s && o instanceof mt && l.width < i * 0.5))
|
|
30588
|
+
return l;
|
|
30589
|
+
};
|
|
30590
|
+
let r = this.fontMap.get(e.toLowerCase());
|
|
30591
|
+
if (!r) {
|
|
30587
30592
|
!this.missingFonts[e] && (this.missingFonts[e] = 0), this.missingFonts[e]++;
|
|
30588
|
-
for (const [,
|
|
30589
|
-
if (
|
|
30590
|
-
|
|
30593
|
+
for (const [, o] of this.fontMap)
|
|
30594
|
+
if (n(o)) {
|
|
30595
|
+
r = o;
|
|
30591
30596
|
break;
|
|
30592
30597
|
}
|
|
30593
30598
|
}
|
|
30594
|
-
let
|
|
30595
|
-
if (!
|
|
30596
|
-
for (const [,
|
|
30597
|
-
if (
|
|
30598
|
-
const
|
|
30599
|
-
if (
|
|
30600
|
-
|
|
30599
|
+
let a = r?.getCharShape(t, i);
|
|
30600
|
+
if (a && s && r instanceof mt && a.width < i * 0.5 && (a = void 0), !a)
|
|
30601
|
+
for (const [, o] of this.fontMap) {
|
|
30602
|
+
if (o === r) continue;
|
|
30603
|
+
const l = n(o);
|
|
30604
|
+
if (l) {
|
|
30605
|
+
r = o, a = l;
|
|
30601
30606
|
break;
|
|
30602
30607
|
}
|
|
30603
30608
|
}
|
|
30604
|
-
if (
|
|
30605
|
-
if (
|
|
30606
|
-
if (
|
|
30607
|
-
font:
|
|
30609
|
+
if (a) {
|
|
30610
|
+
if (r instanceof mt) return a.toThreeGeometry();
|
|
30611
|
+
if (r instanceof Qt) return new Pl(t, {
|
|
30612
|
+
font: r,
|
|
30608
30613
|
depth: 0,
|
|
30609
30614
|
size: i || 12,
|
|
30610
30615
|
curveSegments: 3,
|
|
@@ -30621,7 +30626,7 @@ class Tt {
|
|
|
30621
30626
|
break;
|
|
30622
30627
|
}
|
|
30623
30628
|
}
|
|
30624
|
-
if (i instanceof
|
|
30629
|
+
if (i instanceof mt) return e.toThreeGeometry();
|
|
30625
30630
|
if (i instanceof Qt) return new p.ExtrudeGeometry(e.toShapes(!1), {
|
|
30626
30631
|
/* 类型桥接:toShapes 为 Shape 运行时方法,@types 未声明 */
|
|
30627
30632
|
curveSegments: 3,
|
|
@@ -30634,7 +30639,7 @@ class Tt {
|
|
|
30634
30639
|
for (let i = 0; i < t.length; i++) {
|
|
30635
30640
|
const s = t[i];
|
|
30636
30641
|
let n = null;
|
|
30637
|
-
typeof s == "object" ? n = Object.keys(s)[0] : n =
|
|
30642
|
+
typeof s == "object" ? n = Object.keys(s)[0] : n = Ct.getFileName(s.toLowerCase());
|
|
30638
30643
|
const r = await Ui.instance().query(n);
|
|
30639
30644
|
if (r) e = !0;
|
|
30640
30645
|
else {
|
|
@@ -30658,7 +30663,7 @@ class Tt {
|
|
|
30658
30663
|
} = i;
|
|
30659
30664
|
if (this.fileNames && !this.fileNames.includes(s)) continue;
|
|
30660
30665
|
let r;
|
|
30661
|
-
n ? r = new
|
|
30666
|
+
n ? r = new mt(s, i) : r = new Qt(s, i), this.fontMap.set(s, r);
|
|
30662
30667
|
}
|
|
30663
30668
|
P.debug("[FontManager] Loaded font data from cache.");
|
|
30664
30669
|
}
|
|
@@ -30668,7 +30673,7 @@ class Tt {
|
|
|
30668
30673
|
return;
|
|
30669
30674
|
}
|
|
30670
30675
|
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
|
|
30676
|
+
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
30677
|
}
|
|
30673
30678
|
/**
|
|
30674
30679
|
* Just for log usage
|
|
@@ -30758,7 +30763,7 @@ class U0 {
|
|
|
30758
30763
|
const f = o[u], m = t.children[f];
|
|
30759
30764
|
m.updateMatrix(), d.setMatrixAt(u, m.matrix);
|
|
30760
30765
|
}
|
|
30761
|
-
d.matrixAutoUpdate =
|
|
30766
|
+
d.matrixAutoUpdate = bt, d.updateMatrix(), n.push(d);
|
|
30762
30767
|
}), r.sort((a, o) => o - a), r.forEach((a) => t.remove(t.children[a])), n.forEach((a) => {
|
|
30763
30768
|
a.parent = t, t.children.push(a);
|
|
30764
30769
|
}), t.updateMatrix(), console.log("[Inst] " + r.length + "(out of " + e + ") objects instanced to " + n.length + " InstancedMesh");
|
|
@@ -31492,7 +31497,7 @@ const au = (c, t, e = 800, i = 45) => {
|
|
|
31492
31497
|
g(this, "osnapInfo");
|
|
31493
31498
|
g(this, "drawSnapFunctions");
|
|
31494
31499
|
g(this, "snapLineVisible");
|
|
31495
|
-
this.needsFrustumCulled = !1, this.renderOrder = 1e3, this.snapType =
|
|
31500
|
+
this.needsFrustumCulled = !1, this.renderOrder = 1e3, this.snapType = Rt.TripleCross, this.snapLineVisible = !1, this.snapType = e, this.drawSnapFunctions = {
|
|
31496
31501
|
TripleCross: this.drawTripleCorss.bind(this),
|
|
31497
31502
|
Square: this.drawSquare.bind(this),
|
|
31498
31503
|
Triangle: this.drawTriangle.bind(this),
|
|
@@ -31651,7 +31656,7 @@ class N0 {
|
|
|
31651
31656
|
this.overlayRender = t, this.overlayRender?.addDrawableList(this.drawableList), this.initOSnapMarkers();
|
|
31652
31657
|
}
|
|
31653
31658
|
initOSnapMarkers() {
|
|
31654
|
-
const t = new ke(
|
|
31659
|
+
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
31660
|
this.markers[
|
|
31656
31661
|
1
|
|
31657
31662
|
/* Vertex */
|
|
@@ -32441,7 +32446,7 @@ class no {
|
|
|
32441
32446
|
* 在叠加层用云线框高亮指定结果(替换上一个高亮)。
|
|
32442
32447
|
*/
|
|
32443
32448
|
highlight(t) {
|
|
32444
|
-
this.overlayRender && (!this.drawableList && (this.drawableList = new bn("text-search"), this.overlayRender.addDrawableList(this.drawableList)), this.clearHighlight(), this.drawableList.addDrawable(new
|
|
32449
|
+
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
32450
|
}
|
|
32446
32451
|
/**
|
|
32447
32452
|
* 清除当前高亮。
|
|
@@ -32797,7 +32802,7 @@ class bu {
|
|
|
32797
32802
|
g(this, "modelGroup");
|
|
32798
32803
|
this.viewer = t;
|
|
32799
32804
|
const e = new p.Scene();
|
|
32800
|
-
e.matrixAutoUpdate =
|
|
32805
|
+
e.matrixAutoUpdate = bt, e.matrixWorldAutoUpdate = bt, this.scene = e, this.modelGroup = new p.Group(), this.modelGroup.name = "models", this.scene.add(this.modelGroup);
|
|
32801
32806
|
const { width: i, height: s, viewerContainer: n } = t.container;
|
|
32802
32807
|
let r;
|
|
32803
32808
|
try {
|
|
@@ -33161,10 +33166,10 @@ class Pr extends hi {
|
|
|
33161
33166
|
}
|
|
33162
33167
|
addModel(e) {
|
|
33163
33168
|
const i = e.getModelObject();
|
|
33164
|
-
i.name = e.modelId, this.sceneManager.addModel(e), i.matrixAutoUpdate =
|
|
33169
|
+
i.name = e.modelId, this.sceneManager.addModel(e), i.matrixAutoUpdate = bt, i.updateMatrix(), i.updateMatrixWorld(!0), this.loadedModels.push(e), this.enableRender(0);
|
|
33165
33170
|
}
|
|
33166
33171
|
async setFont(e) {
|
|
33167
|
-
!this.fontManager && (this.fontManager = new
|
|
33172
|
+
!this.fontManager && (this.fontManager = new Ct()), await this.fontManager.loadFonts(e);
|
|
33168
33173
|
}
|
|
33169
33174
|
/**
|
|
33170
33175
|
*
|
|
@@ -33464,7 +33469,7 @@ class $o extends Pr {
|
|
|
33464
33469
|
g(this, "requestHeaders");
|
|
33465
33470
|
/** 打印截图进行中:临时强制显示所有图符/文字,避免低缩放时被"视觉过小"逻辑隐藏 */
|
|
33466
33471
|
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(
|
|
33472
|
+
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
33473
|
const i = new p.Vector3(0, 0, 100), s = new p.Vector3(0, 0, 0);
|
|
33469
33474
|
this.cameraManager.setCameraConfig({
|
|
33470
33475
|
eye: i,
|
|
@@ -33563,7 +33568,7 @@ class $o extends Pr {
|
|
|
33563
33568
|
*/
|
|
33564
33569
|
highlightEntityBox(e) {
|
|
33565
33570
|
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
|
|
33571
|
+
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
33572
|
}
|
|
33568
33573
|
/**
|
|
33569
33574
|
* Gets if click-to-highlight entity is enabled. Default is false.
|
|
@@ -33709,7 +33714,7 @@ class $o extends Pr {
|
|
|
33709
33714
|
this.layoutInfos[this.activeLayoutName] = {
|
|
33710
33715
|
homeViewExtent: n,
|
|
33711
33716
|
extent: n
|
|
33712
|
-
}, s.matrixAutoUpdate =
|
|
33717
|
+
}, s.matrixAutoUpdate = bt, this.scene.add(s);
|
|
33713
33718
|
const r = n.max.z;
|
|
33714
33719
|
r > this.camera.position.z && (this.camera.position.z = r, this.camera.updateProjectionMatrix()), this.flyToObject(s);
|
|
33715
33720
|
}
|
|
@@ -34162,10 +34167,10 @@ class $o extends Pr {
|
|
|
34162
34167
|
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
34168
|
let Qe = 0;
|
|
34164
34169
|
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), Ae = (1 - Math.abs(2 * vn - 1)) * Ni,
|
|
34170
|
+
const vn = Math.min(0.55, (1 - ct) * u), Ae = (1 - Math.abs(2 * vn - 1)) * Ni, At = Ae * (1 - Math.abs(Qe * 6 % 2 - 1)), Hi = vn - Ae / 2;
|
|
34166
34171
|
let Ht = 0, Gt = 0, Wt = 0;
|
|
34167
34172
|
const qt = Math.floor(Qe * 6) % 6;
|
|
34168
|
-
qt === 0 ? (Ht = Ae, Gt =
|
|
34173
|
+
qt === 0 ? (Ht = Ae, Gt = At) : qt === 1 ? (Ht = At, Gt = Ae) : qt === 2 ? (Gt = Ae, Wt = At) : qt === 3 ? (Gt = At, Wt = Ae) : qt === 4 ? (Ht = At, Wt = Ae) : (Ht = Ae, Wt = At), l[v] = (Ht + Hi) * 255, l[v + 1] = (Gt + Hi) * 255, l[v + 2] = (Wt + Hi) * 255, f[S] = 0.299 * l[v] + 0.587 * l[v + 1] + 0.114 * l[v + 2];
|
|
34169
34174
|
}
|
|
34170
34175
|
const m = Math.max(1, i), b = new Float32Array(h), y = new Uint8ClampedArray(h), C = new Uint8ClampedArray(h), w = new Uint8ClampedArray(h);
|
|
34171
34176
|
for (let S = 0; S < a; S++) {
|
|
@@ -34475,7 +34480,7 @@ class Mu {
|
|
|
34475
34480
|
*/
|
|
34476
34481
|
async setFont(t) {
|
|
34477
34482
|
const e = Date.now();
|
|
34478
|
-
!this.fontManager && (this.fontManager = new
|
|
34483
|
+
!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
34484
|
}
|
|
34480
34485
|
/**
|
|
34481
34486
|
* Compares two dxf files. Note that:
|
|
@@ -34516,7 +34521,7 @@ class Mu {
|
|
|
34516
34521
|
if (P.info("[DxfCompareHelper] loadFiles in " + (Date.now() - C) / 1e3 + "s"), this.loader.isAborted()) return Promise.reject("[DxfCompareHelper] compare loadFile aborted");
|
|
34517
34522
|
const O = E.value, S = M.value;
|
|
34518
34523
|
C = Date.now();
|
|
34519
|
-
const v = await new
|
|
34524
|
+
const v = await new yt(O, S, i).compare(b);
|
|
34520
34525
|
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
34526
|
U.printMemory("After getting the comparison results"), C = Date.now(), await this.loader.loadEntitiesForCompare(O, S, 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");
|
|
34522
34527
|
const T = O, _ = S;
|
|
@@ -34676,7 +34681,7 @@ class W0 extends Mu {
|
|
|
34676
34681
|
if (P.info("[DxfCompareHelper] loadFiles in " + (Date.now() - x) / 1e3 + "s"), this.loader.isAborted()) return Promise.reject("[DxfCompareHelper] compare loadFile aborted");
|
|
34677
34682
|
const v = O.value, T = S.value;
|
|
34678
34683
|
x = Date.now();
|
|
34679
|
-
const _ = await new
|
|
34684
|
+
const _ = await new yt(v, T, s).compare(C);
|
|
34680
34685
|
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
34686
|
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
34687
|
const A = v, I = T;
|
|
@@ -35088,7 +35093,7 @@ class Y0 extends Pr {
|
|
|
35088
35093
|
};
|
|
35089
35094
|
this.cameraManager.flyToViewpoint(r);
|
|
35090
35095
|
}
|
|
35091
|
-
this.cameraManager.setProjection(
|
|
35096
|
+
this.cameraManager.setProjection(Et.Perspective), this.cameraManager.setNavigationMode(xt.Orbit), this.setupDefaultEvents(), this.setDefaultBackground();
|
|
35092
35097
|
}
|
|
35093
35098
|
setupDefaultEvents() {
|
|
35094
35099
|
let e = !1, i, s = 0, n = 0, r = 0;
|
|
@@ -35430,7 +35435,7 @@ class X0 extends Pr {
|
|
|
35430
35435
|
};
|
|
35431
35436
|
this.cameraManager.flyToViewpoint(r);
|
|
35432
35437
|
}
|
|
35433
|
-
this.cameraManager.setProjection(
|
|
35438
|
+
this.cameraManager.setProjection(Et.Perspective), this.cameraManager.setNavigationMode(xt.Orbit), this.setupDefaultEvents(), this.setDefaultBackground(), this.addEventListener(ce.BeforeRender, () => {
|
|
35434
35439
|
this.update3dTiles();
|
|
35435
35440
|
});
|
|
35436
35441
|
}
|
|
@@ -35607,7 +35612,7 @@ class X0 extends Pr {
|
|
|
35607
35612
|
this.spinner.increaseJobCount();
|
|
35608
35613
|
}, l.onLoadModel = (d) => {
|
|
35609
35614
|
d.traverse((u) => {
|
|
35610
|
-
u.matrixAutoUpdate && (u.matrixAutoUpdate =
|
|
35615
|
+
u.matrixAutoUpdate && (u.matrixAutoUpdate = bt, u.updateMatrix()), u.isMesh && (u.castShadow = !0, u.receiveShadow = !0), u.geometry && u.layers.enableAll();
|
|
35611
35616
|
}), this.enableRender(), setTimeout(() => this.spinner.decreaseJobCount(), 100);
|
|
35612
35617
|
}, l.setCamera(this.camera), l.setResolutionFromRenderer(this.camera, this.renderer), l.update(), h) {
|
|
35613
35618
|
h.applyMatrix4(s.getView().transform), o.pickUsageGroup.applyMatrix4(s.getView().transform), this.pickUsageScene.add(o.pickUsageGroup), this.addModel(o), this.cameraManager.adjustCameraByBBox(a);
|
|
@@ -36246,14 +36251,14 @@ export {
|
|
|
36246
36251
|
hn as ByBlock,
|
|
36247
36252
|
_o as ByLayer,
|
|
36248
36253
|
S0 as CSS2DObjectUtils,
|
|
36249
|
-
|
|
36254
|
+
Et as CameraProjection,
|
|
36250
36255
|
T0 as CancelablePromise,
|
|
36251
36256
|
xn as CanvasRender,
|
|
36252
36257
|
gs as ColorUtils,
|
|
36253
36258
|
U as CommonUtils,
|
|
36254
|
-
|
|
36259
|
+
Ot as CompareDrawable,
|
|
36255
36260
|
Ho as Container,
|
|
36256
|
-
|
|
36261
|
+
xt as ControlsMode,
|
|
36257
36262
|
Pe as CoordinateUtils,
|
|
36258
36263
|
xh as DecimalPrecisionRange,
|
|
36259
36264
|
zn as DefaultCameraFar,
|
|
@@ -36266,17 +36271,17 @@ export {
|
|
|
36266
36271
|
ci as Drawable,
|
|
36267
36272
|
bn as DrawableList,
|
|
36268
36273
|
We as DxfChangeType,
|
|
36269
|
-
|
|
36274
|
+
yt as DxfCompare,
|
|
36270
36275
|
W0 as DxfCompareHelper,
|
|
36271
36276
|
Ua as DxfCompareMarkupManager,
|
|
36272
36277
|
X as DxfLoader,
|
|
36273
36278
|
r1 as DxfParser,
|
|
36274
36279
|
Be as DxfRenderOrder,
|
|
36275
|
-
|
|
36280
|
+
Dt as DxfUtils,
|
|
36276
36281
|
Sh as EdgeUtils,
|
|
36277
36282
|
hi as Event,
|
|
36278
36283
|
sa as ExportUtils,
|
|
36279
|
-
|
|
36284
|
+
Ct as FontManager,
|
|
36280
36285
|
A0 as FpsUtils,
|
|
36281
36286
|
ru as GenerateMeshBvhWorker,
|
|
36282
36287
|
N as GeometryUtils,
|
|
@@ -36295,7 +36300,7 @@ export {
|
|
|
36295
36300
|
oi as LoadingHelper,
|
|
36296
36301
|
Me as MaterialUtils,
|
|
36297
36302
|
F as MathUtils,
|
|
36298
|
-
|
|
36303
|
+
bt as MatrixAutoUpdate,
|
|
36299
36304
|
ye as MergeUtils,
|
|
36300
36305
|
ef as Mesh,
|
|
36301
36306
|
Zo as MeshBvhHelper,
|
|
@@ -36306,7 +36311,7 @@ export {
|
|
|
36306
36311
|
sn as NestedCompareTypes,
|
|
36307
36312
|
N0 as OSnapHelper,
|
|
36308
36313
|
k0 as OSnapIconSize,
|
|
36309
|
-
|
|
36314
|
+
Rt as OSnapMarkerType,
|
|
36310
36315
|
cu as OSnapType,
|
|
36311
36316
|
j0 as ObjectPixelSizeHelper,
|
|
36312
36317
|
Q as ObjectUtils,
|