@mlightcad/data-model 1.3.11 → 1.3.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -821,7 +821,7 @@ var Go = { exports: {} };
821
821
  function f(z) {
822
822
  return z === "debug" && (z = "log"), typeof console === e ? !1 : z === "trace" && s ? x : console[z] !== void 0 ? g(console, z) : console.log !== void 0 ? g(console, "log") : t;
823
823
  }
824
- function A() {
824
+ function w() {
825
825
  for (var z = this.getLevel(), D = 0; D < o.length; D++) {
826
826
  var B = o[D];
827
827
  this[B] = D < z ? t : this.methodFactory(B, z, this.name);
@@ -831,7 +831,7 @@ var Go = { exports: {} };
831
831
  }
832
832
  function b(z) {
833
833
  return function() {
834
- typeof console !== e && (A.call(this), this[z].apply(this, arguments));
834
+ typeof console !== e && (w.call(this), this[z].apply(this, arguments));
835
835
  };
836
836
  }
837
837
  function E(z, D, B) {
@@ -900,24 +900,24 @@ var Go = { exports: {} };
900
900
  }, B.methodFactory = D || E, B.getLevel = function() {
901
901
  return ot ?? vt ?? dt;
902
902
  }, B.setLevel = function(bt, Ot) {
903
- return ot = qt(bt), Ot !== !1 && ut(ot), A.call(B);
903
+ return ot = qt(bt), Ot !== !1 && ut(ot), w.call(B);
904
904
  }, B.setDefaultLevel = function(bt) {
905
905
  vt = qt(bt), st() || B.setLevel(bt, !1);
906
906
  }, B.resetLevel = function() {
907
- ot = null, Vt(), A.call(B);
907
+ ot = null, Vt(), w.call(B);
908
908
  }, B.enableAll = function(bt) {
909
909
  B.setLevel(B.levels.TRACE, bt);
910
910
  }, B.disableAll = function(bt) {
911
911
  B.setLevel(B.levels.SILENT, bt);
912
912
  }, B.rebuild = function() {
913
- if (c !== B && (dt = qt(c.getLevel())), A.call(B), c === B)
913
+ if (c !== B && (dt = qt(c.getLevel())), w.call(B), c === B)
914
914
  for (var bt in h)
915
915
  h[bt].rebuild();
916
916
  }, dt = qt(
917
917
  c ? c.getLevel() : "WARN"
918
918
  );
919
919
  var Wt = st();
920
- Wt != null && (ot = qt(Wt)), A.call(B);
920
+ Wt != null && (ot = qt(Wt)), w.call(B);
921
921
  }
922
922
  c = new M(), c.getLogger = function(z) {
923
923
  if (typeof z != "symbol" && typeof z != "string" || z === "")
@@ -928,9 +928,9 @@ var Go = { exports: {} };
928
928
  c.methodFactory
929
929
  )), D;
930
930
  };
931
- var O = typeof window !== e ? window.log : void 0;
931
+ var L = typeof window !== e ? window.log : void 0;
932
932
  return c.noConflict = function() {
933
- return typeof window !== e && window.log === c && (window.log = O), c;
933
+ return typeof window !== e && window.log === c && (window.log = L), c;
934
934
  }, c.getLoggers = function() {
935
935
  return h;
936
936
  }, c.default = c, c;
