@maqiuyao/dxf-viewer 0.2.29 → 0.2.30

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.
@@ -170,8 +170,8 @@ function wn(c, t, e, i, s) {
170
170
  let n = 1 / 0, r = 1 / 0, a = 1 / 0, o = -1 / 0, l = -1 / 0, h = -1 / 0, d = 1 / 0, u = 1 / 0, f = 1 / 0, m = -1 / 0, x = -1 / 0, y = -1 / 0;
171
171
  const T = c.offset || 0;
172
172
  for (let w = (t - T) * 6, b = (t + e - T) * 6; w < b; w += 6) {
173
- const S = c[w + 0], E = c[w + 1], O = S - E, C = S + E;
174
- O < n && (n = O), C > o && (o = C), S < d && (d = S), S > m && (m = S);
173
+ const E = c[w + 0], S = c[w + 1], O = E - S, C = E + S;
174
+ O < n && (n = O), C > o && (o = C), E < d && (d = E), E > m && (m = E);
175
175
  const v = c[w + 2], M = c[w + 3], _ = v - M, P = v + M;
176
176
  _ < r && (r = _), P > l && (l = P), v < u && (u = v), v > x && (x = v);
177
177
  const I = c[w + 4], B = c[w + 5], k = I - B, D = I + B;
@@ -202,9 +202,9 @@ function Vl(c, t, e, i, s, n) {
202
202
  const w = [...At];
203
203
  w.length = s;
204
204
  let b = 0;
205
- for (let E = d; E < u; E += 6, b++) {
205
+ for (let S = d; S < u; S += 6, b++) {
206
206
  const O = w[b];
207
- O.candidate = e[E + 2 * f], O.count = 0;
207
+ O.candidate = e[S + 2 * f], O.count = 0;
208
208
  const {
209
209
  bounds: C,
210
210
  leftCacheBounds: v,
@@ -212,24 +212,24 @@ function Vl(c, t, e, i, s, n) {
212
212
  } = O;
213
213
  for (let _ = 0; _ < 3; _++)
214
214
  M[_] = 1 / 0, M[_ + 3] = -1 / 0, v[_] = 1 / 0, v[_ + 3] = -1 / 0, C[_] = 1 / 0, C[_ + 3] = -1 / 0;
215
- ms(E, e, C);
215
+ ms(S, e, C);
216
216
  }
217
217
  w.sort(zl);
218
- let S = s;
219
- for (let E = 0; E < S; E++) {
220
- const O = w[E];
221
- for (; E + 1 < S && w[E + 1].candidate === O.candidate; )
222
- w.splice(E + 1, 1), S--;
218
+ let E = s;
219
+ for (let S = 0; S < E; S++) {
220
+ const O = w[S];
221
+ for (; S + 1 < E && w[S + 1].candidate === O.candidate; )
222
+ w.splice(S + 1, 1), E--;
223
223
  }
224
- for (let E = d; E < u; E += 6) {
225
- const O = e[E + 2 * f];
226
- for (let C = 0; C < S; C++) {
224
+ for (let S = d; S < u; S += 6) {
225
+ const O = e[S + 2 * f];
226
+ for (let C = 0; C < E; C++) {
227
227
  const v = w[C];
228
- O >= v.candidate ? ms(E, e, v.rightCacheBounds) : (ms(E, e, v.leftCacheBounds), v.count++);
228
+ O >= v.candidate ? ms(S, e, v.rightCacheBounds) : (ms(S, e, v.leftCacheBounds), v.count++);
229
229
  }
230
230
  }
231
- for (let E = 0; E < S; E++) {
232
- const O = w[E], C = O.count, v = s - O.count, M = O.leftCacheBounds, _ = O.rightCacheBounds;
231
+ for (let S = 0; S < E; S++) {
232
+ const O = w[S], C = O.count, v = s - O.count, M = O.leftCacheBounds, _ = O.rightCacheBounds;
233
233
  let P = 0;
234
234
  C !== 0 && (P = Ni(M) / o);
235
235
  let I = 0;
@@ -238,35 +238,35 @@ function Vl(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 S = 0; S < wt; S++) {
242
- const E = At[S];
243
- E.count = 0, E.candidate = m + T + S * T;
244
- const O = E.bounds;
241
+ for (let E = 0; E < wt; E++) {
242
+ const S = At[E];
243
+ S.count = 0, S.candidate = m + T + E * T;
244
+ const O = S.bounds;
245
245
  for (let C = 0; C < 3; C++)
246
246
  O[C] = 1 / 0, O[C + 3] = -1 / 0;
247
247
  }
248
- for (let S = d; S < u; S += 6) {
249
- let C = ~~((e[S + 2 * f] - m) / T);
248
+ for (let E = d; E < u; E += 6) {
249
+ let C = ~~((e[E + 2 * f] - m) / T);
250
250
  C >= wt && (C = wt - 1);
251
251
  const v = At[C];
252
- v.count++, ms(S, e, v.bounds);
252
+ v.count++, ms(E, e, v.bounds);
253
253
  }
254
254
  const w = At[wt - 1];
255
255
  _r(w.bounds, w.rightCacheBounds);
256
- for (let S = wt - 2; S >= 0; S--) {
257
- const E = At[S], O = At[S + 1];
258
- Pr(E.bounds, O.rightCacheBounds, E.rightCacheBounds);
256
+ for (let E = wt - 2; E >= 0; E--) {
257
+ const S = At[E], O = At[E + 1];
258
+ Pr(S.bounds, O.rightCacheBounds, S.rightCacheBounds);
259
259
  }
260
260
  let b = 0;
261
- for (let S = 0; S < wt - 1; S++) {
262
- const E = At[S], O = E.count, C = E.bounds, M = At[S + 1].rightCacheBounds;
261
+ for (let E = 0; E < wt - 1; E++) {
262
+ const S = At[E], O = S.count, C = S.bounds, M = At[E + 1].rightCacheBounds;
263
263
  O !== 0 && (b === 0 ? _r(C, gs) : Pr(C, gs, gs)), b += O;
264
264
  let _ = 0, P = 0;
265
265
  b !== 0 && (_ = Ni(gs) / o);
266
266
  const I = s - b;
267
267
  I !== 0 && (P = Ni(M) / o);
268
268
  const B = Or + bn * (_ * b + P * I);
269
- B < l && (r = f, l = B, a = E.candidate);
269
+ B < l && (r = f, l = B, a = S.candidate);
270
270
  }
271
271
  }
272
272
  }
@@ -346,22 +346,22 @@ function Gl(c, t, e, i, s, n) {
346
346
  function T(b) {
347
347
  d && d((b - n.offset) / n.count);
348
348
  }
349
- function w(b, S, E, O = null, C = 0) {
349
+ function w(b, E, S, O = null, C = 0) {
350
350
  !x && C >= r && (x = !0, a && console.warn(`BVH: Max depth of ${r} reached when generating BVH. Consider increasing maxDepth.`));
351
- const v = E > l;
352
- if (E <= o && !v || C >= r)
353
- return T(S + E), b.offset = S, b.count = E, b;
354
- const M = Vl(b.boundingData, O, t, S, E, h);
355
- let _ = M.axis === -1 ? -1 : jl(u, f, t, S, E, M);
356
- if (M.axis === -1 || _ === S || _ === S + E) {
351
+ const v = S > l;
352
+ if (S <= o && !v || C >= r)
353
+ return T(E + S), b.offset = E, b.count = S, b;
354
+ const M = Vl(b.boundingData, O, t, E, S, h);
355
+ let _ = M.axis === -1 ? -1 : jl(u, f, t, E, S, M);
356
+ if (M.axis === -1 || _ === E || _ === E + S) {
357
357
  if (!v)
358
- return T(S + E), b.offset = S, b.count = E, b;
359
- M.axis = Math.max(0, er(b.boundingData)), _ = S + Math.max(1, Math.floor(E / 2));
358
+ return T(E + S), b.offset = E, b.count = S, b;
359
+ M.axis = Math.max(0, er(b.boundingData)), _ = E + Math.max(1, Math.floor(S / 2));
360
360
  }
361
361
  b.splitAxis = M.axis;
362
- const P = new vn(), I = S, B = _ - S;
362
+ const P = new vn(), I = E, B = _ - E;
363
363
  b.left = P, wn(t, I, B, P.boundingData, m), w(P, I, B, m, C + 1);
364
- const k = new vn(), D = _, F = E - B;
364
+ const k = new vn(), D = _, F = S - B;
365
365
  return b.right = k, wn(t, D, F, k.boundingData, m), w(k, D, F, m, C + 1), b;
366
366
  }
367
367
  }
@@ -437,13 +437,13 @@ function nr(c, t, e, i, s = null, n = 0, r = 0) {
437
437
  y = T, T = I, w = b;
438
438
  }
439
439
  w || (w = Vt, ce(m, a, w));
440
- const S = ue(m * 2, o), E = e(w, S, y, r + 1, n + m / we);
440
+ const E = ue(m * 2, o), S = e(w, E, y, r + 1, n + m / we);
441
441
  let O;
442
- if (E === Er) {
442
+ if (S === Er) {
443
443
  const I = _(m), k = P(m) - I;
444
444
  O = i(I, k, !0, r + 1, n + m / we, w);
445
445
  } else
446
- O = E && nr(
446
+ O = S && nr(
447
447
  m,
448
448
  t,
449
449
  e,
@@ -506,9 +506,9 @@ function Xl(c, t, e, i) {
506
506
  function nt(c, t, e, i, s, n = 0, r = 0, a = 0, o = 0, l = null, h = !1) {
507
507
  let d, u;
508
508
  h ? (d = tn, u = is) : (d = is, u = tn);
509
- const f = d.float32Array, m = d.uint32Array, x = d.uint16Array, y = u.float32Array, T = u.uint32Array, w = u.uint16Array, b = c * 2, S = t * 2, E = ue(b, x), O = ue(S, w);
509
+ const f = d.float32Array, m = d.uint32Array, x = d.uint16Array, y = u.float32Array, T = u.uint32Array, w = u.uint16Array, b = c * 2, E = t * 2, S = ue(b, x), O = ue(E, w);
510
510
  let C = !1;
511
- if (O && E)
511
+ if (O && S)
512
512
  h ? C = s(
513
513
  Se(t, T),
514
514
  Ae(t * 2, w),
@@ -590,7 +590,7 @@ function nt(c, t, e, i, s, n = 0, r = 0, a = 0, o = 0, l = null, h = !1) {
590
590
  h
591
591
  );
592
592
  else if (_)
593
- if (E)
593
+ if (S)
594
594
  C = nt(
595
595
  c,
596
596
  v,
@@ -637,7 +637,7 @@ function nt(c, t, e, i, s, n = 0, r = 0, a = 0, o = 0, l = null, h = !1) {
637
637
  ), Dt.releasePrimitive(I);
638
638
  }
639
639
  else if (P)
640
- if (E)
640
+ if (S)
641
641
  C = nt(
642
642
  c,
643
643
  M,
@@ -1144,56 +1144,56 @@ ct.prototype.closestPointToSegment = /* @__PURE__ */ (function() {
1144
1144
  })();
1145
1145
  ct.prototype.intersectsTriangle = /* @__PURE__ */ (function() {
1146
1146
  const c = /* @__PURE__ */ new ct(), t = /* @__PURE__ */ new _t(), e = /* @__PURE__ */ new _t(), i = /* @__PURE__ */ new W(), s = /* @__PURE__ */ new W(), n = /* @__PURE__ */ new W(), r = /* @__PURE__ */ new W(), a = /* @__PURE__ */ new Ot(), o = /* @__PURE__ */ new Ot(), l = /* @__PURE__ */ new W(), h = /* @__PURE__ */ new Ut(), d = /* @__PURE__ */ new Ut();
1147
- function u(b, S, E, O) {
1147
+ function u(b, E, S, O) {
1148
1148
  const C = i;
1149
- !b.isDegenerateIntoPoint && !b.isDegenerateIntoSegment ? C.copy(b.plane.normal) : C.copy(S.plane.normal);
1149
+ !b.isDegenerateIntoPoint && !b.isDegenerateIntoSegment ? C.copy(b.plane.normal) : C.copy(E.plane.normal);
1150
1150
  const v = b.satBounds, M = b.satAxes;
1151
1151
  for (let I = 1; I < 4; I++) {
1152
1152
  const B = v[I], k = M[I];
1153
- if (t.setFromPoints(k, S.points), B.isSeparated(t) || (r.copy(C).cross(k), t.setFromPoints(r, b.points), e.setFromPoints(r, S.points), t.isSeparated(e))) return !1;
1153
+ if (t.setFromPoints(k, E.points), B.isSeparated(t) || (r.copy(C).cross(k), t.setFromPoints(r, b.points), e.setFromPoints(r, E.points), t.isSeparated(e))) return !1;
1154
1154
  }
1155
- const _ = S.satBounds, P = S.satAxes;
1155
+ const _ = E.satBounds, P = E.satAxes;
1156
1156
  for (let I = 1; I < 4; I++) {
1157
1157
  const B = _[I], k = P[I];
1158
- if (t.setFromPoints(k, b.points), B.isSeparated(t) || (r.crossVectors(C, k), t.setFromPoints(r, b.points), e.setFromPoints(r, S.points), t.isSeparated(e))) return !1;
1158
+ if (t.setFromPoints(k, b.points), B.isSeparated(t) || (r.crossVectors(C, k), t.setFromPoints(r, b.points), e.setFromPoints(r, E.points), t.isSeparated(e))) return !1;
1159
1159
  }
1160
- return E && (O || console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."), E.start.set(0, 0, 0), E.end.set(0, 0, 0)), !0;
1160
+ return S && (O || console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."), S.start.set(0, 0, 0), S.end.set(0, 0, 0)), !0;
1161
1161
  }
1162
- function f(b, S, E, O, C, v, M, _, P, I, B) {
1162
+ function f(b, E, S, O, C, v, M, _, P, I, B) {
1163
1163
  let k = M / (M - _);
1164
- I.x = O + (C - O) * k, B.start.subVectors(S, b).multiplyScalar(k).add(b), k = M / (M - P), I.y = O + (v - O) * k, B.end.subVectors(E, b).multiplyScalar(k).add(b);
1164
+ I.x = O + (C - O) * k, B.start.subVectors(E, b).multiplyScalar(k).add(b), k = M / (M - P), I.y = O + (v - O) * k, B.end.subVectors(S, b).multiplyScalar(k).add(b);
1165
1165
  }
1166
- function m(b, S, E, O, C, v, M, _, P, I, B) {
1166
+ function m(b, E, S, O, C, v, M, _, P, I, B) {
1167
1167
  if (C > 0)
1168
- f(b.c, b.a, b.b, O, S, E, P, M, _, I, B);
1168
+ f(b.c, b.a, b.b, O, E, S, P, M, _, I, B);
1169
1169
  else if (v > 0)
1170
- f(b.b, b.a, b.c, E, S, O, _, M, P, I, B);
1170
+ f(b.b, b.a, b.c, S, E, O, _, M, P, I, B);
1171
1171
  else if (_ * P > 0 || M != 0)
1172
- f(b.a, b.b, b.c, S, E, O, M, _, P, I, B);
1172
+ f(b.a, b.b, b.c, E, S, O, M, _, P, I, B);
1173
1173
  else if (_ != 0)
1174
- f(b.b, b.a, b.c, E, S, O, _, M, P, I, B);
1174
+ f(b.b, b.a, b.c, S, E, O, _, M, P, I, B);
1175
1175
  else if (P != 0)
1176
- f(b.c, b.a, b.b, O, S, E, P, M, _, I, B);
1176
+ f(b.c, b.a, b.b, O, E, S, P, M, _, I, B);
1177
1177
  else
1178
1178
  return !0;
1179
1179
  return !1;
1180
1180
  }
1181
- function x(b, S, E, O) {
1182
- const C = S.degenerateSegment, v = b.plane.distanceToPoint(C.start), M = b.plane.distanceToPoint(C.end);
1183
- return Ze(v) ? Ze(M) ? u(b, S, E, O) : (E && (E.start.copy(C.start), E.end.copy(C.start)), b.containsPoint(C.start)) : Ze(M) ? (E && (E.start.copy(C.end), E.end.copy(C.end)), b.containsPoint(C.end)) : b.plane.intersectLine(C, i) != null ? (E && (E.start.copy(i), E.end.copy(i)), b.containsPoint(i)) : !1;
1181
+ function x(b, E, S, O) {
1182
+ const C = E.degenerateSegment, v = b.plane.distanceToPoint(C.start), M = b.plane.distanceToPoint(C.end);
1183
+ return Ze(v) ? Ze(M) ? u(b, E, S, O) : (S && (S.start.copy(C.start), S.end.copy(C.start)), b.containsPoint(C.start)) : Ze(M) ? (S && (S.start.copy(C.end), S.end.copy(C.end)), b.containsPoint(C.end)) : b.plane.intersectLine(C, i) != null ? (S && (S.start.copy(i), S.end.copy(i)), b.containsPoint(i)) : !1;
1184
1184
  }
1185
- function y(b, S, E) {
1186
- const O = S.a;
1187
- return Ze(b.plane.distanceToPoint(O)) && b.containsPoint(O) ? (E && (E.start.copy(O), E.end.copy(O)), !0) : !1;
1185
+ function y(b, E, S) {
1186
+ const O = E.a;
1187
+ return Ze(b.plane.distanceToPoint(O)) && b.containsPoint(O) ? (S && (S.start.copy(O), S.end.copy(O)), !0) : !1;
1188
1188
  }
1189
- function T(b, S, E) {
1190
- const O = b.degenerateSegment, C = S.a;
1191
- return O.closestPointToPoint(C, !0, i), C.distanceToSquared(i) < Br ? (E && (E.start.copy(C), E.end.copy(C)), !0) : !1;
1189
+ function T(b, E, S) {
1190
+ const O = b.degenerateSegment, C = E.a;
1191
+ return O.closestPointToPoint(C, !0, i), C.distanceToSquared(i) < Br ? (S && (S.start.copy(C), S.end.copy(C)), !0) : !1;
1192
1192
  }
1193
- function w(b, S, E, O) {
1193
+ function w(b, E, S, O) {
1194
1194
  if (b.isDegenerateIntoSegment)
1195
- if (S.isDegenerateIntoSegment) {
1196
- const C = b.degenerateSegment, v = S.degenerateSegment, M = s, _ = n;
1195
+ if (E.isDegenerateIntoSegment) {
1196
+ const C = b.degenerateSegment, v = E.degenerateSegment, M = s, _ = n;
1197
1197
  C.delta(M), v.delta(_);
1198
1198
  const P = i.subVectors(v.start, C.start), I = M.x * _.y - M.y * _.x;
1199
1199
  if (Ze(I))
@@ -1202,29 +1202,29 @@ ct.prototype.intersectsTriangle = /* @__PURE__ */ (function() {
1202
1202
  if (B < 0 || B > 1 || k < 0 || k > 1)
1203
1203
  return !1;
1204
1204
  const D = C.start.z + M.z * B, F = v.start.z + _.z * k;
1205
- return Ze(D - F) ? (E && (E.start.copy(C.start).addScaledVector(M, B), E.end.copy(C.start).addScaledVector(M, B)), !0) : !1;
1206
- } else return S.isDegenerateIntoPoint ? T(b, S, E) : x(S, b, E, O);
1205
+ return Ze(D - F) ? (S && (S.start.copy(C.start).addScaledVector(M, B), S.end.copy(C.start).addScaledVector(M, B)), !0) : !1;
1206
+ } else return E.isDegenerateIntoPoint ? T(b, E, S) : x(E, b, S, O);
1207
1207
  else {
1208
1208
  if (b.isDegenerateIntoPoint)
1209
- return S.isDegenerateIntoPoint ? S.a.distanceToSquared(b.a) < Br ? (E && (E.start.copy(b.a), E.end.copy(b.a)), !0) : !1 : S.isDegenerateIntoSegment ? T(S, b, E) : y(S, b, E);
1210
- if (S.isDegenerateIntoPoint)
1211
- return y(b, S, E);
1212
- if (S.isDegenerateIntoSegment)
1213
- return x(b, S, E, O);
1209
+ return E.isDegenerateIntoPoint ? E.a.distanceToSquared(b.a) < Br ? (S && (S.start.copy(b.a), S.end.copy(b.a)), !0) : !1 : E.isDegenerateIntoSegment ? T(E, b, S) : y(E, b, S);
1210
+ if (E.isDegenerateIntoPoint)
1211
+ return y(b, E, S);
1212
+ if (E.isDegenerateIntoSegment)
1213
+ return x(b, E, S, O);
1214
1214
  }
1215
1215
  }
1216
- return function(S, E = null, O = !1) {
1217
- this.needsUpdate && this.update(), S.isExtendedTriangle ? S.needsUpdate && S.update() : (c.copy(S), c.update(), S = c);
1218
- const C = w(this, S, E, O);
1216
+ return function(E, S = null, O = !1) {
1217
+ this.needsUpdate && this.update(), E.isExtendedTriangle ? E.needsUpdate && E.update() : (c.copy(E), c.update(), E = c);
1218
+ const C = w(this, E, S, O);
1219
1219
  if (C !== void 0)
1220
1220
  return C;
1221
- const v = this.plane, M = S.plane;
1221
+ const v = this.plane, M = E.plane;
1222
1222
  let _ = M.distanceToPoint(this.a), P = M.distanceToPoint(this.b), I = M.distanceToPoint(this.c);
1223
1223
  Ze(_) && (_ = 0), Ze(P) && (P = 0), Ze(I) && (I = 0);
1224
1224
  const B = _ * P, k = _ * I;
1225
1225
  if (B > 0 && k > 0)
1226
1226
  return !1;
1227
- let D = v.distanceToPoint(S.a), F = v.distanceToPoint(S.b), se = v.distanceToPoint(S.c);
1227
+ let D = v.distanceToPoint(E.a), F = v.distanceToPoint(E.b), se = v.distanceToPoint(E.c);
1228
1228
  Ze(D) && (D = 0), Ze(F) && (F = 0), Ze(se) && (se = 0);
1229
1229
  const re = D * F, Ue = D * se;
1230
1230
  if (re > 0 && Ue > 0)
@@ -1234,11 +1234,11 @@ ct.prototype.intersectsTriangle = /* @__PURE__ */ (function() {
1234
1234
  let de = 0, Vi = Math.abs(Be.x);
1235
1235
  const et = Math.abs(Be.y);
1236
1236
  et > Vi && (Vi = et, de = 1), Math.abs(Be.z) > Vi && (de = 2);
1237
- const ke = rc[de], Pt = this.a[ke], Ui = this.b[ke], Nt = this.c[ke], Ht = S.a[ke], Gt = S.b[ke], Wt = S.c[ke];
1237
+ const ke = rc[de], Pt = this.a[ke], Ui = this.b[ke], Nt = this.c[ke], Ht = E.a[ke], Gt = E.b[ke], Wt = E.c[ke];
1238
1238
  if (m(this, Pt, Ui, Nt, B, k, _, P, I, h, a))
1239
- return u(this, S, E, O);
1240
- if (m(S, Ht, Gt, Wt, re, Ue, D, F, se, d, o))
1241
- return u(this, S, E, O);
1239
+ return u(this, E, S, O);
1240
+ if (m(E, Ht, Gt, Wt, re, Ue, D, F, se, d, o))
1241
+ return u(this, E, S, O);
1242
1242
  if (h.y < h.x) {
1243
1243
  const gn = h.y;
1244
1244
  h.y = h.x, h.x = gn, l.copy(a.start), a.start.copy(a.end), a.end.copy(l);
@@ -1247,7 +1247,7 @@ ct.prototype.intersectsTriangle = /* @__PURE__ */ (function() {
1247
1247
  const gn = d.y;
1248
1248
  d.y = d.x, d.x = gn, l.copy(o.start), o.start.copy(o.end), o.end.copy(l);
1249
1249
  }
1250
- return h.y < d.x || d.y < h.x ? !1 : (E && (d.x > h.x ? E.start.copy(o.start) : E.start.copy(a.start), d.y < h.y ? E.end.copy(o.end) : E.end.copy(a.end)), !0);
1250
+ return h.y < d.x || d.y < h.x ? !1 : (S && (d.x > h.x ? S.start.copy(o.start) : S.start.copy(a.start), d.y < h.y ? S.end.copy(o.end) : S.end.copy(a.end)), !0);
1251
1251
  };
1252
1252
  })();
1253
1253
  ct.prototype.distanceToPoint = /* @__PURE__ */ (function() {
@@ -1385,9 +1385,9 @@ ze.prototype.distanceToBox = /* @__PURE__ */ (function() {
1385
1385
  for (let y = 0; y < 3; y++)
1386
1386
  for (let T = 0; T <= 1; T++)
1387
1387
  for (let w = 0; w <= 1; w++) {
1388
- const b = (y + 1) % 3, S = (y + 2) % 3, E = T << b | w << S, O = 1 << y | T << b | w << S, C = f[E], v = f[O];
1388
+ const b = (y + 1) % 3, E = (y + 2) % 3, S = T << b | w << E, O = 1 << y | T << b | w << E, C = f[S], v = f[O];
1389
1389
  t[x].set(C, v);
1390
- const _ = c[y], P = c[b], I = c[S], B = e[x], k = B.start, D = B.end;
1390
+ const _ = c[y], P = c[b], I = c[E], B = e[x], k = B.start, D = B.end;
1391
1391
  k[_] = d[_], k[P] = T ? d[P] : u[P], k[I] = w ? d[I] : u[P], D[_] = u[_], D[P] = T ? d[P] : u[P], D[I] = w ? d[I] : u[P], x++;
1392
1392
  }
1393
1393
  for (let y = 0; y <= 1; y++)
@@ -1403,9 +1403,9 @@ ze.prototype.distanceToBox = /* @__PURE__ */ (function() {
1403
1403
  for (let w = 0; w < 12; w++) {
1404
1404
  const b = e[w];
1405
1405
  xr(T, b, i, s);
1406
- const S = i.distanceToSquared(s);
1407
- if (S < m && (m = S, o && o.copy(i), l && l.copy(s), S < h))
1408
- return Math.sqrt(S);
1406
+ const E = i.distanceToSquared(s);
1407
+ if (E < m && (m = E, o && o.copy(i), l && l.copy(s), E < h))
1408
+ return Math.sqrt(E);
1409
1409
  }
1410
1410
  }
1411
1411
  return Math.sqrt(m);
@@ -1489,8 +1489,8 @@ function dn(c, t, e, i, s, n, r) {
1489
1489
  if (Array.isArray(t)) {
1490
1490
  const T = i * 3;
1491
1491
  for (let w = 0, b = u.length; w < b; w++) {
1492
- const { start: S, count: E, materialIndex: O } = u[w];
1493
- if (T >= S && T < S + E) {
1492
+ const { start: E, count: S, materialIndex: O } = u[w];
1493
+ if (T >= E && T < E + S) {
1494
1494
  const C = Fr(t[O]), v = Rr(e, f, m, x, y, o, l, h, C, n, r);
1495
1495
  if (v)
1496
1496
  if (v.faceIndex = i, v.face.materialIndex = O, s)
@@ -1548,26 +1548,26 @@ function fc(c, t = null) {
1548
1548
  const x = u * 2;
1549
1549
  if (ue(x, a)) {
1550
1550
  const y = Se(u, r), T = Ae(x, a);
1551
- let w = 1 / 0, b = 1 / 0, S = 1 / 0, E = -1 / 0, O = -1 / 0, C = -1 / 0;
1551
+ let w = 1 / 0, b = 1 / 0, E = 1 / 0, S = -1 / 0, O = -1 / 0, C = -1 / 0;
1552
1552
  for (let v = 3 * y, M = 3 * (y + T); v < M; v++) {
1553
1553
  let _ = i[v];
1554
1554
  const P = s.getX(_), I = s.getY(_), B = s.getZ(_);
1555
- P < w && (w = P), P > E && (E = P), I < b && (b = I), I > O && (O = I), B < S && (S = B), B > C && (C = B);
1555
+ P < w && (w = P), P > S && (S = P), I < b && (b = I), I > O && (O = I), B < E && (E = B), B > C && (C = B);
1556
1556
  }
1557
- return o[u + 0] !== w || o[u + 1] !== b || o[u + 2] !== S || o[u + 3] !== E || o[u + 4] !== O || o[u + 5] !== C ? (o[u + 0] = w, o[u + 1] = b, o[u + 2] = S, o[u + 3] = E, o[u + 4] = O, o[u + 5] = C, !0) : !1;
1557
+ return o[u + 0] !== w || o[u + 1] !== b || o[u + 2] !== E || o[u + 3] !== S || o[u + 4] !== O || o[u + 5] !== C ? (o[u + 0] = w, o[u + 1] = b, o[u + 2] = E, o[u + 3] = S, o[u + 4] = O, o[u + 5] = C, !0) : !1;
1558
1558
  } else {
1559
1559
  const y = ve(u), T = Me(u, r);
1560
- let w = m, b = !1, S = !1;
1560
+ let w = m, b = !1, E = !1;
1561
1561
  if (t) {
1562
1562
  if (!w) {
1563
1563
  const _ = y / we + f / Pe, P = T / we + f / Pe;
1564
- b = t.has(_), S = t.has(P), w = !b && !S;
1564
+ b = t.has(_), E = t.has(P), w = !b && !E;
1565
1565
  }
1566
1566
  } else
1567
- b = !0, S = !0;
1568
- const E = w || b, O = w || S;
1567
+ b = !0, E = !0;
1568
+ const S = w || b, O = w || E;
1569
1569
  let C = !1;
1570
- E && (C = d(y, f, w));
1570
+ S && (C = d(y, f, w));
1571
1571
  let v = !1;
1572
1572
  O && (v = d(T, f, w));
1573
1573
  const M = C || v;
@@ -1583,8 +1583,8 @@ function fc(c, t = null) {
1583
1583
  function jt(c, t, e, i, s) {
1584
1584
  let n, r, a, o, l, h;
1585
1585
  const d = 1 / e.direction.x, u = 1 / e.direction.y, f = 1 / e.direction.z, m = e.origin.x, x = e.origin.y, y = e.origin.z;
1586
- let T = t[c], w = t[c + 3], b = t[c + 1], S = t[c + 3 + 1], E = t[c + 2], O = t[c + 3 + 2];
1587
- return d >= 0 ? (n = (T - m) * d, r = (w - m) * d) : (n = (w - m) * d, r = (T - m) * d), u >= 0 ? (a = (b - x) * u, o = (S - x) * u) : (a = (S - x) * u, o = (b - x) * u), n > o || a > r || ((a > n || isNaN(n)) && (n = a), (o < r || isNaN(r)) && (r = o), f >= 0 ? (l = (E - y) * f, h = (O - y) * f) : (l = (O - y) * f, h = (E - y) * f), n > h || l > r) ? !1 : ((l > n || n !== n) && (n = l), (h < r || r !== r) && (r = h), n <= s && r >= i);
1586
+ let T = t[c], w = t[c + 3], b = t[c + 1], E = t[c + 3 + 1], S = t[c + 2], O = t[c + 3 + 2];
1587
+ return d >= 0 ? (n = (T - m) * d, r = (w - m) * d) : (n = (w - m) * d, r = (T - m) * d), u >= 0 ? (a = (b - x) * u, o = (E - x) * u) : (a = (E - x) * u, o = (b - x) * u), n > o || a > r || ((a > n || isNaN(n)) && (n = a), (o < r || isNaN(r)) && (r = o), f >= 0 ? (l = (S - y) * f, h = (O - y) * f) : (l = (O - y) * f, h = (S - y) * f), n > h || l > r) ? !1 : ((l > n || n !== n) && (n = l), (h < r || r !== r) && (r = h), n <= s && r >= i);
1588
1588
  }
1589
1589
  function pc(c, t, e, i, s, n, r, a) {
1590
1590
  const { geometry: o, _indirectBuffer: l } = c;
@@ -1644,15 +1644,15 @@ function ar(c, t, e, i, s, n) {
1644
1644
  m ? (x = ve(c), y = Me(c, o)) : (x = Me(c, o), y = ve(c));
1645
1645
  const w = jt(x, r, i, s, n) ? ar(x, t, e, i, s, n) : null;
1646
1646
  if (w) {
1647
- const E = w.point[u];
1648
- if (m ? E <= r[y + d] : (
1647
+ const S = w.point[u];
1648
+ if (m ? S <= r[y + d] : (
1649
1649
  // min bounding data
1650
- E >= r[y + d + 3]
1650
+ S >= r[y + d + 3]
1651
1651
  ))
1652
1652
  return w;
1653
1653
  }
1654
- const S = jt(y, r, i, s, n) ? ar(y, t, e, i, s, n) : null;
1655
- return w && S ? w.distance <= S.distance ? w : S : w || S || null;
1654
+ const E = jt(y, r, i, s, n) ? ar(y, t, e, i, s, n) : null;
1655
+ return w && E ? w.distance <= E.distance ? w : E : w || E || null;
1656
1656
  }
1657
1657
  }
1658
1658
  const Ms = /* @__PURE__ */ new Re(), fi = /* @__PURE__ */ new ct(), pi = /* @__PURE__ */ new ct(), Wi = /* @__PURE__ */ new lt(), zr = /* @__PURE__ */ new ze(), Ts = /* @__PURE__ */ new ze();
@@ -1671,7 +1671,7 @@ function or(c, t, e, i, s = null) {
1671
1671
  intersectsBounds: (w) => Ts.intersectsBox(w),
1672
1672
  intersectsTriangle: (w) => {
1673
1673
  w.a.applyMatrix4(i), w.b.applyMatrix4(i), w.c.applyMatrix4(i), w.needsUpdate = !0;
1674
- for (let b = x * 3, S = (y + x) * 3; b < S; b += 3)
1674
+ for (let b = x * 3, E = (y + x) * 3; b < E; b += 3)
1675
1675
  if (me(pi, b, d, u), pi.needsUpdate = !0, w.intersectsTriangle(pi))
1676
1676
  return !0;
1677
1677
  return !1;
@@ -1681,8 +1681,8 @@ function or(c, t, e, i, s = null) {
1681
1681
  const T = hn(e);
1682
1682
  for (let w = x * 3, b = (y + x) * 3; w < b; w += 3) {
1683
1683
  me(fi, w, d, u), fi.a.applyMatrix4(Wi), fi.b.applyMatrix4(Wi), fi.c.applyMatrix4(Wi), fi.needsUpdate = !0;
1684
- for (let S = 0, E = T * 3; S < E; S += 3)
1685
- if (me(pi, S, f, m), pi.needsUpdate = !0, fi.intersectsTriangle(pi))
1684
+ for (let E = 0, S = T * 3; E < S; E += 3)
1685
+ if (me(pi, E, f, m), pi.needsUpdate = !0, fi.intersectsTriangle(pi))
1686
1686
  return !0;
1687
1687
  }
1688
1688
  }
@@ -1697,12 +1697,12 @@ function Sc(c, t, e, i = {}, s = {}, n = 0, r = 1 / 0) {
1697
1697
  const a = c.geometry, o = a.attributes.position, l = a.index, h = t.attributes.position, d = t.index, u = Je.getPrimitive(), f = Je.getPrimitive();
1698
1698
  let m = vc, x = Mc, y = null, T = null;
1699
1699
  s && (y = Tc, T = Cc);
1700
- let w = 1 / 0, b = null, S = null;
1700
+ let w = 1 / 0, b = null, E = null;
1701
1701
  return Cs.copy(e).invert(), qi.matrix.copy(Cs), c.shapecast(
1702
1702
  {
1703
- boundsTraverseOrder: (E) => On.distanceToBox(E),
1704
- intersectsBounds: (E, O, C) => C < w && C < r ? (O && (qi.min.copy(E.min), qi.max.copy(E.max), qi.needsUpdate = !0), !0) : !1,
1705
- intersectsRange: (E, O) => {
1703
+ boundsTraverseOrder: (S) => On.distanceToBox(S),
1704
+ intersectsBounds: (S, O, C) => C < w && C < r ? (O && (qi.min.copy(S.min), qi.max.copy(S.max), qi.needsUpdate = !0), !0) : !1,
1705
+ intersectsRange: (S, O) => {
1706
1706
  if (t.boundsTree)
1707
1707
  return t.boundsTree.shapecast({
1708
1708
  boundsTraverseOrder: (v) => qi.distanceToBox(v),
@@ -1710,10 +1710,10 @@ function Sc(c, t, e, i = {}, s = {}, n = 0, r = 1 / 0) {
1710
1710
  intersectsRange: (v, M) => {
1711
1711
  for (let _ = v, P = v + M; _ < P; _++) {
1712
1712
  me(f, 3 * _, d, h), f.a.applyMatrix4(e), f.b.applyMatrix4(e), f.c.applyMatrix4(e), f.needsUpdate = !0;
1713
- for (let I = E, B = E + O; I < B; I++) {
1713
+ for (let I = S, B = S + O; I < B; I++) {
1714
1714
  me(u, 3 * I, l, o), u.needsUpdate = !0;
1715
1715
  const k = u.distanceToTriangle(f, m, y);
1716
- if (k < w && (x.copy(m), T && T.copy(y), w = k, b = I, S = _), k < n)
1716
+ if (k < w && (x.copy(m), T && T.copy(y), w = k, b = I, E = _), k < n)
1717
1717
  return !0;
1718
1718
  }
1719
1719
  }
@@ -1723,17 +1723,17 @@ function Sc(c, t, e, i = {}, s = {}, n = 0, r = 1 / 0) {
1723
1723
  const C = hn(t);
1724
1724
  for (let v = 0, M = C; v < M; v++) {
1725
1725
  me(f, 3 * v, d, h), f.a.applyMatrix4(e), f.b.applyMatrix4(e), f.c.applyMatrix4(e), f.needsUpdate = !0;
1726
- for (let _ = E, P = E + O; _ < P; _++) {
1726
+ for (let _ = S, P = S + O; _ < P; _++) {
1727
1727
  me(u, 3 * _, l, o), u.needsUpdate = !0;
1728
1728
  const I = u.distanceToTriangle(f, m, y);
1729
- if (I < w && (x.copy(m), T && T.copy(y), w = I, b = _, S = v), I < n)
1729
+ if (I < w && (x.copy(m), T && T.copy(y), w = I, b = _, E = v), I < n)
1730
1730
  return !0;
1731
1731
  }
1732
1732
  }
1733
1733
  }
1734
1734
  }
1735
1735
  }
1736
- ), Je.releasePrimitive(u), Je.releasePrimitive(f), w === 1 / 0 ? null : (i.point ? i.point.copy(x) : i.point = x.clone(), i.distance = w, i.faceIndex = b, s && (s.point ? s.point.copy(T) : s.point = T.clone(), s.point.applyMatrix4(Cs), x.applyMatrix4(Cs), s.distance = x.sub(s.point).length(), s.faceIndex = S), i);
1736
+ ), Je.releasePrimitive(u), Je.releasePrimitive(f), w === 1 / 0 ? null : (i.point ? i.point.copy(x) : i.point = x.clone(), i.distance = w, i.faceIndex = b, s && (s.point ? s.point.copy(T) : s.point = T.clone(), s.point.applyMatrix4(Cs), x.applyMatrix4(Cs), s.distance = x.sub(s.point).length(), s.faceIndex = E), i);
1737
1737
  }
1738
1738
  function Ec(c, t = null) {
1739
1739
  t && Array.isArray(t) && (t = new Set(t));
@@ -1746,30 +1746,30 @@ function Ec(c, t = null) {
1746
1746
  const x = u * 2;
1747
1747
  if (ue(x, a)) {
1748
1748
  const y = Se(u, r), T = Ae(x, a);
1749
- let w = 1 / 0, b = 1 / 0, S = 1 / 0, E = -1 / 0, O = -1 / 0, C = -1 / 0;
1749
+ let w = 1 / 0, b = 1 / 0, E = 1 / 0, S = -1 / 0, O = -1 / 0, C = -1 / 0;
1750
1750
  for (let v = y, M = y + T; v < M; v++) {
1751
1751
  const _ = 3 * c.resolveTriangleIndex(v);
1752
1752
  for (let P = 0; P < 3; P++) {
1753
1753
  let I = _ + P;
1754
1754
  I = i ? i[I] : I;
1755
1755
  const B = s.getX(I), k = s.getY(I), D = s.getZ(I);
1756
- B < w && (w = B), B > E && (E = B), k < b && (b = k), k > O && (O = k), D < S && (S = D), D > C && (C = D);
1756
+ B < w && (w = B), B > S && (S = B), k < b && (b = k), k > O && (O = k), D < E && (E = D), D > C && (C = D);
1757
1757
  }
1758
1758
  }
1759
- return o[u + 0] !== w || o[u + 1] !== b || o[u + 2] !== S || o[u + 3] !== E || o[u + 4] !== O || o[u + 5] !== C ? (o[u + 0] = w, o[u + 1] = b, o[u + 2] = S, o[u + 3] = E, o[u + 4] = O, o[u + 5] = C, !0) : !1;
1759
+ return o[u + 0] !== w || o[u + 1] !== b || o[u + 2] !== E || o[u + 3] !== S || o[u + 4] !== O || o[u + 5] !== C ? (o[u + 0] = w, o[u + 1] = b, o[u + 2] = E, o[u + 3] = S, o[u + 4] = O, o[u + 5] = C, !0) : !1;
1760
1760
  } else {
1761
1761
  const y = ve(u), T = Me(u, r);
1762
- let w = m, b = !1, S = !1;
1762
+ let w = m, b = !1, E = !1;
1763
1763
  if (t) {
1764
1764
  if (!w) {
1765
1765
  const _ = y / we + f / Pe, P = T / we + f / Pe;
1766
- b = t.has(_), S = t.has(P), w = !b && !S;
1766
+ b = t.has(_), E = t.has(P), w = !b && !E;
1767
1767
  }
1768
1768
  } else
1769
- b = !0, S = !0;
1770
- const E = w || b, O = w || S;
1769
+ b = !0, E = !0;
1770
+ const S = w || b, O = w || E;
1771
1771
  let C = !1;
1772
- E && (C = d(y, f, w));
1772
+ S && (C = d(y, f, w));
1773
1773
  let v = !1;
1774
1774
  O && (v = d(T, f, w));
1775
1775
  const M = C || v;
@@ -1815,15 +1815,15 @@ function cr(c, t, e, i, s, n) {
1815
1815
  m ? (x = ve(c), y = Me(c, o)) : (x = Me(c, o), y = ve(c));
1816
1816
  const w = jt(x, r, i, s, n) ? cr(x, t, e, i, s, n) : null;
1817
1817
  if (w) {
1818
- const E = w.point[u];
1819
- if (m ? E <= r[y + d] : (
1818
+ const S = w.point[u];
1819
+ if (m ? S <= r[y + d] : (
1820
1820
  // min bounding data
1821
- E >= r[y + d + 3]
1821
+ S >= r[y + d + 3]
1822
1822
  ))
1823
1823
  return w;
1824
1824
  }
1825
- const S = jt(y, r, i, s, n) ? cr(y, t, e, i, s, n) : null;
1826
- return w && S ? w.distance <= S.distance ? w : S : w || S || null;
1825
+ const E = jt(y, r, i, s, n) ? cr(y, t, e, i, s, n) : null;
1826
+ return w && E ? w.distance <= E.distance ? w : E : w || E || null;
1827
1827
  }
1828
1828
  }
1829
1829
  const Ss = /* @__PURE__ */ new Re(), mi = /* @__PURE__ */ new ct(), gi = /* @__PURE__ */ new ct(), Yi = /* @__PURE__ */ new lt(), Vr = /* @__PURE__ */ new ze(), Es = /* @__PURE__ */ new ze();
@@ -1842,7 +1842,7 @@ function hr(c, t, e, i, s = null) {
1842
1842
  intersectsBounds: (w) => Es.intersectsBox(w),
1843
1843
  intersectsTriangle: (w) => {
1844
1844
  w.a.applyMatrix4(i), w.b.applyMatrix4(i), w.c.applyMatrix4(i), w.needsUpdate = !0;
1845
- for (let b = x, S = y + x; b < S; b++)
1845
+ for (let b = x, E = y + x; b < E; b++)
1846
1846
  if (me(gi, 3 * t.resolveTriangleIndex(b), d, u), gi.needsUpdate = !0, w.intersectsTriangle(gi))
1847
1847
  return !0;
1848
1848
  return !1;
@@ -1851,10 +1851,10 @@ function hr(c, t, e, i, s = null) {
1851
1851
  {
1852
1852
  const T = hn(e);
1853
1853
  for (let w = x, b = y + x; w < b; w++) {
1854
- const S = t.resolveTriangleIndex(w);
1855
- me(mi, 3 * S, d, u), mi.a.applyMatrix4(Yi), mi.b.applyMatrix4(Yi), mi.c.applyMatrix4(Yi), mi.needsUpdate = !0;
1856
- for (let E = 0, O = T * 3; E < O; E += 3)
1857
- if (me(gi, E, f, m), gi.needsUpdate = !0, mi.intersectsTriangle(gi))
1854
+ const E = t.resolveTriangleIndex(w);
1855
+ me(mi, 3 * E, d, u), mi.a.applyMatrix4(Yi), mi.b.applyMatrix4(Yi), mi.c.applyMatrix4(Yi), mi.needsUpdate = !0;
1856
+ for (let S = 0, O = T * 3; S < O; S += 3)
1857
+ if (me(gi, S, f, m), gi.needsUpdate = !0, mi.intersectsTriangle(gi))
1858
1858
  return !0;
1859
1859
  }
1860
1860
  }
@@ -1869,12 +1869,12 @@ function Lc(c, t, e, i = {}, s = {}, n = 0, r = 1 / 0) {
1869
1869
  const a = c.geometry, o = a.attributes.position, l = a.index, h = t.attributes.position, d = t.index, u = Je.getPrimitive(), f = Je.getPrimitive();
1870
1870
  let m = Ic, x = Bc, y = null, T = null;
1871
1871
  s && (y = kc, T = Dc);
1872
- let w = 1 / 0, b = null, S = null;
1872
+ let w = 1 / 0, b = null, E = null;
1873
1873
  return Os.copy(e).invert(), Xi.matrix.copy(Os), c.shapecast(
1874
1874
  {
1875
- boundsTraverseOrder: (E) => _n.distanceToBox(E),
1876
- intersectsBounds: (E, O, C) => C < w && C < r ? (O && (Xi.min.copy(E.min), Xi.max.copy(E.max), Xi.needsUpdate = !0), !0) : !1,
1877
- intersectsRange: (E, O) => {
1875
+ boundsTraverseOrder: (S) => _n.distanceToBox(S),
1876
+ intersectsBounds: (S, O, C) => C < w && C < r ? (O && (Xi.min.copy(S.min), Xi.max.copy(S.max), Xi.needsUpdate = !0), !0) : !1,
1877
+ intersectsRange: (S, O) => {
1878
1878
  if (t.boundsTree) {
1879
1879
  const C = t.boundsTree;
1880
1880
  return C.shapecast({
@@ -1884,11 +1884,11 @@ function Lc(c, t, e, i = {}, s = {}, n = 0, r = 1 / 0) {
1884
1884
  for (let _ = v, P = v + M; _ < P; _++) {
1885
1885
  const I = C.resolveTriangleIndex(_);
1886
1886
  me(f, 3 * I, d, h), f.a.applyMatrix4(e), f.b.applyMatrix4(e), f.c.applyMatrix4(e), f.needsUpdate = !0;
1887
- for (let B = E, k = E + O; B < k; B++) {
1887
+ for (let B = S, k = S + O; B < k; B++) {
1888
1888
  const D = c.resolveTriangleIndex(B);
1889
1889
  me(u, 3 * D, l, o), u.needsUpdate = !0;
1890
1890
  const F = u.distanceToTriangle(f, m, y);
1891
- if (F < w && (x.copy(m), T && T.copy(y), w = F, b = B, S = _), F < n)
1891
+ if (F < w && (x.copy(m), T && T.copy(y), w = F, b = B, E = _), F < n)
1892
1892
  return !0;
1893
1893
  }
1894
1894
  }
@@ -1898,18 +1898,18 @@ function Lc(c, t, e, i = {}, s = {}, n = 0, r = 1 / 0) {
1898
1898
  const C = hn(t);
1899
1899
  for (let v = 0, M = C; v < M; v++) {
1900
1900
  me(f, 3 * v, d, h), f.a.applyMatrix4(e), f.b.applyMatrix4(e), f.c.applyMatrix4(e), f.needsUpdate = !0;
1901
- for (let _ = E, P = E + O; _ < P; _++) {
1901
+ for (let _ = S, P = S + O; _ < P; _++) {
1902
1902
  const I = c.resolveTriangleIndex(_);
1903
1903
  me(u, 3 * I, l, o), u.needsUpdate = !0;
1904
1904
  const B = u.distanceToTriangle(f, m, y);
1905
- if (B < w && (x.copy(m), T && T.copy(y), w = B, b = _, S = v), B < n)
1905
+ if (B < w && (x.copy(m), T && T.copy(y), w = B, b = _, E = v), B < n)
1906
1906
  return !0;
1907
1907
  }
1908
1908
  }
1909
1909
  }
1910
1910
  }
1911
1911
  }
1912
- ), Je.releasePrimitive(u), Je.releasePrimitive(f), w === 1 / 0 ? null : (i.point ? i.point.copy(x) : i.point = x.clone(), i.distance = w, i.faceIndex = b, s && (s.point ? s.point.copy(T) : s.point = T.clone(), s.point.applyMatrix4(Os), x.applyMatrix4(Os), s.distance = x.sub(s.point).length(), s.faceIndex = S), i);
1912
+ ), Je.releasePrimitive(u), Je.releasePrimitive(f), w === 1 / 0 ? null : (i.point ? i.point.copy(x) : i.point = x.clone(), i.distance = w, i.faceIndex = b, s && (s.point ? s.point.copy(T) : s.point = T.clone(), s.point.applyMatrix4(Os), x.applyMatrix4(Os), s.distance = x.sub(s.point).length(), s.faceIndex = E), i);
1913
1913
  }
1914
1914
  function Ur(c, t, e) {
1915
1915
  return c === null ? null : (c.point.applyMatrix4(t.matrixWorld), c.distance = c.point.distanceTo(e.ray.origin), c.object = t, c);
@@ -2048,11 +2048,11 @@ class cs extends ic {
2048
2048
  const u = ["getX", "getY", "getZ"], f = i.offset;
2049
2049
  for (let m = t, x = t + e; m < x; m++) {
2050
2050
  const T = (n ? n[m] : m) * 3, w = (m - f) * 6;
2051
- let b = T + 0, S = T + 1, E = T + 2;
2052
- a && (b = a[b], S = a[S], E = a[E]), o || (b = b * d + h, S = S * d + h, E = E * d + h);
2051
+ let b = T + 0, E = T + 1, S = T + 2;
2052
+ a && (b = a[b], E = a[E], S = a[S]), o || (b = b * d + h, E = E * d + h, S = S * d + h);
2053
2053
  for (let O = 0; O < 3; O++) {
2054
2054
  let C, v, M;
2055
- o ? (C = r[u[O]](b), v = r[u[O]](S), M = r[u[O]](E)) : (C = l[b + O], v = l[S + O], M = l[E + O]);
2055
+ o ? (C = r[u[O]](b), v = r[u[O]](E), M = r[u[O]](S)) : (C = l[b + O], v = l[E + O], M = l[S + O]);
2056
2056
  let _ = C;
2057
2057
  v < _ && (_ = v), M < _ && (_ = M);
2058
2058
  let P = C;
@@ -2228,19 +2228,19 @@ class cs extends ic {
2228
2228
  if (n) {
2229
2229
  if (!(t instanceof cs))
2230
2230
  throw new Error('MeshBVH: "intersectsTriangles" callback can only be used with another MeshBVH.');
2231
- const m = (x, y, T, w, b, S, E, O) => {
2231
+ const m = (x, y, T, w, b, E, S, O) => {
2232
2232
  for (let C = T, v = T + w; C < v; C++) {
2233
2233
  f(C), h.a.applyMatrix4(e), h.b.applyMatrix4(e), h.c.applyMatrix4(e), h.needsUpdate = !0;
2234
2234
  for (let M = x, _ = x + y; M < _; M++)
2235
- if (l(M), r.needsUpdate = !0, n(r, h, M, C, b, S, E, O))
2235
+ if (l(M), r.needsUpdate = !0, n(r, h, M, C, b, E, S, O))
2236
2236
  return !0;
2237
2237
  }
2238
2238
  return !1;
2239
2239
  };
2240
2240
  if (s) {
2241
2241
  const x = s;
2242
- s = function(y, T, w, b, S, E, O, C) {
2243
- return x(y, T, w, b, S, E, O, C) ? !0 : m(y, T, w, b, S, E, O, C);
2242
+ s = function(y, T, w, b, E, S, O, C) {
2243
+ return x(y, T, w, b, E, S, O, C) ? !0 : m(y, T, w, b, E, S, O, C);
2244
2244
  };
2245
2245
  } else
2246
2246
  s = m;
@@ -3556,13 +3556,13 @@ class lh {
3556
3556
  for (let u = 0, f = e.length; u < f; u += 3) {
3557
3557
  const m = u / 3;
3558
3558
  for (let x = 0; x < 3; x++) {
3559
- const y = r[u + x], T = r[u + (x + 1) % 3], w = Math.min(y, T), b = Math.max(y, T), S = w + "," + b;
3560
- h[S] === void 0 ? h[S] = {
3559
+ const y = r[u + x], T = r[u + (x + 1) % 3], w = Math.min(y, T), b = Math.max(y, T), E = w + "," + b;
3560
+ h[E] === void 0 ? h[E] = {
3561
3561
  index1: w,
3562
3562
  index2: b,
3563
3563
  face1: m,
3564
3564
  face2: void 0
3565
- } : h[S].face2 = m;
3565
+ } : h[E].face2 = m;
3566
3566
  }
3567
3567
  }
3568
3568
  for (const u in h) {
@@ -3661,12 +3661,12 @@ class lh {
3661
3661
  T.splice(b, 1), b = 0;
3662
3662
  } else break;
3663
3663
  }
3664
- const S = /* @__PURE__ */ new Set();
3664
+ const E = /* @__PURE__ */ new Set();
3665
3665
  for (let M = 0; M < y.length; M++)
3666
3666
  y[M].forEach((P) => {
3667
- S.has(P) ? A.warn("[Edge] " + P + " is already in positionIndexSet!") : S.add(P);
3667
+ E.has(P) ? A.warn("[Edge] " + P + " is already in positionIndexSet!") : E.add(P);
3668
3668
  });
3669
- const E = (M, _) => {
3669
+ const S = (M, _) => {
3670
3670
  let P = !1;
3671
3671
  const I = m[M];
3672
3672
  if (!I) return console.warn(M + " is not in positionIndexHash!"), P;
@@ -3681,12 +3681,12 @@ class lh {
3681
3681
  return P;
3682
3682
  }, O = (M, _, P) => {
3683
3683
  const I = [];
3684
- return I.push(E(M, _)), I.push(E(_, P)), I.push(E(P, M)), I.filter((B) => B === !0).length >= 2;
3684
+ return I.push(S(M, _)), I.push(S(_, P)), I.push(S(P, M)), I.filter((B) => B === !0).length >= 2;
3685
3685
  }, C = (M, _) => {
3686
3686
  if (!u[M]) return A.warn("[Edge] " + M + " position isn't used!"), !0;
3687
3687
  const P = u[M];
3688
3688
  for (const B of P) {
3689
- const k = E(M, B), D = d[B];
3689
+ const k = S(M, B), D = d[B];
3690
3690
  if (!D.inited) continue;
3691
3691
  const F = oh(_, D.point);
3692
3692
  if (k && !F || !k && F) return !1;
@@ -4294,7 +4294,7 @@ class H {
4294
4294
  static convertSimpleWidthLineToMeshGeometry(t, e) {
4295
4295
  let i, s = !1, n = !1, r = [], a = [], o, l, h = new p.Vector2(), d = new p.Vector2(), u = new p.Vector2(), f = new p.Vector2();
4296
4296
  const m = [], x = e / 2;
4297
- for (let b = 0, S = t.length - 1; b < S; b++)
4297
+ for (let b = 0, E = t.length - 1; b < E; b++)
4298
4298
  s = !b, n = b === t.length - 2, i = this.getOffsetPoint(t[b], t[b + 1], x), h = new p.Vector2(t[b].x + i.x, t[b].y + i.y), d = new p.Vector2(t[b + 1].x + i.x, t[b + 1].y + i.y), u = new p.Vector2(t[b].x - i.x, t[b].y - i.y), f = new p.Vector2(t[b + 1].x - i.x, t[b + 1].y - i.y), s || (o = this.getLineLineIntersectionPoint(
4299
4299
  r[0],
4300
4300
  r[1],
@@ -5183,9 +5183,9 @@ const ks = new p.Matrix4(), mh = new p.Matrix4(), as = class as {
5183
5183
  let f = [], m = 0, x = 0, y = 0;
5184
5184
  const T = [];
5185
5185
  if (d.forEach((b) => {
5186
- const S = t.children[b], E = S.geometry.clone();
5187
- if (E.applyMatrix4(S.matrix), H.tryConvertInterleavedBufferAttributes(E), E.userData.isLineSegments = S.isLineSegments === !0, f.push(E), e) {
5188
- const O = S.name, C = E.attributes?.position?.count, v = E.index?.count || 0, M = {
5186
+ const E = t.children[b], S = E.geometry.clone();
5187
+ if (S.applyMatrix4(E.matrix), H.tryConvertInterleavedBufferAttributes(S), S.userData.isLineSegments = E.isLineSegments === !0, f.push(S), e) {
5188
+ const O = E.name, C = S.attributes?.position?.count, v = S.index?.count || 0, M = {
5189
5189
  batchId: m,
5190
5190
  name: O,
5191
5191
  positionStart: x,
@@ -5193,7 +5193,7 @@ const ks = new p.Matrix4(), mh = new p.Matrix4(), as = class as {
5193
5193
  indexStart: y,
5194
5194
  indexCount: v
5195
5195
  };
5196
- Object.keys(S.userData).length !== 0 && (M.userData = S.userData), T.push(M), x += C, y += v, m++;
5196
+ Object.keys(E.userData).length !== 0 && (M.userData = E.userData), T.push(M), x += C, y += v, m++;
5197
5197
  }
5198
5198
  }), f.length === 0) return;
5199
5199
  let w;
@@ -5257,13 +5257,13 @@ const ks = new p.Matrix4(), mh = new p.Matrix4(), as = class as {
5257
5257
  if (T.isInstancedMesh || !T.geometry || !(T.geometry instanceof p.BufferGeometry)) continue;
5258
5258
  let w = !1;
5259
5259
  const b = Object.values(o);
5260
- for (let S = b.length - 1; S >= 0; --S) {
5261
- const E = b[S].indexes[0];
5262
- if (w = this.tryHandleMergeableObjects(t, y, E, o, l), w) break;
5260
+ for (let E = b.length - 1; E >= 0; --E) {
5261
+ const S = b[E].indexes[0];
5262
+ if (w = this.tryHandleMergeableObjects(t, y, S, o, l), w) break;
5263
5263
  }
5264
- for (let S = l.length - 1; !w && S >= 0; --S) {
5265
- const E = l[S];
5266
- if (w = this.tryHandleMergeableObjects(t, y, E, o, l), w) break;
5264
+ for (let E = l.length - 1; !w && E >= 0; --E) {
5265
+ const S = l[E];
5266
+ if (w = this.tryHandleMergeableObjects(t, y, S, o, l), w) break;
5267
5267
  }
5268
5268
  !w && l.push(y);
5269
5269
  }
@@ -5274,7 +5274,7 @@ const ks = new p.Matrix4(), mh = new p.Matrix4(), as = class as {
5274
5274
  const T = y.indexes;
5275
5275
  if (T.length < 2) return;
5276
5276
  const w = t[T[0]];
5277
- let b = [], S = 0, E = 0, O = 0;
5277
+ let b = [], E = 0, S = 0, O = 0;
5278
5278
  const C = [];
5279
5279
  if (T.forEach((M) => {
5280
5280
  const _ = t[M], P = _.geometry.clone();
@@ -5283,15 +5283,15 @@ const ks = new p.Matrix4(), mh = new p.Matrix4(), as = class as {
5283
5283
  let D;
5284
5284
  w.isLine && (!P.boundingSphere && P.computeBoundingSphere(), D = P.boundingSphere.clone());
5285
5285
  const F = {
5286
- batchId: S,
5286
+ batchId: E,
5287
5287
  name: I,
5288
- positionStart: E,
5288
+ positionStart: S,
5289
5289
  positionCount: B,
5290
5290
  indexStart: O,
5291
5291
  indexCount: k,
5292
5292
  boundingSphere: D
5293
5293
  };
5294
- !_.parent.geometry && Object.keys(_.parent.userData).length !== 0 && (F.parentUserData = _.parent.userData), Object.keys(_.userData).length !== 0 && (F.userData = _.userData), C.push(F), E += B, O += k, S++;
5294
+ !_.parent.geometry && Object.keys(_.parent.userData).length !== 0 && (F.parentUserData = _.parent.userData), Object.keys(_.userData).length !== 0 && (F.userData = _.userData), C.push(F), S += B, O += k, E++;
5295
5295
  }
5296
5296
  }), b.length === 0) return;
5297
5297
  let v;
@@ -5408,8 +5408,8 @@ const ks = new p.Matrix4(), mh = new p.Matrix4(), as = class as {
5408
5408
  let y = 0;
5409
5409
  for (let T = 0; T < d.count; T++) {
5410
5410
  const w = T * m, b = T !== 0 && T !== d.count - 1 && !h;
5411
- for (let S = 0; S < m; S++)
5412
- x[y + S] = d.array[w + S], b && (x[y + m + S] = d.array[w + S]);
5411
+ for (let E = 0; E < m; E++)
5412
+ x[y + E] = d.array[w + E], b && (x[y + m + E] = d.array[w + E]);
5413
5413
  y += b ? 2 * m : m;
5414
5414
  }
5415
5415
  a.set(x, o), o += f * m;
@@ -15556,9 +15556,9 @@ class kt {
15556
15556
  let f = [], m = 0, x = 0, y = 0;
15557
15557
  const T = [];
15558
15558
  if (d.forEach((b) => {
15559
- const S = t.children[b], E = S.geometry?.clone();
15560
- if (E.applyMatrix4(S.matrix), E.userData.isLineSegments = S.type === G.LineSegment, f.push(E), e) {
15561
- const O = E.attributes?.position?.count, C = E.index?.count || 0;
15559
+ const E = t.children[b], S = E.geometry?.clone();
15560
+ if (S.applyMatrix4(E.matrix), S.userData.isLineSegments = E.type === G.LineSegment, f.push(S), e) {
15561
+ const O = S.attributes?.position?.count, C = S.index?.count || 0;
15562
15562
  T.push({
15563
15563
  batchId: m,
15564
15564
  positionStart: x,
@@ -15644,13 +15644,13 @@ class kt {
15644
15644
  if (!t[y].geometry || this.isFilteredByOtherFactors(t[y], e)) continue;
15645
15645
  let w = !1;
15646
15646
  const b = Object.values(o);
15647
- for (let S = b.length - 1; S >= 0; --S) {
15648
- const E = b[S].indexes[0];
15649
- if (w = this.tryHandleMergeableObjects(t, y, E, o, l), w) break;
15647
+ for (let E = b.length - 1; E >= 0; --E) {
15648
+ const S = b[E].indexes[0];
15649
+ if (w = this.tryHandleMergeableObjects(t, y, S, o, l), w) break;
15650
15650
  }
15651
- for (let S = l.length - 1; !w && S >= 0; --S) {
15652
- const E = l[S];
15653
- if (w = this.tryHandleMergeableObjects(t, y, E, o, l), w) break;
15651
+ for (let E = l.length - 1; !w && E >= 0; --E) {
15652
+ const S = l[E];
15653
+ if (w = this.tryHandleMergeableObjects(t, y, S, o, l), w) break;
15654
15654
  }
15655
15655
  !w && l.push(y);
15656
15656
  }
@@ -15661,7 +15661,7 @@ class kt {
15661
15661
  const T = y.indexes;
15662
15662
  if (T.length < 2) return;
15663
15663
  const w = t[T[0]];
15664
- let b = [], S = 0, E = 0, O = 0;
15664
+ let b = [], E = 0, S = 0, O = 0;
15665
15665
  const C = [];
15666
15666
  if (T.forEach((M) => {
15667
15667
  const _ = t[M], P = _.geometry?.clone();
@@ -15670,14 +15670,14 @@ class kt {
15670
15670
  let k;
15671
15671
  (w.type === G.Line || w.type === G.LineSegment) && (!P.boundingSphere && P.computeBoundingSphere(), k = P.boundingSphere?.clone());
15672
15672
  const D = {
15673
- batchId: S,
15674
- positionStart: E,
15673
+ batchId: E,
15674
+ positionStart: S,
15675
15675
  positionCount: I,
15676
15676
  indexStart: O,
15677
15677
  indexCount: B,
15678
15678
  boundingSphere: k
15679
15679
  };
15680
- Object.keys(_.userData).length !== 0 && (D.userData = _.userData), C.push(D), E += I, O += B, S++;
15680
+ Object.keys(_.userData).length !== 0 && (D.userData = _.userData), C.push(D), S += I, O += B, E++;
15681
15681
  }
15682
15682
  }), b.length === 0) return;
15683
15683
  let v;
@@ -15746,7 +15746,7 @@ class kt {
15746
15746
  * - They have the same type or the same draw type( Mesh or Line or Point).
15747
15747
  */
15748
15748
  static areObjectsMergeable(t, e) {
15749
- 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 === G.Line || t.type === G.LineSegment) && (e.type === G.Line || e.type === G.LineSegment);
15749
+ return t.userData.isConstructionLine || e.userData.isConstructionLine || t.layers.mask !== e.layers.mask || t.renderOrder !== e.renderOrder || t.userData.layerName !== e.userData.layerName ? !1 : t.type === e.type ? !0 : (t.type === G.Line || t.type === G.LineSegment) && (e.type === G.Line || e.type === G.LineSegment);
15750
15750
  }
15751
15751
  }
15752
15752
  g(kt, "MergeInfo", {
@@ -19139,9 +19139,9 @@ class zd {
19139
19139
  else if (n.value === "BLOCKS")
19140
19140
  A.trace("> BLOCKS"), e.blocks = o(), A.trace("<");
19141
19141
  else if (n.value === "ENTITIES")
19142
- A.trace("> ENTITIES"), e.entities = S(!1), A.trace("<");
19142
+ A.trace("> ENTITIES"), e.entities = E(!1), A.trace("<");
19143
19143
  else if (n.value === "OBJECTS")
19144
- A.trace("> OBJECTS"), e.objects = E(), A.trace("<");
19144
+ A.trace("> OBJECTS"), e.objects = S(), A.trace("<");
19145
19145
  else if (n.value === "EOF")
19146
19146
  A.trace("EOF");
19147
19147
  else {
@@ -19215,7 +19215,7 @@ class zd {
19215
19215
  break;
19216
19216
  case 0:
19217
19217
  if (n.value === "ENDBLK") break;
19218
- C.entities = S(!0);
19218
+ C.entities = E(!0);
19219
19219
  break;
19220
19220
  default:
19221
19221
  bt(n), n = t.next();
@@ -19641,7 +19641,7 @@ class zd {
19641
19641
  parseTableRecords: T
19642
19642
  }
19643
19643
  };
19644
- function S(C) {
19644
+ function E(C) {
19645
19645
  const v = [], M = C ? "ENDBLK" : "ENDSEC";
19646
19646
  for (C || (n = t.next()); ; )
19647
19647
  if (n.code === 0) {
@@ -19660,7 +19660,7 @@ class zd {
19660
19660
  n = t.next();
19661
19661
  return M === "ENDSEC" && (n = t.next()), v;
19662
19662
  }
19663
- function E() {
19663
+ function S() {
19664
19664
  const C = {}, v = "ENDSEC";
19665
19665
  for (n = t.next(); n.value !== "EOF"; )
19666
19666
  if (n.code === 0) {
@@ -20334,48 +20334,48 @@ const qe = new p.Vector3(1, 0, 0), Un = new p.Vector3(0, 1, 0), yi = new p.Vecto
20334
20334
  const a = j.getUpdateProgressFuncForLoop(r, i);
20335
20335
  let o = {};
20336
20336
  const l = (b) => {
20337
- const S = b.userData.layerName;
20338
- let E = o[S];
20339
- !E && (E = [], o[S] = E), E.push(b);
20337
+ const E = b.userData.layerName;
20338
+ let S = o[E];
20339
+ !S && (S = [], o[E] = S), S.push(b);
20340
20340
  }, h = {}, d = {}, u = new U();
20341
20341
  for (let b = 0; b < r && !this.aborted; b++) {
20342
- const S = e.entities[b];
20343
- this.addViewport(S, h);
20344
- const E = this.loadEntity(S, e);
20345
- if (!E && await a(b), !E) continue;
20346
- const O = this.getLayout(e, S), C = O.layoutName;
20342
+ const E = e.entities[b];
20343
+ this.addViewport(E, h);
20344
+ const S = this.loadEntity(E, e);
20345
+ if (!S && await a(b), !S) continue;
20346
+ const O = this.getLayout(e, E), C = O.layoutName;
20347
20347
  let v = u.children.find((M) => M.name === C);
20348
- if (!v && (v = new U(), v.name = C, v.userData.isLayoutLevelObject = !0, u.add(v)), E.traverse((M) => {
20348
+ if (!v && (v = new U(), v.name = C, v.userData.isLayoutLevelObject = !0, u.add(v)), S.traverse((M) => {
20349
20349
  M.userData.isSnapObject && (!this.layoutsSnapObjectsMap[C] && (this.layoutsSnapObjectsMap[C] = []), this.layoutsSnapObjectsMap[C].push(M));
20350
20350
  }), this.enableMerge) {
20351
- kt.merge(E, !1), !d[C] && (d[C] = {
20351
+ kt.merge(S, !1), !d[C] && (d[C] = {
20352
20352
  object: v,
20353
20353
  layerObjects: {}
20354
20354
  });
20355
20355
  const _ = d[C];
20356
- if (E.geometry) {
20357
- const P = E.userData.layerName;
20358
- !_.layerObjects[P] && (_.layerObjects[P] = []), _.layerObjects[P].push(E), E.children.forEach((I) => {
20356
+ if (S.geometry) {
20357
+ const P = S.userData.layerName;
20358
+ !_.layerObjects[P] && (_.layerObjects[P] = []), _.layerObjects[P].push(S), S.children.forEach((I) => {
20359
20359
  I.userData.isSnapObject && l(I);
20360
20360
  });
20361
- } else E.children.length > 0 && (v.add(E), E.traverse((P) => {
20361
+ } else S.children.length > 0 && (v.add(S), S.traverse((P) => {
20362
20362
  P.geometry && l(P);
20363
20363
  }));
20364
20364
  } else
20365
- v.add(E), E.traverse((M) => {
20365
+ v.add(S), S.traverse((M) => {
20366
20366
  M.geometry && l(M);
20367
20367
  });
20368
20368
  n++, await a(b);
20369
20369
  }
20370
20370
  e.objects.LAYOUT.forEach((b) => {
20371
- const S = b, E = S.layoutName;
20372
- if (this.ignorePaperSpace && E !== V.MODEL_LAYOUT_NAME) return;
20373
- const O = S.associatedBlockName, C = e.blocks[O];
20374
- C && this.loadLayout(C, e, S, u, o, h);
20371
+ const E = b, S = E.layoutName;
20372
+ if (this.ignorePaperSpace && S !== V.MODEL_LAYOUT_NAME) return;
20373
+ const O = E.associatedBlockName, C = e.blocks[O];
20374
+ C && this.loadLayout(C, e, E, u, o, h);
20375
20375
  }), A.debug("[Dxf] Drew entities in " + (Date.now() - s) / 1e3 + "s");
20376
20376
  for (const b in this.layoutsSnapObjectsMap) {
20377
- const S = u.children.find((C) => C.name === b), E = new U();
20378
- E.name = V.SNAP_GROUP_NAME, E.userData.isSnapGroup = !0, S.add(E);
20377
+ const E = u.children.find((C) => C.name === b), S = new U();
20378
+ S.name = V.SNAP_GROUP_NAME, S.userData.isSnapGroup = !0, E.add(S);
20379
20379
  const O = this.layoutsSnapObjectsMap[b];
20380
20380
  for (let C = 0; C < O.length; C++) {
20381
20381
  const v = O[C], M = v.userData.layerName;
@@ -20384,28 +20384,28 @@ const qe = new p.Vector3(1, 0, 0), Un = new p.Vector3(0, 1, 0), yi = new p.Vecto
20384
20384
  const P = fe.identity();
20385
20385
  for (; _ && _.userData.isLayoutLevelObject !== !0; )
20386
20386
  P.premultiply(_.matrix), _ = _.parent;
20387
- v.matrix.copy(P), E.add(v);
20387
+ v.matrix.copy(P), S.add(v);
20388
20388
  }
20389
20389
  }
20390
20390
  if (this.enableMerge)
20391
20391
  for (const b in d) {
20392
- const S = d[b], E = S.object;
20393
- for (const O in S.layerObjects) {
20394
- const C = S.layerObjects[O], v = kt.deepMerge(C, void 0, !1, !1, !0), M = v.added, _ = v.removed;
20392
+ const E = d[b], S = E.object;
20393
+ for (const O in E.layerObjects) {
20394
+ const C = E.layerObjects[O], v = kt.deepMerge(C, void 0, !1, !1, !0), M = v.added, _ = v.removed;
20395
20395
  if (_.length !== C.length) {
20396
20396
  let P = _;
20397
20397
  _.length >= 100 && (P = new Set(_));
20398
20398
  const I = (B) => Array.isArray(P) ? P.indexOf(B) >= 0 : P.has(B);
20399
20399
  for (let B = 0, k = C.length; B < k; B++) {
20400
20400
  const D = C[B];
20401
- !I(D) && (E.add(D), l(D));
20401
+ !I(D) && (S.add(D), l(D));
20402
20402
  }
20403
20403
  }
20404
20404
  for (let P = 0; P < M.length; P++) {
20405
20405
  const I = M[P];
20406
- E.add(I), l(I);
20406
+ S.add(I), l(I);
20407
20407
  }
20408
- S.layerObjects[O] = [];
20408
+ E.layerObjects[O] = [];
20409
20409
  }
20410
20410
  }
20411
20411
  this.printStatsInfo(), this.enableReleaseData && (this.releaseCachedData(), this.releaseDxfData(e)), this.enableMerge && V.mergeDxfObjects({
@@ -20417,26 +20417,26 @@ const qe = new p.Vector3(1, 0, 0), Un = new p.Vector3(0, 1, 0), yi = new p.Vecto
20417
20417
  u.clear(), o = {};
20418
20418
  const x = {};
20419
20419
  e.objects.LAYOUT.forEach((b) => {
20420
- const S = b;
20421
- x[S.layoutName] = S;
20420
+ const E = b;
20421
+ x[E.layoutName] = E;
20422
20422
  });
20423
20423
  const y = {}, T = (b) => {
20424
- const S = b.userData.layerName;
20425
- let E = y[S];
20426
- !E && (E = [], y[S] = E), E.push(b);
20424
+ const E = b.userData.layerName;
20425
+ let S = y[E];
20426
+ !S && (S = [], y[E] = S), S.push(b);
20427
20427
  };
20428
20428
  m.children.forEach((b) => {
20429
20429
  if (Q.setSharedVariablesOfObject(b), !b.userData.isLayoutLevelObject) return;
20430
- const S = b.name;
20431
- let E;
20432
- if (S !== V.MODEL_LAYOUT_NAME) {
20433
- const O = x[S];
20434
- !O.directAssociatedLeafObjectSet && (O.directAssociatedLeafObjectSet = /* @__PURE__ */ new Set()), E = O.directAssociatedLeafObjectSet;
20430
+ const E = b.name;
20431
+ let S;
20432
+ if (E !== V.MODEL_LAYOUT_NAME) {
20433
+ const O = x[E];
20434
+ !O.directAssociatedLeafObjectSet && (O.directAssociatedLeafObjectSet = /* @__PURE__ */ new Set()), S = O.directAssociatedLeafObjectSet;
20435
20435
  }
20436
20436
  b.traverse((O) => {
20437
20437
  if (Q.setSharedVariablesOfObject(O), O.userData.isSnapGroup && (O.visible = V.SHOW_SNAP_OBJECT), O.geometry) {
20438
20438
  const C = O.userData.layerName;
20439
- this.getLayerVisible(e, C) === !1 && (O.visible = !1, O.userData.layerVisible = !1), T(O), E && E.add(O);
20439
+ this.getLayerVisible(e, C) === !1 && (O.visible = !1, O.userData.layerVisible = !1), T(O), S && S.add(O);
20440
20440
  }
20441
20441
  });
20442
20442
  }), A.info("[Dxf] loadEntities() done in " + (Date.now() - s) / 1e3 + "s");
@@ -20447,14 +20447,14 @@ const qe = new p.Vector3(1, 0, 0), Un = new p.Vector3(0, 1, 0), yi = new p.Vecto
20447
20447
  layoutViewportsMap: h
20448
20448
  });
20449
20449
  if (V.LOADLLDATA) {
20450
- const b = m.children[0].children, S = [];
20451
- for (let E = 0; E < b.length; E++) {
20452
- const O = b[E];
20450
+ const b = m.children[0].children, E = [];
20451
+ for (let S = 0; S < b.length; S++) {
20452
+ const O = b[S];
20453
20453
  if (O?.userData?.llbData) {
20454
20454
  const C = new p.Box3().setFromObject(O);
20455
20455
  C.getSize(new p.Vector3());
20456
20456
  const v = C.getCenter(new p.Vector3());
20457
- S.push({ ...O, boundingBox: { max: C.max, min: C.min, center: v } });
20457
+ E.push({ ...O, boundingBox: { max: C.max, min: C.min, center: v } });
20458
20458
  } else if (O.children && O.children.some((C) => C.userData?.llbData))
20459
20459
  for (let C = 0; C < O.children.length; C++) {
20460
20460
  const v = O.children[C];
@@ -20463,11 +20463,11 @@ const qe = new p.Vector3(1, 0, 0), Un = new p.Vector3(0, 1, 0), yi = new p.Vecto
20463
20463
  const M = new p.Box3().setFromObject(v);
20464
20464
  M.getSize(new p.Vector3());
20465
20465
  const _ = M.getCenter(new p.Vector3());
20466
- S.push({ ...v, boundingBox: { max: M.max, min: M.min, center: _ } });
20466
+ E.push({ ...v, boundingBox: { max: M.max, min: M.min, center: _ } });
20467
20467
  }
20468
20468
  }
20469
20469
  }
20470
- w.llbMesh = S;
20470
+ w.llbMesh = E;
20471
20471
  }
20472
20472
  return Promise.resolve(w);
20473
20473
  }
@@ -20574,14 +20574,14 @@ const qe = new p.Vector3(1, 0, 0), Un = new p.Vector3(0, 1, 0), yi = new p.Vecto
20574
20574
  layersAndObjects: b
20575
20575
  /* 类型桥接:形参类型滞后,实际为 DxfObject[] */
20576
20576
  });
20577
- const S = m.convertToThreejsObject();
20577
+ const E = m.convertToThreejsObject();
20578
20578
  m.clear(), b = {};
20579
- const E = {}, O = (v) => {
20579
+ const S = {}, O = (v) => {
20580
20580
  const M = v.userData.layerName;
20581
- let _ = E[M];
20582
- !_ && (_ = [], E[M] = _), _.push(v);
20581
+ let _ = S[M];
20582
+ !_ && (_ = [], S[M] = _), _.push(v);
20583
20583
  };
20584
- S.children.forEach((v) => {
20584
+ E.children.forEach((v) => {
20585
20585
  Q.setSharedVariablesOfObject(v), v.userData.isLayoutLevelObject && v.traverse((M) => {
20586
20586
  if (Q.setSharedVariablesOfObject(M), M.userData.isSnapGroup && (M.visible = V.SHOW_SNAP_OBJECT), M.geometry) {
20587
20587
  const _ = M.userData.layerName;
@@ -20590,7 +20590,7 @@ const qe = new p.Vector3(1, 0, 0), Un = new p.Vector3(0, 1, 0), yi = new p.Vecto
20590
20590
  });
20591
20591
  });
20592
20592
  const C = f;
20593
- C.threejsObject = S, C.layersAndThreejsObjects = E, C.layoutViewportsMap = {};
20593
+ C.threejsObject = E, C.layersAndThreejsObjects = S, C.layoutViewportsMap = {};
20594
20594
  };
20595
20595
  let h = Date.now();
20596
20596
  this.compareContext = {
@@ -20751,9 +20751,9 @@ const qe = new p.Vector3(1, 0, 0), Un = new p.Vector3(0, 1, 0), yi = new p.Vecto
20751
20751
  }
20752
20752
  }
20753
20753
  else w = !1;
20754
- const b = Math.min(parseInt(e.handle, 16) || 0, 3999), S = w ? Te.InsertLine + b * 1e-5 : Te.InsertSymbol + b * 1e-4, E = !w && T?.length ? new Map(T.map((O, C) => [O.type !== "HATCH" && O.type !== "SOLID" ? void 0 : O.handle, C]).filter(([O]) => O !== void 0)) : void 0;
20754
+ const b = Math.min(parseInt(e.handle, 16) || 0, 3999), E = w ? Te.InsertLine + b * 1e-5 : Te.InsertSymbol + b * 1e-4, S = !w && T?.length ? new Map(T.map((O, C) => [O.type !== "HATCH" && O.type !== "SOLID" ? void 0 : O.handle, C]).filter(([O]) => O !== void 0)) : void 0;
20755
20755
  o.traverse((O) => {
20756
- if (O.geometry && O.renderOrder < Te.Text && (O.renderOrder = E?.has(O.userData.handle) ? S - 5e-5 + E.get(O.userData.handle) * 5e-7 : S, w)) {
20756
+ if (O.geometry && O.renderOrder < Te.Text && (O.renderOrder = S?.has(O.userData.handle) ? E - 5e-5 + S.get(O.userData.handle) * 5e-7 : E, w)) {
20757
20757
  const C = O.geometry.getAttribute("position");
20758
20758
  if (C) {
20759
20759
  let v = !1;
@@ -20796,10 +20796,10 @@ const qe = new p.Vector3(1, 0, 0), Un = new p.Vector3(0, 1, 0), yi = new p.Vecto
20796
20796
  const w = new p.Vector3();
20797
20797
  let b = !1;
20798
20798
  this.enableRTC && (b = H.checkAndRebasePositionsOnRTC(y, w));
20799
- const S = new p.BufferGeometry().setFromPoints(y), E = new U(G.Line);
20800
- E.geometry = S, E.material = ge;
20799
+ const E = new p.BufferGeometry().setFromPoints(y), S = new U(G.Line);
20800
+ S.geometry = E, S.material = ge;
20801
20801
  const O = new U(G.Point);
20802
- return O.geometry = ma, O.material = Ls, O.matrix.setPosition(e.center.x, e.center.y, e.center.z), O.userData.isSnapObject = !0, O.userData.type = "CircleCenter", O.layers.set(Xe), E.add(O), b && (this.setRTCUserData(E), E.matrix.setPosition(w.x, w.y, 0)), E.layers.enableAll(), E;
20802
+ return O.geometry = ma, O.material = Ls, O.matrix.setPosition(e.center.x, e.center.y, e.center.z), O.userData.isSnapObject = !0, O.userData.type = "CircleCenter", O.layers.set(Xe), S.add(O), b && (this.setRTCUserData(S), S.matrix.setPosition(w.x, w.y, 0)), S.layers.enableAll(), S;
20803
20803
  }
20804
20804
  // 说明:以下为源码中注释掉的 loadMText 旧实现(保真保留)。
20805
20805
  // ['loadMText'](entity, data, parentEntity) {
@@ -20958,35 +20958,35 @@ const qe = new p.Vector3(1, 0, 0), Un = new p.Vector3(0, 1, 0), yi = new p.Vecto
20958
20958
  }), a = this.getMTextGroup(r, e, n, i, s), o = a && a.object;
20959
20959
  if (!o) return;
20960
20960
  o.matrix.decompose($, ye, it), e.position && ($.x += e.position.x, $.y += e.position.y, o.matrix.compose($, ye, it)), ut.makeEmpty();
20961
- const l = U.getBox(o, ut), h = l.getSize(N), d = e.width || h.x, u = e.height || h.y, f = h.y > 0 ? h.y : u, m = e.text;
20962
- let x = 0, y = 0;
20963
- switch (document.createElement("canvas").getContext("2d"), e.attachmentPoint) {
20961
+ const l = U.getBox(o, ut), h = l.getSize(N), d = e.width || h.x, u = e.height || h.y, f = h.y > 0 ? h.y : u;
20962
+ let m = 0, x = 0;
20963
+ switch (e.attachmentPoint) {
20964
20964
  case 1:
20965
- x = 0, y = 0;
20965
+ m = 0, x = 0;
20966
20966
  break;
20967
20967
  case 2:
20968
- x -= d / 2, y = 0;
20968
+ m -= d / 2, x = 0;
20969
20969
  break;
20970
20970
  case 3:
20971
- x -= d, y = 0;
20971
+ m -= d, x = 0;
20972
20972
  break;
20973
20973
  case 4:
20974
- x = 0, y += f / 2;
20974
+ m = 0, x += f / 2;
20975
20975
  break;
20976
20976
  case 5:
20977
- x -= d / 2, y += f / 2;
20977
+ m -= d / 2, x += f / 2;
20978
20978
  break;
20979
20979
  case 6:
20980
- x -= d, y += f / 2;
20980
+ m -= d, x += f / 2;
20981
20981
  break;
20982
20982
  case 7:
20983
- x = 0, y += f;
20983
+ m = 0, x += f;
20984
20984
  break;
20985
20985
  case 8:
20986
- x -= d / 2, y += f;
20986
+ m -= d / 2, x += f;
20987
20987
  break;
20988
20988
  case 9:
20989
- x -= d, y += f;
20989
+ m -= d, x += f;
20990
20990
  break;
20991
20991
  default:
20992
20992
  return;
@@ -20997,71 +20997,68 @@ const qe = new p.Vector3(1, 0, 0), Un = new p.Vector3(0, 1, 0), yi = new p.Vecto
20997
20997
  case 2:
20998
20998
  break;
20999
20999
  case 3:
21000
- y += u;
21000
+ x += u;
21001
21001
  break;
21002
21002
  case 4:
21003
21003
  break;
21004
21004
  case 5:
21005
- const I = m.split("\\P");
21006
- let B = 0;
21007
- I > 1 && (B = I - 1), B > 1 ? y += u * (B - 1) : y -= u / 4;
21008
21005
  break;
21009
21006
  default:
21010
21007
  return;
21011
21008
  }
21012
- o.traverse((I) => {
21013
- I.geometry && I.geometry.translate(x, y, 0), I.layers.enableAll();
21009
+ o.traverse((_) => {
21010
+ _.geometry && _.geometry.translate(m, x, 0), _.layers.enableAll();
21014
21011
  });
21015
- let w = 0;
21016
- if (e.rotation && (w = e.rotation * Math.PI / 180), e.directionVector) {
21017
- const I = e.directionVector, B = new p.Vector3(I.x, I.y, I.z), k = B.clone().cross(qe), D = qe.angleTo(B);
21018
- w = k.z > 0 ? -D : D;
21012
+ let y = 0;
21013
+ if (e.rotation && (y = e.rotation * Math.PI / 180), e.directionVector) {
21014
+ const _ = e.directionVector, P = new p.Vector3(_.x, _.y, _.z), I = P.clone().cross(qe), B = qe.angleTo(P);
21015
+ y = I.z > 0 ? -B : B;
21019
21016
  }
21020
21017
  H.shouldRebasePositionOnRTC($) && this.setRTCUserData(o), o.matrix.compose($, ye, it);
21021
- const b = e.position ? $.clone().sub(e.position) : $;
21022
- tt.makeTranslation(-b.x, -b.y, 0), fe.makeRotationZ(w), o.matrix.multiply(tt), o.matrix.multiply(fe), o.matrix.multiply(tt.invert()), o.userData || (o.userData = {});
21023
- const S = o.matrix.elements, E = S && S[12] || 0, O = S && S[13] || 0, C = S && S[14] || 0, v = new p.Box3();
21024
- U.getBox(o, v);
21025
- const M = new p.Vector3();
21026
- v.getCenter(M);
21027
- const _ = new p.Vector3();
21028
- v.getSize(_), o.userData.renderArea = {
21018
+ const T = e.position ? $.clone().sub(e.position) : $;
21019
+ tt.makeTranslation(-T.x, -T.y, 0), fe.makeRotationZ(y), o.matrix.multiply(tt), o.matrix.multiply(fe), o.matrix.multiply(tt.invert()), o.userData || (o.userData = {});
21020
+ const w = o.matrix.elements, b = w && w[12] || 0, E = w && w[13] || 0, S = w && w[14] || 0, O = new p.Box3();
21021
+ U.getBox(o, O);
21022
+ const C = new p.Vector3();
21023
+ O.getCenter(C);
21024
+ const v = new p.Vector3();
21025
+ O.getSize(v), o.userData.renderArea = {
21029
21026
  position: {
21030
- x: E,
21031
- y: O,
21032
- z: C
21027
+ x: b,
21028
+ y: E,
21029
+ z: S
21033
21030
  },
21034
21031
  bbox: {
21035
21032
  min: {
21036
- x: v.min.x,
21037
- y: v.min.y,
21038
- z: v.min.z
21033
+ x: O.min.x,
21034
+ y: O.min.y,
21035
+ z: O.min.z
21039
21036
  },
21040
21037
  max: {
21041
- x: v.max.x,
21042
- y: v.max.y,
21043
- z: v.max.z
21038
+ x: O.max.x,
21039
+ y: O.max.y,
21040
+ z: O.max.z
21044
21041
  },
21045
21042
  center: {
21046
- x: M.x,
21047
- y: M.y,
21048
- z: M.z
21043
+ x: C.x,
21044
+ y: C.y,
21045
+ z: C.z
21049
21046
  },
21050
- width: _.x,
21051
- height: _.y,
21052
- depth: _.z
21047
+ width: v.x,
21048
+ height: v.y,
21049
+ depth: v.z
21053
21050
  },
21054
21051
  textSize: {
21055
21052
  width: d,
21056
21053
  height: u
21057
21054
  },
21058
- rotation: w,
21055
+ rotation: y,
21059
21056
  attachmentPoint: e.attachmentPoint || 0,
21060
21057
  drawingDirection: e.drawingDirection || 0
21061
21058
  };
21062
- const P = this;
21063
- return o.userData.textContent = e.text || "", o.userData.cleanText = P.cleanMTextContent ? P.cleanMTextContent(e.text) : e.text, o.userData.dxfType = "MTEXT", o.userData.isMText = !0, o.userData.layer = e.layer || "0", o.userData.handle = e.handle || "", o.traverse((I) => {
21064
- I.geometry && (I.userData.textContent = e.text || "", I.userData.dxfType = "MTEXT", I.userData.layer = e.layer || "0", I.userData.handle = e.handle || "");
21059
+ const M = this;
21060
+ return o.userData.textContent = e.text || "", o.userData.cleanText = M.cleanMTextContent ? M.cleanMTextContent(e.text) : e.text, o.userData.dxfType = "MTEXT", o.userData.isMText = !0, o.userData.layer = e.layer || "0", o.userData.handle = e.handle || "", o.traverse((_) => {
21061
+ _.geometry && (_.userData.textContent = e.text || "", _.userData.dxfType = "MTEXT", _.userData.layer = e.layer || "0", _.userData.handle = e.handle || "");
21065
21062
  }), o.userData.entityId = e.entityId || e.handle, o;
21066
21063
  }
21067
21064
  /**
@@ -21128,8 +21125,8 @@ const qe = new p.Vector3(1, 0, 0), Un = new p.Vector3(0, 1, 0), yi = new p.Vecto
21128
21125
  });
21129
21126
  let y = 0;
21130
21127
  if (e.rotation && (y = e.rotation * Math.PI / 180), e.directionVector) {
21131
- const w = e.directionVector, b = new p.Vector3(w.x, w.y, w.z), S = b.clone().cross(qe), E = qe.angleTo(b);
21132
- y = S.z > 0 ? -E : E;
21128
+ const w = e.directionVector, b = new p.Vector3(w.x, w.y, w.z), E = b.clone().cross(qe), S = qe.angleTo(b);
21129
+ y = E.z > 0 ? -S : S;
21133
21130
  }
21134
21131
  H.shouldRebasePositionOnRTC($) && this.setRTCUserData(o), o.matrix.compose($, ye, it);
21135
21132
  const T = e.position ? $.clone().sub(e.position) : $;
@@ -21140,17 +21137,17 @@ const qe = new p.Vector3(1, 0, 0), Un = new p.Vector3(0, 1, 0), yi = new p.Vecto
21140
21137
  let h = i.height || i.contextData && i.contextData.textHeight || 0;
21141
21138
  if (i.textStyle) {
21142
21139
  if (s && s.fontFile && s.fontFile.endsWith(".shx")) {
21143
- const E = s.fontFile + "_" + s.styleName;
21144
- !this.statsInfo.unsupportedTextStyles[E] && (this.statsInfo.unsupportedTextStyles[E] = 0), this.statsInfo.unsupportedTextStyles[E]++;
21140
+ const S = s.fontFile + "_" + s.styleName;
21141
+ !this.statsInfo.unsupportedTextStyles[S] && (this.statsInfo.unsupportedTextStyles[S] = 0), this.statsInfo.unsupportedTextStyles[S]++;
21145
21142
  }
21146
21143
  h = h || s.textHeight;
21147
21144
  }
21148
21145
  let d = "Left";
21149
21146
  i.width && i.attachmentPoint && ([1, 4, 7].includes(i.attachmentPoint) ? d = "Left" : [2, 5, 8].includes(i.attachmentPoint) ? d = "Center" : [3, 6, 9].includes(i.attachmentPoint) && (d = "Right"));
21150
21147
  const u = i.width || 0, f = new U();
21151
- let m, x = s.fontFile, y = 1, T = 1, w = 256, b = h * 0.8, S = b + h;
21152
- for (let E = 0; E < e.length; E++) {
21153
- const O = e[E];
21148
+ let m, x = s.fontFile, y = 1, T = 1, w = 256, b = h * 0.8, E = b + h;
21149
+ for (let S = 0; S < e.length; S++) {
21150
+ const O = e[S];
21154
21151
  if (typeof O == "string") {
21155
21152
  const C = [], v = (P, I) => {
21156
21153
  let B;
@@ -21178,14 +21175,14 @@ const qe = new p.Vector3(1, 0, 0), Un = new p.Vector3(0, 1, 0), yi = new p.Vecto
21178
21175
  if (I === `
21179
21176
  `) {
21180
21177
  const k = a;
21181
- a = 0, o -= S, l.length > 0 && v(l, k), l = [];
21178
+ a = 0, o -= E, l.length > 0 && v(l, k), l = [];
21182
21179
  continue;
21183
21180
  }
21184
- if (b = h * 0.8, S = b + h, M = this.font?.getCharShape(I, x, h), s.bigFontFile && !M && (M = this.font?.getCharShape(I, s.bigFontFile, h)), !M && (M = this.font?.getCharShape(I, "", h)), !M && (M = this.font?.getNotFoundTextShape(h)), !M) {
21181
+ if (b = h * 0.8, E = b + h, M = this.font?.getCharShape(I, x, h), s.bigFontFile && !M && (M = this.font?.getCharShape(I, s.bigFontFile, h)), !M && (M = this.font?.getCharShape(I, "", h)), !M && (M = this.font?.getNotFoundTextShape(h)), !M) {
21185
21182
  a += h + T * (h / 3.5);
21186
21183
  continue;
21187
21184
  }
21188
- a > (u || 1 / 0) && (l.length > 0 && v(l, a), a = 0, o -= S, l = []), M.translate(a, o, 0), M.scale(y, 1, 1), M.boundingBox || M.computeBoundingBox(), O.T && (T = O.T);
21185
+ a > (u || 1 / 0) && (l.length > 0 && v(l, a), a = 0, o -= E, l = []), M.translate(a, o, 0), M.scale(y, 1, 1), M.boundingBox || M.computeBoundingBox(), O.T && (T = O.T);
21189
21186
  const B = Sh(
21190
21187
  I,
21191
21188
  M,
@@ -21317,7 +21314,7 @@ const qe = new p.Vector3(1, 0, 0), Un = new p.Vector3(0, 1, 0), yi = new p.Vecto
21317
21314
  let a = !1;
21318
21315
  this.enableRTC && (a = H.checkAndRebasePositionsOnRTC(n, r));
21319
21316
  const o = new p.BufferGeometry().setFromPoints(n), l = new U(G.Line);
21320
- return l.geometry = o, l.material = ge, a && (this.setRTCUserData(l), l.matrix.setPosition(r.x, r.y, 0)), l.layers.enableAll(), l;
21317
+ return l.geometry = o, l.material = ge, l.userData.isConstructionLine = !0, a && (this.setRTCUserData(l), l.matrix.setPosition(r.x, r.y, 0)), l.layers.enableAll(), l;
21321
21318
  }
21322
21319
  loadRay(e) {
21323
21320
  if (!e.vertices || e.vertices.length === 0) return A.warn("[Dxf] Entity is missing vertices:", e.handle), void 0;
@@ -21327,7 +21324,7 @@ const qe = new p.Vector3(1, 0, 0), Un = new p.Vector3(0, 1, 0), yi = new p.Vecto
21327
21324
  let r = !1;
21328
21325
  this.enableRTC && (r = H.checkAndRebasePositionsOnRTC(s, n));
21329
21326
  const a = new p.BufferGeometry().setFromPoints(s), o = new U(G.Line);
21330
- return o.geometry = a, o.material = ge, r && (this.setRTCUserData(o), o.matrix.setPosition(n.x, n.y, 0)), o.layers.enableAll(), o;
21327
+ return o.geometry = a, o.material = ge, o.userData.isConstructionLine = !0, r && (this.setRTCUserData(o), o.matrix.setPosition(n.x, n.y, 0)), o.layers.enableAll(), o;
21331
21328
  }
21332
21329
  // 说明:以下为源码中注释掉的 loadLine 旧实现(保真保留)。
21333
21330
  // loadLine(entity, dxfData) {
@@ -21438,13 +21435,13 @@ const qe = new p.Vector3(1, 0, 0), Un = new p.Vector3(0, 1, 0), yi = new p.Vecto
21438
21435
  }
21439
21436
  O.setAttribute("lineDistance", new p.Float32BufferAttribute(M, 1));
21440
21437
  };
21441
- const b = x.pattern?.[0] || 0.5, S = x.pattern?.[1] || 0.5, E = 0.1;
21438
+ const b = x.pattern?.[0] || 0.5, E = x.pattern?.[1] || 0.5, S = 0.1;
21442
21439
  T = new p.LineDashedMaterial({
21443
21440
  color: ge.color,
21444
21441
  linewidth: ge.linewidth || 1,
21445
- dashSize: b * E,
21446
- gapSize: S * E,
21447
- scale: E
21442
+ dashSize: b * S,
21443
+ gapSize: E * S,
21444
+ scale: S
21448
21445
  }), w(y);
21449
21446
  } else
21450
21447
  y.setIndex(u);
@@ -21488,10 +21485,10 @@ const qe = new p.Vector3(1, 0, 0), Un = new p.Vector3(0, 1, 0), yi = new p.Vecto
21488
21485
  if (o?.outlines) {
21489
21486
  const x = o.outlines, y = [];
21490
21487
  x.forEach((b) => {
21491
- const S = new p.Shape();
21492
- b.forEach((E, O) => {
21493
- O === 0 ? S.moveTo(E[0], E[1]) : S.lineTo(E[0], E[1]);
21494
- }), S.closePath(), y.push(new p.ShapeGeometry(S));
21488
+ const E = new p.Shape();
21489
+ b.forEach((S, O) => {
21490
+ O === 0 ? E.moveTo(S[0], S[1]) : E.lineTo(S[0], S[1]);
21491
+ }), E.closePath(), y.push(new p.ShapeGeometry(E));
21495
21492
  });
21496
21493
  const T = _e(y), w = new U(G.Mesh);
21497
21494
  w.geometry = T, w.material = xi, w.layers.enableAll(), w.layers.disable(Xe), a.add(w);
@@ -21514,10 +21511,10 @@ const qe = new p.Vector3(1, 0, 0), Un = new p.Vector3(0, 1, 0), yi = new p.Vecto
21514
21511
  if (this.statsInfo.unsupportedPolylineCount++, x ? y = this.createTaperedPolylineGeometry(n, u) : y = H.convertWidthLineToMeshGeometry(d, u), !y)
21515
21512
  A.warn("[Dxf] Failed to convert line with width to mesh geometry: %s", e.handle);
21516
21513
  else {
21517
- const S = new U(G.Mesh);
21518
- S.geometry = y, S.material = xi, S.layers.enableAll(), S.layers.disable(Xe), a.add(S);
21519
- const E = Q.createOutline(y, ge, S.matrix), O = new U(G.LineSegment);
21520
- O.geometry = E.geometry, O.material = E.material, O.matrix = E.matrix, O.layers.enableAll(), O.layers.disable(Xe), a.add(O);
21514
+ const E = new U(G.Mesh);
21515
+ E.geometry = y, E.material = xi, E.layers.enableAll(), E.layers.disable(Xe), a.add(E);
21516
+ const S = Q.createOutline(y, ge, E.matrix), O = new U(G.LineSegment);
21517
+ O.geometry = S.geometry, O.material = S.material, O.matrix = S.matrix, O.layers.enableAll(), O.layers.disable(Xe), a.add(O);
21521
21518
  }
21522
21519
  }
21523
21520
  }
@@ -21538,8 +21535,8 @@ const qe = new p.Vector3(1, 0, 0), Un = new p.Vector3(0, 1, 0), yi = new p.Vecto
21538
21535
  if (u === 0) continue;
21539
21536
  const f = o.startWidth ?? i ?? 0, m = o.endWidth ?? i ?? 0;
21540
21537
  if (f <= 0 && m <= 0) continue;
21541
- const x = -d / u, y = h / u, T = f / 2, w = m / 2, b = { x: o.x + x * T, y: o.y + y * T }, S = { x: o.x - x * T, y: o.y - y * T }, E = { x: l.x + x * w, y: l.y + y * w }, O = { x: l.x - x * w, y: l.y - y * w }, C = s.length / 3;
21542
- s.push(b.x, b.y, 0, S.x, S.y, 0, E.x, E.y, 0, O.x, O.y, 0), n.push(C, C + 1, C + 2), n.push(C + 1, C + 3, C + 2);
21538
+ const x = -d / u, y = h / u, T = f / 2, w = m / 2, b = { x: o.x + x * T, y: o.y + y * T }, E = { x: o.x - x * T, y: o.y - y * T }, S = { x: l.x + x * w, y: l.y + y * w }, O = { x: l.x - x * w, y: l.y - y * w }, C = s.length / 3;
21539
+ s.push(b.x, b.y, 0, E.x, E.y, 0, S.x, S.y, 0, O.x, O.y, 0), n.push(C, C + 1, C + 2), n.push(C + 1, C + 3, C + 2);
21543
21540
  }
21544
21541
  if (!n.length) return null;
21545
21542
  const r = new p.BufferGeometry();
@@ -21584,12 +21581,12 @@ const qe = new p.Vector3(1, 0, 0), Un = new p.Vector3(0, 1, 0), yi = new p.Vecto
21584
21581
  default:
21585
21582
  return;
21586
21583
  }
21587
- d.traverse((S) => {
21588
- S.geometry && S.geometry.translate(y, T, 0);
21584
+ d.traverse((E) => {
21585
+ E.geometry && E.geometry.translate(y, T, 0);
21589
21586
  });
21590
21587
  let w = 0;
21591
21588
  if (e.contextData?.textRotation && (w = e.contextData.textRotation * Math.PI / 180), e.contextData?.textDirection) {
21592
- const S = e.contextData.textDirection, E = new p.Vector3(S.x, S.y, S.z), O = E.clone().cross(qe), C = qe.angleTo(E);
21589
+ const E = e.contextData.textDirection, S = new p.Vector3(E.x, E.y, E.z), O = S.clone().cross(qe), C = qe.angleTo(S);
21593
21590
  w += O.z > 0 ? -C : C;
21594
21591
  }
21595
21592
  H.shouldRebasePositionOnRTC($) && this.setRTCUserData(d), d.matrix.compose($, ye, it), e.contextData?.textLocation ? N.set(e.contextData.textLocation.x, e.contextData.textLocation.y, 0) : N.set(0, 0, 0);
@@ -21602,14 +21599,14 @@ const qe = new p.Vector3(1, 0, 0), Un = new p.Vector3(0, 1, 0), yi = new p.Vecto
21602
21599
  const m = f.lastLeaderLinePoint;
21603
21600
  if (!m) return a;
21604
21601
  if (e.enableDogLeg && f.doglegVector) {
21605
- const S = new p.Vector3(m.x, m.y, m.z), E = f.doglegLength, O = new p.Vector3(f.doglegVector.x, f.doglegVector.y, f.doglegVector.z), C = O.multiplyScalar(E), v = S.clone().add(C);
21606
- u.push(v, S);
21602
+ const E = new p.Vector3(m.x, m.y, m.z), S = f.doglegLength, O = new p.Vector3(f.doglegVector.x, f.doglegVector.y, f.doglegVector.z), C = O.multiplyScalar(S), v = E.clone().add(C);
21603
+ u.push(v, E);
21607
21604
  }
21608
21605
  const x = e.contextData?.leaders[0].leaderLines || [];
21609
- for (let S = 0; S < x.length; S++) {
21610
- const E = x[S].vertices?.[0];
21611
- if (!E || E.length === 0) continue;
21612
- const O = E.reverse().map((B) => new p.Vector3(B.x, B.y, B.z));
21606
+ for (let E = 0; E < x.length; E++) {
21607
+ const S = x[E].vertices?.[0];
21608
+ if (!S || S.length === 0) continue;
21609
+ const O = S.reverse().map((B) => new p.Vector3(B.x, B.y, B.z));
21613
21610
  let C = new p.Vector3(m.x, m.y, m.z);
21614
21611
  for (let B = 0; B < O.length; B++)
21615
21612
  u.push(C, O[B]), C = O[B];
@@ -21669,10 +21666,10 @@ const qe = new p.Vector3(1, 0, 0), Un = new p.Vector3(0, 1, 0), yi = new p.Vecto
21669
21666
  if (w && w.entities) {
21670
21667
  r && (e.colorIndex = r.DIMCLRD || 256, e.color = Li(e.colorIndex));
21671
21668
  for (let b = 0; b < w.entities.length; b++) {
21672
- const S = this.loadEntity(w.entities[b], i, e);
21673
- if (S) {
21674
- const E = new p.Vector3(n[0].x, n[0].y, n[0].z), O = new p.Vector3(n[1].x, n[1].y, n[1].z), C = Math.atan2(E.y - O.y, E.x - O.x);
21675
- N.copy(E), $.setScalar(d), ye.setFromAxisAngle(yi, C), S.matrix.compose(N, ye, $), u.add(S);
21669
+ const E = this.loadEntity(w.entities[b], i, e);
21670
+ if (E) {
21671
+ const S = new p.Vector3(n[0].x, n[0].y, n[0].z), O = new p.Vector3(n[1].x, n[1].y, n[1].z), C = Math.atan2(S.y - O.y, S.x - O.x);
21672
+ N.copy(S), $.setScalar(d), ye.setFromAxisAngle(yi, C), E.matrix.compose(N, ye, $), u.add(E);
21676
21673
  }
21677
21674
  }
21678
21675
  } else this.loadDefaultLeadArrow(n[1], n[0], d / o / 2, n);
@@ -21837,12 +21834,12 @@ const qe = new p.Vector3(1, 0, 0), Un = new p.Vector3(0, 1, 0), yi = new p.Vecto
21837
21834
  for (let T = 0; T < o; T++) {
21838
21835
  const w = d[y][T];
21839
21836
  if (!w || w.mergedValue !== 0) continue;
21840
- let b = 1, S = 1;
21837
+ let b = 1, E = 1;
21841
21838
  for (; y + b < a && d[y + b][T] && d[y + b][T].mergedValue === 1; )
21842
21839
  b++;
21843
- for (; T + S < o && d[y][T + S] && d[y][T + S].mergedValue === 1; )
21844
- S++;
21845
- w.rowSpan = b, w.colSpan = S;
21840
+ for (; T + E < o && d[y][T + E] && d[y][T + E].mergedValue === 1; )
21841
+ E++;
21842
+ w.rowSpan = b, w.colSpan = E;
21846
21843
  }
21847
21844
  const f = [0];
21848
21845
  for (let y = 0; y < a; y++)
@@ -21855,14 +21852,14 @@ const qe = new p.Vector3(1, 0, 0), Un = new p.Vector3(0, 1, 0), yi = new p.Vecto
21855
21852
  let T = m[0], w = !1;
21856
21853
  for (let b = 0; b < o; b++) {
21857
21854
  y > 0 && d[y - 1][b], y < a && d[y][b];
21858
- let S = !0;
21855
+ let E = !0;
21859
21856
  if (y === 0 || y === a)
21860
- S = !0;
21857
+ E = !0;
21861
21858
  else {
21862
- const E = this._getMergeOwner(d, y - 1, b, a, o), O = this._getMergeOwner(d, y, b, a, o);
21863
- S = E !== O;
21859
+ const S = this._getMergeOwner(d, y - 1, b, a, o), O = this._getMergeOwner(d, y, b, a, o);
21860
+ E = S !== O;
21864
21861
  }
21865
- S ? w || (w = !0, T = m[b]) : w && (x.push(new p.Vector3(T, f[y], 0), new p.Vector3(m[b], f[y], 0)), w = !1);
21862
+ E ? w || (w = !0, T = m[b]) : w && (x.push(new p.Vector3(T, f[y], 0), new p.Vector3(m[b], f[y], 0)), w = !1);
21866
21863
  }
21867
21864
  w && x.push(new p.Vector3(T, f[y], 0), new p.Vector3(m[o], f[y], 0));
21868
21865
  }
@@ -21870,14 +21867,14 @@ const qe = new p.Vector3(1, 0, 0), Un = new p.Vector3(0, 1, 0), yi = new p.Vecto
21870
21867
  let T = f[0], w = !1;
21871
21868
  for (let b = 0; b < a; b++) {
21872
21869
  y > 0 && d[b][y - 1], y < o && d[b][y];
21873
- let S = !0;
21870
+ let E = !0;
21874
21871
  if (y === 0 || y === o)
21875
- S = !0;
21872
+ E = !0;
21876
21873
  else {
21877
- const E = this._getMergeOwner(d, b, y - 1, a, o), O = this._getMergeOwner(d, b, y, a, o);
21878
- S = E !== O;
21874
+ const S = this._getMergeOwner(d, b, y - 1, a, o), O = this._getMergeOwner(d, b, y, a, o);
21875
+ E = S !== O;
21879
21876
  }
21880
- S ? w || (w = !0, T = f[b]) : w && (x.push(new p.Vector3(m[y], T, 0), new p.Vector3(m[y], f[b], 0)), w = !1);
21877
+ E ? w || (w = !0, T = f[b]) : w && (x.push(new p.Vector3(m[y], T, 0), new p.Vector3(m[y], f[b], 0)), w = !1);
21881
21878
  }
21882
21879
  w && x.push(new p.Vector3(m[y], T, 0), new p.Vector3(m[y], f[a], 0));
21883
21880
  }
@@ -21889,16 +21886,16 @@ const qe = new p.Vector3(1, 0, 0), Un = new p.Vector3(0, 1, 0), yi = new p.Vecto
21889
21886
  for (let T = 0; T < o; T++) {
21890
21887
  const w = d[y][T];
21891
21888
  if (!w || w.mergedValue !== 0) continue;
21892
- const b = m[T], S = f[y];
21893
- let E = 0;
21889
+ const b = m[T], E = f[y];
21890
+ let S = 0;
21894
21891
  for (let M = 0; M < (w.colSpan || 1); M++)
21895
- E += h[T + M];
21892
+ S += h[T + M];
21896
21893
  let O = 0;
21897
21894
  for (let M = 0; M < (w.rowSpan || 1); M++)
21898
21895
  O += l[y + M];
21899
21896
  w.colorIndex = e.colorIndex, w.height = w.textHeight || 2.5;
21900
- const C = this.getTableTextOffset(w.attachmentPoint || 1, E, O);
21901
- N.set(b, S, 0), N.add(C), w.position = N.clone();
21897
+ const C = this.getTableTextOffset(w.attachmentPoint || 1, S, O);
21898
+ N.set(b, E, 0), N.add(C), w.position = N.clone();
21902
21899
  const v = this.loadMText(w, i, s);
21903
21900
  v && n.add(v);
21904
21901
  }
@@ -21994,8 +21991,8 @@ const qe = new p.Vector3(1, 0, 0), Un = new p.Vector3(0, 1, 0), yi = new p.Vecto
21994
21991
  e.center && (w.x = e.center.x, w.y = e.center.y);
21995
21992
  const b = new p.Vector3(e.center?.x, e.center?.y, e.center?.z).applyMatrix4(r.invert());
21996
21993
  w.x = b.x, w.y = b.y;
21997
- const S = w, E = new U(G.Point);
21998
- return E.geometry = ma, E.material = Ls, E.userData.handle = e.handle, E.userData.isSnapObject = !0, E.userData.type = "CircleCenter", E.layers.set(Xe), T.add(E), x ? (this.setRTCUserData(T), S.x += m.x, S.y += m.y) : H.shouldRebasePositionOnRTC(S) && this.setRTCUserData(T), T.matrix.setPosition(S), T.layers.enableAll(), T;
21994
+ const E = w, S = new U(G.Point);
21995
+ return S.geometry = ma, S.material = Ls, S.userData.handle = e.handle, S.userData.isSnapObject = !0, S.userData.type = "CircleCenter", S.layers.set(Xe), T.add(S), x ? (this.setRTCUserData(T), E.x += m.x, E.y += m.y) : H.shouldRebasePositionOnRTC(E) && this.setRTCUserData(T), T.matrix.setPosition(E), T.layers.enableAll(), T;
21999
21996
  }
22000
21997
  addTriangleFacingCamera(e, i, s, n) {
22001
21998
  const r = new p.Vector3(), a = new p.Vector3();
@@ -22057,15 +22054,15 @@ const qe = new p.Vector3(1, 0, 0), Un = new p.Vector3(0, 1, 0), yi = new p.Vecto
22057
22054
  let u = 0, f = 0;
22058
22055
  i?.xScale;
22059
22056
  const m = n + s, x = i?.fontFile || "", y = typeof x == "string" && x.toLowerCase().endsWith(".shx"), T = y ? s * 0.06 : s * 0.04, w = [];
22060
- for (let E = 0; E < e.length; E++) {
22061
- const O = e[E];
22057
+ for (let S = 0; S < e.length; S++) {
22058
+ const O = e[S];
22062
22059
  O !== " " && O !== `
22063
- ` && w.push(E);
22060
+ ` && w.push(S);
22064
22061
  }
22065
22062
  const b = w.length;
22066
- let S = 0;
22067
- for (let E = 0; E < e.length; E++) {
22068
- const O = e[E];
22063
+ let E = 0;
22064
+ for (let S = 0; S < e.length; S++) {
22065
+ const O = e[S];
22069
22066
  if (O === " ") {
22070
22067
  u += s * (y ? 0.4 : 0.33);
22071
22068
  continue;
@@ -22092,16 +22089,16 @@ const qe = new p.Vector3(1, 0, 0), Un = new p.Vector3(0, 1, 0), yi = new p.Vecto
22092
22089
  M >= 12288 && M <= 12351 || // CJK 符号与标点(、。《》等)
22093
22090
  M >= 65280 && M <= 65519 || // 全角 ASCII 与标点
22094
22091
  [8216, 8217, 8220, 8221].includes(M) ? Math.max(v, s) : v + T;
22095
- S++, u += P + (S === b ? 0 : l);
22092
+ E++, u += P + (E === b ? 0 : l);
22096
22093
  }
22097
22094
  d.push(C);
22098
22095
  }
22099
22096
  }
22100
22097
  if (d.length > 0) {
22101
- const E = d.filter((C) => C instanceof p.ExtrudeGeometry), O = d.filter((C) => !(C instanceof p.ExtrudeGeometry));
22102
- if (E.length > 0) {
22098
+ const S = d.filter((C) => C instanceof p.ExtrudeGeometry), O = d.filter((C) => !(C instanceof p.ExtrudeGeometry));
22099
+ if (S.length > 0) {
22103
22100
  const C = new U(G.Mesh);
22104
- C.geometry = _e(E), C.material = xi, h.add(C);
22101
+ C.geometry = _e(S), C.material = xi, h.add(C);
22105
22102
  }
22106
22103
  if (O.length > 0) {
22107
22104
  const C = new U(G.LineSegment);
@@ -22149,8 +22146,8 @@ const qe = new p.Vector3(1, 0, 0), Un = new p.Vector3(0, 1, 0), yi = new p.Vecto
22149
22146
  if (e.startPoint && e.endPoint) {
22150
22147
  const d = new p.Vector3(e.startPoint.x, e.startPoint.y, e.startPoint.z), u = new p.Vector3(e.endPoint.x, e.endPoint.y, e.endPoint.z), f = new p.Vector3().subVectors(d, u), m = f.length(), x = m / l, T = (e.text || "").length;
22151
22148
  if (T > 1) {
22152
- const S = (m - l) / (T - 1);
22153
- o.userData.letterSpacing = S;
22149
+ const E = (m - l) / (T - 1);
22150
+ o.userData.letterSpacing = E;
22154
22151
  } else
22155
22152
  x < 3 && o.scale.setX(x);
22156
22153
  const w = f.clone().cross(qe), b = f.angleTo(qe);
@@ -22683,11 +22680,11 @@ const qe = new p.Vector3(1, 0, 0), Un = new p.Vector3(0, 1, 0), yi = new p.Vecto
22683
22680
  });
22684
22681
  const w = this.buildContainHierarchyTree(l, h, T), b = [];
22685
22682
  this.buildHatchGeometry(l, w, b);
22686
- let S;
22687
- if (b.length > 0 && (S = _e(b)), !S || !S.getIndex() || S.getIndex()?.count === 0) return A.warn("[Dxf] Failed to convert hatch boundaries!"), void 0;
22688
- const E = new U(G.Mesh);
22689
- E.geometry = S, E.material = xi, this.setHatchMaterial(E, n, i, x, s);
22690
- const O = E;
22683
+ let E;
22684
+ if (b.length > 0 && (E = _e(b)), !E || !E.getIndex() || E.getIndex()?.count === 0) return A.warn("[Dxf] Failed to convert hatch boundaries!"), void 0;
22685
+ const S = new U(G.Mesh);
22686
+ S.geometry = E, S.material = xi, this.setHatchMaterial(S, n, i, x, s);
22687
+ const O = S;
22691
22688
  return y && (this.setRTCUserData(O), O.matrix.setPosition(x.x, x.y, 0)), O.traverse((C) => {
22692
22689
  C.layers.enableAll(), C.layers.disable(Xe);
22693
22690
  }), O;
@@ -22722,7 +22719,7 @@ const qe = new p.Vector3(1, 0, 0), Un = new p.Vector3(0, 1, 0), yi = new p.Vecto
22722
22719
  for (let w = 0; w < i.objects.XRECORD.length; w++) {
22723
22720
  const b = i.objects.XRECORD[w];
22724
22721
  if (b.handle === x) {
22725
- const S = b.binaryData, E = j.hexToBase64(S), O = "data:image/jpg;base64," + E, C = new p.TextureLoader(this.manager).load(O);
22722
+ const E = b.binaryData, S = j.hexToBase64(E), O = "data:image/jpg;base64," + S, C = new p.TextureLoader(this.manager).load(O);
22726
22723
  C.colorSpace = p.SRGBColorSpace;
22727
22724
  const v = new p.MeshBasicMaterial({
22728
22725
  transparent: !0,
@@ -22733,10 +22730,10 @@ const qe = new p.Vector3(1, 0, 0), Un = new p.Vector3(0, 1, 0), yi = new p.Vecto
22733
22730
  }
22734
22731
  }
22735
22732
  if (T) {
22736
- const w = new p.Box2().setFromPoints(o), b = w.getSize(Zi), S = new p.PlaneGeometry(b.x, b.y), E = new U(G.Mesh);
22737
- E.geometry = S, E.material = T;
22733
+ const w = new p.Box2().setFromPoints(o), b = w.getSize(Zi), E = new p.PlaneGeometry(b.x, b.y), S = new U(G.Mesh);
22734
+ S.geometry = E, S.material = T;
22738
22735
  const O = w.getCenter(Zi);
22739
- N.set(O.x, O.y, 0), h && (this.setRTCUserData(E), N.x += l.x, N.y += l.y), E.matrix.setPosition(N), E.layers.enableAll(), m.add(E);
22736
+ N.set(O.x, O.y, 0), h && (this.setRTCUserData(S), N.x += l.x, N.y += l.y), S.matrix.setPosition(N), S.layers.enableAll(), m.add(S);
22740
22737
  }
22741
22738
  return m.children.length > 1 ? m : f;
22742
22739
  }
@@ -22992,21 +22989,21 @@ const qe = new p.Vector3(1, 0, 0), Un = new p.Vector3(0, 1, 0), yi = new p.Vecto
22992
22989
  const M = f.dashPattern[v];
22993
22990
  M > 0 && (T = !1), w += Math.abs(M);
22994
22991
  }
22995
- const b = T ? a : r, S = [], E = [];
22992
+ const b = T ? a : r, E = [], S = [];
22996
22993
  let O = 0;
22997
- E[0] = O;
22994
+ S[0] = O;
22998
22995
  for (let v = 0; v < y; ++v)
22999
- S[v] = f.dashPattern[v], S[v] === 0 && (S[v] = b * w), O += Math.abs(S[v]), E[v + 1] = O;
22996
+ E[v] = f.dashPattern[v], E[v] === 0 && (E[v] = b * w), O += Math.abs(E[v]), S[v + 1] = O;
23000
22997
  for (let v = y; v < o; ++v)
23001
- S[v] = 0;
23002
- for (let v = E.length; v < o + 1; ++v)
23003
- E[v] = O;
22998
+ E[v] = 0;
22999
+ for (let v = S.length; v < o + 1; ++v)
23000
+ S[v] = O;
23004
23001
  const C = {
23005
23002
  origin: m,
23006
23003
  delta: x,
23007
23004
  angle: f.angle - e.patternAngle,
23008
- pattern: S,
23009
- patternSum: E,
23005
+ pattern: E,
23006
+ patternSum: S,
23010
23007
  patternLength: O
23011
23008
  };
23012
23009
  if (l += 4, l += o, l += o + 1, l > V.MaxFragmentUniforms) {
@@ -23138,10 +23135,10 @@ const qe = new p.Vector3(1, 0, 0), Un = new p.Vector3(0, 1, 0), yi = new p.Vecto
23138
23135
  regions: [o(e[y])],
23139
23136
  inverted: !1
23140
23137
  }), b = qt.combine(x, w);
23141
- d = qt.polygon(qt.selectUnion(b)), d.regions.length > 0 ? d.regions.forEach((S) => {
23142
- if (S.length === 0) return;
23143
- const E = S.map((O) => new p.Vector2(O[0], O[1]));
23144
- h.holes.push(new p.Path(E));
23138
+ d = qt.polygon(qt.selectUnion(b)), d.regions.length > 0 ? d.regions.forEach((E) => {
23139
+ if (E.length === 0) return;
23140
+ const S = E.map((O) => new p.Vector2(O[0], O[1]));
23141
+ h.holes.push(new p.Path(S));
23145
23142
  }) : A.warn("[Dxf] mergedHoles.regions is empty");
23146
23143
  }
23147
23144
  });
@@ -23425,7 +23422,7 @@ const qe = new p.Vector3(1, 0, 0), Un = new p.Vector3(0, 1, 0), yi = new p.Vecto
23425
23422
  }), m[b].children.push(y);
23426
23423
  }
23427
23424
  for (const y in m) {
23428
- const T = m[y], w = kt.deepMerge(T.children, T.object, !1, !1, !0), b = w.added, S = w.removed;
23425
+ const T = m[y], w = kt.deepMerge(T.children, T.object, !1, !1, !0), b = w.added, E = w.removed;
23429
23426
  !s[y] && (s[y] = {
23430
23427
  object: T.object,
23431
23428
  children: []
@@ -23433,21 +23430,21 @@ const qe = new p.Vector3(1, 0, 0), Un = new p.Vector3(0, 1, 0), yi = new p.Vecto
23433
23430
  object: T.object,
23434
23431
  children: []
23435
23432
  });
23436
- const E = S.length > r;
23437
- if (E) {
23433
+ const S = E.length > r;
23434
+ if (S) {
23438
23435
  const O = Date.now();
23439
- V.removeEmptyObjectsFromRemovingMarkedObjects2(S, T.object), o += Date.now() - O;
23440
- } else a += S.length;
23441
- if (S.length === T.children.length) !E && S.forEach((O) => {
23436
+ V.removeEmptyObjectsFromRemovingMarkedObjects2(E, T.object), o += Date.now() - O;
23437
+ } else a += E.length;
23438
+ if (E.length === T.children.length) !S && E.forEach((O) => {
23442
23439
  s[y].children.push(O);
23443
23440
  });
23444
23441
  else {
23445
- let O = S;
23446
- S.length >= 100 && (O = new Set(S));
23442
+ let O = E;
23443
+ E.length >= 100 && (O = new Set(E));
23447
23444
  const C = (v) => Array.isArray(O) ? O.indexOf(v) >= 0 : O.has(v);
23448
23445
  for (let v = 0; v < T.children.length; v++) {
23449
23446
  const M = T.children[v];
23450
- C(M) ? !E && s[y].children.push(M) : x.push(M);
23447
+ C(M) ? !S && s[y].children.push(M) : x.push(M);
23451
23448
  }
23452
23449
  }
23453
23450
  for (let O = 0; O < b.length; O++) {
@@ -23492,10 +23489,10 @@ const qe = new p.Vector3(1, 0, 0), Un = new p.Vector3(0, 1, 0), yi = new p.Vecto
23492
23489
  await s(++m / f * 100);
23493
23490
  continue;
23494
23491
  }
23495
- const w = Date.now(), b = {}, S = [];
23492
+ const w = Date.now(), b = {}, E = [];
23496
23493
  for (const C of T) {
23497
23494
  if (C.userData.isSnapObject) {
23498
- S.push(C);
23495
+ E.push(C);
23499
23496
  continue;
23500
23497
  }
23501
23498
  let v, M = C;
@@ -23513,7 +23510,7 @@ const qe = new p.Vector3(1, 0, 0), Un = new p.Vector3(0, 1, 0), yi = new p.Vecto
23513
23510
  children: []
23514
23511
  }), b[_].children.push(C);
23515
23512
  }
23516
- const E = Object.keys(b).length;
23513
+ const S = Object.keys(b).length;
23517
23514
  let O = 0;
23518
23515
  for (const C in b) {
23519
23516
  let v;
@@ -23543,25 +23540,25 @@ const qe = new p.Vector3(1, 0, 0), Un = new p.Vector3(0, 1, 0), yi = new p.Vecto
23543
23540
  const D = (F) => Array.isArray(k) ? k.indexOf(F) >= 0 : k.has(F);
23544
23541
  for (let F = 0; F < M.children.length; F++) {
23545
23542
  const se = M.children[F];
23546
- D(se) ? !B && a[C].children.push(se) : (S.push(se), v && v.add(se));
23543
+ D(se) ? !B && a[C].children.push(se) : (E.push(se), v && v.add(se));
23547
23544
  }
23548
23545
  }
23549
23546
  for (let k = 0; k < P.length; k++) {
23550
23547
  const D = P[k];
23551
- Q.setSharedVariablesOfObject(D), S.push(D), o[C].children.push(D), v && v.add(D);
23548
+ Q.setSharedVariablesOfObject(D), E.push(D), o[C].children.push(D), v && v.add(D);
23552
23549
  }
23553
- h > l && u(), await s((m + ++O / E) / f * 100);
23550
+ h > l && u(), await s((m + ++O / S) / f * 100);
23554
23551
  }
23555
- await s(++m / f * 100), e.layersAndThreejsObjects[y] = S, A.debug("[Dxf] Merged layer '" + y + "' in " + (Date.now() - w) / 1e3 + "s");
23552
+ await s(++m / f * 100), e.layersAndThreejsObjects[y] = E, A.debug("[Dxf] Merged layer '" + y + "' in " + (Date.now() - w) / 1e3 + "s");
23556
23553
  }
23557
23554
  h > 0 && u();
23558
23555
  for (const y in o) {
23559
23556
  const T = o[y], w = e.threejsObject.children.find((b) => b.name === y);
23560
23557
  if (w) {
23561
- const b = w.children.find((S) => S.name === V.SNAP_GROUP_NAME);
23558
+ const b = w.children.find((E) => E.name === V.SNAP_GROUP_NAME);
23562
23559
  if (b && y !== V.MODEL_LAYOUT_NAME) {
23563
- const S = n[y];
23564
- !S.directAssociatedLeafObjectSet && (S.directAssociatedLeafObjectSet = /* @__PURE__ */ new Set()), b.children.forEach((E) => S.directAssociatedLeafObjectSet?.add(E));
23560
+ const E = n[y];
23561
+ !E.directAssociatedLeafObjectSet && (E.directAssociatedLeafObjectSet = /* @__PURE__ */ new Set()), b.children.forEach((S) => E.directAssociatedLeafObjectSet?.add(S));
23565
23562
  }
23566
23563
  }
23567
23564
  !w && e.threejsObject.add(T.object), T.children.forEach((b) => {
@@ -23768,7 +23765,7 @@ class ds extends br {
23768
23765
  const e = new p.Box3(), i = this.getModelObject(), s = new p.Box3();
23769
23766
  i.updateWorldMatrix(!1, !0);
23770
23767
  const n = (r) => {
23771
- if (r.userData?.isSnapObject) return;
23768
+ if (r.userData?.isSnapObject || r.userData?.isConstructionLine) return;
23772
23769
  const a = r.geometry;
23773
23770
  a && (a.boundingBox || a.computeBoundingBox(), s.copy(a.boundingBox).applyMatrix4(r.matrixWorld), e.union(s));
23774
23771
  for (const o of r.children) n(o);
@@ -24060,11 +24057,11 @@ class ds extends br {
24060
24057
  }
24061
24058
  }), w.add(_);
24062
24059
  }), T && T.size === 0) return;
24063
- const S = s.getModelObject();
24064
- let E = s.getLayoutLevelObject(e);
24065
- !E && (E = new p.Group(), Q.setSharedVariablesOfObject(E), E.name = e, S?.add(E)), E.add(w), w.applyMatrix4(r.msToPsMatrix), w.updateMatrixWorld(!0);
24066
- let O = E.children.find((M) => M.name === Z.SNAP_GROUP_NAME);
24067
- !O && (O = new p.Group(), O.visible = Z.SHOW_SNAP_OBJECT, O.name = Z.SNAP_GROUP_NAME, E.add(O));
24060
+ const E = s.getModelObject();
24061
+ let S = s.getLayoutLevelObject(e);
24062
+ !S && (S = new p.Group(), Q.setSharedVariablesOfObject(S), S.name = e, E?.add(S)), S.add(w), w.applyMatrix4(r.msToPsMatrix), w.updateMatrixWorld(!0);
24063
+ let O = S.children.find((M) => M.name === Z.SNAP_GROUP_NAME);
24064
+ !O && (O = new p.Group(), O.visible = Z.SHOW_SNAP_OBJECT, O.name = Z.SNAP_GROUP_NAME, S.add(O));
24068
24065
  const C = s.getLayoutLevelObject(Z.MODEL_LAYOUT_NAME), v = C?.children.find((M) => M.name === Z.SNAP_GROUP_NAME);
24069
24066
  v && v.traverse((M) => {
24070
24067
  if (!M.geometry) return;
@@ -26230,7 +26227,7 @@ class b1 extends cl {
26230
26227
  };
26231
26228
  }
26232
26229
  createInstancedMesh(e) {
26233
- const { position: i, uv: s, color: n, normal: r, indice: a, barycentric: o, matrices: l, userIds: h, materialId: d } = e, u = h.map((E) => Ea(this.tilesetId, E)), f = h.length, m = new p.BufferGeometry();
26230
+ const { position: i, uv: s, color: n, normal: r, indice: a, barycentric: o, matrices: l, userIds: h, materialId: d } = e, u = h.map((S) => Ea(this.tilesetId, S)), f = h.length, m = new p.BufferGeometry();
26234
26231
  m.setIndex(Array.from(a)), m.setAttribute("position", new p.Float32BufferAttribute(i, 3)), m.setAttribute("uv", new p.Float32BufferAttribute(s, 2)), m.setAttribute("normal", new p.Float32BufferAttribute(r, 3)), m.setAttribute(
26235
26232
  "tileObjectId",
26236
26233
  new p.InstancedBufferAttribute(new Int32Array(u), 1)
@@ -26241,10 +26238,10 @@ class b1 extends cl {
26241
26238
  w.instanceMatrix = new p.InstancedBufferAttribute(new Float32Array(l), 16);
26242
26239
  let b = n;
26243
26240
  b.length === 0 && (b = this.getVertexColorArray(f * 3, y?.color)), w.instanceColor = new p.InstancedBufferAttribute(b, 3);
26244
- const S = new p.InstancedMesh(m, this.materialManager?.pickMaterial, f);
26245
- return S.instanceMatrix = new p.InstancedBufferAttribute(new Float32Array(l), 16), {
26241
+ const E = new p.InstancedMesh(m, this.materialManager?.pickMaterial, f);
26242
+ return E.instanceMatrix = new p.InstancedBufferAttribute(new Float32Array(l), 16), {
26246
26243
  mesh: w,
26247
- pickMesh: S,
26244
+ pickMesh: E,
26248
26245
  userIds: h
26249
26246
  };
26250
26247
  }
@@ -26276,16 +26273,16 @@ class b1 extends cl {
26276
26273
  )
26277
26274
  ), x && f.setIndex(x), f.applyMatrix4(T);
26278
26275
  } else {
26279
- const { indexStart: T, indexCount: w, positionStart: b, positionCount: S } = o.userData.batchTable.find(
26276
+ const { indexStart: T, indexCount: w, positionStart: b, positionCount: E } = o.userData.batchTable.find(
26280
26277
  (_) => _.userId === d
26281
- ), E = m.itemSize, O = m.array.slice(
26282
- b * E,
26283
- b * E + S * E
26284
- ), C = new p.Float32BufferAttribute(O, E);
26278
+ ), S = m.itemSize, O = m.array.slice(
26279
+ b * S,
26280
+ b * S + E * S
26281
+ ), C = new p.Float32BufferAttribute(O, S);
26285
26282
  f.setAttribute("position", C);
26286
26283
  const v = y.array.slice(
26287
26284
  b,
26288
- b + S
26285
+ b + E
26289
26286
  ), M = new p.Int32BufferAttribute(v, 1);
26290
26287
  if (f.setAttribute("tileObjectId", M), x) {
26291
26288
  const _ = x.array.slice(T, T + w);
@@ -26951,9 +26948,9 @@ function Aa(c, t, e, i, s = 1 / 0, n, r) {
26951
26948
  i = Math.max(1e-4, i);
26952
26949
  const a = 2 / i, o = a * n, l = 1 / (1 + o + 0.48 * o * o + 0.235 * o * o * o);
26953
26950
  let h = t.x, d = t.y, u = t.z, f = c.x - h, m = c.y - d, x = c.z - u;
26954
- const y = h, T = d, w = u, b = s * i, S = b * b, E = f * f + m * m + x * x;
26955
- if (E > S) {
26956
- const D = Math.sqrt(E);
26951
+ const y = h, T = d, w = u, b = s * i, E = b * b, S = f * f + m * m + x * x;
26952
+ if (S > E) {
26953
+ const D = Math.sqrt(S);
26957
26954
  f = f / D * b, m = m / D * b, x = x / D * b;
26958
26955
  }
26959
26956
  h = c.x - f, d = c.y - m, u = c.z - x;
@@ -27219,23 +27216,23 @@ class J extends C1 {
27219
27216
  right: 0,
27220
27217
  top: 0,
27221
27218
  bottom: 0
27222
- }, 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 q.Vector3(), this._focalOffsetVelocity = new q.Vector3(), this._zoomVelocity = { value: 0 }, this._truckInternal = (b, S, E) => {
27219
+ }, 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 q.Vector3(), this._focalOffsetVelocity = new q.Vector3(), this._zoomVelocity = { value: 0 }, this._truckInternal = (b, E, S) => {
27223
27220
  if (at(this._camera)) {
27224
- const O = X.copy(this._camera.position).sub(this._target), C = this._camera.getEffectiveFOV() * Ki, v = O.length() * Math.tan(C * 0.5), M = this.truckSpeed * b * v / this._elementRect.height, _ = this.truckSpeed * S * v / this._elementRect.height;
27225
- this.verticalDragToForward ? (E ? this.setFocalOffset(this._focalOffsetEnd.x + M, this._focalOffsetEnd.y, this._focalOffsetEnd.z, !0) : this.truck(M, 0, !0), this.forward(-_, !0)) : E ? this.setFocalOffset(this._focalOffsetEnd.x + M, this._focalOffsetEnd.y + _, this._focalOffsetEnd.z, !0) : this.truck(M, _, !0);
27221
+ const O = X.copy(this._camera.position).sub(this._target), C = this._camera.getEffectiveFOV() * Ki, v = O.length() * Math.tan(C * 0.5), M = this.truckSpeed * b * v / this._elementRect.height, _ = this.truckSpeed * E * v / this._elementRect.height;
27222
+ this.verticalDragToForward ? (S ? this.setFocalOffset(this._focalOffsetEnd.x + M, this._focalOffsetEnd.y, this._focalOffsetEnd.z, !0) : this.truck(M, 0, !0), this.forward(-_, !0)) : S ? this.setFocalOffset(this._focalOffsetEnd.x + M, this._focalOffsetEnd.y + _, this._focalOffsetEnd.z, !0) : this.truck(M, _, !0);
27226
27223
  } else if (Ne(this._camera)) {
27227
- const O = this._camera, C = this.truckSpeed * b * (O.right - O.left) / O.zoom / this._elementRect.width, v = this.truckSpeed * S * (O.top - O.bottom) / O.zoom / this._elementRect.height;
27228
- E ? this.setFocalOffset(this._focalOffsetEnd.x + C, this._focalOffsetEnd.y + v, this._focalOffsetEnd.z, !0) : this.truck(C, v, !0);
27224
+ const O = this._camera, C = this.truckSpeed * b * (O.right - O.left) / O.zoom / this._elementRect.width, v = this.truckSpeed * E * (O.top - O.bottom) / O.zoom / this._elementRect.height;
27225
+ S ? this.setFocalOffset(this._focalOffsetEnd.x + C, this._focalOffsetEnd.y + v, this._focalOffsetEnd.z, !0) : this.truck(C, v, !0);
27229
27226
  }
27230
- }, this._rotateInternal = (b, S) => {
27231
- const E = wi * this.azimuthRotateSpeed * b / this._elementRect.height, O = wi * this.polarRotateSpeed * S / this._elementRect.height;
27232
- this.rotate(E, O, !0);
27233
- }, this._dollyInternal = (b, S, E) => {
27227
+ }, this._rotateInternal = (b, E) => {
27228
+ const S = wi * this.azimuthRotateSpeed * b / this._elementRect.height, O = wi * this.polarRotateSpeed * E / this._elementRect.height;
27229
+ this.rotate(S, O, !0);
27230
+ }, this._dollyInternal = (b, E, S) => {
27234
27231
  const O = Math.pow(0.95, -b * this.dollySpeed), C = this._sphericalEnd.radius * O, v = this._sphericalEnd.radius, M = v * (b >= 0 ? -1 : 1);
27235
- this.dollyTo(C), this.infinityDolly && (C < this.minDistance || this.maxDistance === this.minDistance) && (this._camera.getWorldDirection(X), this._targetEnd.add(X.normalize().multiplyScalar(M)), this._target.add(X.normalize().multiplyScalar(M))), this.dollyToCursor && (this._dollyControlAmount += this._sphericalEnd.radius - v, this.infinityDolly && (C < this.minDistance || this.maxDistance === this.minDistance) && (this._dollyControlAmount -= M), this._dollyControlCoord.set(S, E));
27236
- }, this._zoomInternal = (b, S, E) => {
27232
+ this.dollyTo(C), this.infinityDolly && (C < this.minDistance || this.maxDistance === this.minDistance) && (this._camera.getWorldDirection(X), this._targetEnd.add(X.normalize().multiplyScalar(M)), this._target.add(X.normalize().multiplyScalar(M))), this.dollyToCursor && (this._dollyControlAmount += this._sphericalEnd.radius - v, this.infinityDolly && (C < this.minDistance || this.maxDistance === this.minDistance) && (this._dollyControlAmount -= M), this._dollyControlCoord.set(E, S));
27233
+ }, this._zoomInternal = (b, E, S) => {
27237
27234
  const O = Math.pow(0.95, b * this.dollySpeed), C = this._zoomEnd;
27238
- this.zoomTo(this._zoom * O), this.dollyToCursor && (this._dollyControlAmount += this._zoomEnd - C, this._dollyControlCoord.set(S, E));
27235
+ this.zoomTo(this._zoom * O), this.dollyToCursor && (this._dollyControlAmount += this._zoomEnd - C, this._dollyControlCoord.set(E, S));
27239
27236
  }, typeof q > "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 q.Quaternion().setFromUnitVectors(this._camera.up, js), this._yAxisUpSpaceInverse = this._yAxisUpSpace.clone().invert(), this._state = L.NONE, this._target = new q.Vector3(), this._targetEnd = this._target.clone(), this._focalOffset = new q.Vector3(), this._focalOffsetEnd = this._focalOffset.clone(), this._spherical = new q.Spherical().setFromVector3(X.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)), this._sphericalEnd = this._spherical.clone(), this._zoom = this._camera.zoom, this._zoomEnd = this._zoom, this._nearPlaneCorners = [new q.Vector3(), new q.Vector3(), new q.Vector3(), new q.Vector3()], this._updateNearPlaneCorners(), this._boundary = new q.Box3(new q.Vector3(-1 / 0, -1 / 0, -1 / 0), new q.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 q.Vector2(), this.mouseButtons = {
27240
27237
  left: L.ROTATE,
27241
27238
  middle: L.DOLLY,
@@ -27248,28 +27245,28 @@ class J extends C1 {
27248
27245
  };
27249
27246
  const s = new q.Vector2(), n = new q.Vector2(), r = new q.Vector2(), a = (b) => {
27250
27247
  if (!this._enabled || !this._domElement) return;
27251
- const S = b.pointerType !== "mouse" ? null : (b.buttons & Y.LEFT) === Y.LEFT ? Y.LEFT : (b.buttons & Y.MIDDLE) === Y.MIDDLE ? Y.MIDDLE : (b.buttons & Y.RIGHT) === Y.RIGHT ? Y.RIGHT : null;
27252
- if (S !== null) {
27253
- const O = this._findPointerByMouseButton(S);
27248
+ const E = b.pointerType !== "mouse" ? null : (b.buttons & Y.LEFT) === Y.LEFT ? Y.LEFT : (b.buttons & Y.MIDDLE) === Y.MIDDLE ? Y.MIDDLE : (b.buttons & Y.RIGHT) === Y.RIGHT ? Y.RIGHT : null;
27249
+ if (E !== null) {
27250
+ const O = this._findPointerByMouseButton(E);
27254
27251
  O && this._activePointers.splice(this._activePointers.indexOf(O), 1);
27255
27252
  }
27256
- const E = {
27253
+ const S = {
27257
27254
  pointerId: b.pointerId,
27258
27255
  clientX: b.clientX,
27259
27256
  clientY: b.clientY,
27260
27257
  deltaX: 0,
27261
27258
  deltaY: 0,
27262
- mouseButton: S
27259
+ mouseButton: E
27263
27260
  };
27264
- this._activePointers.push(E), this._domElement.removeEventListener("pointermove", l), this._domElement.removeEventListener("pointerup", d), this._domElement.addEventListener("pointermove", l), this._domElement.addEventListener("pointerup", d), y(b);
27261
+ this._activePointers.push(S), this._domElement.removeEventListener("pointermove", l), this._domElement.removeEventListener("pointerup", d), this._domElement.addEventListener("pointermove", l), this._domElement.addEventListener("pointerup", d), y(b);
27265
27262
  }, o = (b) => {
27266
27263
  if (!this._enabled || !this._domElement) return;
27267
- const S = (b.buttons & Y.LEFT) === Y.LEFT ? Y.LEFT : (b.buttons & Y.MIDDLE) === Y.MIDDLE ? Y.MIDDLE : (b.buttons & Y.RIGHT) === Y.RIGHT ? Y.RIGHT : null;
27268
- if (S !== null) {
27269
- const O = this._findPointerByMouseButton(S);
27264
+ const E = (b.buttons & Y.LEFT) === Y.LEFT ? Y.LEFT : (b.buttons & Y.MIDDLE) === Y.MIDDLE ? Y.MIDDLE : (b.buttons & Y.RIGHT) === Y.RIGHT ? Y.RIGHT : null;
27265
+ if (E !== null) {
27266
+ const O = this._findPointerByMouseButton(E);
27270
27267
  O && this._activePointers.splice(this._activePointers.indexOf(O), 1);
27271
27268
  }
27272
- const E = {
27269
+ const S = {
27273
27270
  pointerId: 0,
27274
27271
  clientX: b.clientX,
27275
27272
  clientY: b.clientY,
@@ -27277,11 +27274,11 @@ class J extends C1 {
27277
27274
  deltaY: 0,
27278
27275
  mouseButton: (b.buttons & Y.LEFT) === Y.LEFT ? Y.LEFT : (b.buttons & Y.MIDDLE) === Y.LEFT ? Y.MIDDLE : (b.buttons & Y.RIGHT) === Y.LEFT ? Y.RIGHT : null
27279
27276
  };
27280
- this._activePointers.push(E), this._domElement.removeEventListener("mousemove", h), this._domElement.removeEventListener("mouseup", u), this._domElement.addEventListener("mousemove", h), this._domElement.addEventListener("mouseup", u), y(b);
27277
+ this._activePointers.push(S), this._domElement.removeEventListener("mousemove", h), this._domElement.removeEventListener("mouseup", u), this._domElement.addEventListener("mousemove", h), this._domElement.addEventListener("mouseup", u), y(b);
27281
27278
  }, l = (b) => {
27282
- const S = b.pointerId, E = this._findPointerById(S);
27283
- if (E) {
27284
- if (E.clientX = b.clientX, E.clientY = b.clientY, E.deltaX = b.movementX, E.deltaY = b.movementY, b.pointerType === "touch")
27279
+ const E = b.pointerId, S = this._findPointerById(E);
27280
+ if (S) {
27281
+ if (S.clientX = b.clientX, S.clientY = b.clientY, S.deltaX = b.movementX, S.deltaY = b.movementY, b.pointerType === "touch")
27285
27282
  switch (this._activePointers.length) {
27286
27283
  case 1:
27287
27284
  this._state = this.touches.one;
@@ -27298,11 +27295,11 @@ class J extends C1 {
27298
27295
  T();
27299
27296
  }
27300
27297
  }, h = (b) => {
27301
- const S = this._findPointerById(0);
27302
- S && (S.clientX = b.clientX, S.clientY = b.clientY, S.deltaX = b.movementX, S.deltaY = b.movementY, this._state = 0, (b.buttons & Y.LEFT) === Y.LEFT && (this._state = this._state | this.mouseButtons.left), (b.buttons & Y.MIDDLE) === Y.MIDDLE && (this._state = this._state | this.mouseButtons.middle), (b.buttons & Y.RIGHT) === Y.RIGHT && (this._state = this._state | this.mouseButtons.right), T());
27298
+ const E = this._findPointerById(0);
27299
+ E && (E.clientX = b.clientX, E.clientY = b.clientY, E.deltaX = b.movementX, E.deltaY = b.movementY, this._state = 0, (b.buttons & Y.LEFT) === Y.LEFT && (this._state = this._state | this.mouseButtons.left), (b.buttons & Y.MIDDLE) === Y.MIDDLE && (this._state = this._state | this.mouseButtons.middle), (b.buttons & Y.RIGHT) === Y.RIGHT && (this._state = this._state | this.mouseButtons.right), T());
27303
27300
  }, d = (b) => {
27304
- const S = b.pointerId, E = this._findPointerById(S);
27305
- if (E && this._activePointers.splice(this._activePointers.indexOf(E), 1), b.pointerType === "touch")
27301
+ const E = b.pointerId, S = this._findPointerById(E);
27302
+ if (S && this._activePointers.splice(this._activePointers.indexOf(S), 1), b.pointerType === "touch")
27306
27303
  switch (this._activePointers.length) {
27307
27304
  case 0:
27308
27305
  this._state = L.NONE;
@@ -27331,7 +27328,7 @@ class J extends C1 {
27331
27328
  const v = performance.now();
27332
27329
  f - v < 1e3 && this._getClientRect(this._elementRect), f = v;
27333
27330
  }
27334
- const S = S1 ? -1 : -3, E = b.deltaMode === 1 ? b.deltaY / S : b.deltaY / (S * 10), O = this.dollyToCursor ? (b.clientX - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, C = this.dollyToCursor ? (b.clientY - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
27331
+ const E = S1 ? -1 : -3, S = b.deltaMode === 1 ? b.deltaY / E : b.deltaY / (E * 10), O = this.dollyToCursor ? (b.clientX - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, C = this.dollyToCursor ? (b.clientY - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
27335
27332
  switch (this.mouseButtons.wheel) {
27336
27333
  case L.ROTATE: {
27337
27334
  this._rotateInternal(b.deltaX, b.deltaY), this._isUserControllingRotate = !0;
@@ -27346,25 +27343,25 @@ class J extends C1 {
27346
27343
  break;
27347
27344
  }
27348
27345
  case L.DOLLY: {
27349
- this._dollyInternal(-E, O, C), this._isUserControllingDolly = !0;
27346
+ this._dollyInternal(-S, O, C), this._isUserControllingDolly = !0;
27350
27347
  break;
27351
27348
  }
27352
27349
  case L.ZOOM: {
27353
- this._zoomInternal(-E, O, C), this._isUserControllingZoom = !0;
27350
+ this._zoomInternal(-S, O, C), this._isUserControllingZoom = !0;
27354
27351
  break;
27355
27352
  }
27356
27353
  }
27357
27354
  this.dispatchEvent({ type: "control" });
27358
27355
  }, x = (b) => {
27359
27356
  if (!(!this._domElement || !this._enabled) && this.mouseButtons.right === J.ACTION.NONE) {
27360
- const S = b instanceof PointerEvent ? b.pointerId : (b instanceof MouseEvent, 0), E = this._findPointerById(S);
27361
- E && this._activePointers.splice(this._activePointers.indexOf(E), 1), this._domElement.removeEventListener("pointermove", l), this._domElement.removeEventListener("pointerup", d), this._domElement.removeEventListener("mousemove", h), this._domElement.removeEventListener("mouseup", u);
27357
+ const E = b instanceof PointerEvent ? b.pointerId : (b instanceof MouseEvent, 0), S = this._findPointerById(E);
27358
+ S && this._activePointers.splice(this._activePointers.indexOf(S), 1), this._domElement.removeEventListener("pointermove", l), this._domElement.removeEventListener("pointerup", d), this._domElement.removeEventListener("mousemove", h), this._domElement.removeEventListener("mouseup", u);
27362
27359
  return;
27363
27360
  }
27364
27361
  }, y = (b) => {
27365
27362
  if (!this._enabled) return;
27366
27363
  if (Gn(this._activePointers, je), this._getClientRect(this._elementRect), s.copy(je), n.copy(je), this._activePointers.length >= 2) {
27367
- const E = je.x - this._activePointers[1].clientX, O = je.y - this._activePointers[1].clientY, C = Math.sqrt(E * E + O * O);
27364
+ const S = je.x - this._activePointers[1].clientX, O = je.y - this._activePointers[1].clientY, C = Math.sqrt(S * S + O * O);
27368
27365
  r.set(0, C);
27369
27366
  const v = (this._activePointers[0].clientX + this._activePointers[1].clientX) * 0.5, M = (this._activePointers[0].clientY + this._activePointers[1].clientY) * 0.5;
27370
27367
  n.set(v, M);
@@ -27387,10 +27384,10 @@ class J extends C1 {
27387
27384
  }, T = () => {
27388
27385
  if (!this._enabled) return;
27389
27386
  Gn(this._activePointers, je);
27390
- const b = Fe.isBrowser ? this._domElement && document.pointerLockElement === this._domElement : !1, S = b ? -this._activePointers[0].deltaX : n.x - je.x, E = b ? -this._activePointers[0].deltaY : n.y - je.y;
27391
- if (n.copy(je), ((this._state & L.ROTATE) === L.ROTATE || (this._state & L.TOUCH_ROTATE) === L.TOUCH_ROTATE || (this._state & L.TOUCH_DOLLY_ROTATE) === L.TOUCH_DOLLY_ROTATE || (this._state & L.TOUCH_ZOOM_ROTATE) === L.TOUCH_ZOOM_ROTATE) && (this._rotateInternal(S, E), this._isUserControllingRotate = !0), (this._state & L.DOLLY) === L.DOLLY || (this._state & L.ZOOM) === L.ZOOM) {
27387
+ const b = Fe.isBrowser ? this._domElement && document.pointerLockElement === this._domElement : !1, E = b ? -this._activePointers[0].deltaX : n.x - je.x, S = b ? -this._activePointers[0].deltaY : n.y - je.y;
27388
+ if (n.copy(je), ((this._state & L.ROTATE) === L.ROTATE || (this._state & L.TOUCH_ROTATE) === L.TOUCH_ROTATE || (this._state & L.TOUCH_DOLLY_ROTATE) === L.TOUCH_DOLLY_ROTATE || (this._state & L.TOUCH_ZOOM_ROTATE) === L.TOUCH_ZOOM_ROTATE) && (this._rotateInternal(E, S), this._isUserControllingRotate = !0), (this._state & L.DOLLY) === L.DOLLY || (this._state & L.ZOOM) === L.ZOOM) {
27392
27389
  const O = this.dollyToCursor ? (s.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, C = this.dollyToCursor ? (s.y - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
27393
- (this._state & L.DOLLY) === L.DOLLY ? (this._dollyInternal(E * Us, O, C), this._isUserControllingDolly = !0) : (this._zoomInternal(E * Us, O, C), this._isUserControllingZoom = !0);
27390
+ (this._state & L.DOLLY) === L.DOLLY ? (this._dollyInternal(S * Us, O, C), this._isUserControllingDolly = !0) : (this._zoomInternal(S * Us, O, C), this._isUserControllingZoom = !0);
27394
27391
  }
27395
27392
  if ((this._state & L.TOUCH_DOLLY) === L.TOUCH_DOLLY || (this._state & L.TOUCH_ZOOM) === L.TOUCH_ZOOM || (this._state & L.TOUCH_DOLLY_TRUCK) === L.TOUCH_DOLLY_TRUCK || (this._state & L.TOUCH_ZOOM_TRUCK) === L.TOUCH_ZOOM_TRUCK || (this._state & L.TOUCH_DOLLY_OFFSET) === L.TOUCH_DOLLY_OFFSET || (this._state & L.TOUCH_ZOOM_OFFSET) === L.TOUCH_ZOOM_OFFSET || (this._state & L.TOUCH_DOLLY_ROTATE) === L.TOUCH_DOLLY_ROTATE || (this._state & L.TOUCH_ZOOM_ROTATE) === L.TOUCH_ZOOM_ROTATE) {
27396
27393
  const O = je.x - this._activePointers[1].clientX, C = je.y - this._activePointers[1].clientY, v = Math.sqrt(O * O + C * C), M = r.y - v;
@@ -27398,7 +27395,7 @@ class J extends C1 {
27398
27395
  const _ = this.dollyToCursor ? (n.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, P = this.dollyToCursor ? (n.y - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
27399
27396
  (this._state & L.TOUCH_DOLLY) === L.TOUCH_DOLLY || (this._state & L.TOUCH_DOLLY_ROTATE) === L.TOUCH_DOLLY_ROTATE || (this._state & L.TOUCH_DOLLY_TRUCK) === L.TOUCH_DOLLY_TRUCK || (this._state & L.TOUCH_DOLLY_OFFSET) === L.TOUCH_DOLLY_OFFSET ? (this._dollyInternal(M * Us, _, P), this._isUserControllingDolly = !0) : (this._zoomInternal(M * Us, _, P), this._isUserControllingZoom = !0);
27400
27397
  }
27401
- ((this._state & L.TRUCK) === L.TRUCK || (this._state & L.TOUCH_TRUCK) === L.TOUCH_TRUCK || (this._state & L.TOUCH_DOLLY_TRUCK) === L.TOUCH_DOLLY_TRUCK || (this._state & L.TOUCH_ZOOM_TRUCK) === L.TOUCH_ZOOM_TRUCK) && (this._truckInternal(S, E, !1), this._isUserControllingTruck = !0), ((this._state & L.OFFSET) === L.OFFSET || (this._state & L.TOUCH_OFFSET) === L.TOUCH_OFFSET || (this._state & L.TOUCH_DOLLY_OFFSET) === L.TOUCH_DOLLY_OFFSET || (this._state & L.TOUCH_ZOOM_OFFSET) === L.TOUCH_ZOOM_OFFSET) && (this._truckInternal(S, E, !0), this._isUserControllingOffset = !0), this.dispatchEvent({ type: "control" });
27398
+ ((this._state & L.TRUCK) === L.TRUCK || (this._state & L.TOUCH_TRUCK) === L.TOUCH_TRUCK || (this._state & L.TOUCH_DOLLY_TRUCK) === L.TOUCH_DOLLY_TRUCK || (this._state & L.TOUCH_ZOOM_TRUCK) === L.TOUCH_ZOOM_TRUCK) && (this._truckInternal(E, S, !1), this._isUserControllingTruck = !0), ((this._state & L.OFFSET) === L.OFFSET || (this._state & L.TOUCH_OFFSET) === L.TOUCH_OFFSET || (this._state & L.TOUCH_DOLLY_OFFSET) === L.TOUCH_DOLLY_OFFSET || (this._state & L.TOUCH_ZOOM_OFFSET) === L.TOUCH_ZOOM_OFFSET) && (this._truckInternal(E, S, !0), this._isUserControllingOffset = !0), this.dispatchEvent({ type: "control" });
27402
27399
  }, w = () => {
27403
27400
  Gn(this._activePointers, je), n.copy(je), this._activePointers.length === 0 && this._domElement && (this._domElement.removeEventListener("pointermove", l), this._domElement.removeEventListener("mousemove", h), this._domElement.removeEventListener("pointerup", d), this._domElement.removeEventListener("mouseup", u), this.dispatchEvent({ type: "controlend" }));
27404
27401
  };
@@ -27806,7 +27803,7 @@ class J extends C1 {
27806
27803
  const b = this.getDistanceToFitBox(T.x, T.y, T.z, s);
27807
27804
  l.push(this.moveTo(w.x, w.y, w.z, i)), l.push(this.dollyTo(b, i)), l.push(this.setFocalOffset(0, 0, 0, i));
27808
27805
  } else if (Ne(this._camera)) {
27809
- const b = this._camera, S = b.right - b.left, E = b.top - b.bottom, O = s ? Math.max(S / T.x, E / T.y) : Math.min(S / T.x, E / T.y);
27806
+ const b = this._camera, E = b.right - b.left, S = b.top - b.bottom, O = s ? Math.max(E / T.x, S / T.y) : Math.min(E / T.x, S / T.y);
27810
27807
  l.push(this.moveTo(w.x, w.y, w.z, i)), l.push(this.zoomTo(O, i)), l.push(this.setFocalOffset(0, 0, 0, i));
27811
27808
  }
27812
27809
  return Promise.all(l);
@@ -27870,11 +27867,11 @@ class J extends C1 {
27870
27867
  st.setFromVector3(T.sub(y).applyQuaternion(this._yAxisUpSpace));
27871
27868
  const w = vi.set(d, u, f), b = ie.set(o, l, h);
27872
27869
  Qi.setFromVector3(b.sub(w).applyQuaternion(this._yAxisUpSpace)), this._targetEnd.copy(y.lerp(w, m));
27873
- const S = Qi.theta - st.theta, E = Qi.phi - st.phi, O = Qi.radius - st.radius;
27870
+ const E = Qi.theta - st.theta, S = Qi.phi - st.phi, O = Qi.radius - st.radius;
27874
27871
  this._sphericalEnd.set(
27875
27872
  st.radius + O * m,
27876
- st.phi + E * m,
27877
- st.theta + S * m
27873
+ st.phi + S * m,
27874
+ st.theta + E * m
27878
27875
  ), this.normalizeRotations(), this._needsUpdate = !0, x || (this._target.copy(this._targetEnd), this._spherical.copy(this._sphericalEnd));
27879
27876
  const C = !x || ae(this._target.x, this._targetEnd.x, this.restThreshold) && ae(this._target.y, this._targetEnd.y, this.restThreshold) && ae(this._target.z, this._targetEnd.z, this.restThreshold) && ae(this._spherical.theta, this._sphericalEnd.theta, this.restThreshold) && ae(this._spherical.phi, this._sphericalEnd.phi, this.restThreshold) && ae(this._spherical.radius, this._sphericalEnd.radius, this.restThreshold);
27880
27877
  return this._createOnRestPromise(C);
@@ -28093,8 +28090,8 @@ class J extends C1 {
28093
28090
  (u.near + u.far) / (u.near - u.far)
28094
28091
  ).unproject(u), m = ie.set(0, 0, -1).applyQuaternion(u.quaternion), x = vi.copy(f).add(m.multiplyScalar(-f.dot(u.up))), T = -(this._zoom - this._dollyControlAmount - this._zoomEnd) / this._zoom, w = X.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).normalize().negate(), b = this._targetEnd.dot(w);
28095
28092
  this._targetEnd.lerp(x, T);
28096
- const S = this._targetEnd.dot(w), E = w.multiplyScalar(S - b);
28097
- this._targetEnd.sub(E);
28093
+ const E = this._targetEnd.dot(w), S = w.multiplyScalar(E - b);
28094
+ this._targetEnd.sub(S);
28098
28095
  }
28099
28096
  this._target.copy(this._targetEnd), this._boundary.clampPoint(this._targetEnd, this._targetEnd), this._dollyControlAmount = 0;
28100
28097
  }
@@ -29156,12 +29153,12 @@ const gt = class gt {
29156
29153
  const x = Math.PI / 4;
29157
29154
  let y = x * m, T = gt.CIRCLE_SPAN;
29158
29155
  u < 0 && (T = -T, y = -y);
29159
- const w = x * f, b = w + y, S = s.clone().sub(new p.Vector2(Math.cos(w) * d, Math.sin(w) * d));
29160
- if (s = S.clone().add(new p.Vector2(Math.cos(b) * d, Math.sin(b) * d)), o) {
29161
- let E = w;
29156
+ const w = x * f, b = w + y, E = s.clone().sub(new p.Vector2(Math.cos(w) * d, Math.sin(w) * d));
29157
+ if (s = E.clone().add(new p.Vector2(Math.cos(b) * d, Math.sin(b) * d)), o) {
29158
+ let S = w;
29162
29159
  const O = !0;
29163
- for (; O && (E += T, !!Number.isFinite(E)); )
29164
- if (u >= 0 && E < b || u < 0 && E > b) r.push(S.clone().add(new p.Vector2(d * Math.cos(E), d * Math.sin(E))));
29160
+ for (; O && (S += T, !!Number.isFinite(S)); )
29161
+ if (u >= 0 && S < b || u < 0 && S > b) r.push(E.clone().add(new p.Vector2(d * Math.cos(S), d * Math.sin(S))));
29165
29162
  else break;
29166
29163
  r.push(s.clone());
29167
29164
  }
@@ -29173,15 +29170,15 @@ const gt = class gt {
29173
29170
  let w = y & 7;
29174
29171
  w == 0 && (w = 8), u != 0 && w--;
29175
29172
  const b = Math.PI / 4;
29176
- let S = b * w, E = gt.CIRCLE_SPAN, O = 1;
29177
- y < 0 && (E = -E, S = -S, O = -1);
29178
- let C = b * T, v = C + S;
29173
+ let E = b * w, S = gt.CIRCLE_SPAN, O = 1;
29174
+ y < 0 && (S = -S, E = -E, O = -1);
29175
+ let C = b * T, v = C + E;
29179
29176
  C += b * d / 256 * O, v += b * u / 256 * O;
29180
29177
  const M = s.clone().sub(new p.Vector2(x * Math.cos(C), x * Math.sin(C)));
29181
29178
  if (s = M.clone().add(new p.Vector2(x * Math.cos(v), x * Math.sin(v))), o) {
29182
29179
  let _ = C;
29183
29180
  const P = !0;
29184
- for (; P && (_ += E, !!Number.isFinite(_)); )
29181
+ for (; P && (_ += S, !!Number.isFinite(_)); )
29185
29182
  if (y > 0 && _ < v || y < 0 && _ > v) r.push(M.clone().add(new p.Vector2(x * Math.cos(_), x * Math.sin(_))));
29186
29183
  else break;
29187
29184
  r.push(s.clone());
@@ -31790,10 +31787,10 @@ class v0 {
31790
31787
  let x = Math.max(0, f.start), y = Math.min(d.count, f.start + f.count);
31791
31788
  m && (x = Math.max(x, m.indexStart), y = Math.min(y, m.indexStart + m.indexCount));
31792
31789
  for (let T = x, w = y; T < w - 1; T += h) {
31793
- const b = d.getX(T), S = d.getX(T + 1);
31794
- le.fromBufferAttribute(u, b), Oe.fromBufferAttribute(u, S), le.applyMatrix4(l.matrixWorld), Oe.applyMatrix4(l.matrixWorld), !i && (le.setZ(0), Oe.setZ(0));
31795
- const E = this.getOsnapInfoFromSegment(t, le, Oe, s, n, r, a);
31796
- E && (r = this.osnapTypePriorities[E.type], o.push(E));
31790
+ const b = d.getX(T), E = d.getX(T + 1);
31791
+ le.fromBufferAttribute(u, b), Oe.fromBufferAttribute(u, E), le.applyMatrix4(l.matrixWorld), Oe.applyMatrix4(l.matrixWorld), !i && (le.setZ(0), Oe.setZ(0));
31792
+ const S = this.getOsnapInfoFromSegment(t, le, Oe, s, n, r, a);
31793
+ S && (r = this.osnapTypePriorities[S.type], o.push(S));
31797
31794
  }
31798
31795
  } else {
31799
31796
  let x = Math.max(0, f.start), y = Math.min(u.count, f.start + f.count);
@@ -32515,11 +32512,11 @@ class $1 {
32515
32512
  this.raycaster.params.Line.threshold = u, this.setLayerChannels(i);
32516
32513
  const m = 8;
32517
32514
  for (let y = 0; y < m; y++) {
32518
- const T = y / m * Math.PI * 2, w = Math.cos(T) * s, b = Math.sin(T) * s, S = {
32515
+ const T = y / m * Math.PI * 2, w = Math.cos(T) * s, b = Math.sin(T) * s, E = {
32519
32516
  x: t.x + w,
32520
32517
  y: t.y + b
32521
- }, E = Ie.screen2Ndc(S, this.camera, this.viewerContainer);
32522
- this.raycaster.setFromCamera(E, this.camera), this.raycaster.layers.enableAll();
32518
+ }, S = Ie.screen2Ndc(E, this.camera, this.viewerContainer);
32519
+ this.raycaster.setFromCamera(S, this.camera), this.raycaster.layers.enableAll();
32523
32520
  const O = this.raycaster.intersectObjects(e, !0) || [];
32524
32521
  for (const C of O)
32525
32522
  C.object && !a.has(C.object.uuid) && (a.set(C.object.uuid, C), r.push(C));
@@ -32531,8 +32528,8 @@ class $1 {
32531
32528
  if (this.raycaster.params.Line.threshold = f, r.length > 1) {
32532
32529
  const y = this.raycaster.ray.origin.clone();
32533
32530
  r.sort((T, w) => {
32534
- const b = T.point || T.object.getWorldPosition(new p.Vector3()), S = w.point || w.object.getWorldPosition(new p.Vector3());
32535
- return b.distanceTo(y) - S.distanceTo(y);
32531
+ const b = T.point || T.object.getWorldPosition(new p.Vector3()), E = w.point || w.object.getWorldPosition(new p.Vector3());
32532
+ return b.distanceTo(y) - E.distanceTo(y);
32536
32533
  });
32537
32534
  }
32538
32535
  return r;
@@ -33960,8 +33957,8 @@ class Do extends vr {
33960
33957
  y > l && n.setPixelRatio(y), this.cameraManager.update(0), this.dispatchEvent(he.BeforeRender), n.render(this.scene, this.camera), this.dispatchEvent(he.AfterRender);
33961
33958
  const T = n.domElement, w = this.overlayRender.getCanvas(), b = document.createElement("canvas");
33962
33959
  b.width = T.width, b.height = T.height;
33963
- const S = b.getContext("2d");
33964
- if (S.drawImage(T, 0, 0), w && w.width > 0 && w.height > 0 && S.drawImage(w, 0, 0, b.width, b.height), i) {
33960
+ const E = b.getContext("2d");
33961
+ if (E.drawImage(T, 0, 0), w && w.width > 0 && w.height > 0 && E.drawImage(w, 0, 0, b.width, b.height), i) {
33965
33962
  const O = new p.Color(1973806);
33966
33963
  this.scene.background instanceof p.Color ? O.copy(this.scene.background) : n.getClearColor(O), O.convertLinearToSRGB(), this.invertForPrint(b, Math.max(1, Math.round(y / 2)), {
33967
33964
  r: O.r * 255,
@@ -33969,10 +33966,10 @@ class Do extends vr {
33969
33966
  b: O.b * 255
33970
33967
  });
33971
33968
  }
33972
- let E = b.toDataURL("image/png");
33969
+ let S = b.toDataURL("image/png");
33973
33970
  if (h && this.camera.type === "OrthographicCamera") {
33974
33971
  const O = this.cropCanvasToBox(b, h);
33975
- O && (E = O);
33972
+ O && (S = O);
33976
33973
  }
33977
33974
  this._printCaptureMode = !1;
33978
33975
  for (const { object: O, visible: C } of u) O.visible = C;
@@ -33983,7 +33980,7 @@ class Do extends vr {
33983
33980
  a.x,
33984
33981
  a.y,
33985
33982
  a.z
33986
- ), this.cameraManager.update(0), this.enableRender(), E;
33983
+ ), this.cameraManager.update(0), this.enableRender(), S;
33987
33984
  }
33988
33985
  /**
33989
33986
  * Converts a dark-background CAD render to a white-background image for printing
@@ -34023,7 +34020,7 @@ class Do extends vr {
34023
34020
  x[v + M] = _, y[v + M] = l[P * 4], T[v + M] = l[P * 4 + 1], w[v + M] = l[P * 4 + 2];
34024
34021
  }
34025
34022
  }
34026
- const b = new Float32Array(h), S = new Uint8ClampedArray(h), E = new Uint8ClampedArray(h), O = new Uint8ClampedArray(h);
34023
+ const b = new Float32Array(h), E = new Uint8ClampedArray(h), S = new Uint8ClampedArray(h), O = new Uint8ClampedArray(h);
34027
34024
  for (let C = 0; C < r; C++)
34028
34025
  for (let v = 0; v < a; v++) {
34029
34026
  let M = 255, _ = v * r + C;
@@ -34033,10 +34030,10 @@ class Do extends vr {
34033
34030
  D < M && (M = D, _ = k * r + C);
34034
34031
  }
34035
34032
  const B = v * r + C;
34036
- b[B] = M, S[B] = y[_], E[B] = T[_], O[B] = w[_];
34033
+ b[B] = M, E[B] = y[_], S[B] = T[_], O[B] = w[_];
34037
34034
  }
34038
34035
  for (let C = 0, v = 0; C < h; C++, v += 4)
34039
- f[C] > 250 && b[C] < 250 && (l[v] = S[C], l[v + 1] = E[C], l[v + 2] = O[C]);
34036
+ f[C] > 250 && b[C] < 250 && (l[v] = E[C], l[v + 1] = S[C], l[v + 2] = O[C]);
34040
34037
  n.putImageData(o, 0, 0);
34041
34038
  }
34042
34039
  /**
@@ -34046,10 +34043,10 @@ class Do extends vr {
34046
34043
  cropCanvasToBox(e, i) {
34047
34044
  const s = this.camera, n = s.zoom || 1, r = s.position.x, a = s.position.y, o = r + s.left / n, l = r + s.right / n, h = a + s.bottom / n, d = a + s.top / n, u = l - o, f = d - h;
34048
34045
  if (u <= 0 || f <= 0) return;
34049
- const m = (v) => (v - o) / u * e.width, x = (v) => (d - v) / f * e.height, y = Math.max(u, f) * 0.01, T = Math.max(0, Math.floor(m(i.min.x - y))), w = Math.min(e.width, Math.ceil(m(i.max.x + y))), b = Math.max(0, Math.floor(x(i.max.y + y))), S = Math.min(e.height, Math.ceil(x(i.min.y - y))), E = w - T, O = S - b;
34050
- if (E < 16 || O < 16) return;
34046
+ const m = (v) => (v - o) / u * e.width, x = (v) => (d - v) / f * e.height, y = Math.max(u, f) * 0.01, T = Math.max(0, Math.floor(m(i.min.x - y))), w = Math.min(e.width, Math.ceil(m(i.max.x + y))), b = Math.max(0, Math.floor(x(i.max.y + y))), E = Math.min(e.height, Math.ceil(x(i.min.y - y))), S = w - T, O = E - b;
34047
+ if (S < 16 || O < 16) return;
34051
34048
  const C = document.createElement("canvas");
34052
- return C.width = E, C.height = O, C.getContext("2d").drawImage(e, T, b, E, O, 0, 0, E, O), C.toDataURL("image/png");
34049
+ return C.width = S, C.height = O, C.getContext("2d").drawImage(e, T, b, S, O, 0, 0, S, O), C.toDataURL("image/png");
34053
34050
  }
34054
34051
  /**
34055
34052
  * Opens the browser print dialog with the image laid out on the selected paper size,
@@ -34072,15 +34069,15 @@ class Do extends vr {
34072
34069
  x.style.cssText = `position:fixed;left:-20000px;top:0;border:0;visibility:hidden;width:${Math.ceil(f * y)}px;height:${Math.ceil(m * y)}px;`;
34073
34070
  const T = (v) => v.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), w = l ? "max-width:100%;max-height:100%;width:auto;height:auto;" : "width:100%;height:auto;", b = `<!DOCTYPE html><html><head><meta charset="utf-8"><title>${T(d)}</title><style>@page{size:${r} ${a};margin:${h}mm;}html,body{margin:0;padding:0;background:#fff;}body{display:flex;align-items:center;justify-content:center;width:${f - 2 * h}mm;height:${m - 2 * h}mm;overflow:hidden;}img{display:block;${w}}</style></head><body><img src="${i}" alt="${T(d)}"></body></html>`;
34074
34071
  document.body.appendChild(x);
34075
- const S = () => {
34076
- x.contentWindow?.removeEventListener("afterprint", S), setTimeout(() => x.remove(), 100);
34077
- }, E = x.contentDocument;
34078
- E.open(), E.write(b), E.close();
34079
- const O = E.querySelector("img"), C = () => {
34072
+ const E = () => {
34073
+ x.contentWindow?.removeEventListener("afterprint", E), setTimeout(() => x.remove(), 100);
34074
+ }, S = x.contentDocument;
34075
+ S.open(), S.write(b), S.close();
34076
+ const O = S.querySelector("img"), C = () => {
34080
34077
  const v = x.contentWindow;
34081
- v.addEventListener("afterprint", S), v.focus(), v.print(), setTimeout(S, 6e4);
34078
+ v.addEventListener("afterprint", E), v.focus(), v.print(), setTimeout(E, 6e4);
34082
34079
  };
34083
- O.complete ? C() : (O.onload = C, O.onerror = S);
34080
+ O.complete ? C() : (O.onload = C, O.onerror = E);
34084
34081
  }
34085
34082
  /**
34086
34083
  * @description {en} Gets dxf layers.
@@ -34355,11 +34352,11 @@ class tu {
34355
34352
  }, f = (B) => u(B, 0, 15), m = (B) => u(B, 15, 30), x = (B) => u(B, 30, 60), y = (B) => u(B, 60, 95);
34356
34353
  j.printMemory("Before comparing"), this.loadingProgressBar?.addProgressItem(l), d(0);
34357
34354
  let T = Date.now();
34358
- const w = this.loader.parse(n, f), b = this.loader.parse(a, m), [S, E] = await Promise.allSettled([w, b]);
34359
- if (S.status === "rejected") throw "[DxfCompareHelper] Failed to parse " + n;
34360
- if (E.status === "rejected") throw "[DxfCompareHelper] Failed to parse " + a;
34355
+ const w = this.loader.parse(n, f), b = this.loader.parse(a, m), [E, S] = await Promise.allSettled([w, b]);
34356
+ if (E.status === "rejected") throw "[DxfCompareHelper] Failed to parse " + n;
34357
+ if (S.status === "rejected") throw "[DxfCompareHelper] Failed to parse " + a;
34361
34358
  if (A.info("[DxfCompareHelper] loadFiles in " + (Date.now() - T) / 1e3 + "s"), this.loader.isAborted()) throw "[DxfCompareHelper] compare loadFile aborted";
34362
- const O = S.value, C = E.value;
34359
+ const O = E.value, C = S.value;
34363
34360
  T = Date.now();
34364
34361
  const v = await new yt(O, C, i).compare(x);
34365
34362
  if (A.info("[DxfCompareHelper] Compared in " + (Date.now() - T) / 1e3 + "s"), A.debug("[DxfCompareHelper] Compared results:", v), this.loader.isAborted()) throw "[DxfCompareHelper] compare change aborted";
@@ -34522,7 +34519,7 @@ class C0 extends tu {
34522
34519
  }, x = (D) => m(D, 0, 15), y = (D) => m(D, 15, 30), T = (D) => m(D, 30, 60), w = (D) => m(D, 60, 95);
34523
34520
  j.printMemory("Before comparing"), this.loadingProgressBar?.addProgressItem(d), f(0);
34524
34521
  let b = Date.now();
34525
- const S = this.loader.parse(r, x), E = this.loader.parse(o, y), [O, C] = await Promise.allSettled([S, E]);
34522
+ const E = this.loader.parse(r, x), S = this.loader.parse(o, y), [O, C] = await Promise.allSettled([E, S]);
34526
34523
  if (O.status === "rejected") throw "[DxfCompareHelper] Failed to parse " + r;
34527
34524
  if (C.status === "rejected") throw "[DxfCompareHelper] Failed to parse " + o;
34528
34525
  if (A.info("[DxfCompareHelper] loadFiles in " + (Date.now() - b) / 1e3 + "s"), this.loader.isAborted()) throw "[DxfCompareHelper] compare loadFile aborted";