@maqiuyao/dxf-viewer 0.2.1 → 0.2.2

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.
@@ -16,8 +16,8 @@ import jn from "i18next";
16
16
  import { mergeGeometries as me } from "three/examples/jsm/utils/BufferGeometryUtils.js";
17
17
  import { Earcut as Vn } from "three/src/extras/Earcut.js";
18
18
  import Un from "2d-polygon-self-intersections";
19
- import { SimplifyModifier as Hn } from "three/examples/jsm/modifiers/SimplifyModifier.js";
20
- import { SVGObject as Nn } from "three/examples/jsm/renderers/SVGRenderer.js";
19
+ import { SimplifyModifier as Nn } from "three/examples/jsm/modifiers/SimplifyModifier.js";
20
+ import { SVGObject as Hn } from "three/examples/jsm/renderers/SVGRenderer.js";
21
21
  import { RGBELoader as Gn } from "three/examples/jsm/loaders/RGBELoader.js";
22
22
  import * as Wn from "js-base64";
23
23
  import qn from "concaveman";
@@ -1179,7 +1179,7 @@ class ge {
1179
1179
  return n.x /= i.clientWidth, n.y /= i.clientHeight, n;
1180
1180
  }
1181
1181
  }
1182
- class Hc {
1182
+ class Nc {
1183
1183
  /**
1184
1184
  * Creates CSS2DObject with HTMLElement
1185
1185
  */
@@ -1218,7 +1218,7 @@ class Hc {
1218
1218
  }
1219
1219
  const Fa = {
1220
1220
  "Precision from file": 99
1221
- }, Nc = (h, t) => h.toFixed(t === Fa["Precision from file"] ? 2 : t), za = "en", Xe = !1, ja = 10, Pe = 11, Tt = 12, qr = 583902, Gc = [0.031, 0.906, 0.867, 0.5], Zi = [0.3, 0.3, 0.3, 0.8], Yr = 0.5, Ki = 0.1, $i = 5e3, Va = 45, Wc = "x-viewer-iconfont", qc = "x-viewer-iconfont2", Xr = 10, Is = new d.Vector3(), ks = new d.Vector3(), Ds = new d.Vector3(), ri = new d.Vector3(), Je = new d.Vector3(), Bs = new d.Triangle();
1221
+ }, Hc = (h, t) => h.toFixed(t === Fa["Precision from file"] ? 2 : t), za = "en", Xe = !1, ja = 10, Pe = 11, Tt = 12, qr = 583902, Gc = [0.031, 0.906, 0.867, 0.5], Zi = [0.3, 0.3, 0.3, 0.8], Yr = 0.5, Ki = 0.1, $i = 5e3, Va = 45, Wc = "x-viewer-iconfont", qc = "x-viewer-iconfont2", Xr = 10, Is = new d.Vector3(), ks = new d.Vector3(), Ds = new d.Vector3(), ri = new d.Vector3(), Je = new d.Vector3(), Bs = new d.Triangle();
1222
1222
  function Ua(h, t, e, i, s) {
1223
1223
  const r = [], n = {};
1224
1224
  let a, o, l, c;
@@ -1229,7 +1229,7 @@ function Ua(h, t, e, i, s) {
1229
1229
  for (m = 0, g = t.length; m < g; m++)
1230
1230
  s[m] = r[t[m]], i[s[m]] = t[m];
1231
1231
  }
1232
- function Ha(h, t, e, i) {
1232
+ function Na(h, t, e, i) {
1233
1233
  for (let s = 0, r = h; s < r; s += 3) {
1234
1234
  const n = t[s] * 3, a = t[s + 1] * 3, o = t[s + 2] * 3;
1235
1235
  Is.set(e[n], e[n + 1], e[n + 2]), ks.set(e[a], e[a + 1], e[a + 2]), Ds.set(e[o], e[o + 1], e[o + 2]), d.Triangle.getNormal(Is, ks, Ds, ri), i.push({
@@ -1238,7 +1238,7 @@ function Ha(h, t, e, i) {
1238
1238
  }
1239
1239
  }
1240
1240
  const Ji = [new d.Vector3(1, 0, 0), new d.Vector3(0, 1, 0), new d.Vector3(0, 0, 1), new d.Vector3(1, 1, 0), new d.Vector3(0, 1, 1), new d.Vector3(1, 0, 1), new d.Vector3(1, 1, 1), new d.Vector3(0, 0, 0)];
1241
- function Na(h, t) {
1241
+ function Ha(h, t) {
1242
1242
  return Je.addVectors(h, t), Je.x === 0 || Je.y === 0 || Je.z === 0;
1243
1243
  }
1244
1244
  class Ga {
@@ -1249,7 +1249,7 @@ class Ga {
1249
1249
  const s = [], r = [], n = [];
1250
1250
  Ua(t, e, s, r, n);
1251
1251
  const a = [];
1252
- Ha(e.length, n, s, a);
1252
+ Na(e.length, n, s, a);
1253
1253
  const o = [], l = Math.cos(d.MathUtils.DEG2RAD * i), c = {};
1254
1254
  let u = !1;
1255
1255
  for (let f = 0, m = e.length; f < m; f += 3) {
@@ -1387,7 +1387,7 @@ class Ga {
1387
1387
  for (const k of A) {
1388
1388
  const B = O(M, k), L = u[k];
1389
1389
  if (!L.inited) continue;
1390
- const W = Na(P, L.point);
1390
+ const W = Ha(P, L.point);
1391
1391
  if (B && !W || !B && W) return !1;
1392
1392
  }
1393
1393
  const I = m[M];
@@ -1739,7 +1739,7 @@ class R {
1739
1739
  }
1740
1740
  }
1741
1741
  }
1742
- const es = 1e7, zs = new d.Box2(), js = new d.Box2(), Vs = new d.Vector3(), Us = new d.Vector3(), Hs = new d.Vector3(), it = new d.Triangle();
1742
+ const es = 1e7, zs = new d.Box2(), js = new d.Box2(), Vs = new d.Vector3(), Us = new d.Vector3(), Ns = new d.Vector3(), it = new d.Triangle();
1743
1743
  class U {
1744
1744
  /**
1745
1745
  * Compares two materials
@@ -1844,7 +1844,7 @@ class U {
1844
1844
  static getLineSegmentsIntersectingPoint(t, e) {
1845
1845
  const { start: i, end: s } = t, { start: r, end: n } = e, a = Vs.subVectors(s, i).normalize(), o = Us.subVectors(n, r).normalize();
1846
1846
  if (a.dot(o) === 1) return null;
1847
- const l = Hs.subVectors(r, i), c = a.clone().cross(o), u = l.clone().cross(o), f = l.clone().dot(c);
1847
+ const l = Ns.subVectors(r, i), c = a.clone().cross(o), u = l.clone().cross(o), f = l.clone().dot(c);
1848
1848
  if (f >= 1e-5 || f <= -1e-5) return null;
1849
1849
  const m = c.lengthSq();
1850
1850
  if (R.areNumbersEqual(0, m)) return;
@@ -1852,7 +1852,7 @@ class U {
1852
1852
  return x.equals(i) || x.equals(s) ? null : x;
1853
1853
  }
1854
1854
  static isPointOnLineSegment(t, e, i = 1e-3) {
1855
- const { start: s, end: r } = e, n = Vs.subVectors(s, r).length(), a = Us.subVectors(t, s).length(), o = Hs.subVectors(t, r).length();
1855
+ const { start: s, end: r } = e, n = Vs.subVectors(s, r).length(), a = Us.subVectors(t, s).length(), o = Ns.subVectors(t, r).length();
1856
1856
  return Math.abs(n - (a + o)) <= i;
1857
1857
  }
1858
1858
  static isPointOnLineSegments(t, e, i = 1e-3) {
@@ -2052,7 +2052,7 @@ const Xc = {
2052
2052
  boxSelect: "Box select an area to confirm the screenshot range",
2053
2053
  pickMarkup: "Click on a markup to confirm the screenshot range"
2054
2054
  }
2055
- }, Ns = {
2055
+ }, Hs = {
2056
2056
  ProgressBar: {
2057
2057
  Loading: "正在加载",
2058
2058
  Comparing: "正在对比"
@@ -2067,10 +2067,10 @@ je.init({
2067
2067
  debug: !1,
2068
2068
  resources: {
2069
2069
  en: {
2070
- translation: Ns
2070
+ translation: Hs
2071
2071
  },
2072
2072
  cn: {
2073
- translation: Ns
2073
+ translation: Hs
2074
2074
  }
2075
2075
  }
2076
2076
  });
@@ -3353,7 +3353,7 @@ class Kc {
3353
3353
  */
3354
3354
  static simplifyGeometry(t, e) {
3355
3355
  const i = this.getNumberOfVerticesToRemove(t, e);
3356
- return i > 0 ? new Hn().modify(t, i) : t;
3356
+ return i > 0 ? new Nn().modify(t, i) : t;
3357
3357
  }
3358
3358
  /**
3359
3359
  * Gets number of vertices to remove
@@ -3369,7 +3369,7 @@ const $c = 10;
3369
3369
  var nt = /* @__PURE__ */ ((h) => (h.TripleCross = "TripleCross", h.Square = "Square", h.Triangle = "Triangle", h.CircleWithCross = "CircleWithCross", h.Cross = "Cross", h.Perpendicular = "Perpendicular", h))(nt || {});
3370
3370
  class Jc {
3371
3371
  static createSVGObject(t) {
3372
- return new Nn(t);
3372
+ return new Hn(t);
3373
3373
  }
3374
3374
  }
3375
3375
  class Fi {
@@ -11639,7 +11639,7 @@ class ed {
11639
11639
  }
11640
11640
  var ae = /* @__PURE__ */ ((h) => (h.MouseClick = "mouseclick", h.LayoutChange = "layoutchange", h.ModelLoad = "modelload", h.BeforeRender = "beforerender", h.AfterRender = "afterrender", h.OnAnimate = "onanimate", h.CameraChange = "camerachange", h.ControlChange = "controlchange", h.BoxSelectActivate = "boxselectactivate", h.BoxSelectDeactivate = "boxselectdeactivate", h.PickMarkupActivate = "pickmarkupactivate", h.PickMarkupDeactivate = "pickmarkupdeactivate", h.MarkupActivate = "markupactivate", h.MarkupDeactivate = "markupdeactivate", h.MarkupAdd = "markupadd", h.MarkupUpdate = "markupupdate", h.MarkupRemove = "markupremove", h.BeforeRemoveMarkup = "beforeremovemarkup", h.MeasurementActivate = "measurementactivate", h.MeasurementDeactivate = "measurementdeactivate", h.MeasurementAdd = "measurementadd", h.MeasurementRemove = "measurementremove", h.HotpointClick = "hotpointclick", h))(ae || {});
11641
11641
  const qs = {};
11642
- class Ni extends St {
11642
+ class Hi extends St {
11643
11643
  constructor(e) {
11644
11644
  super();
11645
11645
  p(this, "viewer");
@@ -11797,7 +11797,7 @@ class Gi extends St {
11797
11797
  }
11798
11798
  setDrawableDatas(e) {
11799
11799
  for (let i = 0; i < e.length; i++) {
11800
- const s = e[i], r = Ni.createDrawable(s);
11800
+ const s = e[i], r = Hi.createDrawable(s);
11801
11801
  this.addDrawable(r);
11802
11802
  }
11803
11803
  }
@@ -11995,7 +11995,7 @@ class et extends Ct {
11995
11995
  return "CompareDrawable";
11996
11996
  }
11997
11997
  }
11998
- Ni._registerDrawableClass(et);
11998
+ Hi._registerDrawableClass(et);
11999
11999
  const Ja = [
12000
12000
  0,
12001
12001
  16711680,
@@ -12254,7 +12254,7 @@ const Ja = [
12254
12254
  14079702,
12255
12255
  16777215
12256
12256
  ], Qa = ["PROXY", "REGION", "INSERT", "HATCH"];
12257
- function Ht(h) {
12257
+ function Nt(h) {
12258
12258
  return Ja[h];
12259
12259
  }
12260
12260
  function Ae(h) {
@@ -12299,7 +12299,7 @@ function Q(h, t) {
12299
12299
  case 62:
12300
12300
  if (!h.isTrueColor) {
12301
12301
  const e = t.value;
12302
- h.colorIndex = e, e < 0 && console.warn("[DxfParser] Negative colorIndex indicates layer is off or BYBLOCK/BYLAYER"), h.color = Ht(Math.abs(e));
12302
+ h.colorIndex = e, e < 0 && console.warn("[DxfParser] Negative colorIndex indicates layer is off or BYBLOCK/BYLAYER"), h.color = Nt(Math.abs(e));
12303
12303
  }
12304
12304
  break;
12305
12305
  // 67: 模型空间/图纸空间(0=model, 1=paper)
@@ -12941,7 +12941,7 @@ const Ke = class Ke {
12941
12941
  };
12942
12942
  p(Ke, "ENTITY_COLOR_ADDED", 65280), p(Ke, "ENTITY_COLOR_REMOVED", 16711680), p(Ke, "ENTITY_COLOR_NO_CHANGE", 10066329), p(Ke, "ENTITY_COLOR_MARKUP", 16744231), p(Ke, "ENTITY_TYPES_TO_IGNORE", ["ATTRIB", "SEQEND"]);
12943
12943
  let qe = Ke;
12944
- var H = /* @__PURE__ */ ((h) => (h[h.Object = 0] = "Object", h[h.Point = 1] = "Point", h[h.Line = 2] = "Line", h[h.LineSegment = 3] = "LineSegment", h[h.Mesh = 4] = "Mesh", h))(H || {});
12944
+ var N = /* @__PURE__ */ ((h) => (h[h.Object = 0] = "Object", h[h.Point = 1] = "Point", h[h.Line = 2] = "Line", h[h.LineSegment = 3] = "LineSegment", h[h.Mesh = 4] = "Mesh", h))(N || {});
12945
12945
  const is = new si(), ss = new ws();
12946
12946
  class F {
12947
12947
  constructor(t = 0) {
@@ -13196,7 +13196,7 @@ class rt {
13196
13196
  const T = [];
13197
13197
  if (u.forEach((b) => {
13198
13198
  const E = t.children[b], O = E.geometry?.clone();
13199
- if (O.applyMatrix4(E.matrix), O.userData.isLineSegments = E.type === H.LineSegment, m.push(O), e) {
13199
+ if (O.applyMatrix4(E.matrix), O.userData.isLineSegments = E.type === N.LineSegment, m.push(O), e) {
13200
13200
  const _ = O.attributes?.position?.count, C = O.index?.count || 0;
13201
13201
  T.push({
13202
13202
  batchId: g,
@@ -13208,15 +13208,15 @@ class rt {
13208
13208
  }
13209
13209
  }), m.length === 0) return;
13210
13210
  let v;
13211
- if (f.type === H.Mesh) {
13211
+ if (f.type === N.Mesh) {
13212
13212
  const b = me(m);
13213
13213
  if (!b) return;
13214
13214
  b.userData = {}, v = new F(f.type), v.geometry = b, v.material = f.material, n.push(v);
13215
- } else if (f.type === H.Line || f.type === H.LineSegment) {
13215
+ } else if (f.type === N.Line || f.type === N.LineSegment) {
13216
13216
  const b = ce.mergeLineGeometries(m, e, f.material instanceof d.LineDashedMaterial || f.material instanceof d.ShaderMaterial, T);
13217
13217
  if (!b) return;
13218
- v = new F(H.LineSegment), v.geometry = b, v.material = f.material, a.push(v);
13219
- } else if (f.type === H.Point) {
13218
+ v = new F(N.LineSegment), v.geometry = b, v.material = f.material, a.push(v);
13219
+ } else if (f.type === N.Point) {
13220
13220
  const b = me(m);
13221
13221
  if (!b) return;
13222
13222
  b.userData = {}, v = new F(f.type), v.geometry = b, v.material = f.material, o.push(v);
@@ -13253,7 +13253,7 @@ class rt {
13253
13253
  */
13254
13254
  static isFilteredByOtherFactors(t, e) {
13255
13255
  const i = t;
13256
- if (i.type === H.Mesh && i.material && i.material.isShaderMaterial) return !0;
13256
+ if (i.type === N.Mesh && i.material && i.material.isShaderMaterial) return !0;
13257
13257
  let s = !1, r = t;
13258
13258
  for (; r && r !== e; ) {
13259
13259
  const n = r.userData;
@@ -13304,10 +13304,10 @@ class rt {
13304
13304
  const C = [];
13305
13305
  if (T.forEach((M) => {
13306
13306
  const P = t[M], A = P.geometry?.clone();
13307
- if (v.material instanceof d.LineBasicMaterial && A.deleteAttribute("lineDistance"), this.applyMatrix(A, P, e), A.userData.isLineSegments = P.type === H.LineSegment, b.push(A), r) {
13307
+ if (v.material instanceof d.LineBasicMaterial && A.deleteAttribute("lineDistance"), this.applyMatrix(A, P, e), A.userData.isLineSegments = P.type === N.LineSegment, b.push(A), r) {
13308
13308
  const I = A.attributes?.position?.count, k = A.index?.count || 0;
13309
13309
  let B;
13310
- (v.type === H.Line || v.type === H.LineSegment) && (!A.boundingSphere && A.computeBoundingSphere(), B = A.boundingSphere?.clone());
13310
+ (v.type === N.Line || v.type === N.LineSegment) && (!A.boundingSphere && A.computeBoundingSphere(), B = A.boundingSphere?.clone());
13311
13311
  const L = {
13312
13312
  batchId: E,
13313
13313
  positionStart: O,
@@ -13320,15 +13320,15 @@ class rt {
13320
13320
  }
13321
13321
  }), b.length === 0) return;
13322
13322
  let w;
13323
- if (v.type === H.Mesh) {
13323
+ if (v.type === N.Mesh) {
13324
13324
  const M = me(b);
13325
13325
  if (!M) return;
13326
13326
  M.userData = {}, w = new F(v.type), w.geometry = M, w.material = v.material, c.push(w);
13327
- } else if (v.type === H.Line || v.type === H.LineSegment) {
13327
+ } else if (v.type === N.Line || v.type === N.LineSegment) {
13328
13328
  const M = ce.mergeLineGeometries(b, r, v.material instanceof d.LineDashedMaterial || v.material instanceof d.ShaderMaterial, C);
13329
13329
  if (!M) return;
13330
- w = new F(H.LineSegment), w.geometry = M, w.material = v.material, u.push(w);
13331
- } else if (v.type === H.Point) {
13330
+ w = new F(N.LineSegment), w.geometry = M, w.material = v.material, u.push(w);
13331
+ } else if (v.type === N.Point) {
13332
13332
  const M = me(b);
13333
13333
  if (!M) return;
13334
13334
  M.userData = {}, w = new F(v.type), w.geometry = M, w.material = v.material, f.push(w);
@@ -13385,7 +13385,7 @@ class rt {
13385
13385
  * - They have the same type or the same draw type( Mesh or Line or Point).
13386
13386
  */
13387
13387
  static areObjectsMergeable(t, e) {
13388
- 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);
13388
+ 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 === N.Line || t.type === N.LineSegment) && (e.type === N.Line || e.type === N.LineSegment);
13389
13389
  }
13390
13390
  }
13391
13391
  p(rt, "MergeInfo", {
@@ -15542,7 +15542,7 @@ function Uo(h) {
15542
15542
  return null;
15543
15543
  }
15544
15544
  }
15545
- class Ho {
15545
+ class No {
15546
15546
  constructor() {
15547
15547
  p(this, "ForEntityName", "LEADER");
15548
15548
  }
@@ -15557,7 +15557,7 @@ class Ho {
15557
15557
  for (; !t.isEOF() && e.code !== 0; )
15558
15558
  switch (e.code) {
15559
15559
  case 10:
15560
- i.vertices.push(No(t)), e = t.lastReadGroup;
15560
+ i.vertices.push(Ho(t)), e = t.lastReadGroup;
15561
15561
  break;
15562
15562
  case 3:
15563
15563
  i.dimensionStyle = e.value, e = t.next();
@@ -15589,7 +15589,7 @@ class Ho {
15589
15589
  case 1070:
15590
15590
  if (s) {
15591
15591
  const r = Uo(e.value);
15592
- r && (e = t.next(), (e.code == 1005 || e.code == 1040 || e.code == 1070) && (r === "DIMLDRBLK" ? i.arrowHeadBlockHandle = e.value : r === "DIMASZ" ? i.arrowHeight = e.value : r === "DIMSCALE" ? i.arrowHeadScale = e.value : r === "DIMCLRD" && e.value > 0 && (i.colorIndex = e.value, i.color = Ht(Math.abs(e.value)))));
15592
+ r && (e = t.next(), (e.code == 1005 || e.code == 1040 || e.code == 1070) && (r === "DIMLDRBLK" ? i.arrowHeadBlockHandle = e.value : r === "DIMASZ" ? i.arrowHeight = e.value : r === "DIMSCALE" ? i.arrowHeadScale = e.value : r === "DIMCLRD" && e.value > 0 && (i.colorIndex = e.value, i.color = Nt(Math.abs(e.value)))));
15593
15593
  }
15594
15594
  e = t.next();
15595
15595
  break;
@@ -15600,7 +15600,7 @@ class Ho {
15600
15600
  return i;
15601
15601
  }
15602
15602
  }
15603
- function No(h) {
15603
+ function Ho(h) {
15604
15604
  const t = {};
15605
15605
  let e = h.lastReadGroup || h.next();
15606
15606
  const i = e.code;
@@ -17075,7 +17075,7 @@ class yl {
17075
17075
  }
17076
17076
  }
17077
17077
  function xl(h) {
17078
- h.registerEntityHandler(Mo), h.registerEntityHandler(To), h.registerEntityHandler(So), h.registerEntityHandler(Oo), h.registerEntityHandler(Eo), h.registerEntityHandler(Po), h.registerEntityHandler(Ao), h.registerEntityHandler(ko), h.registerEntityHandler(zo), h.registerEntityHandler(jo), h.registerEntityHandler(Vo), h.registerEntityHandler(Ho), h.registerEntityHandler(Go), h.registerEntityHandler(qo), h.registerEntityHandler(Yo), h.registerEntityHandler(Xo), h.registerEntityHandler(Zo), h.registerEntityHandler(Qo), h.registerEntityHandler(tl), h.registerEntityHandler(il), h.registerEntityHandler(sl), h.registerEntityHandler(rl), h.registerEntityHandler(nl), h.registerEntityHandler(ol), h.registerEntityHandler(ll), h.registerEntityHandler(hl), h.registerEntityHandler(cl);
17078
+ h.registerEntityHandler(Mo), h.registerEntityHandler(To), h.registerEntityHandler(So), h.registerEntityHandler(Oo), h.registerEntityHandler(Eo), h.registerEntityHandler(Po), h.registerEntityHandler(Ao), h.registerEntityHandler(ko), h.registerEntityHandler(zo), h.registerEntityHandler(jo), h.registerEntityHandler(Vo), h.registerEntityHandler(No), h.registerEntityHandler(Go), h.registerEntityHandler(qo), h.registerEntityHandler(Yo), h.registerEntityHandler(Xo), h.registerEntityHandler(Zo), h.registerEntityHandler(Qo), h.registerEntityHandler(tl), h.registerEntityHandler(il), h.registerEntityHandler(sl), h.registerEntityHandler(rl), h.registerEntityHandler(nl), h.registerEntityHandler(ol), h.registerEntityHandler(ll), h.registerEntityHandler(hl), h.registerEntityHandler(cl);
17079
17079
  }
17080
17080
  function bl(h) {
17081
17081
  h.registerObjectHandler(dl), h.registerObjectHandler(ul), h.registerObjectHandler(fl), h.registerObjectHandler(pl), h.registerObjectHandler(ml), h.registerObjectHandler(yl);
@@ -17451,7 +17451,7 @@ class wl {
17451
17451
  w.handle = r.value, r = t.next();
17452
17452
  break;
17453
17453
  case 62:
17454
- w.visible = r.value >= 0, w.colorIndex = Math.abs(r.value), w.color = Ht(w.colorIndex), r = t.next();
17454
+ w.visible = r.value >= 0, w.colorIndex = Math.abs(r.value), w.color = Nt(w.colorIndex), r = t.next();
17455
17455
  break;
17456
17456
  case 70:
17457
17457
  w.flag = r.value, w.frozen = (w.flag & 1) > 0, r = t.next();
@@ -18008,7 +18008,7 @@ const Ee = new d.Vector3(1, 0, 0), os = new d.Vector3(0, 1, 0), Ot = new d.Vecto
18008
18008
  color: ht
18009
18009
  }), Et = new d.MeshBasicMaterial({
18010
18010
  color: ht
18011
- }), dr = new d.BufferGeometry().setFromPoints([new d.Vector3()]), ur = new d.Matrix4(), De = new d.Matrix4(), re = new d.Matrix4(), z = new d.Vector3(), Z = new d.Vector3(), Be = new d.Vector3(), Kt = new d.Vector2(), le = new d.Quaternion(), vi = new d.Object3D(), He = new d.Box3(), fr = new d.PointsMaterial({
18011
+ }), dr = new d.BufferGeometry().setFromPoints([new d.Vector3()]), ur = new d.Matrix4(), De = new d.Matrix4(), re = new d.Matrix4(), z = new d.Vector3(), Z = new d.Vector3(), Be = new d.Vector3(), Kt = new d.Vector2(), le = new d.Quaternion(), vi = new d.Object3D(), Ne = new d.Box3(), fr = new d.PointsMaterial({
18012
18012
  color: 65280,
18013
18013
  size: 5,
18014
18014
  depthTest: !1
@@ -18565,8 +18565,8 @@ const Ee = new d.Vector3(1, 0, 0), os = new d.Vector3(0, 1, 0), Ot = new d.Vecto
18565
18565
  const I = re.identity();
18566
18566
  for (; A && A.userData.isLayoutLevelObject !== !0; )
18567
18567
  I.premultiply(A.matrix), A = A.parent;
18568
- He.makeEmpty();
18569
- const k = F.getBox(P, He);
18568
+ Ne.makeEmpty();
18569
+ const k = F.getBox(P, Ne);
18570
18570
  k.applyMatrix4(I), M.type === _e.Added ? !f && (M.box = new d.Box3().copy(k)) : M.type === _e.Removed ? f && (M.box = new d.Box3().copy(k)) : M.type === _e.Modified && (M.box ? M.box.union(k) : M.box = new d.Box3().copy(k));
18571
18571
  }
18572
18572
  }
@@ -18758,9 +18758,9 @@ const Ee = new d.Vector3(1, 0, 0), os = new d.Vector3(0, 1, 0), Ot = new d.Vecto
18758
18758
  const v = new d.Vector3();
18759
18759
  let b = !1;
18760
18760
  this.enableRTC && (b = U.checkAndRebasePositionsOnRTC(y, v));
18761
- const E = new d.BufferGeometry().setFromPoints(y), O = new F(H.Line);
18761
+ const E = new d.BufferGeometry().setFromPoints(y), O = new F(N.Line);
18762
18762
  O.geometry = E, O.material = oe;
18763
- const _ = new F(H.Point);
18763
+ const _ = new F(N.Point);
18764
18764
  return _.geometry = dr, _.material = bi, _.matrix.setPosition(e.center.x, e.center.y, e.center.z), _.userData.isSnapObject = !0, _.userData.type = "CircleCenter", _.layers.set(Pe), O.add(_), b && (this.setRTCUserData(O), O.matrix.setPosition(v.x, v.y, 0)), O.layers.enableAll(), O;
18765
18765
  }
18766
18766
  // 说明:以下为源码中注释掉的 loadMText 旧实现(保真保留)。
@@ -18918,8 +18918,8 @@ const Ee = new d.Vector3(1, 0, 0), os = new d.Vector3(0, 1, 0), Ot = new d.Vecto
18918
18918
  encoding: this.getTextEncoding(r)
18919
18919
  }), a = this.getMTextGroup(n, e, r, i, s), o = a && a.object;
18920
18920
  if (!o) return;
18921
- o.matrix.decompose(Z, le, Be), e.position && (Z.x += e.position.x, Z.y += e.position.y, o.matrix.compose(Z, le, Be)), He.makeEmpty();
18922
- const l = F.getBox(o, He), c = l.getSize(z), u = e.width || c.x, f = e.height || c.y, m = e.lineSpaceFactor || 1.657, g = e.text;
18921
+ o.matrix.decompose(Z, le, Be), e.position && (Z.x += e.position.x, Z.y += e.position.y, o.matrix.compose(Z, le, Be)), Ne.makeEmpty();
18922
+ const l = F.getBox(o, Ne), c = l.getSize(z), u = e.width || c.x, f = e.height || c.y, m = e.lineSpaceFactor || 1.657, g = e.text;
18923
18923
  let x = 0, y = 0;
18924
18924
  switch (document.createElement("canvas").getContext("2d"), e.attachmentPoint) {
18925
18925
  case 1:
@@ -19037,8 +19037,8 @@ const Ee = new d.Vector3(1, 0, 0), os = new d.Vector3(0, 1, 0), Ot = new d.Vecto
19037
19037
  encoding: this.getTextEncoding(r)
19038
19038
  }), a = this.getMTextGroup(n, e, r, i, s), o = a && a.object;
19039
19039
  if (!o) return;
19040
- o.matrix.decompose(Z, le, Be), e.position && (Z.x += e.position.x, Z.y += e.position.y, o.matrix.compose(Z, le, Be)), He.makeEmpty();
19041
- const l = F.getBox(o, He), c = l.getSize(z), u = e.width || c.x, f = e.height || c.y, m = e.lineSpaceFactor || 1.657, g = e.text;
19040
+ o.matrix.decompose(Z, le, Be), e.position && (Z.x += e.position.x, Z.y += e.position.y, o.matrix.compose(Z, le, Be)), Ne.makeEmpty();
19041
+ const l = F.getBox(o, Ne), c = l.getSize(z), u = e.width || c.x, f = e.height || c.y, m = e.lineSpaceFactor || 1.657, g = e.text;
19042
19042
  let x = 0, y = 0;
19043
19043
  switch (e.attachmentPoint) {
19044
19044
  case 1:
@@ -19163,14 +19163,14 @@ const Ee = new d.Vector3(1, 0, 0), os = new d.Vector3(0, 1, 0), Ot = new d.Vecto
19163
19163
  l.length > 0 && (w(l), l = []);
19164
19164
  const P = new F();
19165
19165
  if (C.length > 0) {
19166
- !g && (g = i.colorIndex), v !== void 0 && v !== 256 ? (i.color = Ht(v), i.colorIndex = v) : i.colorIndex = g;
19166
+ !g && (g = i.colorIndex), v !== void 0 && v !== 256 ? (i.color = Nt(v), i.colorIndex = v) : i.colorIndex = g;
19167
19167
  const A = this.getColor(i, r, n), I = C.filter((B) => B instanceof d.ExtrudeGeometry), k = C.filter((B) => !(B instanceof d.ExtrudeGeometry));
19168
19168
  if (I.length > 0) {
19169
- const B = new F(H.Mesh);
19169
+ const B = new F(N.Mesh);
19170
19170
  B.geometry = me(I), B.material = this.getMeshBasicMaterial(A), P.add(B);
19171
19171
  }
19172
19172
  if (k.length > 0) {
19173
- const B = new F(H.LineSegment);
19173
+ const B = new F(N.LineSegment);
19174
19174
  B.geometry = me(k), B.material = this.getLineBasicMaterial(A), P.add(B);
19175
19175
  }
19176
19176
  }
@@ -19251,7 +19251,7 @@ const Ee = new d.Vector3(1, 0, 0), os = new d.Vector3(0, 1, 0), Ot = new d.Vecto
19251
19251
  const s = new d.Vector3();
19252
19252
  let r = !1;
19253
19253
  this.enableRTC && (r = U.checkAndRebasePositionsOnRTC(i, s));
19254
- const n = new d.BufferGeometry().setFromPoints(i), a = new F(H.Line);
19254
+ const n = new d.BufferGeometry().setFromPoints(i), a = new F(N.Line);
19255
19255
  return a.geometry = n, a.material = oe, r && (this.setRTCUserData(a), a.matrix.setPosition(s.x, s.y, 0)), a.layers.enableAll(), a;
19256
19256
  }
19257
19257
  loadSpline(e, i) {
@@ -19269,7 +19269,7 @@ const Ee = new d.Vector3(1, 0, 0), os = new d.Vector3(0, 1, 0), Ot = new d.Vecto
19269
19269
  this.enableRTC && (g = U.checkAndRebasePositionsOnRTC(f, m));
19270
19270
  const x = U.getAdjacentNonRepeatPoints(f);
19271
19271
  if (x.length < 2) return S.warn("[Dxf] Spline entity (handle '%s') contains less than 2 points, ignored!", e.handle), void 0;
19272
- const y = new d.BufferGeometry().setFromPoints(x), T = new F(H.Line);
19272
+ const y = new d.BufferGeometry().setFromPoints(x), T = new F(N.Line);
19273
19273
  return T.geometry = y, T.material = oe, g && (this.setRTCUserData(T), T.matrix.setPosition(m.x, m.y, 0)), T.layers.enableAll(), T;
19274
19274
  }
19275
19275
  loadXLine(e) {
@@ -19279,7 +19279,7 @@ const Ee = new d.Vector3(1, 0, 0), os = new d.Vector3(0, 1, 0), Ot = new d.Vecto
19279
19279
  const n = new d.Vector3();
19280
19280
  let a = !1;
19281
19281
  this.enableRTC && (a = U.checkAndRebasePositionsOnRTC(r, n));
19282
- const o = new d.BufferGeometry().setFromPoints(r), l = new F(H.Line);
19282
+ const o = new d.BufferGeometry().setFromPoints(r), l = new F(N.Line);
19283
19283
  return l.geometry = o, l.material = oe, a && (this.setRTCUserData(l), l.matrix.setPosition(n.x, n.y, 0)), l.layers.enableAll(), l;
19284
19284
  }
19285
19285
  loadRay(e) {
@@ -19289,7 +19289,7 @@ const Ee = new d.Vector3(1, 0, 0), os = new d.Vector3(0, 1, 0), Ot = new d.Vecto
19289
19289
  const r = new d.Vector3();
19290
19290
  let n = !1;
19291
19291
  this.enableRTC && (n = U.checkAndRebasePositionsOnRTC(s, r));
19292
- const a = new d.BufferGeometry().setFromPoints(s), o = new F(H.Line);
19292
+ const a = new d.BufferGeometry().setFromPoints(s), o = new F(N.Line);
19293
19293
  return o.geometry = a, o.material = oe, n && (this.setRTCUserData(o), o.matrix.setPosition(r.x, r.y, 0)), o.layers.enableAll(), o;
19294
19294
  }
19295
19295
  // 说明:以下为源码中注释掉的 loadLine 旧实现(保真保留)。
@@ -19411,11 +19411,11 @@ const Ee = new d.Vector3(1, 0, 0), os = new d.Vector3(0, 1, 0), Ot = new d.Vecto
19411
19411
  }), v(y);
19412
19412
  } else
19413
19413
  y.setIndex(f);
19414
- l = new F(H.LineSegment), l.geometry = y, l.material = T;
19414
+ l = new F(N.LineSegment), l.geometry = y, l.material = T;
19415
19415
  }
19416
19416
  if (r.length > 0) {
19417
19417
  a && U.checkAndRebasePositionsOnRTC(r, n);
19418
- const c = new d.BufferGeometry().setFromPoints(r), u = new F(H.Point);
19418
+ const c = new d.BufferGeometry().setFromPoints(r), u = new F(N.Point);
19419
19419
  u.geometry = c, u.material = bi, l ? console.warn("Line has both segments and points – consider using a Group") : l = u;
19420
19420
  }
19421
19421
  if (l)
@@ -19456,7 +19456,7 @@ const Ee = new d.Vector3(1, 0, 0), os = new d.Vector3(0, 1, 0), Ot = new d.Vecto
19456
19456
  O === 0 ? b.moveTo(E[0], E[1]) : b.lineTo(E[0], E[1]);
19457
19457
  }), b.closePath(), x.push(new d.ShapeGeometry(b));
19458
19458
  });
19459
- const y = me(x), T = new F(H.Mesh);
19459
+ const y = me(x), T = new F(N.Mesh);
19460
19460
  T.geometry = y, T.material = Et, T.layers.enableAll(), T.layers.disable(Pe), a.add(T);
19461
19461
  }
19462
19462
  let l = !1;
@@ -19477,14 +19477,14 @@ const Ee = new d.Vector3(1, 0, 0), os = new d.Vector3(0, 1, 0), Ot = new d.Vecto
19477
19477
  if (this.statsInfo.unsupportedPolylineCount++, g ? x = this.createTaperedPolylineGeometry(r) : x = U.convertWidthLineToMeshGeometry(u, f), !x)
19478
19478
  S.warn("[Dxf] Failed to convert line with width to mesh geometry: %s", e.handle);
19479
19479
  else {
19480
- const b = new F(H.Mesh);
19480
+ const b = new F(N.Mesh);
19481
19481
  b.geometry = x, b.material = Et, b.layers.enableAll(), b.layers.disable(Pe), a.add(b);
19482
- const E = J.createOutline(x, oe, b.matrix), O = new F(H.LineSegment);
19482
+ const E = J.createOutline(x, oe, b.matrix), O = new F(N.LineSegment);
19483
19483
  O.geometry = E.geometry, O.material = E.material, O.matrix = E.matrix, O.layers.enableAll(), O.layers.disable(Pe), a.add(O);
19484
19484
  }
19485
19485
  }
19486
19486
  }
19487
- const m = new F(H.Line);
19487
+ const m = new F(N.Line);
19488
19488
  return m.geometry = new d.BufferGeometry().setFromPoints(u), m.material = oe, m.layers.enableAll(), a.children.length > 0 ? a.add(m) : a = m, l && (this.setRTCUserData(a), a.matrix.setPosition(c)), a;
19489
19489
  }
19490
19490
  /**
@@ -19519,8 +19519,8 @@ const Ee = new d.Vector3(1, 0, 0), os = new d.Vector3(0, 1, 0), Ot = new d.Vecto
19519
19519
  if (!n) return;
19520
19520
  const a = new F(), o = Di(n), l = this.getTextStyle(i, e), c = this.getMTextGroup(o, e, l, i, s), u = c && c.object;
19521
19521
  if (u) {
19522
- u.matrix.decompose(Z, le, Be), e.contextData?.textLocation && (Z.x += e.contextData.textLocation.x, Z.y += e.contextData.textLocation.y, u.matrix.compose(Z, le, Be)), He.makeEmpty();
19523
- const f = F.getBox(u, He), m = f.getSize(z), g = m.x, x = m.y;
19522
+ u.matrix.decompose(Z, le, Be), e.contextData?.textLocation && (Z.x += e.contextData.textLocation.x, Z.y += e.contextData.textLocation.y, u.matrix.compose(Z, le, Be)), Ne.makeEmpty();
19523
+ const f = F.getBox(u, Ne), m = f.getSize(z), g = m.x, x = m.y;
19524
19524
  let y = 0, T = 0;
19525
19525
  switch (e.contextData?.textAttachment) {
19526
19526
  case 1:
@@ -19597,7 +19597,7 @@ const Ee = new d.Vector3(1, 0, 0), os = new d.Vector3(0, 1, 0), Ot = new d.Vecto
19597
19597
  const y = new d.Vector3();
19598
19598
  let T = !1;
19599
19599
  this.enableRTC && (T = U.checkAndRebasePositionsOnRTC(f, y));
19600
- const v = new d.BufferGeometry().setFromPoints(f), b = new F(H.LineSegment);
19600
+ const v = new d.BufferGeometry().setFromPoints(f), b = new F(N.LineSegment);
19601
19601
  b.geometry = v, b.material = oe, b.renderOrder = xe.Line, T && (this.setRTCUserData(b), b.matrix.setPosition(y.x, y.y, 0)), a.add(b);
19602
19602
  } else return u?.traverse((f) => {
19603
19603
  f.layers.enableAll();
@@ -19632,7 +19632,7 @@ const Ee = new d.Vector3(1, 0, 0), os = new d.Vector3(0, 1, 0), Ot = new d.Vecto
19632
19632
  e.arrowHeadBlockHandle ? T = e.arrowHeadBlockHandle : n && n.DIMLDRBLK && (T = n.DIMLDRBLK);
19633
19633
  const v = this.getBlockByHandle(i.blocks, T);
19634
19634
  if (v && v.entities) {
19635
- n && (e.colorIndex = n.DIMCLRD || 256, e.color = Ht(e.colorIndex));
19635
+ n && (e.colorIndex = n.DIMCLRD || 256, e.color = Nt(e.colorIndex));
19636
19636
  for (let b = 0; b < v.entities.length; b++) {
19637
19637
  const E = this.loadEntity(v.entities[b], i, e);
19638
19638
  if (E) {
@@ -19646,7 +19646,7 @@ const Ee = new d.Vector3(1, 0, 0), os = new d.Vector3(0, 1, 0), Ot = new d.Vecto
19646
19646
  const m = new d.Vector3();
19647
19647
  let g = !1;
19648
19648
  this.enableRTC && (g = U.checkAndRebasePositionsOnRTC(r, m));
19649
- const x = new d.BufferGeometry().setFromPoints(r), y = new F(H.Line);
19649
+ const x = new d.BufferGeometry().setFromPoints(r), y = new F(N.Line);
19650
19650
  return y.geometry = x, y.material = oe, y.renderOrder = xe.Line, g && (this.setRTCUserData(y), y.matrix.setPosition(m.x, m.y, 0)), f.children.length > 0 ? (f.add(y), rt.merge(f, !1), f.traverse((T) => {
19651
19651
  T.layers.enableAll();
19652
19652
  }), f.children.length === 1 ? f.children[0] : f) : (y.layers.enableAll(), y);
@@ -19847,7 +19847,7 @@ const Ee = new d.Vector3(1, 0, 0), os = new d.Vector3(0, 1, 0), Ot = new d.Vecto
19847
19847
  v && x.push(new d.Vector3(g[y], T, 0), new d.Vector3(g[y], m[a], 0));
19848
19848
  }
19849
19849
  if (x.length > 0) {
19850
- const y = new d.BufferGeometry().setFromPoints(x), T = new F(H.LineSegment);
19850
+ const y = new d.BufferGeometry().setFromPoints(x), T = new F(N.LineSegment);
19851
19851
  T.geometry = y, T.material = oe, T.layers.enableAll(), r.add(T);
19852
19852
  }
19853
19853
  for (let y = 0; y < a; y++)
@@ -19953,13 +19953,13 @@ const Ee = new d.Vector3(1, 0, 0), os = new d.Vector3(0, 1, 0), Ot = new d.Vecto
19953
19953
  const f = this.getDivision(a, o, e.radius * c), m = l.getPoints(f), g = new d.Vector3();
19954
19954
  let x = !1;
19955
19955
  this.enableRTC && (x = U.checkAndRebasePositionsOnRTC(m, g));
19956
- const y = new d.BufferGeometry().setFromPoints(m), T = new F(H.Line);
19956
+ const y = new d.BufferGeometry().setFromPoints(m), T = new F(N.Line);
19957
19957
  T.geometry = y, T.material = oe;
19958
19958
  const v = new d.Vector3();
19959
19959
  e.center && (v.x = e.center.x, v.y = e.center.y);
19960
19960
  const b = new d.Vector3(e.center?.x, e.center?.y, e.center?.z).applyMatrix4(n.invert());
19961
19961
  v.x = b.x, v.y = b.y;
19962
- const E = v, O = new F(H.Point);
19962
+ const E = v, O = new F(N.Point);
19963
19963
  return O.geometry = dr, O.material = bi, O.userData.handle = e.handle, O.userData.isSnapObject = !0, O.userData.type = "CircleCenter", O.layers.set(Pe), T.add(O), x ? (this.setRTCUserData(T), E.x += g.x, E.y += g.y) : U.shouldRebasePositionOnRTC(E) && this.setRTCUserData(T), T.matrix.setPosition(E), T.layers.enableAll(), T;
19964
19964
  }
19965
19965
  addTriangleFacingCamera(e, i, s, r) {
@@ -19986,7 +19986,7 @@ const Ee = new d.Vector3(1, 0, 0), os = new d.Vector3(0, 1, 0), Ot = new d.Vecto
19986
19986
  this.enableRTC && (l = U.checkAndRebasePositionsOnRTC(n, o));
19987
19987
  const c = new d.BufferGeometry().setFromPoints(n);
19988
19988
  c.setIndex(a);
19989
- const u = new F(H.Mesh);
19989
+ const u = new F(N.Mesh);
19990
19990
  return u.geometry = c, u.material = Et, l && (this.setRTCUserData(u), u.matrix.setPosition(o.x, o.y, 0)), u.layers.enableAll(), u;
19991
19991
  }
19992
19992
  getTextStyle(e, i) {
@@ -20065,19 +20065,19 @@ const Ee = new d.Vector3(1, 0, 0), os = new d.Vector3(0, 1, 0), Ot = new d.Vecto
20065
20065
  if (u.length > 0) {
20066
20066
  const O = u.filter((C) => C instanceof d.ExtrudeGeometry), _ = u.filter((C) => !(C instanceof d.ExtrudeGeometry));
20067
20067
  if (O.length > 0) {
20068
- const C = new F(H.Mesh);
20068
+ const C = new F(N.Mesh);
20069
20069
  C.geometry = me(O), C.material = Et, c.add(C);
20070
20070
  }
20071
20071
  if (_.length > 0) {
20072
- const C = new F(H.LineSegment);
20072
+ const C = new F(N.LineSegment);
20073
20073
  C.geometry = me(_), C.material = oe, c.add(C);
20074
20074
  }
20075
20075
  }
20076
20076
  return c;
20077
20077
  }
20078
20078
  transformTextMesh(e, i) {
20079
- He.makeEmpty();
20080
- const s = F.getBox(i, He), r = s.getSize(z), {
20079
+ Ne.makeEmpty();
20080
+ const s = F.getBox(i, Ne), r = s.getSize(z), {
20081
20081
  halign: n,
20082
20082
  valign: a
20083
20083
  } = e;
@@ -20206,23 +20206,32 @@ const Ee = new d.Vector3(1, 0, 0), os = new d.Vector3(0, 1, 0), Ot = new d.Vecto
20206
20206
  let r = e.text;
20207
20207
  if (!r || !this.font) return;
20208
20208
  const n = this.getTextStyle(i, e);
20209
- r = rs(r).map((c) => c.text).join("");
20209
+ r = rs(r).map((f) => f.text).join("");
20210
20210
  const o = this.getTextMesh(r, e.textHeight, n, e);
20211
20211
  if (!o || o.children.length === 0) return;
20212
- o.userData.llbData = s?.zdysx, o.userData.textContent = r || "", o.userData.dxfType = "ATTRIB", o.userData.layer = e.layer || "0", o.userData.handle = e.handle || "", this.transformTextMesh(e, o), z.set(o.matrix.elements[12], o.matrix.elements[13], o.matrix.elements[14]);
20213
- const l = U.shouldRebasePositionOnRTC(z);
20214
- return l && this.setRTCUserData(o), o.traverse((c) => {
20215
- const u = c.geometry;
20216
- if (u) {
20217
- if (c instanceof d.Mesh && !u.getIndex()) {
20218
- const f = u.getAttribute("position"), m = [];
20219
- for (let g = 0; g < f.count; g += 3)
20220
- m.push(g, g + 1, g + 2);
20221
- u.setIndex(m);
20212
+ const l = s?.zdysx;
20213
+ o.userData.llbData = l;
20214
+ let c;
20215
+ if (l)
20216
+ try {
20217
+ c = JSON.parse(l);
20218
+ } catch {
20219
+ c = l;
20220
+ }
20221
+ o.userData.textContent = r || "", o.userData.dxfType = "ATTRIB", o.userData.layer = e.layer || "0", o.userData.handle = e.handle || "", this.transformTextMesh(e, o), z.set(o.matrix.elements[12], o.matrix.elements[13], o.matrix.elements[14]);
20222
+ const u = U.shouldRebasePositionOnRTC(z);
20223
+ return u && this.setRTCUserData(o), o.traverse((f) => {
20224
+ const m = f.geometry;
20225
+ if (m) {
20226
+ if (f instanceof d.Mesh && !m.getIndex()) {
20227
+ const g = m.getAttribute("position"), x = [];
20228
+ for (let y = 0; y < g.count; y += 3)
20229
+ x.push(y, y + 1, y + 2);
20230
+ m.setIndex(x);
20222
20231
  }
20223
- if (u.hasAttribute("uv") && u.deleteAttribute("uv"), u.hasAttribute("normal") && u.deleteAttribute("normal"), c instanceof d.Mesh && (c.entity = e, c.userData.entity = e), c.userData.textContent = r, c.userData.dxfType = "ATTRIB", c.userData.layer = e.layer || "0", c.userData.handle = e.handle || "", !l) {
20224
- const f = U.caculateGeometryCenter(u);
20225
- f && U.shouldRebasePositionOnRTC(f) && this.setRTCUserData(c);
20232
+ if (m.hasAttribute("uv") && m.deleteAttribute("uv"), m.hasAttribute("normal") && m.deleteAttribute("normal"), f instanceof d.Mesh && (f.entity = e, f.userData.entity = e), f.userData.textContent = r, f.userData.dxfType = "ATTRIB", f.userData.layer = e.layer || "0", f.userData.handle = e.handle || "", c !== void 0 && (f.userData.xdata = c), !u) {
20233
+ const g = U.caculateGeometryCenter(m);
20234
+ g && U.shouldRebasePositionOnRTC(g) && this.setRTCUserData(f);
20226
20235
  }
20227
20236
  }
20228
20237
  }), o.layers.enableAll(), o;
@@ -20234,7 +20243,7 @@ const Ee = new d.Vector3(1, 0, 0), os = new d.Vector3(0, 1, 0), Ot = new d.Vecto
20234
20243
  const a = z;
20235
20244
  let o = !1;
20236
20245
  this.enableRTC && (o = U.checkAndRebasePositionsOnRTC(n, a)), r.setFromPoints(n);
20237
- const l = new F(H.Point);
20246
+ const l = new F(N.Point);
20238
20247
  return l.geometry = r, l.material = oe, o && (this.setRTCUserData(l), l.matrix.setPosition(a.x, a.y, 0)), l.layers.enableAll(), l;
20239
20248
  }
20240
20249
  loadDimension(e, i) {
@@ -20242,7 +20251,7 @@ const Ee = new d.Vector3(1, 0, 0), os = new d.Vector3(0, 1, 0), Ot = new d.Vecto
20242
20251
  const s = i.blocks[e.block];
20243
20252
  if (!s || !s.entities) return;
20244
20253
  const r = i.tables.dimStyle.dimStyles[e.dimStyleName] || this.getDefaultDimensionStyle(i);
20245
- r && r.DIMCLRD > 0 && (e.colorIndex = r.DIMCLRD, e.color = Ht(e.colorIndex));
20254
+ r && r.DIMCLRD > 0 && (e.colorIndex = r.DIMCLRD, e.color = Nt(e.colorIndex));
20246
20255
  const n = new F();
20247
20256
  for (let o = 0; o < s.entities.length; o++) {
20248
20257
  const l = this.loadEntity(s.entities[o], i, e);
@@ -20277,10 +20286,10 @@ const Ee = new d.Vector3(1, 0, 0), os = new d.Vector3(0, 1, 0), Ot = new d.Vecto
20277
20286
  transparent: !0,
20278
20287
  side: d.FrontSide,
20279
20288
  map: y
20280
- }), v = new F(H.Mesh);
20289
+ }), v = new F(N.Mesh);
20281
20290
  v.geometry = c, v.material = T, o.add(v);
20282
20291
  }
20283
- const u = new d.EdgesGeometry(c), f = this.getColor(e, i, s), m = new F(H.Line);
20292
+ const u = new d.EdgesGeometry(c), f = this.getColor(e, i, s), m = new F(N.Line);
20284
20293
  m.geometry = u, m.material = this.getLineBasicMaterial(f);
20285
20294
  const g = e.uPixel ? new d.Vector3(e.uPixel.x, e.uPixel.y, e.uPixel.z) : new d.Vector3(r.pixelSize.x, 0, 0), x = e.vPixel ? new d.Vector3(e.vPixel.x, e.vPixel.y, e.vPixel.z) : new d.Vector3(r.pixelSize.y, 0, 0);
20286
20295
  if (o.add(m), Z.set(g.x, x.y, 1), z.set(0, 0, 0), e.position) {
@@ -20294,35 +20303,44 @@ const Ee = new d.Vector3(1, 0, 0), os = new d.Vector3(0, 1, 0), Ot = new d.Vecto
20294
20303
  const n = i.blocks[e.block];
20295
20304
  if (!n || !n.entities) return;
20296
20305
  s && e.layer === "0" && (e.layer = s.layer), e.blockPosition = n.position;
20297
- const a = new F();
20298
- for (let f = 0; f < n.entities.length; f++) {
20299
- if (n.entities[f].type === "ATTDEF") continue;
20300
- const m = this.loadEntity(n.entities[f], i, e, r);
20301
- m && (e && e.zdysx && j.LOADLLDATA && (m.userData.llbData = e.zdysx), a.add(m));
20306
+ const a = new F(), o = e.zdysx;
20307
+ let l;
20308
+ if (o)
20309
+ try {
20310
+ l = JSON.parse(o);
20311
+ } catch {
20312
+ l = o;
20313
+ }
20314
+ for (let g = 0; g < n.entities.length; g++) {
20315
+ if (n.entities[g].type === "ATTDEF") continue;
20316
+ const x = this.loadEntity(n.entities[g], i, e, r);
20317
+ x && (o && j.LOADLLDATA && (x.userData.llbData = o), l !== void 0 && x.traverse((y) => {
20318
+ y.geometry && (y.userData.xdata = l);
20319
+ }), a.add(x));
20302
20320
  }
20303
20321
  if (a.children.length === 0) {
20304
- const f = e.name || e.block;
20305
- return !this.statsInfo.ignoredInserts[f] && (this.statsInfo.ignoredInserts[f] = 0), this.statsInfo.ignoredInserts[f]++, void 0;
20322
+ const g = e.name || e.block;
20323
+ return !this.statsInfo.ignoredInserts[g] && (this.statsInfo.ignoredInserts[g] = 0), this.statsInfo.ignoredInserts[g]++, void 0;
20306
20324
  } else {
20307
20325
  !this.blockReferencesCache[e.block] && (this.blockReferencesCache[e.block] = { referenceCount: 0 });
20308
- const f = this.blockReferencesCache[e.block];
20309
- f.referenceCount++;
20310
- }
20311
- a.name = e.type + "<" + n.name + ">", a.userData.entityType = e.type, e.extendedData?.originalType && (a.userData.originalType = e.extendedData?.originalType), e?.blockPosition && a.matrix.setPosition(-e.blockPosition.x, -e.blockPosition.y, 0);
20312
- const o = z.set(1, 1, 1);
20313
- e.xScale && (o.x = e.xScale), e.yScale && (o.y = e.yScale);
20314
- const l = new d.Euler();
20315
- e.rotation && (l.z = e.rotation * Math.PI / 180), le.setFromEuler(l, !1);
20316
- const c = Z.set(0, 0, 0);
20317
- e.position && (c.x = e.position.x, c.y = e.position.y), re.compose(c, le, o), e.extrusionDirection && e.extrusionDirection.z < 0 && re.premultiply(ur.identity().makeScale(-1, 1, 1)), De.copy(a.matrix), a.matrix.premultiply(re), Z.set(a.matrix.elements[12], a.matrix.elements[13], a.matrix.elements[14]), U.shouldRebasePositionOnRTC(Z) && this.setRTCUserData(a);
20318
- const u = this.findSpatialFilterByHandle(e.handle, i);
20319
- if (u) {
20326
+ const g = this.blockReferencesCache[e.block];
20327
+ g.referenceCount++;
20328
+ }
20329
+ a.name = e.type + "<" + n.name + ">", a.userData.entityType = e.type, l !== void 0 && (a.userData.xdata = l), e.extendedData?.originalType && (a.userData.originalType = e.extendedData?.originalType), e?.blockPosition && a.matrix.setPosition(-e.blockPosition.x, -e.blockPosition.y, 0);
20330
+ const c = z.set(1, 1, 1);
20331
+ e.xScale && (c.x = e.xScale), e.yScale && (c.y = e.yScale);
20332
+ const u = new d.Euler();
20333
+ e.rotation && (u.z = e.rotation * Math.PI / 180), le.setFromEuler(u, !1);
20334
+ const f = Z.set(0, 0, 0);
20335
+ e.position && (f.x = e.position.x, f.y = e.position.y), re.compose(f, le, c), e.extrusionDirection && e.extrusionDirection.z < 0 && re.premultiply(ur.identity().makeScale(-1, 1, 1)), De.copy(a.matrix), a.matrix.premultiply(re), Z.set(a.matrix.elements[12], a.matrix.elements[13], a.matrix.elements[14]), U.shouldRebasePositionOnRTC(Z) && this.setRTCUserData(a);
20336
+ const m = this.findSpatialFilterByHandle(e.handle, i);
20337
+ if (m) {
20320
20338
  this.loadSpatialFilter(
20321
- u
20339
+ m
20322
20340
  /* 类型桥接:运行时为 DxfSpatialFilter */
20323
20341
  );
20324
- const f = u;
20325
- f && f.clipPolylines && f.clipPolylines.length > 0 && (a.userData.spatialFilterHandle = u.handle, this.cloneMaterialsForSpatialFilter(a), S.debug("[Dxf] Spatial filter:", e.associatedSpatialFilter));
20342
+ const g = m;
20343
+ g && g.clipPolylines && g.clipPolylines.length > 0 && (a.userData.spatialFilterHandle = m.handle, this.cloneMaterialsForSpatialFilter(a), S.debug("[Dxf] Spatial filter:", e.associatedSpatialFilter));
20326
20344
  }
20327
20345
  return a;
20328
20346
  }
@@ -20601,7 +20619,7 @@ const Ee = new d.Vector3(1, 0, 0), os = new d.Vector3(0, 1, 0), Ot = new d.Vecto
20601
20619
  this.buildHatchGeometry(l, y, T);
20602
20620
  let v;
20603
20621
  if (T.length > 0 && (v = me(T)), !v || !v.getIndex() || v.getIndex()?.count === 0) return S.warn("[Dxf] Failed to convert hatch boundaries!"), void 0;
20604
- const b = new F(H.Mesh);
20622
+ const b = new F(N.Mesh);
20605
20623
  b.geometry = v, b.material = Et, this.setHatchMaterial(b, r, i, m, s);
20606
20624
  const E = b;
20607
20625
  return g && (this.setRTCUserData(E), E.matrix.setPosition(m.x, m.y, 0)), E.traverse((O) => {
@@ -20619,7 +20637,7 @@ const Ee = new d.Vector3(1, 0, 0), os = new d.Vector3(0, 1, 0), Ot = new d.Vecto
20619
20637
  const o = [new d.Vector2(s, r), new d.Vector2(s, a), new d.Vector2(n, a), new d.Vector2(n, r), new d.Vector2(s, r)], l = new d.Vector3();
20620
20638
  let c = !1;
20621
20639
  this.enableRTC && (c = U.checkAndRebasePositionsOnRTC(o, l));
20622
- const u = new d.BufferGeometry().setFromPoints(o), f = this.getLineBasicMaterial(16777215), m = new F(H.Line);
20640
+ const u = new d.BufferGeometry().setFromPoints(o), f = this.getLineBasicMaterial(16777215), m = new F(N.Line);
20623
20641
  m.geometry = u, m.material = f, m.layers.enableAll(), c && (this.setRTCUserData(m), m.matrix.setPosition(l.x, l.y, 0));
20624
20642
  const g = new F();
20625
20643
  g.add(m);
@@ -20649,7 +20667,7 @@ const Ee = new d.Vector3(1, 0, 0), os = new d.Vector3(0, 1, 0), Ot = new d.Vecto
20649
20667
  }
20650
20668
  }
20651
20669
  if (T) {
20652
- const v = new d.Box2().setFromPoints(o), b = v.getSize(Kt), E = new d.PlaneGeometry(b.x, b.y), O = new F(H.Mesh);
20670
+ const v = new d.Box2().setFromPoints(o), b = v.getSize(Kt), E = new d.PlaneGeometry(b.x, b.y), O = new F(N.Mesh);
20653
20671
  O.geometry = E, O.material = T;
20654
20672
  const _ = v.getCenter(Kt);
20655
20673
  z.set(_.x, _.y, 0), c && (this.setRTCUserData(O), z.x += l.x, z.y += l.y), O.matrix.setPosition(z), O.layers.enableAll(), g.add(O);
@@ -20709,7 +20727,7 @@ const Ee = new d.Vector3(1, 0, 0), os = new d.Vector3(0, 1, 0), Ot = new d.Vecto
20709
20727
  let l = !1;
20710
20728
  const c = new d.Vector3();
20711
20729
  this.enableRTC && (l = U.checkAndRebasePositionsOnRTC(o, c));
20712
- const u = new d.BufferGeometry().setFromPoints(o), f = new F(H.Line);
20730
+ const u = new d.BufferGeometry().setFromPoints(o), f = new F(N.Line);
20713
20731
  f.geometry = u, f.material = oe, f.userData.entityType = e.type, f.layers.enableAll(), l && (this.setRTCUserData(f), f.matrix.setPosition(c.x, c.y, 0));
20714
20732
  const m = e.psBBox.clone();
20715
20733
  m.applyMatrix4(e.msToPsMatrix.clone().invert()), m.min.z = 0, m.max.z = 0;
@@ -20723,7 +20741,7 @@ const Ee = new d.Vector3(1, 0, 0), os = new d.Vector3(0, 1, 0), Ot = new d.Vecto
20723
20741
  let x = !1;
20724
20742
  const y = new d.Vector3();
20725
20743
  this.enableRTC && (x = U.checkAndRebasePositionsOnRTC(g, y));
20726
- const T = new d.BufferGeometry().setFromPoints(g), v = new F(H.Line);
20744
+ const T = new d.BufferGeometry().setFromPoints(g), v = new F(N.Line);
20727
20745
  v.geometry = T, v.material = oe, v.userData.entityType = e.type, v.userData.inPaperSpace = [], v.layers.enableAll(), x && (this.setRTCUserData(v), v.matrix.setPosition(y.x, y.y, 0));
20728
20746
  const b = new F();
20729
20747
  return b.add(f), b.add(v), f;
@@ -20831,7 +20849,7 @@ const Ee = new d.Vector3(1, 0, 0), os = new d.Vector3(0, 1, 0), Ot = new d.Vecto
20831
20849
  const a = e;
20832
20850
  if (!a.geometry) return;
20833
20851
  const o = this.getColor(i, s, n);
20834
- if (a.type === H.Line || a.type === H.LineSegment) {
20852
+ if (a.type === N.Line || a.type === N.LineSegment) {
20835
20853
  a.material = this.getLineBasicMaterial(o);
20836
20854
  return;
20837
20855
  }
@@ -21548,7 +21566,7 @@ const Ee = new d.Vector3(1, 0, 0), os = new d.Vector3(0, 1, 0), Ot = new d.Vecto
21548
21566
  s(e), this.removeEmptyObjectsFromMark2(i);
21549
21567
  }
21550
21568
  static removeEmptyObjectsFromMark2(e) {
21551
- if (e.userData.validCount === 0 || e.type === H.Object && e.children.length === 0) return e.removeFromParent(), !0;
21569
+ if (e.userData.validCount === 0 || e.type === N.Object && e.children.length === 0) return e.removeFromParent(), !0;
21552
21570
  for (let i = 0; i < e.children.length; )
21553
21571
  !this.removeEmptyObjectsFromMark2(e.children[i]) && ++i;
21554
21572
  return !1;
@@ -22740,7 +22758,7 @@ const Il = `
22740
22758
 
22741
22759
  gl_FragColor = tileObjectId2Color(vTileObjectId);
22742
22760
  }
22743
- `, Hl = `
22761
+ `, Nl = `
22744
22762
  #define STANDARD
22745
22763
 
22746
22764
  varying vec3 vViewPosition;
@@ -22800,7 +22818,7 @@ void main() {
22800
22818
 
22801
22819
  #endif
22802
22820
  }
22803
- `, Nl = `
22821
+ `, Hl = `
22804
22822
  #define STANDARD
22805
22823
 
22806
22824
  #ifdef PHYSICAL
@@ -22971,8 +22989,8 @@ d.ShaderChunk.outline_bc_vertex = Bl;
22971
22989
  d.ShaderChunk.outline_bc_fragment = Ll;
22972
22990
  d.ShaderChunk.outline_bc_pars_fragment = Rl;
22973
22991
  d.ShaderChunk.outline_bc_pars_vertex = Fl;
22974
- d.ShaderChunk.standard_ex_vertex = Hl;
22975
- d.ShaderChunk.standard_ex_fragment = Nl;
22992
+ d.ShaderChunk.standard_ex_vertex = Nl;
22993
+ d.ShaderChunk.standard_ex_fragment = Hl;
22976
22994
  d.ShaderChunk.common_ex = Il;
22977
22995
  d.ShaderChunk.id_pars_vertex = kl;
22978
22996
  d.ShaderChunk.id_vertex = Dl;
@@ -24867,7 +24885,7 @@ function Or(h, t, e, i, s = 1 / 0, r, n) {
24867
24885
  return M * I + P * k + A * B > 0 && (n.x = y, n.y = T, n.z = v, e.x = (n.x - y) / r, e.y = (n.y - T) / r, e.z = (n.z - v) / r), n;
24868
24886
  }
24869
24887
  const Ci = 1 / 8, lh = ve.isBrowser && /Mac/.test(navigator.platform), hh = !(ve.isBrowser && "PointerEvent" in window);
24870
- let N, Er, Si, fs, Me, q, ee, At, Ne, Ge, ft, _r, Pr, Le, ei, It, Ar, ps, Ir, ms, gs, Oi;
24888
+ let H, Er, Si, fs, Me, q, ee, At, He, Ge, ft, _r, Pr, Le, ei, It, Ar, ps, Ir, ms, gs, Oi;
24871
24889
  class K extends oh {
24872
24890
  /**
24873
24891
  * Creates a `CameraControls` instance.
@@ -25123,7 +25141,7 @@ class K extends oh {
25123
25141
  right: 0,
25124
25142
  top: 0,
25125
25143
  bottom: 0
25126
- }, 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 N.Vector3(), this._focalOffsetVelocity = new N.Vector3(), this._zoomVelocity = { value: 0 }, this._truckInternal = (b, E, O) => {
25144
+ }, 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 H.Vector3(), this._focalOffsetVelocity = new H.Vector3(), this._zoomVelocity = { value: 0 }, this._truckInternal = (b, E, O) => {
25127
25145
  if (Fe(this._camera)) {
25128
25146
  const _ = q.copy(this._camera.position).sub(this._target), C = this._camera.getEffectiveFOV() * $t, w = _.length() * Math.tan(C * 0.5), M = this.truckSpeed * b * w / this._elementRect.height, P = this.truckSpeed * E * w / this._elementRect.height;
25129
25147
  this.verticalDragToForward ? (O ? this.setFocalOffset(this._focalOffsetEnd.x + M, this._focalOffsetEnd.y, this._focalOffsetEnd.z, !0) : this.truck(M, 0, !0), this.forward(-P, !0)) : O ? this.setFocalOffset(this._focalOffsetEnd.x + M, this._focalOffsetEnd.y + P, this._focalOffsetEnd.z, !0) : this.truck(M, P, !0);
@@ -25140,7 +25158,7 @@ class K extends oh {
25140
25158
  }, this._zoomInternal = (b, E, O) => {
25141
25159
  const _ = Math.pow(0.95, b * this.dollySpeed), C = this._zoomEnd;
25142
25160
  this.zoomTo(this._zoom * _), this.dollyToCursor && (this._dollyControlAmount += this._zoomEnd - C, this._dollyControlCoord.set(E, O));
25143
- }, typeof N > "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 N.Quaternion().setFromUnitVectors(this._camera.up, Si), this._yAxisUpSpaceInverse = this._yAxisUpSpace.clone().invert(), this._state = D.NONE, this._target = new N.Vector3(), this._targetEnd = this._target.clone(), this._focalOffset = new N.Vector3(), this._focalOffsetEnd = this._focalOffset.clone(), this._spherical = new N.Spherical().setFromVector3(q.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)), this._sphericalEnd = this._spherical.clone(), this._zoom = this._camera.zoom, this._zoomEnd = this._zoom, this._nearPlaneCorners = [new N.Vector3(), new N.Vector3(), new N.Vector3(), new N.Vector3()], this._updateNearPlaneCorners(), this._boundary = new N.Box3(new N.Vector3(-1 / 0, -1 / 0, -1 / 0), new N.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 N.Vector2(), this.mouseButtons = {
25161
+ }, typeof H > "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 H.Quaternion().setFromUnitVectors(this._camera.up, Si), this._yAxisUpSpaceInverse = this._yAxisUpSpace.clone().invert(), this._state = D.NONE, this._target = new H.Vector3(), this._targetEnd = this._target.clone(), this._focalOffset = new H.Vector3(), this._focalOffsetEnd = this._focalOffset.clone(), this._spherical = new H.Spherical().setFromVector3(q.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)), this._sphericalEnd = this._spherical.clone(), this._zoom = this._camera.zoom, this._zoomEnd = this._zoom, this._nearPlaneCorners = [new H.Vector3(), new H.Vector3(), new H.Vector3(), new H.Vector3()], this._updateNearPlaneCorners(), this._boundary = new H.Box3(new H.Vector3(-1 / 0, -1 / 0, -1 / 0), new H.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 H.Vector2(), this.mouseButtons = {
25144
25162
  left: D.ROTATE,
25145
25163
  middle: D.DOLLY,
25146
25164
  right: D.TRUCK,
@@ -25150,7 +25168,7 @@ class K extends oh {
25150
25168
  two: Fe(this._camera) ? D.TOUCH_DOLLY_TRUCK : Te(this._camera) ? D.TOUCH_ZOOM_TRUCK : D.NONE,
25151
25169
  three: D.TOUCH_TRUCK
25152
25170
  };
25153
- const s = new N.Vector2(), r = new N.Vector2(), n = new N.Vector2(), a = (b) => {
25171
+ const s = new H.Vector2(), r = new H.Vector2(), n = new H.Vector2(), a = (b) => {
25154
25172
  if (!this._enabled || !this._domElement) return;
25155
25173
  const E = b.pointerType !== "mouse" ? null : (b.buttons & G.LEFT) === G.LEFT ? G.LEFT : (b.buttons & G.MIDDLE) === G.MIDDLE ? G.MIDDLE : (b.buttons & G.RIGHT) === G.RIGHT ? G.RIGHT : null;
25156
25174
  if (E !== null) {
@@ -25355,7 +25373,7 @@ class K extends oh {
25355
25373
  * @category Statics
25356
25374
  */
25357
25375
  static install(e) {
25358
- N = e.THREE, Er = Object.freeze(new N.Vector3(0, 0, 0)), Si = Object.freeze(new N.Vector3(0, 1, 0)), fs = Object.freeze(new N.Vector3(0, 0, 1)), Me = new N.Vector2(), q = new N.Vector3(), ee = new N.Vector3(), At = new N.Vector3(), Ne = new N.Vector3(), Ge = new N.Vector3(), ft = new N.Vector3(), _r = new N.Vector3(), Pr = new N.Vector3(), Le = new N.Spherical(), ei = new N.Spherical(), It = new N.Box3(), Ar = new N.Box3(), ps = new N.Sphere(), Ir = new N.Quaternion(), ms = new N.Quaternion(), gs = new N.Matrix4(), Oi = new N.Raycaster();
25376
+ H = e.THREE, Er = Object.freeze(new H.Vector3(0, 0, 0)), Si = Object.freeze(new H.Vector3(0, 1, 0)), fs = Object.freeze(new H.Vector3(0, 0, 1)), Me = new H.Vector2(), q = new H.Vector3(), ee = new H.Vector3(), At = new H.Vector3(), He = new H.Vector3(), Ge = new H.Vector3(), ft = new H.Vector3(), _r = new H.Vector3(), Pr = new H.Vector3(), Le = new H.Spherical(), ei = new H.Spherical(), It = new H.Box3(), Ar = new H.Box3(), ps = new H.Sphere(), Ir = new H.Quaternion(), ms = new H.Quaternion(), gs = new H.Matrix4(), Oi = new H.Raycaster();
25359
25377
  }
25360
25378
  /**
25361
25379
  * list all ACTIONs
@@ -25625,8 +25643,8 @@ class K extends oh {
25625
25643
  * @category Methods
25626
25644
  */
25627
25645
  truck(e, i, s = !1) {
25628
- this._camera.updateMatrix(), Ne.setFromMatrixColumn(this._camera.matrix, 0), Ge.setFromMatrixColumn(this._camera.matrix, 1), Ne.multiplyScalar(e), Ge.multiplyScalar(-i);
25629
- const r = q.copy(Ne).add(Ge), n = ee.copy(this._targetEnd).add(r);
25646
+ this._camera.updateMatrix(), He.setFromMatrixColumn(this._camera.matrix, 0), Ge.setFromMatrixColumn(this._camera.matrix, 1), He.multiplyScalar(e), Ge.multiplyScalar(-i);
25647
+ const r = q.copy(He).add(Ge), n = ee.copy(this._targetEnd).add(r);
25630
25648
  return this.moveTo(n.x, n.y, n.z, s);
25631
25649
  }
25632
25650
  /**
@@ -25722,7 +25740,7 @@ class K extends oh {
25722
25740
  * @category Methods
25723
25741
  */
25724
25742
  fitToSphere(e, i) {
25725
- const s = [], n = e instanceof N.Sphere ? ps.copy(e) : K.createBoundingSphere(e, ps);
25743
+ const s = [], n = e instanceof H.Sphere ? ps.copy(e) : K.createBoundingSphere(e, ps);
25726
25744
  if (s.push(this.moveTo(n.center.x, n.center.y, n.center.z, i)), Fe(this._camera)) {
25727
25745
  const a = this.getDistanceToFitSphere(n.radius);
25728
25746
  s.push(this.dollyTo(a, i));
@@ -25830,9 +25848,9 @@ class K extends oh {
25830
25848
  * @category Methods
25831
25849
  */
25832
25850
  setOrbitPoint(e, i, s) {
25833
- this._camera.updateMatrixWorld(), Ne.setFromMatrixColumn(this._camera.matrixWorldInverse, 0), Ge.setFromMatrixColumn(this._camera.matrixWorldInverse, 1), ft.setFromMatrixColumn(this._camera.matrixWorldInverse, 2);
25851
+ this._camera.updateMatrixWorld(), He.setFromMatrixColumn(this._camera.matrixWorldInverse, 0), Ge.setFromMatrixColumn(this._camera.matrixWorldInverse, 1), ft.setFromMatrixColumn(this._camera.matrixWorldInverse, 2);
25834
25852
  const r = q.set(e, i, s), n = r.distanceTo(this._camera.position), a = r.sub(this._camera.position);
25835
- Ne.multiplyScalar(a.x), Ge.multiplyScalar(a.y), ft.multiplyScalar(a.z), q.copy(Ne).add(Ge).add(ft), q.z = q.z + n, this.dollyTo(n, !1), this.setFocalOffset(-q.x, q.y, -q.z, !1), this.moveTo(e, i, s, !1);
25853
+ He.multiplyScalar(a.x), Ge.multiplyScalar(a.y), ft.multiplyScalar(a.z), q.copy(He).add(Ge).add(ft), q.z = q.z + n, this.dollyTo(n, !1), this.setFocalOffset(-q.x, q.y, -q.z, !1), this.moveTo(e, i, s, !1);
25836
25854
  }
25837
25855
  /**
25838
25856
  * Set the boundary box that encloses the target of the camera. box3 is in THREE.Box3
@@ -25860,7 +25878,7 @@ class K extends oh {
25860
25878
  this._viewport = null;
25861
25879
  return;
25862
25880
  }
25863
- this._viewport = this._viewport || new N.Vector4(), typeof e == "number" ? this._viewport.set(e, i, s, r) : this._viewport.copy(e);
25881
+ this._viewport = this._viewport || new H.Vector4(), typeof e == "number" ? this._viewport.set(e, i, s, r) : this._viewport.copy(e);
25864
25882
  }
25865
25883
  /**
25866
25884
  * Calculate the distance to fit the box.
@@ -25892,7 +25910,7 @@ class K extends oh {
25892
25910
  * @category Methods
25893
25911
  */
25894
25912
  getTarget(e) {
25895
- return (e && e.isVector3 ? e : new N.Vector3()).copy(this._targetEnd);
25913
+ return (e && e.isVector3 ? e : new H.Vector3()).copy(this._targetEnd);
25896
25914
  }
25897
25915
  /**
25898
25916
  * Returns its current position.
@@ -25900,7 +25918,7 @@ class K extends oh {
25900
25918
  * @category Methods
25901
25919
  */
25902
25920
  getPosition(e) {
25903
- return (e && e.isVector3 ? e : new N.Vector3()).setFromSpherical(this._sphericalEnd).applyQuaternion(this._yAxisUpSpaceInverse).add(this._targetEnd);
25921
+ return (e && e.isVector3 ? e : new H.Vector3()).setFromSpherical(this._sphericalEnd).applyQuaternion(this._yAxisUpSpaceInverse).add(this._targetEnd);
25904
25922
  }
25905
25923
  /**
25906
25924
  * Returns its current focal offset, which is how much the camera appears to be translated in screen parallel coordinates.
@@ -25908,7 +25926,7 @@ class K extends oh {
25908
25926
  * @category Methods
25909
25927
  */
25910
25928
  getFocalOffset(e) {
25911
- return (e && e.isVector3 ? e : new N.Vector3()).copy(this._focalOffsetEnd);
25929
+ return (e && e.isVector3 ? e : new H.Vector3()).copy(this._focalOffsetEnd);
25912
25930
  }
25913
25931
  /**
25914
25932
  * Normalize camera azimuth angle rotation between 0 and 360 degrees.
@@ -26010,7 +26028,7 @@ class K extends oh {
26010
26028
  }
26011
26029
  this._camera.zoom !== this._zoom && (this._camera.zoom = this._zoom, this._camera.updateProjectionMatrix(), this._updateNearPlaneCorners(), this._needsUpdate = !0);
26012
26030
  const l = this._collisionTest();
26013
- this._spherical.radius = Math.min(this._spherical.radius, l), this._spherical.makeSafe(), this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target), this._camera.lookAt(this._target), (!ie(this._focalOffset.x) || !ie(this._focalOffset.y) || !ie(this._focalOffset.z)) && (this._camera.updateMatrixWorld(), Ne.setFromMatrixColumn(this._camera.matrix, 0), Ge.setFromMatrixColumn(this._camera.matrix, 1), ft.setFromMatrixColumn(this._camera.matrix, 2), Ne.multiplyScalar(this._focalOffset.x), Ge.multiplyScalar(-this._focalOffset.y), ft.multiplyScalar(this._focalOffset.z), q.copy(Ne).add(Ge).add(ft), this._camera.position.add(q)), this._boundaryEnclosesCamera && this._encloseToBoundary(
26031
+ this._spherical.radius = Math.min(this._spherical.radius, l), this._spherical.makeSafe(), this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target), this._camera.lookAt(this._target), (!ie(this._focalOffset.x) || !ie(this._focalOffset.y) || !ie(this._focalOffset.z)) && (this._camera.updateMatrixWorld(), He.setFromMatrixColumn(this._camera.matrix, 0), Ge.setFromMatrixColumn(this._camera.matrix, 1), ft.setFromMatrixColumn(this._camera.matrix, 2), He.multiplyScalar(this._focalOffset.x), Ge.multiplyScalar(-this._focalOffset.y), ft.multiplyScalar(this._focalOffset.z), q.copy(He).add(Ge).add(ft), this._camera.position.add(q)), this._boundaryEnclosesCamera && this._encloseToBoundary(
26014
26032
  this._camera.position.copy(this._target),
26015
26033
  q.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse),
26016
26034
  1
@@ -26148,7 +26166,7 @@ class K extends oh {
26148
26166
  }
26149
26167
  _removeAllEventListeners() {
26150
26168
  }
26151
- static createBoundingSphere(e, i = new N.Sphere()) {
26169
+ static createBoundingSphere(e, i = new H.Sphere()) {
26152
26170
  const s = i, r = s.center;
26153
26171
  It.makeEmpty(), e.traverseVisible((a) => {
26154
26172
  a.isMesh && It.expandByObject(a);
@@ -28485,7 +28503,7 @@ class gh {
28485
28503
  cancelAnimationFrame(this.intervalMap[t]);
28486
28504
  }
28487
28505
  }
28488
- class Hi {
28506
+ class Ni {
28489
28507
  constructor(t) {
28490
28508
  p(this, "buffer");
28491
28509
  p(this, "u8");
@@ -28524,7 +28542,7 @@ class Hi {
28524
28542
  this.u8[i + 1] = (this.u8[i + 1] & u) + a;
28525
28543
  }
28526
28544
  test() {
28527
- var t = new ArrayBuffer(3), e = new Hi(t), i, s;
28545
+ var t = new ArrayBuffer(3), e = new Ni(t), i, s;
28528
28546
  for (i = 0; i < 12; i++)
28529
28547
  for (s = -2048; s < 2048; s++)
28530
28548
  if (e.setInt12(i, s), e.getInt12(i) != s) {
@@ -28738,7 +28756,7 @@ class xh {
28738
28756
  return s;
28739
28757
  }
28740
28758
  storeDeltas6(t, e) {
28741
- for (var i = new ArrayBuffer(Math.ceil(t * 0.75) + 4), s = new Hi(i), r = 32, n = 0; n < e.length; n++) {
28759
+ for (var i = new ArrayBuffer(Math.ceil(t * 0.75) + 4), s = new Ni(i), r = 32, n = 0; n < e.length; n++) {
28742
28760
  for (var a = e[n], o = 0; o < a.length; o++) {
28743
28761
  var l = a[o];
28744
28762
  s.setInt12(r, l[0]), r += 12, s.setInt12(r, l[1]), r += 12;
@@ -28751,7 +28769,7 @@ class xh {
28751
28769
  return new DataView(i).setUint32(0, r), i;
28752
28770
  }
28753
28771
  deltaDecode6(t) {
28754
- for (var e = new DataView(t).getUint32(0), i = new Hi(t), s = 32, r = []; s < e; ) {
28772
+ for (var e = new DataView(t).getUint32(0), i = new Ni(t), s = 32, r = []; s < e; ) {
28755
28773
  var n = i.getInt12(s);
28756
28774
  if (s += 12, n === -2048) {
28757
28775
  r.push(-2048);
@@ -29246,9 +29264,9 @@ const Mh = (h, t, e = 800, i = 45) => {
29246
29264
  };
29247
29265
  p(he, "lineColor", "rgba(255, 119, 0, 1)"), p(he, "FILL_COLOR_NONE", "rgba(0, 0, 0, 0)"), p(he, "SNAP_LINE_COLOR", "rgba(255, 240, 0, 0.3)"), p(he, "lineWidth", 2), p(he, "iconSize", 14);
29248
29266
  let be = he;
29249
- Ni._registerDrawableClass(be);
29267
+ Hi._registerDrawableClass(be);
29250
29268
  var Sh = /* @__PURE__ */ ((h) => (h[h.None = 0] = "None", h[h.Vertex = 1] = "Vertex", h[h.MiddlePoint = 2] = "MiddlePoint", h[h.Edge = 4] = "Edge", h[h.Face = 8] = "Face", h[h.FootOfPerpendicular = 16] = "FootOfPerpendicular", h[h.Intersection = 32] = "Intersection", h[h.CircleCenter = 64] = "CircleCenter", h))(Sh || {});
29251
- const Oh = 1e-5, se = new d.Vector3(), fe = new d.Vector3(), Nt = new d.Vector3(), ni = new d.Vector3(), mt = new d.Matrix4(), ai = new d.Line3();
29269
+ const Oh = 1e-5, se = new d.Vector3(), fe = new d.Vector3(), Ht = new d.Vector3(), ni = new d.Vector3(), mt = new d.Matrix4(), ai = new d.Line3();
29252
29270
  function Eh(h, t) {
29253
29271
  let e = Number.MAX_VALUE, i = 0;
29254
29272
  for (let s = 0; s < h.vertices.length; s++) {
@@ -29288,9 +29306,9 @@ function _h(h) {
29288
29306
  let l = Number.MAX_VALUE, c = 0;
29289
29307
  for (let m = 0; m < o.length; m += 2) {
29290
29308
  const g = o[m], x = o[m + 1];
29291
- se.set(a[g * 3], a[g * 3 + 1], a[g * 3 + 2]), se.applyMatrix4(mt), fe.set(a[x * 3], a[x * 3 + 1], a[x * 3 + 2]), fe.applyMatrix4(mt), ai.set(se, fe), ai.closestPointToPoint(h.point, !0, Nt);
29292
- const y = h.point.distanceTo(Nt);
29293
- y < l && (c = m, l = y, ni.copy(Nt));
29309
+ se.set(a[g * 3], a[g * 3 + 1], a[g * 3 + 2]), se.applyMatrix4(mt), fe.set(a[x * 3], a[x * 3 + 1], a[x * 3 + 2]), fe.applyMatrix4(mt), ai.set(se, fe), ai.closestPointToPoint(h.point, !0, Ht);
29310
+ const y = h.point.distanceTo(Ht);
29311
+ y < l && (c = m, l = y, ni.copy(Ht));
29294
29312
  }
29295
29313
  const u = o[c], f = o[c + 1];
29296
29314
  return se.set(a[u * 3], a[u * 3 + 1], a[u * 3 + 2]), se.applyMatrix4(mt), fe.set(a[f * 3], a[f * 3 + 1], a[f * 3 + 2]), fe.applyMatrix4(mt), {
@@ -29599,8 +29617,8 @@ class ad {
29599
29617
  1
29600
29618
  /* Vertex */
29601
29619
  ]) return;
29602
- ai.set(e, i), ai.closestPointToPoint(t, !0, Nt);
29603
- const l = t.distanceTo(Nt);
29620
+ ai.set(e, i), ai.closestPointToPoint(t, !0, Ht);
29621
+ const l = t.distanceTo(Ht);
29604
29622
  if (l > s) return;
29605
29623
  const c = t.distanceTo(e), u = t.distanceTo(i);
29606
29624
  if (Math.min(c, u) <= s && this.isOSnapTypeEnabled(
@@ -29656,7 +29674,7 @@ class ad {
29656
29674
  start: e.clone(),
29657
29675
  end: i.clone()
29658
29676
  }, {
29659
- point: Nt.clone(),
29677
+ point: Ht.clone(),
29660
29678
  distance: R.floorNumber(l, 7),
29661
29679
  type: 4,
29662
29680
  line: {
@@ -30704,7 +30722,7 @@ class Os extends St {
30704
30722
  this.renderEnabled = !0, this.raf && (this.timeoutSymbol && this.raf.clearTimeout(this.timeoutSymbol), this.timeoutSymbol = this.raf.setTimeout(() => {
30705
30723
  this.renderEnabled = !1;
30706
30724
  }, i));
30707
- }, this.viewerCfg = e, this.initLogLevel(), this.initLocalization(), this.container = new un(e.containerId), e.enableProgressBar && (this.progressBar = new fn(this.container)), this.spinner = new ah(this.container), this.sceneManager = new Lh(this), this.pickManager = new Bh(this), this.overlayRender = new Ni(this), this.css2dRenderer = this.initCSS2DRenderer(), this.inputManager = new Dh(this.viewerContainer), this.cameraManager = new uh(this), this.loaderHelper = new Mt(), this.undoManager = new Rh(), this.resize(), this.clock.start(), this.animate();
30725
+ }, this.viewerCfg = e, this.initLogLevel(), this.initLocalization(), this.container = new un(e.containerId), e.enableProgressBar && (this.progressBar = new fn(this.container)), this.spinner = new ah(this.container), this.sceneManager = new Lh(this), this.pickManager = new Bh(this), this.overlayRender = new Hi(this), this.css2dRenderer = this.initCSS2DRenderer(), this.inputManager = new Dh(this.viewerContainer), this.cameraManager = new uh(this), this.loaderHelper = new Mt(), this.undoManager = new Rh(), this.resize(), this.clock.start(), this.animate();
30708
30726
  }
30709
30727
  initLogLevel() {
30710
30728
  const e = this.viewerCfg.logLevel;
@@ -32193,7 +32211,7 @@ class zt {
32193
32211
  return new zt([t[0] + i, t[1] + s], [e[0] + i, e[1] + s]);
32194
32212
  }
32195
32213
  }
32196
- const ti = Array.isArray, Hr = (h, t) => h[0] === t[0] && h[1] === t[1], vs = (h) => Array.isArray(h) && h.length, wn = (h, t = 0, e = !1) => {
32214
+ const ti = Array.isArray, Nr = (h, t) => h[0] === t[0] && h[1] === t[1], vs = (h) => Array.isArray(h) && h.length, wn = (h, t = 0, e = !1) => {
32197
32215
  let i, s;
32198
32216
  if (vs(h) && typeof h[0][0] == "number") {
32199
32217
  let r = 0;
@@ -32227,7 +32245,7 @@ class cd {
32227
32245
  processContour(t, e) {
32228
32246
  let i, s;
32229
32247
  if (ti(t[0]) && typeof t[0][0] == "number")
32230
- for (t = t, e = e, s = t.length, Hr(t[0], t[s - 1]) && (s -= 1), i = 0; i < s; i++)
32248
+ for (t = t, e = e, s = t.length, Nr(t[0], t[s - 1]) && (s -= 1), i = 0; i < s; i++)
32231
32249
  e.push(new zt(t[i], t[(i + 1) % s]));
32232
32250
  else
32233
32251
  for (t = t, e = e, i = 0, s = t.length; i < s; i++)
@@ -32262,7 +32280,7 @@ class cd {
32262
32280
  return this.distance = t, this;
32263
32281
  }
32264
32282
  ensureLastPoint(t) {
32265
- return Hr(t[0], t[t.length - 1]) || t.push([t[0][0], t[0][1]]), t;
32283
+ return Nr(t[0], t[t.length - 1]) || t.push([t[0][0], t[0][1]]), t;
32266
32284
  }
32267
32285
  /**
32268
32286
  * Decides by the sign if it's a padding or a margin
@@ -32783,7 +32801,7 @@ class dd extends Os {
32783
32801
  this.sceneManager.enableClipping(i), this.sceneManager.setClipPlanes(e);
32784
32802
  }
32785
32803
  }
32786
- function Nr(h) {
32804
+ function Hr(h) {
32787
32805
  return Object.assign(Object.assign({}, {
32788
32806
  asset: "",
32789
32807
  version: "",
@@ -32822,12 +32840,12 @@ class Vh {
32822
32840
  p(this, "metadata");
32823
32841
  p(this, "statistics");
32824
32842
  p(this, "view");
32825
- this.url = t, this.metadata = Nr(), this.statistics = Gr(), this.view = jh();
32843
+ this.url = t, this.metadata = Hr(), this.statistics = Gr(), this.view = jh();
32826
32844
  }
32827
32845
  async parse() {
32828
32846
  return await fetch(this.url).then((t) => t.ok ? t.json() : (S.error(
32829
32847
  '[BimTiles] Failed to request "' + this.url + '", status ' + t.status + " : " + t.statusText
32830
- ), Promise.reject(!1))).then((t) => (this.metadata = Nr(t.metadata), this.statistics = Gr(t.statistics), t.view.transform && t.view.transform.length === 16 && this.view.transform.fromArray(t.view.transform), t.view.boundingVolume && t.view.boundingVolume.length === 6 && this.view.boundingVolume.setFromArray(t.view.boundingVolume), Promise.resolve(!0)));
32848
+ ), Promise.reject(!1))).then((t) => (this.metadata = Hr(t.metadata), this.statistics = Gr(t.statistics), t.view.transform && t.view.transform.length === 16 && this.view.transform.fromArray(t.view.transform), t.view.boundingVolume && t.view.boundingVolume.length === 6 && this.view.boundingVolume.setFromArray(t.view.boundingVolume), Promise.resolve(!0)));
32831
32849
  }
32832
32850
  getMetadata() {
32833
32851
  return this.metadata;
@@ -33179,7 +33197,7 @@ class fd extends St {
33179
33197
  }
33180
33198
  }
33181
33199
  K.install({ THREE: d });
33182
- class Hh extends K {
33200
+ class Nh extends K {
33183
33201
  constructor(e, i) {
33184
33202
  super(e, i);
33185
33203
  p(this, "minZoom");
@@ -33255,7 +33273,7 @@ class Hh extends K {
33255
33273
  super.dispose(), this.stopListenToKeyEvents();
33256
33274
  }
33257
33275
  }
33258
- var Nh = /* @__PURE__ */ ((h) => (h[h.Browser = 0] = "Browser", h[h.Browserless = 1] = "Browserless", h[h.Headless = 2] = "Headless", h))(Nh || {});
33276
+ var Hh = /* @__PURE__ */ ((h) => (h[h.Browser = 0] = "Browser", h[h.Browserless = 1] = "Browserless", h[h.Headless = 2] = "Headless", h))(Hh || {});
33259
33277
  class pd {
33260
33278
  constructor(t, e, i) {
33261
33279
  p(this, "containerOrCanvas");
@@ -33368,7 +33386,7 @@ class pd {
33368
33386
  if (!this.renderer) return;
33369
33387
  const t = this.camera;
33370
33388
  if (!t) return;
33371
- const e = new Hh(t, this.renderer.domElement);
33389
+ const e = new Nh(t, this.renderer.domElement);
33372
33390
  e.smoothTime = 0.05, e.enabled = !0, e.keyTruckSpeed = 10, e.keys = {
33373
33391
  left: "KeyD",
33374
33392
  up: "KeyE",
@@ -33668,10 +33686,10 @@ export {
33668
33686
  Ms as BoxSelectHelper,
33669
33687
  zi as ByBlock,
33670
33688
  Kr as ByLayer,
33671
- Hc as CSS2DObjectUtils,
33689
+ Nc as CSS2DObjectUtils,
33672
33690
  Qe as CameraProjection,
33673
33691
  Vc as CancelablePromise,
33674
- Ni as CanvasRender,
33692
+ Hi as CanvasRender,
33675
33693
  ci as ColorUtils,
33676
33694
  V as CommonUtils,
33677
33695
  et as CompareDrawable,
@@ -33763,13 +33781,13 @@ export {
33763
33781
  pd as Viewer3dLite,
33764
33782
  ed as Viewer3dUtils,
33765
33783
  ae as ViewerEvent,
33766
- Nh as ViewerMode,
33784
+ Hh as ViewerMode,
33767
33785
  ze as ViewerName,
33768
33786
  $a as Views,
33769
33787
  Ph as ZoomToRectHelper,
33770
33788
  lo as bspline,
33771
33789
  md as checkIsNewVersion,
33772
- Ns as cn,
33790
+ Hs as cn,
33773
33791
  go as createHatchPatternShaderMaterial,
33774
33792
  uo as decodeDxfTextCharacterCodes,
33775
33793
  po as decodeDxfTextMbcsCharacterCodes,
@@ -33786,5 +33804,5 @@ export {
33786
33804
  Uc as setIcon,
33787
33805
  Ra as setLogLevel,
33788
33806
  Wh as setVersionToLocalStorage,
33789
- Nc as showPrecisionValue
33807
+ Hc as showPrecisionValue
33790
33808
  };