@@ -1048,9 +1048,9 @@ let eu = class Wo {
1048
1048
  typeof t == "object" ? (o = t, s = e) : (o = {}, o[t] = e), s || (s = {});
1049
1049
  const h = s.unset, c = s.silent, g = [], x = this._changing;
1050
1050
  this._changing = !0, x || (this._previousAttributes = Os(this.attributes), this.changed = {});
1051
- const f = this.attributes, A = this.changed, b = this._previousAttributes;
1051
+ const f = this.attributes, w = this.changed, b = this._previousAttributes;
1052
1052
  for (const E in o)
1053
- e = o[E], Is(f[E], e) || g.push(E), Is(b[E], e) ? delete A[E] : A[E] = e, h ? delete f[E] : f[E] = e;
1053
+ e = o[E], Is(f[E], e) || g.push(E), Is(b[E], e) ? delete w[E] : w[E] = e, h ? delete f[E] : f[E] = e;
1054
1054
  if (!c) {
1055
1055
  g.length && (this._pending = s);
1056
1056
  for (let E = 0; E < g.length; E++)
@@ -1728,19 +1728,26 @@ class on {
1728
1728
  * ```
1729
1729
  */
1730
1730
  draw(t, e, s, o = !0, h, c) {
1731
+ var x;
1731
1732
  const g = [];
1732
1733
  if (e != null) {
1733
- const x = this.createKey(e.name, s);
1734
- let f;
1735
- if (this.has(x))
1736
- f = this.get(x);
1734
+ const f = this.createKey(e.name, s);
1735
+ let w;
1736
+ if (this.has(f))
1737
+ w = this.get(f);
1737
1738
  else {
1738
- const A = e.newIterator();
1739
- for (const b of A)
1740
- b.color.isByBlock && s ? (yo.copy(b.color), b.color.color = s, this.addEntity(b, g, t), b.color.copy(yo)) : this.addEntity(b, g, t);
1741
- f = t.group(g), f && o && this.set(x, f);
1739
+ const b = (x = t.basePoint) == null ? void 0 : x.clone();
1740
+ t.basePoint = void 0;
1741
+ const E = e.newIterator();
1742
+ let M = !0;
1743
+ for (const L of E)
1744
+ if (L.color.isByBlock && s ? (yo.copy(L.color), L.color.color = s, this.addEntity(L, g, t), L.color.copy(yo)) : this.addEntity(L, g, t), M) {
1745
+ const z = g[0];
1746
+ t.basePoint = z.basePoint, M = !1;
1747
+ }
1748
+ w = t.group(g), w && o && this.set(f, w), t.basePoint = b;
1742
1749
  }
1743
- return f && h && (f.applyMatrix(h), c && (c.x != 0 || c.y != 0 || c.z != 1) && (h.setFromExtrusionDirection(c), f.applyMatrix(h))), f;
1750
+ return w && h && (w.applyMatrix(h), c && (c.x != 0 || c.y != 0 || c.z != 1) && (h.setFromExtrusionDirection(c), w.applyMatrix(h))), w;
1744
1751
  } else
1745
1752
  return t.group(g);
1746
1753
  }
@@ -1975,8 +1982,8 @@ class Zo {
1975
1982
  data: { total: 0 },
1976
1983
  format() {
1977
1984
  let f = "";
1978
- return Object.keys(this.data).forEach((A) => {
1979
- A !== "total" && (f += `- ${A}: ${this.data[A]} ms
1985
+ return Object.keys(this.data).forEach((w) => {
1986
+ w !== "total" && (f += `- ${w}: ${this.data[w]} ms
1980
1987
  `);
1981
1988
  }), f += `- total: ${this.data.total} ms`, f;
1982
1989
  }
@@ -2010,8 +2017,8 @@ class Zo {
2010
2017
  step: 5,
2011
2018
  progress: c,
2012
2019
  task: async (f) => {
2013
- const A = this.getFonts(f.model);
2014
- return { model: f.model, data: A };
2020
+ const w = this.getFonts(f.model);
2021
+ return { model: f.model, data: w };
2015
2022
  }
2016
2023
  },
2017
2024
  o
@@ -2230,14 +2237,14 @@ let ca = Symbol();
2230
2237
  function xt(i, t) {
2231
2238
  return (e, s, o) => {
2232
2239
  let h = function(x, f = !1) {
2233
- return x.reduce((A, b) => {
2234
- b.pushContext && A.push({});
2235
- let E = A[A.length - 1];
2240
+ return x.reduce((w, b) => {
2241
+ b.pushContext && w.push({});
2242
+ let E = w[w.length - 1];
2236
2243
  for (let M of typeof b.code == "number" ? [b.code] : b.code) {
2237
- let O = E[M] ?? (E[M] = []);
2238
- b.isMultiple && O.length && f && console.warn(`Snippet ${O[O.length - 1].name} for code(${M}) is shadowed by ${b.name}`), O.push(b);
2244
+ let L = E[M] ?? (E[M] = []);
2245
+ b.isMultiple && L.length && f && console.warn(`Snippet ${L[L.length - 1].name} for code(${M}) is shadowed by ${b.name}`), L.push(b);
2239
2246
  }
2240
- return A;
2247
+ return w;
2241
2248
  }, [{}]);
2242
2249
  }(i, s.debug), c = !1, g = h.length - 1;
2243
2250
  for (; !At(e, 0, "EOF"); ) {
@@ -2246,13 +2253,13 @@ function xt(i, t) {
2246
2253
  var W;
2247
2254
  return ot >= dt && ((W = vt[B]) == null ? void 0 : W.length);
2248
2255
  });
2249
- }(h, e.code, g), f = x == null ? void 0 : x[e.code], A = f == null ? void 0 : f[f.length - 1];
2250
- if (!x || !A) {
2256
+ }(h, e.code, g), f = x == null ? void 0 : x[e.code], w = f == null ? void 0 : f[f.length - 1];
2257
+ if (!x || !w) {
2251
2258
  s.rewind();
2252
2259
  break;
2253
2260
  }
2254
- A.isMultiple || x[e.code].pop();
2255
- let { name: b, parser: E, isMultiple: M, isReducible: O } = A, z = E == null ? void 0 : E(e, s, o);
2261
+ w.isMultiple || x[e.code].pop();
2262
+ let { name: b, parser: E, isMultiple: M, isReducible: L } = w, z = E == null ? void 0 : E(e, s, o);
2256
2263
  if (z === ca) {
2257
2264
  s.rewind();
2258
2265
  break;
@@ -2268,9 +2275,9 @@ function xt(i, t) {
2268
2275
  }
2269
2276
  return [W, Ii(ot[ot.length - 1])];
2270
2277
  }(o, b);
2271
- M && !O ? (Object.prototype.hasOwnProperty.call(D, B) || (D[B] = []), D[B].push(z)) : D[B] = z;
2278
+ M && !L ? (Object.prototype.hasOwnProperty.call(D, B) || (D[B] = []), D[B].push(z)) : D[B] = z;
2272
2279
  }
2273
- A.pushContext && (g -= 1), c = !0, e = s.next();
2280
+ w.pushContext && (g -= 1), c = !0, e = s.next();
2274
2281
  }
2275
2282
  return t && Object.setPrototypeOf(o, t), c;
2276
2283
  };
@@ -3113,25 +3120,25 @@ class Ys {
3113
3120
  x.topBorderVisibility = !!(h.value ?? !0), h = o.next();
3114
3121
  break;
3115
3122
  case 301:
3116
- (function(f, A, b) {
3123
+ (function(f, w, b) {
3117
3124
  for (; b.code !== 304; ) switch (b.code) {
3118
3125
  case 301:
3119
3126
  case 93:
3120
3127
  case 90:
3121
3128
  case 94:
3122
- b = A.next();
3129
+ b = w.next();
3123
3130
  break;
3124
3131
  case 1:
3125
- f.text = b.value, b = A.next();
3132
+ f.text = b.value, b = w.next();
3126
3133
  break;
3127
3134
  case 300:
3128
- f.attrText = b.value, b = A.next();
3135
+ f.attrText = b.value, b = w.next();
3129
3136
  break;
3130
3137
  case 302:
3131
- f.text = b.value ? b.value : f.text, b = A.next();
3138
+ f.text = b.value ? b.value : f.text, b = w.next();
3132
3139
  break;
3133
3140
  default:
3134
- console.log(`Ignore code: ${b.code}, value: ${b.value}`), b = A.next();
3141
+ console.log(`Ignore code: ${b.code}, value: ${b.value}`), b = w.next();
3135
3142
  }
3136
3143
  })(x, o, h), h = o.next();
3137
3144
  break;
@@ -3745,7 +3752,7 @@ class Xc {
3745
3752
  * @param buffer The ArrayBuffer containing DXF file content.
3746
3753
  */
3747
3754
  getDxfInfoFromBuffer(t) {
3748
- var f, A, b;
3755
+ var f, w, b;
3749
3756
  const s = new TextDecoder("utf-8");
3750
3757
  let o = 0, h = "", c = null, g = null, x = !1;
3751
3758
  for (; o < t.byteLength; ) {
@@ -3760,7 +3767,7 @@ class Xc {
3760
3767
  else if (B === "ENDSEC" && x)
3761
3768
  return { version: c, encoding: g };
3762
3769
  if (x && B === "$ACADVER") {
3763
- const dt = (A = z[D + 2]) == null ? void 0 : A.trim();
3770
+ const dt = (w = z[D + 2]) == null ? void 0 : w.trim();
3764
3771
  dt && (c = new Li(dt));
3765
3772
  } else if (x && B === "$DWGCODEPAGE") {
3766
3773
  const dt = (b = z[D + 2]) == null ? void 0 : b.trim();
@@ -4670,8 +4677,8 @@ const zi = class mh {
4670
4677
  * @returns Return this matrix
4671
4678
  */
4672
4679
  set(t, e, s, o, h, c, g, x, f) {
4673
- const A = this.elements;
4674
- return A[0] = t, A[1] = o, A[2] = g, A[3] = e, A[4] = h, A[5] = x, A[6] = s, A[7] = c, A[8] = f, this;
4680
+ const w = this.elements;
4681
+ return w[0] = t, w[1] = o, w[2] = g, w[3] = e, w[4] = h, w[5] = x, w[6] = s, w[7] = c, w[8] = f, this;
4675
4682
  }
4676
4683
  /**
4677
4684
  * Reset this matrix to the 3x3 identity matrix:
@@ -4731,8 +4738,8 @@ const zi = class mh {
4731
4738
  * @returns Return this matrix
4732
4739
  */
4733
4740
  multiplyMatrices(t, e) {
4734
- const s = t.elements, o = e.elements, h = this.elements, c = s[0], g = s[3], x = s[6], f = s[1], A = s[4], b = s[7], E = s[2], M = s[5], O = s[8], z = o[0], D = o[3], B = o[6], dt = o[1], vt = o[4], ot = o[7], W = o[2], ut = o[5], st = o[8];
4735
- return h[0] = c * z + g * dt + x * W, h[3] = c * D + g * vt + x * ut, h[6] = c * B + g * ot + x * st, h[1] = f * z + A * dt + b * W, h[4] = f * D + A * vt + b * ut, h[7] = f * B + A * ot + b * st, h[2] = E * z + M * dt + O * W, h[5] = E * D + M * vt + O * ut, h[8] = E * B + M * ot + O * st, this;
4741
+ const s = t.elements, o = e.elements, h = this.elements, c = s[0], g = s[3], x = s[6], f = s[1], w = s[4], b = s[7], E = s[2], M = s[5], L = s[8], z = o[0], D = o[3], B = o[6], dt = o[1], vt = o[4], ot = o[7], W = o[2], ut = o[5], st = o[8];
4742
+ return h[0] = c * z + g * dt + x * W, h[3] = c * D + g * vt + x * ut, h[6] = c * B + g * ot + x * st, h[1] = f * z + w * dt + b * W, h[4] = f * D + w * vt + b * ut, h[7] = f * B + w * ot + b * st, h[2] = E * z + M * dt + L * W, h[5] = E * D + M * vt + L * ut, h[8] = E * B + M * ot + L * st, this;
4736
4743
  }
4737
4744
  /**
4738
4745
  * Multiply every component of the matrix by the scalar value s.
@@ -4748,8 +4755,8 @@ const zi = class mh {
4748
4755
  * @returns Return the determinant of this matrix
4749
4756
  */
4750
4757
  determinant() {
4751
- const t = this.elements, e = t[0], s = t[1], o = t[2], h = t[3], c = t[4], g = t[5], x = t[6], f = t[7], A = t[8];
4752
- return e * c * A - e * g * f - s * h * A + s * g * x + o * h * f - o * c * x;
4758
+ const t = this.elements, e = t[0], s = t[1], o = t[2], h = t[3], c = t[4], g = t[5], x = t[6], f = t[7], w = t[8];
4759
+ return e * c * w - e * g * f - s * h * w + s * g * x + o * h * f - o * c * x;
4753
4760
  }
4754
4761
  /**
4755
4762
  * Invert this matrix, using the analytic method. You can not invert with a determinant of zero.
@@ -4757,10 +4764,10 @@ const zi = class mh {
4757
4764
  * @returns Return this matrix
4758
4765
  */
4759
4766
  invert() {
4760
- const t = this.elements, e = t[0], s = t[1], o = t[2], h = t[3], c = t[4], g = t[5], x = t[6], f = t[7], A = t[8], b = A * c - g * f, E = g * x - A * h, M = f * h - c * x, O = e * b + s * E + o * M;
4761
- if (O === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0);
4762
- const z = 1 / O;
4763
- return t[0] = b * z, t[1] = (o * f - A * s) * z, t[2] = (g * s - o * c) * z, t[3] = E * z, t[4] = (A * e - o * x) * z, t[5] = (o * h - g * e) * z, t[6] = M * z, t[7] = (s * x - f * e) * z, t[8] = (c * e - s * h) * z, this;
4767
+ const t = this.elements, e = t[0], s = t[1], o = t[2], h = t[3], c = t[4], g = t[5], x = t[6], f = t[7], w = t[8], b = w * c - g * f, E = g * x - w * h, M = f * h - c * x, L = e * b + s * E + o * M;
4768
+ if (L === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0);
4769
+ const z = 1 / L;
4770
+ return t[0] = b * z, t[1] = (o * f - w * s) * z, t[2] = (g * s - o * c) * z, t[3] = E * z, t[4] = (w * e - o * x) * z, t[5] = (o * h - g * e) * z, t[6] = M * z, t[7] = (s * x - f * e) * z, t[8] = (c * e - s * h) * z, this;
4764
4771
  }
4765
4772
  /**
4766
4773
  * Transpose this matrix in place.
@@ -4993,9 +5000,9 @@ function _h(i, t, e = !1) {
4993
5000
  let h = !1;
4994
5001
  const c = t.length;
4995
5002
  for (let g = 0, x = c - 1; g < c; x = g++) {
4996
- const f = t[g].x, A = t[g].y, b = t[x].x, E = t[x].y;
4997
- let M = A > o != E > o;
4998
- e && (M = A >= o != E >= o), M && s < (b - f) * (o - A) / (E - A) + f && (h = !h);
5003
+ const f = t[g].x, w = t[g].y, b = t[x].x, E = t[x].y;
5004
+ let M = w > o != E > o;
5005
+ e && (M = w >= o != E >= o), M && s < (b - f) * (o - w) / (E - w) + f && (h = !h);
4999
5006
  }
5000
5007
  return h;
5001
5008
  }
@@ -5030,7 +5037,7 @@ function _d(i, t) {
5030
5037
  const e = t.length - 1, s = i, o = [0];
5031
5038
  let h = 0;
5032
5039
  for (let g = 1; g <= e; g++) {
5033
- const x = t[g][0] - t[g - 1][0], f = t[g][1] - t[g - 1][1], A = t[g][2] - t[g - 1][2], b = Math.sqrt(x * x + f * f + A * A);
5040
+ const x = t[g][0] - t[g - 1][0], f = t[g][1] - t[g - 1][1], w = t[g][2] - t[g - 1][2], b = Math.sqrt(x * x + f * f + w * w);
5034
5041
  h += b, o.push(h);
5035
5042
  }
5036
5043
  const c = [];
@@ -5048,7 +5055,7 @@ function vd(i, t) {
5048
5055
  const e = t.length - 1, s = i, o = [0];
5049
5056
  let h = 0;
5050
5057
  for (let g = 1; g <= e; g++) {
5051
- const x = t[g][0] - t[g - 1][0], f = t[g][1] - t[g - 1][1], A = t[g][2] - t[g - 1][2], b = Math.sqrt(x * x + f * f + A * A), E = Math.sqrt(b);
5058
+ const x = t[g][0] - t[g - 1][0], f = t[g][1] - t[g - 1][1], w = t[g][2] - t[g - 1][2], b = Math.sqrt(x * x + f * f + w * w), E = Math.sqrt(b);
5052
5059
  h += E, o.push(h);
5053
5060
  }
5054
5061
  const c = [];
@@ -5077,7 +5084,7 @@ function Ks(i, t, e, s, o) {
5077
5084
  const g = [0, 0, 0];
5078
5085
  let x = 0;
5079
5086
  for (let f = 0; f <= h; f++) {
5080
- const A = Ri(f, c, i, e), b = o[f] * A;
5087
+ const w = Ri(f, c, i, e), b = o[f] * w;
5081
5088
  g[0] += s[f][0] * b, g[1] += s[f][1] * b, g[2] += s[f][2] * b, x += b;
5082
5089
  }
5083
5090
  if (x < 1e-10) {
@@ -5093,7 +5100,7 @@ function yd(i, t, e, s) {
5093
5100
  const o = i, h = t[o], c = t[t.length - o - 1];
5094
5101
  let g = 0;
5095
5102
  const x = 1e3, f = (c - h) / x;
5096
- let A = Ks(
5103
+ let w = Ks(
5097
5104
  h,
5098
5105
  i,
5099
5106
  t,
@@ -5101,8 +5108,8 @@ function yd(i, t, e, s) {
5101
5108
  s
5102
5109
  );
5103
5110
  for (let z = 1; z <= x; z++) {
5104
- const D = h + z * f, B = Ks(D, i, t, e, s), dt = B[0] - A[0], vt = B[1] - A[1], ot = B[2] - A[2];
5105
- g += Math.sqrt(dt * dt + vt * vt + ot * ot), A = B;
5111
+ const D = h + z * f, B = Ks(D, i, t, e, s), dt = B[0] - w[0], vt = B[1] - w[1], ot = B[2] - w[2];
5112
+ g += Math.sqrt(dt * dt + vt * vt + ot * ot), w = B;
5106
5113
  }
5107
5114
  const b = Ks(
5108
5115
  c,
@@ -5110,8 +5117,8 @@ function yd(i, t, e, s) {
5110
5117
  t,
5111
5118
  e,
5112
5119
  s
5113
- ), E = b[0] - A[0], M = b[1] - A[1], O = b[2] - A[2];
5114
- return g += Math.sqrt(E * E + M * M + O * O), g;
5120
+ ), E = b[0] - w[0], M = b[1] - w[1], L = b[2] - w[2];
5121
+ return g += Math.sqrt(E * E + M * M + L * L), g;
5115
5122
  }
5116
5123
  function I0(i) {
5117
5124
  return i.map((t) => [...t]);
@@ -5138,30 +5145,30 @@ class un {
5138
5145
  * @param t Input normalized interpolation factor (between 0 and 1).
5139
5146
  */
5140
5147
  static slerpFlat(t, e, s, o, h, c, g) {
5141
- let x = s[o + 0], f = s[o + 1], A = s[o + 2], b = s[o + 3];
5142
- const E = h[c + 0], M = h[c + 1], O = h[c + 2], z = h[c + 3];
5148
+ let x = s[o + 0], f = s[o + 1], w = s[o + 2], b = s[o + 3];
5149
+ const E = h[c + 0], M = h[c + 1], L = h[c + 2], z = h[c + 3];
5143
5150
  if (g === 0) {
5144
- t[e + 0] = x, t[e + 1] = f, t[e + 2] = A, t[e + 3] = b;
5151
+ t[e + 0] = x, t[e + 1] = f, t[e + 2] = w, t[e + 3] = b;
5145
5152
  return;
5146
5153
  }
5147
5154
  if (g === 1) {
5148
- t[e + 0] = E, t[e + 1] = M, t[e + 2] = O, t[e + 3] = z;
5155
+ t[e + 0] = E, t[e + 1] = M, t[e + 2] = L, t[e + 3] = z;
5149
5156
  return;
5150
5157
  }
5151
- if (b !== z || x !== E || f !== M || A !== O) {
5158
+ if (b !== z || x !== E || f !== M || w !== L) {
5152
5159
  let D = 1 - g;
5153
- const B = x * E + f * M + A * O + b * z, dt = B >= 0 ? 1 : -1, vt = 1 - B * B;
5160
+ const B = x * E + f * M + w * L + b * z, dt = B >= 0 ? 1 : -1, vt = 1 - B * B;
5154
5161
  if (vt > Number.EPSILON) {
5155
5162
  const W = Math.sqrt(vt), ut = Math.atan2(W, B * dt);
5156
5163
  D = Math.sin(D * ut) / W, g = Math.sin(g * ut) / W;
5157
5164
  }
5158
5165
  const ot = g * dt;
5159
- if (x = x * D + E * ot, f = f * D + M * ot, A = A * D + O * ot, b = b * D + z * ot, D === 1 - g) {
5160
- const W = 1 / Math.sqrt(x * x + f * f + A * A + b * b);
5161
- x *= W, f *= W, A *= W, b *= W;
5166
+ if (x = x * D + E * ot, f = f * D + M * ot, w = w * D + L * ot, b = b * D + z * ot, D === 1 - g) {
5167
+ const W = 1 / Math.sqrt(x * x + f * f + w * w + b * b);
5168
+ x *= W, f *= W, w *= W, b *= W;
5162
5169
  }
5163
5170
  }
5164
- t[e] = x, t[e + 1] = f, t[e + 2] = A, t[e + 3] = b;
5171
+ t[e] = x, t[e + 1] = f, t[e + 2] = w, t[e + 3] = b;
5165
5172
  }
5166
5173
  /**
5167
5174
  * This multiplication implementation assumes the quaternion data are managed in flat arrays.
@@ -5174,8 +5181,8 @@ class un {
5174
5181
  * @returns Return an array
5175
5182
  */
5176
5183
  static multiplyQuaternionsFlat(t, e, s, o, h, c) {
5177
- const g = s[o], x = s[o + 1], f = s[o + 2], A = s[o + 3], b = h[c], E = h[c + 1], M = h[c + 2], O = h[c + 3];
5178
- return t[e] = g * O + A * b + x * M - f * E, t[e + 1] = x * O + A * E + f * b - g * M, t[e + 2] = f * O + A * M + g * E - x * b, t[e + 3] = A * O - g * b - x * E - f * M, t;
5184
+ const g = s[o], x = s[o + 1], f = s[o + 2], w = s[o + 3], b = h[c], E = h[c + 1], M = h[c + 2], L = h[c + 3];
5185
+ return t[e] = g * L + w * b + x * M - f * E, t[e + 1] = x * L + w * E + f * b - g * M, t[e + 2] = f * L + w * M + g * E - x * b, t[e + 3] = w * L - g * b - x * E - f * M, t;
5179
5186
  }
5180
5187
  /**
5181
5188
  * X cooridinate
@@ -5246,25 +5253,25 @@ class un {
5246
5253
  * @returns Return this quaternion
5247
5254
  */
5248
5255
  setFromEuler(t, e = !0) {
5249
- const s = t.x, o = t.y, h = t.z, c = t.order, g = Math.cos, x = Math.sin, f = g(s / 2), A = g(o / 2), b = g(h / 2), E = x(s / 2), M = x(o / 2), O = x(h / 2);
5256
+ const s = t.x, o = t.y, h = t.z, c = t.order, g = Math.cos, x = Math.sin, f = g(s / 2), w = g(o / 2), b = g(h / 2), E = x(s / 2), M = x(o / 2), L = x(h / 2);
5250
5257
  switch (c) {
5251
5258
  case "XYZ":
5252
- this._x = E * A * b + f * M * O, this._y = f * M * b - E * A * O, this._z = f * A * O + E * M * b, this._w = f * A * b - E * M * O;
5259
+ this._x = E * w * b + f * M * L, this._y = f * M * b - E * w * L, this._z = f * w * L + E * M * b, this._w = f * w * b - E * M * L;
5253
5260
  break;
5254
5261
  case "YXZ":
5255
- this._x = E * A * b + f * M * O, this._y = f * M * b - E * A * O, this._z = f * A * O - E * M * b, this._w = f * A * b + E * M * O;
5262
+ this._x = E * w * b + f * M * L, this._y = f * M * b - E * w * L, this._z = f * w * L - E * M * b, this._w = f * w * b + E * M * L;
5256
5263
  break;
5257
5264
  case "ZXY":
5258
- this._x = E * A * b - f * M * O, this._y = f * M * b + E * A * O, this._z = f * A * O + E * M * b, this._w = f * A * b - E * M * O;
5265
+ this._x = E * w * b - f * M * L, this._y = f * M * b + E * w * L, this._z = f * w * L + E * M * b, this._w = f * w * b - E * M * L;
5259
5266
  break;
5260
5267
  case "ZYX":
5261
- this._x = E * A * b - f * M * O, this._y = f * M * b + E * A * O, this._z = f * A * O - E * M * b, this._w = f * A * b + E * M * O;
5268
+ this._x = E * w * b - f * M * L, this._y = f * M * b + E * w * L, this._z = f * w * L - E * M * b, this._w = f * w * b + E * M * L;
5262
5269
  break;
5263
5270
  case "YZX":
5264
- this._x = E * A * b + f * M * O, this._y = f * M * b + E * A * O, this._z = f * A * O - E * M * b, this._w = f * A * b - E * M * O;
5271
+ this._x = E * w * b + f * M * L, this._y = f * M * b + E * w * L, this._z = f * w * L - E * M * b, this._w = f * w * b - E * M * L;
5265
5272
  break;
5266
5273
  case "XZY":
5267
- this._x = E * A * b - f * M * O, this._y = f * M * b - E * A * O, this._z = f * A * O + E * M * b, this._w = f * A * b + E * M * O;
5274
+ this._x = E * w * b - f * M * L, this._y = f * M * b - E * w * L, this._z = f * w * L + E * M * b, this._w = f * w * b + E * M * L;
5268
5275
  break;
5269
5276
  default:
5270
5277
  console.warn(
@@ -5290,19 +5297,19 @@ class un {
5290
5297
  * @returns Return this quaternion
5291
5298
  */
5292
5299
  setFromRotationMatrix(t) {
5293
- const e = t.elements, s = e[0], o = e[4], h = e[8], c = e[1], g = e[5], x = e[9], f = e[2], A = e[6], b = e[10], E = s + g + b;
5300
+ const e = t.elements, s = e[0], o = e[4], h = e[8], c = e[1], g = e[5], x = e[9], f = e[2], w = e[6], b = e[10], E = s + g + b;
5294
5301
  if (E > 0) {
5295
5302
  const M = 0.5 / Math.sqrt(E + 1);
5296
- this._w = 0.25 / M, this._x = (A - x) * M, this._y = (h - f) * M, this._z = (c - o) * M;
5303
+ this._w = 0.25 / M, this._x = (w - x) * M, this._y = (h - f) * M, this._z = (c - o) * M;
5297
5304
  } else if (s > g && s > b) {
5298
5305
  const M = 2 * Math.sqrt(1 + s - g - b);
5299
- this._w = (A - x) / M, this._x = 0.25 * M, this._y = (o + c) / M, this._z = (h + f) / M;
5306
+ this._w = (w - x) / M, this._x = 0.25 * M, this._y = (o + c) / M, this._z = (h + f) / M;
5300
5307
  } else if (g > b) {
5301
5308
  const M = 2 * Math.sqrt(1 + g - s - b);
5302
- this._w = (h - f) / M, this._x = (o + c) / M, this._y = 0.25 * M, this._z = (x + A) / M;
5309
+ this._w = (h - f) / M, this._x = (o + c) / M, this._y = 0.25 * M, this._z = (x + w) / M;
5303
5310
  } else {
5304
5311
  const M = 2 * Math.sqrt(1 + b - s - g);
5305
- this._w = (c - o) / M, this._x = (h + f) / M, this._y = (x + A) / M, this._z = 0.25 * M;
5312
+ this._w = (c - o) / M, this._x = (h + f) / M, this._y = (x + w) / M, this._z = 0.25 * M;
5306
5313
  }
5307
5314
  return this._onChangeCallback(), this;
5308
5315
  }
@@ -5419,8 +5426,8 @@ class un {
5419
5426
  * @returns Return this quaternion
5420
5427
  */
5421
5428
  multiplyQuaternions(t, e) {
5422
- const s = t._x, o = t._y, h = t._z, c = t._w, g = e._x, x = e._y, f = e._z, A = e._w;
5423
- return this._x = s * A + c * g + o * f - h * x, this._y = o * A + c * x + h * g - s * f, this._z = h * A + c * f + s * x - o * g, this._w = c * A - s * g - o * x - h * f, this._onChangeCallback(), this;
5429
+ const s = t._x, o = t._y, h = t._z, c = t._w, g = e._x, x = e._y, f = e._z, w = e._w;
5430
+ return this._x = s * w + c * g + o * f - h * x, this._y = o * w + c * x + h * g - s * f, this._z = h * w + c * f + s * x - o * g, this._w = c * w - s * g - o * x - h * f, this._onChangeCallback(), this;
5424
5431
  }
5425
5432
  /**
5426
5433
  * Handles the spherical linear interpolation between quaternions. t represents the amount of rotation
@@ -5441,7 +5448,7 @@ class un {
5441
5448
  const M = 1 - e;
5442
5449
  return this._w = M * c + e * this._w, this._x = M * s + e * this._x, this._y = M * o + e * this._y, this._z = M * h + e * this._z, this.normalize(), this;
5443
5450
  }
5444
- const f = Math.sqrt(x), A = Math.atan2(f, g), b = Math.sin((1 - e) * A) / f, E = Math.sin(e * A) / f;
5451
+ const f = Math.sqrt(x), w = Math.atan2(f, g), b = Math.sin((1 - e) * w) / f, E = Math.sin(e * w) / f;
5445
5452
  return this._w = c * b + this._w * E, this._x = s * b + this._x * E, this._y = o * b + this._y * E, this._z = h * b + this._z * E, this._onChangeCallback(), this;
5446
5453
  }
5447
5454
  /**
@@ -5767,8 +5774,8 @@ const Ve = class vh {
5767
5774
  * @returns Return this vector
5768
5775
  */
5769
5776
  applyQuaternion(t) {
5770
- const e = this.x, s = this.y, o = this.z, h = t.x, c = t.y, g = t.z, x = t.w, f = 2 * (c * o - g * s), A = 2 * (g * e - h * o), b = 2 * (h * s - c * e);
5771
- return this.x = e + x * f + c * b - g * A, this.y = s + x * A + g * f - h * b, this.z = o + x * b + h * A - c * f, this;
5777
+ const e = this.x, s = this.y, o = this.z, h = t.x, c = t.y, g = t.z, x = t.w, f = 2 * (c * o - g * s), w = 2 * (g * e - h * o), b = 2 * (h * s - c * e);
5778
+ return this.x = e + x * f + c * b - g * w, this.y = s + x * w + g * f - h * b, this.z = o + x * b + h * w - c * f, this;
5772
5779
  }
5773
5780
  /**
5774
5781
  * Transforms the direction of this vector by a matrix (the upper left 3 x 3 subset of a m) and
@@ -6173,8 +6180,8 @@ const Ei = /* @__PURE__ */ new Z(), Eo = /* @__PURE__ */ new un(), Fi = class yh
6173
6180
  * @param n43 Input element in the forth row and the third column
6174
6181
  * @param n44 Input element in the forth row and the forth column
6175
6182
  */
6176
- constructor(t, e, s, o, h, c, g, x, f, A, b, E, M, O, z, D) {
6177
- this.elements = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], t != null && e != null && s != null && o != null && h != null && c != null && g != null && x != null && f != null && A != null && b != null && E != null && M != null && O != null && z != null && D != null && this.set(
6183
+ constructor(t, e, s, o, h, c, g, x, f, w, b, E, M, L, z, D) {
6184
+ this.elements = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], t != null && e != null && s != null && o != null && h != null && c != null && g != null && x != null && f != null && w != null && b != null && E != null && M != null && L != null && z != null && D != null && this.set(
6178
6185
  t,
6179
6186
  e,
6180
6187
  s,
@@ -6184,11 +6191,11 @@ const Ei = /* @__PURE__ */ new Z(), Eo = /* @__PURE__ */ new un(), Fi = class yh
6184
6191
  g,
6185
6192
  x,
6186
6193
  f,
6187
- A,
6194
+ w,
6188
6195
  b,
6189
6196
  E,
6190
6197
  M,
6191
- O,
6198
+ L,
6192
6199
  z,
6193
6200
  D
6194
6201
  );
@@ -6214,9 +6221,9 @@ const Ei = /* @__PURE__ */ new Z(), Eo = /* @__PURE__ */ new un(), Fi = class yh
6214
6221
  * @param n44 Input element in the forth row and the forth column
6215
6222
  * @returns Return this matrix
6216
6223
  */
6217
- set(t, e, s, o, h, c, g, x, f, A, b, E, M, O, z, D) {
6224
+ set(t, e, s, o, h, c, g, x, f, w, b, E, M, L, z, D) {
6218
6225
  const B = this.elements;
6219
- return B[0] = t, B[4] = e, B[8] = s, B[12] = o, B[1] = h, B[5] = c, B[9] = g, B[13] = x, B[2] = f, B[6] = A, B[10] = b, B[14] = E, B[3] = M, B[7] = O, B[11] = z, B[15] = D, this;
6226
+ return B[0] = t, B[4] = e, B[8] = s, B[12] = o, B[1] = h, B[5] = c, B[9] = g, B[13] = x, B[2] = f, B[6] = w, B[10] = b, B[14] = E, B[3] = M, B[7] = L, B[11] = z, B[15] = D, this;
6220
6227
  }
6221
6228
  /**
6222
6229
  * Reset this matrix to the identity matrix.
@@ -6500,8 +6507,8 @@ const Ei = /* @__PURE__ */ new Z(), Eo = /* @__PURE__ */ new un(), Fi = class yh
6500
6507
  * @returns Return this matrix
6501
6508
  */
6502
6509
  multiplyMatrices(t, e) {
6503
- const s = t.elements, o = e.elements, h = this.elements, c = s[0], g = s[4], x = s[8], f = s[12], A = s[1], b = s[5], E = s[9], M = s[13], O = s[2], z = s[6], D = s[10], B = s[14], dt = s[3], vt = s[7], ot = s[11], W = s[15], ut = o[0], st = o[4], Vt = o[8], qt = o[12], Wt = o[1], bt = o[5], Ot = o[9], de = o[13], me = o[2], Me = o[6], Jt = o[10], ie = o[14], Q = o[3], Mt = o[7], ae = o[11], hr = o[15];
6504
- return h[0] = c * ut + g * Wt + x * me + f * Q, h[4] = c * st + g * bt + x * Me + f * Mt, h[8] = c * Vt + g * Ot + x * Jt + f * ae, h[12] = c * qt + g * de + x * ie + f * hr, h[1] = A * ut + b * Wt + E * me + M * Q, h[5] = A * st + b * bt + E * Me + M * Mt, h[9] = A * Vt + b * Ot + E * Jt + M * ae, h[13] = A * qt + b * de + E * ie + M * hr, h[2] = O * ut + z * Wt + D * me + B * Q, h[6] = O * st + z * bt + D * Me + B * Mt, h[10] = O * Vt + z * Ot + D * Jt + B * ae, h[14] = O * qt + z * de + D * ie + B * hr, h[3] = dt * ut + vt * Wt + ot * me + W * Q, h[7] = dt * st + vt * bt + ot * Me + W * Mt, h[11] = dt * Vt + vt * Ot + ot * Jt + W * ae, h[15] = dt * qt + vt * de + ot * ie + W * hr, this;
6510
+ const s = t.elements, o = e.elements, h = this.elements, c = s[0], g = s[4], x = s[8], f = s[12], w = s[1], b = s[5], E = s[9], M = s[13], L = s[2], z = s[6], D = s[10], B = s[14], dt = s[3], vt = s[7], ot = s[11], W = s[15], ut = o[0], st = o[4], Vt = o[8], qt = o[12], Wt = o[1], bt = o[5], Ot = o[9], de = o[13], me = o[2], Me = o[6], Jt = o[10], ie = o[14], Q = o[3], Mt = o[7], ae = o[11], hr = o[15];
6511
+ return h[0] = c * ut + g * Wt + x * me + f * Q, h[4] = c * st + g * bt + x * Me + f * Mt, h[8] = c * Vt + g * Ot + x * Jt + f * ae, h[12] = c * qt + g * de + x * ie + f * hr, h[1] = w * ut + b * Wt + E * me + M * Q, h[5] = w * st + b * bt + E * Me + M * Mt, h[9] = w * Vt + b * Ot + E * Jt + M * ae, h[13] = w * qt + b * de + E * ie + M * hr, h[2] = L * ut + z * Wt + D * me + B * Q, h[6] = L * st + z * bt + D * Me + B * Mt, h[10] = L * Vt + z * Ot + D * Jt + B * ae, h[14] = L * qt + z * de + D * ie + B * hr, h[3] = dt * ut + vt * Wt + ot * me + W * Q, h[7] = dt * st + vt * bt + ot * Me + W * Mt, h[11] = dt * Vt + vt * Ot + ot * Jt + W * ae, h[15] = dt * qt + vt * de + ot * ie + W * hr, this;
6505
6512
  }
6506
6513
  /**
6507
6514
  * Multiply every component of the matrix by a scalar value s.
@@ -6517,8 +6524,8 @@ const Ei = /* @__PURE__ */ new Z(), Eo = /* @__PURE__ */ new un(), Fi = class yh
6517
6524
  * @returns Return the determinant of this matrix.
6518
6525
  */
6519
6526
  determinant() {
6520
- const t = this.elements, e = t[0], s = t[4], o = t[8], h = t[12], c = t[1], g = t[5], x = t[9], f = t[13], A = t[2], b = t[6], E = t[10], M = t[14], O = t[3], z = t[7], D = t[11], B = t[15];
6521
- return O * (+h * x * b - o * f * b - h * g * E + s * f * E + o * g * M - s * x * M) + z * (+e * x * M - e * f * E + h * c * E - o * c * M + o * f * A - h * x * A) + D * (+e * f * b - e * g * M - h * c * b + s * c * M + h * g * A - s * f * A) + B * (-o * g * A - e * x * b + e * g * E + o * c * b - s * c * E + s * x * A);
6527
+ const t = this.elements, e = t[0], s = t[4], o = t[8], h = t[12], c = t[1], g = t[5], x = t[9], f = t[13], w = t[2], b = t[6], E = t[10], M = t[14], L = t[3], z = t[7], D = t[11], B = t[15];
6528
+ return L * (+h * x * b - o * f * b - h * g * E + s * f * E + o * g * M - s * x * M) + z * (+e * x * M - e * f * E + h * c * E - o * c * M + o * f * w - h * x * w) + D * (+e * f * b - e * g * M - h * c * b + s * c * M + h * g * w - s * f * w) + B * (-o * g * w - e * x * b + e * g * E + o * c * b - s * c * E + s * x * w);
6522
6529
  }
6523
6530
  /**
6524
6531
  * Transposes this matrix.
@@ -6546,11 +6553,11 @@ const Ei = /* @__PURE__ */ new Z(), Eo = /* @__PURE__ */ new un(), Fi = class yh
6546
6553
  * @returns Return this matrix
6547
6554
  */
6548
6555
  invert() {
6549
- const t = this.elements, e = t[0], s = t[1], o = t[2], h = t[3], c = t[4], g = t[5], x = t[6], f = t[7], A = t[8], b = t[9], E = t[10], M = t[11], O = t[12], z = t[13], D = t[14], B = t[15], dt = b * D * f - z * E * f + z * x * M - g * D * M - b * x * B + g * E * B, vt = O * E * f - A * D * f - O * x * M + c * D * M + A * x * B - c * E * B, ot = A * z * f - O * b * f + O * g * M - c * z * M - A * g * B + c * b * B, W = O * b * x - A * z * x - O * g * E + c * z * E + A * g * D - c * b * D, ut = e * dt + s * vt + o * ot + h * W;
6556
+ const t = this.elements, e = t[0], s = t[1], o = t[2], h = t[3], c = t[4], g = t[5], x = t[6], f = t[7], w = t[8], b = t[9], E = t[10], M = t[11], L = t[12], z = t[13], D = t[14], B = t[15], dt = b * D * f - z * E * f + z * x * M - g * D * M - b * x * B + g * E * B, vt = L * E * f - w * D * f - L * x * M + c * D * M + w * x * B - c * E * B, ot = w * z * f - L * b * f + L * g * M - c * z * M - w * g * B + c * b * B, W = L * b * x - w * z * x - L * g * E + c * z * E + w * g * D - c * b * D, ut = e * dt + s * vt + o * ot + h * W;
6550
6557
  if (ut === 0)
6551
6558
  return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
6552
6559
  const st = 1 / ut;
6553
- return t[0] = dt * st, t[1] = (z * E * h - b * D * h - z * o * M + s * D * M + b * o * B - s * E * B) * st, t[2] = (g * D * h - z * x * h + z * o * f - s * D * f - g * o * B + s * x * B) * st, t[3] = (b * x * h - g * E * h - b * o * f + s * E * f + g * o * M - s * x * M) * st, t[4] = vt * st, t[5] = (A * D * h - O * E * h + O * o * M - e * D * M - A * o * B + e * E * B) * st, t[6] = (O * x * h - c * D * h - O * o * f + e * D * f + c * o * B - e * x * B) * st, t[7] = (c * E * h - A * x * h + A * o * f - e * E * f - c * o * M + e * x * M) * st, t[8] = ot * st, t[9] = (O * b * h - A * z * h - O * s * M + e * z * M + A * s * B - e * b * B) * st, t[10] = (c * z * h - O * g * h + O * s * f - e * z * f - c * s * B + e * g * B) * st, t[11] = (A * g * h - c * b * h - A * s * f + e * b * f + c * s * M - e * g * M) * st, t[12] = W * st, t[13] = (A * z * o - O * b * o + O * s * E - e * z * E - A * s * D + e * b * D) * st, t[14] = (O * g * o - c * z * o - O * s * x + e * z * x + c * s * D - e * g * D) * st, t[15] = (c * b * o - A * g * o + A * s * x - e * b * x - c * s * E + e * g * E) * st, this;
6560
+ return t[0] = dt * st, t[1] = (z * E * h - b * D * h - z * o * M + s * D * M + b * o * B - s * E * B) * st, t[2] = (g * D * h - z * x * h + z * o * f - s * D * f - g * o * B + s * x * B) * st, t[3] = (b * x * h - g * E * h - b * o * f + s * E * f + g * o * M - s * x * M) * st, t[4] = vt * st, t[5] = (w * D * h - L * E * h + L * o * M - e * D * M - w * o * B + e * E * B) * st, t[6] = (L * x * h - c * D * h - L * o * f + e * D * f + c * o * B - e * x * B) * st, t[7] = (c * E * h - w * x * h + w * o * f - e * E * f - c * o * M + e * x * M) * st, t[8] = ot * st, t[9] = (L * b * h - w * z * h - L * s * M + e * z * M + w * s * B - e * b * B) * st, t[10] = (c * z * h - L * g * h + L * s * f - e * z * f - c * s * B + e * g * B) * st, t[11] = (w * g * h - c * b * h - w * s * f + e * b * f + c * s * M - e * g * M) * st, t[12] = W * st, t[13] = (w * z * o - L * b * o + L * s * E - e * z * E - w * s * D + e * b * D) * st, t[14] = (L * g * o - c * z * o - L * s * x + e * z * x + c * s * D - e * g * D) * st, t[15] = (c * b * o - w * g * o + w * s * x - e * b * x - c * s * E + e * g * E) * st, this;
6554
6561
  }
6555
6562
  /**
6556
6563
  * Multiply the columns of this matrix by vector v.
@@ -6613,18 +6620,18 @@ const Ei = /* @__PURE__ */ new Z(), Eo = /* @__PURE__ */ new un(), Fi = class yh
6613
6620
  * @returns Return this matrix
6614
6621
  */
6615
6622
  makeRotationAxis(t, e) {
6616
- const s = Math.cos(e), o = Math.sin(e), h = 1 - s, c = t.x, g = t.y, x = t.z, f = h * c, A = h * g;
6623
+ const s = Math.cos(e), o = Math.sin(e), h = 1 - s, c = t.x, g = t.y, x = t.z, f = h * c, w = h * g;
6617
6624
  return this.set(
6618
6625
  f * c + s,
6619
6626
  f * g - o * x,
6620
6627
  f * x + o * g,
6621
6628
  0,
6622
6629
  f * g + o * x,
6623
- A * g + s,
6624
- A * x - o * c,
6630
+ w * g + s,
6631
+ w * x - o * c,
6625
6632
  0,
6626
6633
  f * x - o * g,
6627
- A * x + o * c,
6634
+ w * x + o * c,
6628
6635
  h * x * x + s,
6629
6636
  0,
6630
6637
  0,
@@ -6664,8 +6671,8 @@ const Ei = /* @__PURE__ */ new Z(), Eo = /* @__PURE__ */ new un(), Fi = class yh
6664
6671
  * @returns Return this matrix
6665
6672
  */
6666
6673
  compose(t, e, s) {
6667
- const o = this.elements, h = e.x, c = e.y, g = e.z, x = e.w, f = h + h, A = c + c, b = g + g, E = h * f, M = h * A, O = h * b, z = c * A, D = c * b, B = g * b, dt = x * f, vt = x * A, ot = x * b, W = s.x, ut = s.y, st = s.z;
6668
- return o[0] = (1 - (z + B)) * W, o[1] = (M + ot) * W, o[2] = (O - vt) * W, o[3] = 0, o[4] = (M - ot) * ut, o[5] = (1 - (E + B)) * ut, o[6] = (D + dt) * ut, o[7] = 0, o[8] = (O + vt) * st, o[9] = (D - dt) * st, o[10] = (1 - (E + z)) * st, o[11] = 0, o[12] = t.x, o[13] = t.y, o[14] = t.z, o[15] = 1, this;
6674
+ const o = this.elements, h = e.x, c = e.y, g = e.z, x = e.w, f = h + h, w = c + c, b = g + g, E = h * f, M = h * w, L = h * b, z = c * w, D = c * b, B = g * b, dt = x * f, vt = x * w, ot = x * b, W = s.x, ut = s.y, st = s.z;
6675
+ return o[0] = (1 - (z + B)) * W, o[1] = (M + ot) * W, o[2] = (L - vt) * W, o[3] = 0, o[4] = (M - ot) * ut, o[5] = (1 - (E + B)) * ut, o[6] = (D + dt) * ut, o[7] = 0, o[8] = (L + vt) * st, o[9] = (D - dt) * st, o[10] = (1 - (E + z)) * st, o[11] = 0, o[12] = t.x, o[13] = t.y, o[14] = t.z, o[15] = 1, this;
6669
6676
  }
6670
6677
  /**
6671
6678
  * Decompose this matrix into its position, quaternion and scale components.
@@ -6683,8 +6690,8 @@ const Ei = /* @__PURE__ */ new Z(), Eo = /* @__PURE__ */ new un(), Fi = class yh
6683
6690
  let h = Tn.set(o[0], o[1], o[2]).length();
6684
6691
  const c = Tn.set(o[4], o[5], o[6]).length(), g = Tn.set(o[8], o[9], o[10]).length();
6685
6692
  this.determinant() < 0 && (h = -h), t.x = o[12], t.y = o[13], t.z = o[14], nr.copy(this);
6686
- const x = 1 / h, f = 1 / c, A = 1 / g;
6687
- return nr.elements[0] *= x, nr.elements[1] *= x, nr.elements[2] *= x, nr.elements[4] *= f, nr.elements[5] *= f, nr.elements[6] *= f, nr.elements[8] *= A, nr.elements[9] *= A, nr.elements[10] *= A, e.setFromRotationMatrix(nr), s.x = h, s.y = c, s.z = g, this;
6693
+ const x = 1 / h, f = 1 / c, w = 1 / g;
6694
+ return nr.elements[0] *= x, nr.elements[1] *= x, nr.elements[2] *= x, nr.elements[4] *= f, nr.elements[5] *= f, nr.elements[6] *= f, nr.elements[8] *= w, nr.elements[9] *= w, nr.elements[10] *= w, e.setFromRotationMatrix(nr), s.x = h, s.y = c, s.z = g, this;
6688
6695
  }
6689
6696
  // makePerspective(
6690
6697
  // left,
@@ -7586,13 +7593,13 @@ const To = /* @__PURE__ */ new cn(), No = /* @__PURE__ */ new un(), xh = class B
7586
7593
  * @returns Return this euler
7587
7594
  */
7588
7595
  setFromRotationMatrix(t, e = this._order, s = !0) {
7589
- const o = t.elements, h = o[0], c = o[4], g = o[8], x = o[1], f = o[5], A = o[9], b = o[2], E = o[6], M = o[10];
7596
+ const o = t.elements, h = o[0], c = o[4], g = o[8], x = o[1], f = o[5], w = o[9], b = o[2], E = o[6], M = o[10];
7590
7597
  switch (e) {
7591
7598
  case "XYZ":
7592
- this._y = Math.asin(Vr(g, -1, 1)), Math.abs(g) < 0.9999999 ? (this._x = Math.atan2(-A, M), this._z = Math.atan2(-c, h)) : (this._x = Math.atan2(E, f), this._z = 0);
7599
+ this._y = Math.asin(Vr(g, -1, 1)), Math.abs(g) < 0.9999999 ? (this._x = Math.atan2(-w, M), this._z = Math.atan2(-c, h)) : (this._x = Math.atan2(E, f), this._z = 0);
7593
7600
  break;
7594
7601
  case "YXZ":
7595
- this._x = Math.asin(-Vr(A, -1, 1)), Math.abs(A) < 0.9999999 ? (this._y = Math.atan2(g, M), this._z = Math.atan2(x, f)) : (this._y = Math.atan2(-b, h), this._z = 0);
7602
+ this._x = Math.asin(-Vr(w, -1, 1)), Math.abs(w) < 0.9999999 ? (this._y = Math.atan2(g, M), this._z = Math.atan2(x, f)) : (this._y = Math.atan2(-b, h), this._z = 0);
7596
7603
  break;
7597
7604
  case "ZXY":
7598
7605
  this._x = Math.asin(Vr(E, -1, 1)), Math.abs(E) < 0.9999999 ? (this._y = Math.atan2(-b, M), this._z = Math.atan2(-c, f)) : (this._y = 0, this._z = Math.atan2(x, h));
@@ -7601,10 +7608,10 @@ const To = /* @__PURE__ */ new cn(), No = /* @__PURE__ */ new un(), xh = class B
7601
7608
  this._y = Math.asin(-Vr(b, -1, 1)), Math.abs(b) < 0.9999999 ? (this._x = Math.atan2(E, M), this._z = Math.atan2(x, h)) : (this._x = 0, this._z = Math.atan2(-c, f));
7602
7609
  break;
7603
7610
  case "YZX":
7604
- this._z = Math.asin(Vr(x, -1, 1)), Math.abs(x) < 0.9999999 ? (this._x = Math.atan2(-A, f), this._y = Math.atan2(-b, h)) : (this._x = 0, this._y = Math.atan2(g, M));
7611
+ this._z = Math.asin(Vr(x, -1, 1)), Math.abs(x) < 0.9999999 ? (this._x = Math.atan2(-w, f), this._y = Math.atan2(-b, h)) : (this._x = 0, this._y = Math.atan2(g, M));
7605
7612
  break;
7606
7613
  case "XZY":
7607
- this._z = Math.asin(-Vr(c, -1, 1)), Math.abs(c) < 0.9999999 ? (this._x = Math.atan2(E, f), this._y = Math.atan2(g, h)) : (this._x = Math.atan2(-A, M), this._y = 0);
7614
+ this._z = Math.asin(-Vr(c, -1, 1)), Math.abs(c) < 0.9999999 ? (this._x = Math.atan2(E, f), this._y = Math.atan2(g, h)) : (this._x = Math.atan2(-w, M), this._y = 0);
7608
7615
  break;
7609
7616
  default:
7610
7617
  console.warn(
@@ -7780,13 +7787,13 @@ class fa extends wh {
7780
7787
  });
7781
7788
  const g = { index: -1, children: [] };
7782
7789
  for (let x = 0; x < c; x++) {
7783
- const f = o[x], A = e[f], b = s[f];
7790
+ const f = o[x], w = e[f], b = s[f];
7784
7791
  let E = x + 1;
7785
7792
  for (; E < c; E++) {
7786
- const M = o[E], O = e[M];
7793
+ const M = o[E], L = e[M];
7787
7794
  if (s[M].containsBox(b) && gd.isPointInPolygon(
7788
- A[kt.randInt(0, A.length - 1)],
7789
- O
7795
+ w[kt.randInt(0, w.length - 1)],
7796
+ L
7790
7797
  )) {
7791
7798
  (t = h.get(M)) == null || t.children.push(h.get(f));
7792
7799
  break;
@@ -7933,7 +7940,7 @@ class Ms extends wh {
7933
7940
  }
7934
7941
  if (o = x, s[o] === c)
7935
7942
  return o / (h - 1);
7936
- const A = s[o], b = s[o + 1] - A, E = (c - A) / b;
7943
+ const w = s[o], b = s[o + 1] - w, E = (c - w) / b;
7937
7944
  return (o + E) / (h - 1);
7938
7945
  }
7939
7946
  /**
@@ -7991,10 +7998,10 @@ class Ps extends Ms {
7991
7998
  const o = (st, Vt) => ({
7992
7999
  x: (st.x + Vt.x) / 2,
7993
8000
  y: (st.y + Vt.y) / 2
7994
- }), h = (st, Vt) => (Vt.y - st.y) / (Vt.x - st.x), c = (st) => -1 / st, g = o(t, e), x = o(e, s), f = h(t, e), A = h(e, s), b = c(f), E = c(A), M = (st, Vt, qt, Wt) => {
8001
+ }), h = (st, Vt) => (Vt.y - st.y) / (Vt.x - st.x), c = (st) => -1 / st, g = o(t, e), x = o(e, s), f = h(t, e), w = h(e, s), b = c(f), E = c(w), M = (st, Vt, qt, Wt) => {
7995
8002
  const bt = (Wt - Vt) / (st - qt), Ot = st * bt + Vt;
7996
8003
  return { x: bt, y: Ot };
7997
- }, O = g.y - b * g.x, z = x.y - E * x.x, D = M(b, O, E, z), B = Math.sqrt(
8004
+ }, L = g.y - b * g.x, z = x.y - E * x.x, D = M(b, L, E, z), B = Math.sqrt(
7998
8005
  Math.pow(t.x - D.x, 2) + Math.pow(t.y - D.y, 2)
7999
8006
  ), dt = (st, Vt) => Math.atan2(st.y - Vt.y, st.x - Vt.x), vt = dt(t, D), ot = dt(e, D), W = dt(s, D), ut = W > vt && W < ot || vt > W && vt < ot || ot > W && ot < vt;
8000
8007
  this.center = D, this.radius = B, this._clockwise = !ut, this._startAngle = vt, this._endAngle = W;
@@ -8013,20 +8020,20 @@ class Ps extends Ms {
8013
8020
  createByStartEndPointsAndBulge(t, e, s) {
8014
8021
  let o, h, c;
8015
8022
  s < 0 ? (o = Math.atan(-s) * 4, h = new Zt(t), c = new Zt(e)) : (o = Math.atan(s) * 4, h = new Zt(e), c = new Zt(t));
8016
- const g = new Zt().subVectors(c, h), x = g.length(), f = new Zt().addVectors(h, g.multiplyScalar(0.5)), A = Math.abs(x / 2 / Math.tan(o / 2)), b = g.normalize();
8023
+ const g = new Zt().subVectors(c, h), x = g.length(), f = new Zt().addVectors(h, g.multiplyScalar(0.5)), w = Math.abs(x / 2 / Math.tan(o / 2)), b = g.normalize();
8017
8024
  let E;
8018
8025
  if (o < Math.PI) {
8019
8026
  const M = new Zt(
8020
8027
  b.x * Math.cos(Math.PI / 2) - b.y * Math.sin(Math.PI / 2),
8021
8028
  b.y * Math.cos(Math.PI / 2) + b.x * Math.sin(Math.PI / 2)
8022
8029
  );
8023
- E = f.add(M.multiplyScalar(-A));
8030
+ E = f.add(M.multiplyScalar(-w));
8024
8031
  } else {
8025
8032
  const M = new Zt(
8026
8033
  b.x * Math.cos(Math.PI / 2) - b.y * Math.sin(Math.PI / 2),
8027
8034
  b.y * Math.cos(Math.PI / 2) + b.x * Math.sin(Math.PI / 2)
8028
8035
  );
8029
- E = f.add(M.multiplyScalar(A));
8036
+ E = f.add(M.multiplyScalar(w));
8030
8037
  }
8031
8038
  s < 0 ? (this._startAngle = Math.atan2(h.y - E.y, h.x - E.x), this._endAngle = Math.atan2(c.y - E.y, c.x - E.x)) : (this._startAngle = Math.atan2(c.y - E.y, c.x - E.x), this._endAngle = Math.atan2(h.y - E.y, h.x - E.x)), this._clockwise = s < 0, this.center = E, this.radius = c.sub(E).length();
8032
8039
  }
@@ -8446,8 +8453,8 @@ class Ln extends Ts {
8446
8453
  const o = new Z().addVectors(t, e).multiplyScalar(0.5), h = new Z().addVectors(t, s).multiplyScalar(0.5), c = new Z().subVectors(e, t), g = new Z().subVectors(s, t), x = new Z().crossVectors(c, g).normalize();
8447
8454
  if (x.lengthSq() === 0)
8448
8455
  return console.error("Points are collinear and cannot form a valid arc."), null;
8449
- const f = new Z().crossVectors(c, x).normalize(), A = new Z().crossVectors(g, x).normalize(), b = f.clone().multiplyScalar(Number.MAX_SAFE_INTEGER), E = A.clone().multiplyScalar(Number.MAX_SAFE_INTEGER), M = new dn(o, o.clone().add(b)), O = new dn(h, h.clone().add(E)), z = new Z();
8450
- return M.closestPointToPoint(O.startPoint, !0, z) ? z : (console.error("Cannot find a valid center for the arc."), null);
8456
+ const f = new Z().crossVectors(c, x).normalize(), w = new Z().crossVectors(g, x).normalize(), b = f.clone().multiplyScalar(Number.MAX_SAFE_INTEGER), E = w.clone().multiplyScalar(Number.MAX_SAFE_INTEGER), M = new dn(o, o.clone().add(b)), L = new dn(h, h.clone().add(E)), z = new Z();
8457
+ return M.closestPointToPoint(L.startPoint, !0, z) ? z : (console.error("Cannot find a valid center for the arc."), null);
8451
8458
  }
8452
8459
  /**
8453
8460
  * Create arc by three points
@@ -8803,8 +8810,8 @@ class _a extends Ms {
8803
8810
  const h = this.startAngle + t * s;
8804
8811
  let c = this.center.x + this.majorAxisRadius * Math.cos(h), g = this.center.y + this.minorAxisRadius * Math.sin(h);
8805
8812
  if (this.rotation !== 0) {
8806
- const x = Math.cos(this.rotation), f = Math.sin(this.rotation), A = c - this.center.x, b = g - this.center.y;
8807
- c = A * x - b * f + this.center.x, g = A * f + b * x + this.center.y;
8813
+ const x = Math.cos(this.rotation), f = Math.sin(this.rotation), w = c - this.center.x, b = g - this.center.y;
8814
+ c = w * x - b * f + this.center.x, g = w * f + b * x + this.center.y;
8808
8815
  }
8809
8816
  return new Nt(c, g);
8810
8817
  }
@@ -8972,8 +8979,8 @@ class va extends Ts {
8972
8979
  const t = 1e3, e = this.deltaAngle / t;
8973
8980
  let s = 0, o = this.getPointAtAngle(this.startAngle);
8974
8981
  for (let h = 1; h <= t; h++) {
8975
- const c = this.startAngle + h * e, g = this.getPointAtAngle(c), x = g.x - o.x, f = g.y - o.y, A = g.z - o.z;
8976
- s += Math.sqrt(x * x + f * f + A * A), o = g;
8982
+ const c = this.startAngle + h * e, g = this.getPointAtAngle(c), x = g.x - o.x, f = g.y - o.y, w = g.z - o.z;
8983
+ s += Math.sqrt(x * x + f * f + w * w), o = g;
8977
8984
  }
8978
8985
  return s;
8979
8986
  }
@@ -9207,8 +9214,8 @@ class Rn extends Ms {
9207
9214
  if (o < s - 1 ? c = this._vertices[o + 1] : o == s - 1 && this.closed && (c = this._vertices[0]), c) {
9208
9215
  const g = new Ps(h, c, h.bulge).getPoints(t), x = g.length;
9209
9216
  for (let f = 0; f < x; ++f) {
9210
- const A = g[f];
9211
- e.push(new Nt(A.x, A.y));
9217
+ const w = g[f];
9218
+ e.push(new Nt(w.x, w.y));
9212
9219
  }
9213
9220
  }
9214
9221
  } else
@@ -9393,10 +9400,10 @@ var Ah = { exports: {} };
9393
9400
  var c = s;
9394
9401
  if (h()) {
9395
9402
  var g = function(x, f) {
9396
- var A = s;
9403
+ var w = s;
9397
9404
  return x.split(".").forEach(function(b) {
9398
- A && (A = A[b]);
9399
- }), A ? A[f] : null;
9405
+ w && (w = w[b]);
9406
+ }), w ? w[f] : null;
9400
9407
  };
9401
9408
  onmessage = function(x) {
9402
9409
  if (!(!x.data.className || !x.data.methodName)) {
@@ -9408,7 +9415,7 @@ var Ah = { exports: {} };
9408
9415
  };
9409
9416
  }
9410
9417
  }
9411
- return function(x, f, A) {
9418
+ return function(x, f, w) {
9412
9419
  f.geom = f.geom || {}, f.exe = f.exe || {}, f.eval = f.eval || {}, f.core = f.core || {}, f.promhx = f.promhx || {};
9413
9420
  var b = {}, E = function() {
9414
9421
  return Mt.__string_rec(this, "");
@@ -9421,9 +9428,9 @@ var Ah = { exports: {} };
9421
9428
  for (var u in n) l[u] = n[u];
9422
9429
  return n.toString !== Object.prototype.toString && (l.toString = n.toString), l;
9423
9430
  }
9424
- var O = function() {
9431
+ var L = function() {
9425
9432
  };
9426
- b.HxOverrides = O, O.__name__ = ["HxOverrides"], O.strDate = function(r) {
9433
+ b.HxOverrides = L, L.__name__ = ["HxOverrides"], L.strDate = function(r) {
9427
9434
  var n = r.length;
9428
9435
  switch (n) {
9429
9436
  case 8:
@@ -9438,13 +9445,13 @@ var Ah = { exports: {} };
9438
9445
  default:
9439
9446
  throw new Q("Invalid date format : " + r);
9440
9447
  }
9441
- }, O.cca = function(r, n) {
9448
+ }, L.cca = function(r, n) {
9442
9449
  var a = r.charCodeAt(n);
9443
9450
  if (a == a)
9444
9451
  return a;
9445
- }, O.substr = function(r, n, a) {
9452
+ }, L.substr = function(r, n, a) {
9446
9453
  return n != null && n != 0 && a != null && a < 0 ? "" : (a == null && (a = r.length), n < 0 ? (n = r.length + n, n < 0 && (n = 0)) : a < 0 && (a = r.length + a - n), r.substr(n, a));
9447
- }, O.iter = function(r) {
9454
+ }, L.iter = function(r) {
9448
9455
  return {
9449
9456
  cur: 0,
9450
9457
  arr: r,
@@ -9668,7 +9675,7 @@ var Ah = { exports: {} };
9668
9675
  break;
9669
9676
  case D:
9670
9677
  this.buf.b += "l";
9671
- for (var w = r, I = w.h, S = null; I != null; ) {
9678
+ for (var A = r, I = A.h, S = null; I != null; ) {
9672
9679
  var P;
9673
9680
  S = I[0], I = I[1], P = S, this.serialize(P);
9674
9681
  }
@@ -9680,8 +9687,8 @@ var Ah = { exports: {} };
9680
9687
  break;
9681
9688
  case me:
9682
9689
  this.buf.b += "b";
9683
- for (var T = r, L = T.keys(); L.hasNext(); ) {
9684
- var C = L.next();
9690
+ for (var T = r, O = T.keys(); O.hasNext(); ) {
9691
+ var C = O.next();
9685
9692
  this.serializeString(C), this.serialize(hi[C] != null ? T.getReserved(C) : T.h[C]);
9686
9693
  }
9687
9694
  this.buf.b += "h";
@@ -9801,7 +9808,7 @@ var Ah = { exports: {} };
9801
9808
  if (n >= 43 && n < 58 || n == 101 || n == 69) this.pos++;
9802
9809
  else break;
9803
9810
  }
9804
- return dt.parseFloat(O.substr(this.buf, r, this.pos - r));
9811
+ return dt.parseFloat(L.substr(this.buf, r, this.pos - r));
9805
9812
  },
9806
9813
  unserializeObject: function(r) {
9807
9814
  for (; ; ) {
@@ -9839,7 +9846,7 @@ var Ah = { exports: {} };
9839
9846
  case 121:
9840
9847
  var n = this.readDigits();
9841
9848
  if (this.get(this.pos++) != 58 || this.length - this.pos < n) throw new Q("Invalid string length");
9842
- var a = O.substr(this.buf, this.pos, n);
9849
+ var a = L.substr(this.buf, this.pos, n);
9843
9850
  return this.pos += n, a = decodeURIComponent(a.split("+").join(" ")), this.scache.push(a), a;
9844
9851
  case 107:
9845
9852
  return NaN;
@@ -9877,8 +9884,8 @@ var Ah = { exports: {} };
9877
9884
  case 120:
9878
9885
  throw new Q(this.unserialize());
9879
9886
  case 99:
9880
- var w = this.unserialize(), I = this.resolver.resolveClass(w);
9881
- if (I == null) throw new Q("Class not found " + w);
9887
+ var A = this.unserialize(), I = this.resolver.resolveClass(A);
9888
+ if (I == null) throw new Q("Class not found " + A);
9882
9889
  var S = ut.createEmptyInstance(I);
9883
9890
  return this.cache.push(S), this.unserializeObject(S), S;
9884
9891
  case 119:
@@ -9887,11 +9894,11 @@ var Ah = { exports: {} };
9887
9894
  var T = this.unserializeEnum(k, this.unserialize());
9888
9895
  return this.cache.push(T), T;
9889
9896
  case 106:
9890
- var L = this.unserialize(), C = this.resolver.resolveEnum(L);
9891
- if (C == null) throw new Q("Enum not found " + L);
9897
+ var O = this.unserialize(), C = this.resolver.resolveEnum(O);
9898
+ if (C == null) throw new Q("Enum not found " + O);
9892
9899
  this.pos++;
9893
9900
  var F = this.readDigits(), R = ut.getEnumConstructs(C)[F];
9894
- if (R == null) throw new Q("Unknown enum index " + L + "@" + F);
9901
+ if (R == null) throw new Q("Unknown enum index " + O + "@" + F);
9895
9902
  var U = this.unserializeEnum(C, R);
9896
9903
  return this.cache.push(U), U;
9897
9904
  case 108:
@@ -9924,8 +9931,8 @@ var Ah = { exports: {} };
9924
9931
  case 118:
9925
9932
  var it;
9926
9933
  if (this.buf.charCodeAt(this.pos) >= 48 && this.buf.charCodeAt(this.pos) <= 57 && this.buf.charCodeAt(this.pos + 1) >= 48 && this.buf.charCodeAt(this.pos + 1) <= 57 && this.buf.charCodeAt(this.pos + 2) >= 48 && this.buf.charCodeAt(this.pos + 2) <= 57 && this.buf.charCodeAt(this.pos + 3) >= 48 && this.buf.charCodeAt(this.pos + 3) <= 57 && this.buf.charCodeAt(this.pos + 4) == 45) {
9927
- var ht = O.substr(this.buf, this.pos, 19);
9928
- it = O.strDate(ht), this.pos += 19;
9934
+ var ht = L.substr(this.buf, this.pos, 19);
9935
+ it = L.strDate(ht), this.pos += 19;
9929
9936
  } else {
9930
9937
  var at = this.readFloat(), ct = /* @__PURE__ */ new Date();
9931
9938
  ct.setTime(at), it = ct;
@@ -9939,10 +9946,10 @@ var Ah = { exports: {} };
9939
9946
  var gt = this.pos, It = nt & 3, jt;
9940
9947
  jt = (nt >> 2) * 3 + (It >= 2 ? It - 1 : 0);
9941
9948
  for (var Xt = gt + (nt - It), Dt = Me.alloc(jt), Kt = 0; gt < Xt; ) {
9942
- var Ae = X[ot.fastCodeAt(mt, gt++)], We = X[ot.fastCodeAt(mt, gt++)];
9943
- Dt.set(Kt++, Ae << 2 | We >> 4);
9949
+ var Ae = X[ot.fastCodeAt(mt, gt++)], He = X[ot.fastCodeAt(mt, gt++)];
9950
+ Dt.set(Kt++, Ae << 2 | He >> 4);
9944
9951
  var _e = X[ot.fastCodeAt(mt, gt++)];
9945
- Dt.set(Kt++, We << 4 | _e >> 2);
9952
+ Dt.set(Kt++, He << 4 | _e >> 2);
9946
9953
  var ge = X[ot.fastCodeAt(mt, gt++)];
9947
9954
  Dt.set(Kt++, _e << 6 | ge);
9948
9955
  }
@@ -9987,7 +9994,7 @@ var Ah = { exports: {} };
9987
9994
  var r = [];
9988
9995
  for (var n in this.h)
9989
9996
  this.h.hasOwnProperty(n) && r.push(n | 0);
9990
- return O.iter(r);
9997
+ return L.iter(r);
9991
9998
  },
9992
9999
  __class__: bt
9993
10000
  };
@@ -10003,7 +10010,7 @@ var Ah = { exports: {} };
10003
10010
  var r = [];
10004
10011
  for (var n in this.h.__keys__)
10005
10012
  this.h.hasOwnProperty(n) && r.push(this.h.__keys__[n]);
10006
- return O.iter(r);
10013
+ return L.iter(r);
10007
10014
  },
10008
10015
  __class__: Ot
10009
10016
  };
@@ -10030,7 +10037,7 @@ var Ah = { exports: {} };
10030
10037
  },
10031
10038
  keys: function() {
10032
10039
  var r = this.arrayKeys();
10033
- return O.iter(r);
10040
+ return L.iter(r);
10034
10041
  },
10035
10042
  arrayKeys: function() {
10036
10043
  var r = [];
@@ -10125,8 +10132,8 @@ var Ah = { exports: {} };
10125
10132
  }
10126
10133
  var _ = r.length, v = "[";
10127
10134
  n += " ";
10128
- for (var w = 0; w < _; ) {
10129
- var I = w++;
10135
+ for (var A = 0; A < _; ) {
10136
+ var I = A++;
10130
10137
  v += (I > 0 ? "," : "") + Mt.__string_rec(r[I], n);
10131
10138
  }
10132
10139
  return v += "]", v;
@@ -10144,9 +10151,9 @@ var Ah = { exports: {} };
10144
10151
  var k = null, T = `{
10145
10152
  `;
10146
10153
  n += " ";
10147
- var L = r.hasOwnProperty != null;
10154
+ var O = r.hasOwnProperty != null;
10148
10155
  for (var k in r)
10149
- L && !r.hasOwnProperty(k) || k == "prototype" || k == "__class__" || k == "__super__" || k == "__interfaces__" || k == "__properties__" || (T.length != 2 && (T += `,
10156
+ O && !r.hasOwnProperty(k) || k == "prototype" || k == "__class__" || k == "__super__" || k == "__interfaces__" || k == "__properties__" || (T.length != 2 && (T += `,
10150
10157
  `), T += n + k + " : " + Mt.__string_rec(r[k], n));
10151
10158
  return n = n.substring(1), T += `
10152
10159
  ` + n + "}", T;
@@ -10197,7 +10204,7 @@ var Ah = { exports: {} };
10197
10204
  }, Mt.__isNativeObj = function(r) {
10198
10205
  return Mt.__nativeClassName(r) != null;
10199
10206
  }, Mt.__resolveNativeClass = function(r) {
10200
- return A[r];
10207
+ return w[r];
10201
10208
  };
10202
10209
  var ae = function(r) {
10203
10210
  if (r instanceof Array && r.__enum__ == null)
@@ -10313,7 +10320,7 @@ var Ah = { exports: {} };
10313
10320
  } else if (r instanceof Array && r.__enum__ == null) {
10314
10321
  var _ = r;
10315
10322
  if (_.length + n > a.byteLength) throw new Q("set() outside of range");
10316
- for (var v = 0, w = _.length; v < w; ) {
10323
+ for (var v = 0, A = _.length; v < A; ) {
10317
10324
  var I = v++;
10318
10325
  a[I + n] = _[I];
10319
10326
  }
@@ -10343,11 +10350,11 @@ var Ah = { exports: {} };
10343
10350
  }, Et.linkAll = function(r, n) {
10344
10351
  for (var a = function(d, p, _) {
10345
10352
  if (d.length == 0 || Et.allFulfilled(d)) {
10346
- for (var v, w = [], I = Ke(r)(); I.hasNext(); ) {
10353
+ for (var v, A = [], I = Ke(r)(); I.hasNext(); ) {
10347
10354
  var S = I.next();
10348
- w.push(S == p ? _ : S._val);
10355
+ A.push(S == p ? _ : S._val);
10349
10356
  }
10350
- v = w, n.handleResolve(v);
10357
+ v = A, n.handleResolve(v);
10351
10358
  }
10352
10359
  }, l = Ke(r)(); l.hasNext(); ) {
10353
10360
  var u = l.next();
@@ -10359,8 +10366,8 @@ var Ah = { exports: {} };
10359
10366
  };
10360
10367
  }(a, function(d) {
10361
10368
  for (var p, _ = [], v = Ke(r)(); v.hasNext(); ) {
10362
- var w = v.next();
10363
- w != u && _.push(w);
10369
+ var A = v.next();
10370
+ A != u && _.push(A);
10364
10371
  }
10365
10372
  return p = _, p;
10366
10373
  }(), u)
@@ -10368,8 +10375,8 @@ var Ah = { exports: {} };
10368
10375
  }
10369
10376
  Et.allFulfilled(r) && n.handleResolve(function(d) {
10370
10377
  for (var p, _ = [], v = Ke(r)(); v.hasNext(); ) {
10371
- var w = v.next();
10372
- _.push(w._val);
10378
+ var A = v.next();
10379
+ _.push(A._val);
10373
10380
  }
10374
10381
  return p = _, p;
10375
10382
  }());
@@ -10460,8 +10467,8 @@ var Ah = { exports: {} };
10460
10467
  }
10461
10468
  else if (n._update.length > 0)
10462
10469
  for (var _ = 0, v = n._update; _ < v.length; ) {
10463
- var w = v[_];
10464
- ++_, w.async.handleError(l);
10470
+ var A = v[_];
10471
+ ++_, A.async.handleError(l);
10465
10472
  }
10466
10473
  else throw new Q(l);
10467
10474
  n._errorPending = !1;
@@ -10825,8 +10832,8 @@ var Ah = { exports: {} };
10825
10832
  u == null && (u = -1);
10826
10833
  var d;
10827
10834
  u < -0.5 ? d = rt.TOLERANCE : d = u;
10828
- var p = Math.min(r, n) - d, _ = Math.max(r, n) + d, v = Math.min(a, l) - d, w = Math.max(a, l) + d;
10829
- return p >= v && p <= w || _ >= v && _ <= w || v >= p && v <= _ || w >= p && w <= _;
10835
+ var p = Math.min(r, n) - d, _ = Math.max(r, n) + d, v = Math.min(a, l) - d, A = Math.max(a, l) + d;
10836
+ return p >= v && p <= A || _ >= v && _ <= A || v >= p && v <= _ || A >= p && A <= _;
10830
10837
  }, Te.prototype = {
10831
10838
  fromPoint: function(r) {
10832
10839
  return new Te([r]);
@@ -10875,7 +10882,7 @@ var Ah = { exports: {} };
10875
10882
  if (!this.initialized) return null;
10876
10883
  var a = this.min, l = this.max, u = r.min, d = r.max;
10877
10884
  if (!this.intersects(r, n)) return null;
10878
- for (var p = [], _ = [], v = 0, w = this.dim; v < w; ) {
10885
+ for (var p = [], _ = [], v = 0, A = this.dim; v < A; ) {
10879
10886
  var I = v++;
10880
10887
  p.push(Math.min(l[I], d[I])), _.push(Math.max(a[I], u[I]));
10881
10888
  }
@@ -10993,13 +11000,13 @@ var Ah = { exports: {} };
10993
11000
  b["verb.core.CurveTriPoint"] = vn, vn.__name__ = ["verb", "core", "CurveTriPoint"], vn.prototype = {
10994
11001
  __class__: vn
10995
11002
  };
10996
- var Ge = function(r, n, a, l, u) {
11003
+ var je = function(r, n, a, l, u) {
10997
11004
  u == null && (u = !1), l == null && (l = -1), this.uv = a, this.point = r, this.normal = n, this.id = l, this.degen = u;
10998
11005
  };
10999
- b["verb.core.SurfacePoint"] = Ge, Ge.__name__ = ["verb", "core", "SurfacePoint"], Ge.fromUv = function(r, n) {
11000
- return new Ge(null, null, [r, n]);
11001
- }, Ge.prototype = {
11002
- __class__: Ge
11006
+ b["verb.core.SurfacePoint"] = je, je.__name__ = ["verb", "core", "SurfacePoint"], je.fromUv = function(r, n) {
11007
+ return new je(null, null, [r, n]);
11008
+ }, je.prototype = {
11009
+ __class__: je
11003
11010
  };
11004
11011
  var Cs = f.core.CurvePoint = function(r, n) {
11005
11012
  this.u = r, this.pt = n;
@@ -11023,16 +11030,16 @@ var Ah = { exports: {} };
11023
11030
  return -S.item1;
11024
11031
  }), d, p = null;
11025
11032
  p = function(S) {
11026
- for (var P, k = S.dimension, T = l.distanceFunction(r, S.kdPoint.point), L, C = [], F = 0, R = l.dim; F < R; )
11033
+ for (var P, k = S.dimension, T = l.distanceFunction(r, S.kdPoint.point), O, C = [], F = 0, R = l.dim; F < R; )
11027
11034
  F++, C.push(0);
11028
- L = C;
11035
+ O = C;
11029
11036
  for (var U, V, q = function(K, tt) {
11030
11037
  u.push(new ee(K, tt)), u.size() > n && u.pop();
11031
11038
  }, J = 0, H = l.dim; J < H; ) {
11032
11039
  var G = J++;
11033
- G == S.dimension ? L[G] = r[G] : L[G] = S.kdPoint.point[G];
11040
+ G == S.dimension ? O[G] = r[G] : O[G] = S.kdPoint.point[G];
11034
11041
  }
11035
- if (U = l.distanceFunction(L, S.kdPoint.point), S.right == null && S.left == null) {
11042
+ if (U = l.distanceFunction(O, S.kdPoint.point), S.right == null && S.left == null) {
11036
11043
  (u.size() < n || T < u.peek().item1) && q(S, T);
11037
11044
  return;
11038
11045
  }
@@ -11041,8 +11048,8 @@ var Ah = { exports: {} };
11041
11048
  for (var _ = 0; _ < n; )
11042
11049
  _++, u.push(new ee(null, a));
11043
11050
  d(this.root);
11044
- for (var v = [], w = 0; w < n; ) {
11045
- var I = w++;
11051
+ for (var v = [], A = 0; A < n; ) {
11052
+ var I = A++;
11046
11053
  u.content[I].item0 != null && v.push(new ee(u.content[I].item0.kdPoint, u.content[I].item1));
11047
11054
  }
11048
11055
  return v;
@@ -11093,7 +11100,7 @@ var Ah = { exports: {} };
11093
11100
  _ = this.scoreFunction(v), _ < l && (p = d);
11094
11101
  }
11095
11102
  if (u < n) {
11096
- var w = this.content[u], I = this.scoreFunction(w);
11103
+ var A = this.content[u], I = this.scoreFunction(A);
11097
11104
  I < (p == -1 ? l : _) && (p = u);
11098
11105
  }
11099
11106
  if (p != -1)
@@ -11233,12 +11240,12 @@ var Ah = { exports: {} };
11233
11240
  }
11234
11241
  return a;
11235
11242
  }, Lt.mult = function(r, n) {
11236
- var a, l, u, d, p, _, v, w;
11243
+ var a, l, u, d, p, _, v, A;
11237
11244
  a = r.length, l = n.length, u = n[0].length, d = [];
11238
11245
  for (var I = a - 1, S = 0, P = 0; I >= 0; ) {
11239
11246
  for (p = [], _ = r[I], P = u - 1; P >= 0; ) {
11240
11247
  for (v = _[l - 1] * n[l - 1][P], S = l - 2; S >= 1; )
11241
- w = S - 1, v += _[S] * n[S][P] + _[w] * n[w][P], S -= 2;
11248
+ A = S - 1, v += _[S] * n[S][P] + _[A] * n[A][P], S -= 2;
11242
11249
  S == 0 && (v += _[0] * n[0][P]), p[P] = v, P--;
11243
11250
  }
11244
11251
  d[I] = p, I--;
@@ -11279,7 +11286,7 @@ var Ah = { exports: {} };
11279
11286
  for (var n = [], a = 0, l = r[0].length; a < l; ) {
11280
11287
  var u = a++;
11281
11288
  n.push(function(d) {
11282
- for (var p, _ = [], v = 0, w = r.length; v < w; ) {
11289
+ for (var p, _ = [], v = 0, A = r.length; v < A; ) {
11283
11290
  var I = v++;
11284
11291
  _.push(r[I][u]);
11285
11292
  }
@@ -11290,36 +11297,36 @@ var Ah = { exports: {} };
11290
11297
  }, Lt.solve = function(r, n) {
11291
11298
  return Lt.LUsolve(Lt.LU(r), n);
11292
11299
  }, Lt.LUsolve = function(r, n) {
11293
- var a, l, u = r.LU, d = u.length, p = n.slice(), _ = r.P, v, w, I;
11300
+ var a, l, u = r.LU, d = u.length, p = n.slice(), _ = r.P, v, A, I;
11294
11301
  for (a = d - 1; a != -1; )
11295
11302
  p[a] = n[a], --a;
11296
11303
  for (a = 0; a < d; ) {
11297
- for (v = _[a], _[a] != a && (I = p[a], p[a] = p[v], p[v] = I), w = u[a], l = 0; l < a; )
11298
- p[a] -= p[l] * w[l], ++l;
11304
+ for (v = _[a], _[a] != a && (I = p[a], p[a] = p[v], p[v] = I), A = u[a], l = 0; l < a; )
11305
+ p[a] -= p[l] * A[l], ++l;
11299
11306
  ++a;
11300
11307
  }
11301
11308
  for (a = d - 1; a >= 0; ) {
11302
- for (w = u[a], l = a + 1; l < d; )
11303
- p[a] -= p[l] * w[l], ++l;
11304
- p[a] /= w[a], --a;
11309
+ for (A = u[a], l = a + 1; l < d; )
11310
+ p[a] -= p[l] * A[l], ++l;
11311
+ p[a] /= A[a], --a;
11305
11312
  }
11306
11313
  return p;
11307
11314
  }, Lt.LU = function(r) {
11308
- for (var n, a, l, u, d, p, _, v, w, I = [], S = 0, P = r.length; S < P; ) {
11315
+ for (var n, a, l, u, d, p, _, v, A, I = [], S = 0, P = r.length; S < P; ) {
11309
11316
  var k = S++;
11310
11317
  I.push(r[k].slice());
11311
11318
  }
11312
11319
  r = I;
11313
- var T = r.length, L = T - 1, C = [];
11320
+ var T = r.length, O = T - 1, C = [];
11314
11321
  for (l = 0; l < T; ) {
11315
- for (_ = l, p = r[l], w = Math.abs(p[l]), a = l + 1; a < T; )
11316
- u = Math.abs(r[a][l]), w < u && (w = u, _ = a), ++a;
11322
+ for (_ = l, p = r[l], A = Math.abs(p[l]), a = l + 1; a < T; )
11323
+ u = Math.abs(r[a][l]), A < u && (A = u, _ = a), ++a;
11317
11324
  for (C[l] = _, _ != l && (r[l] = r[_], r[_] = p, p = r[l]), d = p[l], n = l + 1; n < T; )
11318
11325
  r[n][l] /= d, ++n;
11319
11326
  for (n = l + 1; n < T; ) {
11320
- for (v = r[n], a = l + 1; a < L; )
11327
+ for (v = r[n], a = l + 1; a < O; )
11321
11328
  v[a] -= v[l] * p[a], ++a, v[a] -= v[l] * p[a], ++a;
11322
- a == L && (v[a] -= v[l] * p[a]), ++n;
11329
+ a == O && (v[a] -= v[l] * p[a]), ++n;
11323
11330
  }
11324
11331
  ++l;
11325
11332
  }
@@ -11350,11 +11357,11 @@ var Ah = { exports: {} };
11350
11357
  u.push(new ee(_, p));
11351
11358
  }
11352
11359
  u.sort(function(P, k) {
11353
- var T = P.item0, L = k.item0;
11354
- return T == L ? 0 : T > L ? 1 : -1;
11360
+ var T = P.item0, O = k.item0;
11361
+ return T == O ? 0 : T > O ? 1 : -1;
11355
11362
  });
11356
- for (var v = [], w = 0, I = u.length; w < I; ) {
11357
- var S = w++;
11363
+ for (var v = [], A = 0, I = u.length; A < I; ) {
11364
+ var S = A++;
11358
11365
  v.push(u[S].item1);
11359
11366
  }
11360
11367
  return v;
@@ -11376,8 +11383,8 @@ var Ah = { exports: {} };
11376
11383
  }
11377
11384
  return a;
11378
11385
  }, re.triangleUVFromPoint = function(r, n, a) {
11379
- var l = r.faces[n], u = r.points[l[0]], d = r.points[l[1]], p = r.points[l[2]], _ = r.uvs[l[0]], v = r.uvs[l[1]], w = r.uvs[l[2]], I = m.sub(u, a), S = m.sub(d, a), P = m.sub(p, a), k = m.norm(m.cross(m.sub(u, d), m.sub(u, p))), T = m.norm(m.cross(S, P)) / k, L = m.norm(m.cross(P, I)) / k, C = m.norm(m.cross(I, S)) / k;
11380
- return m.add(m.mul(T, _), m.add(m.mul(L, v), m.mul(C, w)));
11386
+ var l = r.faces[n], u = r.points[l[0]], d = r.points[l[1]], p = r.points[l[2]], _ = r.uvs[l[0]], v = r.uvs[l[1]], A = r.uvs[l[2]], I = m.sub(u, a), S = m.sub(d, a), P = m.sub(p, a), k = m.norm(m.cross(m.sub(u, d), m.sub(u, p))), T = m.norm(m.cross(S, P)) / k, O = m.norm(m.cross(P, I)) / k, C = m.norm(m.cross(I, S)) / k;
11387
+ return m.add(m.mul(T, _), m.add(m.mul(O, v), m.mul(C, A)));
11381
11388
  };
11382
11389
  var Cr = function(r, n) {
11383
11390
  if (this._empty = !1, this._face = -1, n == null) {
@@ -11424,22 +11431,22 @@ var Ah = { exports: {} };
11424
11431
  var d = n.length, p = r(n), _ = p, v;
11425
11432
  if (isNaN(p)) throw new Q("uncmin: f(x0) is a NaN!");
11426
11433
  a = Math.max(a, rt.EPSILON);
11427
- var w, I, S, P = Lt.identity(d), k = 0, T = [], L, C, F, R, U, V, q = "";
11434
+ var A, I, S, P = Lt.identity(d), k = 0, T = [], O, C, F, R, U, V, q = "";
11428
11435
  for (I = l(n); k < u; ) {
11429
11436
  if (!m.all(m.finite(I))) {
11430
11437
  q = "Gradient has Infinity or NaN";
11431
11438
  break;
11432
11439
  }
11433
- if (w = m.neg(Lt.dot(P, I)), !m.all(m.finite(w))) {
11440
+ if (A = m.neg(Lt.dot(P, I)), !m.all(m.finite(A))) {
11434
11441
  q = "Search direction has Infinity or NaN";
11435
11442
  break;
11436
11443
  }
11437
- if (V = m.norm(w), V < a) {
11444
+ if (V = m.norm(A), V < a) {
11438
11445
  q = "Newton step smaller than tol";
11439
11446
  break;
11440
11447
  }
11441
- for (U = 1, v = m.dot(I, w), L = n; k < u && !(U * V < a); ) {
11442
- if (T = m.mul(U, w), L = m.add(n, T), _ = r(L), _ - p >= 0.1 * U * v || isNaN(_)) {
11448
+ for (U = 1, v = m.dot(I, A), O = n; k < u && !(U * V < a); ) {
11449
+ if (T = m.mul(U, A), O = m.add(n, T), _ = r(O), _ - p >= 0.1 * U * v || isNaN(_)) {
11443
11450
  U *= 0.5, ++k;
11444
11451
  continue;
11445
11452
  }
@@ -11453,20 +11460,20 @@ var Ah = { exports: {} };
11453
11460
  q = "maxit reached during line search";
11454
11461
  break;
11455
11462
  }
11456
- S = l(L), C = m.sub(S, I), R = m.dot(C, T), F = Lt.dot(P, C), P = Lt.sub(Lt.add(P, Lt.mul((R + m.dot(C, F)) / (R * R), Xe.tensor(T, T))), Lt.div(Lt.add(Xe.tensor(F, T), Xe.tensor(T, F)), R)), n = L, p = _, I = S, ++k;
11463
+ S = l(O), C = m.sub(S, I), R = m.dot(C, T), F = Lt.dot(P, C), P = Lt.sub(Lt.add(P, Lt.mul((R + m.dot(C, F)) / (R * R), Xe.tensor(T, T))), Lt.div(Lt.add(Xe.tensor(F, T), Xe.tensor(T, F)), R)), n = O, p = _, I = S, ++k;
11457
11464
  }
11458
11465
  return new Kn(n, p, I, P, k, q);
11459
11466
  }, Xe.numericalGradient = function(r, n) {
11460
11467
  var a = n.length, l = r(n);
11461
11468
  if (l == NaN) throw new Q("gradient: f(x) is a NaN!");
11462
- for (var u = n.slice(0), d, p, _ = [], v, w = 1e-3, I, S, P, k = 0, T, L, C, F = 0; F < a; )
11469
+ for (var u = n.slice(0), d, p, _ = [], v, A = 1e-3, I, S, P, k = 0, T, O, C, F = 0; F < a; )
11463
11470
  for (var R = F++, U = Math.max(1e-6 * l, 1e-8); ; ) {
11464
11471
  if (++k, k > 20) throw new Q("Numerical gradient fails");
11465
11472
  if (u[R] = n[R] + U, d = r(u), u[R] = n[R] - U, p = r(u), u[R] = n[R], isNaN(d) || isNaN(p)) {
11466
11473
  U /= 16;
11467
11474
  continue;
11468
11475
  }
11469
- if (_[R] = (d - p) / (2 * U), I = n[R] - U, S = n[R], P = n[R] + U, T = (d - l) / U, L = (l - p) / U, C = m.max([Math.abs(_[R]), Math.abs(l), Math.abs(d), Math.abs(p), Math.abs(I), Math.abs(S), Math.abs(P), 1e-8]), v = Math.min(m.max([Math.abs(T - _[R]), Math.abs(L - _[R]), Math.abs(T - L)]) / C, U / C), v > w) U /= 16;
11476
+ if (_[R] = (d - p) / (2 * U), I = n[R] - U, S = n[R], P = n[R] + U, T = (d - l) / U, O = (l - p) / U, C = m.max([Math.abs(_[R]), Math.abs(l), Math.abs(d), Math.abs(p), Math.abs(I), Math.abs(S), Math.abs(P), 1e-8]), v = Math.min(m.max([Math.abs(T - _[R]), Math.abs(O - _[R]), Math.abs(T - O)]) / C, U / C), v > A) U /= 16;
11470
11477
  else break;
11471
11478
  }
11472
11479
  return _;
@@ -11517,7 +11524,7 @@ var Ah = { exports: {} };
11517
11524
  }, Ne.segmentClosestPoint = function(r, n, a, l, u) {
11518
11525
  var d = m.sub(a, n), p = m.norm(d);
11519
11526
  if (p < rt.EPSILON) return { u: l, pt: n };
11520
- var _ = n, v = m.mul(1 / p, d), w = m.sub(r, _), I = m.dot(w, v);
11527
+ var _ = n, v = m.mul(1 / p, d), A = m.sub(r, _), I = m.dot(A, v);
11521
11528
  return I < 0 ? { u: l, pt: n } : I > p ? { u, pt: a } : { u: l + (u - l) * I / p, pt: m.add(_, m.mul(I, v)) };
11522
11529
  };
11523
11530
  var m = f.core.Vec = function() {
@@ -11525,10 +11532,10 @@ var Ah = { exports: {} };
11525
11532
  b["verb.core.Vec"] = m, m.__name__ = ["verb", "core", "Vec"], m.angleBetween = function(r, n) {
11526
11533
  return Math.acos(m.dot(r, n) / (m.norm(r) * m.norm(n)));
11527
11534
  }, m.positiveAngleBetween = function(r, n, a) {
11528
- var l = m.cross(r, n), u = m.norm(r), d = m.norm(n), p = u * d, _ = m.dot(r, n), v = m.norm(l) / p, w = _ / p, I = Math.atan2(v, w), S = m.dot(a, l);
11535
+ var l = m.cross(r, n), u = m.norm(r), d = m.norm(n), p = u * d, _ = m.dot(r, n), v = m.norm(l) / p, A = _ / p, I = Math.atan2(v, A), S = m.dot(a, l);
11529
11536
  return Math.abs(S) < rt.EPSILON || S > 0 ? I : -I;
11530
11537
  }, m.signedAngleBetween = function(r, n, a) {
11531
- var l = m.cross(r, n), u = m.norm(r), d = m.norm(n), p = u * d, _ = m.dot(r, n), v = m.norm(l) / p, w = _ / p, I = Math.atan2(v, w), S = m.dot(a, l);
11538
+ var l = m.cross(r, n), u = m.norm(r), d = m.norm(n), p = u * d, _ = m.dot(r, n), v = m.norm(l) / p, A = _ / p, I = Math.atan2(v, A), S = m.dot(a, l);
11532
11539
  return S > 0 ? I : 2 * Math.PI - I;
11533
11540
  }, m.angleBetweenNormalized2d = function(r, n) {
11534
11541
  var a = r[0] * n[1] - r[1] * n[0];
@@ -11735,21 +11742,21 @@ var Ah = { exports: {} };
11735
11742
  var a = yt.rationalSurfaceClosestParam(r, n);
11736
11743
  return N.rationalSurfacePoint(r, a[0], a[1]);
11737
11744
  }, yt.rationalSurfaceClosestParam = function(r, n) {
11738
- for (var a = 5, l = 0, u, d = 1e-4, p = 5e-4, _, v = r.knotsU[0], w = $.last(r.knotsU), I = r.knotsV[0], S = $.last(r.knotsV), P = yt.isRationalSurfaceClosed(r), k = yt.isRationalSurfaceClosed(r, !1), T, L = zt.rationalSurfaceAdaptive(r, new Lr()), C = 1 / 0, F = 0, R = L.points.length; F < R; ) {
11739
- var U = F++, V = L.points[U], q = m.normSquared(m.sub(n, V));
11740
- q < C && (C = q, T = L.uvs[U]);
11745
+ for (var a = 5, l = 0, u, d = 1e-4, p = 5e-4, _, v = r.knotsU[0], A = $.last(r.knotsU), I = r.knotsV[0], S = $.last(r.knotsV), P = yt.isRationalSurfaceClosed(r), k = yt.isRationalSurfaceClosed(r, !1), T, O = zt.rationalSurfaceAdaptive(r, new Lr()), C = 1 / 0, F = 0, R = O.points.length; F < R; ) {
11746
+ var U = F++, V = O.points[U], q = m.normSquared(m.sub(n, V));
11747
+ q < C && (C = q, T = O.uvs[U]);
11741
11748
  }
11742
11749
  for (var J = function(jt) {
11743
11750
  return N.rationalSurfaceDerivatives(r, jt[0], jt[1], 2);
11744
11751
  }, H = function(jt, Xt, Dt) {
11745
- var Kt = Xt[1][0], Ae = Xt[0][1], We = Xt[2][0], _e = Xt[0][2], ge = Xt[1][1], Se = Xt[1][1], Le = m.dot(Kt, Dt), $e = m.dot(Ae, Dt), lr = [-Le, -$e], Ze = m.dot(Kt, Kt) + m.dot(We, Dt), Qe = m.dot(Kt, Ae) + m.dot(ge, Dt), Je = m.dot(Kt, Ae) + m.dot(Se, Dt), dr = m.dot(Ae, Ae) + m.dot(_e, Dt), Pn = [[Ze, Qe], [Je, dr]], qr = Lt.solve(Pn, lr);
11752
+ var Kt = Xt[1][0], Ae = Xt[0][1], He = Xt[2][0], _e = Xt[0][2], ge = Xt[1][1], Se = Xt[1][1], Le = m.dot(Kt, Dt), $e = m.dot(Ae, Dt), lr = [-Le, -$e], Ze = m.dot(Kt, Kt) + m.dot(He, Dt), Qe = m.dot(Kt, Ae) + m.dot(ge, Dt), Je = m.dot(Kt, Ae) + m.dot(Se, Dt), dr = m.dot(Ae, Ae) + m.dot(_e, Dt), Pn = [[Ze, Qe], [Je, dr]], qr = Lt.solve(Pn, lr);
11746
11753
  return m.add(qr, jt);
11747
11754
  }; l < a; ) {
11748
11755
  u = J(T), _ = m.sub(u[0][0], n);
11749
11756
  var G = m.norm(_), K = m.dot(u[1][0], _), tt = m.norm(u[1][0]) * G, et = m.dot(u[0][1], _), it = m.norm(u[0][1]) * G, ht = K / tt, at = et / it, ct = G < d, nt = ht < p, mt = at < p;
11750
11757
  if (ct && nt && mt) return T;
11751
11758
  var X = H(T, u, _);
11752
- X[0] < v ? P ? X = [w - (X[0] - v), X[1]] : X = [v + rt.EPSILON, X[1]] : X[0] > w && (P ? X = [v + (X[0] - w), X[1]] : X = [w - rt.EPSILON, X[1]]), X[1] < I ? k ? X = [X[0], S - (X[1] - I)] : X = [X[0], I + rt.EPSILON] : X[1] > S && (k ? X = [X[0], I + (X[0] - S)] : X = [X[0], S - rt.EPSILON]);
11759
+ X[0] < v ? P ? X = [A - (X[0] - v), X[1]] : X = [v + rt.EPSILON, X[1]] : X[0] > A && (P ? X = [v + (X[0] - A), X[1]] : X = [A - rt.EPSILON, X[1]]), X[1] < I ? k ? X = [X[0], S - (X[1] - I)] : X = [X[0], I + rt.EPSILON] : X[1] > S && (k ? X = [X[0], I + (X[0] - S)] : X = [X[0], S - rt.EPSILON]);
11753
11760
  var gt = m.norm(m.mul(X[0] - T[0], u[1][0])), It = m.norm(m.mul(X[1] - T[1], u[0][1]));
11754
11761
  if (gt + It < d) return T;
11755
11762
  T = X, l++;
@@ -11759,15 +11766,15 @@ var Ah = { exports: {} };
11759
11766
  return N.rationalCurvePoint(r, yt.rationalCurveClosestParam(r, n));
11760
11767
  }, yt.rationalCurveClosestParam = function(r, n) {
11761
11768
  for (var a = 1 / 0, l = 0, u = zt.rationalCurveRegularSample(r, r.controlPoints.length * r.degree, !0), d = 0, p = u.length - 1; d < p; ) {
11762
- var _ = d++, v = u[_][0], w = u[_ + 1][0], I = u[_].slice(1), S = u[_ + 1].slice(1), P = Ne.segmentClosestPoint(n, I, S, v, w), k = m.norm(m.sub(n, P.pt));
11769
+ var _ = d++, v = u[_][0], A = u[_ + 1][0], I = u[_].slice(1), S = u[_ + 1].slice(1), P = Ne.segmentClosestPoint(n, I, S, v, A), k = m.norm(m.sub(n, P.pt));
11763
11770
  k < a && (a = k, l = P.u);
11764
11771
  }
11765
- for (var T = 5, L = 0, C, F = 1e-4, R = 5e-4, U, V = r.knots[0], q = $.last(r.knots), J = m.normSquared(m.sub(r.controlPoints[0], $.last(r.controlPoints))) < rt.EPSILON, H = l, G = function(X) {
11772
+ for (var T = 5, O = 0, C, F = 1e-4, R = 5e-4, U, V = r.knots[0], q = $.last(r.knots), J = m.normSquared(m.sub(r.controlPoints[0], $.last(r.controlPoints))) < rt.EPSILON, H = l, G = function(X) {
11766
11773
  return N.rationalCurveDerivatives(r, X, 2);
11767
11774
  }, K = function(X, gt, It) {
11768
11775
  var jt = m.dot(gt[1], It), Xt = m.dot(gt[2], It), Dt = m.dot(gt[1], gt[1]), Kt = Xt + Dt;
11769
11776
  return X - jt / Kt;
11770
- }; L < T; ) {
11777
+ }; O < T; ) {
11771
11778
  C = G(H), U = m.sub(C[0], n);
11772
11779
  var tt = m.norm(U), et = m.dot(C[1], U), it = m.norm(C[1]) * tt, ht = et / it, at = tt < F, ct = Math.abs(ht) < R;
11773
11780
  if (at && ct) return H;
@@ -11775,7 +11782,7 @@ var Ah = { exports: {} };
11775
11782
  nt < V ? J ? nt = q - (nt - V) : nt = V : nt > q && (J ? nt = V + (nt - q) : nt = q);
11776
11783
  var mt = m.norm(m.mul(nt - H, C[1]));
11777
11784
  if (mt < F) return H;
11778
- H = nt, L++;
11785
+ H = nt, O++;
11779
11786
  }
11780
11787
  return H;
11781
11788
  }, yt.rationalCurveParamAtArcLength = function(r, n, a, l, u) {
@@ -11794,9 +11801,9 @@ var Ah = { exports: {} };
11794
11801
  if (n < 0) return r.knots[0];
11795
11802
  var u;
11796
11803
  if (l != null ? u = l : u = yt.rationalBezierCurveArcLength(r), n > u) return $.last(r.knots);
11797
- var d = r.knots[0], p = 0, _ = $.last(r.knots), v = u, w = 0, I = 0, S;
11804
+ var d = r.knots[0], p = 0, _ = $.last(r.knots), v = u, A = 0, I = 0, S;
11798
11805
  for (a != null ? S = a : S = rt.TOLERANCE * 2; v - p > S; )
11799
- w = (d + _) / 2, I = yt.rationalBezierCurveArcLength(r, w), I > n ? (_ = w, v = I) : (d = w, p = I);
11806
+ A = (d + _) / 2, I = yt.rationalBezierCurveArcLength(r, A), I > n ? (_ = A, v = I) : (d = A, p = I);
11800
11807
  return (d + _) / 2;
11801
11808
  }, yt.rationalCurveArcLength = function(r, n, a) {
11802
11809
  a == null && (a = 16), n == null ? n = $.last(r.knots) : n = n;
@@ -11809,8 +11816,8 @@ var Ah = { exports: {} };
11809
11816
  a == null && (a = 16);
11810
11817
  var l;
11811
11818
  n == null ? l = $.last(r.knots) : l = n;
11812
- for (var u = (l - r.knots[0]) / 2, d = 0, p = r.degree + a, _, v, w = 0; w < p; ) {
11813
- var I = w++;
11819
+ for (var u = (l - r.knots[0]) / 2, d = 0, p = r.degree + a, _, v, A = 0; A < p; ) {
11820
+ var I = A++;
11814
11821
  _ = u * yt.Tvalues[p][I] + u + r.knots[0], v = N.rationalCurveDerivatives(r, _, 1), d += yt.Cvalues[p][I] * m.norm(v[1]);
11815
11822
  }
11816
11823
  return u * d;
@@ -11824,9 +11831,9 @@ var Ah = { exports: {} };
11824
11831
  },
11825
11832
  __class__: wn
11826
11833
  };
11827
- var je = f.eval.Check = function() {
11834
+ var We = f.eval.Check = function() {
11828
11835
  };
11829
- b["verb.eval.Check"] = je, je.__name__ = ["verb", "eval", "Check"], je.isValidKnotVector = function(r, n) {
11836
+ b["verb.eval.Check"] = We, We.__name__ = ["verb", "eval", "Check"], We.isValidKnotVector = function(r, n) {
11830
11837
  if (r.length == 0 || r.length < (n + 1) * 2) return !1;
11831
11838
  for (var a = $.first(r), l = 0, u = n + 1; l < u; ) {
11832
11839
  var d = l++;
@@ -11837,23 +11844,23 @@ var Ah = { exports: {} };
11837
11844
  var v = p++;
11838
11845
  if (Math.abs(r[v] - a) > rt.EPSILON) return !1;
11839
11846
  }
11840
- return je.isNonDecreasing(r);
11841
- }, je.isNonDecreasing = function(r) {
11847
+ return We.isNonDecreasing(r);
11848
+ }, We.isNonDecreasing = function(r) {
11842
11849
  for (var n = $.first(r), a = 0, l = r.length; a < l; ) {
11843
11850
  var u = a++;
11844
11851
  if (r[u] < n - rt.EPSILON) return !1;
11845
11852
  n = r[u];
11846
11853
  }
11847
11854
  return !0;
11848
- }, je.isValidNurbsCurveData = function(r) {
11855
+ }, We.isValidNurbsCurveData = function(r) {
11849
11856
  if (r.controlPoints == null) throw new Q("Control points array cannot be null!");
11850
11857
  if (r.degree == null) throw new Q("Degree cannot be null!");
11851
11858
  if (r.degree < 1) throw new Q("Degree must be greater than 1!");
11852
11859
  if (r.knots == null) throw new Q("Knots cannot be null!");
11853
11860
  if (r.knots.length != r.controlPoints.length + r.degree + 1) throw new Q("controlPoints.length + degree + 1 must equal knots.length!");
11854
- if (!je.isValidKnotVector(r.knots, r.degree)) throw new Q("Invalid knot vector format! Should begin with degree + 1 repeats and end with degree + 1 repeats!");
11861
+ if (!We.isValidKnotVector(r.knots, r.degree)) throw new Q("Invalid knot vector format! Should begin with degree + 1 repeats and end with degree + 1 repeats!");
11855
11862
  return r;
11856
- }, je.isValidNurbsSurfaceData = function(r) {
11863
+ }, We.isValidNurbsSurfaceData = function(r) {
11857
11864
  if (r.controlPoints == null) throw new Q("Control points array cannot be null!");
11858
11865
  if (r.degreeU == null) throw new Q("DegreeU cannot be null!");
11859
11866
  if (r.degreeV == null) throw new Q("DegreeV cannot be null!");
@@ -11863,7 +11870,7 @@ var Ah = { exports: {} };
11863
11870
  if (r.knotsV == null) throw new Q("KnotsV cannot be null!");
11864
11871
  if (r.knotsU.length != r.controlPoints.length + r.degreeU + 1) throw new Q("controlPointsU.length + degreeU + 1 must equal knotsU.length!");
11865
11872
  if (r.knotsV.length != r.controlPoints[0].length + r.degreeV + 1) throw new Q("controlPointsV.length + degreeV + 1 must equal knotsV.length!");
11866
- if (!je.isValidKnotVector(r.knotsU, r.degreeU) || !je.isValidKnotVector(r.knotsV, r.degreeV)) throw new Q("Invalid knot vector format! Should begin with degree + 1 repeats and end with degree + 1 repeats!");
11873
+ if (!We.isValidKnotVector(r.knotsU, r.degreeU) || !We.isValidKnotVector(r.knotsV, r.degreeV)) throw new Q("Invalid knot vector format! Should begin with degree + 1 repeats and end with degree + 1 repeats!");
11867
11874
  return r;
11868
11875
  };
11869
11876
  var oe = f.eval.Divide = function() {
@@ -11872,12 +11879,12 @@ var Ah = { exports: {} };
11872
11879
  a == null && (a = !1);
11873
11880
  var l, u, d;
11874
11881
  a ? (d = r.controlPoints, l = r.knotsV, u = r.degreeV) : (d = Lt.transpose(r.controlPoints), l = r.knotsU, u = r.degreeU);
11875
- for (var p, _ = [], v = 0, w = u + 1; v < w; )
11882
+ for (var p, _ = [], v = 0, A = u + 1; v < A; )
11876
11883
  v++, _.push(n);
11877
11884
  p = _;
11878
11885
  for (var I = [], S = [], P = N.knotSpan(u, n, l), k = null, T = 0; T < d.length; ) {
11879
- var L = d[T];
11880
- ++T, k = ft.curveKnotRefine(new Gt(u, l, L), p), I.push(k.controlPoints.slice(0, P + 1)), S.push(k.controlPoints.slice(P + 1));
11886
+ var O = d[T];
11887
+ ++T, k = ft.curveKnotRefine(new Gt(u, l, O), p), I.push(k.controlPoints.slice(0, P + 1)), S.push(k.controlPoints.slice(P + 1));
11881
11888
  }
11882
11889
  var C = k.knots.slice(0, P + u + 2), F = k.knots.slice(P + 1);
11883
11890
  return a ? [new te(r.degreeU, u, r.knotsU.slice(), C, I), new te(r.degreeU, u, r.knotsU.slice(), F, S)] : (I = Lt.transpose(I), S = Lt.transpose(S), [new te(u, r.degreeV, C, r.knotsV.slice(), I), new te(u, r.degreeV, F, r.knotsV.slice(), S)]);
@@ -11887,7 +11894,7 @@ var Ah = { exports: {} };
11887
11894
  for (var l = r.knots, u, d = [], p = 0, _ = a + 1; p < _; )
11888
11895
  p++, d.push(n);
11889
11896
  u = d;
11890
- var v = ft.curveKnotRefine(r, u), w = N.knotSpan(a, n, l), I = v.knots.slice(0, w + a + 2), S = v.knots.slice(w + 1), P = v.controlPoints.slice(0, w + 1), k = v.controlPoints.slice(w + 1);
11897
+ var v = ft.curveKnotRefine(r, u), A = N.knotSpan(a, n, l), I = v.knots.slice(0, A + a + 2), S = v.knots.slice(A + 1), P = v.controlPoints.slice(0, A + 1), k = v.controlPoints.slice(A + 1);
11891
11898
  return [new Gt(a, I, P), new Gt(a, S, k)];
11892
11899
  }, oe.rationalCurveByEqualArcLength = function(r, n) {
11893
11900
  var a = yt.rationalCurveArcLength(r), l = a / n;
@@ -11897,8 +11904,8 @@ var Ah = { exports: {} };
11897
11904
  return yt.rationalBezierCurveArcLength(P);
11898
11905
  }), u = m.sum(l), d = [new An(r.knots[0], 0)];
11899
11906
  if (n > u) return d;
11900
- for (var p = n, _ = 0, v = p, w = 0, I = 0, S; _ < a.length; ) {
11901
- for (w += l[_]; v < w + rt.EPSILON; )
11907
+ for (var p = n, _ = 0, v = p, A = 0, I = 0, S; _ < a.length; ) {
11908
+ for (A += l[_]; v < A + rt.EPSILON; )
11902
11909
  S = yt.rationalBezierCurveParamAtArcLength(a[_], v - I, rt.TOLERANCE, l[_]), d.push(new An(S, v)), v += p;
11903
11910
  I += l[_], _++;
11904
11911
  }
@@ -11920,24 +11927,24 @@ var Ah = { exports: {} };
11920
11927
  return m.cross(l[1][0], l[0][1]);
11921
11928
  }, N.rationalSurfaceDerivatives = function(r, n, a, l) {
11922
11929
  l == null && (l = 1);
11923
- for (var u = N.surfaceDerivatives(r, n, a, l), d = N.rational2d(u), p = N.weight2d(u), _ = [], v = d[0][0].length, w = 0, I = l + 1; w < I; ) {
11924
- var S = w++;
11930
+ for (var u = N.surfaceDerivatives(r, n, a, l), d = N.rational2d(u), p = N.weight2d(u), _ = [], v = d[0][0].length, A = 0, I = l + 1; A < I; ) {
11931
+ var S = A++;
11925
11932
  _.push([]);
11926
11933
  for (var P = 0, k = l - S + 1; P < k; ) {
11927
- for (var T = P++, L = d[S][T], C = 1, F = T + 1; C < F; ) {
11934
+ for (var T = P++, O = d[S][T], C = 1, F = T + 1; C < F; ) {
11928
11935
  var R = C++;
11929
- m.subMulMutate(L, Ft.get(T, R) * p[0][R], _[S][T - R]);
11936
+ m.subMulMutate(O, Ft.get(T, R) * p[0][R], _[S][T - R]);
11930
11937
  }
11931
11938
  for (var U = 1, V = S + 1; U < V; ) {
11932
11939
  var q = U++;
11933
- m.subMulMutate(L, Ft.get(S, q) * p[q][0], _[S - q][T]);
11940
+ m.subMulMutate(O, Ft.get(S, q) * p[q][0], _[S - q][T]);
11934
11941
  for (var J = m.zeros1d(v), H = 1, G = T + 1; H < G; ) {
11935
11942
  var K = H++;
11936
11943
  m.addMulMutate(J, Ft.get(T, K) * p[q][K], _[S - q][T - K]);
11937
11944
  }
11938
- m.subMulMutate(L, Ft.get(S, q), J);
11945
+ m.subMulMutate(O, Ft.get(S, q), J);
11939
11946
  }
11940
- m.mulMutate(1 / p[0][0], L), _[S].push(L);
11947
+ m.mulMutate(1 / p[0][0], O), _[S].push(O);
11941
11948
  }
11942
11949
  }
11943
11950
  return _;
@@ -11946,9 +11953,9 @@ var Ah = { exports: {} };
11946
11953
  }, N.rationalCurveDerivatives = function(r, n, a) {
11947
11954
  a == null && (a = 1);
11948
11955
  for (var l = N.curveDerivatives(r, n, a), u = N.rational1d(l), d = N.weight1d(l), p = [], _ = 0, v = a + 1; _ < v; ) {
11949
- for (var w = _++, I = u[w], S = 1, P = w + 1; S < P; ) {
11956
+ for (var A = _++, I = u[A], S = 1, P = A + 1; S < P; ) {
11950
11957
  var k = S++;
11951
- m.subMulMutate(I, Ft.get(w, k) * d[k], p[w - k]);
11958
+ m.subMulMutate(I, Ft.get(A, k) * d[k], p[A - k]);
11952
11959
  }
11953
11960
  m.mulMutate(1 / d[0], I), p.push(I);
11954
11961
  }
@@ -11959,19 +11966,19 @@ var Ah = { exports: {} };
11959
11966
  var u = r.knotsU.length - r.degreeU - 2, d = r.knotsV.length - r.degreeV - 2;
11960
11967
  return N.surfaceDerivativesGivenNM(u, d, r, n, a, l);
11961
11968
  }, N.surfaceDerivativesGivenNM = function(r, n, a, l, u, d) {
11962
- var p = a.degreeU, _ = a.degreeV, v = a.controlPoints, w = a.knotsU, I = a.knotsV;
11963
- if (!N.areValidRelations(p, v.length, w.length) || !N.areValidRelations(_, v[0].length, I.length)) throw new Q("Invalid relations between control points, knot vector, and n");
11969
+ var p = a.degreeU, _ = a.degreeV, v = a.controlPoints, A = a.knotsU, I = a.knotsV;
11970
+ if (!N.areValidRelations(p, v.length, A.length) || !N.areValidRelations(_, v[0].length, I.length)) throw new Q("Invalid relations between control points, knot vector, and n");
11964
11971
  var S = v[0][0].length, P;
11965
11972
  d < p ? P = d : P = p;
11966
11973
  var k;
11967
11974
  d < _ ? k = d : k = _;
11968
- for (var T = m.zeros3d(d + 1, d + 1, S), L = N.knotSpanGivenN(r, p, l, w), C = N.knotSpanGivenN(n, _, u, I), F = N.derivativeBasisFunctionsGivenNI(L, l, p, r, w), R = N.derivativeBasisFunctionsGivenNI(C, u, _, n, I), U = m.zeros2d(_ + 1, S), V = 0, q = 0, J = P + 1; q < J; ) {
11975
+ for (var T = m.zeros3d(d + 1, d + 1, S), O = N.knotSpanGivenN(r, p, l, A), C = N.knotSpanGivenN(n, _, u, I), F = N.derivativeBasisFunctionsGivenNI(O, l, p, r, A), R = N.derivativeBasisFunctionsGivenNI(C, u, _, n, I), U = m.zeros2d(_ + 1, S), V = 0, q = 0, J = P + 1; q < J; ) {
11969
11976
  for (var H = q++, G = 0, K = _ + 1; G < K; ) {
11970
11977
  var tt = G++;
11971
11978
  U[tt] = m.zeros1d(S);
11972
11979
  for (var et = 0, it = p + 1; et < it; ) {
11973
11980
  var ht = et++;
11974
- m.addMulMutate(U[tt], F[H][ht], v[L - p + ht][C - _ + tt]);
11981
+ m.addMulMutate(U[tt], F[H][ht], v[O - p + ht][C - _ + tt]);
11975
11982
  }
11976
11983
  }
11977
11984
  var at = d - H;
@@ -11990,36 +11997,36 @@ var Ah = { exports: {} };
11990
11997
  var l = r.knotsU.length - r.degreeU - 2, u = r.knotsV.length - r.degreeV - 2;
11991
11998
  return N.surfacePointGivenNM(l, u, r, n, a);
11992
11999
  }, N.surfacePointGivenNM = function(r, n, a, l, u) {
11993
- var d = a.degreeU, p = a.degreeV, _ = a.controlPoints, v = a.knotsU, w = a.knotsV;
11994
- if (!N.areValidRelations(d, _.length, v.length) || !N.areValidRelations(p, _[0].length, w.length)) throw new Q("Invalid relations between control points, knot vector, and n");
11995
- for (var I = _[0][0].length, S = N.knotSpanGivenN(r, d, l, v), P = N.knotSpanGivenN(n, p, u, w), k = N.basisFunctionsGivenKnotSpanIndex(S, l, d, v), T = N.basisFunctionsGivenKnotSpanIndex(P, u, p, w), L = S - d, C = P, F = m.zeros1d(I), R = m.zeros1d(I), U = 0, V = p + 1; U < V; ) {
12000
+ var d = a.degreeU, p = a.degreeV, _ = a.controlPoints, v = a.knotsU, A = a.knotsV;
12001
+ if (!N.areValidRelations(d, _.length, v.length) || !N.areValidRelations(p, _[0].length, A.length)) throw new Q("Invalid relations between control points, knot vector, and n");
12002
+ for (var I = _[0][0].length, S = N.knotSpanGivenN(r, d, l, v), P = N.knotSpanGivenN(n, p, u, A), k = N.basisFunctionsGivenKnotSpanIndex(S, l, d, v), T = N.basisFunctionsGivenKnotSpanIndex(P, u, p, A), O = S - d, C = P, F = m.zeros1d(I), R = m.zeros1d(I), U = 0, V = p + 1; U < V; ) {
11996
12003
  var q = U++;
11997
12004
  R = m.zeros1d(I), C = P - p + q;
11998
12005
  for (var J = 0, H = d + 1; J < H; ) {
11999
12006
  var G = J++;
12000
- m.addMulMutate(R, k[G], _[L + G][C]);
12007
+ m.addMulMutate(R, k[G], _[O + G][C]);
12001
12008
  }
12002
12009
  m.addMulMutate(F, T[q], R);
12003
12010
  }
12004
12011
  return F;
12005
12012
  }, N.curveRegularSamplePoints = function(r, n) {
12006
- for (var a = N.curveDerivatives(r, r.knots[0], r.degree), l = 1 / n, u = l * l, d = a[0], p = m.mul(l, a[1]), _ = m.mul(u * 0.5, a[2]), v = m.mul(u * l * 0.5, a[3]), w = m.add(_, _), I = m.add(v, v), S = m.mul(0.3333333333333333, v), P = [], k = 0, T = n + 1; k < T; )
12007
- k++, P.push(N.dehomogenize(d)), m.addAllMutate([d, p, _, S]), m.addAllMutate([p, w, v]), m.addAllMutate([w, I]), m.addAllMutate([_, v]);
12013
+ for (var a = N.curveDerivatives(r, r.knots[0], r.degree), l = 1 / n, u = l * l, d = a[0], p = m.mul(l, a[1]), _ = m.mul(u * 0.5, a[2]), v = m.mul(u * l * 0.5, a[3]), A = m.add(_, _), I = m.add(v, v), S = m.mul(0.3333333333333333, v), P = [], k = 0, T = n + 1; k < T; )
12014
+ k++, P.push(N.dehomogenize(d)), m.addAllMutate([d, p, _, S]), m.addAllMutate([p, A, v]), m.addAllMutate([A, I]), m.addAllMutate([_, v]);
12008
12015
  return P;
12009
12016
  }, N.curveRegularSamplePoints2 = function(r, n) {
12010
- for (var a = N.curveDerivatives(r, r.knots[0], r.degree), l = 1 / n, u = l * l, d = a[0], p = m.mul(l, a[1]), _ = m.mul(u * 0.5, a[2]), v = m.mul(u * l * 0.5, a[3]), w = m.add(_, _), I = m.add(v, v), S = m.mul(0.3333333333333333, v), P = [], k = 0, T = n + 1; k < T; )
12011
- k++, P.push(N.dehomogenize(d)), m.addAllMutate([d, p, _, S]), m.addAllMutate([p, w, v]), m.addAllMutate([w, I]), m.addAllMutate([_, v]);
12017
+ for (var a = N.curveDerivatives(r, r.knots[0], r.degree), l = 1 / n, u = l * l, d = a[0], p = m.mul(l, a[1]), _ = m.mul(u * 0.5, a[2]), v = m.mul(u * l * 0.5, a[3]), A = m.add(_, _), I = m.add(v, v), S = m.mul(0.3333333333333333, v), P = [], k = 0, T = n + 1; k < T; )
12018
+ k++, P.push(N.dehomogenize(d)), m.addAllMutate([d, p, _, S]), m.addAllMutate([p, A, v]), m.addAllMutate([A, I]), m.addAllMutate([_, v]);
12012
12019
  return P;
12013
12020
  }, N.rationalSurfaceRegularSampleDerivatives = function(r, n, a, l) {
12014
- for (var u = N.surfaceRegularSampleDerivatives(r, n, a, l), d = [], p = n + 1, _ = a + 1, v = l + 1, w = 0; w < p; ) {
12015
- var I = w++, S = [];
12021
+ for (var u = N.surfaceRegularSampleDerivatives(r, n, a, l), d = [], p = n + 1, _ = a + 1, v = l + 1, A = 0; A < p; ) {
12022
+ var I = A++, S = [];
12016
12023
  d.push(S);
12017
12024
  for (var P = 0; P < _; ) {
12018
- for (var k = P++, T = u[I][k], L = N.rational2d(T), C = N.weight2d(T), F = [], R = L[0][0].length, U = 0; U < v; ) {
12025
+ for (var k = P++, T = u[I][k], O = N.rational2d(T), C = N.weight2d(T), F = [], R = O[0][0].length, U = 0; U < v; ) {
12019
12026
  var V = U++;
12020
12027
  F.push([]);
12021
12028
  for (var q = 0, J = v - V; q < J; ) {
12022
- for (var H = q++, G = L[V][H], K = 1, tt = H + 1; K < tt; ) {
12029
+ for (var H = q++, G = O[V][H], K = 1, tt = H + 1; K < tt; ) {
12023
12030
  var et = K++;
12024
12031
  m.subMulMutate(G, Ft.get(H, et) * C[0][et], F[V][H - et]);
12025
12032
  }
@@ -12040,14 +12047,14 @@ var Ah = { exports: {} };
12040
12047
  }
12041
12048
  return d;
12042
12049
  }, N.surfaceRegularSampleDerivatives = function(r, n, a, l) {
12043
- var u = r.degreeU, d = r.degreeV, p = r.controlPoints, _ = r.knotsU, v = r.knotsV, w = p[0][0].length;
12050
+ var u = r.degreeU, d = r.degreeV, p = r.controlPoints, _ = r.knotsU, v = r.knotsV, A = p[0][0].length;
12044
12051
  ($.last(_) - _[0]) / n, ($.last(v) - v[0]) / a;
12045
- for (var I = N.regularlySpacedDerivativeBasisFunctions(u, _, n), S = I.item0, P = I.item1, k = N.regularlySpacedDerivativeBasisFunctions(d, v, a), T = k.item0, L = k.item1, C = [], F = n + 1, R = a + 1, U = 0; U < F; ) {
12052
+ for (var I = N.regularlySpacedDerivativeBasisFunctions(u, _, n), S = I.item0, P = I.item1, k = N.regularlySpacedDerivativeBasisFunctions(d, v, a), T = k.item0, O = k.item1, C = [], F = n + 1, R = a + 1, U = 0; U < F; ) {
12046
12053
  var V = U++, q = [];
12047
12054
  C.push(q);
12048
12055
  for (var J = 0; J < R; ) {
12049
12056
  var H = J++;
12050
- q.push(N.surfaceDerivativesGivenBasesKnotSpans(u, d, p, S[V], T[H], P[V], L[H], w, l));
12057
+ q.push(N.surfaceDerivativesGivenBasesKnotSpans(u, d, p, S[V], T[H], P[V], O[H], A, l));
12051
12058
  }
12052
12059
  }
12053
12060
  return C;
@@ -12056,47 +12063,47 @@ var Ah = { exports: {} };
12056
12063
  }, N.surfaceRegularSamplePoints = function(r, n, a) {
12057
12064
  var l = r.degreeU, u = r.degreeV, d = r.controlPoints, p = r.knotsU, _ = r.knotsV, v = d[0][0].length;
12058
12065
  ($.last(p) - p[0]) / n, ($.last(_) - _[0]) / a;
12059
- for (var w = N.regularlySpacedBasisFunctions(l, p, n), I = w.item0, S = w.item1, P = N.regularlySpacedBasisFunctions(u, _, a), k = P.item0, T = P.item1, L = [], C = n + 1, F = a + 1, R = 0; R < C; ) {
12066
+ for (var A = N.regularlySpacedBasisFunctions(l, p, n), I = A.item0, S = A.item1, P = N.regularlySpacedBasisFunctions(u, _, a), k = P.item0, T = P.item1, O = [], C = n + 1, F = a + 1, R = 0; R < C; ) {
12060
12067
  var U = R++, V = [];
12061
- L.push(V);
12068
+ O.push(V);
12062
12069
  for (var q = 0; q < F; ) {
12063
12070
  var J = q++;
12064
12071
  V.push(N.surfacePointGivenBasesKnotSpans(l, u, d, I[U], k[J], S[U], T[J], v));
12065
12072
  }
12066
12073
  }
12067
- return L;
12074
+ return O;
12068
12075
  }, N.regularlySpacedBasisFunctions = function(r, n, a) {
12069
- for (var l = n.length - r - 2, u = ($.last(n) - n[0]) / a, d = [], p = [], _ = n[0], v = N.knotSpanGivenN(l, r, _, n), w = a + 1, I = 0; I < w; ) {
12076
+ for (var l = n.length - r - 2, u = ($.last(n) - n[0]) / a, d = [], p = [], _ = n[0], v = N.knotSpanGivenN(l, r, _, n), A = a + 1, I = 0; I < A; ) {
12070
12077
  for (I++; _ >= n[v + 1]; ) v++;
12071
12078
  p.push(v), d.push(N.basisFunctionsGivenKnotSpanIndex(v, _, r, n)), _ += u;
12072
12079
  }
12073
12080
  return new ee(p, d);
12074
12081
  }, N.regularlySpacedDerivativeBasisFunctions = function(r, n, a) {
12075
- for (var l = n.length - r - 2, u = ($.last(n) - n[0]) / a, d = [], p = [], _ = n[0], v = N.knotSpanGivenN(l, r, _, n), w = a + 1, I = 0; I < w; ) {
12082
+ for (var l = n.length - r - 2, u = ($.last(n) - n[0]) / a, d = [], p = [], _ = n[0], v = N.knotSpanGivenN(l, r, _, n), A = a + 1, I = 0; I < A; ) {
12076
12083
  for (I++; _ >= n[v + 1]; ) v++;
12077
12084
  p.push(v), d.push(N.derivativeBasisFunctionsGivenNI(v, _, r, l, n)), _ += u;
12078
12085
  }
12079
12086
  return new ee(p, d);
12080
12087
  }, N.surfacePointGivenBasesKnotSpans = function(r, n, a, l, u, d, p, _) {
12081
- for (var v = m.zeros1d(_), w, I = l - r, S = u - n, P = 0, k = n + 1; P < k; ) {
12088
+ for (var v = m.zeros1d(_), A, I = l - r, S = u - n, P = 0, k = n + 1; P < k; ) {
12082
12089
  var T = P++;
12083
- w = m.zeros1d(_);
12084
- for (var L = 0, C = r + 1; L < C; ) {
12085
- var F = L++;
12086
- m.addMulMutate(w, d[F], a[I + F][S]);
12090
+ A = m.zeros1d(_);
12091
+ for (var O = 0, C = r + 1; O < C; ) {
12092
+ var F = O++;
12093
+ m.addMulMutate(A, d[F], a[I + F][S]);
12087
12094
  }
12088
- S++, m.addMulMutate(v, p[T], w);
12095
+ S++, m.addMulMutate(v, p[T], A);
12089
12096
  }
12090
12097
  return v;
12091
12098
  }, N.surfaceDerivativesGivenBasesKnotSpans = function(r, n, a, l, u, d, p, _, v) {
12092
- var w = a[0][0].length, I;
12099
+ var A = a[0][0].length, I;
12093
12100
  v < r ? I = v : I = r;
12094
12101
  var S;
12095
12102
  v < n ? S = v : S = n;
12096
- for (var P = m.zeros3d(I + 1, S + 1, w), k = m.zeros2d(n + 1, w), T = 0, L = 0, C = I + 1; L < C; ) {
12097
- for (var F = L++, R = 0, U = n + 1; R < U; ) {
12103
+ for (var P = m.zeros3d(I + 1, S + 1, A), k = m.zeros2d(n + 1, A), T = 0, O = 0, C = I + 1; O < C; ) {
12104
+ for (var F = O++, R = 0, U = n + 1; R < U; ) {
12098
12105
  var V = R++;
12099
- k[V] = m.zeros1d(w);
12106
+ k[V] = m.zeros1d(A);
12100
12107
  for (var q = 0, J = r + 1; q < J; ) {
12101
12108
  var H = q++;
12102
12109
  m.addMulMutate(k[V], d[F][H], a[l - r + H][u - n + V]);
@@ -12106,7 +12113,7 @@ var Ah = { exports: {} };
12106
12113
  G < S ? T = G : T = S;
12107
12114
  for (var K = 0, tt = T + 1; K < tt; ) {
12108
12115
  var et = K++;
12109
- P[F][et] = m.zeros1d(w);
12116
+ P[F][et] = m.zeros1d(A);
12110
12117
  for (var it = 0, ht = n + 1; it < ht; ) {
12111
12118
  var at = it++;
12112
12119
  m.addMulMutate(P[F][et], p[et][at], k[at]);
@@ -12122,12 +12129,12 @@ var Ah = { exports: {} };
12122
12129
  if (!N.areValidRelations(u, d.length, p.length)) throw new Q("Invalid relations between control points, knot vector, and n");
12123
12130
  var _ = d[0].length, v;
12124
12131
  l < u ? v = l : v = u;
12125
- for (var w = m.zeros2d(l + 1, _), I = N.knotSpanGivenN(r, u, a, p), S = N.derivativeBasisFunctionsGivenNI(I, a, u, v, p), P = 0, k = v + 1; P < k; )
12126
- for (var T = P++, L = 0, C = u + 1; L < C; ) {
12127
- var F = L++;
12128
- m.addMulMutate(w[T], S[T][F], d[I - u + F]);
12132
+ for (var A = m.zeros2d(l + 1, _), I = N.knotSpanGivenN(r, u, a, p), S = N.derivativeBasisFunctionsGivenNI(I, a, u, v, p), P = 0, k = v + 1; P < k; )
12133
+ for (var T = P++, O = 0, C = u + 1; O < C; ) {
12134
+ var F = O++;
12135
+ m.addMulMutate(A[T], S[T][F], d[I - u + F]);
12129
12136
  }
12130
- return w;
12137
+ return A;
12131
12138
  }, N.curvePoint = function(r, n) {
12132
12139
  var a = r.knots.length - r.degree - 2;
12133
12140
  return N.curvePointGivenN(a, r, n);
@@ -12137,8 +12144,8 @@ var Ah = { exports: {} };
12137
12144
  var l = n.degree, u = n.controlPoints, d = n.knots;
12138
12145
  if (!N.areValidRelations(l, u.length, d.length))
12139
12146
  throw new Q("Invalid relations between control points, knot Array, and n");
12140
- for (var p = N.knotSpanGivenN(r, l, a, d), _ = N.basisFunctionsGivenKnotSpanIndex(p, a, l, d), v = m.zeros1d(u[0].length), w = 0, I = l + 1; w < I; ) {
12141
- var S = w++;
12147
+ for (var p = N.knotSpanGivenN(r, l, a, d), _ = N.basisFunctionsGivenKnotSpanIndex(p, a, l, d), v = m.zeros1d(u[0].length), A = 0, I = l + 1; A < I; ) {
12148
+ var S = A++;
12142
12149
  m.addMulMutate(v, _[S], u[p - l + S]);
12143
12150
  }
12144
12151
  return v;
@@ -12147,13 +12154,13 @@ var Ah = { exports: {} };
12147
12154
  return N.volumePointGivenNML(r, u, d, p, n, a, l);
12148
12155
  }, N.volumePointGivenNML = function(r, n, a, l, u, d, p) {
12149
12156
  if (!N.areValidRelations(r.degreeU, r.controlPoints.length, r.knotsU.length) || !N.areValidRelations(r.degreeV, r.controlPoints[0].length, r.knotsV.length) || !N.areValidRelations(r.degreeW, r.controlPoints[0][0].length, r.knotsW.length)) throw new Q("Invalid relations between control points and knot vector");
12150
- for (var _ = r.controlPoints, v = r.degreeU, w = r.degreeV, I = r.degreeW, S = r.knotsU, P = r.knotsV, k = r.knotsW, T = _[0][0][0].length, L = N.knotSpanGivenN(n, v, u, S), C = N.knotSpanGivenN(a, w, d, P), F = N.knotSpanGivenN(l, I, p, k), R = N.basisFunctionsGivenKnotSpanIndex(L, u, v, S), U = N.basisFunctionsGivenKnotSpanIndex(C, d, w, P), V = N.basisFunctionsGivenKnotSpanIndex(F, p, I, k), q = L - v, J = m.zeros1d(T), H = m.zeros1d(T), G = m.zeros1d(T), K = 0, tt = I + 1; K < tt; ) {
12157
+ for (var _ = r.controlPoints, v = r.degreeU, A = r.degreeV, I = r.degreeW, S = r.knotsU, P = r.knotsV, k = r.knotsW, T = _[0][0][0].length, O = N.knotSpanGivenN(n, v, u, S), C = N.knotSpanGivenN(a, A, d, P), F = N.knotSpanGivenN(l, I, p, k), R = N.basisFunctionsGivenKnotSpanIndex(O, u, v, S), U = N.basisFunctionsGivenKnotSpanIndex(C, d, A, P), V = N.basisFunctionsGivenKnotSpanIndex(F, p, I, k), q = O - v, J = m.zeros1d(T), H = m.zeros1d(T), G = m.zeros1d(T), K = 0, tt = I + 1; K < tt; ) {
12151
12158
  var et = K++;
12152
12159
  G = m.zeros1d(T);
12153
- for (var it = F - I + et, ht = 0, at = w + 1; ht < at; ) {
12160
+ for (var it = F - I + et, ht = 0, at = A + 1; ht < at; ) {
12154
12161
  var ct = ht++;
12155
12162
  H = m.zeros1d(T);
12156
- for (var nt = C - w + ct, mt = 0, X = v + 1; mt < X; ) {
12163
+ for (var nt = C - A + ct, mt = 0, X = v + 1; mt < X; ) {
12157
12164
  var gt = mt++;
12158
12165
  m.addMulMutate(H, R[gt], _[q + gt][nt][it]);
12159
12166
  }
@@ -12166,20 +12173,20 @@ var Ah = { exports: {} };
12166
12173
  var l = N.knotSpan(n, r, a), u = a.length - 1, d = u - n - 1;
12167
12174
  return N.derivativeBasisFunctionsGivenNI(l, r, n, d, a);
12168
12175
  }, N.derivativeBasisFunctionsGivenNI = function(r, n, a, l, u) {
12169
- var d = m.zeros2d(a + 1, a + 1), p = m.zeros1d(a + 1), _ = m.zeros1d(a + 1), v = 0, w = 0;
12176
+ var d = m.zeros2d(a + 1, a + 1), p = m.zeros1d(a + 1), _ = m.zeros1d(a + 1), v = 0, A = 0;
12170
12177
  d[0][0] = 1;
12171
12178
  for (var I = 1, S = a + 1; I < S; ) {
12172
12179
  var P = I++;
12173
12180
  p[P] = n - u[r + 1 - P], _[P] = u[r + P] - n, v = 0;
12174
12181
  for (var k = 0; k < P; ) {
12175
12182
  var T = k++;
12176
- d[P][T] = _[T + 1] + p[P - T], w = d[T][P - 1] / d[P][T], d[T][P] = v + _[T + 1] * w, v = p[P - T] * w;
12183
+ d[P][T] = _[T + 1] + p[P - T], A = d[T][P - 1] / d[P][T], d[T][P] = v + _[T + 1] * A, v = p[P - T] * A;
12177
12184
  }
12178
12185
  d[P][P] = v;
12179
12186
  }
12180
- for (var L = m.zeros2d(l + 1, a + 1), C = m.zeros2d(2, a + 1), F = 0, R = 1, U = 0, V = 0, q = 0, J = 0, H = 0, G = 0, K = a + 1; G < K; ) {
12187
+ for (var O = m.zeros2d(l + 1, a + 1), C = m.zeros2d(2, a + 1), F = 0, R = 1, U = 0, V = 0, q = 0, J = 0, H = 0, G = 0, K = a + 1; G < K; ) {
12181
12188
  var tt = G++;
12182
- L[0][tt] = d[tt][a];
12189
+ O[0][tt] = d[tt][a];
12183
12190
  }
12184
12191
  for (var et = 0, it = a + 1; et < it; ) {
12185
12192
  var ht = et++;
@@ -12191,27 +12198,27 @@ var Ah = { exports: {} };
12191
12198
  var gt = mt++;
12192
12199
  C[R][gt] = (C[F][gt] - C[F][gt - 1]) / d[q + 1][V + gt], U += C[R][gt] * d[V + gt][q];
12193
12200
  }
12194
- ht <= q && (C[R][nt] = -C[F][nt - 1] / d[q + 1][ht], U += C[R][nt] * d[ht][q]), L[nt][ht] = U;
12201
+ ht <= q && (C[R][nt] = -C[F][nt - 1] / d[q + 1][ht], U += C[R][nt] * d[ht][q]), O[nt][ht] = U;
12195
12202
  var It = F;
12196
12203
  F = R, R = It;
12197
12204
  }
12198
12205
  }
12199
12206
  for (var jt = a, Xt = 1, Dt = l + 1; Xt < Dt; ) {
12200
- for (var Kt = Xt++, Ae = 0, We = a + 1; Ae < We; ) {
12207
+ for (var Kt = Xt++, Ae = 0, He = a + 1; Ae < He; ) {
12201
12208
  var _e = Ae++;
12202
- L[Kt][_e] *= jt;
12209
+ O[Kt][_e] *= jt;
12203
12210
  }
12204
12211
  jt *= a - Kt;
12205
12212
  }
12206
- return L;
12213
+ return O;
12207
12214
  }, N.basisFunctions = function(r, n, a) {
12208
12215
  var l = N.knotSpan(n, r, a);
12209
12216
  return N.basisFunctionsGivenKnotSpanIndex(l, r, n, a);
12210
12217
  }, N.basisFunctionsGivenKnotSpanIndex = function(r, n, a, l) {
12211
12218
  var u = m.zeros1d(a + 1), d = m.zeros1d(a + 1), p = m.zeros1d(a + 1), _ = 0, v = 0;
12212
12219
  u[0] = 1;
12213
- for (var w = 1, I = a + 1; w < I; ) {
12214
- var S = w++;
12220
+ for (var A = 1, I = a + 1; A < I; ) {
12221
+ var S = A++;
12215
12222
  d[S] = n - l[r + 1 - S], p[S] = l[r + S] - n, _ = 0;
12216
12223
  for (var P = 0; P < S; ) {
12217
12224
  var k = P++;
@@ -12256,8 +12263,8 @@ var Ah = { exports: {} };
12256
12263
  var a = r.length, l = r[0].length, u = [], d = 0, p = [], _;
12257
12264
  n != null ? _ = n : _ = m.rep(r.length, 1);
12258
12265
  for (var v = 0; v < a; ) {
12259
- var w = v++, I = [];
12260
- p = r[w], d = _[w];
12266
+ var A = v++, I = [];
12267
+ p = r[A], d = _[A];
12261
12268
  for (var S = 0; S < l; ) {
12262
12269
  var P = S++;
12263
12270
  I.push(p[P] * d);
@@ -12293,12 +12300,12 @@ var Ah = { exports: {} };
12293
12300
  }), 3);
12294
12301
  });
12295
12302
  }, lt.surfacesAtPointWithEstimate = function(r, n, a, l, u) {
12296
- var d, p, _, v, w, I, S, P, k, T, L, C, F, R = 5, U = 0;
12303
+ var d, p, _, v, A, I, S, P, k, T, O, C, F, R = 5, U = 0;
12297
12304
  do {
12298
- if (d = N.rationalSurfaceDerivatives(r, a[0], a[1], 1), p = d[0][0], v = d[1][0], w = d[0][1], _ = m.normalized(m.cross(v, w)), I = m.dot(_, p), S = N.rationalSurfaceDerivatives(n, l[0], l[1], 1), P = S[0][0], T = S[1][0], L = S[0][1], k = m.normalized(m.cross(T, L)), C = m.dot(k, P), F = m.distSquared(p, P), F < u * u) break;
12305
+ if (d = N.rationalSurfaceDerivatives(r, a[0], a[1], 1), p = d[0][0], v = d[1][0], A = d[0][1], _ = m.normalized(m.cross(v, A)), I = m.dot(_, p), S = N.rationalSurfaceDerivatives(n, l[0], l[1], 1), P = S[0][0], T = S[1][0], O = S[0][1], k = m.normalized(m.cross(T, O)), C = m.dot(k, P), F = m.distSquared(p, P), F < u * u) break;
12299
12306
  var V = m.normalized(m.cross(_, k)), q = m.dot(V, p), J = lt.threePlanes(_, I, k, C, V, q);
12300
12307
  if (J == null) throw new Q("panic!");
12301
- var H = m.sub(J, p), G = m.sub(J, P), K = m.cross(v, _), tt = m.cross(w, _), et = m.cross(T, k), it = m.cross(L, k), ht = m.dot(tt, H) / m.dot(tt, v), at = m.dot(K, H) / m.dot(K, w), ct = m.dot(it, G) / m.dot(it, T), nt = m.dot(et, G) / m.dot(et, L);
12308
+ var H = m.sub(J, p), G = m.sub(J, P), K = m.cross(v, _), tt = m.cross(A, _), et = m.cross(T, k), it = m.cross(O, k), ht = m.dot(tt, H) / m.dot(tt, v), at = m.dot(K, H) / m.dot(K, A), ct = m.dot(it, G) / m.dot(it, T), nt = m.dot(et, G) / m.dot(et, O);
12302
12309
  a = m.add([ht, at], a), l = m.add([ct, nt], l), U++;
12303
12310
  } while (U < R);
12304
12311
  return new Wn(a, l, p, F);
@@ -12311,15 +12318,15 @@ var Ah = { exports: {} };
12311
12318
  }).filter(function(p) {
12312
12319
  return m.distSquared(p.min.point, p.max.point) > rt.EPSILON;
12313
12320
  }), function(p, _) {
12314
- var v = m.sub(p.min.uv0, _.min.uv0), w = m.dot(v, v), I = m.sub(p.max.uv0, _.max.uv0), S = m.dot(I, I), P = m.sub(p.min.uv0, _.max.uv0), k = m.dot(P, P), T = m.sub(p.max.uv0, _.min.uv0), L = m.dot(T, T);
12315
- return w < rt.EPSILON && S < rt.EPSILON || k < rt.EPSILON && L < rt.EPSILON;
12321
+ var v = m.sub(p.min.uv0, _.min.uv0), A = m.dot(v, v), I = m.sub(p.max.uv0, _.max.uv0), S = m.dot(I, I), P = m.sub(p.min.uv0, _.max.uv0), k = m.dot(P, P), T = m.sub(p.max.uv0, _.min.uv0), O = m.dot(T, T);
12322
+ return A < rt.EPSILON && S < rt.EPSILON || k < rt.EPSILON && O < rt.EPSILON;
12316
12323
  });
12317
12324
  return lt.makeMeshIntersectionPolylines(d);
12318
12325
  }, lt.meshSlices = function(r, n, a, l) {
12319
- for (var u = new Cr(r), d = u.boundingBox(), p = d.min[0], _ = d.min[1], v = d.max[0], w = d.max[1], I = m.span(n, a, l), S = [], P = 0; P < I.length; ) {
12326
+ for (var u = new Cr(r), d = u.boundingBox(), p = d.min[0], _ = d.min[1], v = d.max[0], A = d.max[1], I = m.span(n, a, l), S = [], P = 0; P < I.length; ) {
12320
12327
  var k = I[P];
12321
12328
  ++P;
12322
- var T = [[p, _, k], [v, _, k], [v, w, k], [p, w, k]], L = [[0, 0], [1, 0], [1, 1], [0, 1]], C = [[0, 1, 2], [0, 2, 3]], F = new qe(C, T, null, L);
12329
+ var T = [[p, _, k], [v, _, k], [v, A, k], [p, A, k]], O = [[0, 0], [1, 0], [1, 1], [0, 1]], C = [[0, 1, 2], [0, 2, 3]], F = new qe(C, T, null, O);
12323
12330
  S.push(lt.meshes(r, F, u));
12324
12331
  }
12325
12332
  return S;
@@ -12336,8 +12343,8 @@ var Ah = { exports: {} };
12336
12343
  for (var _ = 0; _ < u.length; ) {
12337
12344
  var v = u[_];
12338
12345
  if (++_, v.adj == null) {
12339
- var w = lt.lookupAdjacentSegment(v, l, r.length);
12340
- w != null && w.adj == null && (v.adj = w, w.adj = v);
12346
+ var A = lt.lookupAdjacentSegment(v, l, r.length);
12347
+ A != null && A.adj == null && (v.adj = A, A.adj = v);
12341
12348
  }
12342
12349
  }
12343
12350
  var I = u.filter(function(R) {
@@ -12347,9 +12354,9 @@ var Ah = { exports: {} };
12347
12354
  for (var S = [], P = 0, k = !1; I.length != 0; ) {
12348
12355
  var T = I.pop();
12349
12356
  if (!T.visited) {
12350
- for (var L = [], C = T; C != null && !(C.visited || (C.visited = !0, C.opp.visited = !0, L.push(C), P += 2, C = C.opp.adj, C == T)); )
12357
+ for (var O = [], C = T; C != null && !(C.visited || (C.visited = !0, C.opp.visited = !0, O.push(C), P += 2, C = C.opp.adj, C == T)); )
12351
12358
  ;
12352
- L.length > 0 && (L.push(L[L.length - 1].opp), S.push(L));
12359
+ O.length > 0 && (O.push(O[O.length - 1].opp), S.push(O));
12353
12360
  }
12354
12361
  if (I.length == 0 && u.length > 0 && (k || P < u.length)) {
12355
12362
  k = !0;
@@ -12375,7 +12382,7 @@ var Ah = { exports: {} };
12375
12382
  a == null && (a = 1e-3), l != null ? l = l : l = new ir(r), u != null ? u = u : u = new Nr(n);
12376
12383
  var d = lt.boundingBoxTrees(l, u, a);
12377
12384
  return $.unique(d.map(function(p) {
12378
- var _ = p.item0, v = p.item1, w = $.first(_.knots), I = $.last(_.knots), S = (w + I) / 2, P = $.first(v.knotsU), k = $.last(v.knotsU), T = $.first(v.knotsV), L = $.last(v.knotsV), C = [(P + k) / 2, (T + L) / 2];
12385
+ var _ = p.item0, v = p.item1, A = $.first(_.knots), I = $.last(_.knots), S = (A + I) / 2, P = $.first(v.knotsU), k = $.last(v.knotsU), T = $.first(v.knotsV), O = $.last(v.knotsV), C = [(P + k) / 2, (T + O) / 2];
12379
12386
  return lt.curveAndSurfaceWithEstimate(_, v, [S].concat(C), a);
12380
12387
  }).filter(function(p) {
12381
12388
  return m.distSquared(p.curvePoint, p.surfacePoint) < a * a;
@@ -12385,10 +12392,10 @@ var Ah = { exports: {} };
12385
12392
  }, lt.curveAndSurfaceWithEstimate = function(r, n, a, l) {
12386
12393
  l == null && (l = 1e-3);
12387
12394
  var u = function(v) {
12388
- var w = N.rationalCurvePoint(r, v[0]), I = N.rationalSurfacePoint(n, v[1], v[2]), S = m.sub(w, I);
12395
+ var A = N.rationalCurvePoint(r, v[0]), I = N.rationalSurfacePoint(n, v[1], v[2]), S = m.sub(A, I);
12389
12396
  return m.dot(S, S);
12390
12397
  }, d = function(v) {
12391
- var w = N.rationalCurveDerivatives(r, v[0], 1), I = N.rationalSurfaceDerivatives(n, v[1], v[2], 1), S = m.sub(I[0][0], w[0]), P = m.mul(-1, w[1]), k = I[1][0], T = I[0][1];
12398
+ var A = N.rationalCurveDerivatives(r, v[0], 1), I = N.rationalSurfaceDerivatives(n, v[1], v[2], 1), S = m.sub(I[0][0], A[0]), P = m.mul(-1, A[1]), k = I[1][0], T = I[0][1];
12392
12399
  return [2 * m.dot(P, S), 2 * m.dot(k, S), 2 * m.dot(T, S)];
12393
12400
  }, p = Xe.uncmin(u, a, l * l, d), _ = p.solution;
12394
12401
  return new Gn(_[0], [_[1], _[2]], N.rationalCurvePoint(r, _[0]), N.rationalSurfacePoint(n, _[1], _[2]));
@@ -12396,9 +12403,9 @@ var Ah = { exports: {} };
12396
12403
  for (var l = lt.boundingBoxTrees(new or(r), new ar(n), a), u = [], d = 0; d < l.length; ) {
12397
12404
  var p = l[d];
12398
12405
  ++d;
12399
- var _ = p.item0, v = p.item1, w = lt.segmentWithTriangle(r.points[_], r.points[_ + 1], n.points, n.faces[v]);
12400
- if (w != null) {
12401
- var I = w.point, S = m.lerp(w.p, [r.params[_]], [r.params[_ + 1]])[0], P = re.triangleUVFromPoint(n, v, I);
12406
+ var _ = p.item0, v = p.item1, A = lt.segmentWithTriangle(r.points[_], r.points[_ + 1], n.points, n.faces[v]);
12407
+ if (A != null) {
12408
+ var I = A.point, S = m.lerp(A.p, [r.params[_]], [r.params[_ + 1]])[0], P = re.triangleUVFromPoint(n, v, I);
12402
12409
  u.push(new jn(I, S, P, _, v));
12403
12410
  }
12404
12411
  }
@@ -12410,15 +12417,15 @@ var Ah = { exports: {} };
12410
12417
  for (var d = []; l.length > 0; ) {
12411
12418
  var p = l.pop(), _ = u.pop();
12412
12419
  if (!(p.empty() || _.empty()) && p.boundingBox().intersects(_.boundingBox(), a)) {
12413
- var v = p.indivisible(a), w = _.indivisible(a);
12414
- if (v && w) {
12420
+ var v = p.indivisible(a), A = _.indivisible(a);
12421
+ if (v && A) {
12415
12422
  d.push(new ee(p.yield(), _.yield()));
12416
12423
  continue;
12417
- } else if (v && !w) {
12424
+ } else if (v && !A) {
12418
12425
  var I = _.split();
12419
12426
  l.push(p), u.push(I.item1), l.push(p), u.push(I.item0);
12420
12427
  continue;
12421
- } else if (!v && w) {
12428
+ } else if (!v && A) {
12422
12429
  var S = p.split();
12423
12430
  l.push(S.item1), u.push(_), l.push(S.item0), u.push(_);
12424
12431
  continue;
@@ -12439,15 +12446,15 @@ var Ah = { exports: {} };
12439
12446
  });
12440
12447
  }, lt.curvesWithEstimate = function(r, n, a, l, u) {
12441
12448
  var d = function(P) {
12442
- var k = N.rationalCurvePoint(r, P[0]), T = N.rationalCurvePoint(n, P[1]), L = m.sub(k, T);
12443
- return m.dot(L, L);
12449
+ var k = N.rationalCurvePoint(r, P[0]), T = N.rationalCurvePoint(n, P[1]), O = m.sub(k, T);
12450
+ return m.dot(O, O);
12444
12451
  }, p = function(P) {
12445
- var k = N.rationalCurveDerivatives(r, P[0], 1), T = N.rationalCurveDerivatives(n, P[1], 1), L = m.sub(k[0], T[0]), C = k[1], F = m.mul(-1, T[1]);
12446
- return [2 * m.dot(C, L), 2 * m.dot(F, L)];
12447
- }, _ = Xe.uncmin(d, [a, l], u * u, p), v = _.solution[0], w = _.solution[1], I = N.rationalCurvePoint(r, v), S = N.rationalCurvePoint(n, w);
12448
- return new Hr(I, S, v, w);
12452
+ var k = N.rationalCurveDerivatives(r, P[0], 1), T = N.rationalCurveDerivatives(n, P[1], 1), O = m.sub(k[0], T[0]), C = k[1], F = m.mul(-1, T[1]);
12453
+ return [2 * m.dot(C, O), 2 * m.dot(F, O)];
12454
+ }, _ = Xe.uncmin(d, [a, l], u * u, p), v = _.solution[0], A = _.solution[1], I = N.rationalCurvePoint(r, v), S = N.rationalCurvePoint(n, A);
12455
+ return new Hr(I, S, v, A);
12449
12456
  }, lt.triangles = function(r, n, a, l) {
12450
- var u = r.faces[n], d = a.faces[l], p = re.getTriangleNorm(r.points, u), _ = re.getTriangleNorm(a.points, d), v = r.points[u[0]], w = a.points[d[0]], I = lt.planes(v, p, w, _);
12457
+ var u = r.faces[n], d = a.faces[l], p = re.getTriangleNorm(r.points, u), _ = re.getTriangleNorm(a.points, d), v = r.points[u[0]], A = a.points[d[0]], I = lt.planes(v, p, A, _);
12451
12458
  if (I == null) return null;
12452
12459
  var S = lt.clipRayInCoplanarTriangle(I, r, n);
12453
12460
  if (S == null) return null;
@@ -12456,11 +12463,11 @@ var Ah = { exports: {} };
12456
12463
  var k = lt.mergeTriangleClipIntervals(S, P, r, n, a, l);
12457
12464
  return k == null ? null : new we(new Tr(k.min.uv0, k.min.uv1, k.min.point, n, l), new Tr(k.max.uv0, k.max.uv1, k.max.point, n, l));
12458
12465
  }, lt.clipRayInCoplanarTriangle = function(r, n, a) {
12459
- for (var l = n.faces[a], u = [n.points[l[0]], n.points[l[1]], n.points[l[2]]], d = [n.uvs[l[0]], n.uvs[l[1]], n.uvs[l[2]]], p = [m.sub(d[1], d[0]), m.sub(d[2], d[1]), m.sub(d[0], d[2])], _ = [m.sub(u[1], u[0]), m.sub(u[2], u[1]), m.sub(u[0], u[2])], v = _.map(m.normalized), w = _.map(m.norm), I = null, S = null, P = 0; P < 3; ) {
12460
- var k = P++, T = u[k], L = v[k], C = lt.rays(T, L, r.origin, r.dir);
12466
+ for (var l = n.faces[a], u = [n.points[l[0]], n.points[l[1]], n.points[l[2]]], d = [n.uvs[l[0]], n.uvs[l[1]], n.uvs[l[2]]], p = [m.sub(d[1], d[0]), m.sub(d[2], d[1]), m.sub(d[0], d[2])], _ = [m.sub(u[1], u[0]), m.sub(u[2], u[1]), m.sub(u[0], u[2])], v = _.map(m.normalized), A = _.map(m.norm), I = null, S = null, P = 0; P < 3; ) {
12467
+ var k = P++, T = u[k], O = v[k], C = lt.rays(T, O, r.origin, r.dir);
12461
12468
  if (C != null) {
12462
12469
  var F = C.u0, R = C.u1;
12463
- F < -rt.EPSILON || F > w[k] + rt.EPSILON || ((I == null || R < I.u) && (I = new vn(R, m.onRay(r.origin, r.dir, R), m.onRay(d[k], p[k], F / w[k]))), (S == null || R > S.u) && (S = new vn(R, m.onRay(r.origin, r.dir, R), m.onRay(d[k], p[k], F / w[k]))));
12470
+ F < -rt.EPSILON || F > A[k] + rt.EPSILON || ((I == null || R < I.u) && (I = new vn(R, m.onRay(r.origin, r.dir, R), m.onRay(d[k], p[k], F / A[k]))), (S == null || R > S.u) && (S = new vn(R, m.onRay(r.origin, r.dir, R), m.onRay(d[k], p[k], F / A[k]))));
12464
12471
  }
12465
12472
  }
12466
12473
  return S == null || I == null ? null : new we(I, S);
@@ -12477,44 +12484,44 @@ var Ah = { exports: {} };
12477
12484
  if (m.dot(u, u) < rt.EPSILON) return null;
12478
12485
  var d = 0, p = Math.abs(u[0]), _ = Math.abs(u[1]), v = Math.abs(u[2]);
12479
12486
  _ > p && (d = 1, p = _), v > p && (d = 2, p = v);
12480
- var w, I, S, P;
12481
- d == 0 ? (w = n[1], I = n[2], S = l[1], P = l[2]) : d == 1 ? (w = n[0], I = n[2], S = l[0], P = l[2]) : (w = n[0], I = n[1], S = l[0], P = l[1]);
12482
- var k = -m.dot(r, n), T = -m.dot(a, l), L = w * P - I * S, C = (I * T - k * P) / L, F = (k * S - w * T) / L, R;
12487
+ var A, I, S, P;
12488
+ d == 0 ? (A = n[1], I = n[2], S = l[1], P = l[2]) : d == 1 ? (A = n[0], I = n[2], S = l[0], P = l[2]) : (A = n[0], I = n[1], S = l[0], P = l[1]);
12489
+ var k = -m.dot(r, n), T = -m.dot(a, l), O = A * P - I * S, C = (I * T - k * P) / O, F = (k * S - A * T) / O, R;
12483
12490
  return d == 0 ? R = [0, C, F] : d == 1 ? R = [C, 0, F] : R = [C, F, 0], new _n(R, m.normalized(u));
12484
12491
  }, lt.threePlanes = function(r, n, a, l, u, d) {
12485
12492
  var p = m.cross(a, u), _ = m.dot(r, p);
12486
12493
  if (Math.abs(_) < rt.EPSILON) return null;
12487
- var v = m.sub(m.mul(d, a), m.mul(l, u)), w = m.add(m.mul(n, p), m.cross(r, v));
12488
- return m.mul(1 / _, w);
12494
+ var v = m.sub(m.mul(d, a), m.mul(l, u)), A = m.add(m.mul(n, p), m.cross(r, v));
12495
+ return m.mul(1 / _, A);
12489
12496
  }, lt.polylines = function(r, n, a) {
12490
12497
  for (var l = lt.boundingBoxTrees(new or(r), new or(n), a), u = [], d = 0; d < l.length; ) {
12491
12498
  var p = l[d];
12492
12499
  ++d;
12493
- var _ = p.item0, v = p.item1, w = lt.segments(r.points[_], r.points[_ + 1], n.points[v], n.points[v + 1], a);
12494
- w != null && (w.u0 = m.lerp(w.u0, [r.params[_]], [r.params[_ + 1]])[0], w.u1 = m.lerp(w.u1, [n.params[v]], [n.params[v + 1]])[0], u.push(w));
12500
+ var _ = p.item0, v = p.item1, A = lt.segments(r.points[_], r.points[_ + 1], n.points[v], n.points[v + 1], a);
12501
+ A != null && (A.u0 = m.lerp(A.u0, [r.params[_]], [r.params[_ + 1]])[0], A.u1 = m.lerp(A.u1, [n.params[v]], [n.params[v + 1]])[0], u.push(A));
12495
12502
  }
12496
12503
  return u;
12497
12504
  }, lt.segments = function(r, n, a, l, u) {
12498
- var d = m.sub(n, r), p = Math.sqrt(m.dot(d, d)), _ = m.mul(1 / p, d), v = m.sub(l, a), w = Math.sqrt(m.dot(v, v)), I = m.mul(1 / w, v), S = lt.rays(r, _, a, I);
12505
+ var d = m.sub(n, r), p = Math.sqrt(m.dot(d, d)), _ = m.mul(1 / p, d), v = m.sub(l, a), A = Math.sqrt(m.dot(v, v)), I = m.mul(1 / A, v), S = lt.rays(r, _, a, I);
12499
12506
  if (S != null) {
12500
- var P = Math.min(Math.max(0, S.u0 / p), 1), k = Math.min(Math.max(0, S.u1 / w), 1), T = m.onRay(r, d, P), L = m.onRay(a, v, k), C = m.distSquared(T, L);
12501
- if (C < u * u) return new Hr(T, L, P, k);
12507
+ var P = Math.min(Math.max(0, S.u0 / p), 1), k = Math.min(Math.max(0, S.u1 / A), 1), T = m.onRay(r, d, P), O = m.onRay(a, v, k), C = m.distSquared(T, O);
12508
+ if (C < u * u) return new Hr(T, O, P, k);
12502
12509
  }
12503
12510
  return null;
12504
12511
  }, lt.rays = function(r, n, a, l) {
12505
- var u = m.dot(n, l), d = m.dot(n, a), p = m.dot(n, r), _ = m.dot(l, a), v = m.dot(l, r), w = m.dot(n, n), I = m.dot(l, l), S = w * I - u * u;
12512
+ var u = m.dot(n, l), d = m.dot(n, a), p = m.dot(n, r), _ = m.dot(l, a), v = m.dot(l, r), A = m.dot(n, n), I = m.dot(l, l), S = A * I - u * u;
12506
12513
  if (Math.abs(S) < rt.EPSILON) return null;
12507
- var P = u * (d - p) - w * (_ - v), k = P / S, T = (d - p + k * u) / w, L = m.onRay(r, n, T), C = m.onRay(a, l, k);
12508
- return new Hr(L, C, T, k);
12514
+ var P = u * (d - p) - A * (_ - v), k = P / S, T = (d - p + k * u) / A, O = m.onRay(r, n, T), C = m.onRay(a, l, k);
12515
+ return new Hr(O, C, T, k);
12509
12516
  }, lt.segmentWithTriangle = function(r, n, a, l) {
12510
- var u = a[l[0]], d = a[l[1]], p = a[l[2]], _ = m.sub(d, u), v = m.sub(p, u), w = m.cross(_, v), I = m.sub(n, r), S = m.sub(r, u), P = -m.dot(w, S), k = m.dot(w, I);
12517
+ var u = a[l[0]], d = a[l[1]], p = a[l[2]], _ = m.sub(d, u), v = m.sub(p, u), A = m.cross(_, v), I = m.sub(n, r), S = m.sub(r, u), P = -m.dot(A, S), k = m.dot(A, I);
12511
12518
  if (Math.abs(k) < rt.EPSILON) return null;
12512
12519
  var T = P / k;
12513
12520
  if (T < 0 || T > 1) return null;
12514
- var L = m.add(r, m.mul(T, I)), C = m.dot(_, v), F = m.dot(_, _), R = m.dot(v, v), U = m.sub(L, u), V = m.dot(U, _), q = m.dot(U, v), J = C * C - F * R;
12521
+ var O = m.add(r, m.mul(T, I)), C = m.dot(_, v), F = m.dot(_, _), R = m.dot(v, v), U = m.sub(O, u), V = m.dot(U, _), q = m.dot(U, v), J = C * C - F * R;
12515
12522
  if (Math.abs(J) < rt.EPSILON) return null;
12516
12523
  var H = (C * q - R * V) / J, G = (C * V - F * q) / J;
12517
- return H > 1 + rt.EPSILON || G > 1 + rt.EPSILON || G < -rt.EPSILON || H < -rt.EPSILON || H + G > 1 + rt.EPSILON ? null : new Hn(L, H, G, T);
12524
+ return H > 1 + rt.EPSILON || G > 1 + rt.EPSILON || G < -rt.EPSILON || H < -rt.EPSILON || H + G > 1 + rt.EPSILON ? null : new Hn(O, H, G, T);
12518
12525
  }, lt.segmentAndPlane = function(r, n, a, l) {
12519
12526
  var u = m.dot(l, m.sub(n, r));
12520
12527
  if (Math.abs(u) < rt.EPSILON) return null;
@@ -12525,7 +12532,7 @@ var Ah = { exports: {} };
12525
12532
  };
12526
12533
  b["verb.eval.Make"] = pt, pt.__name__ = ["verb", "eval", "Make"], pt.rationalTranslationalSurface = function(r, n) {
12527
12534
  for (var a = N.rationalCurvePoint(n, $.first(n.knots)), l = $.first(n.knots), u = $.last(n.knots), d = 2 * n.controlPoints.length, p = (u - l) / (d - 1), _ = [], v = 0; v < d; ) {
12528
- var w = v++, I = m.sub(N.rationalCurvePoint(n, l + w * p), a), S = ft.rationalCurveTransform(r, [[1, 0, 0, I[0]], [0, 1, 0, I[1]], [0, 0, 1, I[2]], [0, 0, 0, 1]]);
12535
+ var A = v++, I = m.sub(N.rationalCurvePoint(n, l + A * p), a), S = ft.rationalCurveTransform(r, [[1, 0, 0, I[0]], [0, 1, 0, I[1]], [0, 0, 1, I[2]], [0, 0, 0, 1]]);
12529
12536
  _.push(S);
12530
12537
  }
12531
12538
  return pt.loftedSurface(_);
@@ -12539,9 +12546,9 @@ var Ah = { exports: {} };
12539
12546
  var u;
12540
12547
  a ? u = r.degreeV : u = r.degreeU;
12541
12548
  for (var d = yt.knotMultiplicities(l), p = -1, _ = 0, v = d.length; _ < v; ) {
12542
- var w = _++;
12543
- if (Math.abs(n - d[w].knot) < rt.EPSILON) {
12544
- p = w;
12549
+ var A = _++;
12550
+ if (Math.abs(n - d[A].knot) < rt.EPSILON) {
12551
+ p = A;
12545
12552
  break;
12546
12553
  }
12547
12554
  }
@@ -12551,22 +12558,22 @@ var Ah = { exports: {} };
12551
12558
  I > 0 ? S = ft.surfaceKnotRefine(r, m.rep(I, n), a) : S = r;
12552
12559
  var P = N.knotSpan(u, n, l);
12553
12560
  return Math.abs(n - $.first(l)) < rt.EPSILON ? P = 0 : Math.abs(n - $.last(l)) < rt.EPSILON && (P = (a ? S.controlPoints[0].length : S.controlPoints.length) - 1), a ? new Gt(S.degreeU, S.knotsU, function(k) {
12554
- for (var T, L = [], C = 0, F = S.controlPoints; C < F.length; ) {
12561
+ for (var T, O = [], C = 0, F = S.controlPoints; C < F.length; ) {
12555
12562
  var R = F[C];
12556
- ++C, L.push(R[P]);
12563
+ ++C, O.push(R[P]);
12557
12564
  }
12558
- return T = L, T;
12565
+ return T = O, T;
12559
12566
  }()) : new Gt(S.degreeV, S.knotsV, S.controlPoints[P]);
12560
12567
  }, pt.loftedSurface = function(r, n) {
12561
12568
  r = ft.unifyCurveKnotVectors(r);
12562
12569
  var a = r[0].degree;
12563
12570
  n == null && (n = 3), n > r.length - 1 && (n = r.length - 1);
12564
12571
  for (var l = r[0].knots, u = [], d = [], p = 0, _ = r[0].controlPoints.length; p < _; ) {
12565
- var v = [p++], w = r.map(/* @__PURE__ */ function(S) {
12572
+ var v = [p++], A = r.map(/* @__PURE__ */ function(S) {
12566
12573
  return function(P) {
12567
12574
  return P.controlPoints[S[0]];
12568
12575
  };
12569
- }(v)), I = pt.rationalInterpCurve(w, n, !0);
12576
+ }(v)), I = pt.rationalInterpCurve(A, n, !0);
12570
12577
  d.push(I.controlPoints), u = I.knots;
12571
12578
  }
12572
12579
  return new te(a, n, l, u, d);
@@ -12583,8 +12590,8 @@ var Ah = { exports: {} };
12583
12590
  }, pt.fourPointSurface = function(r, n, a, l, u) {
12584
12591
  u == null && (u = 3);
12585
12592
  for (var d = u, p = [], _ = 0, v = u + 1; _ < v; ) {
12586
- for (var w = _++, I = [], S = 0, P = u + 1; S < P; ) {
12587
- var k = S++, T = 1 - w / d, L = m.lerp(T, r, n), C = m.lerp(T, l, a), F = m.lerp(1 - k / d, L, C);
12593
+ for (var A = _++, I = [], S = 0, P = u + 1; S < P; ) {
12594
+ var k = S++, T = 1 - A / d, O = m.lerp(T, r, n), C = m.lerp(T, l, a), F = m.lerp(1 - k / d, O, C);
12588
12595
  F.push(1), I.push(F);
12589
12596
  }
12590
12597
  p.push(I);
@@ -12596,15 +12603,15 @@ var Ah = { exports: {} };
12596
12603
  n = m.normalized(n), a = m.normalized(a), u < l && (u = 2 * Math.PI + l);
12597
12604
  var _ = u - l, v = 0;
12598
12605
  _ <= Math.PI / 2 ? v = 1 : _ <= Math.PI ? v = 2 : _ <= 3 * Math.PI / 2 ? v = 3 : v = 4;
12599
- var w = _ / v, I = Math.cos(w / 2), S = m.add(r, m.add(m.mul(d * Math.cos(l), n), m.mul(p * Math.sin(l), a))), P = m.sub(m.mul(Math.cos(l), a), m.mul(Math.sin(l), n)), k = [], T = m.zeros1d(2 * v + 3), L = 0, C = l, F = m.zeros1d(v * 2);
12606
+ var A = _ / v, I = Math.cos(A / 2), S = m.add(r, m.add(m.mul(d * Math.cos(l), n), m.mul(p * Math.sin(l), a))), P = m.sub(m.mul(Math.cos(l), a), m.mul(Math.sin(l), n)), k = [], T = m.zeros1d(2 * v + 3), O = 0, C = l, F = m.zeros1d(v * 2);
12600
12607
  k[0] = S, F[0] = 1;
12601
12608
  for (var R = 1, U = v + 1; R < U; ) {
12602
12609
  var V = R++;
12603
- C += w;
12610
+ C += A;
12604
12611
  var q = m.add(r, m.add(m.mul(d * Math.cos(C), n), m.mul(p * Math.sin(C), a)));
12605
- F[L + 2] = 1, k[L + 2] = q;
12612
+ F[O + 2] = 1, k[O + 2] = q;
12606
12613
  var J = m.sub(m.mul(Math.cos(C), a), m.mul(Math.sin(C), n)), H = lt.rays(S, m.mul(1 / m.norm(P), P), q, m.mul(1 / m.norm(J), J)), G = m.add(S, m.mul(H.u0, P));
12607
- F[L + 1] = I, k[L + 1] = G, L += 2, V < v && (S = q, P = J);
12614
+ F[O + 1] = I, k[O + 1] = G, O += 2, V < v && (S = q, P = J);
12608
12615
  }
12609
12616
  for (var K = 2 * v + 1, tt = 0; tt < 3; ) {
12610
12617
  var et = tt++;
@@ -12630,12 +12637,12 @@ var Ah = { exports: {} };
12630
12637
  a += m.dist(r[d], r[d + 1]), n.push(a);
12631
12638
  }
12632
12639
  n.push(a), n = m.mul(1 / a, n);
12633
- for (var p, _ = [], v = 0, w = r.length; v < w; )
12640
+ for (var p, _ = [], v = 0, A = r.length; v < A; )
12634
12641
  v++, _.push(1);
12635
12642
  return p = _, new Gt(1, n, N.homogenize1d(r.slice(0), p));
12636
12643
  }, pt.extrudedSurface = function(r, n, a) {
12637
- for (var l = [[], [], []], u = [[], [], []], d = N.dehomogenize1d(a.controlPoints), p = N.weight1d(a.controlPoints), _ = m.mul(n, r), v = m.mul(0.5 * n, r), w = 0, I = d.length; w < I; ) {
12638
- var S = w++;
12644
+ for (var l = [[], [], []], u = [[], [], []], d = N.dehomogenize1d(a.controlPoints), p = N.weight1d(a.controlPoints), _ = m.mul(n, r), v = m.mul(0.5 * n, r), A = 0, I = d.length; A < I; ) {
12645
+ var S = A++;
12639
12646
  l[2][S] = d[S], l[1][S] = m.add(v, d[S]), l[0][S] = m.add(_, d[S]), u[0][S] = p[S], u[1][S] = p[S], u[2][S] = p[S];
12640
12647
  }
12641
12648
  return new te(2, a.degree, [0, 0, 0, 1, 1, 1], a.knots, N.homogenize2d(l, u));
@@ -12645,13 +12652,13 @@ var Ah = { exports: {} };
12645
12652
  }, pt.revolvedSurface = function(r, n, a, l) {
12646
12653
  var u = N.dehomogenize1d(r.controlPoints), d = N.weight1d(r.controlPoints), p, _;
12647
12654
  l <= Math.PI / 2 ? (p = 1, _ = m.zeros1d(6 + 2 * (p - 1))) : l <= Math.PI ? (p = 2, _ = m.zeros1d(6 + 2 * (p - 1)), _[3] = _[4] = 0.5) : l <= 3 * Math.PI / 2 ? (p = 3, _ = m.zeros1d(6 + 2 * (p - 1)), _[3] = _[4] = 0.3333333333333333, _[5] = _[6] = 0.6666666666666666) : (p = 4, _ = m.zeros1d(6 + 2 * (p - 1)), _[3] = _[4] = 0.25, _[5] = _[6] = 0.5, _[7] = _[8] = 0.75);
12648
- for (var v = l / p, w = 3 + 2 * (p - 1), I = 0; I < 3; ) {
12655
+ for (var v = l / p, A = 3 + 2 * (p - 1), I = 0; I < 3; ) {
12649
12656
  var S = I++;
12650
- _[S] = 0, _[w + S] = 1;
12657
+ _[S] = 0, _[A + S] = 1;
12651
12658
  }
12652
- for (var P = Math.cos(v / 2), k = 0, T = m.zeros1d(p + 1), L = m.zeros1d(p + 1), C = m.zeros3d(2 * p + 1, u.length, 3), F = m.zeros2d(2 * p + 1, u.length), R = 1, U = p + 1; R < U; ) {
12659
+ for (var P = Math.cos(v / 2), k = 0, T = m.zeros1d(p + 1), O = m.zeros1d(p + 1), C = m.zeros3d(2 * p + 1, u.length, 3), F = m.zeros2d(2 * p + 1, u.length), R = 1, U = p + 1; R < U; ) {
12653
12660
  var V = R++;
12654
- k += v, L[V] = Math.cos(k), T[V] = Math.sin(k);
12661
+ k += v, O[V] = Math.cos(k), T[V] = Math.sin(k);
12655
12662
  }
12656
12663
  for (var q = 0, J = u.length; q < J; ) {
12657
12664
  var H = q++, G = Ne.rayClosestPoint(u[H], n, a), K = m.sub(u[H], G), tt = m.norm(K), et = m.cross(a, K);
@@ -12660,8 +12667,8 @@ var Ah = { exports: {} };
12660
12667
  F[0][H] = d[H];
12661
12668
  for (var ht = et, at = 0, ct = 1, nt = p + 1; ct < nt; ) {
12662
12669
  var mt = ct++, X;
12663
- tt == 0 ? X = G : X = m.add(G, m.add(m.mul(tt * L[mt], K), m.mul(tt * T[mt], et))), C[at + 2][H] = X, F[at + 2][H] = d[H];
12664
- var gt = m.sub(m.mul(L[mt], et), m.mul(T[mt], K));
12670
+ tt == 0 ? X = G : X = m.add(G, m.add(m.mul(tt * O[mt], K), m.mul(tt * T[mt], et))), C[at + 2][H] = X, F[at + 2][H] = d[H];
12671
+ var gt = m.sub(m.mul(O[mt], et), m.mul(T[mt], K));
12665
12672
  if (tt == 0) C[at + 1][H] = G;
12666
12673
  else {
12667
12674
  var It = lt.rays(it, m.mul(1 / m.norm(ht), ht), X, m.mul(1 / m.norm(gt), gt)), jt = m.add(it, m.mul(It.u0, ht));
@@ -12675,19 +12682,19 @@ var Ah = { exports: {} };
12675
12682
  var u = pt.arc(r, m.mul(-1, n), a, l, 0, Math.PI);
12676
12683
  return pt.revolvedSurface(u, r, n, 2 * Math.PI);
12677
12684
  }, pt.conicalSurface = function(r, n, a, l, u) {
12678
- var d = 2 * Math.PI, p = 1, _ = [m.add(a, m.mul(l, r)), m.add(a, m.mul(u, n))], v = [0, 0, 1, 1], w = [1, 1], I = new Gt(p, v, N.homogenize1d(_, w));
12685
+ var d = 2 * Math.PI, p = 1, _ = [m.add(a, m.mul(l, r)), m.add(a, m.mul(u, n))], v = [0, 0, 1, 1], A = [1, 1], I = new Gt(p, v, N.homogenize1d(_, A));
12679
12686
  return pt.revolvedSurface(I, a, r, d);
12680
12687
  }, pt.rationalInterpCurve = function(r, n, a, l, u) {
12681
12688
  if (a == null && (a = !1), n == null && (n = 3), r.length < n + 1) throw new Q("You need to supply at least degree + 1 points! You only supplied " + r.length + " points.");
12682
12689
  for (var d = [0], p = 1, _ = r.length; p < _; ) {
12683
- var v = p++, w = m.norm(m.sub(r[v], r[v - 1])), I = d[d.length - 1];
12684
- d.push(I + w);
12690
+ var v = p++, A = m.norm(m.sub(r[v], r[v - 1])), I = d[d.length - 1];
12691
+ d.push(I + A);
12685
12692
  }
12686
12693
  for (var S = d[d.length - 1], P = 0, k = d.length; P < k; ) {
12687
12694
  var T = P++;
12688
12695
  d[T] = d[T] / S;
12689
12696
  }
12690
- var L = m.rep(n + 1, 0), C = l != null && u != null, F;
12697
+ var O = m.rep(n + 1, 0), C = l != null && u != null, F;
12691
12698
  C ? F = 0 : F = 1;
12692
12699
  var R;
12693
12700
  C ? R = d.length - n + 1 : R = d.length - n;
@@ -12696,9 +12703,9 @@ var Ah = { exports: {} };
12696
12703
  var H = J++;
12697
12704
  q += d[V + H];
12698
12705
  }
12699
- L.push(1 / n * q);
12706
+ O.push(1 / n * q);
12700
12707
  }
12701
- var G = L.concat(m.rep(n + 1, 1)), K = [], tt;
12708
+ var G = O.concat(m.rep(n + 1, 1)), K = [], tt;
12702
12709
  C ? tt = r.length + 1 : tt = r.length - 1;
12703
12710
  var et;
12704
12711
  C ? et = r.length - (n - 1) : et = r.length - (n + 1);
@@ -12712,8 +12719,8 @@ var Ah = { exports: {} };
12712
12719
  var gt = K[0].length - 2, It = [-1, 1].concat(m.zeros1d(gt)), jt = m.zeros1d(gt).concat([-1, 1]);
12713
12720
  $.spliceAndInsert(K, 1, 0, It), $.spliceAndInsert(K, K.length - 1, 0, jt);
12714
12721
  }
12715
- for (var Xt = r[0].length, Dt = [], Kt = (1 - G[G.length - n - 2]) / n, Ae = G[n + 1] / n, We = 0; We < Xt; ) {
12716
- var _e = [We++], ge;
12722
+ for (var Xt = r[0].length, Dt = [], Kt = (1 - G[G.length - n - 2]) / n, Ae = G[n + 1] / n, He = 0; He < Xt; ) {
12723
+ var _e = [He++], ge;
12717
12724
  if (!C) ge = r.map(/* @__PURE__ */ function(Je) {
12718
12725
  return function(dr) {
12719
12726
  return dr[Je[0]];
@@ -12770,8 +12777,8 @@ var Ah = { exports: {} };
12770
12777
  ++_, p.push(new we($.first(v.knots), $.last(v.knots)));
12771
12778
  }
12772
12779
  d = p;
12773
- for (var w = 0, I = r.length; w < I; ) {
12774
- var S = w++, P = [d[S].min];
12780
+ for (var A = 0, I = r.length; A < I; ) {
12781
+ var S = A++, P = [d[S].min];
12775
12782
  r[S].knots = r[S].knots.map(/* @__PURE__ */ function(G) {
12776
12783
  return function(K) {
12777
12784
  return K - G[0];
@@ -12782,8 +12789,8 @@ var Ah = { exports: {} };
12782
12789
  return G.max - G.min;
12783
12790
  }), T = z.fold(k, function(G, K) {
12784
12791
  return Math.max(G, K);
12785
- }, 0), L = 0, C = r.length; L < C; ) {
12786
- var F = L++, R = [T / k[F]];
12792
+ }, 0), O = 0, C = r.length; O < C; ) {
12793
+ var F = O++, R = [T / k[F]];
12787
12794
  r[F].knots = r[F].knots.map(/* @__PURE__ */ function(G) {
12788
12795
  return function(K) {
12789
12796
  return K * G[0];
@@ -12803,7 +12810,7 @@ var Ah = { exports: {} };
12803
12810
  return r > n ? r : n;
12804
12811
  }, ft.curveElevateDegree = function(r, n) {
12805
12812
  if (n <= r.degree) return r;
12806
- var a = r.knots.length - r.degree - 2, l = r.degree, u = r.knots, d = r.controlPoints, p = n - r.degree, _ = r.controlPoints[0].length, v = m.zeros2d(l + p + 1, l + 1), w = [], I = [], S = [], P = a + l + 1, k = n, T = Math.floor(k / 2), L = [], C = [];
12813
+ var a = r.knots.length - r.degree - 2, l = r.degree, u = r.knots, d = r.controlPoints, p = n - r.degree, _ = r.controlPoints[0].length, v = m.zeros2d(l + p + 1, l + 1), A = [], I = [], S = [], P = a + l + 1, k = n, T = Math.floor(k / 2), O = [], C = [];
12807
12814
  v[0][0] = 1, v[k][l] = 1;
12808
12815
  for (var F = 1, R = T + 1; F < R; )
12809
12816
  for (var U = F++, V = 1 / Ft.get(k, U), q = ft.imin(l, U), J = ft.imax(0, U - p), H = q + 1; J < H; ) {
@@ -12816,14 +12823,14 @@ var Ah = { exports: {} };
12816
12823
  v[tt][at] = v[k - tt][l - at];
12817
12824
  }
12818
12825
  var ct = k + 1, nt = -1, mt = l, X = l + 1, gt = 1, It = u[0];
12819
- L[0] = d[0];
12826
+ O[0] = d[0];
12820
12827
  for (var jt = 0, Xt = k + 1; jt < Xt; ) {
12821
12828
  var Dt = jt++;
12822
12829
  C[Dt] = It;
12823
12830
  }
12824
12831
  for (var Kt = 0, Ae = l + 1; Kt < Ae; ) {
12825
- var We = Kt++;
12826
- w[We] = d[We];
12832
+ var He = Kt++;
12833
+ A[He] = d[He];
12827
12834
  }
12828
12835
  for (; X < P; ) {
12829
12836
  for (var _e = X; X < P && u[X] == u[X + 1]; ) X = X + 1;
@@ -12837,8 +12844,8 @@ var Ah = { exports: {} };
12837
12844
  Qe[Je - ge - 1] = Ze / (u[mt + Je] - It), Je--;
12838
12845
  for (var dr = 1, Pn = nt + 1; dr < Pn; ) {
12839
12846
  for (var qr = dr++, zh = nt - qr, ci = ge + qr, Xr = l; Xr >= ci; )
12840
- w[Xr] = m.add(m.mul(Qe[Xr - ci], w[Xr]), m.mul(1 - Qe[Xr - ci], w[Xr - 1])), Xr--;
12841
- S[zh] = w[l];
12847
+ A[Xr] = m.add(m.mul(Qe[Xr - ci], A[Xr]), m.mul(1 - Qe[Xr - ci], A[Xr - 1])), Xr--;
12848
+ S[zh] = A[l];
12842
12849
  }
12843
12850
  }
12844
12851
  for (var ao = $e, Rh = k + 1; ao < Rh; ) {
@@ -12846,7 +12853,7 @@ var Ah = { exports: {} };
12846
12853
  I[En] = m.zeros1d(_);
12847
12854
  for (var Fh = ft.imin(l, En), oo = ft.imax(0, En - p), Bh = Fh + 1; oo < Bh; ) {
12848
12855
  var lo = oo++;
12849
- I[En] = m.add(I[En], m.mul(v[En][lo], w[lo]));
12856
+ I[En] = m.add(I[En], m.mul(v[En][lo], A[lo]));
12850
12857
  }
12851
12858
  }
12852
12859
  if (Le > 1)
@@ -12854,7 +12861,7 @@ var Ah = { exports: {} };
12854
12861
  for (var pi = uo++, mr = di, Kr = mi, Br = Kr - ct + 1; Kr - mr > pi; ) {
12855
12862
  if (mr < gt) {
12856
12863
  var Uh = (Se - C[mr]) / (It - C[mr]);
12857
- L[mr] = m.lerp(Uh, L[mr], L[mr - 1]);
12864
+ O[mr] = m.lerp(Uh, O[mr], O[mr - 1]);
12858
12865
  }
12859
12866
  if (Kr >= $e) {
12860
12867
  if (Kr - pi <= ct - k + Le) {
@@ -12871,16 +12878,16 @@ var Ah = { exports: {} };
12871
12878
  co++, C[ct] = It, ct = ct + 1;
12872
12879
  for (var mo = $e, jh = lr + 1; mo < jh; ) {
12873
12880
  var Wh = mo++;
12874
- L[gt] = I[Wh], gt = gt + 1;
12881
+ O[gt] = I[Wh], gt = gt + 1;
12875
12882
  }
12876
12883
  if (X < P) {
12877
12884
  for (var po = 0; po < nt; ) {
12878
12885
  var go = po++;
12879
- w[go] = S[go];
12886
+ A[go] = S[go];
12880
12887
  }
12881
12888
  for (var fo = nt, Hh = l + 1; fo < Hh; ) {
12882
12889
  var _o = fo++;
12883
- w[_o] = d[X - l + _o];
12890
+ A[_o] = d[X - l + _o];
12884
12891
  }
12885
12892
  mt = X, X = X + 1, It = Se;
12886
12893
  } else
@@ -12889,12 +12896,12 @@ var Ah = { exports: {} };
12889
12896
  C[ct + qh] = Se;
12890
12897
  }
12891
12898
  }
12892
- return new Gt(n, C, L);
12899
+ return new Gt(n, C, O);
12893
12900
  }, ft.rationalSurfaceTransform = function(r, n) {
12894
12901
  for (var a = N.dehomogenize2d(r.controlPoints), l = 0, u = a.length; l < u; )
12895
12902
  for (var d = l++, p = 0, _ = a[d].length; p < _; ) {
12896
- var v = p++, w = a[d][v];
12897
- w.push(1), a[d][v] = Lt.dot(n, w).slice(0, w.length - 1);
12903
+ var v = p++, A = a[d][v];
12904
+ A.push(1), a[d][v] = Lt.dot(n, A).slice(0, A.length - 1);
12898
12905
  }
12899
12906
  return new te(r.degreeU, r.degreeV, r.knotsU.slice(), r.knotsV.slice(), N.homogenize2d(a, N.weight2d(r.controlPoints)));
12900
12907
  }, ft.rationalCurveTransform = function(r, n) {
@@ -12907,8 +12914,8 @@ var Ah = { exports: {} };
12907
12914
  var l = [], u, d, p;
12908
12915
  a ? (p = r.controlPoints, u = r.knotsV, d = r.degreeV) : (p = Lt.transpose(r.controlPoints), u = r.knotsU, d = r.degreeU);
12909
12916
  for (var _ = null, v = 0; v < p.length; ) {
12910
- var w = p[v];
12911
- ++v, _ = ft.curveKnotRefine(new Gt(d, u, w), n), l.push(_.controlPoints);
12917
+ var A = p[v];
12918
+ ++v, _ = ft.curveKnotRefine(new Gt(d, u, A), n), l.push(_.controlPoints);
12912
12919
  }
12913
12920
  var I = _.knots;
12914
12921
  return a ? new te(r.degreeU, r.degreeV, r.knotsU.slice(), I, l) : (l = Lt.transpose(l), new te(r.degreeU, r.degreeV, I, r.knotsV.slice(), l));
@@ -12916,8 +12923,8 @@ var Ah = { exports: {} };
12916
12923
  for (var n = r.degree, a = r.controlPoints, l = r.knots, u = yt.knotMultiplicities(l), d = n + 1, p = 0; p < u.length; ) {
12917
12924
  var _ = u[p];
12918
12925
  if (++p, _.mult < d) {
12919
- var v = m.rep(d - _.mult, _.knot), w = ft.curveKnotRefine(new Gt(n, l, a), v);
12920
- l = w.knots, a = w.controlPoints;
12926
+ var v = m.rep(d - _.mult, _.knot), A = ft.curveKnotRefine(new Gt(n, l, a), v);
12927
+ l = A.knots, a = A.controlPoints;
12921
12928
  }
12922
12929
  }
12923
12930
  l.length / d - 1;
@@ -12928,23 +12935,23 @@ var Ah = { exports: {} };
12928
12935
  return S;
12929
12936
  }, ft.curveKnotRefine = function(r, n) {
12930
12937
  if (n.length == 0) return pt.clonedCurve(r);
12931
- for (var a = r.degree, l = r.controlPoints, u = r.knots, d = l.length - 1, p = d + a + 1, _ = n.length - 1, v = N.knotSpan(a, n[0], u), w = N.knotSpan(a, n[_], u), I = [], S = [], P = 0, k = v - a + 1; P < k; ) {
12938
+ for (var a = r.degree, l = r.controlPoints, u = r.knots, d = l.length - 1, p = d + a + 1, _ = n.length - 1, v = N.knotSpan(a, n[0], u), A = N.knotSpan(a, n[_], u), I = [], S = [], P = 0, k = v - a + 1; P < k; ) {
12932
12939
  var T = P++;
12933
12940
  I[T] = l[T];
12934
12941
  }
12935
- for (var L = w - 1, C = d + 1; L < C; ) {
12936
- var F = L++;
12942
+ for (var O = A - 1, C = d + 1; O < C; ) {
12943
+ var F = O++;
12937
12944
  I[F + _ + 1] = l[F];
12938
12945
  }
12939
12946
  for (var R = 0, U = v + 1; R < U; ) {
12940
12947
  var V = R++;
12941
12948
  S[V] = u[V];
12942
12949
  }
12943
- for (var q = w + a, J = p + 1; q < J; ) {
12950
+ for (var q = A + a, J = p + 1; q < J; ) {
12944
12951
  var H = q++;
12945
12952
  S[H + _ + 1] = u[H];
12946
12953
  }
12947
- for (var G = w + a - 1, K = w + a + _, tt = _; tt >= 0; ) {
12954
+ for (var G = A + a - 1, K = A + a + _, tt = _; tt >= 0; ) {
12948
12955
  for (; n[tt] <= u[G] && G > v; )
12949
12956
  I[K - a - 1] = l[G - a - 1], S[K] = u[G], K = K - 1, G = G - 1;
12950
12957
  I[K - a - 1] = I[K - a];
@@ -12956,12 +12963,12 @@ var Ah = { exports: {} };
12956
12963
  }
12957
12964
  return new Gt(a, S, I);
12958
12965
  }, ft.curveKnotInsert = function(r, n, a) {
12959
- for (var l = r.degree, u = r.controlPoints, d = r.knots, p = 0, _ = u.length, v = N.knotSpan(l, n, d), w = [], I = [], S = [], P = 1, k = v + 1; P < k; ) {
12966
+ for (var l = r.degree, u = r.controlPoints, d = r.knots, p = 0, _ = u.length, v = N.knotSpan(l, n, d), A = [], I = [], S = [], P = 1, k = v + 1; P < k; ) {
12960
12967
  var T = P++;
12961
12968
  I[T] = d[T];
12962
12969
  }
12963
- for (var L = 1, C = a + 1; L < C; ) {
12964
- var F = L++;
12970
+ for (var O = 1, C = a + 1; O < C; ) {
12971
+ var F = O++;
12965
12972
  I[v + F] = n;
12966
12973
  }
12967
12974
  for (var R = v + 1, U = d.length; R < U; ) {
@@ -12978,20 +12985,20 @@ var Ah = { exports: {} };
12978
12985
  }
12979
12986
  for (var tt = 0, et = l - p + 1; tt < et; ) {
12980
12987
  var it = tt++;
12981
- w[it] = u[v - l + it];
12988
+ A[it] = u[v - l + it];
12982
12989
  }
12983
12990
  for (var ht = 0, at = 0, ct = 1, nt = a + 1; ct < nt; ) {
12984
12991
  var mt = ct++;
12985
12992
  ht = v - l + mt;
12986
12993
  for (var X = 0, gt = l - mt - p + 1; X < gt; ) {
12987
12994
  var It = X++;
12988
- at = (n - d[ht + It]) / (d[It + v + 1] - d[ht + It]), w[It] = m.add(m.mul(at, w[It + 1]), m.mul(1 - at, w[It]));
12995
+ at = (n - d[ht + It]) / (d[It + v + 1] - d[ht + It]), A[It] = m.add(m.mul(at, A[It + 1]), m.mul(1 - at, A[It]));
12989
12996
  }
12990
- S[ht] = w[0], S[v + a - mt - p] = w[l - mt - p];
12997
+ S[ht] = A[0], S[v + a - mt - p] = A[l - mt - p];
12991
12998
  }
12992
12999
  for (var jt = ht + 1, Xt = v - p; jt < Xt; ) {
12993
13000
  var Dt = jt++;
12994
- S[Dt] = w[Dt - ht];
13001
+ S[Dt] = A[Dt - ht];
12995
13002
  }
12996
13003
  return new Gt(l, I, S);
12997
13004
  };
@@ -13002,8 +13009,8 @@ var Ah = { exports: {} };
13002
13009
  }, zt.rationalCurveRegularSampleRange = function(r, n, a, l, u) {
13003
13010
  l < 1 && (l = 2);
13004
13011
  for (var d = [], p = (a - n) / (l - 1), _ = 0, v = 0; v < l; ) {
13005
- var w = v++;
13006
- _ = n + p * w, u ? d.push([_].concat(N.rationalCurvePoint(r, _))) : d.push(N.rationalCurvePoint(r, _));
13012
+ var A = v++;
13013
+ _ = n + p * A, u ? d.push([_].concat(N.rationalCurvePoint(r, _))) : d.push(N.rationalCurvePoint(r, _));
13007
13014
  }
13008
13015
  return d;
13009
13016
  }, zt.rationalCurveAdaptiveSample = function(r, n, a) {
@@ -13018,19 +13025,19 @@ var Ah = { exports: {} };
13018
13025
  return r.controlPoints.map(N.dehomogenize);
13019
13026
  return zt.rationalCurveAdaptiveSampleRange(r, r.knots[0], $.last(r.knots), n, a);
13020
13027
  }, zt.rationalCurveAdaptiveSampleRange = function(r, n, a, l, u) {
13021
- var d = N.rationalCurvePoint(r, n), p = N.rationalCurvePoint(r, a), _ = 0.5 + 0.2 * Math.random(), v = n + (a - n) * _, w = N.rationalCurvePoint(r, v), I = m.sub(d, p), S = m.sub(d, w);
13022
- if (m.dot(I, I) < l && m.dot(S, S) > l || !Ne.threePointsAreFlat(d, w, p, l)) {
13028
+ var d = N.rationalCurvePoint(r, n), p = N.rationalCurvePoint(r, a), _ = 0.5 + 0.2 * Math.random(), v = n + (a - n) * _, A = N.rationalCurvePoint(r, v), I = m.sub(d, p), S = m.sub(d, A);
13029
+ if (m.dot(I, I) < l && m.dot(S, S) > l || !Ne.threePointsAreFlat(d, A, p, l)) {
13023
13030
  var P = n + (a - n) * 0.5, k = zt.rationalCurveAdaptiveSampleRange(r, n, P, l, u), T = zt.rationalCurveAdaptiveSampleRange(r, P, a, l, u);
13024
13031
  return k.slice(0, -1).concat(T);
13025
13032
  } else return u ? [[n].concat(d), [a].concat(p)] : [d, p];
13026
13033
  }, zt.rationalSurfaceNaive = function(r, n, a) {
13027
13034
  n < 1 && (n = 1), a < 1 && (a = 1), r.degreeU, r.degreeV, r.controlPoints;
13028
- for (var l = r.knotsU, u = r.knotsV, d = $.last(l) - l[0], p = $.last(u) - u[0], _ = d / n, v = p / a, w = [], I = [], S = [], P = 0, k = n + 1; P < k; )
13029
- for (var T = P++, L = 0, C = a + 1; L < C; ) {
13030
- var F = L++, R = T * _, U = F * v;
13035
+ for (var l = r.knotsU, u = r.knotsV, d = $.last(l) - l[0], p = $.last(u) - u[0], _ = d / n, v = p / a, A = [], I = [], S = [], P = 0, k = n + 1; P < k; )
13036
+ for (var T = P++, O = 0, C = a + 1; O < C; ) {
13037
+ var F = O++, R = T * _, U = F * v;
13031
13038
  I.push([R, U]);
13032
13039
  var V = N.rationalSurfaceDerivatives(r, R, U, 1), q = V[0][0];
13033
- w.push(q);
13040
+ A.push(q);
13034
13041
  var J = m.normalized(m.cross(V[1][0], V[0][1]));
13035
13042
  S.push(J);
13036
13043
  }
@@ -13039,17 +13046,17 @@ var Ah = { exports: {} };
13039
13046
  var et = tt++, it = K * (a + 1) + et, ht = (K + 1) * (a + 1) + et, at = ht + 1, ct = it + 1, nt = [it, ht, at], mt = [it, at, ct];
13040
13047
  H.push(nt), H.push(mt);
13041
13048
  }
13042
- return new qe(H, w, S, I);
13049
+ return new qe(H, A, S, I);
13043
13050
  }, zt.divideRationalSurfaceAdaptive = function(r, n) {
13044
13051
  n == null && (n = new Lr()), n.minDivsU != null ? n.minDivsU = n.minDivsU : n.minDivsU = 1, n.minDivsV != null ? n.minDivsU = n.minDivsV : n.minDivsU = 1, n.refine != null ? n.refine = n.refine : n.refine = !0;
13045
13052
  var a = (r.controlPoints.length - 1) * 2, l = (r.controlPoints[0].length - 1) * 2, u;
13046
13053
  n.minDivsU > a ? u = n.minDivsU = n.minDivsU : u = n.minDivsU = a;
13047
13054
  var d;
13048
13055
  n.minDivsV > l ? d = n.minDivsV = n.minDivsV : d = n.minDivsV = l;
13049
- for (var p = $.last(r.knotsU), _ = r.knotsU[0], v = $.last(r.knotsV), w = r.knotsV[0], I = (p - _) / u, S = (v - w) / d, P = [], k = [], T = 0, L = d + 1; T < L; ) {
13056
+ for (var p = $.last(r.knotsU), _ = r.knotsU[0], v = $.last(r.knotsV), A = r.knotsV[0], I = (p - _) / u, S = (v - A) / d, P = [], k = [], T = 0, O = d + 1; T < O; ) {
13050
13057
  for (var C = T++, F = [], R = 0, U = u + 1; R < U; ) {
13051
- var V = R++, q = _ + I * V, J = w + S * C, H = N.rationalSurfaceDerivatives(r, q, J, 1), G = m.normalized(m.cross(H[0][1], H[1][0]));
13052
- F.push(new Ge(H[0][0], G, [q, J], -1, m.isZero(G)));
13058
+ var V = R++, q = _ + I * V, J = A + S * C, H = N.rationalSurfaceDerivatives(r, q, J, 1), G = m.normalized(m.cross(H[0][1], H[1][0]));
13059
+ F.push(new je(H[0][0], G, [q, J], -1, m.isZero(G)));
13053
13060
  }
13054
13061
  k.push(F);
13055
13062
  }
@@ -13093,7 +13100,7 @@ var Ah = { exports: {} };
13093
13100
  var cr = f.core.AdaptiveRefinementNode = function(r, n, a) {
13094
13101
  if (this.srf = r, a == null ? this.neighbors = [null, null, null, null] : this.neighbors = a, this.corners = n, this.corners == null) {
13095
13102
  var l = r.knotsU[0], u = $.last(r.knotsU), d = r.knotsV[0], p = $.last(r.knotsV);
13096
- this.corners = [Ge.fromUv(l, d), Ge.fromUv(u, d), Ge.fromUv(u, p), Ge.fromUv(l, p)];
13103
+ this.corners = [je.fromUv(l, d), je.fromUv(u, d), je.fromUv(u, p), je.fromUv(l, p)];
13097
13104
  }
13098
13105
  };
13099
13106
  b["verb.eval.AdaptiveRefinementNode"] = cr, cr.__name__ = ["verb", "eval", "AdaptiveRefinementNode"], cr.prototype = {
@@ -13115,7 +13122,7 @@ var Ah = { exports: {} };
13115
13122
  },
13116
13123
  evalSrf: function(r, n, a) {
13117
13124
  var l = N.rationalSurfaceDerivatives(this.srf, r, n, 1), u = l[0][0], d = m.cross(l[0][1], l[1][0]), p = m.isZero(d);
13118
- return p || (d = m.normalized(d)), a != null ? (a.degen = p, a.point = u, a.normal = d, a) : new Ge(u, d, [r, n], -1, p);
13125
+ return p || (d = m.normalized(d)), a != null ? (a.degen = p, a.point = u, a.normal = d, a) : new je(u, d, [r, n], -1, p);
13119
13126
  },
13120
13127
  getEdgeCorners: function(r) {
13121
13128
  if (this.isLeaf()) return [this.corners[r]];
@@ -13203,8 +13210,8 @@ var Ah = { exports: {} };
13203
13210
  this.children = [new cr(this.srf, d), new cr(this.srf, p)], this.children[0].neighbors = [this.neighbors[0], this.children[1], this.neighbors[2], this.neighbors[3]], this.children[1].neighbors = [this.neighbors[0], this.neighbors[1], this.neighbors[2], this.children[0]];
13204
13211
  }
13205
13212
  for (var _ = 0, v = this.children; _ < v.length; ) {
13206
- var w = v[_];
13207
- ++_, w._divide(r, n, !a);
13213
+ var A = v[_];
13214
+ ++_, A._divide(r, n, !a);
13208
13215
  }
13209
13216
  }
13210
13217
  },
@@ -13221,7 +13228,7 @@ var Ah = { exports: {} };
13221
13228
  for (var n = r.points.length, a = [], l = [], u = 0, d = 0; d < 4; ) {
13222
13229
  var p = d++, _ = this.getAllCorners(p);
13223
13230
  _.length == 2 && (u = p + 1);
13224
- for (var v = 0, w = _.length; v < w; ) {
13231
+ for (var v = 0, A = _.length; v < A; ) {
13225
13232
  var I = v++;
13226
13233
  a.push(_[I]);
13227
13234
  }
@@ -13242,8 +13249,8 @@ var Ah = { exports: {} };
13242
13249
  }
13243
13250
  var T = this.center();
13244
13251
  r.uvs.push(T.uv), r.points.push(T.point), r.normals.push(T.normal);
13245
- for (var L = r.points.length - 1, C = 0, F = a.length - 1; C < a.length; )
13246
- r.faces.push([L, l[C], l[F]]), F = C++;
13252
+ for (var O = r.points.length - 1, C = 0, F = a.length - 1; C < a.length; )
13253
+ r.faces.push([O, l[C], l[F]]), F = C++;
13247
13254
  return r;
13248
13255
  },
13249
13256
  __class__: cr
@@ -13307,7 +13314,7 @@ var Ah = { exports: {} };
13307
13314
  __class__: Sn
13308
13315
  };
13309
13316
  var Tt = f.geom.NurbsCurve = function(r) {
13310
- this._data = je.isValidNurbsCurveData(r);
13317
+ this._data = We.isValidNurbsCurveData(r);
13311
13318
  };
13312
13319
  b["verb.geom.NurbsCurve"] = Tt, Tt.__name__ = ["verb", "geom", "NurbsCurve"], Tt.__interfaces__ = [Sn], Tt.byKnotsControlPointsWeights = function(r, n, a, l) {
13313
13320
  return new Tt(new Gt(r, n.slice(), N.homogenize1d(a, l)));
@@ -13473,7 +13480,7 @@ var Ah = { exports: {} };
13473
13480
  __class__: In
13474
13481
  };
13475
13482
  var Pt = f.geom.NurbsSurface = function(r) {
13476
- this._data = je.isValidNurbsSurfaceData(r);
13483
+ this._data = We.isValidNurbsSurfaceData(r);
13477
13484
  };
13478
13485
  b["verb.geom.NurbsSurface"] = Pt, Pt.__name__ = ["verb", "geom", "NurbsSurface"], Pt.__interfaces__ = [In], Pt.byKnotsControlPointsWeights = function(r, n, a, l, u, d) {
13479
13486
  return new Pt(new te(r, n, a, l, N.homogenize2d(u, d)));
@@ -13762,7 +13769,7 @@ var Ah = { exports: {} };
13762
13769
  });
13763
13770
  function Ke(r) {
13764
13771
  return r instanceof Array ? function() {
13765
- return O.iter(r);
13772
+ return L.iter(r);
13766
13773
  } : typeof r.iterator == "function" ? Ce(r, r.iterator) : r.iterator;
13767
13774
  }
13768
13775
  var li, Ch = 0;
@@ -13793,9 +13800,9 @@ var Ah = { exports: {} };
13793
13800
  }
13794
13801
  return n;
13795
13802
  });
13796
- var hi = {}, Ls = A.ArrayBuffer || ae;
13797
- Ls.prototype.slice == null && (Ls.prototype.slice = ae.sliceImpl), A.DataView;
13798
- var ui = A.Uint8Array || sr._new;
13803
+ var hi = {}, Ls = w.ArrayBuffer || ae;
13804
+ Ls.prototype.slice == null && (Ls.prototype.slice = ae.sliceImpl), w.DataView;
13805
+ var ui = w.Uint8Array || sr._new;
13799
13806
  (function(r, n) {
13800
13807
  if (r.setImmediate)
13801
13808
  return;
@@ -13809,9 +13816,9 @@ var Ah = { exports: {} };
13809
13816
  typeof R == "function" ? R.apply(n, U) : new Function("" + R)();
13810
13817
  };
13811
13818
  }
13812
- function w(R) {
13819
+ function A(R) {
13813
13820
  if (u)
13814
- setTimeout(v(w, R), 0);
13821
+ setTimeout(v(A, R), 0);
13815
13822
  else {
13816
13823
  var U = l[R];
13817
13824
  if (U) {
@@ -13830,7 +13837,7 @@ var Ah = { exports: {} };
13830
13837
  function S() {
13831
13838
  p = function() {
13832
13839
  var R = _(arguments);
13833
- return process.nextTick(v(w, R)), R;
13840
+ return process.nextTick(v(A, R)), R;
13834
13841
  };
13835
13842
  }
13836
13843
  function P() {
@@ -13843,7 +13850,7 @@ var Ah = { exports: {} };
13843
13850
  }
13844
13851
  function k() {
13845
13852
  var R = "setImmediate$" + Math.random() + "$", U = function(V) {
13846
- V.source === r && typeof V.data == "string" && V.data.indexOf(R) === 0 && w(+V.data.slice(R.length));
13853
+ V.source === r && typeof V.data == "string" && V.data.indexOf(R) === 0 && A(+V.data.slice(R.length));
13847
13854
  };
13848
13855
  r.addEventListener ? r.addEventListener("message", U, !1) : r.attachEvent("onmessage", U), p = function() {
13849
13856
  var V = _(arguments);
@@ -13854,29 +13861,29 @@ var Ah = { exports: {} };
13854
13861
  var R = new MessageChannel();
13855
13862
  R.port1.onmessage = function(U) {
13856
13863
  var V = U.data;
13857
- w(V);
13864
+ A(V);
13858
13865
  }, p = function() {
13859
13866
  var U = _(arguments);
13860
13867
  return R.port2.postMessage(U), U;
13861
13868
  };
13862
13869
  }
13863
- function L() {
13870
+ function O() {
13864
13871
  var R = d.documentElement;
13865
13872
  p = function() {
13866
13873
  var U = _(arguments), V = d.createElement("script");
13867
13874
  return V.onreadystatechange = function() {
13868
- w(U), V.onreadystatechange = null, R.removeChild(V), V = null;
13875
+ A(U), V.onreadystatechange = null, R.removeChild(V), V = null;
13869
13876
  }, R.appendChild(V), U;
13870
13877
  };
13871
13878
  }
13872
13879
  function C() {
13873
13880
  p = function() {
13874
13881
  var R = _(arguments);
13875
- return setTimeout(v(w, R), 0), R;
13882
+ return setTimeout(v(A, R), 0), R;
13876
13883
  };
13877
13884
  }
13878
13885
  var F = Object.getPrototypeOf && Object.getPrototypeOf(r);
13879
- F = F && F.setTimeout ? F : r, {}.toString.call(r.process) === "[object process]" ? S() : P() ? k() : r.MessageChannel ? T() : d && "onreadystatechange" in d.createElement("script") ? L() : C(), F.setImmediate = p, F.clearImmediate = I;
13886
+ F = F && F.setTimeout ? F : r, {}.toString.call(r.process) === "[object process]" ? S() : P() ? k() : r.MessageChannel ? T() : d && "onreadystatechange" in d.createElement("script") ? O() : C(), F.setImmediate = p, F.clearImmediate = I;
13880
13887
  })(new Function("return this")()), qt.USE_CACHE = !1, qt.USE_ENUM_INDEX = !1, qt.BASE64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%:", Wt.DEFAULT_RESOLVER = ut, Wt.BASE64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%:", Ot.count = 0, ie.i64tmp = function(r) {
13881
13888
  var n, a = new Vt(0, 0);
13882
13889
  return n = a, n;
@@ -13999,14 +14006,14 @@ class Md extends Ts {
13999
14006
  const c = (h - (this._closed ? 0 : 1)) * t;
14000
14007
  let g = Math.floor(c), x = c - g;
14001
14008
  this._closed ? g += g > 0 ? 0 : (Math.floor(Math.abs(g) / h) + 1) * h : x === 0 && g === h - 1 && (g = h - 2, x = 1);
14002
- let f, A;
14009
+ let f, w;
14003
14010
  this._closed || g > 0 ? f = o[(g - 1) % h] : (this._tmp.subVectors(o[0], o[1]).add(o[0]), f = new Y(this._tmp.x, this._tmp.y, this._tmp.z));
14004
14011
  const b = o[g % h], E = o[(g + 1) % h];
14005
- if (this._closed || g + 2 < h ? A = o[(g + 2) % h] : (this._tmp.subVectors(o[h - 1], o[h - 2]).add(o[h - 1]), A = new Y(this._tmp.x, this._tmp.y, this._tmp.z)), this._curveType === "centripetal" || this._curveType === "chordal") {
14012
+ if (this._closed || g + 2 < h ? w = o[(g + 2) % h] : (this._tmp.subVectors(o[h - 1], o[h - 2]).add(o[h - 1]), w = new Y(this._tmp.x, this._tmp.y, this._tmp.z)), this._curveType === "centripetal" || this._curveType === "chordal") {
14006
14013
  const M = this._curveType === "chordal" ? 0.5 : 0.25;
14007
- let O = Math.pow(f.distanceToSquared(b), M), z = Math.pow(b.distanceToSquared(E), M), D = Math.pow(E.distanceToSquared(A), M);
14008
- z < 1e-4 && (z = 1), O < 1e-4 && (O = z), D < 1e-4 && (D = z), this._px.initNonuniformCatmullRom(f.x, b.x, E.x, A.x, O, z, D), this._py.initNonuniformCatmullRom(f.y, b.y, E.y, A.y, O, z, D), this._pz.initNonuniformCatmullRom(f.z, b.z, E.z, A.z, O, z, D);
14009
- } else this._curveType === "catmullrom" && (this._px.initCatmullRom(f.x, b.x, E.x, A.x, this._tension), this._py.initCatmullRom(f.y, b.y, E.y, A.y, this._tension), this._pz.initCatmullRom(f.z, b.z, E.z, A.z, this._tension));
14014
+ let L = Math.pow(f.distanceToSquared(b), M), z = Math.pow(b.distanceToSquared(E), M), D = Math.pow(E.distanceToSquared(w), M);
14015
+ z < 1e-4 && (z = 1), L < 1e-4 && (L = z), D < 1e-4 && (D = z), this._px.initNonuniformCatmullRom(f.x, b.x, E.x, w.x, L, z, D), this._py.initNonuniformCatmullRom(f.y, b.y, E.y, w.y, L, z, D), this._pz.initNonuniformCatmullRom(f.z, b.z, E.z, w.z, L, z, D);
14016
+ } else this._curveType === "catmullrom" && (this._px.initCatmullRom(f.x, b.x, E.x, w.x, this._tension), this._py.initCatmullRom(f.y, b.y, E.y, w.y, this._tension), this._pz.initCatmullRom(f.z, b.z, E.z, w.z, this._tension));
14010
14017
  return s.set(
14011
14018
  this._px.calc(x),
14012
14019
  this._py.calc(x),
@@ -14214,11 +14221,11 @@ class mn extends Ts {
14214
14221
  let g, x = 3, f = !1;
14215
14222
  if (c >= 3 && (Array.isArray(s) ? (g = s, c >= 4 && (x = o || 3), c >= 5 && (f = h)) : s !== void 0 && (x = s || 3, c >= 4 && (f = o))), s === void 0 && c >= 4 && (x = o || 3, c >= 5 && (f = h)), this._degree = x, this._closed = f, this._controlPoints.length < this._degree + 1)
14216
14223
  throw Ye.ILLEGAL_PARAMETERS;
14217
- const A = this.toVerbPoints(this._controlPoints);
14224
+ const w = this.toVerbPoints(this._controlPoints);
14218
14225
  this._nurbsCurve = Nn.geom.NurbsCurve.byKnotsControlPointsWeights(
14219
14226
  this._degree,
14220
14227
  e,
14221
- A,
14228
+ w,
14222
14229
  g
14223
14230
  );
14224
14231
  } else {
@@ -14327,7 +14334,7 @@ class mn extends Ts {
14327
14334
  getPoints(t = 100) {
14328
14335
  const e = this._nurbsCurve, s = [], o = e.knots(), h = this._nurbsCurve.degree(), c = o[h], g = o[o.length - h - 1], x = (g - c) / (t - 1);
14329
14336
  for (let f = 0; f < t; f++) {
14330
- const A = f === t - 1 ? g : c + f * x, b = e.point(A);
14337
+ const w = f === t - 1 ? g : c + f * x, b = e.point(w);
14331
14338
  s.push(new Y(b[0], b[1], b[2]));
14332
14339
  }
14333
14340
  return s;
@@ -15071,9 +15078,9 @@ const Ia = class Ia extends ke {
15071
15078
  */
15072
15079
  constructor(t, e, s = 0, o = !1, h = 0, c = 0, g = null) {
15073
15080
  super(), this._polyType = t, this._elevation = s;
15074
- const x = g && (g == null ? void 0 : g.length) === e.length, f = e.map((A, b) => ({
15075
- x: A.x,
15076
- y: A.y,
15081
+ const x = g && (g == null ? void 0 : g.length) === e.length, f = e.map((w, b) => ({
15082
+ x: w.x,
15083
+ y: w.y,
15077
15084
  bulge: x ? g[b] : void 0
15078
15085
  }));
15079
15086
  this._geo = new Rn(f, o);
@@ -18123,12 +18130,12 @@ const Fa = class Fa extends Ee {
18123
18130
  return new Ct();
18124
18131
  }
18125
18132
  /**
18126
- * Returns the full property definition for this ray entity, including
18133
+ * Returns the full property definition for this mtext entity, including
18127
18134
  * general group and geometry group.
18128
18135
  *
18129
18136
  * The geometry group exposes editable start/end coordinates via
18130
18137
  * {@link AcDbPropertyAccessor} so the property palette can update
18131
- * the ray in real-time.
18138
+ * the mtext in real-time.
18132
18139
  *
18133
18140
  * Each property is an {@link AcDbEntityRuntimeProperty}.
18134
18141
  */
@@ -18652,9 +18659,9 @@ const Rd = /* @__PURE__ */ new Z(), Da = class Da extends ti {
18652
18659
  s += E > 0 ? this.columnWidth(E - 1) : 0, e = 0;
18653
18660
  for (let M = 0; M < this.numRows; M++) {
18654
18661
  e += M > 0 ? this.rowHeight(M - 1) : 0;
18655
- const O = this.cell(M * this.numColumns + E);
18656
- if (f = M * this.numColumns + E, O && !x[f]) {
18657
- const z = O.borderWidth ?? 1, D = O.borderHeight ?? 1;
18662
+ const L = this.cell(M * this.numColumns + E);
18663
+ if (f = M * this.numColumns + E, L && !x[f]) {
18664
+ const z = L.borderWidth ?? 1, D = L.borderHeight ?? 1;
18658
18665
  this.fillVisited(
18659
18666
  x,
18660
18667
  f,
@@ -18665,20 +18672,20 @@ const Rd = /* @__PURE__ */ new Z(), Da = class Da extends ti {
18665
18672
  const B = h[o[c - 1] * 3] - s, dt = E + (M + D) * (this.numColumns + 1) + z;
18666
18673
  E + z == this.numColumns && (o[c++] = E + M * (this.numColumns + 1) + z, o[c++] = dt);
18667
18674
  const vt = -h[dt * 3 + 1] - e;
18668
- if (M + D == this.numRows && (o[c++] = E + (M + D) * (this.numColumns + 1) + D, o[c++] = E + (M + D) * (this.numColumns + 1)), o[c++] = E + (M + D) * (this.numColumns + 1), o[c++] = E + M * (this.numColumns + 1), O.text) {
18669
- const ot = O.attachmentPoint || this.attachmentPoint || Pe.MiddleCenter, W = this.getTableTextOffset(
18675
+ if (M + D == this.numRows && (o[c++] = E + (M + D) * (this.numColumns + 1) + D, o[c++] = E + (M + D) * (this.numColumns + 1)), o[c++] = E + (M + D) * (this.numColumns + 1), o[c++] = E + M * (this.numColumns + 1), L.text) {
18676
+ const ot = L.attachmentPoint || this.attachmentPoint || Pe.MiddleCenter, W = this.getTableTextOffset(
18670
18677
  ot,
18671
18678
  B,
18672
18679
  vt
18673
18680
  ), ut = {
18674
- text: O.text,
18675
- height: O.textHeight,
18681
+ text: L.text,
18682
+ height: L.textHeight,
18676
18683
  width: B,
18677
18684
  position: Rd.set(s, -e, 0).clone().add(W),
18678
18685
  rotation: this.rotation,
18679
18686
  attachmentPoint: ot
18680
18687
  }, st = {
18681
- ...this.getTextStyle(O),
18688
+ ...this.getTextStyle(L),
18682
18689
  color: this.color.color
18683
18690
  };
18684
18691
  g.push(t.mtext(ut, st));
@@ -18687,8 +18694,8 @@ const Rd = /* @__PURE__ */ new Z(), Da = class Da extends ti {
18687
18694
  }
18688
18695
  }
18689
18696
  g.push(t.lineSegments(h, 3, o, this.lineStyle));
18690
- const A = t.group(g), b = new un();
18691
- return b.setFromAxisAngle(Z.Z_AXIS, this.rotation), Ro.compose(this.position, b, this.scaleFactors), A.applyMatrix(Ro), this.attachEntityInfo(A), A;
18697
+ const w = t.group(g), b = new un();
18698
+ return b.setFromAxisAngle(Z.Z_AXIS, this.rotation), Ro.compose(this.position, b, this.scaleFactors), w.applyMatrix(Ro), this.attachEntityInfo(w), w;
18692
18699
  }
18693
18700
  /**
18694
18701
  * Marks cells as visited to handle merged cell rendering.
@@ -19095,6 +19102,133 @@ const Ua = class Ua extends Ee {
19095
19102
  get geometricExtents() {
19096
19103
  return new Ct();
19097
19104
  }
19105
+ /**
19106
+ * Returns the full property definition for this text entity, including
19107
+ * general group and geometry group.
19108
+ *
19109
+ * The geometry group exposes editable start/end coordinates via
19110
+ * {@link AcDbPropertyAccessor} so the property palette can update
19111
+ * the text in real-time.
19112
+ *
19113
+ * Each property is an {@link AcDbEntityRuntimeProperty}.
19114
+ */
19115
+ get properties() {
19116
+ return {
19117
+ type: this.type,
19118
+ groups: [
19119
+ this.getGeneralProperties(),
19120
+ {
19121
+ groupName: "text",
19122
+ properties: [
19123
+ {
19124
+ name: "contents",
19125
+ type: "string",
19126
+ editable: !0,
19127
+ accessor: {
19128
+ get: () => this.textString,
19129
+ set: (t) => {
19130
+ this.textString = t;
19131
+ }
19132
+ }
19133
+ },
19134
+ {
19135
+ name: "styleName",
19136
+ type: "string",
19137
+ editable: !0,
19138
+ accessor: {
19139
+ get: () => this.styleName,
19140
+ set: (t) => {
19141
+ this.styleName = t;
19142
+ }
19143
+ }
19144
+ },
19145
+ {
19146
+ name: "textHeight",
19147
+ type: "float",
19148
+ editable: !0,
19149
+ accessor: {
19150
+ get: () => this.height,
19151
+ set: (t) => {
19152
+ this.height = t;
19153
+ }
19154
+ }
19155
+ },
19156
+ {
19157
+ name: "rotation",
19158
+ type: "float",
19159
+ editable: !0,
19160
+ accessor: {
19161
+ get: () => this.rotation,
19162
+ set: (t) => {
19163
+ this.rotation = t;
19164
+ }
19165
+ }
19166
+ },
19167
+ {
19168
+ name: "widthFactor",
19169
+ type: "float",
19170
+ editable: !0,
19171
+ accessor: {
19172
+ get: () => this.widthFactor,
19173
+ set: (t) => {
19174
+ this.widthFactor = t;
19175
+ }
19176
+ }
19177
+ },
19178
+ {
19179
+ name: "oblique",
19180
+ type: "float",
19181
+ editable: !0,
19182
+ accessor: {
19183
+ get: () => this.oblique,
19184
+ set: (t) => {
19185
+ this.oblique = t;
19186
+ }
19187
+ }
19188
+ }
19189
+ ]
19190
+ },
19191
+ {
19192
+ groupName: "geometry",
19193
+ properties: [
19194
+ {
19195
+ name: "positionX",
19196
+ type: "float",
19197
+ editable: !0,
19198
+ accessor: {
19199
+ get: () => this.position.x,
19200
+ set: (t) => {
19201
+ this.position.x = t;
19202
+ }
19203
+ }
19204
+ },
19205
+ {
19206
+ name: "positionY",
19207
+ type: "float",
19208
+ editable: !0,
19209
+ accessor: {
19210
+ get: () => this.position.y,
19211
+ set: (t) => {
19212
+ this.position.y = t;
19213
+ }
19214
+ }
19215
+ },
19216
+ {
19217
+ name: "positionZ",
19218
+ type: "float",
19219
+ editable: !0,
19220
+ accessor: {
19221
+ get: () => this.position.z,
19222
+ set: (t) => {
19223
+ this.position.z = t;
19224
+ }
19225
+ }
19226
+ }
19227
+ ]
19228
+ }
19229
+ ]
19230
+ };
19231
+ }
19098
19232
  /**
19099
19233
  * Gets the text style for this text entity.
19100
19234
  *
@@ -22190,8 +22324,8 @@ class Do {
22190
22324
  }), e.hatchStyle = t.hatchStyle, e.patternName = t.patternName, e.patternType = t.patternType, e.patternAngle = t.patternAngle == null ? 0 : t.patternAngle, e.patternScale = t.patternScale == null ? 0 : t.patternScale, t.boundaryPaths.forEach((h) => {
22191
22325
  if (h.boundaryPathTypeFlag & 2) {
22192
22326
  const g = h, x = new Rn();
22193
- x.closed = g.isClosed, g.vertices.forEach((f, A) => {
22194
- x.addVertexAt(A, {
22327
+ x.closed = g.isClosed, g.vertices.forEach((f, w) => {
22328
+ x.addVertexAt(w, {
22195
22329
  x: f.x,
22196
22330
  y: f.y,
22197
22331
  bulge: f.bulge
@@ -22201,59 +22335,59 @@ class Do {
22201
22335
  const g = h, x = new Pd();
22202
22336
  g.edges.forEach((f) => {
22203
22337
  if (f.type == 1) {
22204
- const A = f;
22205
- x.add(new ya(A.start, A.end));
22338
+ const w = f;
22339
+ x.add(new ya(w.start, w.end));
22206
22340
  } else if (f.type == 2) {
22207
- const A = f;
22341
+ const w = f;
22208
22342
  x.add(
22209
22343
  new Ps(
22210
- A.center,
22211
- A.radius,
22212
- kt.degToRad(A.startAngle || 0),
22213
- kt.degToRad(A.endAngle || 0),
22214
- !A.isCCW
22344
+ w.center,
22345
+ w.radius,
22346
+ kt.degToRad(w.startAngle || 0),
22347
+ kt.degToRad(w.endAngle || 0),
22348
+ !w.isCCW
22215
22349
  )
22216
22350
  );
22217
22351
  } else if (f.type == 3) {
22218
- const A = f;
22219
- new Zt().subVectors(A.end, A.center);
22352
+ const w = f;
22353
+ new Zt().subVectors(w.end, w.center);
22220
22354
  const E = Math.sqrt(
22221
- Math.pow(A.end.x, 2) + Math.pow(A.end.y, 2)
22222
- ), M = E * A.lengthOfMinorAxis;
22223
- let O = kt.degToRad(A.startAngle || 0), z = kt.degToRad(A.endAngle || 0);
22224
- const D = Math.atan2(A.end.y, A.end.x);
22225
- A.isCCW || (O = Math.PI * 2 - O, z = Math.PI * 2 - z), x.add(
22355
+ Math.pow(w.end.x, 2) + Math.pow(w.end.y, 2)
22356
+ ), M = E * w.lengthOfMinorAxis;
22357
+ let L = kt.degToRad(w.startAngle || 0), z = kt.degToRad(w.endAngle || 0);
22358
+ const D = Math.atan2(w.end.y, w.end.x);
22359
+ w.isCCW || (L = Math.PI * 2 - L, z = Math.PI * 2 - z), x.add(
22226
22360
  new _a(
22227
- { ...A.center, z: 0 },
22361
+ { ...w.center, z: 0 },
22228
22362
  E,
22229
22363
  M,
22230
- O,
22364
+ L,
22231
22365
  z,
22232
- !A.isCCW,
22366
+ !w.isCCW,
22233
22367
  D
22234
22368
  )
22235
22369
  );
22236
22370
  } else if (f.type == 4) {
22237
- const A = f;
22238
- if (A.numberOfControlPoints > 0 && A.numberOfKnots > 0) {
22239
- const b = A.controlPoints.map(
22240
- (O) => ({
22241
- x: O.x,
22242
- y: O.y,
22371
+ const w = f;
22372
+ if (w.numberOfControlPoints > 0 && w.numberOfKnots > 0) {
22373
+ const b = w.controlPoints.map(
22374
+ (L) => ({
22375
+ x: L.x,
22376
+ y: L.y,
22243
22377
  z: 0
22244
22378
  })
22245
22379
  );
22246
22380
  let E = !0;
22247
- const M = A.controlPoints.map((O) => (O.weight == null && (E = !1), O.weight || 1));
22381
+ const M = w.controlPoints.map((L) => (L.weight == null && (E = !1), L.weight || 1));
22248
22382
  x.add(
22249
22383
  new mn(
22250
22384
  b,
22251
- A.knots,
22385
+ w.knots,
22252
22386
  E ? M : void 0
22253
22387
  )
22254
22388
  );
22255
- } else if (A.numberOfFitData > 0) {
22256
- const b = A.fitDatum.map((E) => ({
22389
+ } else if (w.numberOfFitData > 0) {
22390
+ const b = w.fitDatum.map((E) => ({
22257
22391
  x: E.x,
22258
22392
  y: E.y,
22259
22393
  z: 0
@@ -22430,128 +22564,351 @@ class Do {
22430
22564
  return h;
22431
22565
  }
22432
22566
  }
22433
- class ba extends pn {
22567
+ class Fn extends pn {
22434
22568
  /**
22435
- * Creates a new AcDbLayout instance.
22569
+ * Creates a new AcDbSymbolTableRecord instance.
22570
+ *
22571
+ * @param attrs - Input attribute values for this symbol table record
22572
+ * @param defaultAttrs - Default values for attributes of this symbol table record
22436
22573
  *
22437
22574
  * @example
22438
22575
  * ```typescript
22439
- * const layout = new AcDbLayout();
22576
+ * const record = new AcDbSymbolTableRecord({ name: 'MyRecord' });
22440
22577
  * ```
22441
22578
  */
22442
- constructor() {
22443
- super(), this._tabOrder = -1, this._tabSelected = !1, this._blockTableRecordId = "", this._layoutName = "", this._limits = new be(), this._extents = new Ct();
22579
+ constructor(t, e) {
22580
+ t = t || {}, ks(t, { name: "" }), super(t, e);
22444
22581
  }
22445
22582
  /**
22446
- * Gets the user-friendly layout name that is displayed in the tab control.
22583
+ * Gets or sets the name of the symbol table record.
22447
22584
  *
22448
- * Currently there is no restriction on the name except that the length
22449
- * is limited to 256 characters.
22585
+ * This property corresponds to DXF group code 2 and is used for
22586
+ * identifying and referencing the symbol table record.
22450
22587
  *
22451
- * @returns The layout name
22588
+ * @returns The name of the symbol table record
22452
22589
  *
22453
22590
  * @example
22454
22591
  * ```typescript
22455
- * const name = layout.layoutName;
22456
- * console.log('Layout name:', name);
22592
+ * const recordName = record.name;
22593
+ * record.name = 'NewRecordName';
22457
22594
  * ```
22458
22595
  */
22459
- get layoutName() {
22460
- return this._layoutName;
22596
+ get name() {
22597
+ return this.getAttr("name");
22598
+ }
22599
+ set name(t) {
22600
+ this.setAttr("name", t);
22461
22601
  }
22602
+ }
22603
+ const jr = class jr extends Fn {
22462
22604
  /**
22463
- * Sets the user-friendly layout name that is displayed in the tab control.
22605
+ * Returns true if the specified name is the name of the model space block table record.
22464
22606
  *
22465
- * @param value - The new layout name (limited to 256 characters)
22607
+ * Model space is the primary drawing area where most entities are created.
22608
+ *
22609
+ * @param name - The name of one block table record.
22610
+ * @returns True if the specified name is the name of the model space block table record.
22466
22611
  *
22467
22612
  * @example
22468
22613
  * ```typescript
22469
- * layout.layoutName = 'A4 Landscape';
22614
+ * if (AcDbBlockTableRecord.isModelSapceName('*Model_Space')) {
22615
+ * console.log('This is the name of the model space block table record.');
22616
+ * }
22470
22617
  * ```
22471
22618
  */
22472
- set layoutName(t) {
22473
- this._layoutName = t.length > 256 ? t.slice(0, 256) : t;
22619
+ static isModelSapceName(t) {
22620
+ return t.toLowerCase() == jr.MODEL_SPACE_NAME.toLowerCase();
22474
22621
  }
22475
22622
  /**
22476
- * Gets the tab order field, which controls the order in which layouts are displayed.
22623
+ * Returns true if the specified name is the name of a paper space block table record.
22477
22624
  *
22478
- * The tab order should be unique and sequential for each layout in the database.
22625
+ * Paper space is used for creating layouts for printing and plotting.
22479
22626
  *
22480
- * @returns The tab order value
22627
+ * @param name - The name of one block table record.
22628
+ * @returns True if the specified name is the name of a paper space block table record.
22481
22629
  *
22482
22630
  * @example
22483
22631
  * ```typescript
22484
- * const order = layout.tabOrder;
22632
+ * if (AcDbBlockTableRecord.isPaperSapceName('*Paper_Space1')) {
22633
+ * console.log('This is the name of the paper space block table record.');
22634
+ * }
22485
22635
  * ```
22486
22636
  */
22487
- get tabOrder() {
22488
- return this._tabOrder;
22637
+ static isPaperSapceName(t) {
22638
+ return t.toLowerCase().startsWith(jr.PAPER_SPACE_NAME_PREFIX.toLowerCase());
22489
22639
  }
22490
22640
  /**
22491
- * Sets the tab order field, which controls the order in which layouts are displayed.
22492
- *
22493
- * @param value - The new tab order value
22641
+ * Creates a new AcDbBlockTableRecord instance.
22494
22642
  *
22495
22643
  * @example
22496
22644
  * ```typescript
22497
- * layout.tabOrder = 1;
22645
+ * const blockRecord = new AcDbBlockTableRecord();
22498
22646
  * ```
22499
22647
  */
22500
- set tabOrder(t) {
22501
- this._tabOrder = t;
22648
+ constructor() {
22649
+ super(), this._origin = new Y(), this._layoutId = "", this._entities = /* @__PURE__ */ new Map();
22502
22650
  }
22503
22651
  /**
22504
- * Gets whether the layout tab is included in the selection set for operations.
22652
+ * Returns true if this is a model space block table record.
22505
22653
  *
22506
- * This flag indicates whether the layout tab is included in the selection set
22507
- * for operations that affect multiple tabs. The user can perform multiple
22508
- * selection via the user interface using shift-click.
22654
+ * Model space is the primary drawing area where most entities are created.
22509
22655
  *
22510
- * @returns True if the tab is selected, false otherwise
22656
+ * @returns True if this is a model space block table record
22511
22657
  *
22512
22658
  * @example
22513
22659
  * ```typescript
22514
- * const isSelected = layout.tabSelected;
22660
+ * if (blockRecord.isModelSapce) {
22661
+ * console.log('This is model space');
22662
+ * }
22515
22663
  * ```
22516
22664
  */
22517
- get tabSelected() {
22518
- return this._tabSelected;
22665
+ get isModelSapce() {
22666
+ return jr.isModelSapceName(this.name);
22519
22667
  }
22520
22668
  /**
22521
- * Sets whether the layout tab is included in the selection set for operations.
22669
+ * Returns true if this is a paper space block table record.
22522
22670
  *
22523
- * @param value - True to select the tab, false to deselect it
22671
+ * Paper space is used for creating layouts for printing and plotting.
22672
+ *
22673
+ * @returns True if this is a paper space block table record
22524
22674
  *
22525
22675
  * @example
22526
22676
  * ```typescript
22527
- * layout.tabSelected = true;
22677
+ * if (blockRecord.isPaperSapce) {
22678
+ * console.log('This is paper space');
22679
+ * }
22528
22680
  * ```
22529
22681
  */
22530
- set tabSelected(t) {
22531
- this._tabSelected = t;
22682
+ get isPaperSapce() {
22683
+ return jr.isPaperSapceName(this.name);
22532
22684
  }
22533
22685
  /**
22534
- * Gets the associated block table record ID of this layout.
22686
+ * Gets or sets the base point of the block in WCS coordinates.
22535
22687
  *
22536
- * @returns The block table record ID
22688
+ * This point is the origin of the MCS (Model Coordinate System), which is the
22689
+ * local WCS for the entities within the block table record.
22690
+ *
22691
+ * @returns The origin point of the block
22537
22692
  *
22538
22693
  * @example
22539
22694
  * ```typescript
22540
- * const blockId = layout.blockTableRecordId;
22695
+ * const origin = blockRecord.origin;
22696
+ * blockRecord.origin = new AcGePoint3d(10, 20, 0);
22541
22697
  * ```
22542
22698
  */
22543
- get blockTableRecordId() {
22544
- return this._blockTableRecordId;
22699
+ get origin() {
22700
+ return this._origin;
22701
+ }
22702
+ set origin(t) {
22703
+ this._origin.copy(t);
22545
22704
  }
22546
22705
  /**
22547
- * Sets the associated block table record ID of this layout.
22706
+ * Gets or sets the object ID of the associated AcDbLayout object in the Layouts dictionary.
22548
22707
  *
22549
- * @param value - The new block table record ID
22708
+ * This property links the block table record to its corresponding layout object,
22709
+ * which defines the viewport configuration and display settings for the block.
22710
+ * For model space blocks, this is typically empty, while paper space blocks
22711
+ * have a corresponding layout ID.
22712
+ *
22713
+ * @returns The object ID of the associated layout
22550
22714
  *
22551
22715
  * @example
22552
22716
  * ```typescript
22553
- * layout.blockTableRecordId = 'some-block-id';
22554
- * ```
22717
+ * const layoutId = blockRecord.layoutId;
22718
+ * blockRecord.layoutId = 'some-layout-object-id';
22719
+ * ```
22720
+ */
22721
+ get layoutId() {
22722
+ return this._layoutId;
22723
+ }
22724
+ set layoutId(t) {
22725
+ this._layoutId = t;
22726
+ }
22727
+ /**
22728
+ * Appends the specified entity or entities to this block table record.
22729
+ *
22730
+ * This method adds an entity to the block and sets up the necessary
22731
+ * relationships between the entity and the block table record.
22732
+ *
22733
+ * @param entity - The entity or entities to append to this block table record
22734
+ *
22735
+ * @example
22736
+ * ```typescript
22737
+ * const line = new AcDbLine();
22738
+ * blockRecord.appendEntity(line);
22739
+ * ```
22740
+ */
22741
+ appendEntity(t) {
22742
+ if (Array.isArray(t))
22743
+ for (let e = 0; e < t.length; ++e) {
22744
+ const s = t[e];
22745
+ s.database = this.database, s.ownerId = this.objectId, this._entities.set(s.objectId, s);
22746
+ }
22747
+ else
22748
+ t.database = this.database, t.ownerId = this.objectId, this._entities.set(t.objectId, t);
22749
+ (this.isModelSapce || this.isPaperSapce) && this.database.events.entityAppended.dispatch({
22750
+ database: this.database,
22751
+ entity: t
22752
+ });
22753
+ }
22754
+ /**
22755
+ * Creates an iterator object that can be used to iterate over the entities in the block table record.
22756
+ *
22757
+ * @returns An iterator object that can be used to iterate over the entities
22758
+ *
22759
+ * @example
22760
+ * ```typescript
22761
+ * const iterator = blockRecord.newIterator();
22762
+ * for (const entity of iterator) {
22763
+ * console.log('Entity:', entity.type);
22764
+ * }
22765
+ * ```
22766
+ */
22767
+ newIterator() {
22768
+ return new ua(this._entities);
22769
+ }
22770
+ /**
22771
+ * Searches for an entity in this block table record with the specified ID.
22772
+ *
22773
+ * @param id - The entity ID to search for
22774
+ * @returns The entity with the specified ID, or undefined if not found
22775
+ *
22776
+ * @example
22777
+ * ```typescript
22778
+ * const entity = blockRecord.getIdAt('some-entity-id');
22779
+ * if (entity) {
22780
+ * console.log('Found entity:', entity.type);
22781
+ * }
22782
+ * ```
22783
+ */
22784
+ getIdAt(t) {
22785
+ return this._entities.get(t);
22786
+ }
22787
+ };
22788
+ jr.MODEL_SPACE_NAME = "*MODEL_SPACE", jr.PAPER_SPACE_NAME_PREFIX = "*PAPER_SPACE";
22789
+ let Ge = jr;
22790
+ class ba extends pn {
22791
+ /**
22792
+ * Creates a new AcDbLayout instance.
22793
+ *
22794
+ * @example
22795
+ * ```typescript
22796
+ * const layout = new AcDbLayout();
22797
+ * ```
22798
+ */
22799
+ constructor() {
22800
+ super(), this._tabOrder = -1, this._tabSelected = !1, this._blockTableRecordId = "", this._layoutName = "", this._limits = new be(), this._extents = new Ct();
22801
+ }
22802
+ /**
22803
+ * Gets the user-friendly layout name that is displayed in the tab control.
22804
+ *
22805
+ * Currently there is no restriction on the name except that the length
22806
+ * is limited to 256 characters.
22807
+ *
22808
+ * @returns The layout name
22809
+ *
22810
+ * @example
22811
+ * ```typescript
22812
+ * const name = layout.layoutName;
22813
+ * console.log('Layout name:', name);
22814
+ * ```
22815
+ */
22816
+ get layoutName() {
22817
+ return this._layoutName;
22818
+ }
22819
+ /**
22820
+ * Sets the user-friendly layout name that is displayed in the tab control.
22821
+ *
22822
+ * @param value - The new layout name (limited to 256 characters)
22823
+ *
22824
+ * @example
22825
+ * ```typescript
22826
+ * layout.layoutName = 'A4 Landscape';
22827
+ * ```
22828
+ */
22829
+ set layoutName(t) {
22830
+ this._layoutName = t.length > 256 ? t.slice(0, 256) : t;
22831
+ }
22832
+ /**
22833
+ * Gets the tab order field, which controls the order in which layouts are displayed.
22834
+ *
22835
+ * The tab order should be unique and sequential for each layout in the database.
22836
+ *
22837
+ * @returns The tab order value
22838
+ *
22839
+ * @example
22840
+ * ```typescript
22841
+ * const order = layout.tabOrder;
22842
+ * ```
22843
+ */
22844
+ get tabOrder() {
22845
+ return this._tabOrder;
22846
+ }
22847
+ /**
22848
+ * Sets the tab order field, which controls the order in which layouts are displayed.
22849
+ *
22850
+ * @param value - The new tab order value
22851
+ *
22852
+ * @example
22853
+ * ```typescript
22854
+ * layout.tabOrder = 1;
22855
+ * ```
22856
+ */
22857
+ set tabOrder(t) {
22858
+ this._tabOrder = t;
22859
+ }
22860
+ /**
22861
+ * Gets whether the layout tab is included in the selection set for operations.
22862
+ *
22863
+ * This flag indicates whether the layout tab is included in the selection set
22864
+ * for operations that affect multiple tabs. The user can perform multiple
22865
+ * selection via the user interface using shift-click.
22866
+ *
22867
+ * @returns True if the tab is selected, false otherwise
22868
+ *
22869
+ * @example
22870
+ * ```typescript
22871
+ * const isSelected = layout.tabSelected;
22872
+ * ```
22873
+ */
22874
+ get tabSelected() {
22875
+ return this._tabSelected;
22876
+ }
22877
+ /**
22878
+ * Sets whether the layout tab is included in the selection set for operations.
22879
+ *
22880
+ * @param value - True to select the tab, false to deselect it
22881
+ *
22882
+ * @example
22883
+ * ```typescript
22884
+ * layout.tabSelected = true;
22885
+ * ```
22886
+ */
22887
+ set tabSelected(t) {
22888
+ this._tabSelected = t;
22889
+ }
22890
+ /**
22891
+ * Gets the associated block table record ID of this layout.
22892
+ *
22893
+ * @returns The block table record ID
22894
+ *
22895
+ * @example
22896
+ * ```typescript
22897
+ * const blockId = layout.blockTableRecordId;
22898
+ * ```
22899
+ */
22900
+ get blockTableRecordId() {
22901
+ return this._blockTableRecordId;
22902
+ }
22903
+ /**
22904
+ * Sets the associated block table record ID of this layout.
22905
+ *
22906
+ * @param value - The new block table record ID
22907
+ *
22908
+ * @example
22909
+ * ```typescript
22910
+ * layout.blockTableRecordId = 'some-block-id';
22911
+ * ```
22555
22912
  */
22556
22913
  set blockTableRecordId(t) {
22557
22914
  this._blockTableRecordId = t;
@@ -22898,9 +23255,13 @@ class Wd {
22898
23255
  * ```
22899
23256
  */
22900
23257
  convertLayout(t, e) {
22901
- var o;
23258
+ var o, h;
22902
23259
  const s = new ba();
22903
- return s.layoutName = t.layoutName, s.tabOrder = t.tabOrder, (o = e.tables.BLOCK_RECORD) == null || o.entries.some((h) => h.layoutObjects === t.handle ? (s.blockTableRecordId = h.handle, !0) : !1), s.limits.min.copy(t.minLimit), s.limits.max.copy(t.maxLimit), s.extents.min.copy(t.minExtent), s.extents.max.copy(t.maxExtent), this.processCommonAttrs(t, s), s;
23260
+ if (s.layoutName = t.layoutName, s.tabOrder = t.tabOrder, t.ownerObjectId ? s.blockTableRecordId = t.ownerObjectId : (o = e.tables.BLOCK_RECORD) == null || o.entries.some((c) => c.layoutObjects === t.handle ? (s.blockTableRecordId = c.handle, !0) : !1), !s.blockTableRecordId && t.layoutName === "Model") {
23261
+ const c = Ge.MODEL_SPACE_NAME;
23262
+ (h = e.tables.BLOCK_RECORD) == null || h.entries.some((g) => g.name.toUpperCase() === c ? (s.blockTableRecordId = g.handle, !0) : !1);
23263
+ }
23264
+ return s.limits.min.copy(t.minLimit), s.limits.max.copy(t.maxLimit), s.extents.min.copy(t.minExtent), s.extents.max.copy(t.maxExtent), this.processCommonAttrs(t, s), s;
22904
23265
  }
22905
23266
  /**
22906
23267
  * Converts a DXF image definition object to an AcDbRasterImageDef.
@@ -22985,23 +23346,23 @@ class Hd {
22985
23346
  timeout: x
22986
23347
  });
22987
23348
  const f = (b) => {
22988
- const { id: E, success: M, data: O, error: z } = b.data;
23349
+ const { id: E, success: M, data: L, error: z } = b.data;
22989
23350
  if (E !== t) return;
22990
23351
  this.cleanupTask(t);
22991
23352
  const D = Date.now() - o;
22992
23353
  h(M ? {
22993
23354
  success: !0,
22994
- data: O,
23355
+ data: L,
22995
23356
  duration: D
22996
23357
  } : {
22997
23358
  success: !1,
22998
23359
  error: z,
22999
23360
  duration: D
23000
23361
  });
23001
- }, A = (b) => {
23362
+ }, w = (b) => {
23002
23363
  this.cleanupTask(t), c(new Error(`Worker error: ${b.message}`));
23003
23364
  };
23004
- g.addEventListener("message", f), g.addEventListener("error", A), g.postMessage({
23365
+ g.addEventListener("message", f), g.addEventListener("error", w), g.postMessage({
23005
23366
  id: t,
23006
23367
  input: e
23007
23368
  });
@@ -23248,11 +23609,11 @@ class Xd extends Zo {
23248
23609
  t.forEach((c) => {
23249
23610
  if (c.type == "MTEXT") {
23250
23611
  const g = c;
23251
- [...g.text.matchAll(h)].forEach((A) => {
23252
- o.add(A[1].toLowerCase());
23612
+ [...g.text.matchAll(h)].forEach((w) => {
23613
+ o.add(w[1].toLowerCase());
23253
23614
  });
23254
23615
  const f = s.get(g.styleName);
23255
- f == null || f.forEach((A) => o.add(A));
23616
+ f == null || f.forEach((w) => o.add(w));
23256
23617
  } else if (c.type == "TEXT") {
23257
23618
  const g = c, x = s.get(g.styleName);
23258
23619
  x == null || x.forEach((f) => o.add(f));
@@ -23290,14 +23651,14 @@ class Xd extends Zo {
23290
23651
  s
23291
23652
  );
23292
23653
  this.config.convertByEntityType && (g = this.groupAndFlattenByType(g));
23293
- const A = e.tables.blockTable.modelSpace;
23654
+ const w = e.tables.blockTable.modelSpace;
23294
23655
  await f.processChunk(async (b, E) => {
23295
- let M = [], O = b < E ? g[b].type : "";
23656
+ let M = [], L = b < E ? g[b].type : "";
23296
23657
  for (let z = b; z < E; z++) {
23297
23658
  const D = g[z], B = c.convert(D);
23298
- B && (this.config.convertByEntityType && D.type !== O && (A.appendEntity(M), M = [], O = D.type), M.push(B));
23659
+ B && (this.config.convertByEntityType && D.type !== L && (w.appendEntity(M), M = [], L = D.type), M.push(B));
23299
23660
  }
23300
- if (A.appendEntity(M), h) {
23661
+ if (w.appendEntity(M), h) {
23301
23662
  let z = o.value + E / x * (100 - o.value);
23302
23663
  z > 100 && (z = 100), await h(z, "ENTITY", "IN-PROGRESS");
23303
23664
  }
@@ -23343,7 +23704,7 @@ class Xd extends Zo {
23343
23704
  const s = t.blocks;
23344
23705
  for (const [o, h] of Object.entries(s)) {
23345
23706
  let c = e.tables.blockTable.getAt(h.name);
23346
- c || (c = new He(), c.objectId = h.handle, c.name = o, c.origin.copy(h.position), e.tables.blockTable.add(c)), h.entities && this.processEntitiesInBlock(h.entities, c);
23707
+ c || (c = new Ge(), c.objectId = h.handle, c.name = o, c.origin.copy(h.position), e.tables.blockTable.add(c)), h.entities && this.processEntitiesInBlock(h.entities, c);
23347
23708
  }
23348
23709
  }
23349
23710
  /**
@@ -23382,7 +23743,7 @@ class Xd extends Zo {
23382
23743
  var o;
23383
23744
  const s = (o = t.tables.BLOCK_RECORD) == null ? void 0 : o.entries;
23384
23745
  s && s.length > 0 && (e.tables.blockTable.removeAll(), s.forEach((h) => {
23385
- const c = new He();
23746
+ const c = new Ge();
23386
23747
  c.objectId = h.handle, c.name = h.name, c.layoutId = h.layoutObjects, e.tables.blockTable.add(c);
23387
23748
  }));
23388
23749
  }
@@ -23699,15 +24060,15 @@ class Kd extends Zo {
23699
24060
  );
23700
24061
  this.config.convertByEntityType && (c = this.groupAndFlattenByType(c));
23701
24062
  const f = e.tables.blockTable.modelSpace;
23702
- await x.processChunk(async (A, b) => {
23703
- let E = [], M = A < b ? c[A].type : "";
23704
- for (let O = A; O < b; O++) {
23705
- const z = c[O];
24063
+ await x.processChunk(async (w, b) => {
24064
+ let E = [], M = w < b ? c[w].type : "";
24065
+ for (let L = w; L < b; L++) {
24066
+ const z = c[L];
23706
24067
  this.config.convertByEntityType && z.type !== M && (this.triggerEvents(f, E), E = [], M = z.type), E.push(z);
23707
24068
  }
23708
24069
  if (this.triggerEvents(f, E), h) {
23709
- let O = o.value + b / g * (100 - o.value);
23710
- O > 100 && (O = 100), await h(O, "ENTITY", "IN-PROGRESS");
24070
+ let L = o.value + b / g * (100 - o.value);
24071
+ L > 100 && (L = 100), await h(L, "ENTITY", "IN-PROGRESS");
23711
24072
  }
23712
24073
  });
23713
24074
  }
@@ -23918,229 +24279,6 @@ class kr {
23918
24279
  }));
23919
24280
  }
23920
24281
  }
23921
- class Fn extends pn {
23922
- /**
23923
- * Creates a new AcDbSymbolTableRecord instance.
23924
- *
23925
- * @param attrs - Input attribute values for this symbol table record
23926
- * @param defaultAttrs - Default values for attributes of this symbol table record
23927
- *
23928
- * @example
23929
- * ```typescript
23930
- * const record = new AcDbSymbolTableRecord({ name: 'MyRecord' });
23931
- * ```
23932
- */
23933
- constructor(t, e) {
23934
- t = t || {}, ks(t, { name: "" }), super(t, e);
23935
- }
23936
- /**
23937
- * Gets or sets the name of the symbol table record.
23938
- *
23939
- * This property corresponds to DXF group code 2 and is used for
23940
- * identifying and referencing the symbol table record.
23941
- *
23942
- * @returns The name of the symbol table record
23943
- *
23944
- * @example
23945
- * ```typescript
23946
- * const recordName = record.name;
23947
- * record.name = 'NewRecordName';
23948
- * ```
23949
- */
23950
- get name() {
23951
- return this.getAttr("name");
23952
- }
23953
- set name(t) {
23954
- this.setAttr("name", t);
23955
- }
23956
- }
23957
- const jr = class jr extends Fn {
23958
- /**
23959
- * Returns true if the specified name is the name of the model space block table record.
23960
- *
23961
- * Model space is the primary drawing area where most entities are created.
23962
- *
23963
- * @param name - The name of one block table record.
23964
- * @returns True if the specified name is the name of the model space block table record.
23965
- *
23966
- * @example
23967
- * ```typescript
23968
- * if (AcDbBlockTableRecord.isModelSapceName('*Model_Space')) {
23969
- * console.log('This is the name of the model space block table record.');
23970
- * }
23971
- * ```
23972
- */
23973
- static isModelSapceName(t) {
23974
- return t.toLowerCase() == jr.MODEL_SPACE_NAME.toLowerCase();
23975
- }
23976
- /**
23977
- * Returns true if the specified name is the name of a paper space block table record.
23978
- *
23979
- * Paper space is used for creating layouts for printing and plotting.
23980
- *
23981
- * @param name - The name of one block table record.
23982
- * @returns True if the specified name is the name of a paper space block table record.
23983
- *
23984
- * @example
23985
- * ```typescript
23986
- * if (AcDbBlockTableRecord.isPaperSapceName('*Paper_Space1')) {
23987
- * console.log('This is the name of the paper space block table record.');
23988
- * }
23989
- * ```
23990
- */
23991
- static isPaperSapceName(t) {
23992
- return t.toLowerCase().startsWith(jr.PAPER_SPACE_NAME_PREFIX.toLowerCase());
23993
- }
23994
- /**
23995
- * Creates a new AcDbBlockTableRecord instance.
23996
- *
23997
- * @example
23998
- * ```typescript
23999
- * const blockRecord = new AcDbBlockTableRecord();
24000
- * ```
24001
- */
24002
- constructor() {
24003
- super(), this._origin = new Y(), this._layoutId = "", this._entities = /* @__PURE__ */ new Map();
24004
- }
24005
- /**
24006
- * Returns true if this is a model space block table record.
24007
- *
24008
- * Model space is the primary drawing area where most entities are created.
24009
- *
24010
- * @returns True if this is a model space block table record
24011
- *
24012
- * @example
24013
- * ```typescript
24014
- * if (blockRecord.isModelSapce) {
24015
- * console.log('This is model space');
24016
- * }
24017
- * ```
24018
- */
24019
- get isModelSapce() {
24020
- return jr.isModelSapceName(this.name);
24021
- }
24022
- /**
24023
- * Returns true if this is a paper space block table record.
24024
- *
24025
- * Paper space is used for creating layouts for printing and plotting.
24026
- *
24027
- * @returns True if this is a paper space block table record
24028
- *
24029
- * @example
24030
- * ```typescript
24031
- * if (blockRecord.isPaperSapce) {
24032
- * console.log('This is paper space');
24033
- * }
24034
- * ```
24035
- */
24036
- get isPaperSapce() {
24037
- return jr.isPaperSapceName(this.name);
24038
- }
24039
- /**
24040
- * Gets or sets the base point of the block in WCS coordinates.
24041
- *
24042
- * This point is the origin of the MCS (Model Coordinate System), which is the
24043
- * local WCS for the entities within the block table record.
24044
- *
24045
- * @returns The origin point of the block
24046
- *
24047
- * @example
24048
- * ```typescript
24049
- * const origin = blockRecord.origin;
24050
- * blockRecord.origin = new AcGePoint3d(10, 20, 0);
24051
- * ```
24052
- */
24053
- get origin() {
24054
- return this._origin;
24055
- }
24056
- set origin(t) {
24057
- this._origin.copy(t);
24058
- }
24059
- /**
24060
- * Gets or sets the object ID of the associated AcDbLayout object in the Layouts dictionary.
24061
- *
24062
- * This property links the block table record to its corresponding layout object,
24063
- * which defines the viewport configuration and display settings for the block.
24064
- * For model space blocks, this is typically empty, while paper space blocks
24065
- * have a corresponding layout ID.
24066
- *
24067
- * @returns The object ID of the associated layout
24068
- *
24069
- * @example
24070
- * ```typescript
24071
- * const layoutId = blockRecord.layoutId;
24072
- * blockRecord.layoutId = 'some-layout-object-id';
24073
- * ```
24074
- */
24075
- get layoutId() {
24076
- return this._layoutId;
24077
- }
24078
- set layoutId(t) {
24079
- this._layoutId = t;
24080
- }
24081
- /**
24082
- * Appends the specified entity or entities to this block table record.
24083
- *
24084
- * This method adds an entity to the block and sets up the necessary
24085
- * relationships between the entity and the block table record.
24086
- *
24087
- * @param entity - The entity or entities to append to this block table record
24088
- *
24089
- * @example
24090
- * ```typescript
24091
- * const line = new AcDbLine();
24092
- * blockRecord.appendEntity(line);
24093
- * ```
24094
- */
24095
- appendEntity(t) {
24096
- if (Array.isArray(t))
24097
- for (let e = 0; e < t.length; ++e) {
24098
- const s = t[e];
24099
- s.database = this.database, s.ownerId = this.objectId, this._entities.set(s.objectId, s);
24100
- }
24101
- else
24102
- t.database = this.database, t.ownerId = this.objectId, this._entities.set(t.objectId, t);
24103
- (this.isModelSapce || this.isPaperSapce) && this.database.events.entityAppended.dispatch({
24104
- database: this.database,
24105
- entity: t
24106
- });
24107
- }
24108
- /**
24109
- * Creates an iterator object that can be used to iterate over the entities in the block table record.
24110
- *
24111
- * @returns An iterator object that can be used to iterate over the entities
24112
- *
24113
- * @example
24114
- * ```typescript
24115
- * const iterator = blockRecord.newIterator();
24116
- * for (const entity of iterator) {
24117
- * console.log('Entity:', entity.type);
24118
- * }
24119
- * ```
24120
- */
24121
- newIterator() {
24122
- return new ua(this._entities);
24123
- }
24124
- /**
24125
- * Searches for an entity in this block table record with the specified ID.
24126
- *
24127
- * @param id - The entity ID to search for
24128
- * @returns The entity with the specified ID, or undefined if not found
24129
- *
24130
- * @example
24131
- * ```typescript
24132
- * const entity = blockRecord.getIdAt('some-entity-id');
24133
- * if (entity) {
24134
- * console.log('Found entity:', entity.type);
24135
- * }
24136
- * ```
24137
- */
24138
- getIdAt(t) {
24139
- return this._entities.get(t);
24140
- }
24141
- };
24142
- jr.MODEL_SPACE_NAME = "*MODEL_SPACE", jr.PAPER_SPACE_NAME_PREFIX = "*PAPER_SPACE";
24143
- let He = jr;
24144
24282
  class Bn extends pn {
24145
24283
  /**
24146
24284
  * Creates a new AcDbSymbolTable instance.
@@ -24375,8 +24513,8 @@ class $d extends Bn {
24375
24513
  * ```
24376
24514
  */
24377
24515
  get modelSpace() {
24378
- let t = this.getAt(He.MODEL_SPACE_NAME);
24379
- return t || (t = new He(), t.name = He.MODEL_SPACE_NAME, this.add(t)), t;
24516
+ let t = this.getAt(Ge.MODEL_SPACE_NAME);
24517
+ return t || (t = new Ge(), t.name = Ge.MODEL_SPACE_NAME, this.add(t)), t;
24380
24518
  }
24381
24519
  /**
24382
24520
  * Normalizes the specified block table record name if it is one paper spacce or model space
@@ -24388,10 +24526,10 @@ class $d extends Bn {
24388
24526
  */
24389
24527
  normalizeName(t) {
24390
24528
  let e = t;
24391
- if (He.isModelSapceName(t))
24392
- e = He.MODEL_SPACE_NAME;
24393
- else if (He.isPaperSapceName(t)) {
24394
- const s = He.PAPER_SPACE_NAME_PREFIX, o = t.substring(s.length);
24529
+ if (Ge.isModelSapceName(t))
24530
+ e = Ge.MODEL_SPACE_NAME;
24531
+ else if (Ge.isPaperSapceName(t)) {
24532
+ const s = Ge.PAPER_SPACE_NAME_PREFIX, o = t.substring(s.length);
24395
24533
  e = s + o;
24396
24534
  }
24397
24535
  return e;
@@ -26417,8 +26555,8 @@ class E0 extends pn {
26417
26555
  throw new Error("Failed to get response reader");
26418
26556
  const x = [];
26419
26557
  for (; ; ) {
26420
- const { done: O, value: z } = await g.read();
26421
- if (O)
26558
+ const { done: L, value: z } = await g.read();
26559
+ if (L)
26422
26560
  break;
26423
26561
  if (x.push(z), c += z.length, h !== null) {
26424
26562
  const D = Math.round(c / h * 100);
@@ -26431,9 +26569,9 @@ class E0 extends pn {
26431
26569
  }
26432
26570
  }
26433
26571
  const f = new Uint8Array(c);
26434
- let A = 0;
26435
- for (const O of x)
26436
- f.set(O, A), A += O.length;
26572
+ let w = 0;
26573
+ for (const L of x)
26574
+ f.set(L, w), w += L.length;
26437
26575
  this.getFileNameFromUri(t).toLowerCase().split(".").pop() === "dwg" ? await this.read(f.buffer, e, Zs.DWG) : await this.read(f.buffer, e, Zs.DXF), this.events.openProgress.dispatch({
26438
26576
  database: this,
26439
26577
  percentage: 100,
@@ -26959,7 +27097,7 @@ class h0 {
26959
27097
  createLayout(t, e) {
26960
27098
  const s = this.getWorkingDatabase(e), o = new ba();
26961
27099
  o.layoutName = t, o.tabOrder = s.dictionaries.layouts.maxTabOrder;
26962
- const h = new He();
27100
+ const h = new Ge();
26963
27101
  return h.name = `*Paper_Space${o.tabOrder}`, s.tables.blockTable.add(h), s.dictionaries.layouts.setAt(t, o), this.events.layoutCreated.dispatch({
26964
27102
  layout: o
26965
27103
  }), { layout: o, btr: h };
@@ -27083,7 +27221,7 @@ export {
27083
27221
  Yo as AcDbBatchProcessing,
27084
27222
  ti as AcDbBlockReference,
27085
27223
  $d as AcDbBlockTable,
27086
- He as AcDbBlockTableRecord,
27224
+ Ge as AcDbBlockTableRecord,
27087
27225
  Gi as AcDbCircle,
27088
27226
  Xo as AcDbCodePage,
27089
27227
  ke as AcDbCurve,