@tscircuit/3d-viewer 0.0.365 → 0.0.366

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -144,8 +144,8 @@ var require_dist = __commonJS({
144
144
  fromValues: (x, y) => [x, y]
145
145
  },
146
146
  vec3: {
147
- create: (x, y, z98) => [x, y, z98],
148
- fromValues: (x, y, z98) => [x, y, z98]
147
+ create: (x, y, z102) => [x, y, z102],
148
+ fromValues: (x, y, z102) => [x, y, z102]
149
149
  }
150
150
  },
151
151
  geometries: {
@@ -532,29 +532,29 @@ var require_fromRotation = __commonJS({
532
532
  var { sin: sin2, cos: cos2 } = require_trigonometry();
533
533
  var identity = require_identity();
534
534
  var fromRotation = (out, rad, axis) => {
535
- let [x, y, z98] = axis;
536
- const lengthSquared = x * x + y * y + z98 * z98;
535
+ let [x, y, z102] = axis;
536
+ const lengthSquared = x * x + y * y + z102 * z102;
537
537
  if (Math.abs(lengthSquared) < EPS) {
538
538
  return identity(out);
539
539
  }
540
540
  const len = 1 / Math.sqrt(lengthSquared);
541
541
  x *= len;
542
542
  y *= len;
543
- z98 *= len;
543
+ z102 *= len;
544
544
  const s = sin2(rad);
545
545
  const c = cos2(rad);
546
546
  const t = 1 - c;
547
547
  out[0] = x * x * t + c;
548
- out[1] = y * x * t + z98 * s;
549
- out[2] = z98 * x * t - y * s;
548
+ out[1] = y * x * t + z102 * s;
549
+ out[2] = z102 * x * t - y * s;
550
550
  out[3] = 0;
551
- out[4] = x * y * t - z98 * s;
551
+ out[4] = x * y * t - z102 * s;
552
552
  out[5] = y * y * t + c;
553
- out[6] = z98 * y * t + x * s;
553
+ out[6] = z102 * y * t + x * s;
554
554
  out[7] = 0;
555
- out[8] = x * z98 * t + y * s;
556
- out[9] = y * z98 * t - x * s;
557
- out[10] = z98 * z98 * t + c;
555
+ out[8] = x * z102 * t + y * s;
556
+ out[9] = y * z102 * t - x * s;
557
+ out[10] = z102 * z102 * t + c;
558
558
  out[11] = 0;
559
559
  out[12] = 0;
560
560
  out[13] = 0;
@@ -808,8 +808,8 @@ var require_distance = __commonJS({
808
808
  var distance2 = (a, b) => {
809
809
  const x = b[0] - a[0];
810
810
  const y = b[1] - a[1];
811
- const z98 = b[2] - a[2];
812
- return Math.sqrt(x * x + y * y + z98 * z98);
811
+ const z102 = b[2] - a[2];
812
+ return Math.sqrt(x * x + y * y + z102 * z102);
813
813
  };
814
814
  module.exports = distance2;
815
815
  }
@@ -857,11 +857,11 @@ var require_fromValues2 = __commonJS({
857
857
  "node_modules/@jscad/modeling/src/maths/vec3/fromValues.js"(exports, module) {
858
858
  "use strict";
859
859
  var create = require_create2();
860
- var fromValues = (x, y, z98) => {
860
+ var fromValues = (x, y, z102) => {
861
861
  const out = create();
862
862
  out[0] = x;
863
863
  out[1] = y;
864
- out[2] = z98;
864
+ out[2] = z102;
865
865
  return out;
866
866
  };
867
867
  module.exports = fromValues;
@@ -872,10 +872,10 @@ var require_fromValues2 = __commonJS({
872
872
  var require_fromVec2 = __commonJS({
873
873
  "node_modules/@jscad/modeling/src/maths/vec3/fromVec2.js"(exports, module) {
874
874
  "use strict";
875
- var fromVector2 = (out, vector, z98 = 0) => {
875
+ var fromVector2 = (out, vector, z102 = 0) => {
876
876
  out[0] = vector[0];
877
877
  out[1] = vector[1];
878
- out[2] = z98;
878
+ out[2] = z102;
879
879
  return out;
880
880
  };
881
881
  module.exports = fromVector2;
@@ -889,8 +889,8 @@ var require_length = __commonJS({
889
889
  var length2 = (vector) => {
890
890
  const x = vector[0];
891
891
  const y = vector[1];
892
- const z98 = vector[2];
893
- return Math.sqrt(x * x + y * y + z98 * z98);
892
+ const z102 = vector[2];
893
+ return Math.sqrt(x * x + y * y + z102 * z102);
894
894
  };
895
895
  module.exports = length2;
896
896
  }
@@ -973,14 +973,14 @@ var require_normalize = __commonJS({
973
973
  var normalize = (out, vector) => {
974
974
  const x = vector[0];
975
975
  const y = vector[1];
976
- const z98 = vector[2];
977
- let len = x * x + y * y + z98 * z98;
976
+ const z102 = vector[2];
977
+ let len = x * x + y * y + z102 * z102;
978
978
  if (len > 0) {
979
979
  len = 1 / Math.sqrt(len);
980
980
  }
981
981
  out[0] = x * len;
982
982
  out[1] = y * len;
983
- out[2] = z98 * len;
983
+ out[2] = z102 * len;
984
984
  return out;
985
985
  };
986
986
  module.exports = normalize;
@@ -1104,8 +1104,8 @@ var require_squaredDistance = __commonJS({
1104
1104
  var squaredDistance = (a, b) => {
1105
1105
  const x = b[0] - a[0];
1106
1106
  const y = b[1] - a[1];
1107
- const z98 = b[2] - a[2];
1108
- return x * x + y * y + z98 * z98;
1107
+ const z102 = b[2] - a[2];
1108
+ return x * x + y * y + z102 * z102;
1109
1109
  };
1110
1110
  module.exports = squaredDistance;
1111
1111
  }
@@ -1118,8 +1118,8 @@ var require_squaredLength = __commonJS({
1118
1118
  var squaredLength = (vector) => {
1119
1119
  const x = vector[0];
1120
1120
  const y = vector[1];
1121
- const z98 = vector[2];
1122
- return x * x + y * y + z98 * z98;
1121
+ const z102 = vector[2];
1122
+ return x * x + y * y + z102 * z102;
1123
1123
  };
1124
1124
  module.exports = squaredLength;
1125
1125
  }
@@ -1155,12 +1155,12 @@ var require_transform = __commonJS({
1155
1155
  var transform2 = (out, vector, matrix) => {
1156
1156
  const x = vector[0];
1157
1157
  const y = vector[1];
1158
- const z98 = vector[2];
1159
- let w = matrix[3] * x + matrix[7] * y + matrix[11] * z98 + matrix[15];
1158
+ const z102 = vector[2];
1159
+ let w = matrix[3] * x + matrix[7] * y + matrix[11] * z102 + matrix[15];
1160
1160
  w = w || 1;
1161
- out[0] = (matrix[0] * x + matrix[4] * y + matrix[8] * z98 + matrix[12]) / w;
1162
- out[1] = (matrix[1] * x + matrix[5] * y + matrix[9] * z98 + matrix[13]) / w;
1163
- out[2] = (matrix[2] * x + matrix[6] * y + matrix[10] * z98 + matrix[14]) / w;
1161
+ out[0] = (matrix[0] * x + matrix[4] * y + matrix[8] * z102 + matrix[12]) / w;
1162
+ out[1] = (matrix[1] * x + matrix[5] * y + matrix[9] * z102 + matrix[13]) / w;
1163
+ out[2] = (matrix[2] * x + matrix[6] * y + matrix[10] * z102 + matrix[14]) / w;
1164
1164
  return out;
1165
1165
  };
1166
1166
  module.exports = transform2;
@@ -1362,8 +1362,8 @@ var require_isMirroring = __commonJS({
1362
1362
  var isMirroring = (matrix) => {
1363
1363
  const x = matrix[4] * matrix[9] - matrix[8] * matrix[5];
1364
1364
  const y = matrix[8] * matrix[1] - matrix[0] * matrix[9];
1365
- const z98 = matrix[0] * matrix[5] - matrix[4] * matrix[1];
1366
- const d = x * matrix[2] + y * matrix[6] + z98 * matrix[10];
1365
+ const z102 = matrix[0] * matrix[5] - matrix[4] * matrix[1];
1366
+ const d = x * matrix[2] + y * matrix[6] + z102 * matrix[10];
1367
1367
  return d < 0;
1368
1368
  };
1369
1369
  module.exports = isMirroring;
@@ -1465,15 +1465,15 @@ var require_rotate = __commonJS({
1465
1465
  var { sin: sin2, cos: cos2 } = require_trigonometry();
1466
1466
  var copy = require_copy();
1467
1467
  var rotate2 = (out, matrix, radians, axis) => {
1468
- let [x, y, z98] = axis;
1469
- const lengthSquared = x * x + y * y + z98 * z98;
1468
+ let [x, y, z102] = axis;
1469
+ const lengthSquared = x * x + y * y + z102 * z102;
1470
1470
  if (Math.abs(lengthSquared) < EPS) {
1471
1471
  return copy(out, matrix);
1472
1472
  }
1473
1473
  const len = 1 / Math.sqrt(lengthSquared);
1474
1474
  x *= len;
1475
1475
  y *= len;
1476
- z98 *= len;
1476
+ z102 *= len;
1477
1477
  const s = sin2(radians);
1478
1478
  const c = cos2(radians);
1479
1479
  const t = 1 - c;
@@ -1490,14 +1490,14 @@ var require_rotate = __commonJS({
1490
1490
  const a22 = matrix[10];
1491
1491
  const a23 = matrix[11];
1492
1492
  const b00 = x * x * t + c;
1493
- const b01 = y * x * t + z98 * s;
1494
- const b02 = z98 * x * t - y * s;
1495
- const b10 = x * y * t - z98 * s;
1493
+ const b01 = y * x * t + z102 * s;
1494
+ const b02 = z102 * x * t - y * s;
1495
+ const b10 = x * y * t - z102 * s;
1496
1496
  const b11 = y * y * t + c;
1497
- const b12 = z98 * y * t + x * s;
1498
- const b20 = x * z98 * t + y * s;
1499
- const b21 = y * z98 * t - x * s;
1500
- const b22 = z98 * z98 * t + c;
1497
+ const b12 = z102 * y * t + x * s;
1498
+ const b20 = x * z102 * t + y * s;
1499
+ const b21 = y * z102 * t - x * s;
1500
+ const b22 = z102 * z102 * t + c;
1501
1501
  out[0] = a00 * b00 + a10 * b01 + a20 * b02;
1502
1502
  out[1] = a01 * b00 + a11 * b01 + a21 * b02;
1503
1503
  out[2] = a02 * b00 + a12 * b01 + a22 * b02;
@@ -1649,7 +1649,7 @@ var require_scale2 = __commonJS({
1649
1649
  var scale2 = (out, matrix, dimensions) => {
1650
1650
  const x = dimensions[0];
1651
1651
  const y = dimensions[1];
1652
- const z98 = dimensions[2];
1652
+ const z102 = dimensions[2];
1653
1653
  out[0] = matrix[0] * x;
1654
1654
  out[1] = matrix[1] * x;
1655
1655
  out[2] = matrix[2] * x;
@@ -1658,10 +1658,10 @@ var require_scale2 = __commonJS({
1658
1658
  out[5] = matrix[5] * y;
1659
1659
  out[6] = matrix[6] * y;
1660
1660
  out[7] = matrix[7] * y;
1661
- out[8] = matrix[8] * z98;
1662
- out[9] = matrix[9] * z98;
1663
- out[10] = matrix[10] * z98;
1664
- out[11] = matrix[11] * z98;
1661
+ out[8] = matrix[8] * z102;
1662
+ out[9] = matrix[9] * z102;
1663
+ out[10] = matrix[10] * z102;
1664
+ out[11] = matrix[11] * z102;
1665
1665
  out[12] = matrix[12];
1666
1666
  out[13] = matrix[13];
1667
1667
  out[14] = matrix[14];
@@ -1715,7 +1715,7 @@ var require_translate = __commonJS({
1715
1715
  var translate5 = (out, matrix, offsets) => {
1716
1716
  const x = offsets[0];
1717
1717
  const y = offsets[1];
1718
- const z98 = offsets[2];
1718
+ const z102 = offsets[2];
1719
1719
  let a00;
1720
1720
  let a01;
1721
1721
  let a02;
@@ -1729,10 +1729,10 @@ var require_translate = __commonJS({
1729
1729
  let a22;
1730
1730
  let a23;
1731
1731
  if (matrix === out) {
1732
- out[12] = matrix[0] * x + matrix[4] * y + matrix[8] * z98 + matrix[12];
1733
- out[13] = matrix[1] * x + matrix[5] * y + matrix[9] * z98 + matrix[13];
1734
- out[14] = matrix[2] * x + matrix[6] * y + matrix[10] * z98 + matrix[14];
1735
- out[15] = matrix[3] * x + matrix[7] * y + matrix[11] * z98 + matrix[15];
1732
+ out[12] = matrix[0] * x + matrix[4] * y + matrix[8] * z102 + matrix[12];
1733
+ out[13] = matrix[1] * x + matrix[5] * y + matrix[9] * z102 + matrix[13];
1734
+ out[14] = matrix[2] * x + matrix[6] * y + matrix[10] * z102 + matrix[14];
1735
+ out[15] = matrix[3] * x + matrix[7] * y + matrix[11] * z102 + matrix[15];
1736
1736
  } else {
1737
1737
  a00 = matrix[0];
1738
1738
  a01 = matrix[1];
@@ -1758,10 +1758,10 @@ var require_translate = __commonJS({
1758
1758
  out[9] = a21;
1759
1759
  out[10] = a22;
1760
1760
  out[11] = a23;
1761
- out[12] = a00 * x + a10 * y + a20 * z98 + matrix[12];
1762
- out[13] = a01 * x + a11 * y + a21 * z98 + matrix[13];
1763
- out[14] = a02 * x + a12 * y + a22 * z98 + matrix[14];
1764
- out[15] = a03 * x + a13 * y + a23 * z98 + matrix[15];
1761
+ out[12] = a00 * x + a10 * y + a20 * z102 + matrix[12];
1762
+ out[13] = a01 * x + a11 * y + a21 * z102 + matrix[13];
1763
+ out[14] = a02 * x + a12 * y + a22 * z102 + matrix[14];
1764
+ out[15] = a03 * x + a13 * y + a23 * z102 + matrix[15];
1765
1765
  }
1766
1766
  return out;
1767
1767
  };
@@ -3831,11 +3831,11 @@ var require_fromValues4 = __commonJS({
3831
3831
  "node_modules/@jscad/modeling/src/maths/vec4/fromValues.js"(exports, module) {
3832
3832
  "use strict";
3833
3833
  var create = require_create7();
3834
- var fromValues = (x, y, z98, w) => {
3834
+ var fromValues = (x, y, z102, w) => {
3835
3835
  const out = create();
3836
3836
  out[0] = x;
3837
3837
  out[1] = y;
3838
- out[2] = z98;
3838
+ out[2] = z102;
3839
3839
  out[3] = w;
3840
3840
  return out;
3841
3841
  };
@@ -3993,8 +3993,8 @@ var require_projectionOfPoint = __commonJS({
3993
3993
  const a = point2[0] * plane[0] + point2[1] * plane[1] + point2[2] * plane[2] - plane[3];
3994
3994
  const x = point2[0] - a * plane[0];
3995
3995
  const y = point2[1] - a * plane[1];
3996
- const z98 = point2[2] - a * plane[2];
3997
- return vec3.fromValues(x, y, z98);
3996
+ const z102 = point2[2] - a * plane[2];
3997
+ return vec3.fromValues(x, y, z102);
3998
3998
  };
3999
3999
  module.exports = projectionOfPoint;
4000
4000
  }
@@ -4298,11 +4298,11 @@ var require_transform5 = __commonJS({
4298
4298
  "node_modules/@jscad/modeling/src/maths/vec4/transform.js"(exports, module) {
4299
4299
  "use strict";
4300
4300
  var transform2 = (out, vector, matrix) => {
4301
- const [x, y, z98, w] = vector;
4302
- out[0] = matrix[0] * x + matrix[4] * y + matrix[8] * z98 + matrix[12] * w;
4303
- out[1] = matrix[1] * x + matrix[5] * y + matrix[9] * z98 + matrix[13] * w;
4304
- out[2] = matrix[2] * x + matrix[6] * y + matrix[10] * z98 + matrix[14] * w;
4305
- out[3] = matrix[3] * x + matrix[7] * y + matrix[11] * z98 + matrix[15] * w;
4301
+ const [x, y, z102, w] = vector;
4302
+ out[0] = matrix[0] * x + matrix[4] * y + matrix[8] * z102 + matrix[12] * w;
4303
+ out[1] = matrix[1] * x + matrix[5] * y + matrix[9] * z102 + matrix[13] * w;
4304
+ out[2] = matrix[2] * x + matrix[6] * y + matrix[10] * z102 + matrix[14] * w;
4305
+ out[3] = matrix[3] * x + matrix[7] * y + matrix[11] * z102 + matrix[15] * w;
4306
4306
  return out;
4307
4307
  };
4308
4308
  module.exports = transform2;
@@ -4364,8 +4364,8 @@ var require_measureBoundingSphere = __commonJS({
4364
4364
  out[2] = (minz[2] + maxz[2]) * 0.5;
4365
4365
  const x = out[0] - maxx[0];
4366
4366
  const y = out[1] - maxy[1];
4367
- const z98 = out[2] - maxz[2];
4368
- out[3] = Math.sqrt(x * x + y * y + z98 * z98);
4367
+ const z102 = out[2] - maxz[2];
4368
+ out[3] = Math.sqrt(x * x + y * y + z102 * z102);
4369
4369
  cache.set(polygon2, out);
4370
4370
  return out;
4371
4371
  };
@@ -14572,7 +14572,7 @@ var import_jscad_planner = __toESM(require_dist(), 1);
14572
14572
  var import_modeling2 = __toESM(require_src(), 1);
14573
14573
 
14574
14574
  // node_modules/@tscircuit/footprinter/dist/index.js
14575
- import { z as z96 } from "zod";
14575
+ import { z as z101 } from "zod";
14576
14576
 
14577
14577
  // node_modules/@tscircuit/mm/dist/index.js
14578
14578
  var unitToMm = {
@@ -14616,7 +14616,7 @@ import { z as z12 } from "zod";
14616
14616
  import { z as z13 } from "zod";
14617
14617
  import { z as z14 } from "zod";
14618
14618
  import { z as z15 } from "zod";
14619
- import { z as z32 } from "zod";
14619
+ import { z as z35 } from "zod";
14620
14620
  import { z as z16 } from "zod";
14621
14621
  import { z as z17 } from "zod";
14622
14622
  import { z as z18 } from "zod";
@@ -14633,23 +14633,23 @@ import { z as z28 } from "zod";
14633
14633
  import { z as z29 } from "zod";
14634
14634
  import { z as z30 } from "zod";
14635
14635
  import { z as z31 } from "zod";
14636
+ import { z as z32 } from "zod";
14636
14637
  import { z as z33 } from "zod";
14637
14638
  import { z as z34 } from "zod";
14638
- import { z as z35 } from "zod";
14639
14639
  import { z as z36 } from "zod";
14640
14640
  import { z as z37 } from "zod";
14641
14641
  import { z as z38 } from "zod";
14642
14642
  import { z as z39 } from "zod";
14643
14643
  import { z as z40 } from "zod";
14644
- import { z as z41 } from "zod";
14645
14644
  import { z as z42 } from "zod";
14646
- import { z as z44 } from "zod";
14645
+ import { z as z41 } from "zod";
14647
14646
  import { z as z43 } from "zod";
14647
+ import { z as z44 } from "zod";
14648
14648
  import { z as z45 } from "zod";
14649
14649
  import { z as z46 } from "zod";
14650
14650
  import { z as z47 } from "zod";
14651
- import { z as z48 } from "zod";
14652
14651
  import { z as z49 } from "zod";
14652
+ import { z as z48 } from "zod";
14653
14653
  import { z as z50 } from "zod";
14654
14654
  import { z as z51 } from "zod";
14655
14655
  import { z as z52 } from "zod";
@@ -14696,6 +14696,11 @@ import { z as z92 } from "zod";
14696
14696
  import { z as z93 } from "zod";
14697
14697
  import { z as z94 } from "zod";
14698
14698
  import { z as z95 } from "zod";
14699
+ import { z as z96 } from "zod";
14700
+ import { z as z97 } from "zod";
14701
+ import { z as z98 } from "zod";
14702
+ import { z as z99 } from "zod";
14703
+ import { z as z100 } from "zod";
14699
14704
  var unitMappings = {
14700
14705
  Hz: {
14701
14706
  baseUnit: "Hz",
@@ -15078,93 +15083,123 @@ var source_simple_pin_header = source_component_base.extend({
15078
15083
  gender: z22.enum(["male", "female"]).optional().default("male")
15079
15084
  });
15080
15085
  expectTypesMatch(true);
15086
+ var source_simple_pinout = source_component_base.extend({
15087
+ ftype: z23.literal("simple_pinout")
15088
+ });
15089
+ expectTypesMatch(true);
15081
15090
  var source_simple_resonator = source_component_base.extend({
15082
- ftype: z23.literal("simple_resonator"),
15091
+ ftype: z24.literal("simple_resonator"),
15083
15092
  load_capacitance: capacitance,
15084
15093
  equivalent_series_resistance: resistance.optional(),
15085
15094
  frequency
15086
15095
  });
15087
15096
  expectTypesMatch(true);
15088
15097
  var source_simple_transistor = source_component_base.extend({
15089
- ftype: z24.literal("simple_transistor"),
15090
- transistor_type: z24.enum(["npn", "pnp"])
15098
+ ftype: z25.literal("simple_transistor"),
15099
+ transistor_type: z25.enum(["npn", "pnp"])
15091
15100
  });
15092
15101
  expectTypesMatch(true);
15093
15102
  var source_simple_test_point = source_component_base.extend({
15094
- ftype: z25.literal("simple_test_point"),
15095
- footprint_variant: z25.enum(["pad", "through_hole"]).optional(),
15096
- pad_shape: z25.enum(["rect", "circle"]).optional(),
15097
- pad_diameter: z25.union([z25.number(), z25.string()]).optional(),
15098
- hole_diameter: z25.union([z25.number(), z25.string()]).optional(),
15099
- width: z25.union([z25.number(), z25.string()]).optional(),
15100
- height: z25.union([z25.number(), z25.string()]).optional()
15103
+ ftype: z26.literal("simple_test_point"),
15104
+ footprint_variant: z26.enum(["pad", "through_hole"]).optional(),
15105
+ pad_shape: z26.enum(["rect", "circle"]).optional(),
15106
+ pad_diameter: z26.union([z26.number(), z26.string()]).optional(),
15107
+ hole_diameter: z26.union([z26.number(), z26.string()]).optional(),
15108
+ width: z26.union([z26.number(), z26.string()]).optional(),
15109
+ height: z26.union([z26.number(), z26.string()]).optional()
15101
15110
  });
15102
15111
  expectTypesMatch(true);
15103
15112
  var source_simple_mosfet = source_component_base.extend({
15104
- ftype: z26.literal("simple_mosfet"),
15105
- channel_type: z26.enum(["n", "p"]),
15106
- mosfet_mode: z26.enum(["enhancement", "depletion"])
15113
+ ftype: z27.literal("simple_mosfet"),
15114
+ channel_type: z27.enum(["n", "p"]),
15115
+ mosfet_mode: z27.enum(["enhancement", "depletion"])
15107
15116
  });
15108
15117
  expectTypesMatch(true);
15109
15118
  var source_simple_switch = source_component_base.extend({
15110
- ftype: z27.literal("simple_switch")
15119
+ ftype: z28.literal("simple_switch")
15111
15120
  });
15112
15121
  expectTypesMatch(true);
15113
- var source_project_metadata = z28.object({
15114
- type: z28.literal("source_project_metadata"),
15115
- name: z28.string().optional(),
15116
- software_used_string: z28.string().optional(),
15117
- project_url: z28.string().optional(),
15118
- created_at: z28.string().datetime().optional()
15122
+ var source_project_metadata = z29.object({
15123
+ type: z29.literal("source_project_metadata"),
15124
+ name: z29.string().optional(),
15125
+ software_used_string: z29.string().optional(),
15126
+ project_url: z29.string().optional(),
15127
+ created_at: z29.string().datetime().optional()
15119
15128
  });
15120
15129
  expectTypesMatch(true);
15121
- var source_missing_property_error = z29.object({
15122
- type: z29.literal("source_missing_property_error"),
15130
+ var source_missing_property_error = z30.object({
15131
+ type: z30.literal("source_missing_property_error"),
15123
15132
  source_missing_property_error_id: getZodPrefixedIdWithDefault(
15124
15133
  "source_missing_property_error"
15125
15134
  ),
15126
- source_component_id: z29.string(),
15127
- property_name: z29.string(),
15128
- subcircuit_id: z29.string().optional(),
15129
- error_type: z29.literal("source_missing_property_error").default("source_missing_property_error"),
15130
- message: z29.string()
15135
+ source_component_id: z30.string(),
15136
+ property_name: z30.string(),
15137
+ subcircuit_id: z30.string().optional(),
15138
+ error_type: z30.literal("source_missing_property_error").default("source_missing_property_error"),
15139
+ message: z30.string()
15131
15140
  }).describe("The source code is missing a property");
15132
15141
  expectTypesMatch(true);
15133
- var source_failed_to_create_component_error = z30.object({
15134
- type: z30.literal("source_failed_to_create_component_error"),
15142
+ var source_failed_to_create_component_error = z31.object({
15143
+ type: z31.literal("source_failed_to_create_component_error"),
15135
15144
  source_failed_to_create_component_error_id: getZodPrefixedIdWithDefault(
15136
15145
  "source_failed_to_create_component_error"
15137
15146
  ),
15138
- error_type: z30.literal("source_failed_to_create_component_error").default("source_failed_to_create_component_error"),
15139
- component_name: z30.string().optional(),
15140
- subcircuit_id: z30.string().optional(),
15141
- parent_source_component_id: z30.string().optional(),
15142
- message: z30.string(),
15143
- pcb_center: z30.object({
15144
- x: z30.number().optional(),
15145
- y: z30.number().optional()
15147
+ error_type: z31.literal("source_failed_to_create_component_error").default("source_failed_to_create_component_error"),
15148
+ component_name: z31.string().optional(),
15149
+ subcircuit_id: z31.string().optional(),
15150
+ parent_source_component_id: z31.string().optional(),
15151
+ message: z31.string(),
15152
+ pcb_center: z31.object({
15153
+ x: z31.number().optional(),
15154
+ y: z31.number().optional()
15146
15155
  }).optional(),
15147
- schematic_center: z30.object({
15148
- x: z30.number().optional(),
15149
- y: z30.number().optional()
15156
+ schematic_center: z31.object({
15157
+ x: z31.number().optional(),
15158
+ y: z31.number().optional()
15150
15159
  }).optional()
15151
15160
  }).describe("Error emitted when a component fails to be constructed");
15152
15161
  expectTypesMatch(true);
15153
- var source_trace_not_connected_error = z31.object({
15154
- type: z31.literal("source_trace_not_connected_error"),
15162
+ var source_trace_not_connected_error = z32.object({
15163
+ type: z32.literal("source_trace_not_connected_error"),
15155
15164
  source_trace_not_connected_error_id: getZodPrefixedIdWithDefault(
15156
15165
  "source_trace_not_connected_error"
15157
15166
  ),
15158
- error_type: z31.literal("source_trace_not_connected_error").default("source_trace_not_connected_error"),
15159
- message: z31.string(),
15160
- subcircuit_id: z31.string().optional(),
15161
- source_group_id: z31.string().optional(),
15162
- source_trace_id: z31.string().optional(),
15163
- connected_source_port_ids: z31.array(z31.string()).optional(),
15164
- selectors_not_found: z31.array(z31.string()).optional()
15167
+ error_type: z32.literal("source_trace_not_connected_error").default("source_trace_not_connected_error"),
15168
+ message: z32.string(),
15169
+ subcircuit_id: z32.string().optional(),
15170
+ source_group_id: z32.string().optional(),
15171
+ source_trace_id: z32.string().optional(),
15172
+ connected_source_port_ids: z32.array(z32.string()).optional(),
15173
+ selectors_not_found: z32.array(z32.string()).optional()
15165
15174
  }).describe("Occurs when a source trace selector does not match any ports");
15166
15175
  expectTypesMatch(true);
15167
- var any_source_component = z32.union([
15176
+ var source_property_ignored_warning = z33.object({
15177
+ type: z33.literal("source_property_ignored_warning"),
15178
+ source_property_ignored_warning_id: getZodPrefixedIdWithDefault(
15179
+ "source_property_ignored_warning"
15180
+ ),
15181
+ source_component_id: z33.string(),
15182
+ property_name: z33.string(),
15183
+ subcircuit_id: z33.string().optional(),
15184
+ error_type: z33.literal("source_property_ignored_warning").default("source_property_ignored_warning"),
15185
+ message: z33.string()
15186
+ }).describe("The source property was ignored");
15187
+ expectTypesMatch(true);
15188
+ var source_pin_missing_trace_warning = z34.object({
15189
+ type: z34.literal("source_pin_missing_trace_warning"),
15190
+ source_pin_missing_trace_warning_id: getZodPrefixedIdWithDefault(
15191
+ "source_pin_missing_trace_warning"
15192
+ ),
15193
+ warning_type: z34.literal("source_pin_missing_trace_warning").default("source_pin_missing_trace_warning"),
15194
+ message: z34.string(),
15195
+ source_component_id: z34.string(),
15196
+ source_port_id: z34.string(),
15197
+ subcircuit_id: z34.string().optional()
15198
+ }).describe(
15199
+ "Warning emitted when a source component pin is missing a trace connection"
15200
+ );
15201
+ expectTypesMatch(true);
15202
+ var any_source_component = z35.union([
15168
15203
  source_simple_resistor,
15169
15204
  source_simple_capacitor,
15170
15205
  source_simple_diode,
@@ -15178,6 +15213,7 @@ var any_source_component = z32.union([
15178
15213
  source_simple_potentiometer,
15179
15214
  source_simple_crystal,
15180
15215
  source_simple_pin_header,
15216
+ source_simple_pinout,
15181
15217
  source_simple_resonator,
15182
15218
  source_simple_switch,
15183
15219
  source_simple_transistor,
@@ -15187,182 +15223,222 @@ var any_source_component = z32.union([
15187
15223
  source_project_metadata,
15188
15224
  source_missing_property_error,
15189
15225
  source_failed_to_create_component_error,
15190
- source_trace_not_connected_error
15226
+ source_trace_not_connected_error,
15227
+ source_property_ignored_warning,
15228
+ source_pin_missing_trace_warning
15191
15229
  ]);
15192
15230
  expectTypesMatch(true);
15193
- var source_port = z33.object({
15194
- type: z33.literal("source_port"),
15195
- pin_number: z33.number().optional(),
15196
- port_hints: z33.array(z33.string()).optional(),
15197
- name: z33.string(),
15198
- source_port_id: z33.string(),
15199
- source_component_id: z33.string(),
15200
- subcircuit_id: z33.string().optional(),
15201
- subcircuit_connectivity_map_key: z33.string().optional()
15231
+ var source_port = z36.object({
15232
+ type: z36.literal("source_port"),
15233
+ pin_number: z36.number().optional(),
15234
+ port_hints: z36.array(z36.string()).optional(),
15235
+ name: z36.string(),
15236
+ source_port_id: z36.string(),
15237
+ source_component_id: z36.string(),
15238
+ subcircuit_id: z36.string().optional(),
15239
+ subcircuit_connectivity_map_key: z36.string().optional()
15202
15240
  });
15203
15241
  expectTypesMatch(true);
15204
- var source_trace = z34.object({
15205
- type: z34.literal("source_trace"),
15206
- source_trace_id: z34.string(),
15207
- connected_source_port_ids: z34.array(z34.string()),
15208
- connected_source_net_ids: z34.array(z34.string()),
15209
- subcircuit_id: z34.string().optional(),
15210
- subcircuit_connectivity_map_key: z34.string().optional(),
15211
- max_length: z34.number().optional(),
15212
- min_trace_thickness: z34.number().optional(),
15213
- display_name: z34.string().optional()
15242
+ var source_trace = z37.object({
15243
+ type: z37.literal("source_trace"),
15244
+ source_trace_id: z37.string(),
15245
+ connected_source_port_ids: z37.array(z37.string()),
15246
+ connected_source_net_ids: z37.array(z37.string()),
15247
+ subcircuit_id: z37.string().optional(),
15248
+ subcircuit_connectivity_map_key: z37.string().optional(),
15249
+ max_length: z37.number().optional(),
15250
+ min_trace_thickness: z37.number().optional(),
15251
+ display_name: z37.string().optional()
15214
15252
  });
15215
15253
  expectTypesMatch(true);
15216
- var source_group = z35.object({
15217
- type: z35.literal("source_group"),
15218
- source_group_id: z35.string(),
15219
- subcircuit_id: z35.string().optional(),
15220
- parent_subcircuit_id: z35.string().optional(),
15221
- parent_source_group_id: z35.string().optional(),
15222
- is_subcircuit: z35.boolean().optional(),
15223
- name: z35.string().optional()
15254
+ var source_group = z38.object({
15255
+ type: z38.literal("source_group"),
15256
+ source_group_id: z38.string(),
15257
+ subcircuit_id: z38.string().optional(),
15258
+ parent_subcircuit_id: z38.string().optional(),
15259
+ parent_source_group_id: z38.string().optional(),
15260
+ is_subcircuit: z38.boolean().optional(),
15261
+ name: z38.string().optional()
15224
15262
  });
15225
15263
  expectTypesMatch(true);
15226
- var source_net = z36.object({
15227
- type: z36.literal("source_net"),
15228
- source_net_id: z36.string(),
15229
- name: z36.string(),
15230
- member_source_group_ids: z36.array(z36.string()),
15231
- is_power: z36.boolean().optional(),
15232
- is_ground: z36.boolean().optional(),
15233
- is_digital_signal: z36.boolean().optional(),
15234
- is_analog_signal: z36.boolean().optional(),
15235
- trace_width: z36.number().optional(),
15236
- subcircuit_id: z36.string().optional(),
15237
- subcircuit_connectivity_map_key: z36.string().optional()
15264
+ var source_net = z39.object({
15265
+ type: z39.literal("source_net"),
15266
+ source_net_id: z39.string(),
15267
+ name: z39.string(),
15268
+ member_source_group_ids: z39.array(z39.string()),
15269
+ is_power: z39.boolean().optional(),
15270
+ is_ground: z39.boolean().optional(),
15271
+ is_digital_signal: z39.boolean().optional(),
15272
+ is_analog_signal: z39.boolean().optional(),
15273
+ is_positive_voltage_source: z39.boolean().optional(),
15274
+ trace_width: z39.number().optional(),
15275
+ subcircuit_id: z39.string().optional(),
15276
+ subcircuit_connectivity_map_key: z39.string().optional()
15238
15277
  });
15239
15278
  expectTypesMatch(true);
15240
- var source_pcb_ground_plane = z37.object({
15241
- type: z37.literal("source_pcb_ground_plane"),
15242
- source_pcb_ground_plane_id: z37.string(),
15243
- source_group_id: z37.string(),
15244
- source_net_id: z37.string(),
15245
- subcircuit_id: z37.string().optional()
15279
+ var source_pcb_ground_plane = z40.object({
15280
+ type: z40.literal("source_pcb_ground_plane"),
15281
+ source_pcb_ground_plane_id: z40.string(),
15282
+ source_group_id: z40.string(),
15283
+ source_net_id: z40.string(),
15284
+ subcircuit_id: z40.string().optional()
15246
15285
  }).describe("Defines a ground plane in the source domain");
15247
15286
  expectTypesMatch(true);
15248
- var schematic_box = z38.object({
15249
- type: z38.literal("schematic_box"),
15250
- schematic_component_id: z38.string().optional(),
15287
+ var all_layers = [
15288
+ "top",
15289
+ "bottom",
15290
+ "inner1",
15291
+ "inner2",
15292
+ "inner3",
15293
+ "inner4",
15294
+ "inner5",
15295
+ "inner6"
15296
+ ];
15297
+ var layer_string = z41.enum(all_layers);
15298
+ var layer_ref = layer_string.or(
15299
+ z41.object({
15300
+ name: layer_string
15301
+ })
15302
+ ).transform((layer) => {
15303
+ if (typeof layer === "string") {
15304
+ return layer;
15305
+ }
15306
+ return layer.name;
15307
+ });
15308
+ expectTypesMatch(true);
15309
+ var visible_layer = z41.enum(["top", "bottom"]);
15310
+ var source_manually_placed_via = z42.object({
15311
+ type: z42.literal("source_manually_placed_via"),
15312
+ source_manually_placed_via_id: z42.string(),
15313
+ source_group_id: z42.string(),
15314
+ source_net_id: z42.string(),
15315
+ x: distance,
15316
+ y: distance,
15317
+ layers: z42.array(layer_ref),
15318
+ subcircuit_id: z42.string().optional(),
15319
+ source_trace_id: z42.string().optional()
15320
+ }).describe("Defines a via that is manually placed in the source domain");
15321
+ expectTypesMatch(true);
15322
+ var schematic_box = z43.object({
15323
+ type: z43.literal("schematic_box"),
15324
+ schematic_component_id: z43.string().optional(),
15251
15325
  width: distance,
15252
15326
  height: distance,
15253
- is_dashed: z38.boolean().default(false),
15327
+ is_dashed: z43.boolean().default(false),
15254
15328
  x: distance,
15255
15329
  y: distance,
15256
- subcircuit_id: z38.string().optional()
15330
+ subcircuit_id: z43.string().optional()
15257
15331
  }).describe("Draws a box on the schematic");
15258
15332
  expectTypesMatch(true);
15259
- var schematic_path = z39.object({
15260
- type: z39.literal("schematic_path"),
15261
- schematic_component_id: z39.string(),
15262
- fill_color: z39.enum(["red", "blue"]).optional(),
15263
- is_filled: z39.boolean().optional(),
15264
- points: z39.array(point),
15265
- subcircuit_id: z39.string().optional()
15333
+ var schematic_path = z44.object({
15334
+ type: z44.literal("schematic_path"),
15335
+ schematic_component_id: z44.string(),
15336
+ fill_color: z44.enum(["red", "blue"]).optional(),
15337
+ is_filled: z44.boolean().optional(),
15338
+ points: z44.array(point),
15339
+ subcircuit_id: z44.string().optional()
15266
15340
  });
15267
15341
  expectTypesMatch(true);
15268
- var schematic_pin_styles = z40.record(
15269
- z40.object({
15342
+ var schematic_pin_styles = z45.record(
15343
+ z45.object({
15270
15344
  left_margin: length.optional(),
15271
15345
  right_margin: length.optional(),
15272
15346
  top_margin: length.optional(),
15273
15347
  bottom_margin: length.optional()
15274
15348
  })
15275
15349
  );
15276
- var schematic_component_port_arrangement_by_size = z40.object({
15277
- left_size: z40.number(),
15278
- right_size: z40.number(),
15279
- top_size: z40.number().optional(),
15280
- bottom_size: z40.number().optional()
15350
+ var schematic_component_port_arrangement_by_size = z45.object({
15351
+ left_size: z45.number(),
15352
+ right_size: z45.number(),
15353
+ top_size: z45.number().optional(),
15354
+ bottom_size: z45.number().optional()
15281
15355
  });
15282
15356
  expectTypesMatch(true);
15283
- var schematic_component_port_arrangement_by_sides = z40.object({
15284
- left_side: z40.object({
15285
- pins: z40.array(z40.number()),
15357
+ var schematic_component_port_arrangement_by_sides = z45.object({
15358
+ left_side: z45.object({
15359
+ pins: z45.array(z45.number()),
15286
15360
  // @ts-ignore
15287
- direction: z40.enum(["top-to-bottom", "bottom-to-top"]).optional()
15361
+ direction: z45.enum(["top-to-bottom", "bottom-to-top"]).optional()
15288
15362
  }).optional(),
15289
- right_side: z40.object({
15290
- pins: z40.array(z40.number()),
15363
+ right_side: z45.object({
15364
+ pins: z45.array(z45.number()),
15291
15365
  // @ts-ignore
15292
- direction: z40.enum(["top-to-bottom", "bottom-to-top"]).optional()
15366
+ direction: z45.enum(["top-to-bottom", "bottom-to-top"]).optional()
15293
15367
  }).optional(),
15294
- top_side: z40.object({
15295
- pins: z40.array(z40.number()),
15368
+ top_side: z45.object({
15369
+ pins: z45.array(z45.number()),
15296
15370
  // @ts-ignore
15297
- direction: z40.enum(["left-to-right", "right-to-left"]).optional()
15371
+ direction: z45.enum(["left-to-right", "right-to-left"]).optional()
15298
15372
  }).optional(),
15299
- bottom_side: z40.object({
15300
- pins: z40.array(z40.number()),
15373
+ bottom_side: z45.object({
15374
+ pins: z45.array(z45.number()),
15301
15375
  // @ts-ignore
15302
- direction: z40.enum(["left-to-right", "right-to-left"]).optional()
15376
+ direction: z45.enum(["left-to-right", "right-to-left"]).optional()
15303
15377
  }).optional()
15304
15378
  });
15305
15379
  expectTypesMatch(true);
15306
- var port_arrangement = z40.union([
15380
+ var port_arrangement = z45.union([
15307
15381
  schematic_component_port_arrangement_by_size,
15308
15382
  schematic_component_port_arrangement_by_sides
15309
15383
  ]);
15310
- var schematic_component = z40.object({
15311
- type: z40.literal("schematic_component"),
15384
+ var schematic_component = z45.object({
15385
+ type: z45.literal("schematic_component"),
15312
15386
  size,
15313
15387
  center: point,
15314
- source_component_id: z40.string(),
15315
- schematic_component_id: z40.string(),
15388
+ source_component_id: z45.string(),
15389
+ schematic_component_id: z45.string(),
15316
15390
  pin_spacing: length.optional(),
15317
15391
  pin_styles: schematic_pin_styles.optional(),
15318
15392
  box_width: length.optional(),
15319
- symbol_name: z40.string().optional(),
15393
+ symbol_name: z45.string().optional(),
15320
15394
  port_arrangement: port_arrangement.optional(),
15321
- port_labels: z40.record(z40.string()).optional(),
15322
- symbol_display_value: z40.string().optional(),
15323
- subcircuit_id: z40.string().optional(),
15324
- schematic_group_id: z40.string().optional()
15395
+ port_labels: z45.record(z45.string()).optional(),
15396
+ symbol_display_value: z45.string().optional(),
15397
+ subcircuit_id: z45.string().optional(),
15398
+ schematic_group_id: z45.string().optional()
15325
15399
  });
15326
15400
  expectTypesMatch(true);
15327
- var schematic_line = z41.object({
15328
- type: z41.literal("schematic_line"),
15329
- schematic_component_id: z41.string(),
15401
+ var schematic_line = z46.object({
15402
+ type: z46.literal("schematic_line"),
15403
+ schematic_component_id: z46.string(),
15330
15404
  x1: distance,
15331
15405
  x2: distance,
15332
15406
  y1: distance,
15333
15407
  y2: distance,
15334
- subcircuit_id: z41.string().optional()
15408
+ subcircuit_id: z46.string().optional()
15335
15409
  });
15336
15410
  expectTypesMatch(true);
15337
- var schematic_trace = z42.object({
15338
- type: z42.literal("schematic_trace"),
15339
- schematic_trace_id: z42.string(),
15340
- source_trace_id: z42.string(),
15341
- junctions: z42.array(
15342
- z42.object({
15343
- x: z42.number(),
15344
- y: z42.number()
15411
+ var schematic_trace = z47.object({
15412
+ type: z47.literal("schematic_trace"),
15413
+ schematic_trace_id: z47.string(),
15414
+ source_trace_id: z47.string().optional(),
15415
+ junctions: z47.array(
15416
+ z47.object({
15417
+ x: z47.number(),
15418
+ y: z47.number()
15345
15419
  })
15346
15420
  ),
15347
- edges: z42.array(
15348
- z42.object({
15349
- from: z42.object({
15350
- x: z42.number(),
15351
- y: z42.number()
15421
+ edges: z47.array(
15422
+ z47.object({
15423
+ from: z47.object({
15424
+ x: z47.number(),
15425
+ y: z47.number()
15352
15426
  }),
15353
- to: z42.object({
15354
- x: z42.number(),
15355
- y: z42.number()
15427
+ to: z47.object({
15428
+ x: z47.number(),
15429
+ y: z47.number()
15356
15430
  }),
15357
- is_crossing: z42.boolean().optional(),
15358
- from_schematic_port_id: z42.string().optional(),
15359
- to_schematic_port_id: z42.string().optional()
15431
+ is_crossing: z47.boolean().optional(),
15432
+ from_schematic_port_id: z47.string().optional(),
15433
+ to_schematic_port_id: z47.string().optional()
15360
15434
  })
15361
15435
  ),
15362
- subcircuit_id: z42.string().optional()
15436
+ subcircuit_id: z47.string().optional(),
15437
+ // TODO: make required in a future release
15438
+ subcircuit_connectivity_map_key: z47.string().optional()
15363
15439
  });
15364
15440
  expectTypesMatch(true);
15365
- var fivePointAnchor = z43.enum([
15441
+ var fivePointAnchor = z48.enum([
15366
15442
  "center",
15367
15443
  "left",
15368
15444
  "right",
@@ -15370,230 +15446,209 @@ var fivePointAnchor = z43.enum([
15370
15446
  "bottom"
15371
15447
  ]);
15372
15448
  expectTypesMatch(true);
15373
- var schematic_text = z44.object({
15374
- type: z44.literal("schematic_text"),
15375
- schematic_component_id: z44.string().optional(),
15376
- schematic_text_id: z44.string(),
15377
- text: z44.string(),
15378
- font_size: z44.number().default(0.18),
15379
- position: z44.object({
15449
+ var schematic_text = z49.object({
15450
+ type: z49.literal("schematic_text"),
15451
+ schematic_component_id: z49.string().optional(),
15452
+ schematic_text_id: z49.string(),
15453
+ text: z49.string(),
15454
+ font_size: z49.number().default(0.18),
15455
+ position: z49.object({
15380
15456
  x: distance,
15381
15457
  y: distance
15382
15458
  }),
15383
- rotation: z44.number().default(0),
15384
- anchor: z44.union([fivePointAnchor.describe("legacy"), ninePointAnchor]).default("center"),
15385
- color: z44.string().default("#000000"),
15386
- subcircuit_id: z44.string().optional()
15459
+ rotation: z49.number().default(0),
15460
+ anchor: z49.union([fivePointAnchor.describe("legacy"), ninePointAnchor]).default("center"),
15461
+ color: z49.string().default("#000000"),
15462
+ subcircuit_id: z49.string().optional()
15387
15463
  });
15388
15464
  expectTypesMatch(true);
15389
- var schematic_port = z45.object({
15390
- type: z45.literal("schematic_port"),
15391
- schematic_port_id: z45.string(),
15392
- source_port_id: z45.string(),
15393
- schematic_component_id: z45.string().optional(),
15465
+ var schematic_port = z50.object({
15466
+ type: z50.literal("schematic_port"),
15467
+ schematic_port_id: z50.string(),
15468
+ source_port_id: z50.string(),
15469
+ schematic_component_id: z50.string().optional(),
15394
15470
  center: point,
15395
- facing_direction: z45.enum(["up", "down", "left", "right"]).optional(),
15396
- distance_from_component_edge: z45.number().optional(),
15397
- side_of_component: z45.enum(["top", "bottom", "left", "right"]).optional(),
15398
- true_ccw_index: z45.number().optional(),
15399
- pin_number: z45.number().optional(),
15400
- display_pin_label: z45.string().optional(),
15401
- subcircuit_id: z45.string().optional(),
15402
- is_connected: z45.boolean().optional()
15471
+ facing_direction: z50.enum(["up", "down", "left", "right"]).optional(),
15472
+ distance_from_component_edge: z50.number().optional(),
15473
+ side_of_component: z50.enum(["top", "bottom", "left", "right"]).optional(),
15474
+ true_ccw_index: z50.number().optional(),
15475
+ pin_number: z50.number().optional(),
15476
+ display_pin_label: z50.string().optional(),
15477
+ subcircuit_id: z50.string().optional(),
15478
+ is_connected: z50.boolean().optional(),
15479
+ has_input_arrow: z50.boolean().optional(),
15480
+ has_output_arrow: z50.boolean().optional()
15403
15481
  }).describe("Defines a port on a schematic component");
15404
15482
  expectTypesMatch(true);
15405
- var schematic_net_label = z46.object({
15406
- type: z46.literal("schematic_net_label"),
15483
+ var schematic_net_label = z51.object({
15484
+ type: z51.literal("schematic_net_label"),
15407
15485
  schematic_net_label_id: getZodPrefixedIdWithDefault("schematic_net_label"),
15408
- schematic_trace_id: z46.string().optional(),
15409
- source_trace_id: z46.string().optional(),
15410
- source_net_id: z46.string(),
15486
+ schematic_trace_id: z51.string().optional(),
15487
+ source_trace_id: z51.string().optional(),
15488
+ source_net_id: z51.string(),
15411
15489
  center: point,
15412
15490
  anchor_position: point.optional(),
15413
- anchor_side: z46.enum(["top", "bottom", "left", "right"]),
15414
- text: z46.string(),
15415
- symbol_name: z46.string().optional(),
15416
- is_movable: z46.boolean().optional(),
15417
- subcircuit_id: z46.string().optional()
15491
+ anchor_side: z51.enum(["top", "bottom", "left", "right"]),
15492
+ text: z51.string(),
15493
+ symbol_name: z51.string().optional(),
15494
+ is_movable: z51.boolean().optional(),
15495
+ subcircuit_id: z51.string().optional()
15418
15496
  });
15419
15497
  expectTypesMatch(true);
15420
- var schematic_error = z47.object({
15421
- type: z47.literal("schematic_error"),
15422
- schematic_error_id: z47.string(),
15498
+ var schematic_error = z52.object({
15499
+ type: z52.literal("schematic_error"),
15500
+ schematic_error_id: z52.string(),
15423
15501
  // eventually each error type should be broken out into a dir of files
15424
- error_type: z47.literal("schematic_port_not_found").default("schematic_port_not_found"),
15425
- message: z47.string(),
15426
- subcircuit_id: z47.string().optional()
15502
+ error_type: z52.literal("schematic_port_not_found").default("schematic_port_not_found"),
15503
+ message: z52.string(),
15504
+ subcircuit_id: z52.string().optional()
15427
15505
  }).describe("Defines a schematic error on the schematic");
15428
15506
  expectTypesMatch(true);
15429
- var schematic_layout_error = z48.object({
15430
- type: z48.literal("schematic_layout_error"),
15507
+ var schematic_layout_error = z53.object({
15508
+ type: z53.literal("schematic_layout_error"),
15431
15509
  schematic_layout_error_id: getZodPrefixedIdWithDefault(
15432
15510
  "schematic_layout_error"
15433
15511
  ),
15434
- error_type: z48.literal("schematic_layout_error").default("schematic_layout_error"),
15435
- message: z48.string(),
15436
- source_group_id: z48.string(),
15437
- schematic_group_id: z48.string(),
15438
- subcircuit_id: z48.string().optional()
15512
+ error_type: z53.literal("schematic_layout_error").default("schematic_layout_error"),
15513
+ message: z53.string(),
15514
+ source_group_id: z53.string(),
15515
+ schematic_group_id: z53.string(),
15516
+ subcircuit_id: z53.string().optional()
15439
15517
  }).describe("Error emitted when schematic layout fails for a group");
15440
15518
  expectTypesMatch(true);
15441
- var schematic_debug_object_base = z49.object({
15442
- type: z49.literal("schematic_debug_object"),
15443
- label: z49.string().optional(),
15444
- subcircuit_id: z49.string().optional()
15519
+ var schematic_debug_object_base = z54.object({
15520
+ type: z54.literal("schematic_debug_object"),
15521
+ label: z54.string().optional(),
15522
+ subcircuit_id: z54.string().optional()
15445
15523
  });
15446
15524
  var schematic_debug_rect = schematic_debug_object_base.extend({
15447
- shape: z49.literal("rect"),
15525
+ shape: z54.literal("rect"),
15448
15526
  center: point,
15449
15527
  size
15450
15528
  });
15451
15529
  var schematic_debug_line = schematic_debug_object_base.extend({
15452
- shape: z49.literal("line"),
15530
+ shape: z54.literal("line"),
15453
15531
  start: point,
15454
15532
  end: point
15455
15533
  });
15456
15534
  var schematic_debug_point = schematic_debug_object_base.extend({
15457
- shape: z49.literal("point"),
15535
+ shape: z54.literal("point"),
15458
15536
  center: point
15459
15537
  });
15460
- var schematic_debug_object = z49.discriminatedUnion("shape", [
15538
+ var schematic_debug_object = z54.discriminatedUnion("shape", [
15461
15539
  schematic_debug_rect,
15462
15540
  schematic_debug_line,
15463
15541
  schematic_debug_point
15464
15542
  ]);
15465
15543
  expectTypesMatch(true);
15466
- var schematic_voltage_probe = z50.object({
15467
- type: z50.literal("schematic_voltage_probe"),
15468
- schematic_voltage_probe_id: z50.string(),
15544
+ var schematic_voltage_probe = z55.object({
15545
+ type: z55.literal("schematic_voltage_probe"),
15546
+ schematic_voltage_probe_id: z55.string(),
15469
15547
  position: point,
15470
- schematic_trace_id: z50.string(),
15548
+ schematic_trace_id: z55.string(),
15471
15549
  voltage: voltage.optional(),
15472
- subcircuit_id: z50.string().optional()
15550
+ subcircuit_id: z55.string().optional()
15473
15551
  }).describe("Defines a voltage probe measurement point on a schematic trace");
15474
15552
  expectTypesMatch(true);
15475
- var schematic_manual_edit_conflict_warning = z51.object({
15476
- type: z51.literal("schematic_manual_edit_conflict_warning"),
15553
+ var schematic_manual_edit_conflict_warning = z56.object({
15554
+ type: z56.literal("schematic_manual_edit_conflict_warning"),
15477
15555
  schematic_manual_edit_conflict_warning_id: getZodPrefixedIdWithDefault(
15478
15556
  "schematic_manual_edit_conflict_warning"
15479
15557
  ),
15480
- warning_type: z51.literal("schematic_manual_edit_conflict_warning").default("schematic_manual_edit_conflict_warning"),
15481
- message: z51.string(),
15482
- schematic_component_id: z51.string(),
15483
- schematic_group_id: z51.string().optional(),
15484
- subcircuit_id: z51.string().optional(),
15485
- source_component_id: z51.string()
15558
+ warning_type: z56.literal("schematic_manual_edit_conflict_warning").default("schematic_manual_edit_conflict_warning"),
15559
+ message: z56.string(),
15560
+ schematic_component_id: z56.string(),
15561
+ schematic_group_id: z56.string().optional(),
15562
+ subcircuit_id: z56.string().optional(),
15563
+ source_component_id: z56.string()
15486
15564
  }).describe(
15487
15565
  "Warning emitted when a component has both manual placement and explicit schX/schY coordinates"
15488
15566
  );
15489
15567
  expectTypesMatch(true);
15490
- var schematic_group = z52.object({
15491
- type: z52.literal("schematic_group"),
15568
+ var schematic_group = z57.object({
15569
+ type: z57.literal("schematic_group"),
15492
15570
  schematic_group_id: getZodPrefixedIdWithDefault("schematic_group"),
15493
- source_group_id: z52.string(),
15494
- is_subcircuit: z52.boolean().optional(),
15495
- subcircuit_id: z52.string().optional(),
15571
+ source_group_id: z57.string(),
15572
+ is_subcircuit: z57.boolean().optional(),
15573
+ subcircuit_id: z57.string().optional(),
15496
15574
  width: length,
15497
15575
  height: length,
15498
15576
  center: point,
15499
- schematic_component_ids: z52.array(z52.string()),
15500
- name: z52.string().optional(),
15501
- description: z52.string().optional()
15577
+ schematic_component_ids: z57.array(z57.string()),
15578
+ name: z57.string().optional(),
15579
+ description: z57.string().optional()
15502
15580
  }).describe("Defines a group of components on the schematic");
15503
15581
  expectTypesMatch(true);
15504
- var schematic_table = z53.object({
15505
- type: z53.literal("schematic_table"),
15582
+ var schematic_table = z58.object({
15583
+ type: z58.literal("schematic_table"),
15506
15584
  schematic_table_id: getZodPrefixedIdWithDefault("schematic_table"),
15507
15585
  anchor_position: point,
15508
- column_widths: z53.array(distance),
15509
- row_heights: z53.array(distance),
15586
+ column_widths: z58.array(distance),
15587
+ row_heights: z58.array(distance),
15510
15588
  cell_padding: distance.optional(),
15511
15589
  border_width: distance.optional(),
15512
- subcircuit_id: z53.string().optional(),
15513
- schematic_component_id: z53.string().optional(),
15590
+ subcircuit_id: z58.string().optional(),
15591
+ schematic_component_id: z58.string().optional(),
15514
15592
  anchor: ninePointAnchor.optional()
15515
15593
  }).describe("Defines a table on the schematic");
15516
15594
  expectTypesMatch(true);
15517
- var schematic_table_cell = z54.object({
15518
- type: z54.literal("schematic_table_cell"),
15595
+ var schematic_table_cell = z59.object({
15596
+ type: z59.literal("schematic_table_cell"),
15519
15597
  schematic_table_cell_id: getZodPrefixedIdWithDefault(
15520
15598
  "schematic_table_cell"
15521
15599
  ),
15522
- schematic_table_id: z54.string(),
15523
- start_row_index: z54.number(),
15524
- end_row_index: z54.number(),
15525
- start_column_index: z54.number(),
15526
- end_column_index: z54.number(),
15527
- text: z54.string().optional(),
15600
+ schematic_table_id: z59.string(),
15601
+ start_row_index: z59.number(),
15602
+ end_row_index: z59.number(),
15603
+ start_column_index: z59.number(),
15604
+ end_column_index: z59.number(),
15605
+ text: z59.string().optional(),
15528
15606
  center: point,
15529
15607
  width: distance,
15530
15608
  height: distance,
15531
- horizontal_align: z54.enum(["left", "center", "right"]).optional(),
15532
- vertical_align: z54.enum(["top", "middle", "bottom"]).optional(),
15609
+ horizontal_align: z59.enum(["left", "center", "right"]).optional(),
15610
+ vertical_align: z59.enum(["top", "middle", "bottom"]).optional(),
15533
15611
  font_size: distance.optional(),
15534
- subcircuit_id: z54.string().optional()
15612
+ subcircuit_id: z59.string().optional()
15535
15613
  }).describe("Defines a cell within a schematic_table");
15536
15614
  expectTypesMatch(true);
15537
- var all_layers = [
15538
- "top",
15539
- "bottom",
15540
- "inner1",
15541
- "inner2",
15542
- "inner3",
15543
- "inner4",
15544
- "inner5",
15545
- "inner6"
15546
- ];
15547
- var layer_string = z55.enum(all_layers);
15548
- var layer_ref = layer_string.or(
15549
- z55.object({
15550
- name: layer_string
15551
- })
15552
- ).transform((layer) => {
15553
- if (typeof layer === "string") {
15554
- return layer;
15555
- }
15556
- return layer.name;
15557
- });
15558
- expectTypesMatch(true);
15559
- var visible_layer = z55.enum(["top", "bottom"]);
15560
- var pcb_route_hint = z56.object({
15615
+ var pcb_route_hint = z60.object({
15561
15616
  x: distance,
15562
15617
  y: distance,
15563
- via: z56.boolean().optional(),
15618
+ via: z60.boolean().optional(),
15564
15619
  via_to_layer: layer_ref.optional()
15565
15620
  });
15566
- var pcb_route_hints = z56.array(pcb_route_hint);
15621
+ var pcb_route_hints = z60.array(pcb_route_hint);
15567
15622
  expectTypesMatch(true);
15568
15623
  expectTypesMatch(true);
15569
- var route_hint_point = z57.object({
15624
+ var route_hint_point = z61.object({
15570
15625
  x: distance,
15571
15626
  y: distance,
15572
- via: z57.boolean().optional(),
15627
+ via: z61.boolean().optional(),
15573
15628
  to_layer: layer_ref.optional(),
15574
15629
  trace_width: distance.optional()
15575
15630
  });
15576
15631
  expectTypesMatch(true);
15577
- var pcb_component = z58.object({
15578
- type: z58.literal("pcb_component"),
15632
+ var pcb_component = z62.object({
15633
+ type: z62.literal("pcb_component"),
15579
15634
  pcb_component_id: getZodPrefixedIdWithDefault("pcb_component"),
15580
- source_component_id: z58.string(),
15635
+ source_component_id: z62.string(),
15581
15636
  center: point,
15582
15637
  layer: layer_ref,
15583
15638
  rotation,
15584
15639
  width: length,
15585
15640
  height: length,
15586
- subcircuit_id: z58.string().optional(),
15587
- pcb_group_id: z58.string().optional()
15641
+ subcircuit_id: z62.string().optional(),
15642
+ pcb_group_id: z62.string().optional()
15588
15643
  }).describe("Defines a component on the PCB");
15589
15644
  expectTypesMatch(true);
15590
- var pcb_hole_circle_or_square = z59.object({
15591
- type: z59.literal("pcb_hole"),
15645
+ var pcb_hole_circle_or_square = z63.object({
15646
+ type: z63.literal("pcb_hole"),
15592
15647
  pcb_hole_id: getZodPrefixedIdWithDefault("pcb_hole"),
15593
- pcb_group_id: z59.string().optional(),
15594
- subcircuit_id: z59.string().optional(),
15595
- hole_shape: z59.enum(["circle", "square"]),
15596
- hole_diameter: z59.number(),
15648
+ pcb_group_id: z63.string().optional(),
15649
+ subcircuit_id: z63.string().optional(),
15650
+ hole_shape: z63.enum(["circle", "square"]),
15651
+ hole_diameter: z63.number(),
15597
15652
  x: distance,
15598
15653
  y: distance
15599
15654
  });
@@ -15601,14 +15656,14 @@ var pcb_hole_circle_or_square_shape = pcb_hole_circle_or_square.describe(
15601
15656
  "Defines a circular or square hole on the PCB"
15602
15657
  );
15603
15658
  expectTypesMatch(true);
15604
- var pcb_hole_oval = z59.object({
15605
- type: z59.literal("pcb_hole"),
15659
+ var pcb_hole_oval = z63.object({
15660
+ type: z63.literal("pcb_hole"),
15606
15661
  pcb_hole_id: getZodPrefixedIdWithDefault("pcb_hole"),
15607
- pcb_group_id: z59.string().optional(),
15608
- subcircuit_id: z59.string().optional(),
15609
- hole_shape: z59.literal("oval"),
15610
- hole_width: z59.number(),
15611
- hole_height: z59.number(),
15662
+ pcb_group_id: z63.string().optional(),
15663
+ subcircuit_id: z63.string().optional(),
15664
+ hole_shape: z63.literal("oval"),
15665
+ hole_width: z63.number(),
15666
+ hole_height: z63.number(),
15612
15667
  x: distance,
15613
15668
  y: distance
15614
15669
  });
@@ -15617,97 +15672,97 @@ var pcb_hole_oval_shape = pcb_hole_oval.describe(
15617
15672
  );
15618
15673
  expectTypesMatch(true);
15619
15674
  var pcb_hole = pcb_hole_circle_or_square.or(pcb_hole_oval);
15620
- var pcb_plated_hole_circle = z60.object({
15621
- type: z60.literal("pcb_plated_hole"),
15622
- shape: z60.literal("circle"),
15623
- pcb_group_id: z60.string().optional(),
15624
- subcircuit_id: z60.string().optional(),
15625
- outer_diameter: z60.number(),
15626
- hole_diameter: z60.number(),
15675
+ var pcb_plated_hole_circle = z64.object({
15676
+ type: z64.literal("pcb_plated_hole"),
15677
+ shape: z64.literal("circle"),
15678
+ pcb_group_id: z64.string().optional(),
15679
+ subcircuit_id: z64.string().optional(),
15680
+ outer_diameter: z64.number(),
15681
+ hole_diameter: z64.number(),
15627
15682
  x: distance,
15628
15683
  y: distance,
15629
- layers: z60.array(layer_ref),
15630
- port_hints: z60.array(z60.string()).optional(),
15631
- pcb_component_id: z60.string().optional(),
15632
- pcb_port_id: z60.string().optional(),
15684
+ layers: z64.array(layer_ref),
15685
+ port_hints: z64.array(z64.string()).optional(),
15686
+ pcb_component_id: z64.string().optional(),
15687
+ pcb_port_id: z64.string().optional(),
15633
15688
  pcb_plated_hole_id: getZodPrefixedIdWithDefault("pcb_plated_hole")
15634
15689
  });
15635
- var pcb_plated_hole_oval = z60.object({
15636
- type: z60.literal("pcb_plated_hole"),
15637
- shape: z60.enum(["oval", "pill"]),
15638
- pcb_group_id: z60.string().optional(),
15639
- subcircuit_id: z60.string().optional(),
15640
- outer_width: z60.number(),
15641
- outer_height: z60.number(),
15642
- hole_width: z60.number(),
15643
- hole_height: z60.number(),
15690
+ var pcb_plated_hole_oval = z64.object({
15691
+ type: z64.literal("pcb_plated_hole"),
15692
+ shape: z64.enum(["oval", "pill"]),
15693
+ pcb_group_id: z64.string().optional(),
15694
+ subcircuit_id: z64.string().optional(),
15695
+ outer_width: z64.number(),
15696
+ outer_height: z64.number(),
15697
+ hole_width: z64.number(),
15698
+ hole_height: z64.number(),
15644
15699
  x: distance,
15645
15700
  y: distance,
15646
- layers: z60.array(layer_ref),
15647
- port_hints: z60.array(z60.string()).optional(),
15648
- pcb_component_id: z60.string().optional(),
15649
- pcb_port_id: z60.string().optional(),
15701
+ layers: z64.array(layer_ref),
15702
+ port_hints: z64.array(z64.string()).optional(),
15703
+ pcb_component_id: z64.string().optional(),
15704
+ pcb_port_id: z64.string().optional(),
15650
15705
  pcb_plated_hole_id: getZodPrefixedIdWithDefault("pcb_plated_hole")
15651
15706
  });
15652
- var pcb_circular_hole_with_rect_pad = z60.object({
15653
- type: z60.literal("pcb_plated_hole"),
15654
- shape: z60.literal("circular_hole_with_rect_pad"),
15655
- pcb_group_id: z60.string().optional(),
15656
- subcircuit_id: z60.string().optional(),
15657
- hole_shape: z60.literal("circle"),
15658
- pad_shape: z60.literal("rect"),
15659
- hole_diameter: z60.number(),
15660
- rect_pad_width: z60.number(),
15661
- rect_pad_height: z60.number(),
15707
+ var pcb_circular_hole_with_rect_pad = z64.object({
15708
+ type: z64.literal("pcb_plated_hole"),
15709
+ shape: z64.literal("circular_hole_with_rect_pad"),
15710
+ pcb_group_id: z64.string().optional(),
15711
+ subcircuit_id: z64.string().optional(),
15712
+ hole_shape: z64.literal("circle"),
15713
+ pad_shape: z64.literal("rect"),
15714
+ hole_diameter: z64.number(),
15715
+ rect_pad_width: z64.number(),
15716
+ rect_pad_height: z64.number(),
15662
15717
  x: distance,
15663
15718
  y: distance,
15664
- layers: z60.array(layer_ref),
15665
- port_hints: z60.array(z60.string()).optional(),
15666
- pcb_component_id: z60.string().optional(),
15667
- pcb_port_id: z60.string().optional(),
15719
+ layers: z64.array(layer_ref),
15720
+ port_hints: z64.array(z64.string()).optional(),
15721
+ pcb_component_id: z64.string().optional(),
15722
+ pcb_port_id: z64.string().optional(),
15668
15723
  pcb_plated_hole_id: getZodPrefixedIdWithDefault("pcb_plated_hole")
15669
15724
  });
15670
- var pcb_pill_hole_with_rect_pad = z60.object({
15671
- type: z60.literal("pcb_plated_hole"),
15672
- shape: z60.literal("pill_hole_with_rect_pad"),
15673
- pcb_group_id: z60.string().optional(),
15674
- subcircuit_id: z60.string().optional(),
15675
- hole_shape: z60.literal("pill"),
15676
- pad_shape: z60.literal("rect"),
15677
- hole_width: z60.number(),
15678
- hole_height: z60.number(),
15679
- rect_pad_width: z60.number(),
15680
- rect_pad_height: z60.number(),
15725
+ var pcb_pill_hole_with_rect_pad = z64.object({
15726
+ type: z64.literal("pcb_plated_hole"),
15727
+ shape: z64.literal("pill_hole_with_rect_pad"),
15728
+ pcb_group_id: z64.string().optional(),
15729
+ subcircuit_id: z64.string().optional(),
15730
+ hole_shape: z64.literal("pill"),
15731
+ pad_shape: z64.literal("rect"),
15732
+ hole_width: z64.number(),
15733
+ hole_height: z64.number(),
15734
+ rect_pad_width: z64.number(),
15735
+ rect_pad_height: z64.number(),
15681
15736
  x: distance,
15682
15737
  y: distance,
15683
- layers: z60.array(layer_ref),
15684
- port_hints: z60.array(z60.string()).optional(),
15685
- pcb_component_id: z60.string().optional(),
15686
- pcb_port_id: z60.string().optional(),
15738
+ layers: z64.array(layer_ref),
15739
+ port_hints: z64.array(z64.string()).optional(),
15740
+ pcb_component_id: z64.string().optional(),
15741
+ pcb_port_id: z64.string().optional(),
15687
15742
  pcb_plated_hole_id: getZodPrefixedIdWithDefault("pcb_plated_hole")
15688
15743
  });
15689
- var pcb_rotated_pill_hole_with_rect_pad = z60.object({
15690
- type: z60.literal("pcb_plated_hole"),
15691
- shape: z60.literal("rotated_pill_hole_with_rect_pad"),
15692
- pcb_group_id: z60.string().optional(),
15693
- subcircuit_id: z60.string().optional(),
15694
- hole_shape: z60.literal("rotated_pill"),
15695
- pad_shape: z60.literal("rect"),
15696
- hole_width: z60.number(),
15697
- hole_height: z60.number(),
15744
+ var pcb_rotated_pill_hole_with_rect_pad = z64.object({
15745
+ type: z64.literal("pcb_plated_hole"),
15746
+ shape: z64.literal("rotated_pill_hole_with_rect_pad"),
15747
+ pcb_group_id: z64.string().optional(),
15748
+ subcircuit_id: z64.string().optional(),
15749
+ hole_shape: z64.literal("rotated_pill"),
15750
+ pad_shape: z64.literal("rect"),
15751
+ hole_width: z64.number(),
15752
+ hole_height: z64.number(),
15698
15753
  hole_ccw_rotation: rotation,
15699
- rect_pad_width: z60.number(),
15700
- rect_pad_height: z60.number(),
15754
+ rect_pad_width: z64.number(),
15755
+ rect_pad_height: z64.number(),
15701
15756
  rect_ccw_rotation: rotation,
15702
15757
  x: distance,
15703
15758
  y: distance,
15704
- layers: z60.array(layer_ref),
15705
- port_hints: z60.array(z60.string()).optional(),
15706
- pcb_component_id: z60.string().optional(),
15707
- pcb_port_id: z60.string().optional(),
15759
+ layers: z64.array(layer_ref),
15760
+ port_hints: z64.array(z64.string()).optional(),
15761
+ pcb_component_id: z64.string().optional(),
15762
+ pcb_port_id: z64.string().optional(),
15708
15763
  pcb_plated_hole_id: getZodPrefixedIdWithDefault("pcb_plated_hole")
15709
15764
  });
15710
- var pcb_plated_hole = z60.union([
15765
+ var pcb_plated_hole = z64.union([
15711
15766
  pcb_plated_hole_circle,
15712
15767
  pcb_plated_hole_oval,
15713
15768
  pcb_circular_hole_with_rect_pad,
@@ -15721,109 +15776,109 @@ expectTypesMatch(true);
15721
15776
  expectTypesMatch(true);
15722
15777
  expectTypesMatch(true);
15723
15778
  expectTypesMatch(true);
15724
- var pcb_port = z61.object({
15725
- type: z61.literal("pcb_port"),
15779
+ var pcb_port = z65.object({
15780
+ type: z65.literal("pcb_port"),
15726
15781
  pcb_port_id: getZodPrefixedIdWithDefault("pcb_port"),
15727
- pcb_group_id: z61.string().optional(),
15728
- subcircuit_id: z61.string().optional(),
15729
- source_port_id: z61.string(),
15730
- pcb_component_id: z61.string(),
15782
+ pcb_group_id: z65.string().optional(),
15783
+ subcircuit_id: z65.string().optional(),
15784
+ source_port_id: z65.string(),
15785
+ pcb_component_id: z65.string(),
15731
15786
  x: distance,
15732
15787
  y: distance,
15733
- layers: z61.array(layer_ref)
15788
+ layers: z65.array(layer_ref)
15734
15789
  }).describe("Defines a port on the PCB");
15735
15790
  expectTypesMatch(true);
15736
- var pcb_smtpad_circle = z62.object({
15737
- type: z62.literal("pcb_smtpad"),
15738
- shape: z62.literal("circle"),
15791
+ var pcb_smtpad_circle = z66.object({
15792
+ type: z66.literal("pcb_smtpad"),
15793
+ shape: z66.literal("circle"),
15739
15794
  pcb_smtpad_id: getZodPrefixedIdWithDefault("pcb_smtpad"),
15740
- pcb_group_id: z62.string().optional(),
15741
- subcircuit_id: z62.string().optional(),
15795
+ pcb_group_id: z66.string().optional(),
15796
+ subcircuit_id: z66.string().optional(),
15742
15797
  x: distance,
15743
15798
  y: distance,
15744
- radius: z62.number(),
15799
+ radius: z66.number(),
15745
15800
  layer: layer_ref,
15746
- port_hints: z62.array(z62.string()).optional(),
15747
- pcb_component_id: z62.string().optional(),
15748
- pcb_port_id: z62.string().optional()
15801
+ port_hints: z66.array(z66.string()).optional(),
15802
+ pcb_component_id: z66.string().optional(),
15803
+ pcb_port_id: z66.string().optional()
15749
15804
  });
15750
- var pcb_smtpad_rect = z62.object({
15751
- type: z62.literal("pcb_smtpad"),
15752
- shape: z62.literal("rect"),
15805
+ var pcb_smtpad_rect = z66.object({
15806
+ type: z66.literal("pcb_smtpad"),
15807
+ shape: z66.literal("rect"),
15753
15808
  pcb_smtpad_id: getZodPrefixedIdWithDefault("pcb_smtpad"),
15754
- pcb_group_id: z62.string().optional(),
15755
- subcircuit_id: z62.string().optional(),
15809
+ pcb_group_id: z66.string().optional(),
15810
+ subcircuit_id: z66.string().optional(),
15756
15811
  x: distance,
15757
15812
  y: distance,
15758
- width: z62.number(),
15759
- height: z62.number(),
15813
+ width: z66.number(),
15814
+ height: z66.number(),
15760
15815
  layer: layer_ref,
15761
- port_hints: z62.array(z62.string()).optional(),
15762
- pcb_component_id: z62.string().optional(),
15763
- pcb_port_id: z62.string().optional()
15816
+ port_hints: z66.array(z66.string()).optional(),
15817
+ pcb_component_id: z66.string().optional(),
15818
+ pcb_port_id: z66.string().optional()
15764
15819
  });
15765
- var pcb_smtpad_rotated_rect = z62.object({
15766
- type: z62.literal("pcb_smtpad"),
15767
- shape: z62.literal("rotated_rect"),
15820
+ var pcb_smtpad_rotated_rect = z66.object({
15821
+ type: z66.literal("pcb_smtpad"),
15822
+ shape: z66.literal("rotated_rect"),
15768
15823
  pcb_smtpad_id: getZodPrefixedIdWithDefault("pcb_smtpad"),
15769
- pcb_group_id: z62.string().optional(),
15770
- subcircuit_id: z62.string().optional(),
15824
+ pcb_group_id: z66.string().optional(),
15825
+ subcircuit_id: z66.string().optional(),
15771
15826
  x: distance,
15772
15827
  y: distance,
15773
- width: z62.number(),
15774
- height: z62.number(),
15828
+ width: z66.number(),
15829
+ height: z66.number(),
15775
15830
  ccw_rotation: rotation,
15776
15831
  layer: layer_ref,
15777
- port_hints: z62.array(z62.string()).optional(),
15778
- pcb_component_id: z62.string().optional(),
15779
- pcb_port_id: z62.string().optional()
15832
+ port_hints: z66.array(z66.string()).optional(),
15833
+ pcb_component_id: z66.string().optional(),
15834
+ pcb_port_id: z66.string().optional()
15780
15835
  });
15781
- var pcb_smtpad_pill = z62.object({
15782
- type: z62.literal("pcb_smtpad"),
15783
- shape: z62.literal("pill"),
15836
+ var pcb_smtpad_pill = z66.object({
15837
+ type: z66.literal("pcb_smtpad"),
15838
+ shape: z66.literal("pill"),
15784
15839
  pcb_smtpad_id: getZodPrefixedIdWithDefault("pcb_smtpad"),
15785
- pcb_group_id: z62.string().optional(),
15786
- subcircuit_id: z62.string().optional(),
15840
+ pcb_group_id: z66.string().optional(),
15841
+ subcircuit_id: z66.string().optional(),
15787
15842
  x: distance,
15788
15843
  y: distance,
15789
- width: z62.number(),
15790
- height: z62.number(),
15791
- radius: z62.number(),
15844
+ width: z66.number(),
15845
+ height: z66.number(),
15846
+ radius: z66.number(),
15792
15847
  layer: layer_ref,
15793
- port_hints: z62.array(z62.string()).optional(),
15794
- pcb_component_id: z62.string().optional(),
15795
- pcb_port_id: z62.string().optional()
15848
+ port_hints: z66.array(z66.string()).optional(),
15849
+ pcb_component_id: z66.string().optional(),
15850
+ pcb_port_id: z66.string().optional()
15796
15851
  });
15797
- var pcb_smtpad_rotated_pill = z62.object({
15798
- type: z62.literal("pcb_smtpad"),
15799
- shape: z62.literal("rotated_pill"),
15852
+ var pcb_smtpad_rotated_pill = z66.object({
15853
+ type: z66.literal("pcb_smtpad"),
15854
+ shape: z66.literal("rotated_pill"),
15800
15855
  pcb_smtpad_id: getZodPrefixedIdWithDefault("pcb_smtpad"),
15801
- pcb_group_id: z62.string().optional(),
15802
- subcircuit_id: z62.string().optional(),
15856
+ pcb_group_id: z66.string().optional(),
15857
+ subcircuit_id: z66.string().optional(),
15803
15858
  x: distance,
15804
15859
  y: distance,
15805
- width: z62.number(),
15806
- height: z62.number(),
15807
- radius: z62.number(),
15860
+ width: z66.number(),
15861
+ height: z66.number(),
15862
+ radius: z66.number(),
15808
15863
  ccw_rotation: rotation,
15809
15864
  layer: layer_ref,
15810
- port_hints: z62.array(z62.string()).optional(),
15811
- pcb_component_id: z62.string().optional(),
15812
- pcb_port_id: z62.string().optional()
15865
+ port_hints: z66.array(z66.string()).optional(),
15866
+ pcb_component_id: z66.string().optional(),
15867
+ pcb_port_id: z66.string().optional()
15813
15868
  });
15814
- var pcb_smtpad_polygon = z62.object({
15815
- type: z62.literal("pcb_smtpad"),
15816
- shape: z62.literal("polygon"),
15869
+ var pcb_smtpad_polygon = z66.object({
15870
+ type: z66.literal("pcb_smtpad"),
15871
+ shape: z66.literal("polygon"),
15817
15872
  pcb_smtpad_id: getZodPrefixedIdWithDefault("pcb_smtpad"),
15818
- pcb_group_id: z62.string().optional(),
15819
- subcircuit_id: z62.string().optional(),
15820
- points: z62.array(point),
15873
+ pcb_group_id: z66.string().optional(),
15874
+ subcircuit_id: z66.string().optional(),
15875
+ points: z66.array(point),
15821
15876
  layer: layer_ref,
15822
- port_hints: z62.array(z62.string()).optional(),
15823
- pcb_component_id: z62.string().optional(),
15824
- pcb_port_id: z62.string().optional()
15877
+ port_hints: z66.array(z66.string()).optional(),
15878
+ pcb_component_id: z66.string().optional(),
15879
+ pcb_port_id: z66.string().optional()
15825
15880
  });
15826
- var pcb_smtpad = z62.discriminatedUnion("shape", [
15881
+ var pcb_smtpad = z66.discriminatedUnion("shape", [
15827
15882
  pcb_smtpad_circle,
15828
15883
  pcb_smtpad_rect,
15829
15884
  pcb_smtpad_rotated_rect,
@@ -15837,78 +15892,78 @@ expectTypesMatch(true);
15837
15892
  expectTypesMatch(true);
15838
15893
  expectTypesMatch(true);
15839
15894
  expectTypesMatch(true);
15840
- var pcb_solder_paste_circle = z63.object({
15841
- type: z63.literal("pcb_solder_paste"),
15842
- shape: z63.literal("circle"),
15895
+ var pcb_solder_paste_circle = z67.object({
15896
+ type: z67.literal("pcb_solder_paste"),
15897
+ shape: z67.literal("circle"),
15843
15898
  pcb_solder_paste_id: getZodPrefixedIdWithDefault("pcb_solder_paste"),
15844
- pcb_group_id: z63.string().optional(),
15845
- subcircuit_id: z63.string().optional(),
15899
+ pcb_group_id: z67.string().optional(),
15900
+ subcircuit_id: z67.string().optional(),
15846
15901
  x: distance,
15847
15902
  y: distance,
15848
- radius: z63.number(),
15903
+ radius: z67.number(),
15849
15904
  layer: layer_ref,
15850
- pcb_component_id: z63.string().optional(),
15851
- pcb_smtpad_id: z63.string().optional()
15905
+ pcb_component_id: z67.string().optional(),
15906
+ pcb_smtpad_id: z67.string().optional()
15852
15907
  });
15853
- var pcb_solder_paste_rect = z63.object({
15854
- type: z63.literal("pcb_solder_paste"),
15855
- shape: z63.literal("rect"),
15908
+ var pcb_solder_paste_rect = z67.object({
15909
+ type: z67.literal("pcb_solder_paste"),
15910
+ shape: z67.literal("rect"),
15856
15911
  pcb_solder_paste_id: getZodPrefixedIdWithDefault("pcb_solder_paste"),
15857
- pcb_group_id: z63.string().optional(),
15858
- subcircuit_id: z63.string().optional(),
15912
+ pcb_group_id: z67.string().optional(),
15913
+ subcircuit_id: z67.string().optional(),
15859
15914
  x: distance,
15860
15915
  y: distance,
15861
- width: z63.number(),
15862
- height: z63.number(),
15916
+ width: z67.number(),
15917
+ height: z67.number(),
15863
15918
  layer: layer_ref,
15864
- pcb_component_id: z63.string().optional(),
15865
- pcb_smtpad_id: z63.string().optional()
15919
+ pcb_component_id: z67.string().optional(),
15920
+ pcb_smtpad_id: z67.string().optional()
15866
15921
  });
15867
- var pcb_solder_paste_pill = z63.object({
15868
- type: z63.literal("pcb_solder_paste"),
15869
- shape: z63.literal("pill"),
15922
+ var pcb_solder_paste_pill = z67.object({
15923
+ type: z67.literal("pcb_solder_paste"),
15924
+ shape: z67.literal("pill"),
15870
15925
  pcb_solder_paste_id: getZodPrefixedIdWithDefault("pcb_solder_paste"),
15871
- pcb_group_id: z63.string().optional(),
15872
- subcircuit_id: z63.string().optional(),
15926
+ pcb_group_id: z67.string().optional(),
15927
+ subcircuit_id: z67.string().optional(),
15873
15928
  x: distance,
15874
15929
  y: distance,
15875
- width: z63.number(),
15876
- height: z63.number(),
15877
- radius: z63.number(),
15930
+ width: z67.number(),
15931
+ height: z67.number(),
15932
+ radius: z67.number(),
15878
15933
  layer: layer_ref,
15879
- pcb_component_id: z63.string().optional(),
15880
- pcb_smtpad_id: z63.string().optional()
15934
+ pcb_component_id: z67.string().optional(),
15935
+ pcb_smtpad_id: z67.string().optional()
15881
15936
  });
15882
- var pcb_solder_paste_rotated_rect = z63.object({
15883
- type: z63.literal("pcb_solder_paste"),
15884
- shape: z63.literal("rotated_rect"),
15937
+ var pcb_solder_paste_rotated_rect = z67.object({
15938
+ type: z67.literal("pcb_solder_paste"),
15939
+ shape: z67.literal("rotated_rect"),
15885
15940
  pcb_solder_paste_id: getZodPrefixedIdWithDefault("pcb_solder_paste"),
15886
- pcb_group_id: z63.string().optional(),
15887
- subcircuit_id: z63.string().optional(),
15941
+ pcb_group_id: z67.string().optional(),
15942
+ subcircuit_id: z67.string().optional(),
15888
15943
  x: distance,
15889
15944
  y: distance,
15890
- width: z63.number(),
15891
- height: z63.number(),
15945
+ width: z67.number(),
15946
+ height: z67.number(),
15892
15947
  ccw_rotation: distance,
15893
15948
  layer: layer_ref,
15894
- pcb_component_id: z63.string().optional(),
15895
- pcb_smtpad_id: z63.string().optional()
15949
+ pcb_component_id: z67.string().optional(),
15950
+ pcb_smtpad_id: z67.string().optional()
15896
15951
  });
15897
- var pcb_solder_paste_oval = z63.object({
15898
- type: z63.literal("pcb_solder_paste"),
15899
- shape: z63.literal("oval"),
15952
+ var pcb_solder_paste_oval = z67.object({
15953
+ type: z67.literal("pcb_solder_paste"),
15954
+ shape: z67.literal("oval"),
15900
15955
  pcb_solder_paste_id: getZodPrefixedIdWithDefault("pcb_solder_paste"),
15901
- pcb_group_id: z63.string().optional(),
15902
- subcircuit_id: z63.string().optional(),
15956
+ pcb_group_id: z67.string().optional(),
15957
+ subcircuit_id: z67.string().optional(),
15903
15958
  x: distance,
15904
15959
  y: distance,
15905
- width: z63.number(),
15906
- height: z63.number(),
15960
+ width: z67.number(),
15961
+ height: z67.number(),
15907
15962
  layer: layer_ref,
15908
- pcb_component_id: z63.string().optional(),
15909
- pcb_smtpad_id: z63.string().optional()
15963
+ pcb_component_id: z67.string().optional(),
15964
+ pcb_smtpad_id: z67.string().optional()
15910
15965
  });
15911
- var pcb_solder_paste = z63.union([
15966
+ var pcb_solder_paste = z67.union([
15912
15967
  pcb_solder_paste_circle,
15913
15968
  pcb_solder_paste_rect,
15914
15969
  pcb_solder_paste_pill,
@@ -15922,115 +15977,115 @@ expectTypesMatch(
15922
15977
  true
15923
15978
  );
15924
15979
  expectTypesMatch(true);
15925
- var pcb_text = z64.object({
15926
- type: z64.literal("pcb_text"),
15980
+ var pcb_text = z68.object({
15981
+ type: z68.literal("pcb_text"),
15927
15982
  pcb_text_id: getZodPrefixedIdWithDefault("pcb_text"),
15928
- pcb_group_id: z64.string().optional(),
15929
- subcircuit_id: z64.string().optional(),
15930
- text: z64.string(),
15983
+ pcb_group_id: z68.string().optional(),
15984
+ subcircuit_id: z68.string().optional(),
15985
+ text: z68.string(),
15931
15986
  center: point,
15932
15987
  layer: layer_ref,
15933
15988
  width: length,
15934
15989
  height: length,
15935
- lines: z64.number(),
15990
+ lines: z68.number(),
15936
15991
  // @ts-ignore
15937
- align: z64.enum(["bottom-left"])
15992
+ align: z68.enum(["bottom-left"])
15938
15993
  }).describe("Defines text on the PCB");
15939
15994
  expectTypesMatch(true);
15940
- var pcb_trace_route_point_wire = z65.object({
15941
- route_type: z65.literal("wire"),
15995
+ var pcb_trace_route_point_wire = z69.object({
15996
+ route_type: z69.literal("wire"),
15942
15997
  x: distance,
15943
15998
  y: distance,
15944
15999
  width: distance,
15945
- start_pcb_port_id: z65.string().optional(),
15946
- end_pcb_port_id: z65.string().optional(),
16000
+ start_pcb_port_id: z69.string().optional(),
16001
+ end_pcb_port_id: z69.string().optional(),
15947
16002
  layer: layer_ref
15948
16003
  });
15949
- var pcb_trace_route_point_via = z65.object({
15950
- route_type: z65.literal("via"),
16004
+ var pcb_trace_route_point_via = z69.object({
16005
+ route_type: z69.literal("via"),
15951
16006
  x: distance,
15952
16007
  y: distance,
15953
16008
  hole_diameter: distance.optional(),
15954
16009
  outer_diameter: distance.optional(),
15955
- from_layer: z65.string(),
15956
- to_layer: z65.string()
16010
+ from_layer: z69.string(),
16011
+ to_layer: z69.string()
15957
16012
  });
15958
- var pcb_trace_route_point = z65.union([
16013
+ var pcb_trace_route_point = z69.union([
15959
16014
  pcb_trace_route_point_wire,
15960
16015
  pcb_trace_route_point_via
15961
16016
  ]);
15962
- var pcb_trace = z65.object({
15963
- type: z65.literal("pcb_trace"),
15964
- source_trace_id: z65.string().optional(),
15965
- pcb_component_id: z65.string().optional(),
16017
+ var pcb_trace = z69.object({
16018
+ type: z69.literal("pcb_trace"),
16019
+ source_trace_id: z69.string().optional(),
16020
+ pcb_component_id: z69.string().optional(),
15966
16021
  pcb_trace_id: getZodPrefixedIdWithDefault("pcb_trace"),
15967
- pcb_group_id: z65.string().optional(),
15968
- subcircuit_id: z65.string().optional(),
15969
- route_thickness_mode: z65.enum(["constant", "interpolated"]).default("constant").optional(),
15970
- route_order_index: z65.number().optional(),
15971
- should_round_corners: z65.boolean().optional(),
15972
- trace_length: z65.number().optional(),
15973
- route: z65.array(pcb_trace_route_point)
16022
+ pcb_group_id: z69.string().optional(),
16023
+ subcircuit_id: z69.string().optional(),
16024
+ route_thickness_mode: z69.enum(["constant", "interpolated"]).default("constant").optional(),
16025
+ route_order_index: z69.number().optional(),
16026
+ should_round_corners: z69.boolean().optional(),
16027
+ trace_length: z69.number().optional(),
16028
+ route: z69.array(pcb_trace_route_point)
15974
16029
  }).describe("Defines a trace on the PCB");
15975
16030
  expectTypesMatch(true);
15976
16031
  expectTypesMatch(true);
15977
- var pcb_trace_error = z66.object({
15978
- type: z66.literal("pcb_trace_error"),
16032
+ var pcb_trace_error = z70.object({
16033
+ type: z70.literal("pcb_trace_error"),
15979
16034
  pcb_trace_error_id: getZodPrefixedIdWithDefault("pcb_trace_error"),
15980
- error_type: z66.literal("pcb_trace_error").default("pcb_trace_error"),
15981
- message: z66.string(),
16035
+ error_type: z70.literal("pcb_trace_error").default("pcb_trace_error"),
16036
+ message: z70.string(),
15982
16037
  center: point.optional(),
15983
- pcb_trace_id: z66.string(),
15984
- source_trace_id: z66.string(),
15985
- pcb_component_ids: z66.array(z66.string()),
15986
- pcb_port_ids: z66.array(z66.string()),
15987
- subcircuit_id: z66.string().optional()
16038
+ pcb_trace_id: z70.string(),
16039
+ source_trace_id: z70.string(),
16040
+ pcb_component_ids: z70.array(z70.string()),
16041
+ pcb_port_ids: z70.array(z70.string()),
16042
+ subcircuit_id: z70.string().optional()
15988
16043
  }).describe("Defines a trace error on the PCB");
15989
16044
  expectTypesMatch(true);
15990
- var pcb_trace_missing_error = z67.object({
15991
- type: z67.literal("pcb_trace_missing_error"),
16045
+ var pcb_trace_missing_error = z71.object({
16046
+ type: z71.literal("pcb_trace_missing_error"),
15992
16047
  pcb_trace_missing_error_id: getZodPrefixedIdWithDefault(
15993
16048
  "pcb_trace_missing_error"
15994
16049
  ),
15995
- error_type: z67.literal("pcb_trace_missing_error").default("pcb_trace_missing_error"),
15996
- message: z67.string(),
16050
+ error_type: z71.literal("pcb_trace_missing_error").default("pcb_trace_missing_error"),
16051
+ message: z71.string(),
15997
16052
  center: point.optional(),
15998
- source_trace_id: z67.string(),
15999
- pcb_component_ids: z67.array(z67.string()),
16000
- pcb_port_ids: z67.array(z67.string()),
16001
- subcircuit_id: z67.string().optional()
16053
+ source_trace_id: z71.string(),
16054
+ pcb_component_ids: z71.array(z71.string()),
16055
+ pcb_port_ids: z71.array(z71.string()),
16056
+ subcircuit_id: z71.string().optional()
16002
16057
  }).describe(
16003
16058
  "Defines an error when a source trace has no corresponding PCB trace"
16004
16059
  );
16005
16060
  expectTypesMatch(true);
16006
- var pcb_port_not_matched_error = z68.object({
16007
- type: z68.literal("pcb_port_not_matched_error"),
16061
+ var pcb_port_not_matched_error = z72.object({
16062
+ type: z72.literal("pcb_port_not_matched_error"),
16008
16063
  pcb_error_id: getZodPrefixedIdWithDefault("pcb_error"),
16009
- error_type: z68.literal("pcb_port_not_matched_error").default("pcb_port_not_matched_error"),
16010
- message: z68.string(),
16011
- pcb_component_ids: z68.array(z68.string()),
16012
- subcircuit_id: z68.string().optional()
16064
+ error_type: z72.literal("pcb_port_not_matched_error").default("pcb_port_not_matched_error"),
16065
+ message: z72.string(),
16066
+ pcb_component_ids: z72.array(z72.string()),
16067
+ subcircuit_id: z72.string().optional()
16013
16068
  }).describe("Defines a trace error on the PCB where a port is not matched");
16014
16069
  expectTypesMatch(true);
16015
- var pcb_port_not_connected_error = z69.object({
16016
- type: z69.literal("pcb_port_not_connected_error"),
16070
+ var pcb_port_not_connected_error = z73.object({
16071
+ type: z73.literal("pcb_port_not_connected_error"),
16017
16072
  pcb_port_not_connected_error_id: getZodPrefixedIdWithDefault(
16018
16073
  "pcb_port_not_connected_error"
16019
16074
  ),
16020
- error_type: z69.literal("pcb_port_not_connected_error").default("pcb_port_not_connected_error"),
16021
- message: z69.string(),
16022
- pcb_port_ids: z69.array(z69.string()),
16023
- pcb_component_ids: z69.array(z69.string()),
16024
- subcircuit_id: z69.string().optional()
16075
+ error_type: z73.literal("pcb_port_not_connected_error").default("pcb_port_not_connected_error"),
16076
+ message: z73.string(),
16077
+ pcb_port_ids: z73.array(z73.string()),
16078
+ pcb_component_ids: z73.array(z73.string()),
16079
+ subcircuit_id: z73.string().optional()
16025
16080
  }).describe("Defines an error when a pcb port is not connected to any trace");
16026
16081
  expectTypesMatch(
16027
16082
  true
16028
16083
  );
16029
- var pcb_via = z70.object({
16030
- type: z70.literal("pcb_via"),
16084
+ var pcb_via = z74.object({
16085
+ type: z74.literal("pcb_via"),
16031
16086
  pcb_via_id: getZodPrefixedIdWithDefault("pcb_via"),
16032
- pcb_group_id: z70.string().optional(),
16033
- subcircuit_id: z70.string().optional(),
16087
+ pcb_group_id: z74.string().optional(),
16088
+ subcircuit_id: z74.string().optional(),
16034
16089
  x: distance,
16035
16090
  y: distance,
16036
16091
  outer_diameter: distance.default("0.6mm"),
@@ -16039,47 +16094,47 @@ var pcb_via = z70.object({
16039
16094
  from_layer: layer_ref.optional(),
16040
16095
  /** @deprecated */
16041
16096
  to_layer: layer_ref.optional(),
16042
- layers: z70.array(layer_ref),
16043
- pcb_trace_id: z70.string().optional()
16097
+ layers: z74.array(layer_ref),
16098
+ pcb_trace_id: z74.string().optional()
16044
16099
  }).describe("Defines a via on the PCB");
16045
16100
  expectTypesMatch(true);
16046
- var pcb_board = z71.object({
16047
- type: z71.literal("pcb_board"),
16101
+ var pcb_board = z75.object({
16102
+ type: z75.literal("pcb_board"),
16048
16103
  pcb_board_id: getZodPrefixedIdWithDefault("pcb_board"),
16049
- is_subcircuit: z71.boolean().optional(),
16050
- subcircuit_id: z71.string().optional(),
16104
+ is_subcircuit: z75.boolean().optional(),
16105
+ subcircuit_id: z75.string().optional(),
16051
16106
  width: length,
16052
16107
  height: length,
16053
16108
  center: point,
16054
16109
  thickness: length.optional().default(1.4),
16055
- num_layers: z71.number().optional().default(4),
16056
- outline: z71.array(point).optional(),
16057
- material: z71.enum(["fr4", "fr1"]).default("fr4")
16110
+ num_layers: z75.number().optional().default(4),
16111
+ outline: z75.array(point).optional(),
16112
+ material: z75.enum(["fr4", "fr1"]).default("fr4")
16058
16113
  }).describe("Defines the board outline of the PCB");
16059
16114
  expectTypesMatch(true);
16060
- var pcb_placement_error = z72.object({
16061
- type: z72.literal("pcb_placement_error"),
16115
+ var pcb_placement_error = z76.object({
16116
+ type: z76.literal("pcb_placement_error"),
16062
16117
  pcb_placement_error_id: getZodPrefixedIdWithDefault("pcb_placement_error"),
16063
- error_type: z72.literal("pcb_placement_error").default("pcb_placement_error"),
16064
- message: z72.string(),
16065
- subcircuit_id: z72.string().optional()
16118
+ error_type: z76.literal("pcb_placement_error").default("pcb_placement_error"),
16119
+ message: z76.string(),
16120
+ subcircuit_id: z76.string().optional()
16066
16121
  }).describe("Defines a placement error on the PCB");
16067
16122
  expectTypesMatch(true);
16068
- var pcb_trace_hint = z73.object({
16069
- type: z73.literal("pcb_trace_hint"),
16123
+ var pcb_trace_hint = z77.object({
16124
+ type: z77.literal("pcb_trace_hint"),
16070
16125
  pcb_trace_hint_id: getZodPrefixedIdWithDefault("pcb_trace_hint"),
16071
- pcb_port_id: z73.string(),
16072
- pcb_component_id: z73.string(),
16073
- route: z73.array(route_hint_point),
16074
- subcircuit_id: z73.string().optional()
16126
+ pcb_port_id: z77.string(),
16127
+ pcb_component_id: z77.string(),
16128
+ route: z77.array(route_hint_point),
16129
+ subcircuit_id: z77.string().optional()
16075
16130
  }).describe("A hint that can be used during generation of a PCB trace");
16076
16131
  expectTypesMatch(true);
16077
- var pcb_silkscreen_line = z74.object({
16078
- type: z74.literal("pcb_silkscreen_line"),
16132
+ var pcb_silkscreen_line = z78.object({
16133
+ type: z78.literal("pcb_silkscreen_line"),
16079
16134
  pcb_silkscreen_line_id: getZodPrefixedIdWithDefault("pcb_silkscreen_line"),
16080
- pcb_component_id: z74.string(),
16081
- pcb_group_id: z74.string().optional(),
16082
- subcircuit_id: z74.string().optional(),
16135
+ pcb_component_id: z78.string(),
16136
+ pcb_group_id: z78.string().optional(),
16137
+ subcircuit_id: z78.string().optional(),
16083
16138
  stroke_width: distance.default("0.1mm"),
16084
16139
  x1: distance,
16085
16140
  y1: distance,
@@ -16088,159 +16143,159 @@ var pcb_silkscreen_line = z74.object({
16088
16143
  layer: visible_layer
16089
16144
  }).describe("Defines a silkscreen line on the PCB");
16090
16145
  expectTypesMatch(true);
16091
- var pcb_silkscreen_path = z75.object({
16092
- type: z75.literal("pcb_silkscreen_path"),
16146
+ var pcb_silkscreen_path = z79.object({
16147
+ type: z79.literal("pcb_silkscreen_path"),
16093
16148
  pcb_silkscreen_path_id: getZodPrefixedIdWithDefault("pcb_silkscreen_path"),
16094
- pcb_component_id: z75.string(),
16095
- pcb_group_id: z75.string().optional(),
16096
- subcircuit_id: z75.string().optional(),
16149
+ pcb_component_id: z79.string(),
16150
+ pcb_group_id: z79.string().optional(),
16151
+ subcircuit_id: z79.string().optional(),
16097
16152
  layer: visible_layer,
16098
- route: z75.array(point),
16153
+ route: z79.array(point),
16099
16154
  stroke_width: length
16100
16155
  }).describe("Defines a silkscreen path on the PCB");
16101
16156
  expectTypesMatch(true);
16102
- var pcb_silkscreen_text = z76.object({
16103
- type: z76.literal("pcb_silkscreen_text"),
16157
+ var pcb_silkscreen_text = z80.object({
16158
+ type: z80.literal("pcb_silkscreen_text"),
16104
16159
  pcb_silkscreen_text_id: getZodPrefixedIdWithDefault("pcb_silkscreen_text"),
16105
- pcb_group_id: z76.string().optional(),
16106
- subcircuit_id: z76.string().optional(),
16107
- font: z76.literal("tscircuit2024").default("tscircuit2024"),
16160
+ pcb_group_id: z80.string().optional(),
16161
+ subcircuit_id: z80.string().optional(),
16162
+ font: z80.literal("tscircuit2024").default("tscircuit2024"),
16108
16163
  font_size: distance.default("0.2mm"),
16109
- pcb_component_id: z76.string(),
16110
- text: z76.string(),
16111
- ccw_rotation: z76.number().optional(),
16164
+ pcb_component_id: z80.string(),
16165
+ text: z80.string(),
16166
+ ccw_rotation: z80.number().optional(),
16112
16167
  layer: layer_ref,
16113
- is_mirrored: z76.boolean().default(false).optional(),
16168
+ is_mirrored: z80.boolean().default(false).optional(),
16114
16169
  anchor_position: point.default({ x: 0, y: 0 }),
16115
16170
  anchor_alignment: ninePointAnchor.default("center")
16116
16171
  }).describe("Defines silkscreen text on the PCB");
16117
16172
  expectTypesMatch(true);
16118
- var pcb_silkscreen_rect = z77.object({
16119
- type: z77.literal("pcb_silkscreen_rect"),
16173
+ var pcb_silkscreen_rect = z81.object({
16174
+ type: z81.literal("pcb_silkscreen_rect"),
16120
16175
  pcb_silkscreen_rect_id: getZodPrefixedIdWithDefault("pcb_silkscreen_rect"),
16121
- pcb_component_id: z77.string(),
16122
- pcb_group_id: z77.string().optional(),
16123
- subcircuit_id: z77.string().optional(),
16176
+ pcb_component_id: z81.string(),
16177
+ pcb_group_id: z81.string().optional(),
16178
+ subcircuit_id: z81.string().optional(),
16124
16179
  center: point,
16125
16180
  width: length,
16126
16181
  height: length,
16127
16182
  layer: layer_ref,
16128
16183
  stroke_width: length.default("1mm"),
16129
- is_filled: z77.boolean().default(true).optional(),
16130
- has_stroke: z77.boolean().optional(),
16131
- is_stroke_dashed: z77.boolean().optional()
16184
+ is_filled: z81.boolean().default(true).optional(),
16185
+ has_stroke: z81.boolean().optional(),
16186
+ is_stroke_dashed: z81.boolean().optional()
16132
16187
  }).describe("Defines a silkscreen rect on the PCB");
16133
16188
  expectTypesMatch(true);
16134
- var pcb_silkscreen_circle = z78.object({
16135
- type: z78.literal("pcb_silkscreen_circle"),
16189
+ var pcb_silkscreen_circle = z82.object({
16190
+ type: z82.literal("pcb_silkscreen_circle"),
16136
16191
  pcb_silkscreen_circle_id: getZodPrefixedIdWithDefault(
16137
16192
  "pcb_silkscreen_circle"
16138
16193
  ),
16139
- pcb_component_id: z78.string(),
16140
- pcb_group_id: z78.string().optional(),
16141
- subcircuit_id: z78.string().optional(),
16194
+ pcb_component_id: z82.string(),
16195
+ pcb_group_id: z82.string().optional(),
16196
+ subcircuit_id: z82.string().optional(),
16142
16197
  center: point,
16143
16198
  radius: length,
16144
16199
  layer: visible_layer,
16145
16200
  stroke_width: length.default("1mm")
16146
16201
  }).describe("Defines a silkscreen circle on the PCB");
16147
16202
  expectTypesMatch(true);
16148
- var pcb_silkscreen_oval = z79.object({
16149
- type: z79.literal("pcb_silkscreen_oval"),
16203
+ var pcb_silkscreen_oval = z83.object({
16204
+ type: z83.literal("pcb_silkscreen_oval"),
16150
16205
  pcb_silkscreen_oval_id: getZodPrefixedIdWithDefault("pcb_silkscreen_oval"),
16151
- pcb_component_id: z79.string(),
16152
- pcb_group_id: z79.string().optional(),
16153
- subcircuit_id: z79.string().optional(),
16206
+ pcb_component_id: z83.string(),
16207
+ pcb_group_id: z83.string().optional(),
16208
+ subcircuit_id: z83.string().optional(),
16154
16209
  center: point,
16155
16210
  radius_x: distance,
16156
16211
  radius_y: distance,
16157
16212
  layer: visible_layer
16158
16213
  }).describe("Defines a silkscreen oval on the PCB");
16159
16214
  expectTypesMatch(true);
16160
- var pcb_fabrication_note_text = z80.object({
16161
- type: z80.literal("pcb_fabrication_note_text"),
16215
+ var pcb_fabrication_note_text = z84.object({
16216
+ type: z84.literal("pcb_fabrication_note_text"),
16162
16217
  pcb_fabrication_note_text_id: getZodPrefixedIdWithDefault(
16163
16218
  "pcb_fabrication_note_text"
16164
16219
  ),
16165
- subcircuit_id: z80.string().optional(),
16166
- pcb_group_id: z80.string().optional(),
16167
- font: z80.literal("tscircuit2024").default("tscircuit2024"),
16220
+ subcircuit_id: z84.string().optional(),
16221
+ pcb_group_id: z84.string().optional(),
16222
+ font: z84.literal("tscircuit2024").default("tscircuit2024"),
16168
16223
  font_size: distance.default("1mm"),
16169
- pcb_component_id: z80.string(),
16170
- text: z80.string(),
16224
+ pcb_component_id: z84.string(),
16225
+ text: z84.string(),
16171
16226
  layer: visible_layer,
16172
16227
  anchor_position: point.default({ x: 0, y: 0 }),
16173
- anchor_alignment: z80.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
16174
- color: z80.string().optional()
16228
+ anchor_alignment: z84.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
16229
+ color: z84.string().optional()
16175
16230
  }).describe(
16176
16231
  "Defines a fabrication note in text on the PCB, useful for leaving notes for assemblers or fabricators"
16177
16232
  );
16178
16233
  expectTypesMatch(true);
16179
- var pcb_fabrication_note_path = z81.object({
16180
- type: z81.literal("pcb_fabrication_note_path"),
16234
+ var pcb_fabrication_note_path = z85.object({
16235
+ type: z85.literal("pcb_fabrication_note_path"),
16181
16236
  pcb_fabrication_note_path_id: getZodPrefixedIdWithDefault(
16182
16237
  "pcb_fabrication_note_path"
16183
16238
  ),
16184
- pcb_component_id: z81.string(),
16185
- subcircuit_id: z81.string().optional(),
16239
+ pcb_component_id: z85.string(),
16240
+ subcircuit_id: z85.string().optional(),
16186
16241
  layer: layer_ref,
16187
- route: z81.array(point),
16242
+ route: z85.array(point),
16188
16243
  stroke_width: length,
16189
- color: z81.string().optional()
16244
+ color: z85.string().optional()
16190
16245
  }).describe(
16191
16246
  "Defines a fabrication path on the PCB for fabricators or assemblers"
16192
16247
  );
16193
16248
  expectTypesMatch(true);
16194
- var pcb_footprint_overlap_error = z82.object({
16195
- type: z82.literal("pcb_footprint_overlap_error"),
16249
+ var pcb_footprint_overlap_error = z86.object({
16250
+ type: z86.literal("pcb_footprint_overlap_error"),
16196
16251
  pcb_error_id: getZodPrefixedIdWithDefault("pcb_error"),
16197
- error_type: z82.literal("pcb_footprint_overlap_error").default("pcb_footprint_overlap_error"),
16198
- message: z82.string(),
16199
- pcb_smtpad_ids: z82.array(z82.string()).optional(),
16200
- pcb_plated_hole_ids: z82.array(z82.string()).optional(),
16201
- pcb_hole_ids: z82.array(z82.string()).optional(),
16202
- pcb_keepout_ids: z82.array(z82.string()).optional()
16252
+ error_type: z86.literal("pcb_footprint_overlap_error").default("pcb_footprint_overlap_error"),
16253
+ message: z86.string(),
16254
+ pcb_smtpad_ids: z86.array(z86.string()).optional(),
16255
+ pcb_plated_hole_ids: z86.array(z86.string()).optional(),
16256
+ pcb_hole_ids: z86.array(z86.string()).optional(),
16257
+ pcb_keepout_ids: z86.array(z86.string()).optional()
16203
16258
  }).describe("Error emitted when a pcb footprint overlaps with another element");
16204
16259
  expectTypesMatch(
16205
16260
  true
16206
16261
  );
16207
- var pcb_keepout = z83.object({
16208
- type: z83.literal("pcb_keepout"),
16209
- shape: z83.literal("rect"),
16210
- pcb_group_id: z83.string().optional(),
16211
- subcircuit_id: z83.string().optional(),
16262
+ var pcb_keepout = z87.object({
16263
+ type: z87.literal("pcb_keepout"),
16264
+ shape: z87.literal("rect"),
16265
+ pcb_group_id: z87.string().optional(),
16266
+ subcircuit_id: z87.string().optional(),
16212
16267
  center: point,
16213
16268
  width: distance,
16214
16269
  height: distance,
16215
- pcb_keepout_id: z83.string(),
16216
- layers: z83.array(z83.string()),
16270
+ pcb_keepout_id: z87.string(),
16271
+ layers: z87.array(z87.string()),
16217
16272
  // Specify layers where the keepout applies
16218
- description: z83.string().optional()
16273
+ description: z87.string().optional()
16219
16274
  // Optional description of the keepout
16220
16275
  }).or(
16221
- z83.object({
16222
- type: z83.literal("pcb_keepout"),
16223
- shape: z83.literal("circle"),
16224
- pcb_group_id: z83.string().optional(),
16225
- subcircuit_id: z83.string().optional(),
16276
+ z87.object({
16277
+ type: z87.literal("pcb_keepout"),
16278
+ shape: z87.literal("circle"),
16279
+ pcb_group_id: z87.string().optional(),
16280
+ subcircuit_id: z87.string().optional(),
16226
16281
  center: point,
16227
16282
  radius: distance,
16228
- pcb_keepout_id: z83.string(),
16229
- layers: z83.array(z83.string()),
16283
+ pcb_keepout_id: z87.string(),
16284
+ layers: z87.array(z87.string()),
16230
16285
  // Specify layers where the keepout applies
16231
- description: z83.string().optional()
16286
+ description: z87.string().optional()
16232
16287
  // Optional description of the keepout
16233
16288
  })
16234
16289
  );
16235
16290
  expectTypesMatch(true);
16236
- var pcb_cutout_base = z84.object({
16237
- type: z84.literal("pcb_cutout"),
16291
+ var pcb_cutout_base = z88.object({
16292
+ type: z88.literal("pcb_cutout"),
16238
16293
  pcb_cutout_id: getZodPrefixedIdWithDefault("pcb_cutout"),
16239
- pcb_group_id: z84.string().optional(),
16240
- subcircuit_id: z84.string().optional()
16294
+ pcb_group_id: z88.string().optional(),
16295
+ subcircuit_id: z88.string().optional()
16241
16296
  });
16242
16297
  var pcb_cutout_rect = pcb_cutout_base.extend({
16243
- shape: z84.literal("rect"),
16298
+ shape: z88.literal("rect"),
16244
16299
  center: point,
16245
16300
  width: length,
16246
16301
  height: length,
@@ -16248,178 +16303,223 @@ var pcb_cutout_rect = pcb_cutout_base.extend({
16248
16303
  });
16249
16304
  expectTypesMatch(true);
16250
16305
  var pcb_cutout_circle = pcb_cutout_base.extend({
16251
- shape: z84.literal("circle"),
16306
+ shape: z88.literal("circle"),
16252
16307
  center: point,
16253
16308
  radius: length
16254
16309
  });
16255
16310
  expectTypesMatch(true);
16256
16311
  var pcb_cutout_polygon = pcb_cutout_base.extend({
16257
- shape: z84.literal("polygon"),
16258
- points: z84.array(point)
16312
+ shape: z88.literal("polygon"),
16313
+ points: z88.array(point)
16259
16314
  });
16260
16315
  expectTypesMatch(true);
16261
- var pcb_cutout = z84.discriminatedUnion("shape", [
16316
+ var pcb_cutout = z88.discriminatedUnion("shape", [
16262
16317
  pcb_cutout_rect,
16263
16318
  pcb_cutout_circle,
16264
16319
  pcb_cutout_polygon
16265
16320
  ]).describe("Defines a cutout on the PCB, removing board material.");
16266
16321
  expectTypesMatch(true);
16267
- var pcb_missing_footprint_error = z85.object({
16268
- type: z85.literal("pcb_missing_footprint_error"),
16322
+ var pcb_missing_footprint_error = z89.object({
16323
+ type: z89.literal("pcb_missing_footprint_error"),
16269
16324
  pcb_missing_footprint_error_id: getZodPrefixedIdWithDefault(
16270
16325
  "pcb_missing_footprint_error"
16271
16326
  ),
16272
- pcb_group_id: z85.string().optional(),
16273
- subcircuit_id: z85.string().optional(),
16274
- error_type: z85.literal("pcb_missing_footprint_error").default("pcb_missing_footprint_error"),
16275
- source_component_id: z85.string(),
16276
- message: z85.string()
16327
+ pcb_group_id: z89.string().optional(),
16328
+ subcircuit_id: z89.string().optional(),
16329
+ error_type: z89.literal("pcb_missing_footprint_error").default("pcb_missing_footprint_error"),
16330
+ source_component_id: z89.string(),
16331
+ message: z89.string()
16277
16332
  }).describe("Defines a missing footprint error on the PCB");
16278
16333
  expectTypesMatch(
16279
16334
  true
16280
16335
  );
16281
- var pcb_group = z86.object({
16282
- type: z86.literal("pcb_group"),
16336
+ var pcb_group = z90.object({
16337
+ type: z90.literal("pcb_group"),
16283
16338
  pcb_group_id: getZodPrefixedIdWithDefault("pcb_group"),
16284
- source_group_id: z86.string(),
16285
- is_subcircuit: z86.boolean().optional(),
16286
- subcircuit_id: z86.string().optional(),
16339
+ source_group_id: z90.string(),
16340
+ is_subcircuit: z90.boolean().optional(),
16341
+ subcircuit_id: z90.string().optional(),
16287
16342
  width: length,
16288
16343
  height: length,
16289
16344
  center: point,
16290
- pcb_component_ids: z86.array(z86.string()),
16291
- name: z86.string().optional(),
16292
- description: z86.string().optional(),
16293
- layout_mode: z86.string().optional(),
16294
- autorouter_configuration: z86.object({
16345
+ pcb_component_ids: z90.array(z90.string()),
16346
+ name: z90.string().optional(),
16347
+ description: z90.string().optional(),
16348
+ layout_mode: z90.string().optional(),
16349
+ autorouter_configuration: z90.object({
16295
16350
  trace_clearance: length
16296
16351
  }).optional(),
16297
- autorouter_used_string: z86.string().optional()
16352
+ autorouter_used_string: z90.string().optional()
16298
16353
  }).describe("Defines a group of components on the PCB");
16299
16354
  expectTypesMatch(true);
16300
- var pcb_autorouting_error = z87.object({
16301
- type: z87.literal("pcb_autorouting_error"),
16355
+ var pcb_autorouting_error = z91.object({
16356
+ type: z91.literal("pcb_autorouting_error"),
16302
16357
  pcb_error_id: getZodPrefixedIdWithDefault("pcb_autorouting_error"),
16303
- error_type: z87.literal("pcb_autorouting_error").default("pcb_autorouting_error"),
16304
- message: z87.string(),
16305
- subcircuit_id: z87.string().optional()
16358
+ error_type: z91.literal("pcb_autorouting_error").default("pcb_autorouting_error"),
16359
+ message: z91.string(),
16360
+ subcircuit_id: z91.string().optional()
16306
16361
  }).describe("The autorouting has failed to route a portion of the board");
16307
16362
  expectTypesMatch(true);
16308
- var pcb_manual_edit_conflict_warning = z88.object({
16309
- type: z88.literal("pcb_manual_edit_conflict_warning"),
16363
+ var pcb_manual_edit_conflict_warning = z92.object({
16364
+ type: z92.literal("pcb_manual_edit_conflict_warning"),
16310
16365
  pcb_manual_edit_conflict_warning_id: getZodPrefixedIdWithDefault(
16311
16366
  "pcb_manual_edit_conflict_warning"
16312
16367
  ),
16313
- warning_type: z88.literal("pcb_manual_edit_conflict_warning").default("pcb_manual_edit_conflict_warning"),
16314
- message: z88.string(),
16315
- pcb_component_id: z88.string(),
16316
- pcb_group_id: z88.string().optional(),
16317
- subcircuit_id: z88.string().optional(),
16318
- source_component_id: z88.string()
16368
+ warning_type: z92.literal("pcb_manual_edit_conflict_warning").default("pcb_manual_edit_conflict_warning"),
16369
+ message: z92.string(),
16370
+ pcb_component_id: z92.string(),
16371
+ pcb_group_id: z92.string().optional(),
16372
+ subcircuit_id: z92.string().optional(),
16373
+ source_component_id: z92.string()
16319
16374
  }).describe(
16320
16375
  "Warning emitted when a component has both manual placement and explicit pcbX/pcbY coordinates"
16321
16376
  );
16322
16377
  expectTypesMatch(true);
16323
- var pcb_breakout_point = z89.object({
16324
- type: z89.literal("pcb_breakout_point"),
16378
+ var pcb_breakout_point = z93.object({
16379
+ type: z93.literal("pcb_breakout_point"),
16325
16380
  pcb_breakout_point_id: getZodPrefixedIdWithDefault("pcb_breakout_point"),
16326
- pcb_group_id: z89.string(),
16327
- subcircuit_id: z89.string().optional(),
16328
- source_trace_id: z89.string().optional(),
16329
- source_port_id: z89.string().optional(),
16330
- source_net_id: z89.string().optional(),
16381
+ pcb_group_id: z93.string(),
16382
+ subcircuit_id: z93.string().optional(),
16383
+ source_trace_id: z93.string().optional(),
16384
+ source_port_id: z93.string().optional(),
16385
+ source_net_id: z93.string().optional(),
16331
16386
  x: distance,
16332
16387
  y: distance
16333
16388
  }).describe(
16334
16389
  "Defines a routing target within a pcb_group for a source_trace or source_net"
16335
16390
  );
16336
16391
  expectTypesMatch(true);
16337
- var pcb_ground_plane = z90.object({
16338
- type: z90.literal("pcb_ground_plane"),
16392
+ var pcb_ground_plane = z94.object({
16393
+ type: z94.literal("pcb_ground_plane"),
16339
16394
  pcb_ground_plane_id: getZodPrefixedIdWithDefault("pcb_ground_plane"),
16340
- source_pcb_ground_plane_id: z90.string(),
16341
- source_net_id: z90.string(),
16342
- pcb_group_id: z90.string().optional(),
16343
- subcircuit_id: z90.string().optional()
16395
+ source_pcb_ground_plane_id: z94.string(),
16396
+ source_net_id: z94.string(),
16397
+ pcb_group_id: z94.string().optional(),
16398
+ subcircuit_id: z94.string().optional()
16344
16399
  }).describe("Defines a ground plane on the PCB");
16345
16400
  expectTypesMatch(true);
16346
- var pcb_ground_plane_region = z91.object({
16347
- type: z91.literal("pcb_ground_plane_region"),
16401
+ var pcb_ground_plane_region = z95.object({
16402
+ type: z95.literal("pcb_ground_plane_region"),
16348
16403
  pcb_ground_plane_region_id: getZodPrefixedIdWithDefault(
16349
16404
  "pcb_ground_plane_region"
16350
16405
  ),
16351
- pcb_ground_plane_id: z91.string(),
16352
- pcb_group_id: z91.string().optional(),
16353
- subcircuit_id: z91.string().optional(),
16406
+ pcb_ground_plane_id: z95.string(),
16407
+ pcb_group_id: z95.string().optional(),
16408
+ subcircuit_id: z95.string().optional(),
16354
16409
  layer: layer_ref,
16355
- points: z91.array(point)
16410
+ points: z95.array(point)
16356
16411
  }).describe("Defines a polygon region of a ground plane");
16357
16412
  expectTypesMatch(true);
16358
- var pcb_thermal_spoke = z92.object({
16359
- type: z92.literal("pcb_thermal_spoke"),
16413
+ var pcb_thermal_spoke = z96.object({
16414
+ type: z96.literal("pcb_thermal_spoke"),
16360
16415
  pcb_thermal_spoke_id: getZodPrefixedIdWithDefault("pcb_thermal_spoke"),
16361
- pcb_ground_plane_id: z92.string(),
16362
- shape: z92.string(),
16363
- spoke_count: z92.number(),
16416
+ pcb_ground_plane_id: z96.string(),
16417
+ shape: z96.string(),
16418
+ spoke_count: z96.number(),
16364
16419
  spoke_thickness: distance,
16365
16420
  spoke_inner_diameter: distance,
16366
16421
  spoke_outer_diameter: distance,
16367
- pcb_plated_hole_id: z92.string().optional(),
16368
- subcircuit_id: z92.string().optional()
16422
+ pcb_plated_hole_id: z96.string().optional(),
16423
+ subcircuit_id: z96.string().optional()
16369
16424
  }).describe("Pattern for connecting a ground plane to a plated hole");
16370
16425
  expectTypesMatch(true);
16371
- var cad_component = z93.object({
16372
- type: z93.literal("cad_component"),
16373
- cad_component_id: z93.string(),
16374
- pcb_component_id: z93.string(),
16375
- source_component_id: z93.string(),
16426
+ var pcb_copper_pour_base = z97.object({
16427
+ type: z97.literal("pcb_copper_pour"),
16428
+ pcb_copper_pour_id: getZodPrefixedIdWithDefault("pcb_copper_pour"),
16429
+ pcb_group_id: z97.string().optional(),
16430
+ subcircuit_id: z97.string().optional(),
16431
+ layer: layer_ref,
16432
+ source_net_id: z97.string().optional()
16433
+ });
16434
+ var pcb_copper_pour_rect = pcb_copper_pour_base.extend({
16435
+ shape: z97.literal("rect"),
16436
+ center: point,
16437
+ width: length,
16438
+ height: length,
16439
+ rotation: rotation.optional()
16440
+ });
16441
+ expectTypesMatch(true);
16442
+ var pcb_copper_pour_circle = pcb_copper_pour_base.extend({
16443
+ shape: z97.literal("circle"),
16444
+ center: point,
16445
+ radius: length
16446
+ });
16447
+ expectTypesMatch(true);
16448
+ var pcb_copper_pour_polygon = pcb_copper_pour_base.extend({
16449
+ shape: z97.literal("polygon"),
16450
+ points: z97.array(point)
16451
+ });
16452
+ expectTypesMatch(true);
16453
+ var pcb_copper_pour = z97.discriminatedUnion("shape", [
16454
+ pcb_copper_pour_rect,
16455
+ pcb_copper_pour_circle,
16456
+ pcb_copper_pour_polygon
16457
+ ]).describe("Defines a copper pour on the PCB.");
16458
+ expectTypesMatch(true);
16459
+ var cad_component = z98.object({
16460
+ type: z98.literal("cad_component"),
16461
+ cad_component_id: z98.string(),
16462
+ pcb_component_id: z98.string(),
16463
+ source_component_id: z98.string(),
16376
16464
  position: point3,
16377
16465
  rotation: point3.optional(),
16378
16466
  size: point3.optional(),
16379
16467
  layer: layer_ref.optional(),
16380
- subcircuit_id: z93.string().optional(),
16468
+ subcircuit_id: z98.string().optional(),
16381
16469
  // These are all ways to generate/load the 3d model
16382
- footprinter_string: z93.string().optional(),
16383
- model_obj_url: z93.string().optional(),
16384
- model_stl_url: z93.string().optional(),
16385
- model_3mf_url: z93.string().optional(),
16386
- model_jscad: z93.any().optional()
16470
+ footprinter_string: z98.string().optional(),
16471
+ model_obj_url: z98.string().optional(),
16472
+ model_stl_url: z98.string().optional(),
16473
+ model_3mf_url: z98.string().optional(),
16474
+ model_jscad: z98.any().optional()
16387
16475
  }).describe("Defines a component on the PCB");
16388
16476
  expectTypesMatch(true);
16389
- var wave_shape = z94.enum(["sinewave", "square", "triangle", "sawtooth"]);
16390
- var simulation_dc_voltage_source = z94.object({
16391
- type: z94.literal("simulation_voltage_source"),
16477
+ var wave_shape = z99.enum(["sinewave", "square", "triangle", "sawtooth"]);
16478
+ var percentage = z99.union([z99.string(), z99.number()]).transform((val) => {
16479
+ if (typeof val === "string") {
16480
+ if (val.endsWith("%")) {
16481
+ return parseFloat(val.slice(0, -1)) / 100;
16482
+ }
16483
+ return parseFloat(val);
16484
+ }
16485
+ return val;
16486
+ }).pipe(
16487
+ z99.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
16488
+ );
16489
+ var simulation_dc_voltage_source = z99.object({
16490
+ type: z99.literal("simulation_voltage_source"),
16392
16491
  simulation_voltage_source_id: getZodPrefixedIdWithDefault(
16393
16492
  "simulation_voltage_source"
16394
16493
  ),
16395
- is_dc_source: z94.literal(true).optional().default(true),
16396
- positive_source_port_id: z94.string().optional(),
16397
- negative_source_port_id: z94.string().optional(),
16398
- positive_source_net_id: z94.string().optional(),
16399
- negative_source_net_id: z94.string().optional(),
16494
+ is_dc_source: z99.literal(true).optional().default(true),
16495
+ positive_source_port_id: z99.string().optional(),
16496
+ negative_source_port_id: z99.string().optional(),
16497
+ positive_source_net_id: z99.string().optional(),
16498
+ negative_source_net_id: z99.string().optional(),
16400
16499
  voltage
16401
16500
  }).describe("Defines a DC voltage source for simulation");
16402
- var simulation_ac_voltage_source = z94.object({
16403
- type: z94.literal("simulation_voltage_source"),
16501
+ var simulation_ac_voltage_source = z99.object({
16502
+ type: z99.literal("simulation_voltage_source"),
16404
16503
  simulation_voltage_source_id: getZodPrefixedIdWithDefault(
16405
16504
  "simulation_voltage_source"
16406
16505
  ),
16407
- is_dc_source: z94.literal(false),
16408
- terminal1_source_port_id: z94.string().optional(),
16409
- terminal2_source_port_id: z94.string().optional(),
16410
- terminal1_source_net_id: z94.string().optional(),
16411
- terminal2_source_net_id: z94.string().optional(),
16506
+ is_dc_source: z99.literal(false),
16507
+ terminal1_source_port_id: z99.string().optional(),
16508
+ terminal2_source_port_id: z99.string().optional(),
16509
+ terminal1_source_net_id: z99.string().optional(),
16510
+ terminal2_source_net_id: z99.string().optional(),
16412
16511
  voltage: voltage.optional(),
16413
16512
  frequency: frequency.optional(),
16414
16513
  peak_to_peak_voltage: voltage.optional(),
16415
16514
  wave_shape: wave_shape.optional(),
16416
- phase: rotation.optional()
16515
+ phase: rotation.optional(),
16516
+ duty_cycle: percentage.optional()
16417
16517
  }).describe("Defines an AC voltage source for simulation");
16418
- var simulation_voltage_source = z94.union([simulation_dc_voltage_source, simulation_ac_voltage_source]).describe("Defines a voltage source for simulation");
16518
+ var simulation_voltage_source = z99.union([simulation_dc_voltage_source, simulation_ac_voltage_source]).describe("Defines a voltage source for simulation");
16419
16519
  expectTypesMatch(true);
16420
16520
  expectTypesMatch(true);
16421
16521
  expectTypesMatch(true);
16422
- var any_circuit_element = z95.union([
16522
+ var any_circuit_element = z100.union([
16423
16523
  source_trace,
16424
16524
  source_port,
16425
16525
  any_source_component,
@@ -16434,6 +16534,7 @@ var any_circuit_element = z95.union([
16434
16534
  source_simple_battery,
16435
16535
  source_simple_inductor,
16436
16536
  source_simple_pin_header,
16537
+ source_simple_pinout,
16437
16538
  source_simple_resonator,
16438
16539
  source_simple_switch,
16439
16540
  source_simple_transistor,
@@ -16442,8 +16543,10 @@ var any_circuit_element = z95.union([
16442
16543
  source_simple_potentiometer,
16443
16544
  source_simple_push_button,
16444
16545
  source_pcb_ground_plane,
16546
+ source_manually_placed_via,
16445
16547
  source_project_metadata,
16446
16548
  source_trace_not_connected_error,
16549
+ source_pin_missing_trace_warning,
16447
16550
  pcb_component,
16448
16551
  pcb_hole,
16449
16552
  pcb_missing_footprint_error,
@@ -16479,6 +16582,7 @@ var any_circuit_element = z95.union([
16479
16582
  pcb_ground_plane,
16480
16583
  pcb_ground_plane_region,
16481
16584
  pcb_thermal_spoke,
16585
+ pcb_copper_pour,
16482
16586
  schematic_box,
16483
16587
  schematic_text,
16484
16588
  schematic_line,
@@ -16508,7 +16612,7 @@ import { z as z410 } from "zod";
16508
16612
  import { z as z610 } from "zod";
16509
16613
  import { z as z810 } from "zod";
16510
16614
  import { z as z710 } from "zod";
16511
- import { z as z97 } from "zod";
16615
+ import { z as z910 } from "zod";
16512
16616
  import "zod";
16513
16617
  import "zod";
16514
16618
  import { z as z122 } from "zod";
@@ -16687,12 +16791,12 @@ function convertMilToMm(value) {
16687
16791
  }
16688
16792
  return Number(value);
16689
16793
  }
16690
- var lengthInMm = z96.union([z96.string(), z96.number()]).transform((val) => convertMilToMm(val));
16691
- var extendDipDef = (newDefaults) => z96.object({
16692
- fn: z96.string(),
16693
- num_pins: z96.number().optional().default(6),
16694
- wide: z96.boolean().optional(),
16695
- narrow: z96.boolean().optional(),
16794
+ var lengthInMm = z101.union([z101.string(), z101.number()]).transform((val) => convertMilToMm(val));
16795
+ var extendDipDef = (newDefaults) => z101.object({
16796
+ fn: z101.string(),
16797
+ num_pins: z101.number().optional().default(6),
16798
+ wide: z101.boolean().optional(),
16799
+ narrow: z101.boolean().optional(),
16696
16800
  w: lengthInMm.optional(),
16697
16801
  p: lengthInMm.default(newDefaults.p ?? "2.54mm"),
16698
16802
  id: lengthInMm.optional(),
@@ -17732,15 +17836,15 @@ var sot363 = (raw_params) => {
17732
17836
  parameters
17733
17837
  };
17734
17838
  };
17735
- var sot23_def = z97.object({
17736
- fn: z97.string(),
17737
- num_pins: z97.number().default(3),
17738
- w: z97.string().default("1.92mm"),
17739
- h: z97.string().default("2.74mm"),
17740
- pl: z97.string().default("0.8mm"),
17741
- pw: z97.string().default("0.764mm"),
17742
- p: z97.string().default("0.95mm"),
17743
- string: z97.string().optional()
17839
+ var sot23_def = z910.object({
17840
+ fn: z910.string(),
17841
+ num_pins: z910.number().default(3),
17842
+ w: z910.string().default("1.92mm"),
17843
+ h: z910.string().default("2.74mm"),
17844
+ pl: z910.string().default("0.8mm"),
17845
+ pw: z910.string().default("0.764mm"),
17846
+ p: z910.string().default("0.95mm"),
17847
+ string: z910.string().optional()
17744
17848
  });
17745
17849
  var sot23_6_or_8_def = extendSoicDef({
17746
17850
  p: "0.95mm",
@@ -23660,17 +23764,17 @@ var svgPathPoints = normalizeOnY([
23660
23764
  ]);
23661
23765
  var DIP_PIN_HEIGHT = 5.47;
23662
23766
  var heightAboveSurface = 0.5;
23663
- var DipPinLeg = ({ x, y, z: z98 }) => {
23767
+ var DipPinLeg = ({ x, y, z: z102 }) => {
23664
23768
  const isRotated = x > 0;
23665
23769
  return /* @__PURE__ */ jsxs(Fragment22, { children: [
23666
- /* @__PURE__ */ jsx4(Translate, { offset: { x: x + 0.25 / 2, y, z: z98 }, children: /* @__PURE__ */ jsx4(Rotate, { rotation: ["-90deg", 0, "90deg"], children: /* @__PURE__ */ jsx4(ExtrudeLinear, { height: 0.25, children: /* @__PURE__ */ jsx4(Polygon, { points: svgPathPoints.map((p) => [p.x, p.y]) }) }) }) }),
23770
+ /* @__PURE__ */ jsx4(Translate, { offset: { x: x + 0.25 / 2, y, z: z102 }, children: /* @__PURE__ */ jsx4(Rotate, { rotation: ["-90deg", 0, "90deg"], children: /* @__PURE__ */ jsx4(ExtrudeLinear, { height: 0.25, children: /* @__PURE__ */ jsx4(Polygon, { points: svgPathPoints.map((p) => [p.x, p.y]) }) }) }) }),
23667
23771
  /* @__PURE__ */ jsx4(
23668
23772
  Translate,
23669
23773
  {
23670
23774
  offset: {
23671
23775
  x,
23672
23776
  y: y + (isRotated ? 1 : -1),
23673
- z: z98
23777
+ z: z102
23674
23778
  },
23675
23779
  children: /* @__PURE__ */ jsx4(Rotate, { rotation: ["-90deg", "90deg", isRotated ? "180deg" : "0deg"], children: /* @__PURE__ */ jsx4(ExtrudeLinear, { height: 2, children: /* @__PURE__ */ jsx4(
23676
23780
  Polygon,
@@ -25587,7 +25691,7 @@ import * as THREE10 from "three";
25587
25691
  // package.json
25588
25692
  var package_default = {
25589
25693
  name: "@tscircuit/3d-viewer",
25590
- version: "0.0.364",
25694
+ version: "0.0.365",
25591
25695
  main: "./dist/index.js",
25592
25696
  module: "./dist/index.js",
25593
25697
  type: "module",
@@ -25643,7 +25747,7 @@ var package_default = {
25643
25747
  "@vitejs/plugin-react": "^4.3.4",
25644
25748
  "bun-match-svg": "^0.0.9",
25645
25749
  "bun-types": "1.2.1",
25646
- "circuit-json": "^0.0.232",
25750
+ "circuit-json": "^0.0.241",
25647
25751
  "circuit-to-svg": "^0.0.179",
25648
25752
  debug: "^4.4.0",
25649
25753
  "jscad-electronics": "^0.0.38",
@@ -25653,7 +25757,7 @@ var package_default = {
25653
25757
  "react-use-gesture": "^9.1.3",
25654
25758
  semver: "^7.7.0",
25655
25759
  "strip-ansi": "^7.1.0",
25656
- tscircuit: "^0.0.606",
25760
+ tscircuit: "^0.0.622",
25657
25761
  tsup: "^8.3.6",
25658
25762
  typescript: "^5.7.3",
25659
25763
  vite: "^7.1.2",
@@ -26978,6 +27082,7 @@ function createSilkscreenPathGeom(sp, ctx) {
26978
27082
  var buildStateOrder = [
26979
27083
  "initializing",
26980
27084
  "processing_pads",
27085
+ "processing_copper_pours",
26981
27086
  "processing_plated_holes",
26982
27087
  "processing_holes",
26983
27088
  "processing_cutouts",
@@ -26999,6 +27104,7 @@ var BoardGeomBuilder = class {
26999
27104
  silkscreenTexts;
27000
27105
  silkscreenPaths;
27001
27106
  pcb_cutouts;
27107
+ pcb_copper_pours;
27002
27108
  boardGeom = null;
27003
27109
  platedHoleGeoms = [];
27004
27110
  holeGeoms = [];
@@ -27009,6 +27115,7 @@ var BoardGeomBuilder = class {
27009
27115
  // Combined with platedHoleGeoms
27010
27116
  silkscreenTextGeoms = [];
27011
27117
  silkscreenPathGeoms = [];
27118
+ copperPourGeoms = [];
27012
27119
  state = "initializing";
27013
27120
  currentIndex = 0;
27014
27121
  ctx;
@@ -27041,6 +27148,9 @@ var BoardGeomBuilder = class {
27041
27148
  this.silkscreenTexts = su3(circuitJson).pcb_silkscreen_text.list();
27042
27149
  this.silkscreenPaths = su3(circuitJson).pcb_silkscreen_path.list();
27043
27150
  this.pcb_cutouts = su3(circuitJson).pcb_cutout.list();
27151
+ this.pcb_copper_pours = circuitJson.filter(
27152
+ (e) => e.type === "pcb_copper_pour"
27153
+ );
27044
27154
  this.ctx = { pcbThickness: 1.2 };
27045
27155
  this.initializeBoard();
27046
27156
  }
@@ -27137,6 +27247,14 @@ var BoardGeomBuilder = class {
27137
27247
  this.goToNextState();
27138
27248
  }
27139
27249
  break;
27250
+ case "processing_copper_pours":
27251
+ if (this.currentIndex < this.pcb_copper_pours.length) {
27252
+ this.processCopperPour(this.pcb_copper_pours[this.currentIndex]);
27253
+ this.currentIndex++;
27254
+ } else {
27255
+ this.goToNextState();
27256
+ }
27257
+ break;
27140
27258
  case "finalizing":
27141
27259
  this.finalize();
27142
27260
  this.state = "done";
@@ -27187,6 +27305,41 @@ var BoardGeomBuilder = class {
27187
27305
  this.boardGeom = (0, import_booleans2.subtract)(this.boardGeom, cutoutGeom);
27188
27306
  }
27189
27307
  }
27308
+ processCopperPour(pour) {
27309
+ const layerSign = pour.layer === "bottom" ? -1 : 1;
27310
+ const zPos = layerSign * this.ctx.pcbThickness / 2 + layerSign * M;
27311
+ let pourGeom = null;
27312
+ if (pour.shape === "rect") {
27313
+ let baseGeom = (0, import_primitives5.cuboid)({
27314
+ center: [0, 0, 0],
27315
+ // Create at origin for rotation
27316
+ size: [pour.width, pour.height, M]
27317
+ });
27318
+ if ("rotation" in pour && pour.rotation) {
27319
+ const rotationRadians = pour.rotation * Math.PI / 180;
27320
+ baseGeom = (0, import_transforms3.rotateZ)(rotationRadians, baseGeom);
27321
+ }
27322
+ pourGeom = (0, import_transforms3.translate)([pour.center.x, pour.center.y, zPos], baseGeom);
27323
+ } else if (pour.shape === "polygon") {
27324
+ let pointsVec2 = pour.points.map((p) => [p.x, p.y]);
27325
+ if (pointsVec2.length < 3) {
27326
+ console.warn(
27327
+ `PCB Copper Pour [${pour.pcb_copper_pour_id}] polygon has fewer than 3 points, skipping.`
27328
+ );
27329
+ return;
27330
+ }
27331
+ if (arePointsClockwise(pointsVec2)) {
27332
+ pointsVec2 = pointsVec2.reverse();
27333
+ }
27334
+ const polygon2d = (0, import_primitives5.polygon)({ points: pointsVec2 });
27335
+ pourGeom = (0, import_extrusions3.extrudeLinear)({ height: M }, polygon2d);
27336
+ pourGeom = (0, import_transforms3.translate)([0, 0, zPos], pourGeom);
27337
+ }
27338
+ if (pourGeom) {
27339
+ const coloredPourGeom = (0, import_colors4.colorize)(colors.copper, pourGeom);
27340
+ this.copperPourGeoms.push(coloredPourGeom);
27341
+ }
27342
+ }
27190
27343
  processPlatedHole(ph, opts = {}) {
27191
27344
  if (!this.boardGeom) return;
27192
27345
  if (ph.shape === "circle" || ph.shape === "circular_hole_with_rect_pad") {
@@ -27442,6 +27595,7 @@ var BoardGeomBuilder = class {
27442
27595
  ...this.padGeoms,
27443
27596
  ...this.traceGeoms,
27444
27597
  ...this.viaGeoms,
27598
+ ...this.copperPourGeoms,
27445
27599
  ...this.silkscreenTextGeoms,
27446
27600
  ...this.silkscreenPathGeoms
27447
27601
  ];
@@ -27788,7 +27942,7 @@ import { useEffect as useEffect20, useMemo as useMemo18, useState as useState13
27788
27942
  // src/hooks/useManifoldBoardBuilder.ts
27789
27943
  import { useState as useState12, useEffect as useEffect19, useMemo as useMemo17, useRef as useRef7 } from "react";
27790
27944
  import { su as su12 } from "@tscircuit/circuit-json-util";
27791
- import * as THREE19 from "three";
27945
+ import * as THREE20 from "three";
27792
27946
 
27793
27947
  // src/utils/manifold-mesh-to-three-geometry.ts
27794
27948
  import * as THREE13 from "three";
@@ -28511,9 +28665,86 @@ function createManifoldBoard(Manifold, CrossSection, boardData, pcbThickness, ma
28511
28665
  return boardOp;
28512
28666
  }
28513
28667
 
28668
+ // src/utils/manifold/process-copper-pours.ts
28669
+ import * as THREE19 from "three";
28670
+ var COPPER_COLOR4 = new THREE19.Color(...colors.copper);
28671
+ var arePointsClockwise3 = (points) => {
28672
+ let area = 0;
28673
+ for (let i = 0; i < points.length; i++) {
28674
+ const j = (i + 1) % points.length;
28675
+ if (points[i] && points[j]) {
28676
+ area += points[i][0] * points[j][1];
28677
+ area -= points[j][0] * points[i][1];
28678
+ }
28679
+ }
28680
+ const signedArea = area / 2;
28681
+ return signedArea <= 0;
28682
+ };
28683
+ function processCopperPoursForManifold(Manifold, CrossSection, circuitJson, pcbThickness, manifoldInstancesForCleanup, holeUnion) {
28684
+ const copperPourGeoms = [];
28685
+ const copperPours = circuitJson.filter(
28686
+ (e) => e.type === "pcb_copper_pour"
28687
+ );
28688
+ for (const pour of copperPours) {
28689
+ const pourThickness = DEFAULT_SMT_PAD_THICKNESS;
28690
+ const layerSign = pour.layer === "bottom" ? -1 : 1;
28691
+ const zPos = layerSign * (pcbThickness / 2 + pourThickness / 2 + MANIFOLD_Z_OFFSET);
28692
+ let pourOp;
28693
+ if (pour.shape === "rect") {
28694
+ pourOp = Manifold.cube([pour.width, pour.height, pourThickness], true);
28695
+ manifoldInstancesForCleanup.push(pourOp);
28696
+ if (pour.rotation) {
28697
+ const rotatedOp = pourOp.rotate([0, 0, pour.rotation]);
28698
+ manifoldInstancesForCleanup.push(rotatedOp);
28699
+ pourOp = rotatedOp;
28700
+ }
28701
+ pourOp = pourOp.translate([pour.center.x, pour.center.y, zPos]);
28702
+ manifoldInstancesForCleanup.push(pourOp);
28703
+ } else if (pour.shape === "polygon") {
28704
+ if (pour.points.length < 3) continue;
28705
+ let pointsVec2 = pour.points.map((p) => [
28706
+ p.x,
28707
+ p.y
28708
+ ]);
28709
+ if (arePointsClockwise3(pointsVec2)) {
28710
+ pointsVec2 = pointsVec2.reverse();
28711
+ }
28712
+ const crossSection = CrossSection.ofPolygons([pointsVec2]);
28713
+ manifoldInstancesForCleanup.push(crossSection);
28714
+ pourOp = Manifold.extrude(
28715
+ crossSection,
28716
+ pourThickness,
28717
+ 0,
28718
+ // nDivisions
28719
+ 0,
28720
+ // twistDegrees
28721
+ [1, 1],
28722
+ // scaleTop
28723
+ true
28724
+ // center extrusion
28725
+ ).translate([0, 0, zPos]);
28726
+ manifoldInstancesForCleanup.push(pourOp);
28727
+ }
28728
+ if (pourOp) {
28729
+ if (holeUnion) {
28730
+ const withHoles = pourOp.subtract(holeUnion);
28731
+ manifoldInstancesForCleanup.push(withHoles);
28732
+ pourOp = withHoles;
28733
+ }
28734
+ const threeGeom = manifoldMeshToThreeGeometry(pourOp.getMesh());
28735
+ copperPourGeoms.push({
28736
+ key: `coppour-${pour.pcb_copper_pour_id}`,
28737
+ geometry: threeGeom,
28738
+ color: COPPER_COLOR4
28739
+ });
28740
+ }
28741
+ }
28742
+ return { copperPourGeoms };
28743
+ }
28744
+
28514
28745
  // src/utils/manifold/process-cutouts.ts
28515
28746
  import { su as su11 } from "@tscircuit/circuit-json-util";
28516
- var arePointsClockwise3 = (points) => {
28747
+ var arePointsClockwise4 = (points) => {
28517
28748
  let area = 0;
28518
28749
  for (let i = 0; i < points.length; i++) {
28519
28750
  const j = (i + 1) % points.length;
@@ -28578,7 +28809,7 @@ function processCutoutsForManifold(Manifold, CrossSection, circuitJson, pcbThick
28578
28809
  p.x,
28579
28810
  p.y
28580
28811
  ]);
28581
- if (arePointsClockwise3(pointsVec2)) {
28812
+ if (arePointsClockwise4(pointsVec2)) {
28582
28813
  pointsVec2 = pointsVec2.reverse();
28583
28814
  }
28584
28815
  const crossSection = CrossSection.ofPolygons([pointsVec2]);
@@ -28712,7 +28943,7 @@ var useManifoldBoardBuilder = (manifoldJSModule, circuitJson) => {
28712
28943
  const matColorArray = boardMaterialColors[boardData.material] ?? colors.fr4Green;
28713
28944
  currentGeoms.board = {
28714
28945
  geometry: finalBoardGeom,
28715
- color: new THREE19.Color(
28946
+ color: new THREE20.Color(
28716
28947
  matColorArray[0],
28717
28948
  matColorArray[1],
28718
28949
  matColorArray[2]
@@ -28727,6 +28958,15 @@ var useManifoldBoardBuilder = (manifoldJSModule, circuitJson) => {
28727
28958
  holeUnion
28728
28959
  );
28729
28960
  currentGeoms.smtPads = smtPadGeoms;
28961
+ const { copperPourGeoms } = processCopperPoursForManifold(
28962
+ Manifold,
28963
+ CrossSection,
28964
+ circuitJson,
28965
+ currentPcbThickness,
28966
+ manifoldInstancesForCleanup.current,
28967
+ holeUnion
28968
+ );
28969
+ currentGeoms.copperPours = copperPourGeoms;
28730
28970
  setGeoms(currentGeoms);
28731
28971
  const traceColorArr = tracesMaterialColors[boardData.material] ?? colors.fr4GreenSolderWithMask;
28732
28972
  const traceColor = `rgb(${Math.round(traceColorArr[0] * 255)}, ${Math.round(traceColorArr[1] * 255)}, ${Math.round(traceColorArr[2] * 255)})`;
@@ -28786,16 +29026,16 @@ var useManifoldBoardBuilder = (manifoldJSModule, circuitJson) => {
28786
29026
  };
28787
29027
 
28788
29028
  // src/utils/manifold/create-three-geometry-meshes.ts
28789
- import * as THREE20 from "three";
29029
+ import * as THREE21 from "three";
28790
29030
  function createGeometryMeshes(geoms) {
28791
29031
  const meshes = [];
28792
29032
  if (!geoms) return meshes;
28793
29033
  if (geoms.board && geoms.board.geometry) {
28794
- const mesh = new THREE20.Mesh(
29034
+ const mesh = new THREE21.Mesh(
28795
29035
  geoms.board.geometry,
28796
- new THREE20.MeshStandardMaterial({
29036
+ new THREE21.MeshStandardMaterial({
28797
29037
  color: geoms.board.color,
28798
- side: THREE20.DoubleSide,
29038
+ side: THREE21.DoubleSide,
28799
29039
  flatShading: true
28800
29040
  })
28801
29041
  );
@@ -28805,11 +29045,11 @@ function createGeometryMeshes(geoms) {
28805
29045
  const createMeshesFromArray = (geomArray) => {
28806
29046
  if (geomArray) {
28807
29047
  geomArray.forEach((comp) => {
28808
- const mesh = new THREE20.Mesh(
29048
+ const mesh = new THREE21.Mesh(
28809
29049
  comp.geometry,
28810
- new THREE20.MeshStandardMaterial({
29050
+ new THREE21.MeshStandardMaterial({
28811
29051
  color: comp.color,
28812
- side: THREE20.DoubleSide,
29052
+ side: THREE21.DoubleSide,
28813
29053
  flatShading: true
28814
29054
  // Consistent with board
28815
29055
  })
@@ -28822,25 +29062,26 @@ function createGeometryMeshes(geoms) {
28822
29062
  createMeshesFromArray(geoms.platedHoles);
28823
29063
  createMeshesFromArray(geoms.smtPads);
28824
29064
  createMeshesFromArray(geoms.vias);
29065
+ createMeshesFromArray(geoms.copperPours);
28825
29066
  return meshes;
28826
29067
  }
28827
29068
 
28828
29069
  // src/utils/manifold/create-three-texture-meshes.ts
28829
- import * as THREE21 from "three";
29070
+ import * as THREE22 from "three";
28830
29071
  function createTextureMeshes(textures, boardData, pcbThickness) {
28831
29072
  const meshes = [];
28832
29073
  if (!textures || !boardData || pcbThickness === null) return meshes;
28833
29074
  const createTexturePlane = (texture, yOffset, isBottomLayer, keySuffix) => {
28834
29075
  if (!texture) return null;
28835
- const planeGeom = new THREE21.PlaneGeometry(boardData.width, boardData.height);
28836
- const material = new THREE21.MeshBasicMaterial({
29076
+ const planeGeom = new THREE22.PlaneGeometry(boardData.width, boardData.height);
29077
+ const material = new THREE22.MeshBasicMaterial({
28837
29078
  map: texture,
28838
29079
  transparent: true,
28839
- side: THREE21.DoubleSide,
29080
+ side: THREE22.DoubleSide,
28840
29081
  depthWrite: false
28841
29082
  // Important for layers to avoid z-fighting issues with board itself
28842
29083
  });
28843
- const mesh = new THREE21.Mesh(planeGeom, material);
29084
+ const mesh = new THREE22.Mesh(planeGeom, material);
28844
29085
  mesh.position.set(boardData.center.x, boardData.center.y, yOffset);
28845
29086
  if (isBottomLayer) {
28846
29087
  mesh.rotation.set(Math.PI, 0, 0);
@@ -29484,11 +29725,11 @@ var CadViewer = (props) => {
29484
29725
  // src/convert-circuit-json-to-3d-svg.ts
29485
29726
  var import_debug = __toESM(require_browser(), 1);
29486
29727
  import { su as su14 } from "@tscircuit/circuit-json-util";
29487
- import * as THREE25 from "three";
29728
+ import * as THREE26 from "three";
29488
29729
  import { SVGRenderer } from "three/examples/jsm/renderers/SVGRenderer.js";
29489
29730
 
29490
29731
  // src/utils/create-geometry-from-polygons.ts
29491
- import * as THREE22 from "three";
29732
+ import * as THREE23 from "three";
29492
29733
  import { BufferGeometry as BufferGeometry3, Float32BufferAttribute as Float32BufferAttribute2 } from "three";
29493
29734
  function createGeometryFromPolygons(polygons) {
29494
29735
  const geometry = new BufferGeometry3();
@@ -29502,12 +29743,12 @@ function createGeometryFromPolygons(polygons) {
29502
29743
  ...polygon2.vertices[i + 1]
29503
29744
  // Third vertex
29504
29745
  );
29505
- const v1 = new THREE22.Vector3(...polygon2.vertices[0]);
29506
- const v2 = new THREE22.Vector3(...polygon2.vertices[i]);
29507
- const v3 = new THREE22.Vector3(...polygon2.vertices[i + 1]);
29508
- const normal = new THREE22.Vector3().crossVectors(
29509
- new THREE22.Vector3().subVectors(v2, v1),
29510
- new THREE22.Vector3().subVectors(v3, v1)
29746
+ const v1 = new THREE23.Vector3(...polygon2.vertices[0]);
29747
+ const v2 = new THREE23.Vector3(...polygon2.vertices[i]);
29748
+ const v3 = new THREE23.Vector3(...polygon2.vertices[i + 1]);
29749
+ const normal = new THREE23.Vector3().crossVectors(
29750
+ new THREE23.Vector3().subVectors(v2, v1),
29751
+ new THREE23.Vector3().subVectors(v3, v1)
29511
29752
  ).normalize();
29512
29753
  normals.push(
29513
29754
  normal.x,
@@ -29530,22 +29771,22 @@ function createGeometryFromPolygons(polygons) {
29530
29771
  // src/utils/render-component.tsx
29531
29772
  var import_modeling3 = __toESM(require_src(), 1);
29532
29773
  var import_jscad_planner2 = __toESM(require_dist(), 1);
29533
- import * as THREE24 from "three";
29774
+ import * as THREE25 from "three";
29534
29775
 
29535
29776
  // src/utils/load-model.ts
29536
- import * as THREE23 from "three";
29777
+ import * as THREE24 from "three";
29537
29778
  import { OBJLoader as OBJLoader2 } from "three/examples/jsm/loaders/OBJLoader.js";
29538
29779
  import { STLLoader as STLLoader2 } from "three/examples/jsm/loaders/STLLoader.js";
29539
29780
  async function load3DModel(url) {
29540
29781
  if (url.endsWith(".stl")) {
29541
29782
  const loader = new STLLoader2();
29542
29783
  const geometry = await loader.loadAsync(url);
29543
- const material = new THREE23.MeshStandardMaterial({
29784
+ const material = new THREE24.MeshStandardMaterial({
29544
29785
  color: 8947848,
29545
29786
  metalness: 0.5,
29546
29787
  roughness: 0.5
29547
29788
  });
29548
- return new THREE23.Mesh(geometry, material);
29789
+ return new THREE24.Mesh(geometry, material);
29549
29790
  }
29550
29791
  if (url.endsWith(".obj")) {
29551
29792
  const loader = new OBJLoader2();
@@ -29570,9 +29811,9 @@ async function renderComponent(component, scene) {
29570
29811
  }
29571
29812
  if (component.rotation) {
29572
29813
  model.rotation.set(
29573
- THREE24.MathUtils.degToRad(component.rotation.x ?? 0),
29574
- THREE24.MathUtils.degToRad(component.rotation.y ?? 0),
29575
- THREE24.MathUtils.degToRad(component.rotation.z ?? 0)
29814
+ THREE25.MathUtils.degToRad(component.rotation.x ?? 0),
29815
+ THREE25.MathUtils.degToRad(component.rotation.y ?? 0),
29816
+ THREE25.MathUtils.degToRad(component.rotation.z ?? 0)
29576
29817
  );
29577
29818
  }
29578
29819
  scene.add(model);
@@ -29586,13 +29827,13 @@ async function renderComponent(component, scene) {
29586
29827
  );
29587
29828
  if (jscadObject && (jscadObject.polygons || jscadObject.sides)) {
29588
29829
  const threeGeom = convertCSGToThreeGeom(jscadObject);
29589
- const material2 = new THREE24.MeshStandardMaterial({
29830
+ const material2 = new THREE25.MeshStandardMaterial({
29590
29831
  color: 8947848,
29591
29832
  metalness: 0.5,
29592
29833
  roughness: 0.5,
29593
- side: THREE24.DoubleSide
29834
+ side: THREE25.DoubleSide
29594
29835
  });
29595
- const mesh2 = new THREE24.Mesh(threeGeom, material2);
29836
+ const mesh2 = new THREE25.Mesh(threeGeom, material2);
29596
29837
  if (component.position) {
29597
29838
  mesh2.position.set(
29598
29839
  component.position.x ?? 0,
@@ -29602,9 +29843,9 @@ async function renderComponent(component, scene) {
29602
29843
  }
29603
29844
  if (component.rotation) {
29604
29845
  mesh2.rotation.set(
29605
- THREE24.MathUtils.degToRad(component.rotation.x ?? 0),
29606
- THREE24.MathUtils.degToRad(component.rotation.y ?? 0),
29607
- THREE24.MathUtils.degToRad(component.rotation.z ?? 0)
29846
+ THREE25.MathUtils.degToRad(component.rotation.x ?? 0),
29847
+ THREE25.MathUtils.degToRad(component.rotation.y ?? 0),
29848
+ THREE25.MathUtils.degToRad(component.rotation.z ?? 0)
29608
29849
  );
29609
29850
  }
29610
29851
  scene.add(mesh2);
@@ -29620,17 +29861,17 @@ async function renderComponent(component, scene) {
29620
29861
  if (!geom || !geom.polygons && !geom.sides) {
29621
29862
  continue;
29622
29863
  }
29623
- const color = new THREE24.Color(geomInfo.color);
29864
+ const color = new THREE25.Color(geomInfo.color);
29624
29865
  color.convertLinearToSRGB();
29625
29866
  const geomWithColor = { ...geom, color: [color.r, color.g, color.b] };
29626
29867
  const threeGeom = convertCSGToThreeGeom(geomWithColor);
29627
- const material2 = new THREE24.MeshStandardMaterial({
29868
+ const material2 = new THREE25.MeshStandardMaterial({
29628
29869
  vertexColors: true,
29629
29870
  metalness: 0.2,
29630
29871
  roughness: 0.8,
29631
- side: THREE24.DoubleSide
29872
+ side: THREE25.DoubleSide
29632
29873
  });
29633
- const mesh2 = new THREE24.Mesh(threeGeom, material2);
29874
+ const mesh2 = new THREE25.Mesh(threeGeom, material2);
29634
29875
  if (component.position) {
29635
29876
  mesh2.position.set(
29636
29877
  component.position.x ?? 0,
@@ -29640,22 +29881,22 @@ async function renderComponent(component, scene) {
29640
29881
  }
29641
29882
  if (component.rotation) {
29642
29883
  mesh2.rotation.set(
29643
- THREE24.MathUtils.degToRad(component.rotation.x ?? 0),
29644
- THREE24.MathUtils.degToRad(component.rotation.y ?? 0),
29645
- THREE24.MathUtils.degToRad(component.rotation.z ?? 0)
29884
+ THREE25.MathUtils.degToRad(component.rotation.x ?? 0),
29885
+ THREE25.MathUtils.degToRad(component.rotation.y ?? 0),
29886
+ THREE25.MathUtils.degToRad(component.rotation.z ?? 0)
29646
29887
  );
29647
29888
  }
29648
29889
  scene.add(mesh2);
29649
29890
  }
29650
29891
  return;
29651
29892
  }
29652
- const geometry = new THREE24.BoxGeometry(0.5, 0.5, 0.5);
29653
- const material = new THREE24.MeshStandardMaterial({
29893
+ const geometry = new THREE25.BoxGeometry(0.5, 0.5, 0.5);
29894
+ const material = new THREE25.MeshStandardMaterial({
29654
29895
  color: 16711680,
29655
29896
  transparent: true,
29656
29897
  opacity: 0.25
29657
29898
  });
29658
- const mesh = new THREE24.Mesh(geometry, material);
29899
+ const mesh = new THREE25.Mesh(geometry, material);
29659
29900
  if (component.position) {
29660
29901
  mesh.position.set(
29661
29902
  component.position.x ?? 0,
@@ -29676,11 +29917,11 @@ async function convertCircuitJsonTo3dSvg(circuitJson, options = {}) {
29676
29917
  padding = 20,
29677
29918
  zoom = 1.5
29678
29919
  } = options;
29679
- const scene = new THREE25.Scene();
29920
+ const scene = new THREE26.Scene();
29680
29921
  const renderer = new SVGRenderer();
29681
29922
  renderer.setSize(width10, height10);
29682
- renderer.setClearColor(new THREE25.Color(backgroundColor), 1);
29683
- const camera = new THREE25.OrthographicCamera();
29923
+ renderer.setClearColor(new THREE26.Color(backgroundColor), 1);
29924
+ const camera = new THREE26.OrthographicCamera();
29684
29925
  const aspect = width10 / height10;
29685
29926
  const frustumSize = 100;
29686
29927
  const halfFrustumSize = frustumSize / 2 / zoom;
@@ -29694,11 +29935,11 @@ async function convertCircuitJsonTo3dSvg(circuitJson, options = {}) {
29694
29935
  camera.position.set(position.x, position.y, position.z);
29695
29936
  camera.up.set(0, 1, 0);
29696
29937
  const lookAt = options.camera?.lookAt ?? { x: 0, y: 0, z: 0 };
29697
- camera.lookAt(new THREE25.Vector3(lookAt.x, lookAt.y, lookAt.z));
29938
+ camera.lookAt(new THREE26.Vector3(lookAt.x, lookAt.y, lookAt.z));
29698
29939
  camera.updateProjectionMatrix();
29699
- const ambientLight = new THREE25.AmbientLight(16777215, Math.PI / 2);
29940
+ const ambientLight = new THREE26.AmbientLight(16777215, Math.PI / 2);
29700
29941
  scene.add(ambientLight);
29701
- const pointLight = new THREE25.PointLight(16777215, Math.PI / 4);
29942
+ const pointLight = new THREE26.PointLight(16777215, Math.PI / 4);
29702
29943
  pointLight.position.set(-10, -10, 10);
29703
29944
  scene.add(pointLight);
29704
29945
  const components = su14(circuitJson).cad_component.list();
@@ -29711,8 +29952,8 @@ async function convertCircuitJsonTo3dSvg(circuitJson, options = {}) {
29711
29952
  const g = geom;
29712
29953
  if (!g.polygons || g.polygons.length === 0) continue;
29713
29954
  const geometry = createGeometryFromPolygons(g.polygons);
29714
- const material = new THREE25.MeshStandardMaterial({
29715
- color: new THREE25.Color(
29955
+ const material = new THREE26.MeshStandardMaterial({
29956
+ color: new THREE26.Color(
29716
29957
  g.color?.[0] ?? 0,
29717
29958
  g.color?.[1] ?? 0,
29718
29959
  g.color?.[2] ?? 0
@@ -29721,18 +29962,18 @@ async function convertCircuitJsonTo3dSvg(circuitJson, options = {}) {
29721
29962
  roughness: 0.8,
29722
29963
  opacity: 0.9,
29723
29964
  transparent: true,
29724
- side: THREE25.DoubleSide
29965
+ side: THREE26.DoubleSide
29725
29966
  });
29726
- const mesh = new THREE25.Mesh(geometry, material);
29967
+ const mesh = new THREE26.Mesh(geometry, material);
29727
29968
  scene.add(mesh);
29728
29969
  }
29729
29970
  }
29730
- const gridHelper = new THREE25.GridHelper(100, 100);
29971
+ const gridHelper = new THREE26.GridHelper(100, 100);
29731
29972
  gridHelper.rotation.x = Math.PI / 2;
29732
29973
  scene.add(gridHelper);
29733
- const box = new THREE25.Box3().setFromObject(scene);
29734
- const center = box.getCenter(new THREE25.Vector3());
29735
- const size2 = box.getSize(new THREE25.Vector3());
29974
+ const box = new THREE26.Box3().setFromObject(scene);
29975
+ const center = box.getCenter(new THREE26.Vector3());
29976
+ const size2 = box.getSize(new THREE26.Vector3());
29736
29977
  scene.position.sub(center);
29737
29978
  const maxDim = Math.max(size2.x, size2.y, size2.z);
29738
29979
  if (maxDim > 0) {