@mlightcad/data-model 1.7.5 → 1.7.6

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.
@@ -15,7 +15,7 @@ function bu(n, t) {
15
15
  }
16
16
  return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { value: "Module" }));
17
17
  }
18
- var ct = /* @__PURE__ */ ((n) => (n[n.ByColor = 1] = "ByColor", n[n.ByACI = 2] = "ByACI", n[n.ByLayer = 3] = "ByLayer", n[n.ByBlock = 4] = "ByBlock", n[n.None = 0] = "None", n))(ct || {});
18
+ var ht = /* @__PURE__ */ ((n) => (n[n.ByColor = 1] = "ByColor", n[n.ByACI = 2] = "ByACI", n[n.ByLayer = 3] = "ByLayer", n[n.ByBlock = 4] = "ByBlock", n[n.None = 0] = "None", n))(ht || {});
19
19
  const zo = {
20
20
  aliceblue: 15792383,
21
21
  antiquewhite: 16444375,
@@ -505,8 +505,8 @@ let hn = class {
505
505
  * @param method Initial color method (defaults to `ByColor`)
506
506
  * @param value Internal packed value
507
507
  */
508
- constructor(t = ct.ByLayer, e) {
509
- this._colorMethod = t, this._colorMethod == ct.ByColor && e == null ? this._value = 16777215 : this._colorMethod == ct.ByACI ? e == null ? this._value = 8 : e === 0 ? this._colorMethod = ct.ByBlock : e === 256 ? this._colorMethod = ct.ByLayer : this._value = Math.max(0, Math.min(e, 256)) : this._value = e;
508
+ constructor(t = ht.ByLayer, e) {
509
+ this._colorMethod = t, this._colorMethod == ht.ByColor && e == null ? this._value = 16777215 : this._colorMethod == ht.ByACI ? e == null ? this._value = 8 : e === 0 ? this._colorMethod = ht.ByBlock : e === 256 ? this._colorMethod = ht.ByLayer : this._value = Math.max(0, Math.min(e, 256)) : this._value = e;
510
510
  }
511
511
  // ---------------------------------------------------------------------
512
512
  // Color method
@@ -550,11 +550,11 @@ let hn = class {
550
550
  */
551
551
  get RGB() {
552
552
  switch (this._colorMethod) {
553
- case ct.ByColor:
554
- case ct.ByBlock:
555
- case ct.ByLayer:
553
+ case ht.ByColor:
554
+ case ht.ByBlock:
555
+ case ht.ByLayer:
556
556
  return this._value;
557
- case ct.ByACI:
557
+ case ht.ByACI:
558
558
  return this._value ? hn.getColorByIndex(this._value) : this._value;
559
559
  default:
560
560
  return;
@@ -570,7 +570,7 @@ let hn = class {
570
570
  */
571
571
  setRGB(t, e, s) {
572
572
  const a = Math.max(0, Math.min(255, Math.round(t))), h = Math.max(0, Math.min(255, Math.round(e))), u = Math.max(0, Math.min(255, Math.round(s)));
573
- return this._value = a << 16 | h << 8 | u, this._colorMethod = ct.ByColor, this;
573
+ return this._value = a << 16 | h << 8 | u, this._colorMethod = ht.ByColor, this;
574
574
  }
575
575
  /**
576
576
  * Sets the RGB color by a single packed number (0xRRGGBB).
@@ -578,7 +578,7 @@ let hn = class {
578
578
  * @param value Packed RGB number
579
579
  */
580
580
  setRGBValue(t) {
581
- return t == null || !Number.isFinite(t) ? (console.warn("Invalid RGB value:", t), this) : (this._value = t & 16777215, this._colorMethod = ct.ByColor, this);
581
+ return t == null || !Number.isFinite(t) ? (console.warn("Invalid RGB value:", t), this) : (this._value = t & 16777215, this._colorMethod = ht.ByColor, this);
582
582
  }
583
583
  /**
584
584
  * Sets the RGB color from a CSS color string.
@@ -643,7 +643,7 @@ let hn = class {
643
643
  // ---------------------------------------------------------------------
644
644
  /** Gets the AutoCAD Color Index (ACI), or undefined if not ByACI, ByBlock, or ByLayer. */
645
645
  get colorIndex() {
646
- return this._colorMethod === ct.ByACI ? this._value : this._colorMethod === ct.ByLayer ? 256 : this._colorMethod === ct.ByBlock ? 0 : void 0;
646
+ return this._colorMethod === ht.ByACI ? this._value : this._colorMethod === ht.ByLayer ? 256 : this._colorMethod === ht.ByBlock ? 0 : void 0;
647
647
  }
648
648
  /**
649
649
  * Sets the AutoCAD Color Index (0–256).
@@ -657,44 +657,63 @@ let hn = class {
657
657
  set colorIndex(t) {
658
658
  if (t == null) return;
659
659
  const e = Math.max(0, Math.min(256, Math.round(t)));
660
- e === 0 ? (this._colorMethod = ct.ByBlock, this._value = void 0) : e === 256 ? (this._colorMethod = ct.ByLayer, this._value = void 0) : (this._colorMethod = ct.ByACI, this._value = e);
660
+ e === 0 ? (this._colorMethod = ht.ByBlock, this._value = void 0) : e === 256 ? (this._colorMethod = ht.ByLayer, this._value = void 0) : (this._colorMethod = ht.ByACI, this._value = e);
661
661
  }
662
662
  /**
663
663
  * Returns true if the color method is ByColor (explicit RGB).
664
664
  */
665
665
  get isByColor() {
666
- return this._colorMethod === ct.ByColor;
666
+ return this._colorMethod === ht.ByColor;
667
667
  }
668
668
  /**
669
669
  * Returns true if the color method is ByACI.
670
670
  */
671
671
  get isByACI() {
672
- return this._colorMethod === ct.ByACI;
672
+ return this._colorMethod === ht.ByACI;
673
+ }
674
+ /**
675
+ * Returns true if the color method is ByACI and ACI value is 7
676
+ *
677
+ * Notes:
678
+ * In AutoCAD, ACI Color 7 (Color Index 7) is officially named "Black" or "White" depending on
679
+ * the context, but it is functionally defined as the "Contrasting Color" or "Auto-Contrast Color."
680
+ * Here is the technical explanation of its behavior:
681
+ * - If the background is dark: Color 7 displays as White.
682
+ * - If the background is light: Color 7 displays as Black.
683
+ */
684
+ get isForeground() {
685
+ return this._colorMethod === ht.ByACI && this._value === 7;
686
+ }
687
+ /**
688
+ * Sets the color to ACI value 7.
689
+ */
690
+ setForeground() {
691
+ return this._colorMethod = ht.ByACI, this._value = 7, this;
673
692
  }
674
693
  // ---------------------------------------------------------------------
675
694
  // Layer / Block helpers
676
695
  // ---------------------------------------------------------------------
677
696
  /** Returns true if the color method is ByLayer. */
678
697
  get isByLayer() {
679
- return this._colorMethod === ct.ByLayer;
698
+ return this._colorMethod === ht.ByLayer;
680
699
  }
681
700
  /**
682
701
  * Sets the color to ByLayer.
683
702
  * @param value - Option layer color value
684
703
  */
685
704
  setByLayer(t) {
686
- return this._colorMethod = ct.ByLayer, t == null ? this._value = 256 : this._value = t, this;
705
+ return this._colorMethod = ht.ByLayer, t == null ? this._value = 256 : this._value = t, this;
687
706
  }
688
707
  /** Returns true if the color method is ByBlock. */
689
708
  get isByBlock() {
690
- return this._colorMethod === ct.ByBlock;
709
+ return this._colorMethod === ht.ByBlock;
691
710
  }
692
711
  /**
693
712
  * Sets the color to ByBlock.
694
713
  * @param value - Option layer color value
695
714
  */
696
715
  setByBlock(t) {
697
- return this._colorMethod = ct.ByBlock, t == null ? this._value = 0 : this._value = t, this;
716
+ return this._colorMethod = ht.ByBlock, t == null ? this._value = 0 : this._value = t, this;
698
717
  }
699
718
  // ---------------------------------------------------------------------
700
719
  // Color name (dynamic)
@@ -707,13 +726,13 @@ let hn = class {
707
726
  */
708
727
  get colorName() {
709
728
  switch (this._colorMethod) {
710
- case ct.ByLayer:
729
+ case ht.ByLayer:
711
730
  return "ByLayer";
712
- case ct.ByBlock:
731
+ case ht.ByBlock:
713
732
  return "ByBlock";
714
- case ct.ByColor:
733
+ case ht.ByColor:
715
734
  return this._value ? hn.getNameByColor(this._value) : "";
716
- case ct.ByACI:
735
+ case ht.ByACI:
717
736
  return this._value ? hn.getNameByIndex(this._value) : "";
718
737
  default:
719
738
  return;
@@ -729,7 +748,7 @@ let hn = class {
729
748
  set colorName(t) {
730
749
  if (!t) return;
731
750
  const e = hn.getColorByName(t);
732
- e !== void 0 ? (this._value = e, this._colorMethod = ct.ByColor) : console.warn("Unknown color name:", t);
751
+ e !== void 0 ? (this._value = e, this._colorMethod = ht.ByColor) : console.warn("Unknown color name:", t);
733
752
  }
734
753
  // ---------------------------------------------------------------------
735
754
  // Clone / Copy / Equals
@@ -774,13 +793,13 @@ let hn = class {
774
793
  */
775
794
  toString() {
776
795
  switch (this._colorMethod) {
777
- case ct.ByLayer:
796
+ case ht.ByLayer:
778
797
  return "ByLayer";
779
- case ct.ByBlock:
798
+ case ht.ByBlock:
780
799
  return "ByBlock";
781
- case ct.ByACI:
800
+ case ht.ByACI:
782
801
  return this._value !== void 0 ? String(this._value) : "";
783
- case ct.ByColor:
802
+ case ht.ByColor:
784
803
  return this._value ? `${this.red},${this.green},${this.blue}` : "";
785
804
  default:
786
805
  return "";
@@ -793,34 +812,34 @@ let hn = class {
793
812
  if (!t) return;
794
813
  const e = t.trim();
795
814
  if (/^bylayer$/i.test(e))
796
- return new Rr(ct.ByLayer);
815
+ return new Rr(ht.ByLayer);
797
816
  if (/^byblock$/i.test(e))
798
- return new Rr(ct.ByBlock);
817
+ return new Rr(ht.ByBlock);
799
818
  const s = e.match(
800
819
  /^rgb\s*:\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})$/i
801
820
  );
802
821
  if (s) {
803
- const h = Number(s[1]), u = Number(s[2]), m = Number(s[3]), b = new Rr(ct.ByColor);
822
+ const h = Number(s[1]), u = Number(s[2]), m = Number(s[3]), b = new Rr(ht.ByColor);
804
823
  return b.setRGB(h, u, m), b;
805
824
  }
806
825
  if (/^\d{1,3},\d{1,3},\d{1,3}$/.test(e)) {
807
- const [h, u, m] = e.split(",").map(Number), b = new Rr(ct.ByColor);
826
+ const [h, u, m] = e.split(",").map(Number), b = new Rr(ht.ByColor);
808
827
  return b.setRGB(h, u, m), b;
809
828
  }
810
829
  if (/^\d+$/.test(e)) {
811
830
  const h = parseInt(e, 10);
812
- return new Rr(ct.ByACI, h);
831
+ return new Rr(ht.ByACI, h);
813
832
  }
814
833
  if (/^book\$/i.test(e)) {
815
834
  const h = e.substring(e.indexOf("$") + 1), u = hn.getColorByName(h);
816
835
  if (u != null)
817
- return new Rr(ct.ByColor, u);
836
+ return new Rr(ht.ByColor, u);
818
837
  console.warn("Unknown color book entry:", t);
819
838
  return;
820
839
  }
821
840
  const a = hn.getColorByName(e);
822
841
  if (a != null)
823
- return new Rr(ct.ByColor, a);
842
+ return new Rr(ht.ByColor, a);
824
843
  console.warn("Unknown color name:", t);
825
844
  }
826
845
  };
@@ -831,7 +850,7 @@ class W0 {
831
850
  * @param method Initial color method (defaults to `ByColor`)
832
851
  * @param value Internal packed value (defaults to `0`)
833
852
  */
834
- constructor(t = ct.ByColor, e = 0) {
853
+ constructor(t = ht.ByColor, e = 0) {
835
854
  this._colorMethod = t, this._value = e;
836
855
  }
837
856
  /**
@@ -853,7 +872,7 @@ class W0 {
853
872
  * Sets the red component and updates the packed RGB value.
854
873
  */
855
874
  set red(t) {
856
- this._colorMethod = ct.ByColor, this._value = this._value & 65535 | (t & 255) << 16;
875
+ this._colorMethod = ht.ByColor, this._value = this._value & 65535 | (t & 255) << 16;
857
876
  }
858
877
  /**
859
878
  * Gets the green component (0–255). Only valid when colorMethod = ByColor.
@@ -865,7 +884,7 @@ class W0 {
865
884
  * Sets the green component and updates the packed RGB value.
866
885
  */
867
886
  set green(t) {
868
- this._colorMethod = ct.ByColor, this._value = this._value & 16711935 | (t & 255) << 8;
887
+ this._colorMethod = ht.ByColor, this._value = this._value & 16711935 | (t & 255) << 8;
869
888
  }
870
889
  /**
871
890
  * Gets the blue component (0–255). Only valid when colorMethod = ByColor.
@@ -877,7 +896,7 @@ class W0 {
877
896
  * Sets the blue component and updates the packed RGB value.
878
897
  */
879
898
  set blue(t) {
880
- this._colorMethod = ct.ByColor, this._value = this._value & 16776960 | t & 255;
899
+ this._colorMethod = ht.ByColor, this._value = this._value & 16776960 | t & 255;
881
900
  }
882
901
  /**
883
902
  * Sets all RGB components.
@@ -887,7 +906,7 @@ class W0 {
887
906
  * @param b Blue (0–255)
888
907
  */
889
908
  setRGB(t, e, s) {
890
- this._colorMethod = ct.ByColor, this._value = (t & 255) << 16 | (e & 255) << 8 | s & 255;
909
+ this._colorMethod = ht.ByColor, this._value = (t & 255) << 16 | (e & 255) << 8 | s & 255;
891
910
  }
892
911
  // ---------------------------------------------------------------------
893
912
  // ACI accessors
@@ -902,7 +921,7 @@ class W0 {
902
921
  * Sets the AutoCAD Color Index (ACI).
903
922
  */
904
923
  set colorIndex(t) {
905
- this._colorMethod = ct.ByACI, this._value = t;
924
+ this._colorMethod = ht.ByACI, this._value = t;
906
925
  }
907
926
  // ---------------------------------------------------------------------
908
927
  // Layer index accessors
@@ -917,7 +936,7 @@ class W0 {
917
936
  * Sets the layer index for ByLayer color mode.
918
937
  */
919
938
  set layerIndex(t) {
920
- this._colorMethod = ct.ByLayer, this._value = t;
939
+ this._colorMethod = ht.ByLayer, this._value = t;
921
940
  }
922
941
  // ---------------------------------------------------------------------
923
942
  // Utility methods
@@ -926,31 +945,31 @@ class W0 {
926
945
  * Returns true if the color method is ByColor (explicit RGB).
927
946
  */
928
947
  isByColor() {
929
- return this._colorMethod === ct.ByColor;
948
+ return this._colorMethod === ht.ByColor;
930
949
  }
931
950
  /**
932
951
  * Returns true if the color method is ByLayer.
933
952
  */
934
953
  isByLayer() {
935
- return this._colorMethod === ct.ByLayer;
954
+ return this._colorMethod === ht.ByLayer;
936
955
  }
937
956
  /**
938
957
  * Returns true if the color method is ByBlock.
939
958
  */
940
959
  isByBlock() {
941
- return this._colorMethod === ct.ByBlock;
960
+ return this._colorMethod === ht.ByBlock;
942
961
  }
943
962
  /**
944
963
  * Returns true if the color method is ByACI.
945
964
  */
946
965
  isByACI() {
947
- return this._colorMethod === ct.ByACI;
966
+ return this._colorMethod === ht.ByACI;
948
967
  }
949
968
  /**
950
969
  * Returns true if color is uninitialized or invalid.
951
970
  */
952
971
  isNone() {
953
- return this._colorMethod === ct.None;
972
+ return this._colorMethod === ht.None;
954
973
  }
955
974
  /**
956
975
  * Gets the packed internal value.
@@ -8466,8 +8485,8 @@ var Bl = { exports: {} };
8466
8485
  break;
8467
8486
  case Fe:
8468
8487
  for (var G = r, $ = 0, tt = G.length - 2, et = new ft(), ot = $t.BASE64; $ < tt; ) {
8469
- var ut = G.get($++), lt = G.get($++), pt = G.get($++);
8470
- et.add(ot.charAt(ut >> 2)), et.add(ot.charAt((ut << 4 | lt >> 4) & 63)), et.add(ot.charAt((lt << 2 | pt >> 6) & 63)), et.add(ot.charAt(pt & 63));
8488
+ var ct = G.get($++), lt = G.get($++), pt = G.get($++);
8489
+ et.add(ot.charAt(ct >> 2)), et.add(ot.charAt((ct << 4 | lt >> 4) & 63)), et.add(ot.charAt((lt << 2 | pt >> 6) & 63)), et.add(ot.charAt(pt & 63));
8471
8490
  }
8472
8491
  if ($ == tt) {
8473
8492
  var nt = G.get($++), mt = G.get($++);
@@ -8686,8 +8705,8 @@ var Bl = { exports: {} };
8686
8705
  case 118:
8687
8706
  var ot;
8688
8707
  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) {
8689
- var ut = L.substr(this.buf, this.pos, 19);
8690
- ot = L.strDate(ut), this.pos += 19;
8708
+ var ct = L.substr(this.buf, this.pos, 19);
8709
+ ot = L.strDate(ct), this.pos += 19;
8691
8710
  } else {
8692
8711
  var lt = this.readFloat(), pt = /* @__PURE__ */ new Date();
8693
8712
  pt.setTime(lt), ot = pt;
@@ -10508,7 +10527,7 @@ var Bl = { exports: {} };
10508
10527
  return p.add(an, Xt);
10509
10528
  }; l < o; ) {
10510
10529
  c = J(k), f = p.sub(c[0][0], i);
10511
- var G = p.norm(f), $ = p.dot(c[1][0], f), tt = p.norm(c[1][0]) * G, et = p.dot(c[0][1], f), ot = p.norm(c[0][1]) * G, ut = $ / tt, lt = et / ot, pt = G < d, nt = ut < g, mt = lt < g;
10530
+ var G = p.norm(f), $ = p.dot(c[1][0], f), tt = p.norm(c[1][0]) * G, et = p.dot(c[0][1], f), ot = p.norm(c[0][1]) * G, ct = $ / tt, lt = et / ot, pt = G < d, nt = ct < g, mt = lt < g;
10512
10531
  if (pt && nt && mt) return k;
10513
10532
  var D = X(k, c, f);
10514
10533
  D[0] < y ? A ? D = [S - (D[0] - y), D[1]] : D = [y + rt.EPSILON, D[1]] : D[0] > S && (A ? D = [y + (D[0] - S), D[1]] : D = [S - rt.EPSILON, D[1]]), D[1] < P ? T ? D = [D[0], I - (D[1] - P)] : D = [D[0], P + rt.EPSILON] : D[1] > I && (T ? D = [D[0], P + (D[0] - I)] : D = [D[0], I - rt.EPSILON]);
@@ -10531,7 +10550,7 @@ var Bl = { exports: {} };
10531
10550
  return D - Xt / Qt;
10532
10551
  }; B < k; ) {
10533
10552
  C = G(X), U = p.sub(C[0], i);
10534
- var tt = p.norm(U), et = p.dot(C[1], U), ot = p.norm(C[1]) * tt, ut = et / ot, lt = tt < R, pt = Math.abs(ut) < z;
10553
+ var tt = p.norm(U), et = p.dot(C[1], U), ot = p.norm(C[1]) * tt, ct = et / ot, lt = tt < R, pt = Math.abs(ct) < z;
10535
10554
  if (lt && pt) return X;
10536
10555
  var nt = $(X, C, U);
10537
10556
  nt < j ? J ? nt = Y - (nt - j) : nt = j : nt > Y && (J ? nt = j + (nt - Y) : nt = Y);
@@ -10732,8 +10751,8 @@ var Bl = { exports: {} };
10732
10751
  var tt = G++;
10733
10752
  U[tt] = p.zeros1d(I);
10734
10753
  for (var et = 0, ot = g + 1; et < ot; ) {
10735
- var ut = et++;
10736
- p.addMulMutate(U[tt], R[X][ut], y[B - g + ut][C - f + tt]);
10754
+ var ct = et++;
10755
+ p.addMulMutate(U[tt], R[X][ct], y[B - g + ct][C - f + tt]);
10737
10756
  }
10738
10757
  }
10739
10758
  var lt = d - X;
@@ -10785,7 +10804,7 @@ var Bl = { exports: {} };
10785
10804
  var et = $++;
10786
10805
  p.subMulMutate(G, Ft.get(X, et) * C[0][et], R[j][X - et]);
10787
10806
  }
10788
- for (var ot = 1, ut = j + 1; ot < ut; ) {
10807
+ for (var ot = 1, ct = j + 1; ot < ct; ) {
10789
10808
  var lt = ot++;
10790
10809
  p.subMulMutate(G, Ft.get(j, lt) * C[lt][0], R[j - lt][X]);
10791
10810
  for (var pt = p.zeros1d(z), nt = 1, mt = X + 1; nt < mt; ) {
@@ -10869,7 +10888,7 @@ var Bl = { exports: {} };
10869
10888
  for (var $ = 0, tt = k + 1; $ < tt; ) {
10870
10889
  var et = $++;
10871
10890
  A[R][et] = p.zeros1d(S);
10872
- for (var ot = 0, ut = i + 1; ot < ut; ) {
10891
+ for (var ot = 0, ct = i + 1; ot < ct; ) {
10873
10892
  var lt = ot++;
10874
10893
  p.addMulMutate(A[R][et], g[et][lt], T[lt]);
10875
10894
  }
@@ -10912,8 +10931,8 @@ var Bl = { exports: {} };
10912
10931
  for (var f = r.controlPoints, y = r.degreeU, S = r.degreeV, P = r.degreeW, I = r.knotsU, A = r.knotsV, T = r.knotsW, k = f[0][0][0].length, B = N.knotSpanGivenN(i, y, c, I), C = N.knotSpanGivenN(o, S, d, A), R = N.knotSpanGivenN(l, P, g, T), z = N.basisFunctionsGivenKnotSpanIndex(B, c, y, I), U = N.basisFunctionsGivenKnotSpanIndex(C, d, S, A), j = N.basisFunctionsGivenKnotSpanIndex(R, g, P, T), Y = B - y, J = p.zeros1d(k), X = p.zeros1d(k), G = p.zeros1d(k), $ = 0, tt = P + 1; $ < tt; ) {
10913
10932
  var et = $++;
10914
10933
  G = p.zeros1d(k);
10915
- for (var ot = R - P + et, ut = 0, lt = S + 1; ut < lt; ) {
10916
- var pt = ut++;
10934
+ for (var ot = R - P + et, ct = 0, lt = S + 1; ct < lt; ) {
10935
+ var pt = ct++;
10917
10936
  X = p.zeros1d(k);
10918
10937
  for (var nt = C - S + pt, mt = 0, D = y + 1; mt < D; ) {
10919
10938
  var _t = mt++;
@@ -10944,16 +10963,16 @@ var Bl = { exports: {} };
10944
10963
  B[0][tt] = d[tt][o];
10945
10964
  }
10946
10965
  for (var et = 0, ot = o + 1; et < ot; ) {
10947
- var ut = et++;
10966
+ var ct = et++;
10948
10967
  R = 0, z = 1, C[0][0] = 1;
10949
10968
  for (var lt = 1, pt = l + 1; lt < pt; ) {
10950
10969
  var nt = lt++;
10951
- U = 0, j = ut - nt, Y = o - nt, ut >= nt && (C[z][0] = C[R][0] / d[Y + 1][j], U = C[z][0] * d[j][Y]), j >= -1 ? J = 1 : J = -j, ut - 1 <= Y ? X = nt - 1 : X = o - ut;
10970
+ U = 0, j = ct - nt, Y = o - nt, ct >= nt && (C[z][0] = C[R][0] / d[Y + 1][j], U = C[z][0] * d[j][Y]), j >= -1 ? J = 1 : J = -j, ct - 1 <= Y ? X = nt - 1 : X = o - ct;
10952
10971
  for (var mt = J, D = X + 1; mt < D; ) {
10953
10972
  var _t = mt++;
10954
10973
  C[z][_t] = (C[R][_t] - C[R][_t - 1]) / d[Y + 1][j + _t], U += C[z][_t] * d[j + _t][Y];
10955
10974
  }
10956
- ut <= Y && (C[z][nt] = -C[R][nt - 1] / d[Y + 1][ut], U += C[z][nt] * d[ut][Y]), B[nt][ut] = U;
10975
+ ct <= Y && (C[z][nt] = -C[R][nt - 1] / d[Y + 1][ct], U += C[z][nt] * d[ct][Y]), B[nt][ct] = U;
10957
10976
  var At = R;
10958
10977
  R = z, z = At;
10959
10978
  }
@@ -11041,12 +11060,12 @@ var Bl = { exports: {} };
11041
11060
  }
11042
11061
  return l;
11043
11062
  };
11044
- var ht = _.eval.Intersect = function() {
11063
+ var ut = _.eval.Intersect = function() {
11045
11064
  };
11046
- x["verb.eval.Intersect"] = ht, ht.__name__ = ["verb", "eval", "Intersect"], ht.surfaces = function(r, i, o) {
11047
- var l = zt.rationalSurfaceAdaptive(r), c = zt.rationalSurfaceAdaptive(i), d = ht.meshes(l, c), g = d.map(function(f) {
11065
+ x["verb.eval.Intersect"] = ut, ut.__name__ = ["verb", "eval", "Intersect"], ut.surfaces = function(r, i, o) {
11066
+ var l = zt.rationalSurfaceAdaptive(r), c = zt.rationalSurfaceAdaptive(i), d = ut.meshes(l, c), g = d.map(function(f) {
11048
11067
  return f.map(function(y) {
11049
- return ht.surfacesAtPointWithEstimate(r, i, y.uv0, y.uv1, o);
11068
+ return ut.surfacesAtPointWithEstimate(r, i, y.uv0, y.uv1, o);
11050
11069
  });
11051
11070
  });
11052
11071
  return g.map(function(f) {
@@ -11054,20 +11073,20 @@ var Bl = { exports: {} };
11054
11073
  return y.point;
11055
11074
  }), 3);
11056
11075
  });
11057
- }, ht.surfacesAtPointWithEstimate = function(r, i, o, l, c) {
11076
+ }, ut.surfacesAtPointWithEstimate = function(r, i, o, l, c) {
11058
11077
  var d, g, f, y, S, P, I, A, T, k, B, C, R, z = 5, U = 0;
11059
11078
  do {
11060
11079
  if (d = N.rationalSurfaceDerivatives(r, o[0], o[1], 1), g = d[0][0], y = d[1][0], S = d[0][1], f = p.normalized(p.cross(y, S)), P = p.dot(f, g), I = N.rationalSurfaceDerivatives(i, l[0], l[1], 1), A = I[0][0], k = I[1][0], B = I[0][1], T = p.normalized(p.cross(k, B)), C = p.dot(T, A), R = p.distSquared(g, A), R < c * c) break;
11061
- var j = p.normalized(p.cross(f, T)), Y = p.dot(j, g), J = ht.threePlanes(f, P, T, C, j, Y);
11080
+ var j = p.normalized(p.cross(f, T)), Y = p.dot(j, g), J = ut.threePlanes(f, P, T, C, j, Y);
11062
11081
  if (J == null) throw new Q("panic!");
11063
- var X = p.sub(J, g), G = p.sub(J, A), $ = p.cross(y, f), tt = p.cross(S, f), et = p.cross(k, T), ot = p.cross(B, T), ut = p.dot(tt, X) / p.dot(tt, y), lt = p.dot($, X) / p.dot($, S), pt = p.dot(ot, G) / p.dot(ot, k), nt = p.dot(et, G) / p.dot(et, B);
11064
- o = p.add([ut, lt], o), l = p.add([pt, nt], l), U++;
11082
+ var X = p.sub(J, g), G = p.sub(J, A), $ = p.cross(y, f), tt = p.cross(S, f), et = p.cross(k, T), ot = p.cross(B, T), ct = p.dot(tt, X) / p.dot(tt, y), lt = p.dot($, X) / p.dot($, S), pt = p.dot(ot, G) / p.dot(ot, k), nt = p.dot(et, G) / p.dot(et, B);
11083
+ o = p.add([ct, lt], o), l = p.add([pt, nt], l), U++;
11065
11084
  } while (U < z);
11066
11085
  return new Zn(o, l, g, R);
11067
- }, ht.meshes = function(r, i, o, l) {
11086
+ }, ut.meshes = function(r, i, o, l) {
11068
11087
  o == null && (o = new mr(r)), l == null && (l = new mr(i));
11069
- var c = ht.boundingBoxTrees(o, l, 0), d = Z.unique(c.map(function(g) {
11070
- return ht.triangles(r, g.item0, i, g.item1);
11088
+ var c = ut.boundingBoxTrees(o, l, 0), d = Z.unique(c.map(function(g) {
11089
+ return ut.triangles(r, g.item0, i, g.item1);
11071
11090
  }).filter(function(g) {
11072
11091
  return g != null;
11073
11092
  }).filter(function(g) {
@@ -11076,29 +11095,29 @@ var Bl = { exports: {} };
11076
11095
  var y = p.sub(g.min.uv0, f.min.uv0), S = p.dot(y, y), P = p.sub(g.max.uv0, f.max.uv0), I = p.dot(P, P), A = p.sub(g.min.uv0, f.max.uv0), T = p.dot(A, A), k = p.sub(g.max.uv0, f.min.uv0), B = p.dot(k, k);
11077
11096
  return S < rt.EPSILON && I < rt.EPSILON || T < rt.EPSILON && B < rt.EPSILON;
11078
11097
  });
11079
- return ht.makeMeshIntersectionPolylines(d);
11080
- }, ht.meshSlices = function(r, i, o, l) {
11098
+ return ut.makeMeshIntersectionPolylines(d);
11099
+ }, ut.meshSlices = function(r, i, o, l) {
11081
11100
  for (var c = new Wr(r), d = c.boundingBox(), g = d.min[0], f = d.min[1], y = d.max[0], S = d.max[1], P = p.span(i, o, l), I = [], A = 0; A < P.length; ) {
11082
11101
  var T = P[A];
11083
11102
  ++A;
11084
11103
  var k = [[g, f, T], [y, f, T], [y, S, T], [g, S, T]], B = [[0, 0], [1, 0], [1, 1], [0, 1]], C = [[0, 1, 2], [0, 2, 3]], R = new er(C, k, null, B);
11085
- I.push(ht.meshes(r, R, c));
11104
+ I.push(ut.meshes(r, R, c));
11086
11105
  }
11087
11106
  return I;
11088
- }, ht.makeMeshIntersectionPolylines = function(r) {
11107
+ }, ut.makeMeshIntersectionPolylines = function(r) {
11089
11108
  if (r.length == 0) return [];
11090
11109
  for (var i = 0; i < r.length; ) {
11091
11110
  var o = r[i];
11092
11111
  ++i, o.max.opp = o.min, o.min.opp = o.max;
11093
11112
  }
11094
- for (var l = ht.kdTreeFromSegments(r), c = [], d = 0; d < r.length; ) {
11113
+ for (var l = ut.kdTreeFromSegments(r), c = [], d = 0; d < r.length; ) {
11095
11114
  var g = r[d];
11096
11115
  ++d, c.push(g.min), c.push(g.max);
11097
11116
  }
11098
11117
  for (var f = 0; f < c.length; ) {
11099
11118
  var y = c[f];
11100
11119
  if (++f, y.adj == null) {
11101
- var S = ht.lookupAdjacentSegment(y, l, r.length);
11120
+ var S = ut.lookupAdjacentSegment(y, l, r.length);
11102
11121
  S != null && S.adj == null && (y.adj = S, S.adj = y);
11103
11122
  }
11104
11123
  }
@@ -11120,31 +11139,31 @@ var Bl = { exports: {} };
11120
11139
  }
11121
11140
  }
11122
11141
  return I;
11123
- }, ht.kdTreeFromSegments = function(r) {
11142
+ }, ut.kdTreeFromSegments = function(r) {
11124
11143
  for (var i = [], o = 0; o < r.length; ) {
11125
11144
  var l = r[o];
11126
11145
  ++o, i.push(new Tn(l.min.point, l.min)), i.push(new Tn(l.max.point, l.max));
11127
11146
  }
11128
11147
  return new Jn(i, p.distSquared);
11129
- }, ht.lookupAdjacentSegment = function(r, i, o) {
11148
+ }, ut.lookupAdjacentSegment = function(r, i, o) {
11130
11149
  var l = i.nearest(r.point, o, rt.EPSILON).filter(function(c) {
11131
11150
  return r != c.item0.obj;
11132
11151
  }).map(function(c) {
11133
11152
  return c.item0.obj;
11134
11153
  });
11135
11154
  return l.length == 1 ? l[0] : null;
11136
- }, ht.curveAndSurface = function(r, i, o, l, c) {
11155
+ }, ut.curveAndSurface = function(r, i, o, l, c) {
11137
11156
  o == null && (o = 1e-3), l != null ? l = l : l = new pr(r), c != null ? c = c : c = new Gr(i);
11138
- var d = ht.boundingBoxTrees(l, c, o);
11157
+ var d = ut.boundingBoxTrees(l, c, o);
11139
11158
  return Z.unique(d.map(function(g) {
11140
11159
  var f = g.item0, y = g.item1, S = Z.first(f.knots), P = Z.last(f.knots), I = (S + P) / 2, A = Z.first(y.knotsU), T = Z.last(y.knotsU), k = Z.first(y.knotsV), B = Z.last(y.knotsV), C = [(A + T) / 2, (k + B) / 2];
11141
- return ht.curveAndSurfaceWithEstimate(f, y, [I].concat(C), o);
11160
+ return ut.curveAndSurfaceWithEstimate(f, y, [I].concat(C), o);
11142
11161
  }).filter(function(g) {
11143
11162
  return p.distSquared(g.curvePoint, g.surfacePoint) < o * o;
11144
11163
  }), function(g, f) {
11145
11164
  return Math.abs(g.u - f.u) < 0.5 * o;
11146
11165
  });
11147
- }, ht.curveAndSurfaceWithEstimate = function(r, i, o, l) {
11166
+ }, ut.curveAndSurfaceWithEstimate = function(r, i, o, l) {
11148
11167
  l == null && (l = 1e-3);
11149
11168
  var c = function(y) {
11150
11169
  var S = N.rationalCurvePoint(r, y[0]), P = N.rationalSurfacePoint(i, y[1], y[2]), I = p.sub(S, P);
@@ -11154,18 +11173,18 @@ var Bl = { exports: {} };
11154
11173
  return [2 * p.dot(A, I), 2 * p.dot(T, I), 2 * p.dot(k, I)];
11155
11174
  }, g = rr.uncmin(c, o, l * l, d), f = g.solution;
11156
11175
  return new Kn(f[0], [f[1], f[2]], N.rationalCurvePoint(r, f[0]), N.rationalSurfacePoint(i, f[1], f[2]));
11157
- }, ht.polylineAndMesh = function(r, i, o) {
11158
- for (var l = ht.boundingBoxTrees(new gr(r), new mr(i), o), c = [], d = 0; d < l.length; ) {
11176
+ }, ut.polylineAndMesh = function(r, i, o) {
11177
+ for (var l = ut.boundingBoxTrees(new gr(r), new mr(i), o), c = [], d = 0; d < l.length; ) {
11159
11178
  var g = l[d];
11160
11179
  ++d;
11161
- var f = g.item0, y = g.item1, S = ht.segmentWithTriangle(r.points[f], r.points[f + 1], i.points, i.faces[y]);
11180
+ var f = g.item0, y = g.item1, S = ut.segmentWithTriangle(r.points[f], r.points[f + 1], i.points, i.faces[y]);
11162
11181
  if (S != null) {
11163
11182
  var P = S.point, I = p.lerp(S.p, [r.params[f]], [r.params[f + 1]])[0], A = ae.triangleUVFromPoint(i, y, P);
11164
11183
  c.push(new $n(P, I, A, f, y));
11165
11184
  }
11166
11185
  }
11167
11186
  return c;
11168
- }, ht.boundingBoxTrees = function(r, i, o) {
11187
+ }, ut.boundingBoxTrees = function(r, i, o) {
11169
11188
  o == null && (o = 1e-9);
11170
11189
  var l = [], c = [];
11171
11190
  l.push(r), c.push(i);
@@ -11190,16 +11209,16 @@ var Bl = { exports: {} };
11190
11209
  }
11191
11210
  }
11192
11211
  return d;
11193
- }, ht.curves = function(r, i, o) {
11194
- var l = ht.boundingBoxTrees(new pr(r), new pr(i), 0);
11212
+ }, ut.curves = function(r, i, o) {
11213
+ var l = ut.boundingBoxTrees(new pr(r), new pr(i), 0);
11195
11214
  return Z.unique(l.map(function(c) {
11196
- return ht.curvesWithEstimate(r, i, Z.first(c.item0.knots), Z.first(c.item1.knots), o);
11215
+ return ut.curvesWithEstimate(r, i, Z.first(c.item0.knots), Z.first(c.item1.knots), o);
11197
11216
  }).filter(function(c) {
11198
11217
  return p.distSquared(c.point0, c.point1) < o;
11199
11218
  }), function(c, d) {
11200
11219
  return Math.abs(c.u0 - d.u0) < o * 5;
11201
11220
  });
11202
- }, ht.curvesWithEstimate = function(r, i, o, l, c) {
11221
+ }, ut.curvesWithEstimate = function(r, i, o, l, c) {
11203
11222
  var d = function(A) {
11204
11223
  var T = N.rationalCurvePoint(r, A[0]), k = N.rationalCurvePoint(i, A[1]), B = p.sub(T, k);
11205
11224
  return p.dot(B, B);
@@ -11208,25 +11227,25 @@ var Bl = { exports: {} };
11208
11227
  return [2 * p.dot(C, B), 2 * p.dot(R, B)];
11209
11228
  }, f = rr.uncmin(d, [o, l], c * c, g), y = f.solution[0], S = f.solution[1], P = N.rationalCurvePoint(r, y), I = N.rationalCurvePoint(i, S);
11210
11229
  return new nn(P, I, y, S);
11211
- }, ht.triangles = function(r, i, o, l) {
11212
- var c = r.faces[i], d = o.faces[l], g = ae.getTriangleNorm(r.points, c), f = ae.getTriangleNorm(o.points, d), y = r.points[c[0]], S = o.points[d[0]], P = ht.planes(y, g, S, f);
11230
+ }, ut.triangles = function(r, i, o, l) {
11231
+ var c = r.faces[i], d = o.faces[l], g = ae.getTriangleNorm(r.points, c), f = ae.getTriangleNorm(o.points, d), y = r.points[c[0]], S = o.points[d[0]], P = ut.planes(y, g, S, f);
11213
11232
  if (P == null) return null;
11214
- var I = ht.clipRayInCoplanarTriangle(P, r, i);
11233
+ var I = ut.clipRayInCoplanarTriangle(P, r, i);
11215
11234
  if (I == null) return null;
11216
- var A = ht.clipRayInCoplanarTriangle(P, o, l);
11235
+ var A = ut.clipRayInCoplanarTriangle(P, o, l);
11217
11236
  if (A == null) return null;
11218
- var T = ht.mergeTriangleClipIntervals(I, A, r, i, o, l);
11237
+ var T = ut.mergeTriangleClipIntervals(I, A, r, i, o, l);
11219
11238
  return T == null ? null : new Ne(new jr(T.min.uv0, T.min.uv1, T.min.point, i, l), new jr(T.max.uv0, T.max.uv1, T.max.point, i, l));
11220
- }, ht.clipRayInCoplanarTriangle = function(r, i, o) {
11239
+ }, ut.clipRayInCoplanarTriangle = function(r, i, o) {
11221
11240
  for (var l = i.faces[o], c = [i.points[l[0]], i.points[l[1]], i.points[l[2]]], d = [i.uvs[l[0]], i.uvs[l[1]], i.uvs[l[2]]], g = [p.sub(d[1], d[0]), p.sub(d[2], d[1]), p.sub(d[0], d[2])], f = [p.sub(c[1], c[0]), p.sub(c[2], c[1]), p.sub(c[0], c[2])], y = f.map(p.normalized), S = f.map(p.norm), P = null, I = null, A = 0; A < 3; ) {
11222
- var T = A++, k = c[T], B = y[T], C = ht.rays(k, B, r.origin, r.dir);
11241
+ var T = A++, k = c[T], B = y[T], C = ut.rays(k, B, r.origin, r.dir);
11223
11242
  if (C != null) {
11224
11243
  var R = C.u0, z = C.u1;
11225
11244
  R < -rt.EPSILON || R > S[T] + rt.EPSILON || ((P == null || z < P.u) && (P = new Mn(z, p.onRay(r.origin, r.dir, z), p.onRay(d[T], g[T], R / S[T]))), (I == null || z > I.u) && (I = new Mn(z, p.onRay(r.origin, r.dir, z), p.onRay(d[T], g[T], R / S[T]))));
11226
11245
  }
11227
11246
  }
11228
11247
  return I == null || P == null ? null : new Ne(P, I);
11229
- }, ht.mergeTriangleClipIntervals = function(r, i, o, l, c, d) {
11248
+ }, ut.mergeTriangleClipIntervals = function(r, i, o, l, c, d) {
11230
11249
  if (i.min.u > r.max.u + rt.EPSILON || r.min.u > i.max.u + rt.EPSILON) return null;
11231
11250
  var g;
11232
11251
  r.min.u > i.min.u ? g = new ie(r.min, 0) : g = new ie(i.min, 1);
@@ -11234,7 +11253,7 @@ var Bl = { exports: {} };
11234
11253
  r.max.u < i.max.u ? f = new ie(r.max, 0) : f = new ie(i.max, 1);
11235
11254
  var y = new Ne(new jr(null, null, g.item0.point, l, d), new jr(null, null, f.item0.point, l, d));
11236
11255
  return g.item1 == 0 ? (y.min.uv0 = g.item0.uv, y.min.uv1 = ae.triangleUVFromPoint(c, d, g.item0.point)) : (y.min.uv0 = ae.triangleUVFromPoint(o, l, g.item0.point), y.min.uv1 = g.item0.uv), f.item1 == 0 ? (y.max.uv0 = f.item0.uv, y.max.uv1 = ae.triangleUVFromPoint(c, d, f.item0.point)) : (y.max.uv0 = ae.triangleUVFromPoint(o, l, f.item0.point), y.max.uv1 = f.item0.uv), y;
11237
- }, ht.planes = function(r, i, o, l) {
11256
+ }, ut.planes = function(r, i, o, l) {
11238
11257
  var c = p.cross(i, l);
11239
11258
  if (p.dot(c, c) < rt.EPSILON) return null;
11240
11259
  var d = 0, g = Math.abs(c[0]), f = Math.abs(c[1]), y = Math.abs(c[2]);
@@ -11243,32 +11262,32 @@ var Bl = { exports: {} };
11243
11262
  d == 0 ? (S = i[1], P = i[2], I = l[1], A = l[2]) : d == 1 ? (S = i[0], P = i[2], I = l[0], A = l[2]) : (S = i[0], P = i[1], I = l[0], A = l[1]);
11244
11263
  var T = -p.dot(r, i), k = -p.dot(o, l), B = S * A - P * I, C = (P * k - T * A) / B, R = (T * I - S * k) / B, z;
11245
11264
  return d == 0 ? z = [0, C, R] : d == 1 ? z = [C, 0, R] : z = [C, R, 0], new An(z, p.normalized(c));
11246
- }, ht.threePlanes = function(r, i, o, l, c, d) {
11265
+ }, ut.threePlanes = function(r, i, o, l, c, d) {
11247
11266
  var g = p.cross(o, c), f = p.dot(r, g);
11248
11267
  if (Math.abs(f) < rt.EPSILON) return null;
11249
11268
  var y = p.sub(p.mul(d, o), p.mul(l, c)), S = p.add(p.mul(i, g), p.cross(r, y));
11250
11269
  return p.mul(1 / f, S);
11251
- }, ht.polylines = function(r, i, o) {
11252
- for (var l = ht.boundingBoxTrees(new gr(r), new gr(i), o), c = [], d = 0; d < l.length; ) {
11270
+ }, ut.polylines = function(r, i, o) {
11271
+ for (var l = ut.boundingBoxTrees(new gr(r), new gr(i), o), c = [], d = 0; d < l.length; ) {
11253
11272
  var g = l[d];
11254
11273
  ++d;
11255
- var f = g.item0, y = g.item1, S = ht.segments(r.points[f], r.points[f + 1], i.points[y], i.points[y + 1], o);
11274
+ var f = g.item0, y = g.item1, S = ut.segments(r.points[f], r.points[f + 1], i.points[y], i.points[y + 1], o);
11256
11275
  S != null && (S.u0 = p.lerp(S.u0, [r.params[f]], [r.params[f + 1]])[0], S.u1 = p.lerp(S.u1, [i.params[y]], [i.params[y + 1]])[0], c.push(S));
11257
11276
  }
11258
11277
  return c;
11259
- }, ht.segments = function(r, i, o, l, c) {
11260
- var d = p.sub(i, r), g = Math.sqrt(p.dot(d, d)), f = p.mul(1 / g, d), y = p.sub(l, o), S = Math.sqrt(p.dot(y, y)), P = p.mul(1 / S, y), I = ht.rays(r, f, o, P);
11278
+ }, ut.segments = function(r, i, o, l, c) {
11279
+ var d = p.sub(i, r), g = Math.sqrt(p.dot(d, d)), f = p.mul(1 / g, d), y = p.sub(l, o), S = Math.sqrt(p.dot(y, y)), P = p.mul(1 / S, y), I = ut.rays(r, f, o, P);
11261
11280
  if (I != null) {
11262
11281
  var A = Math.min(Math.max(0, I.u0 / g), 1), T = Math.min(Math.max(0, I.u1 / S), 1), k = p.onRay(r, d, A), B = p.onRay(o, y, T), C = p.distSquared(k, B);
11263
11282
  if (C < c * c) return new nn(k, B, A, T);
11264
11283
  }
11265
11284
  return null;
11266
- }, ht.rays = function(r, i, o, l) {
11285
+ }, ut.rays = function(r, i, o, l) {
11267
11286
  var c = p.dot(i, l), d = p.dot(i, o), g = p.dot(i, r), f = p.dot(l, o), y = p.dot(l, r), S = p.dot(i, i), P = p.dot(l, l), I = S * P - c * c;
11268
11287
  if (Math.abs(I) < rt.EPSILON) return null;
11269
11288
  var A = c * (d - g) - S * (f - y), T = A / I, k = (d - g + T * c) / S, B = p.onRay(r, i, k), C = p.onRay(o, l, T);
11270
11289
  return new nn(B, C, k, T);
11271
- }, ht.segmentWithTriangle = function(r, i, o, l) {
11290
+ }, ut.segmentWithTriangle = function(r, i, o, l) {
11272
11291
  var c = o[l[0]], d = o[l[1]], g = o[l[2]], f = p.sub(d, c), y = p.sub(g, c), S = p.cross(f, y), P = p.sub(i, r), I = p.sub(r, c), A = -p.dot(S, I), T = p.dot(S, P);
11273
11292
  if (Math.abs(T) < rt.EPSILON) return null;
11274
11293
  var k = A / T;
@@ -11277,7 +11296,7 @@ var Bl = { exports: {} };
11277
11296
  if (Math.abs(J) < rt.EPSILON) return null;
11278
11297
  var X = (C * Y - z * j) / J, G = (C * j - R * Y) / J;
11279
11298
  return X > 1 + rt.EPSILON || G > 1 + rt.EPSILON || G < -rt.EPSILON || X < -rt.EPSILON || X + G > 1 + rt.EPSILON ? null : new Qn(B, X, G, k);
11280
- }, ht.segmentAndPlane = function(r, i, o, l) {
11299
+ }, ut.segmentAndPlane = function(r, i, o, l) {
11281
11300
  var c = p.dot(l, p.sub(i, r));
11282
11301
  if (Math.abs(c) < rt.EPSILON) return null;
11283
11302
  var d = p.dot(l, p.sub(o, r)), g = d / c;
@@ -11365,7 +11384,7 @@ var Bl = { exports: {} };
11365
11384
  C += S;
11366
11385
  var Y = p.add(r, p.add(p.mul(d * Math.cos(C), i), p.mul(g * Math.sin(C), o)));
11367
11386
  R[B + 2] = 1, T[B + 2] = Y;
11368
- var J = p.sub(p.mul(Math.cos(C), o), p.mul(Math.sin(C), i)), X = ht.rays(I, p.mul(1 / p.norm(A), A), Y, p.mul(1 / p.norm(J), J)), G = p.add(I, p.mul(X.u0, A));
11387
+ var J = p.sub(p.mul(Math.cos(C), o), p.mul(Math.sin(C), i)), X = ut.rays(I, p.mul(1 / p.norm(A), A), Y, p.mul(1 / p.norm(J), J)), G = p.add(I, p.mul(X.u0, A));
11369
11388
  R[B + 1] = P, T[B + 1] = G, B += 2, j < y && (I = Y, A = J);
11370
11389
  }
11371
11390
  for (var $ = 2 * y + 1, tt = 0; tt < 3; ) {
@@ -11420,16 +11439,16 @@ var Bl = { exports: {} };
11420
11439
  tt > rt.EPSILON && ($ = p.mul(1 / tt, $), et = p.mul(1 / tt, et)), C[0][X] = c[X];
11421
11440
  var ot = c[X];
11422
11441
  R[0][X] = d[X];
11423
- for (var ut = et, lt = 0, pt = 1, nt = g + 1; pt < nt; ) {
11442
+ for (var ct = et, lt = 0, pt = 1, nt = g + 1; pt < nt; ) {
11424
11443
  var mt = pt++, D;
11425
11444
  tt == 0 ? D = G : D = p.add(G, p.add(p.mul(tt * B[mt], $), p.mul(tt * k[mt], et))), C[lt + 2][X] = D, R[lt + 2][X] = d[X];
11426
11445
  var _t = p.sub(p.mul(B[mt], et), p.mul(k[mt], $));
11427
11446
  if (tt == 0) C[lt + 1][X] = G;
11428
11447
  else {
11429
- var At = ht.rays(ot, p.mul(1 / p.norm(ut), ut), D, p.mul(1 / p.norm(_t), _t)), Xt = p.add(ot, p.mul(At.u0, ut));
11448
+ var At = ut.rays(ot, p.mul(1 / p.norm(ct), ct), D, p.mul(1 / p.norm(_t), _t)), Xt = p.add(ot, p.mul(At.u0, ct));
11430
11449
  C[lt + 1][X] = Xt;
11431
11450
  }
11432
- R[lt + 1][X] = A * d[X], lt += 2, mt < g && (ot = D, ut = _t);
11451
+ R[lt + 1][X] = A * d[X], lt += 2, mt < g && (ot = D, ct = _t);
11433
11452
  }
11434
11453
  }
11435
11454
  return new se(2, r.degree, f, r.knots, N.homogenize2d(C, R));
@@ -11465,9 +11484,9 @@ var Bl = { exports: {} };
11465
11484
  var et;
11466
11485
  C ? et = r.length - (i - 1) : et = r.length - (i + 1);
11467
11486
  for (var ot = 0; ot < d.length; ) {
11468
- var ut = d[ot];
11487
+ var ct = d[ot];
11469
11488
  ++ot;
11470
- var lt = N.knotSpanGivenN(tt, i, ut, G), pt = N.basisFunctionsGivenKnotSpanIndex(lt, ut, i, G), nt = lt - i, mt = p.zeros1d(nt), D = p.zeros1d(et - nt);
11489
+ var lt = N.knotSpanGivenN(tt, i, ct, G), pt = N.basisFunctionsGivenKnotSpanIndex(lt, ct, i, G), nt = lt - i, mt = p.zeros1d(nt), D = p.zeros1d(et - nt);
11471
11490
  $.push(mt.concat(pt).concat(D));
11472
11491
  }
11473
11492
  if (C) {
@@ -11573,7 +11592,7 @@ var Bl = { exports: {} };
11573
11592
  y[U][G] = j * Ft.get(l, G) * Ft.get(g, U - G);
11574
11593
  }
11575
11594
  for (var $ = k + 1; $ < T; )
11576
- for (var tt = $++, et = yt.imin(l, tt), ot = yt.imax(0, tt - g), ut = et + 1; ot < ut; ) {
11595
+ for (var tt = $++, et = yt.imin(l, tt), ot = yt.imax(0, tt - g), ct = et + 1; ot < ct; ) {
11577
11596
  var lt = ot++;
11578
11597
  y[tt][lt] = y[T - tt][l - lt];
11579
11598
  }
@@ -11711,8 +11730,8 @@ var Bl = { exports: {} };
11711
11730
  P[$ - o - 1] = l[G - o - 1], I[$] = c[G], $ = $ - 1, G = G - 1;
11712
11731
  P[$ - o - 1] = P[$ - o];
11713
11732
  for (var et = 1, ot = o + 1; et < ot; ) {
11714
- var ut = et++, lt = $ - o + ut, pt = I[$ + ut] - i[tt];
11715
- Math.abs(pt) < rt.EPSILON ? P[lt - 1] = P[lt] : (pt = pt / (I[$ + ut] - c[G - o + ut]), P[lt - 1] = p.add(p.mul(pt, P[lt - 1]), p.mul(1 - pt, P[lt])));
11733
+ var ct = et++, lt = $ - o + ct, pt = I[$ + ct] - i[tt];
11734
+ Math.abs(pt) < rt.EPSILON ? P[lt - 1] = P[lt] : (pt = pt / (I[$ + ct] - c[G - o + ct]), P[lt - 1] = p.add(p.mul(pt, P[lt - 1]), p.mul(1 - pt, P[lt])));
11716
11735
  }
11717
11736
  I[$] = i[tt], $ = $ - 1, tt--;
11718
11737
  }
@@ -11742,18 +11761,18 @@ var Bl = { exports: {} };
11742
11761
  var ot = tt++;
11743
11762
  S[ot] = c[y - l + ot];
11744
11763
  }
11745
- for (var ut = 0, lt = 0, pt = 1, nt = o + 1; pt < nt; ) {
11764
+ for (var ct = 0, lt = 0, pt = 1, nt = o + 1; pt < nt; ) {
11746
11765
  var mt = pt++;
11747
- ut = y - l + mt;
11766
+ ct = y - l + mt;
11748
11767
  for (var D = 0, _t = l - mt - g + 1; D < _t; ) {
11749
11768
  var At = D++;
11750
- lt = (i - d[ut + At]) / (d[At + y + 1] - d[ut + At]), S[At] = p.add(p.mul(lt, S[At + 1]), p.mul(1 - lt, S[At]));
11769
+ lt = (i - d[ct + At]) / (d[At + y + 1] - d[ct + At]), S[At] = p.add(p.mul(lt, S[At + 1]), p.mul(1 - lt, S[At]));
11751
11770
  }
11752
- I[ut] = S[0], I[y + o - mt - g] = S[l - mt - g];
11771
+ I[ct] = S[0], I[y + o - mt - g] = S[l - mt - g];
11753
11772
  }
11754
- for (var Xt = ut + 1, Zt = y - g; Xt < Zt; ) {
11773
+ for (var Xt = ct + 1, Zt = y - g; Xt < Zt; ) {
11755
11774
  var jt = Xt++;
11756
- I[jt] = S[jt - ut];
11775
+ I[jt] = S[jt - ct];
11757
11776
  }
11758
11777
  return new qt(l, P, I);
11759
11778
  };
@@ -11798,7 +11817,7 @@ var Bl = { exports: {} };
11798
11817
  }
11799
11818
  for (var X = [], G = 0; G < i; )
11800
11819
  for (var $ = G++, tt = 0; tt < o; ) {
11801
- var et = tt++, ot = $ * (o + 1) + et, ut = ($ + 1) * (o + 1) + et, lt = ut + 1, pt = ot + 1, nt = [ot, ut, lt], mt = [ot, lt, pt];
11820
+ var et = tt++, ot = $ * (o + 1) + et, ct = ($ + 1) * (o + 1) + et, lt = ct + 1, pt = ot + 1, nt = [ot, ct, lt], mt = [ot, lt, pt];
11802
11821
  X.push(nt), X.push(mt);
11803
11822
  }
11804
11823
  return new er(X, S, I, P);
@@ -11817,8 +11836,8 @@ var Bl = { exports: {} };
11817
11836
  }
11818
11837
  for (var $ = 0; $ < d; )
11819
11838
  for (var tt = $++, et = 0; et < c; ) {
11820
- var ot = et++, ut = [T[d - tt - 1][ot], T[d - tt - 1][ot + 1], T[d - tt][ot + 1], T[d - tt][ot]];
11821
- A.push(new br(r, ut));
11839
+ var ot = et++, ct = [T[d - tt - 1][ot], T[d - tt - 1][ot + 1], T[d - tt][ot + 1], T[d - tt][ot]];
11840
+ A.push(new br(r, ct));
11822
11841
  }
11823
11842
  if (!i.refine) return A;
11824
11843
  for (var lt = 0; lt < d; )
@@ -12450,19 +12469,19 @@ var Bl = { exports: {} };
12450
12469
  var Dr = _.geom.Intersect = function() {
12451
12470
  };
12452
12471
  x["verb.geom.Intersect"] = Dr, Dr.__name__ = ["verb", "geom", "Intersect"], Dr.curves = function(r, i, o) {
12453
- return o == null && (o = 1e-3), ht.curves(r.asNurbs(), i.asNurbs(), o);
12472
+ return o == null && (o = 1e-3), ut.curves(r.asNurbs(), i.asNurbs(), o);
12454
12473
  }, Dr.curvesAsync = function(r, i, o) {
12455
- return o == null && (o = 1e-3), St.dispatchMethod(ht, "curves", [r.asNurbs(), i.asNurbs(), o]);
12474
+ return o == null && (o = 1e-3), St.dispatchMethod(ut, "curves", [r.asNurbs(), i.asNurbs(), o]);
12456
12475
  }, Dr.curveAndSurface = function(r, i, o) {
12457
- return o == null && (o = 1e-3), ht.curveAndSurface(r.asNurbs(), i.asNurbs(), o);
12476
+ return o == null && (o = 1e-3), ut.curveAndSurface(r.asNurbs(), i.asNurbs(), o);
12458
12477
  }, Dr.curveAndSurfaceAsync = function(r, i, o) {
12459
- return o == null && (o = 1e-3), St.dispatchMethod(ht, "curveAndSurface", [r.asNurbs(), i.asNurbs(), o]);
12478
+ return o == null && (o = 1e-3), St.dispatchMethod(ut, "curveAndSurface", [r.asNurbs(), i.asNurbs(), o]);
12460
12479
  }, Dr.surfaces = function(r, i, o) {
12461
- return o == null && (o = 1e-3), ht.surfaces(r.asNurbs(), i.asNurbs(), o).map(function(l) {
12480
+ return o == null && (o = 1e-3), ut.surfaces(r.asNurbs(), i.asNurbs(), o).map(function(l) {
12462
12481
  return new Nt(l);
12463
12482
  });
12464
12483
  }, Dr.surfacesAsync = function(r, i, o) {
12465
- return o == null && (o = 1e-3), St.dispatchMethod(ht, "surfaces", [r.asNurbs(), i.asNurbs(), o]).then(function(l) {
12484
+ return o == null && (o = 1e-3), St.dispatchMethod(ut, "surfaces", [r.asNurbs(), i.asNurbs(), o]).then(function(l) {
12466
12485
  return l.map(function(c) {
12467
12486
  return new Nt(c);
12468
12487
  });
@@ -13698,6 +13717,17 @@ const Fa = class Fa extends rn {
13698
13717
  set color(t) {
13699
13718
  this._color == null && (this._color = new _e()), this._color.copy(t);
13700
13719
  }
13720
+ /**
13721
+ * Resolved color applied on this entity. It will resolve layer colors and block colors as needed.
13722
+ */
13723
+ get resolvedColor() {
13724
+ let t = this.color;
13725
+ if (t.isByLayer) {
13726
+ const e = this.getLayerColor();
13727
+ e && e.RGB != null && (t = e);
13728
+ } else t.isByBlock;
13729
+ return t;
13730
+ }
13701
13731
  /**
13702
13732
  * Gets the RGB color of this entity.
13703
13733
  *
@@ -13713,12 +13743,7 @@ const Fa = class Fa extends rn {
13713
13743
  * ```
13714
13744
  */
13715
13745
  get rgbColor() {
13716
- let t = this.color;
13717
- if (t.isByLayer) {
13718
- const s = this.getLayerColor();
13719
- s && s.RGB != null && (t = s);
13720
- } else t.isByBlock;
13721
- const e = t.RGB;
13746
+ const e = this.resolvedColor.RGB;
13722
13747
  return e ?? 16777215;
13723
13748
  }
13724
13749
  /**
@@ -13989,7 +14014,7 @@ const Fa = class Fa extends rn {
13989
14014
  */
13990
14015
  worldDraw(t, e) {
13991
14016
  const s = t.subEntityTraits;
13992
- s.color = this.color, s.rgbColor = this.rgbColor, s.lineType = this.lineStyle, s.lineTypeScale = this.linetypeScale, s.lineWeight = this.lineWeight, s.transparency = this.transparency, s.layer = this.layer, "thickness" in this && (s.thickness = this.thickness);
14017
+ s.color = this.resolvedColor, s.rgbColor = this.rgbColor, s.lineType = this.lineStyle, s.lineTypeScale = this.linetypeScale, s.lineWeight = this.lineWeight, s.transparency = this.transparency, s.layer = this.layer, "thickness" in this && (s.thickness = this.thickness);
13993
14018
  const a = this.subWorldDraw(t, e);
13994
14019
  return this.attachEntityInfo(a), a;
13995
14020
  }
@@ -21863,7 +21888,7 @@ const go = class go extends en {
21863
21888
  });
21864
21889
  if (this.dimensionText) {
21865
21890
  const a = new gi();
21866
- return a.attachmentPoint = Me.MiddleLeft, a.layer = "0", a.color = new _e(ct.ByBlock), a.location = t, a.contents = this.dimensionText ?? "", a.height = 10, a.direction = s(e), a.styleName = this.dimensionStyle.dimtxsty, a;
21891
+ return a.attachmentPoint = Me.MiddleLeft, a.layer = "0", a.color = new _e(ht.ByBlock), a.location = t, a.contents = this.dimensionText ?? "", a.height = 10, a.direction = s(e), a.styleName = this.dimensionStyle.dimtxsty, a;
21867
21892
  }
21868
21893
  }
21869
21894
  createArrows(t) {
@@ -27566,7 +27591,7 @@ const Gt = {
27566
27591
  name: Gt.CECOLOR,
27567
27592
  type: "color",
27568
27593
  isDbVar: !0,
27569
- defaultValue: new _e(ct.ByLayer)
27594
+ defaultValue: new _e(ht.ByLayer)
27570
27595
  }), this.registerVar({
27571
27596
  name: Gt.CELTSCALE,
27572
27597
  type: "number",
@@ -27597,7 +27622,7 @@ const Gt = {
27597
27622
  type: "color",
27598
27623
  isDbVar: !1,
27599
27624
  defaultValue: (() => {
27600
- const t = new _e(ct.ByColor);
27625
+ const t = new _e(ht.ByColor);
27601
27626
  return t.setRGB(96, 165, 250), t;
27602
27627
  })()
27603
27628
  }), this.registerVar({
@@ -30162,7 +30187,7 @@ class nu {
30162
30187
  export {
30163
30188
  pp as AC_DB_SYSTEM_VARIABLE_NAMES,
30164
30189
  _e as AcCmColor,
30165
- ct as AcCmColorMethod,
30190
+ ht as AcCmColorMethod,
30166
30191
  hn as AcCmColorUtil,
30167
30192
  W0 as AcCmEntityColor,
30168
30193
  tr as AcCmErrors,