@tscircuit/3d-viewer 0.0.364 → 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
  };
@@ -14436,22 +14436,26 @@ function useGlobalObjLoader(url) {
14436
14436
  );
14437
14437
  }
14438
14438
  const text = await response.text();
14439
- const mtlContent = text.match(/newmtl[\s\S]*?endmtl/g)?.join("\n").replace(/d 0\./g, "d 1.");
14440
- const objContent = text.replace(/newmtl[\s\S]*?endmtl/g, "");
14441
- const mtlLoader = new MTLLoader();
14442
- mtlLoader.setMaterialOptions({
14443
- invertTrProperty: true
14444
- });
14445
- const materials = mtlLoader.parse(
14446
- mtlContent.replace(
14447
- /Kd\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)/g,
14448
- "Kd $2 $2 $2"
14449
- ),
14450
- "test.mtl"
14451
- );
14439
+ const mtlContentArr = text.match(/newmtl[\s\S]*?endmtl/g);
14452
14440
  const objLoader = new OBJLoader();
14453
- objLoader.setMaterials(materials);
14454
- return objLoader.parse(objContent);
14441
+ if (mtlContentArr?.length) {
14442
+ const mtlContent = mtlContentArr.join("\n").replace(/d 0\./g, "d 1.");
14443
+ const objContent = text.replace(/newmtl[\s\S]*?endmtl/g, "").replace(/^mtllib.*/gm, "");
14444
+ const mtlLoader = new MTLLoader();
14445
+ mtlLoader.setMaterialOptions({
14446
+ invertTrProperty: true
14447
+ });
14448
+ const materials = mtlLoader.parse(
14449
+ mtlContent.replace(
14450
+ /Kd\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)/g,
14451
+ "Kd $2 $2 $2"
14452
+ ),
14453
+ "embedded.mtl"
14454
+ );
14455
+ objLoader.setMaterials(materials);
14456
+ return objLoader.parse(objContent);
14457
+ }
14458
+ return objLoader.parse(text.replace(/^mtllib.*/gm, ""));
14455
14459
  } catch (error) {
14456
14460
  return error;
14457
14461
  }
@@ -14568,7 +14572,7 @@ var import_jscad_planner = __toESM(require_dist(), 1);
14568
14572
  var import_modeling2 = __toESM(require_src(), 1);
14569
14573
 
14570
14574
  // node_modules/@tscircuit/footprinter/dist/index.js
14571
- import { z as z96 } from "zod";
14575
+ import { z as z101 } from "zod";
14572
14576
 
14573
14577
  // node_modules/@tscircuit/mm/dist/index.js
14574
14578
  var unitToMm = {
@@ -14612,7 +14616,7 @@ import { z as z12 } from "zod";
14612
14616
  import { z as z13 } from "zod";
14613
14617
  import { z as z14 } from "zod";
14614
14618
  import { z as z15 } from "zod";
14615
- import { z as z32 } from "zod";
14619
+ import { z as z35 } from "zod";
14616
14620
  import { z as z16 } from "zod";
14617
14621
  import { z as z17 } from "zod";
14618
14622
  import { z as z18 } from "zod";
@@ -14629,23 +14633,23 @@ import { z as z28 } from "zod";
14629
14633
  import { z as z29 } from "zod";
14630
14634
  import { z as z30 } from "zod";
14631
14635
  import { z as z31 } from "zod";
14636
+ import { z as z32 } from "zod";
14632
14637
  import { z as z33 } from "zod";
14633
14638
  import { z as z34 } from "zod";
14634
- import { z as z35 } from "zod";
14635
14639
  import { z as z36 } from "zod";
14636
14640
  import { z as z37 } from "zod";
14637
14641
  import { z as z38 } from "zod";
14638
14642
  import { z as z39 } from "zod";
14639
14643
  import { z as z40 } from "zod";
14640
- import { z as z41 } from "zod";
14641
14644
  import { z as z42 } from "zod";
14642
- import { z as z44 } from "zod";
14645
+ import { z as z41 } from "zod";
14643
14646
  import { z as z43 } from "zod";
14647
+ import { z as z44 } from "zod";
14644
14648
  import { z as z45 } from "zod";
14645
14649
  import { z as z46 } from "zod";
14646
14650
  import { z as z47 } from "zod";
14647
- import { z as z48 } from "zod";
14648
14651
  import { z as z49 } from "zod";
14652
+ import { z as z48 } from "zod";
14649
14653
  import { z as z50 } from "zod";
14650
14654
  import { z as z51 } from "zod";
14651
14655
  import { z as z52 } from "zod";
@@ -14692,6 +14696,11 @@ import { z as z92 } from "zod";
14692
14696
  import { z as z93 } from "zod";
14693
14697
  import { z as z94 } from "zod";
14694
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";
14695
14704
  var unitMappings = {
14696
14705
  Hz: {
14697
14706
  baseUnit: "Hz",
@@ -15074,93 +15083,123 @@ var source_simple_pin_header = source_component_base.extend({
15074
15083
  gender: z22.enum(["male", "female"]).optional().default("male")
15075
15084
  });
15076
15085
  expectTypesMatch(true);
15086
+ var source_simple_pinout = source_component_base.extend({
15087
+ ftype: z23.literal("simple_pinout")
15088
+ });
15089
+ expectTypesMatch(true);
15077
15090
  var source_simple_resonator = source_component_base.extend({
15078
- ftype: z23.literal("simple_resonator"),
15091
+ ftype: z24.literal("simple_resonator"),
15079
15092
  load_capacitance: capacitance,
15080
15093
  equivalent_series_resistance: resistance.optional(),
15081
15094
  frequency
15082
15095
  });
15083
15096
  expectTypesMatch(true);
15084
15097
  var source_simple_transistor = source_component_base.extend({
15085
- ftype: z24.literal("simple_transistor"),
15086
- transistor_type: z24.enum(["npn", "pnp"])
15098
+ ftype: z25.literal("simple_transistor"),
15099
+ transistor_type: z25.enum(["npn", "pnp"])
15087
15100
  });
15088
15101
  expectTypesMatch(true);
15089
15102
  var source_simple_test_point = source_component_base.extend({
15090
- ftype: z25.literal("simple_test_point"),
15091
- footprint_variant: z25.enum(["pad", "through_hole"]).optional(),
15092
- pad_shape: z25.enum(["rect", "circle"]).optional(),
15093
- pad_diameter: z25.union([z25.number(), z25.string()]).optional(),
15094
- hole_diameter: z25.union([z25.number(), z25.string()]).optional(),
15095
- width: z25.union([z25.number(), z25.string()]).optional(),
15096
- 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()
15097
15110
  });
15098
15111
  expectTypesMatch(true);
15099
15112
  var source_simple_mosfet = source_component_base.extend({
15100
- ftype: z26.literal("simple_mosfet"),
15101
- channel_type: z26.enum(["n", "p"]),
15102
- 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"])
15103
15116
  });
15104
15117
  expectTypesMatch(true);
15105
15118
  var source_simple_switch = source_component_base.extend({
15106
- ftype: z27.literal("simple_switch")
15119
+ ftype: z28.literal("simple_switch")
15107
15120
  });
15108
15121
  expectTypesMatch(true);
15109
- var source_project_metadata = z28.object({
15110
- type: z28.literal("source_project_metadata"),
15111
- name: z28.string().optional(),
15112
- software_used_string: z28.string().optional(),
15113
- project_url: z28.string().optional(),
15114
- 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()
15115
15128
  });
15116
15129
  expectTypesMatch(true);
15117
- var source_missing_property_error = z29.object({
15118
- type: z29.literal("source_missing_property_error"),
15130
+ var source_missing_property_error = z30.object({
15131
+ type: z30.literal("source_missing_property_error"),
15119
15132
  source_missing_property_error_id: getZodPrefixedIdWithDefault(
15120
15133
  "source_missing_property_error"
15121
15134
  ),
15122
- source_component_id: z29.string(),
15123
- property_name: z29.string(),
15124
- subcircuit_id: z29.string().optional(),
15125
- error_type: z29.literal("source_missing_property_error").default("source_missing_property_error"),
15126
- 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()
15127
15140
  }).describe("The source code is missing a property");
15128
15141
  expectTypesMatch(true);
15129
- var source_failed_to_create_component_error = z30.object({
15130
- 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"),
15131
15144
  source_failed_to_create_component_error_id: getZodPrefixedIdWithDefault(
15132
15145
  "source_failed_to_create_component_error"
15133
15146
  ),
15134
- error_type: z30.literal("source_failed_to_create_component_error").default("source_failed_to_create_component_error"),
15135
- component_name: z30.string().optional(),
15136
- subcircuit_id: z30.string().optional(),
15137
- parent_source_component_id: z30.string().optional(),
15138
- message: z30.string(),
15139
- pcb_center: z30.object({
15140
- x: z30.number().optional(),
15141
- 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()
15142
15155
  }).optional(),
15143
- schematic_center: z30.object({
15144
- x: z30.number().optional(),
15145
- y: z30.number().optional()
15156
+ schematic_center: z31.object({
15157
+ x: z31.number().optional(),
15158
+ y: z31.number().optional()
15146
15159
  }).optional()
15147
15160
  }).describe("Error emitted when a component fails to be constructed");
15148
15161
  expectTypesMatch(true);
15149
- var source_trace_not_connected_error = z31.object({
15150
- 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"),
15151
15164
  source_trace_not_connected_error_id: getZodPrefixedIdWithDefault(
15152
15165
  "source_trace_not_connected_error"
15153
15166
  ),
15154
- error_type: z31.literal("source_trace_not_connected_error").default("source_trace_not_connected_error"),
15155
- message: z31.string(),
15156
- subcircuit_id: z31.string().optional(),
15157
- source_group_id: z31.string().optional(),
15158
- source_trace_id: z31.string().optional(),
15159
- connected_source_port_ids: z31.array(z31.string()).optional(),
15160
- 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()
15161
15174
  }).describe("Occurs when a source trace selector does not match any ports");
15162
15175
  expectTypesMatch(true);
15163
- 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([
15164
15203
  source_simple_resistor,
15165
15204
  source_simple_capacitor,
15166
15205
  source_simple_diode,
@@ -15174,6 +15213,7 @@ var any_source_component = z32.union([
15174
15213
  source_simple_potentiometer,
15175
15214
  source_simple_crystal,
15176
15215
  source_simple_pin_header,
15216
+ source_simple_pinout,
15177
15217
  source_simple_resonator,
15178
15218
  source_simple_switch,
15179
15219
  source_simple_transistor,
@@ -15183,182 +15223,222 @@ var any_source_component = z32.union([
15183
15223
  source_project_metadata,
15184
15224
  source_missing_property_error,
15185
15225
  source_failed_to_create_component_error,
15186
- source_trace_not_connected_error
15226
+ source_trace_not_connected_error,
15227
+ source_property_ignored_warning,
15228
+ source_pin_missing_trace_warning
15187
15229
  ]);
15188
15230
  expectTypesMatch(true);
15189
- var source_port = z33.object({
15190
- type: z33.literal("source_port"),
15191
- pin_number: z33.number().optional(),
15192
- port_hints: z33.array(z33.string()).optional(),
15193
- name: z33.string(),
15194
- source_port_id: z33.string(),
15195
- source_component_id: z33.string(),
15196
- subcircuit_id: z33.string().optional(),
15197
- 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()
15198
15240
  });
15199
15241
  expectTypesMatch(true);
15200
- var source_trace = z34.object({
15201
- type: z34.literal("source_trace"),
15202
- source_trace_id: z34.string(),
15203
- connected_source_port_ids: z34.array(z34.string()),
15204
- connected_source_net_ids: z34.array(z34.string()),
15205
- subcircuit_id: z34.string().optional(),
15206
- subcircuit_connectivity_map_key: z34.string().optional(),
15207
- max_length: z34.number().optional(),
15208
- min_trace_thickness: z34.number().optional(),
15209
- 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()
15210
15252
  });
15211
15253
  expectTypesMatch(true);
15212
- var source_group = z35.object({
15213
- type: z35.literal("source_group"),
15214
- source_group_id: z35.string(),
15215
- subcircuit_id: z35.string().optional(),
15216
- parent_subcircuit_id: z35.string().optional(),
15217
- parent_source_group_id: z35.string().optional(),
15218
- is_subcircuit: z35.boolean().optional(),
15219
- 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()
15220
15262
  });
15221
15263
  expectTypesMatch(true);
15222
- var source_net = z36.object({
15223
- type: z36.literal("source_net"),
15224
- source_net_id: z36.string(),
15225
- name: z36.string(),
15226
- member_source_group_ids: z36.array(z36.string()),
15227
- is_power: z36.boolean().optional(),
15228
- is_ground: z36.boolean().optional(),
15229
- is_digital_signal: z36.boolean().optional(),
15230
- is_analog_signal: z36.boolean().optional(),
15231
- trace_width: z36.number().optional(),
15232
- subcircuit_id: z36.string().optional(),
15233
- 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()
15234
15277
  });
15235
15278
  expectTypesMatch(true);
15236
- var source_pcb_ground_plane = z37.object({
15237
- type: z37.literal("source_pcb_ground_plane"),
15238
- source_pcb_ground_plane_id: z37.string(),
15239
- source_group_id: z37.string(),
15240
- source_net_id: z37.string(),
15241
- 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()
15242
15285
  }).describe("Defines a ground plane in the source domain");
15243
15286
  expectTypesMatch(true);
15244
- var schematic_box = z38.object({
15245
- type: z38.literal("schematic_box"),
15246
- 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(),
15247
15325
  width: distance,
15248
15326
  height: distance,
15249
- is_dashed: z38.boolean().default(false),
15327
+ is_dashed: z43.boolean().default(false),
15250
15328
  x: distance,
15251
15329
  y: distance,
15252
- subcircuit_id: z38.string().optional()
15330
+ subcircuit_id: z43.string().optional()
15253
15331
  }).describe("Draws a box on the schematic");
15254
15332
  expectTypesMatch(true);
15255
- var schematic_path = z39.object({
15256
- type: z39.literal("schematic_path"),
15257
- schematic_component_id: z39.string(),
15258
- fill_color: z39.enum(["red", "blue"]).optional(),
15259
- is_filled: z39.boolean().optional(),
15260
- points: z39.array(point),
15261
- 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()
15262
15340
  });
15263
15341
  expectTypesMatch(true);
15264
- var schematic_pin_styles = z40.record(
15265
- z40.object({
15342
+ var schematic_pin_styles = z45.record(
15343
+ z45.object({
15266
15344
  left_margin: length.optional(),
15267
15345
  right_margin: length.optional(),
15268
15346
  top_margin: length.optional(),
15269
15347
  bottom_margin: length.optional()
15270
15348
  })
15271
15349
  );
15272
- var schematic_component_port_arrangement_by_size = z40.object({
15273
- left_size: z40.number(),
15274
- right_size: z40.number(),
15275
- top_size: z40.number().optional(),
15276
- 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()
15277
15355
  });
15278
15356
  expectTypesMatch(true);
15279
- var schematic_component_port_arrangement_by_sides = z40.object({
15280
- left_side: z40.object({
15281
- 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()),
15282
15360
  // @ts-ignore
15283
- direction: z40.enum(["top-to-bottom", "bottom-to-top"]).optional()
15361
+ direction: z45.enum(["top-to-bottom", "bottom-to-top"]).optional()
15284
15362
  }).optional(),
15285
- right_side: z40.object({
15286
- pins: z40.array(z40.number()),
15363
+ right_side: z45.object({
15364
+ pins: z45.array(z45.number()),
15287
15365
  // @ts-ignore
15288
- direction: z40.enum(["top-to-bottom", "bottom-to-top"]).optional()
15366
+ direction: z45.enum(["top-to-bottom", "bottom-to-top"]).optional()
15289
15367
  }).optional(),
15290
- top_side: z40.object({
15291
- pins: z40.array(z40.number()),
15368
+ top_side: z45.object({
15369
+ pins: z45.array(z45.number()),
15292
15370
  // @ts-ignore
15293
- direction: z40.enum(["left-to-right", "right-to-left"]).optional()
15371
+ direction: z45.enum(["left-to-right", "right-to-left"]).optional()
15294
15372
  }).optional(),
15295
- bottom_side: z40.object({
15296
- pins: z40.array(z40.number()),
15373
+ bottom_side: z45.object({
15374
+ pins: z45.array(z45.number()),
15297
15375
  // @ts-ignore
15298
- direction: z40.enum(["left-to-right", "right-to-left"]).optional()
15376
+ direction: z45.enum(["left-to-right", "right-to-left"]).optional()
15299
15377
  }).optional()
15300
15378
  });
15301
15379
  expectTypesMatch(true);
15302
- var port_arrangement = z40.union([
15380
+ var port_arrangement = z45.union([
15303
15381
  schematic_component_port_arrangement_by_size,
15304
15382
  schematic_component_port_arrangement_by_sides
15305
15383
  ]);
15306
- var schematic_component = z40.object({
15307
- type: z40.literal("schematic_component"),
15384
+ var schematic_component = z45.object({
15385
+ type: z45.literal("schematic_component"),
15308
15386
  size,
15309
15387
  center: point,
15310
- source_component_id: z40.string(),
15311
- schematic_component_id: z40.string(),
15388
+ source_component_id: z45.string(),
15389
+ schematic_component_id: z45.string(),
15312
15390
  pin_spacing: length.optional(),
15313
15391
  pin_styles: schematic_pin_styles.optional(),
15314
15392
  box_width: length.optional(),
15315
- symbol_name: z40.string().optional(),
15393
+ symbol_name: z45.string().optional(),
15316
15394
  port_arrangement: port_arrangement.optional(),
15317
- port_labels: z40.record(z40.string()).optional(),
15318
- symbol_display_value: z40.string().optional(),
15319
- subcircuit_id: z40.string().optional(),
15320
- 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()
15321
15399
  });
15322
15400
  expectTypesMatch(true);
15323
- var schematic_line = z41.object({
15324
- type: z41.literal("schematic_line"),
15325
- schematic_component_id: z41.string(),
15401
+ var schematic_line = z46.object({
15402
+ type: z46.literal("schematic_line"),
15403
+ schematic_component_id: z46.string(),
15326
15404
  x1: distance,
15327
15405
  x2: distance,
15328
15406
  y1: distance,
15329
15407
  y2: distance,
15330
- subcircuit_id: z41.string().optional()
15408
+ subcircuit_id: z46.string().optional()
15331
15409
  });
15332
15410
  expectTypesMatch(true);
15333
- var schematic_trace = z42.object({
15334
- type: z42.literal("schematic_trace"),
15335
- schematic_trace_id: z42.string(),
15336
- source_trace_id: z42.string(),
15337
- junctions: z42.array(
15338
- z42.object({
15339
- x: z42.number(),
15340
- 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()
15341
15419
  })
15342
15420
  ),
15343
- edges: z42.array(
15344
- z42.object({
15345
- from: z42.object({
15346
- x: z42.number(),
15347
- y: z42.number()
15421
+ edges: z47.array(
15422
+ z47.object({
15423
+ from: z47.object({
15424
+ x: z47.number(),
15425
+ y: z47.number()
15348
15426
  }),
15349
- to: z42.object({
15350
- x: z42.number(),
15351
- y: z42.number()
15427
+ to: z47.object({
15428
+ x: z47.number(),
15429
+ y: z47.number()
15352
15430
  }),
15353
- is_crossing: z42.boolean().optional(),
15354
- from_schematic_port_id: z42.string().optional(),
15355
- 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()
15356
15434
  })
15357
15435
  ),
15358
- 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()
15359
15439
  });
15360
15440
  expectTypesMatch(true);
15361
- var fivePointAnchor = z43.enum([
15441
+ var fivePointAnchor = z48.enum([
15362
15442
  "center",
15363
15443
  "left",
15364
15444
  "right",
@@ -15366,230 +15446,209 @@ var fivePointAnchor = z43.enum([
15366
15446
  "bottom"
15367
15447
  ]);
15368
15448
  expectTypesMatch(true);
15369
- var schematic_text = z44.object({
15370
- type: z44.literal("schematic_text"),
15371
- schematic_component_id: z44.string().optional(),
15372
- schematic_text_id: z44.string(),
15373
- text: z44.string(),
15374
- font_size: z44.number().default(0.18),
15375
- 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({
15376
15456
  x: distance,
15377
15457
  y: distance
15378
15458
  }),
15379
- rotation: z44.number().default(0),
15380
- anchor: z44.union([fivePointAnchor.describe("legacy"), ninePointAnchor]).default("center"),
15381
- color: z44.string().default("#000000"),
15382
- 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()
15383
15463
  });
15384
15464
  expectTypesMatch(true);
15385
- var schematic_port = z45.object({
15386
- type: z45.literal("schematic_port"),
15387
- schematic_port_id: z45.string(),
15388
- source_port_id: z45.string(),
15389
- 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(),
15390
15470
  center: point,
15391
- facing_direction: z45.enum(["up", "down", "left", "right"]).optional(),
15392
- distance_from_component_edge: z45.number().optional(),
15393
- side_of_component: z45.enum(["top", "bottom", "left", "right"]).optional(),
15394
- true_ccw_index: z45.number().optional(),
15395
- pin_number: z45.number().optional(),
15396
- display_pin_label: z45.string().optional(),
15397
- subcircuit_id: z45.string().optional(),
15398
- 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()
15399
15481
  }).describe("Defines a port on a schematic component");
15400
15482
  expectTypesMatch(true);
15401
- var schematic_net_label = z46.object({
15402
- type: z46.literal("schematic_net_label"),
15483
+ var schematic_net_label = z51.object({
15484
+ type: z51.literal("schematic_net_label"),
15403
15485
  schematic_net_label_id: getZodPrefixedIdWithDefault("schematic_net_label"),
15404
- schematic_trace_id: z46.string().optional(),
15405
- source_trace_id: z46.string().optional(),
15406
- 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(),
15407
15489
  center: point,
15408
15490
  anchor_position: point.optional(),
15409
- anchor_side: z46.enum(["top", "bottom", "left", "right"]),
15410
- text: z46.string(),
15411
- symbol_name: z46.string().optional(),
15412
- is_movable: z46.boolean().optional(),
15413
- 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()
15414
15496
  });
15415
15497
  expectTypesMatch(true);
15416
- var schematic_error = z47.object({
15417
- type: z47.literal("schematic_error"),
15418
- schematic_error_id: z47.string(),
15498
+ var schematic_error = z52.object({
15499
+ type: z52.literal("schematic_error"),
15500
+ schematic_error_id: z52.string(),
15419
15501
  // eventually each error type should be broken out into a dir of files
15420
- error_type: z47.literal("schematic_port_not_found").default("schematic_port_not_found"),
15421
- message: z47.string(),
15422
- 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()
15423
15505
  }).describe("Defines a schematic error on the schematic");
15424
15506
  expectTypesMatch(true);
15425
- var schematic_layout_error = z48.object({
15426
- type: z48.literal("schematic_layout_error"),
15507
+ var schematic_layout_error = z53.object({
15508
+ type: z53.literal("schematic_layout_error"),
15427
15509
  schematic_layout_error_id: getZodPrefixedIdWithDefault(
15428
15510
  "schematic_layout_error"
15429
15511
  ),
15430
- error_type: z48.literal("schematic_layout_error").default("schematic_layout_error"),
15431
- message: z48.string(),
15432
- source_group_id: z48.string(),
15433
- schematic_group_id: z48.string(),
15434
- 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()
15435
15517
  }).describe("Error emitted when schematic layout fails for a group");
15436
15518
  expectTypesMatch(true);
15437
- var schematic_debug_object_base = z49.object({
15438
- type: z49.literal("schematic_debug_object"),
15439
- label: z49.string().optional(),
15440
- 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()
15441
15523
  });
15442
15524
  var schematic_debug_rect = schematic_debug_object_base.extend({
15443
- shape: z49.literal("rect"),
15525
+ shape: z54.literal("rect"),
15444
15526
  center: point,
15445
15527
  size
15446
15528
  });
15447
15529
  var schematic_debug_line = schematic_debug_object_base.extend({
15448
- shape: z49.literal("line"),
15530
+ shape: z54.literal("line"),
15449
15531
  start: point,
15450
15532
  end: point
15451
15533
  });
15452
15534
  var schematic_debug_point = schematic_debug_object_base.extend({
15453
- shape: z49.literal("point"),
15535
+ shape: z54.literal("point"),
15454
15536
  center: point
15455
15537
  });
15456
- var schematic_debug_object = z49.discriminatedUnion("shape", [
15538
+ var schematic_debug_object = z54.discriminatedUnion("shape", [
15457
15539
  schematic_debug_rect,
15458
15540
  schematic_debug_line,
15459
15541
  schematic_debug_point
15460
15542
  ]);
15461
15543
  expectTypesMatch(true);
15462
- var schematic_voltage_probe = z50.object({
15463
- type: z50.literal("schematic_voltage_probe"),
15464
- 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(),
15465
15547
  position: point,
15466
- schematic_trace_id: z50.string(),
15548
+ schematic_trace_id: z55.string(),
15467
15549
  voltage: voltage.optional(),
15468
- subcircuit_id: z50.string().optional()
15550
+ subcircuit_id: z55.string().optional()
15469
15551
  }).describe("Defines a voltage probe measurement point on a schematic trace");
15470
15552
  expectTypesMatch(true);
15471
- var schematic_manual_edit_conflict_warning = z51.object({
15472
- 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"),
15473
15555
  schematic_manual_edit_conflict_warning_id: getZodPrefixedIdWithDefault(
15474
15556
  "schematic_manual_edit_conflict_warning"
15475
15557
  ),
15476
- warning_type: z51.literal("schematic_manual_edit_conflict_warning").default("schematic_manual_edit_conflict_warning"),
15477
- message: z51.string(),
15478
- schematic_component_id: z51.string(),
15479
- schematic_group_id: z51.string().optional(),
15480
- subcircuit_id: z51.string().optional(),
15481
- 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()
15482
15564
  }).describe(
15483
15565
  "Warning emitted when a component has both manual placement and explicit schX/schY coordinates"
15484
15566
  );
15485
15567
  expectTypesMatch(true);
15486
- var schematic_group = z52.object({
15487
- type: z52.literal("schematic_group"),
15568
+ var schematic_group = z57.object({
15569
+ type: z57.literal("schematic_group"),
15488
15570
  schematic_group_id: getZodPrefixedIdWithDefault("schematic_group"),
15489
- source_group_id: z52.string(),
15490
- is_subcircuit: z52.boolean().optional(),
15491
- subcircuit_id: z52.string().optional(),
15571
+ source_group_id: z57.string(),
15572
+ is_subcircuit: z57.boolean().optional(),
15573
+ subcircuit_id: z57.string().optional(),
15492
15574
  width: length,
15493
15575
  height: length,
15494
15576
  center: point,
15495
- schematic_component_ids: z52.array(z52.string()),
15496
- name: z52.string().optional(),
15497
- description: z52.string().optional()
15577
+ schematic_component_ids: z57.array(z57.string()),
15578
+ name: z57.string().optional(),
15579
+ description: z57.string().optional()
15498
15580
  }).describe("Defines a group of components on the schematic");
15499
15581
  expectTypesMatch(true);
15500
- var schematic_table = z53.object({
15501
- type: z53.literal("schematic_table"),
15582
+ var schematic_table = z58.object({
15583
+ type: z58.literal("schematic_table"),
15502
15584
  schematic_table_id: getZodPrefixedIdWithDefault("schematic_table"),
15503
15585
  anchor_position: point,
15504
- column_widths: z53.array(distance),
15505
- row_heights: z53.array(distance),
15586
+ column_widths: z58.array(distance),
15587
+ row_heights: z58.array(distance),
15506
15588
  cell_padding: distance.optional(),
15507
15589
  border_width: distance.optional(),
15508
- subcircuit_id: z53.string().optional(),
15509
- schematic_component_id: z53.string().optional(),
15590
+ subcircuit_id: z58.string().optional(),
15591
+ schematic_component_id: z58.string().optional(),
15510
15592
  anchor: ninePointAnchor.optional()
15511
15593
  }).describe("Defines a table on the schematic");
15512
15594
  expectTypesMatch(true);
15513
- var schematic_table_cell = z54.object({
15514
- type: z54.literal("schematic_table_cell"),
15595
+ var schematic_table_cell = z59.object({
15596
+ type: z59.literal("schematic_table_cell"),
15515
15597
  schematic_table_cell_id: getZodPrefixedIdWithDefault(
15516
15598
  "schematic_table_cell"
15517
15599
  ),
15518
- schematic_table_id: z54.string(),
15519
- start_row_index: z54.number(),
15520
- end_row_index: z54.number(),
15521
- start_column_index: z54.number(),
15522
- end_column_index: z54.number(),
15523
- 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(),
15524
15606
  center: point,
15525
15607
  width: distance,
15526
15608
  height: distance,
15527
- horizontal_align: z54.enum(["left", "center", "right"]).optional(),
15528
- 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(),
15529
15611
  font_size: distance.optional(),
15530
- subcircuit_id: z54.string().optional()
15612
+ subcircuit_id: z59.string().optional()
15531
15613
  }).describe("Defines a cell within a schematic_table");
15532
15614
  expectTypesMatch(true);
15533
- var all_layers = [
15534
- "top",
15535
- "bottom",
15536
- "inner1",
15537
- "inner2",
15538
- "inner3",
15539
- "inner4",
15540
- "inner5",
15541
- "inner6"
15542
- ];
15543
- var layer_string = z55.enum(all_layers);
15544
- var layer_ref = layer_string.or(
15545
- z55.object({
15546
- name: layer_string
15547
- })
15548
- ).transform((layer) => {
15549
- if (typeof layer === "string") {
15550
- return layer;
15551
- }
15552
- return layer.name;
15553
- });
15554
- expectTypesMatch(true);
15555
- var visible_layer = z55.enum(["top", "bottom"]);
15556
- var pcb_route_hint = z56.object({
15615
+ var pcb_route_hint = z60.object({
15557
15616
  x: distance,
15558
15617
  y: distance,
15559
- via: z56.boolean().optional(),
15618
+ via: z60.boolean().optional(),
15560
15619
  via_to_layer: layer_ref.optional()
15561
15620
  });
15562
- var pcb_route_hints = z56.array(pcb_route_hint);
15621
+ var pcb_route_hints = z60.array(pcb_route_hint);
15563
15622
  expectTypesMatch(true);
15564
15623
  expectTypesMatch(true);
15565
- var route_hint_point = z57.object({
15624
+ var route_hint_point = z61.object({
15566
15625
  x: distance,
15567
15626
  y: distance,
15568
- via: z57.boolean().optional(),
15627
+ via: z61.boolean().optional(),
15569
15628
  to_layer: layer_ref.optional(),
15570
15629
  trace_width: distance.optional()
15571
15630
  });
15572
15631
  expectTypesMatch(true);
15573
- var pcb_component = z58.object({
15574
- type: z58.literal("pcb_component"),
15632
+ var pcb_component = z62.object({
15633
+ type: z62.literal("pcb_component"),
15575
15634
  pcb_component_id: getZodPrefixedIdWithDefault("pcb_component"),
15576
- source_component_id: z58.string(),
15635
+ source_component_id: z62.string(),
15577
15636
  center: point,
15578
15637
  layer: layer_ref,
15579
15638
  rotation,
15580
15639
  width: length,
15581
15640
  height: length,
15582
- subcircuit_id: z58.string().optional(),
15583
- pcb_group_id: z58.string().optional()
15641
+ subcircuit_id: z62.string().optional(),
15642
+ pcb_group_id: z62.string().optional()
15584
15643
  }).describe("Defines a component on the PCB");
15585
15644
  expectTypesMatch(true);
15586
- var pcb_hole_circle_or_square = z59.object({
15587
- type: z59.literal("pcb_hole"),
15645
+ var pcb_hole_circle_or_square = z63.object({
15646
+ type: z63.literal("pcb_hole"),
15588
15647
  pcb_hole_id: getZodPrefixedIdWithDefault("pcb_hole"),
15589
- pcb_group_id: z59.string().optional(),
15590
- subcircuit_id: z59.string().optional(),
15591
- hole_shape: z59.enum(["circle", "square"]),
15592
- 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(),
15593
15652
  x: distance,
15594
15653
  y: distance
15595
15654
  });
@@ -15597,14 +15656,14 @@ var pcb_hole_circle_or_square_shape = pcb_hole_circle_or_square.describe(
15597
15656
  "Defines a circular or square hole on the PCB"
15598
15657
  );
15599
15658
  expectTypesMatch(true);
15600
- var pcb_hole_oval = z59.object({
15601
- type: z59.literal("pcb_hole"),
15659
+ var pcb_hole_oval = z63.object({
15660
+ type: z63.literal("pcb_hole"),
15602
15661
  pcb_hole_id: getZodPrefixedIdWithDefault("pcb_hole"),
15603
- pcb_group_id: z59.string().optional(),
15604
- subcircuit_id: z59.string().optional(),
15605
- hole_shape: z59.literal("oval"),
15606
- hole_width: z59.number(),
15607
- 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(),
15608
15667
  x: distance,
15609
15668
  y: distance
15610
15669
  });
@@ -15613,97 +15672,97 @@ var pcb_hole_oval_shape = pcb_hole_oval.describe(
15613
15672
  );
15614
15673
  expectTypesMatch(true);
15615
15674
  var pcb_hole = pcb_hole_circle_or_square.or(pcb_hole_oval);
15616
- var pcb_plated_hole_circle = z60.object({
15617
- type: z60.literal("pcb_plated_hole"),
15618
- shape: z60.literal("circle"),
15619
- pcb_group_id: z60.string().optional(),
15620
- subcircuit_id: z60.string().optional(),
15621
- outer_diameter: z60.number(),
15622
- 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(),
15623
15682
  x: distance,
15624
15683
  y: distance,
15625
- layers: z60.array(layer_ref),
15626
- port_hints: z60.array(z60.string()).optional(),
15627
- pcb_component_id: z60.string().optional(),
15628
- 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(),
15629
15688
  pcb_plated_hole_id: getZodPrefixedIdWithDefault("pcb_plated_hole")
15630
15689
  });
15631
- var pcb_plated_hole_oval = z60.object({
15632
- type: z60.literal("pcb_plated_hole"),
15633
- shape: z60.enum(["oval", "pill"]),
15634
- pcb_group_id: z60.string().optional(),
15635
- subcircuit_id: z60.string().optional(),
15636
- outer_width: z60.number(),
15637
- outer_height: z60.number(),
15638
- hole_width: z60.number(),
15639
- 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(),
15640
15699
  x: distance,
15641
15700
  y: distance,
15642
- layers: z60.array(layer_ref),
15643
- port_hints: z60.array(z60.string()).optional(),
15644
- pcb_component_id: z60.string().optional(),
15645
- 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(),
15646
15705
  pcb_plated_hole_id: getZodPrefixedIdWithDefault("pcb_plated_hole")
15647
15706
  });
15648
- var pcb_circular_hole_with_rect_pad = z60.object({
15649
- type: z60.literal("pcb_plated_hole"),
15650
- shape: z60.literal("circular_hole_with_rect_pad"),
15651
- pcb_group_id: z60.string().optional(),
15652
- subcircuit_id: z60.string().optional(),
15653
- hole_shape: z60.literal("circle"),
15654
- pad_shape: z60.literal("rect"),
15655
- hole_diameter: z60.number(),
15656
- rect_pad_width: z60.number(),
15657
- 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(),
15658
15717
  x: distance,
15659
15718
  y: distance,
15660
- layers: z60.array(layer_ref),
15661
- port_hints: z60.array(z60.string()).optional(),
15662
- pcb_component_id: z60.string().optional(),
15663
- 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(),
15664
15723
  pcb_plated_hole_id: getZodPrefixedIdWithDefault("pcb_plated_hole")
15665
15724
  });
15666
- var pcb_pill_hole_with_rect_pad = z60.object({
15667
- type: z60.literal("pcb_plated_hole"),
15668
- shape: z60.literal("pill_hole_with_rect_pad"),
15669
- pcb_group_id: z60.string().optional(),
15670
- subcircuit_id: z60.string().optional(),
15671
- hole_shape: z60.literal("pill"),
15672
- pad_shape: z60.literal("rect"),
15673
- hole_width: z60.number(),
15674
- hole_height: z60.number(),
15675
- rect_pad_width: z60.number(),
15676
- 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(),
15677
15736
  x: distance,
15678
15737
  y: distance,
15679
- layers: z60.array(layer_ref),
15680
- port_hints: z60.array(z60.string()).optional(),
15681
- pcb_component_id: z60.string().optional(),
15682
- 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(),
15683
15742
  pcb_plated_hole_id: getZodPrefixedIdWithDefault("pcb_plated_hole")
15684
15743
  });
15685
- var pcb_rotated_pill_hole_with_rect_pad = z60.object({
15686
- type: z60.literal("pcb_plated_hole"),
15687
- shape: z60.literal("rotated_pill_hole_with_rect_pad"),
15688
- pcb_group_id: z60.string().optional(),
15689
- subcircuit_id: z60.string().optional(),
15690
- hole_shape: z60.literal("rotated_pill"),
15691
- pad_shape: z60.literal("rect"),
15692
- hole_width: z60.number(),
15693
- 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(),
15694
15753
  hole_ccw_rotation: rotation,
15695
- rect_pad_width: z60.number(),
15696
- rect_pad_height: z60.number(),
15754
+ rect_pad_width: z64.number(),
15755
+ rect_pad_height: z64.number(),
15697
15756
  rect_ccw_rotation: rotation,
15698
15757
  x: distance,
15699
15758
  y: distance,
15700
- layers: z60.array(layer_ref),
15701
- port_hints: z60.array(z60.string()).optional(),
15702
- pcb_component_id: z60.string().optional(),
15703
- 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(),
15704
15763
  pcb_plated_hole_id: getZodPrefixedIdWithDefault("pcb_plated_hole")
15705
15764
  });
15706
- var pcb_plated_hole = z60.union([
15765
+ var pcb_plated_hole = z64.union([
15707
15766
  pcb_plated_hole_circle,
15708
15767
  pcb_plated_hole_oval,
15709
15768
  pcb_circular_hole_with_rect_pad,
@@ -15717,109 +15776,109 @@ expectTypesMatch(true);
15717
15776
  expectTypesMatch(true);
15718
15777
  expectTypesMatch(true);
15719
15778
  expectTypesMatch(true);
15720
- var pcb_port = z61.object({
15721
- type: z61.literal("pcb_port"),
15779
+ var pcb_port = z65.object({
15780
+ type: z65.literal("pcb_port"),
15722
15781
  pcb_port_id: getZodPrefixedIdWithDefault("pcb_port"),
15723
- pcb_group_id: z61.string().optional(),
15724
- subcircuit_id: z61.string().optional(),
15725
- source_port_id: z61.string(),
15726
- 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(),
15727
15786
  x: distance,
15728
15787
  y: distance,
15729
- layers: z61.array(layer_ref)
15788
+ layers: z65.array(layer_ref)
15730
15789
  }).describe("Defines a port on the PCB");
15731
15790
  expectTypesMatch(true);
15732
- var pcb_smtpad_circle = z62.object({
15733
- type: z62.literal("pcb_smtpad"),
15734
- shape: z62.literal("circle"),
15791
+ var pcb_smtpad_circle = z66.object({
15792
+ type: z66.literal("pcb_smtpad"),
15793
+ shape: z66.literal("circle"),
15735
15794
  pcb_smtpad_id: getZodPrefixedIdWithDefault("pcb_smtpad"),
15736
- pcb_group_id: z62.string().optional(),
15737
- subcircuit_id: z62.string().optional(),
15795
+ pcb_group_id: z66.string().optional(),
15796
+ subcircuit_id: z66.string().optional(),
15738
15797
  x: distance,
15739
15798
  y: distance,
15740
- radius: z62.number(),
15799
+ radius: z66.number(),
15741
15800
  layer: layer_ref,
15742
- port_hints: z62.array(z62.string()).optional(),
15743
- pcb_component_id: z62.string().optional(),
15744
- 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()
15745
15804
  });
15746
- var pcb_smtpad_rect = z62.object({
15747
- type: z62.literal("pcb_smtpad"),
15748
- shape: z62.literal("rect"),
15805
+ var pcb_smtpad_rect = z66.object({
15806
+ type: z66.literal("pcb_smtpad"),
15807
+ shape: z66.literal("rect"),
15749
15808
  pcb_smtpad_id: getZodPrefixedIdWithDefault("pcb_smtpad"),
15750
- pcb_group_id: z62.string().optional(),
15751
- subcircuit_id: z62.string().optional(),
15809
+ pcb_group_id: z66.string().optional(),
15810
+ subcircuit_id: z66.string().optional(),
15752
15811
  x: distance,
15753
15812
  y: distance,
15754
- width: z62.number(),
15755
- height: z62.number(),
15813
+ width: z66.number(),
15814
+ height: z66.number(),
15756
15815
  layer: layer_ref,
15757
- port_hints: z62.array(z62.string()).optional(),
15758
- pcb_component_id: z62.string().optional(),
15759
- 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()
15760
15819
  });
15761
- var pcb_smtpad_rotated_rect = z62.object({
15762
- type: z62.literal("pcb_smtpad"),
15763
- 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"),
15764
15823
  pcb_smtpad_id: getZodPrefixedIdWithDefault("pcb_smtpad"),
15765
- pcb_group_id: z62.string().optional(),
15766
- subcircuit_id: z62.string().optional(),
15824
+ pcb_group_id: z66.string().optional(),
15825
+ subcircuit_id: z66.string().optional(),
15767
15826
  x: distance,
15768
15827
  y: distance,
15769
- width: z62.number(),
15770
- height: z62.number(),
15828
+ width: z66.number(),
15829
+ height: z66.number(),
15771
15830
  ccw_rotation: rotation,
15772
15831
  layer: layer_ref,
15773
- port_hints: z62.array(z62.string()).optional(),
15774
- pcb_component_id: z62.string().optional(),
15775
- 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()
15776
15835
  });
15777
- var pcb_smtpad_pill = z62.object({
15778
- type: z62.literal("pcb_smtpad"),
15779
- shape: z62.literal("pill"),
15836
+ var pcb_smtpad_pill = z66.object({
15837
+ type: z66.literal("pcb_smtpad"),
15838
+ shape: z66.literal("pill"),
15780
15839
  pcb_smtpad_id: getZodPrefixedIdWithDefault("pcb_smtpad"),
15781
- pcb_group_id: z62.string().optional(),
15782
- subcircuit_id: z62.string().optional(),
15840
+ pcb_group_id: z66.string().optional(),
15841
+ subcircuit_id: z66.string().optional(),
15783
15842
  x: distance,
15784
15843
  y: distance,
15785
- width: z62.number(),
15786
- height: z62.number(),
15787
- radius: z62.number(),
15844
+ width: z66.number(),
15845
+ height: z66.number(),
15846
+ radius: z66.number(),
15788
15847
  layer: layer_ref,
15789
- port_hints: z62.array(z62.string()).optional(),
15790
- pcb_component_id: z62.string().optional(),
15791
- 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()
15792
15851
  });
15793
- var pcb_smtpad_rotated_pill = z62.object({
15794
- type: z62.literal("pcb_smtpad"),
15795
- 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"),
15796
15855
  pcb_smtpad_id: getZodPrefixedIdWithDefault("pcb_smtpad"),
15797
- pcb_group_id: z62.string().optional(),
15798
- subcircuit_id: z62.string().optional(),
15856
+ pcb_group_id: z66.string().optional(),
15857
+ subcircuit_id: z66.string().optional(),
15799
15858
  x: distance,
15800
15859
  y: distance,
15801
- width: z62.number(),
15802
- height: z62.number(),
15803
- radius: z62.number(),
15860
+ width: z66.number(),
15861
+ height: z66.number(),
15862
+ radius: z66.number(),
15804
15863
  ccw_rotation: rotation,
15805
15864
  layer: layer_ref,
15806
- port_hints: z62.array(z62.string()).optional(),
15807
- pcb_component_id: z62.string().optional(),
15808
- 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()
15809
15868
  });
15810
- var pcb_smtpad_polygon = z62.object({
15811
- type: z62.literal("pcb_smtpad"),
15812
- shape: z62.literal("polygon"),
15869
+ var pcb_smtpad_polygon = z66.object({
15870
+ type: z66.literal("pcb_smtpad"),
15871
+ shape: z66.literal("polygon"),
15813
15872
  pcb_smtpad_id: getZodPrefixedIdWithDefault("pcb_smtpad"),
15814
- pcb_group_id: z62.string().optional(),
15815
- subcircuit_id: z62.string().optional(),
15816
- points: z62.array(point),
15873
+ pcb_group_id: z66.string().optional(),
15874
+ subcircuit_id: z66.string().optional(),
15875
+ points: z66.array(point),
15817
15876
  layer: layer_ref,
15818
- port_hints: z62.array(z62.string()).optional(),
15819
- pcb_component_id: z62.string().optional(),
15820
- 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()
15821
15880
  });
15822
- var pcb_smtpad = z62.discriminatedUnion("shape", [
15881
+ var pcb_smtpad = z66.discriminatedUnion("shape", [
15823
15882
  pcb_smtpad_circle,
15824
15883
  pcb_smtpad_rect,
15825
15884
  pcb_smtpad_rotated_rect,
@@ -15833,78 +15892,78 @@ expectTypesMatch(true);
15833
15892
  expectTypesMatch(true);
15834
15893
  expectTypesMatch(true);
15835
15894
  expectTypesMatch(true);
15836
- var pcb_solder_paste_circle = z63.object({
15837
- type: z63.literal("pcb_solder_paste"),
15838
- shape: z63.literal("circle"),
15895
+ var pcb_solder_paste_circle = z67.object({
15896
+ type: z67.literal("pcb_solder_paste"),
15897
+ shape: z67.literal("circle"),
15839
15898
  pcb_solder_paste_id: getZodPrefixedIdWithDefault("pcb_solder_paste"),
15840
- pcb_group_id: z63.string().optional(),
15841
- subcircuit_id: z63.string().optional(),
15899
+ pcb_group_id: z67.string().optional(),
15900
+ subcircuit_id: z67.string().optional(),
15842
15901
  x: distance,
15843
15902
  y: distance,
15844
- radius: z63.number(),
15903
+ radius: z67.number(),
15845
15904
  layer: layer_ref,
15846
- pcb_component_id: z63.string().optional(),
15847
- pcb_smtpad_id: z63.string().optional()
15905
+ pcb_component_id: z67.string().optional(),
15906
+ pcb_smtpad_id: z67.string().optional()
15848
15907
  });
15849
- var pcb_solder_paste_rect = z63.object({
15850
- type: z63.literal("pcb_solder_paste"),
15851
- shape: z63.literal("rect"),
15908
+ var pcb_solder_paste_rect = z67.object({
15909
+ type: z67.literal("pcb_solder_paste"),
15910
+ shape: z67.literal("rect"),
15852
15911
  pcb_solder_paste_id: getZodPrefixedIdWithDefault("pcb_solder_paste"),
15853
- pcb_group_id: z63.string().optional(),
15854
- subcircuit_id: z63.string().optional(),
15912
+ pcb_group_id: z67.string().optional(),
15913
+ subcircuit_id: z67.string().optional(),
15855
15914
  x: distance,
15856
15915
  y: distance,
15857
- width: z63.number(),
15858
- height: z63.number(),
15916
+ width: z67.number(),
15917
+ height: z67.number(),
15859
15918
  layer: layer_ref,
15860
- pcb_component_id: z63.string().optional(),
15861
- pcb_smtpad_id: z63.string().optional()
15919
+ pcb_component_id: z67.string().optional(),
15920
+ pcb_smtpad_id: z67.string().optional()
15862
15921
  });
15863
- var pcb_solder_paste_pill = z63.object({
15864
- type: z63.literal("pcb_solder_paste"),
15865
- shape: z63.literal("pill"),
15922
+ var pcb_solder_paste_pill = z67.object({
15923
+ type: z67.literal("pcb_solder_paste"),
15924
+ shape: z67.literal("pill"),
15866
15925
  pcb_solder_paste_id: getZodPrefixedIdWithDefault("pcb_solder_paste"),
15867
- pcb_group_id: z63.string().optional(),
15868
- subcircuit_id: z63.string().optional(),
15926
+ pcb_group_id: z67.string().optional(),
15927
+ subcircuit_id: z67.string().optional(),
15869
15928
  x: distance,
15870
15929
  y: distance,
15871
- width: z63.number(),
15872
- height: z63.number(),
15873
- radius: z63.number(),
15930
+ width: z67.number(),
15931
+ height: z67.number(),
15932
+ radius: z67.number(),
15874
15933
  layer: layer_ref,
15875
- pcb_component_id: z63.string().optional(),
15876
- pcb_smtpad_id: z63.string().optional()
15934
+ pcb_component_id: z67.string().optional(),
15935
+ pcb_smtpad_id: z67.string().optional()
15877
15936
  });
15878
- var pcb_solder_paste_rotated_rect = z63.object({
15879
- type: z63.literal("pcb_solder_paste"),
15880
- 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"),
15881
15940
  pcb_solder_paste_id: getZodPrefixedIdWithDefault("pcb_solder_paste"),
15882
- pcb_group_id: z63.string().optional(),
15883
- subcircuit_id: z63.string().optional(),
15941
+ pcb_group_id: z67.string().optional(),
15942
+ subcircuit_id: z67.string().optional(),
15884
15943
  x: distance,
15885
15944
  y: distance,
15886
- width: z63.number(),
15887
- height: z63.number(),
15945
+ width: z67.number(),
15946
+ height: z67.number(),
15888
15947
  ccw_rotation: distance,
15889
15948
  layer: layer_ref,
15890
- pcb_component_id: z63.string().optional(),
15891
- pcb_smtpad_id: z63.string().optional()
15949
+ pcb_component_id: z67.string().optional(),
15950
+ pcb_smtpad_id: z67.string().optional()
15892
15951
  });
15893
- var pcb_solder_paste_oval = z63.object({
15894
- type: z63.literal("pcb_solder_paste"),
15895
- shape: z63.literal("oval"),
15952
+ var pcb_solder_paste_oval = z67.object({
15953
+ type: z67.literal("pcb_solder_paste"),
15954
+ shape: z67.literal("oval"),
15896
15955
  pcb_solder_paste_id: getZodPrefixedIdWithDefault("pcb_solder_paste"),
15897
- pcb_group_id: z63.string().optional(),
15898
- subcircuit_id: z63.string().optional(),
15956
+ pcb_group_id: z67.string().optional(),
15957
+ subcircuit_id: z67.string().optional(),
15899
15958
  x: distance,
15900
15959
  y: distance,
15901
- width: z63.number(),
15902
- height: z63.number(),
15960
+ width: z67.number(),
15961
+ height: z67.number(),
15903
15962
  layer: layer_ref,
15904
- pcb_component_id: z63.string().optional(),
15905
- pcb_smtpad_id: z63.string().optional()
15963
+ pcb_component_id: z67.string().optional(),
15964
+ pcb_smtpad_id: z67.string().optional()
15906
15965
  });
15907
- var pcb_solder_paste = z63.union([
15966
+ var pcb_solder_paste = z67.union([
15908
15967
  pcb_solder_paste_circle,
15909
15968
  pcb_solder_paste_rect,
15910
15969
  pcb_solder_paste_pill,
@@ -15918,115 +15977,115 @@ expectTypesMatch(
15918
15977
  true
15919
15978
  );
15920
15979
  expectTypesMatch(true);
15921
- var pcb_text = z64.object({
15922
- type: z64.literal("pcb_text"),
15980
+ var pcb_text = z68.object({
15981
+ type: z68.literal("pcb_text"),
15923
15982
  pcb_text_id: getZodPrefixedIdWithDefault("pcb_text"),
15924
- pcb_group_id: z64.string().optional(),
15925
- subcircuit_id: z64.string().optional(),
15926
- text: z64.string(),
15983
+ pcb_group_id: z68.string().optional(),
15984
+ subcircuit_id: z68.string().optional(),
15985
+ text: z68.string(),
15927
15986
  center: point,
15928
15987
  layer: layer_ref,
15929
15988
  width: length,
15930
15989
  height: length,
15931
- lines: z64.number(),
15990
+ lines: z68.number(),
15932
15991
  // @ts-ignore
15933
- align: z64.enum(["bottom-left"])
15992
+ align: z68.enum(["bottom-left"])
15934
15993
  }).describe("Defines text on the PCB");
15935
15994
  expectTypesMatch(true);
15936
- var pcb_trace_route_point_wire = z65.object({
15937
- route_type: z65.literal("wire"),
15995
+ var pcb_trace_route_point_wire = z69.object({
15996
+ route_type: z69.literal("wire"),
15938
15997
  x: distance,
15939
15998
  y: distance,
15940
15999
  width: distance,
15941
- start_pcb_port_id: z65.string().optional(),
15942
- end_pcb_port_id: z65.string().optional(),
16000
+ start_pcb_port_id: z69.string().optional(),
16001
+ end_pcb_port_id: z69.string().optional(),
15943
16002
  layer: layer_ref
15944
16003
  });
15945
- var pcb_trace_route_point_via = z65.object({
15946
- route_type: z65.literal("via"),
16004
+ var pcb_trace_route_point_via = z69.object({
16005
+ route_type: z69.literal("via"),
15947
16006
  x: distance,
15948
16007
  y: distance,
15949
16008
  hole_diameter: distance.optional(),
15950
16009
  outer_diameter: distance.optional(),
15951
- from_layer: z65.string(),
15952
- to_layer: z65.string()
16010
+ from_layer: z69.string(),
16011
+ to_layer: z69.string()
15953
16012
  });
15954
- var pcb_trace_route_point = z65.union([
16013
+ var pcb_trace_route_point = z69.union([
15955
16014
  pcb_trace_route_point_wire,
15956
16015
  pcb_trace_route_point_via
15957
16016
  ]);
15958
- var pcb_trace = z65.object({
15959
- type: z65.literal("pcb_trace"),
15960
- source_trace_id: z65.string().optional(),
15961
- 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(),
15962
16021
  pcb_trace_id: getZodPrefixedIdWithDefault("pcb_trace"),
15963
- pcb_group_id: z65.string().optional(),
15964
- subcircuit_id: z65.string().optional(),
15965
- route_thickness_mode: z65.enum(["constant", "interpolated"]).default("constant").optional(),
15966
- route_order_index: z65.number().optional(),
15967
- should_round_corners: z65.boolean().optional(),
15968
- trace_length: z65.number().optional(),
15969
- 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)
15970
16029
  }).describe("Defines a trace on the PCB");
15971
16030
  expectTypesMatch(true);
15972
16031
  expectTypesMatch(true);
15973
- var pcb_trace_error = z66.object({
15974
- type: z66.literal("pcb_trace_error"),
16032
+ var pcb_trace_error = z70.object({
16033
+ type: z70.literal("pcb_trace_error"),
15975
16034
  pcb_trace_error_id: getZodPrefixedIdWithDefault("pcb_trace_error"),
15976
- error_type: z66.literal("pcb_trace_error").default("pcb_trace_error"),
15977
- message: z66.string(),
16035
+ error_type: z70.literal("pcb_trace_error").default("pcb_trace_error"),
16036
+ message: z70.string(),
15978
16037
  center: point.optional(),
15979
- pcb_trace_id: z66.string(),
15980
- source_trace_id: z66.string(),
15981
- pcb_component_ids: z66.array(z66.string()),
15982
- pcb_port_ids: z66.array(z66.string()),
15983
- 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()
15984
16043
  }).describe("Defines a trace error on the PCB");
15985
16044
  expectTypesMatch(true);
15986
- var pcb_trace_missing_error = z67.object({
15987
- type: z67.literal("pcb_trace_missing_error"),
16045
+ var pcb_trace_missing_error = z71.object({
16046
+ type: z71.literal("pcb_trace_missing_error"),
15988
16047
  pcb_trace_missing_error_id: getZodPrefixedIdWithDefault(
15989
16048
  "pcb_trace_missing_error"
15990
16049
  ),
15991
- error_type: z67.literal("pcb_trace_missing_error").default("pcb_trace_missing_error"),
15992
- message: z67.string(),
16050
+ error_type: z71.literal("pcb_trace_missing_error").default("pcb_trace_missing_error"),
16051
+ message: z71.string(),
15993
16052
  center: point.optional(),
15994
- source_trace_id: z67.string(),
15995
- pcb_component_ids: z67.array(z67.string()),
15996
- pcb_port_ids: z67.array(z67.string()),
15997
- 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()
15998
16057
  }).describe(
15999
16058
  "Defines an error when a source trace has no corresponding PCB trace"
16000
16059
  );
16001
16060
  expectTypesMatch(true);
16002
- var pcb_port_not_matched_error = z68.object({
16003
- 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"),
16004
16063
  pcb_error_id: getZodPrefixedIdWithDefault("pcb_error"),
16005
- error_type: z68.literal("pcb_port_not_matched_error").default("pcb_port_not_matched_error"),
16006
- message: z68.string(),
16007
- pcb_component_ids: z68.array(z68.string()),
16008
- 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()
16009
16068
  }).describe("Defines a trace error on the PCB where a port is not matched");
16010
16069
  expectTypesMatch(true);
16011
- var pcb_port_not_connected_error = z69.object({
16012
- 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"),
16013
16072
  pcb_port_not_connected_error_id: getZodPrefixedIdWithDefault(
16014
16073
  "pcb_port_not_connected_error"
16015
16074
  ),
16016
- error_type: z69.literal("pcb_port_not_connected_error").default("pcb_port_not_connected_error"),
16017
- message: z69.string(),
16018
- pcb_port_ids: z69.array(z69.string()),
16019
- pcb_component_ids: z69.array(z69.string()),
16020
- 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()
16021
16080
  }).describe("Defines an error when a pcb port is not connected to any trace");
16022
16081
  expectTypesMatch(
16023
16082
  true
16024
16083
  );
16025
- var pcb_via = z70.object({
16026
- type: z70.literal("pcb_via"),
16084
+ var pcb_via = z74.object({
16085
+ type: z74.literal("pcb_via"),
16027
16086
  pcb_via_id: getZodPrefixedIdWithDefault("pcb_via"),
16028
- pcb_group_id: z70.string().optional(),
16029
- subcircuit_id: z70.string().optional(),
16087
+ pcb_group_id: z74.string().optional(),
16088
+ subcircuit_id: z74.string().optional(),
16030
16089
  x: distance,
16031
16090
  y: distance,
16032
16091
  outer_diameter: distance.default("0.6mm"),
@@ -16035,47 +16094,47 @@ var pcb_via = z70.object({
16035
16094
  from_layer: layer_ref.optional(),
16036
16095
  /** @deprecated */
16037
16096
  to_layer: layer_ref.optional(),
16038
- layers: z70.array(layer_ref),
16039
- pcb_trace_id: z70.string().optional()
16097
+ layers: z74.array(layer_ref),
16098
+ pcb_trace_id: z74.string().optional()
16040
16099
  }).describe("Defines a via on the PCB");
16041
16100
  expectTypesMatch(true);
16042
- var pcb_board = z71.object({
16043
- type: z71.literal("pcb_board"),
16101
+ var pcb_board = z75.object({
16102
+ type: z75.literal("pcb_board"),
16044
16103
  pcb_board_id: getZodPrefixedIdWithDefault("pcb_board"),
16045
- is_subcircuit: z71.boolean().optional(),
16046
- subcircuit_id: z71.string().optional(),
16104
+ is_subcircuit: z75.boolean().optional(),
16105
+ subcircuit_id: z75.string().optional(),
16047
16106
  width: length,
16048
16107
  height: length,
16049
16108
  center: point,
16050
16109
  thickness: length.optional().default(1.4),
16051
- num_layers: z71.number().optional().default(4),
16052
- outline: z71.array(point).optional(),
16053
- 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")
16054
16113
  }).describe("Defines the board outline of the PCB");
16055
16114
  expectTypesMatch(true);
16056
- var pcb_placement_error = z72.object({
16057
- type: z72.literal("pcb_placement_error"),
16115
+ var pcb_placement_error = z76.object({
16116
+ type: z76.literal("pcb_placement_error"),
16058
16117
  pcb_placement_error_id: getZodPrefixedIdWithDefault("pcb_placement_error"),
16059
- error_type: z72.literal("pcb_placement_error").default("pcb_placement_error"),
16060
- message: z72.string(),
16061
- 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()
16062
16121
  }).describe("Defines a placement error on the PCB");
16063
16122
  expectTypesMatch(true);
16064
- var pcb_trace_hint = z73.object({
16065
- type: z73.literal("pcb_trace_hint"),
16123
+ var pcb_trace_hint = z77.object({
16124
+ type: z77.literal("pcb_trace_hint"),
16066
16125
  pcb_trace_hint_id: getZodPrefixedIdWithDefault("pcb_trace_hint"),
16067
- pcb_port_id: z73.string(),
16068
- pcb_component_id: z73.string(),
16069
- route: z73.array(route_hint_point),
16070
- 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()
16071
16130
  }).describe("A hint that can be used during generation of a PCB trace");
16072
16131
  expectTypesMatch(true);
16073
- var pcb_silkscreen_line = z74.object({
16074
- type: z74.literal("pcb_silkscreen_line"),
16132
+ var pcb_silkscreen_line = z78.object({
16133
+ type: z78.literal("pcb_silkscreen_line"),
16075
16134
  pcb_silkscreen_line_id: getZodPrefixedIdWithDefault("pcb_silkscreen_line"),
16076
- pcb_component_id: z74.string(),
16077
- pcb_group_id: z74.string().optional(),
16078
- subcircuit_id: z74.string().optional(),
16135
+ pcb_component_id: z78.string(),
16136
+ pcb_group_id: z78.string().optional(),
16137
+ subcircuit_id: z78.string().optional(),
16079
16138
  stroke_width: distance.default("0.1mm"),
16080
16139
  x1: distance,
16081
16140
  y1: distance,
@@ -16084,159 +16143,159 @@ var pcb_silkscreen_line = z74.object({
16084
16143
  layer: visible_layer
16085
16144
  }).describe("Defines a silkscreen line on the PCB");
16086
16145
  expectTypesMatch(true);
16087
- var pcb_silkscreen_path = z75.object({
16088
- type: z75.literal("pcb_silkscreen_path"),
16146
+ var pcb_silkscreen_path = z79.object({
16147
+ type: z79.literal("pcb_silkscreen_path"),
16089
16148
  pcb_silkscreen_path_id: getZodPrefixedIdWithDefault("pcb_silkscreen_path"),
16090
- pcb_component_id: z75.string(),
16091
- pcb_group_id: z75.string().optional(),
16092
- subcircuit_id: z75.string().optional(),
16149
+ pcb_component_id: z79.string(),
16150
+ pcb_group_id: z79.string().optional(),
16151
+ subcircuit_id: z79.string().optional(),
16093
16152
  layer: visible_layer,
16094
- route: z75.array(point),
16153
+ route: z79.array(point),
16095
16154
  stroke_width: length
16096
16155
  }).describe("Defines a silkscreen path on the PCB");
16097
16156
  expectTypesMatch(true);
16098
- var pcb_silkscreen_text = z76.object({
16099
- type: z76.literal("pcb_silkscreen_text"),
16157
+ var pcb_silkscreen_text = z80.object({
16158
+ type: z80.literal("pcb_silkscreen_text"),
16100
16159
  pcb_silkscreen_text_id: getZodPrefixedIdWithDefault("pcb_silkscreen_text"),
16101
- pcb_group_id: z76.string().optional(),
16102
- subcircuit_id: z76.string().optional(),
16103
- 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"),
16104
16163
  font_size: distance.default("0.2mm"),
16105
- pcb_component_id: z76.string(),
16106
- text: z76.string(),
16107
- ccw_rotation: z76.number().optional(),
16164
+ pcb_component_id: z80.string(),
16165
+ text: z80.string(),
16166
+ ccw_rotation: z80.number().optional(),
16108
16167
  layer: layer_ref,
16109
- is_mirrored: z76.boolean().default(false).optional(),
16168
+ is_mirrored: z80.boolean().default(false).optional(),
16110
16169
  anchor_position: point.default({ x: 0, y: 0 }),
16111
16170
  anchor_alignment: ninePointAnchor.default("center")
16112
16171
  }).describe("Defines silkscreen text on the PCB");
16113
16172
  expectTypesMatch(true);
16114
- var pcb_silkscreen_rect = z77.object({
16115
- type: z77.literal("pcb_silkscreen_rect"),
16173
+ var pcb_silkscreen_rect = z81.object({
16174
+ type: z81.literal("pcb_silkscreen_rect"),
16116
16175
  pcb_silkscreen_rect_id: getZodPrefixedIdWithDefault("pcb_silkscreen_rect"),
16117
- pcb_component_id: z77.string(),
16118
- pcb_group_id: z77.string().optional(),
16119
- subcircuit_id: z77.string().optional(),
16176
+ pcb_component_id: z81.string(),
16177
+ pcb_group_id: z81.string().optional(),
16178
+ subcircuit_id: z81.string().optional(),
16120
16179
  center: point,
16121
16180
  width: length,
16122
16181
  height: length,
16123
16182
  layer: layer_ref,
16124
16183
  stroke_width: length.default("1mm"),
16125
- is_filled: z77.boolean().default(true).optional(),
16126
- has_stroke: z77.boolean().optional(),
16127
- 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()
16128
16187
  }).describe("Defines a silkscreen rect on the PCB");
16129
16188
  expectTypesMatch(true);
16130
- var pcb_silkscreen_circle = z78.object({
16131
- type: z78.literal("pcb_silkscreen_circle"),
16189
+ var pcb_silkscreen_circle = z82.object({
16190
+ type: z82.literal("pcb_silkscreen_circle"),
16132
16191
  pcb_silkscreen_circle_id: getZodPrefixedIdWithDefault(
16133
16192
  "pcb_silkscreen_circle"
16134
16193
  ),
16135
- pcb_component_id: z78.string(),
16136
- pcb_group_id: z78.string().optional(),
16137
- subcircuit_id: z78.string().optional(),
16194
+ pcb_component_id: z82.string(),
16195
+ pcb_group_id: z82.string().optional(),
16196
+ subcircuit_id: z82.string().optional(),
16138
16197
  center: point,
16139
16198
  radius: length,
16140
16199
  layer: visible_layer,
16141
16200
  stroke_width: length.default("1mm")
16142
16201
  }).describe("Defines a silkscreen circle on the PCB");
16143
16202
  expectTypesMatch(true);
16144
- var pcb_silkscreen_oval = z79.object({
16145
- type: z79.literal("pcb_silkscreen_oval"),
16203
+ var pcb_silkscreen_oval = z83.object({
16204
+ type: z83.literal("pcb_silkscreen_oval"),
16146
16205
  pcb_silkscreen_oval_id: getZodPrefixedIdWithDefault("pcb_silkscreen_oval"),
16147
- pcb_component_id: z79.string(),
16148
- pcb_group_id: z79.string().optional(),
16149
- subcircuit_id: z79.string().optional(),
16206
+ pcb_component_id: z83.string(),
16207
+ pcb_group_id: z83.string().optional(),
16208
+ subcircuit_id: z83.string().optional(),
16150
16209
  center: point,
16151
16210
  radius_x: distance,
16152
16211
  radius_y: distance,
16153
16212
  layer: visible_layer
16154
16213
  }).describe("Defines a silkscreen oval on the PCB");
16155
16214
  expectTypesMatch(true);
16156
- var pcb_fabrication_note_text = z80.object({
16157
- type: z80.literal("pcb_fabrication_note_text"),
16215
+ var pcb_fabrication_note_text = z84.object({
16216
+ type: z84.literal("pcb_fabrication_note_text"),
16158
16217
  pcb_fabrication_note_text_id: getZodPrefixedIdWithDefault(
16159
16218
  "pcb_fabrication_note_text"
16160
16219
  ),
16161
- subcircuit_id: z80.string().optional(),
16162
- pcb_group_id: z80.string().optional(),
16163
- 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"),
16164
16223
  font_size: distance.default("1mm"),
16165
- pcb_component_id: z80.string(),
16166
- text: z80.string(),
16224
+ pcb_component_id: z84.string(),
16225
+ text: z84.string(),
16167
16226
  layer: visible_layer,
16168
16227
  anchor_position: point.default({ x: 0, y: 0 }),
16169
- anchor_alignment: z80.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
16170
- 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()
16171
16230
  }).describe(
16172
16231
  "Defines a fabrication note in text on the PCB, useful for leaving notes for assemblers or fabricators"
16173
16232
  );
16174
16233
  expectTypesMatch(true);
16175
- var pcb_fabrication_note_path = z81.object({
16176
- type: z81.literal("pcb_fabrication_note_path"),
16234
+ var pcb_fabrication_note_path = z85.object({
16235
+ type: z85.literal("pcb_fabrication_note_path"),
16177
16236
  pcb_fabrication_note_path_id: getZodPrefixedIdWithDefault(
16178
16237
  "pcb_fabrication_note_path"
16179
16238
  ),
16180
- pcb_component_id: z81.string(),
16181
- subcircuit_id: z81.string().optional(),
16239
+ pcb_component_id: z85.string(),
16240
+ subcircuit_id: z85.string().optional(),
16182
16241
  layer: layer_ref,
16183
- route: z81.array(point),
16242
+ route: z85.array(point),
16184
16243
  stroke_width: length,
16185
- color: z81.string().optional()
16244
+ color: z85.string().optional()
16186
16245
  }).describe(
16187
16246
  "Defines a fabrication path on the PCB for fabricators or assemblers"
16188
16247
  );
16189
16248
  expectTypesMatch(true);
16190
- var pcb_footprint_overlap_error = z82.object({
16191
- type: z82.literal("pcb_footprint_overlap_error"),
16249
+ var pcb_footprint_overlap_error = z86.object({
16250
+ type: z86.literal("pcb_footprint_overlap_error"),
16192
16251
  pcb_error_id: getZodPrefixedIdWithDefault("pcb_error"),
16193
- error_type: z82.literal("pcb_footprint_overlap_error").default("pcb_footprint_overlap_error"),
16194
- message: z82.string(),
16195
- pcb_smtpad_ids: z82.array(z82.string()).optional(),
16196
- pcb_plated_hole_ids: z82.array(z82.string()).optional(),
16197
- pcb_hole_ids: z82.array(z82.string()).optional(),
16198
- 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()
16199
16258
  }).describe("Error emitted when a pcb footprint overlaps with another element");
16200
16259
  expectTypesMatch(
16201
16260
  true
16202
16261
  );
16203
- var pcb_keepout = z83.object({
16204
- type: z83.literal("pcb_keepout"),
16205
- shape: z83.literal("rect"),
16206
- pcb_group_id: z83.string().optional(),
16207
- 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(),
16208
16267
  center: point,
16209
16268
  width: distance,
16210
16269
  height: distance,
16211
- pcb_keepout_id: z83.string(),
16212
- layers: z83.array(z83.string()),
16270
+ pcb_keepout_id: z87.string(),
16271
+ layers: z87.array(z87.string()),
16213
16272
  // Specify layers where the keepout applies
16214
- description: z83.string().optional()
16273
+ description: z87.string().optional()
16215
16274
  // Optional description of the keepout
16216
16275
  }).or(
16217
- z83.object({
16218
- type: z83.literal("pcb_keepout"),
16219
- shape: z83.literal("circle"),
16220
- pcb_group_id: z83.string().optional(),
16221
- 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(),
16222
16281
  center: point,
16223
16282
  radius: distance,
16224
- pcb_keepout_id: z83.string(),
16225
- layers: z83.array(z83.string()),
16283
+ pcb_keepout_id: z87.string(),
16284
+ layers: z87.array(z87.string()),
16226
16285
  // Specify layers where the keepout applies
16227
- description: z83.string().optional()
16286
+ description: z87.string().optional()
16228
16287
  // Optional description of the keepout
16229
16288
  })
16230
16289
  );
16231
16290
  expectTypesMatch(true);
16232
- var pcb_cutout_base = z84.object({
16233
- type: z84.literal("pcb_cutout"),
16291
+ var pcb_cutout_base = z88.object({
16292
+ type: z88.literal("pcb_cutout"),
16234
16293
  pcb_cutout_id: getZodPrefixedIdWithDefault("pcb_cutout"),
16235
- pcb_group_id: z84.string().optional(),
16236
- subcircuit_id: z84.string().optional()
16294
+ pcb_group_id: z88.string().optional(),
16295
+ subcircuit_id: z88.string().optional()
16237
16296
  });
16238
16297
  var pcb_cutout_rect = pcb_cutout_base.extend({
16239
- shape: z84.literal("rect"),
16298
+ shape: z88.literal("rect"),
16240
16299
  center: point,
16241
16300
  width: length,
16242
16301
  height: length,
@@ -16244,178 +16303,223 @@ var pcb_cutout_rect = pcb_cutout_base.extend({
16244
16303
  });
16245
16304
  expectTypesMatch(true);
16246
16305
  var pcb_cutout_circle = pcb_cutout_base.extend({
16247
- shape: z84.literal("circle"),
16306
+ shape: z88.literal("circle"),
16248
16307
  center: point,
16249
16308
  radius: length
16250
16309
  });
16251
16310
  expectTypesMatch(true);
16252
16311
  var pcb_cutout_polygon = pcb_cutout_base.extend({
16253
- shape: z84.literal("polygon"),
16254
- points: z84.array(point)
16312
+ shape: z88.literal("polygon"),
16313
+ points: z88.array(point)
16255
16314
  });
16256
16315
  expectTypesMatch(true);
16257
- var pcb_cutout = z84.discriminatedUnion("shape", [
16316
+ var pcb_cutout = z88.discriminatedUnion("shape", [
16258
16317
  pcb_cutout_rect,
16259
16318
  pcb_cutout_circle,
16260
16319
  pcb_cutout_polygon
16261
16320
  ]).describe("Defines a cutout on the PCB, removing board material.");
16262
16321
  expectTypesMatch(true);
16263
- var pcb_missing_footprint_error = z85.object({
16264
- type: z85.literal("pcb_missing_footprint_error"),
16322
+ var pcb_missing_footprint_error = z89.object({
16323
+ type: z89.literal("pcb_missing_footprint_error"),
16265
16324
  pcb_missing_footprint_error_id: getZodPrefixedIdWithDefault(
16266
16325
  "pcb_missing_footprint_error"
16267
16326
  ),
16268
- pcb_group_id: z85.string().optional(),
16269
- subcircuit_id: z85.string().optional(),
16270
- error_type: z85.literal("pcb_missing_footprint_error").default("pcb_missing_footprint_error"),
16271
- source_component_id: z85.string(),
16272
- 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()
16273
16332
  }).describe("Defines a missing footprint error on the PCB");
16274
16333
  expectTypesMatch(
16275
16334
  true
16276
16335
  );
16277
- var pcb_group = z86.object({
16278
- type: z86.literal("pcb_group"),
16336
+ var pcb_group = z90.object({
16337
+ type: z90.literal("pcb_group"),
16279
16338
  pcb_group_id: getZodPrefixedIdWithDefault("pcb_group"),
16280
- source_group_id: z86.string(),
16281
- is_subcircuit: z86.boolean().optional(),
16282
- subcircuit_id: z86.string().optional(),
16339
+ source_group_id: z90.string(),
16340
+ is_subcircuit: z90.boolean().optional(),
16341
+ subcircuit_id: z90.string().optional(),
16283
16342
  width: length,
16284
16343
  height: length,
16285
16344
  center: point,
16286
- pcb_component_ids: z86.array(z86.string()),
16287
- name: z86.string().optional(),
16288
- description: z86.string().optional(),
16289
- layout_mode: z86.string().optional(),
16290
- 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({
16291
16350
  trace_clearance: length
16292
16351
  }).optional(),
16293
- autorouter_used_string: z86.string().optional()
16352
+ autorouter_used_string: z90.string().optional()
16294
16353
  }).describe("Defines a group of components on the PCB");
16295
16354
  expectTypesMatch(true);
16296
- var pcb_autorouting_error = z87.object({
16297
- type: z87.literal("pcb_autorouting_error"),
16355
+ var pcb_autorouting_error = z91.object({
16356
+ type: z91.literal("pcb_autorouting_error"),
16298
16357
  pcb_error_id: getZodPrefixedIdWithDefault("pcb_autorouting_error"),
16299
- error_type: z87.literal("pcb_autorouting_error").default("pcb_autorouting_error"),
16300
- message: z87.string(),
16301
- 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()
16302
16361
  }).describe("The autorouting has failed to route a portion of the board");
16303
16362
  expectTypesMatch(true);
16304
- var pcb_manual_edit_conflict_warning = z88.object({
16305
- 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"),
16306
16365
  pcb_manual_edit_conflict_warning_id: getZodPrefixedIdWithDefault(
16307
16366
  "pcb_manual_edit_conflict_warning"
16308
16367
  ),
16309
- warning_type: z88.literal("pcb_manual_edit_conflict_warning").default("pcb_manual_edit_conflict_warning"),
16310
- message: z88.string(),
16311
- pcb_component_id: z88.string(),
16312
- pcb_group_id: z88.string().optional(),
16313
- subcircuit_id: z88.string().optional(),
16314
- 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()
16315
16374
  }).describe(
16316
16375
  "Warning emitted when a component has both manual placement and explicit pcbX/pcbY coordinates"
16317
16376
  );
16318
16377
  expectTypesMatch(true);
16319
- var pcb_breakout_point = z89.object({
16320
- type: z89.literal("pcb_breakout_point"),
16378
+ var pcb_breakout_point = z93.object({
16379
+ type: z93.literal("pcb_breakout_point"),
16321
16380
  pcb_breakout_point_id: getZodPrefixedIdWithDefault("pcb_breakout_point"),
16322
- pcb_group_id: z89.string(),
16323
- subcircuit_id: z89.string().optional(),
16324
- source_trace_id: z89.string().optional(),
16325
- source_port_id: z89.string().optional(),
16326
- 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(),
16327
16386
  x: distance,
16328
16387
  y: distance
16329
16388
  }).describe(
16330
16389
  "Defines a routing target within a pcb_group for a source_trace or source_net"
16331
16390
  );
16332
16391
  expectTypesMatch(true);
16333
- var pcb_ground_plane = z90.object({
16334
- type: z90.literal("pcb_ground_plane"),
16392
+ var pcb_ground_plane = z94.object({
16393
+ type: z94.literal("pcb_ground_plane"),
16335
16394
  pcb_ground_plane_id: getZodPrefixedIdWithDefault("pcb_ground_plane"),
16336
- source_pcb_ground_plane_id: z90.string(),
16337
- source_net_id: z90.string(),
16338
- pcb_group_id: z90.string().optional(),
16339
- 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()
16340
16399
  }).describe("Defines a ground plane on the PCB");
16341
16400
  expectTypesMatch(true);
16342
- var pcb_ground_plane_region = z91.object({
16343
- type: z91.literal("pcb_ground_plane_region"),
16401
+ var pcb_ground_plane_region = z95.object({
16402
+ type: z95.literal("pcb_ground_plane_region"),
16344
16403
  pcb_ground_plane_region_id: getZodPrefixedIdWithDefault(
16345
16404
  "pcb_ground_plane_region"
16346
16405
  ),
16347
- pcb_ground_plane_id: z91.string(),
16348
- pcb_group_id: z91.string().optional(),
16349
- 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(),
16350
16409
  layer: layer_ref,
16351
- points: z91.array(point)
16410
+ points: z95.array(point)
16352
16411
  }).describe("Defines a polygon region of a ground plane");
16353
16412
  expectTypesMatch(true);
16354
- var pcb_thermal_spoke = z92.object({
16355
- type: z92.literal("pcb_thermal_spoke"),
16413
+ var pcb_thermal_spoke = z96.object({
16414
+ type: z96.literal("pcb_thermal_spoke"),
16356
16415
  pcb_thermal_spoke_id: getZodPrefixedIdWithDefault("pcb_thermal_spoke"),
16357
- pcb_ground_plane_id: z92.string(),
16358
- shape: z92.string(),
16359
- spoke_count: z92.number(),
16416
+ pcb_ground_plane_id: z96.string(),
16417
+ shape: z96.string(),
16418
+ spoke_count: z96.number(),
16360
16419
  spoke_thickness: distance,
16361
16420
  spoke_inner_diameter: distance,
16362
16421
  spoke_outer_diameter: distance,
16363
- pcb_plated_hole_id: z92.string().optional(),
16364
- subcircuit_id: z92.string().optional()
16422
+ pcb_plated_hole_id: z96.string().optional(),
16423
+ subcircuit_id: z96.string().optional()
16365
16424
  }).describe("Pattern for connecting a ground plane to a plated hole");
16366
16425
  expectTypesMatch(true);
16367
- var cad_component = z93.object({
16368
- type: z93.literal("cad_component"),
16369
- cad_component_id: z93.string(),
16370
- pcb_component_id: z93.string(),
16371
- 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(),
16372
16464
  position: point3,
16373
16465
  rotation: point3.optional(),
16374
16466
  size: point3.optional(),
16375
16467
  layer: layer_ref.optional(),
16376
- subcircuit_id: z93.string().optional(),
16468
+ subcircuit_id: z98.string().optional(),
16377
16469
  // These are all ways to generate/load the 3d model
16378
- footprinter_string: z93.string().optional(),
16379
- model_obj_url: z93.string().optional(),
16380
- model_stl_url: z93.string().optional(),
16381
- model_3mf_url: z93.string().optional(),
16382
- 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()
16383
16475
  }).describe("Defines a component on the PCB");
16384
16476
  expectTypesMatch(true);
16385
- var wave_shape = z94.enum(["sinewave", "square", "triangle", "sawtooth"]);
16386
- var simulation_dc_voltage_source = z94.object({
16387
- 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"),
16388
16491
  simulation_voltage_source_id: getZodPrefixedIdWithDefault(
16389
16492
  "simulation_voltage_source"
16390
16493
  ),
16391
- is_dc_source: z94.literal(true).optional().default(true),
16392
- positive_source_port_id: z94.string().optional(),
16393
- negative_source_port_id: z94.string().optional(),
16394
- positive_source_net_id: z94.string().optional(),
16395
- 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(),
16396
16499
  voltage
16397
16500
  }).describe("Defines a DC voltage source for simulation");
16398
- var simulation_ac_voltage_source = z94.object({
16399
- type: z94.literal("simulation_voltage_source"),
16501
+ var simulation_ac_voltage_source = z99.object({
16502
+ type: z99.literal("simulation_voltage_source"),
16400
16503
  simulation_voltage_source_id: getZodPrefixedIdWithDefault(
16401
16504
  "simulation_voltage_source"
16402
16505
  ),
16403
- is_dc_source: z94.literal(false),
16404
- terminal1_source_port_id: z94.string().optional(),
16405
- terminal2_source_port_id: z94.string().optional(),
16406
- terminal1_source_net_id: z94.string().optional(),
16407
- 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(),
16408
16511
  voltage: voltage.optional(),
16409
16512
  frequency: frequency.optional(),
16410
16513
  peak_to_peak_voltage: voltage.optional(),
16411
16514
  wave_shape: wave_shape.optional(),
16412
- phase: rotation.optional()
16515
+ phase: rotation.optional(),
16516
+ duty_cycle: percentage.optional()
16413
16517
  }).describe("Defines an AC voltage source for simulation");
16414
- 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");
16415
16519
  expectTypesMatch(true);
16416
16520
  expectTypesMatch(true);
16417
16521
  expectTypesMatch(true);
16418
- var any_circuit_element = z95.union([
16522
+ var any_circuit_element = z100.union([
16419
16523
  source_trace,
16420
16524
  source_port,
16421
16525
  any_source_component,
@@ -16430,6 +16534,7 @@ var any_circuit_element = z95.union([
16430
16534
  source_simple_battery,
16431
16535
  source_simple_inductor,
16432
16536
  source_simple_pin_header,
16537
+ source_simple_pinout,
16433
16538
  source_simple_resonator,
16434
16539
  source_simple_switch,
16435
16540
  source_simple_transistor,
@@ -16438,8 +16543,10 @@ var any_circuit_element = z95.union([
16438
16543
  source_simple_potentiometer,
16439
16544
  source_simple_push_button,
16440
16545
  source_pcb_ground_plane,
16546
+ source_manually_placed_via,
16441
16547
  source_project_metadata,
16442
16548
  source_trace_not_connected_error,
16549
+ source_pin_missing_trace_warning,
16443
16550
  pcb_component,
16444
16551
  pcb_hole,
16445
16552
  pcb_missing_footprint_error,
@@ -16475,6 +16582,7 @@ var any_circuit_element = z95.union([
16475
16582
  pcb_ground_plane,
16476
16583
  pcb_ground_plane_region,
16477
16584
  pcb_thermal_spoke,
16585
+ pcb_copper_pour,
16478
16586
  schematic_box,
16479
16587
  schematic_text,
16480
16588
  schematic_line,
@@ -16504,7 +16612,7 @@ import { z as z410 } from "zod";
16504
16612
  import { z as z610 } from "zod";
16505
16613
  import { z as z810 } from "zod";
16506
16614
  import { z as z710 } from "zod";
16507
- import { z as z97 } from "zod";
16615
+ import { z as z910 } from "zod";
16508
16616
  import "zod";
16509
16617
  import "zod";
16510
16618
  import { z as z122 } from "zod";
@@ -16683,12 +16791,12 @@ function convertMilToMm(value) {
16683
16791
  }
16684
16792
  return Number(value);
16685
16793
  }
16686
- var lengthInMm = z96.union([z96.string(), z96.number()]).transform((val) => convertMilToMm(val));
16687
- var extendDipDef = (newDefaults) => z96.object({
16688
- fn: z96.string(),
16689
- num_pins: z96.number().optional().default(6),
16690
- wide: z96.boolean().optional(),
16691
- 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(),
16692
16800
  w: lengthInMm.optional(),
16693
16801
  p: lengthInMm.default(newDefaults.p ?? "2.54mm"),
16694
16802
  id: lengthInMm.optional(),
@@ -17728,15 +17836,15 @@ var sot363 = (raw_params) => {
17728
17836
  parameters
17729
17837
  };
17730
17838
  };
17731
- var sot23_def = z97.object({
17732
- fn: z97.string(),
17733
- num_pins: z97.number().default(3),
17734
- w: z97.string().default("1.92mm"),
17735
- h: z97.string().default("2.74mm"),
17736
- pl: z97.string().default("0.8mm"),
17737
- pw: z97.string().default("0.764mm"),
17738
- p: z97.string().default("0.95mm"),
17739
- 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()
17740
17848
  });
17741
17849
  var sot23_6_or_8_def = extendSoicDef({
17742
17850
  p: "0.95mm",
@@ -23656,17 +23764,17 @@ var svgPathPoints = normalizeOnY([
23656
23764
  ]);
23657
23765
  var DIP_PIN_HEIGHT = 5.47;
23658
23766
  var heightAboveSurface = 0.5;
23659
- var DipPinLeg = ({ x, y, z: z98 }) => {
23767
+ var DipPinLeg = ({ x, y, z: z102 }) => {
23660
23768
  const isRotated = x > 0;
23661
23769
  return /* @__PURE__ */ jsxs(Fragment22, { children: [
23662
- /* @__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]) }) }) }) }),
23663
23771
  /* @__PURE__ */ jsx4(
23664
23772
  Translate,
23665
23773
  {
23666
23774
  offset: {
23667
23775
  x,
23668
23776
  y: y + (isRotated ? 1 : -1),
23669
- z: z98
23777
+ z: z102
23670
23778
  },
23671
23779
  children: /* @__PURE__ */ jsx4(Rotate, { rotation: ["-90deg", "90deg", isRotated ? "180deg" : "0deg"], children: /* @__PURE__ */ jsx4(ExtrudeLinear, { height: 2, children: /* @__PURE__ */ jsx4(
23672
23780
  Polygon,
@@ -25583,7 +25691,7 @@ import * as THREE10 from "three";
25583
25691
  // package.json
25584
25692
  var package_default = {
25585
25693
  name: "@tscircuit/3d-viewer",
25586
- version: "0.0.363",
25694
+ version: "0.0.365",
25587
25695
  main: "./dist/index.js",
25588
25696
  module: "./dist/index.js",
25589
25697
  type: "module",
@@ -25639,7 +25747,7 @@ var package_default = {
25639
25747
  "@vitejs/plugin-react": "^4.3.4",
25640
25748
  "bun-match-svg": "^0.0.9",
25641
25749
  "bun-types": "1.2.1",
25642
- "circuit-json": "^0.0.232",
25750
+ "circuit-json": "^0.0.241",
25643
25751
  "circuit-to-svg": "^0.0.179",
25644
25752
  debug: "^4.4.0",
25645
25753
  "jscad-electronics": "^0.0.38",
@@ -25649,7 +25757,7 @@ var package_default = {
25649
25757
  "react-use-gesture": "^9.1.3",
25650
25758
  semver: "^7.7.0",
25651
25759
  "strip-ansi": "^7.1.0",
25652
- tscircuit: "^0.0.606",
25760
+ tscircuit: "^0.0.622",
25653
25761
  tsup: "^8.3.6",
25654
25762
  typescript: "^5.7.3",
25655
25763
  vite: "^7.1.2",
@@ -26974,6 +27082,7 @@ function createSilkscreenPathGeom(sp, ctx) {
26974
27082
  var buildStateOrder = [
26975
27083
  "initializing",
26976
27084
  "processing_pads",
27085
+ "processing_copper_pours",
26977
27086
  "processing_plated_holes",
26978
27087
  "processing_holes",
26979
27088
  "processing_cutouts",
@@ -26995,6 +27104,7 @@ var BoardGeomBuilder = class {
26995
27104
  silkscreenTexts;
26996
27105
  silkscreenPaths;
26997
27106
  pcb_cutouts;
27107
+ pcb_copper_pours;
26998
27108
  boardGeom = null;
26999
27109
  platedHoleGeoms = [];
27000
27110
  holeGeoms = [];
@@ -27005,6 +27115,7 @@ var BoardGeomBuilder = class {
27005
27115
  // Combined with platedHoleGeoms
27006
27116
  silkscreenTextGeoms = [];
27007
27117
  silkscreenPathGeoms = [];
27118
+ copperPourGeoms = [];
27008
27119
  state = "initializing";
27009
27120
  currentIndex = 0;
27010
27121
  ctx;
@@ -27037,6 +27148,9 @@ var BoardGeomBuilder = class {
27037
27148
  this.silkscreenTexts = su3(circuitJson).pcb_silkscreen_text.list();
27038
27149
  this.silkscreenPaths = su3(circuitJson).pcb_silkscreen_path.list();
27039
27150
  this.pcb_cutouts = su3(circuitJson).pcb_cutout.list();
27151
+ this.pcb_copper_pours = circuitJson.filter(
27152
+ (e) => e.type === "pcb_copper_pour"
27153
+ );
27040
27154
  this.ctx = { pcbThickness: 1.2 };
27041
27155
  this.initializeBoard();
27042
27156
  }
@@ -27133,6 +27247,14 @@ var BoardGeomBuilder = class {
27133
27247
  this.goToNextState();
27134
27248
  }
27135
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;
27136
27258
  case "finalizing":
27137
27259
  this.finalize();
27138
27260
  this.state = "done";
@@ -27183,6 +27305,41 @@ var BoardGeomBuilder = class {
27183
27305
  this.boardGeom = (0, import_booleans2.subtract)(this.boardGeom, cutoutGeom);
27184
27306
  }
27185
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
+ }
27186
27343
  processPlatedHole(ph, opts = {}) {
27187
27344
  if (!this.boardGeom) return;
27188
27345
  if (ph.shape === "circle" || ph.shape === "circular_hole_with_rect_pad") {
@@ -27438,6 +27595,7 @@ var BoardGeomBuilder = class {
27438
27595
  ...this.padGeoms,
27439
27596
  ...this.traceGeoms,
27440
27597
  ...this.viaGeoms,
27598
+ ...this.copperPourGeoms,
27441
27599
  ...this.silkscreenTextGeoms,
27442
27600
  ...this.silkscreenPathGeoms
27443
27601
  ];
@@ -27784,7 +27942,7 @@ import { useEffect as useEffect20, useMemo as useMemo18, useState as useState13
27784
27942
  // src/hooks/useManifoldBoardBuilder.ts
27785
27943
  import { useState as useState12, useEffect as useEffect19, useMemo as useMemo17, useRef as useRef7 } from "react";
27786
27944
  import { su as su12 } from "@tscircuit/circuit-json-util";
27787
- import * as THREE19 from "three";
27945
+ import * as THREE20 from "three";
27788
27946
 
27789
27947
  // src/utils/manifold-mesh-to-three-geometry.ts
27790
27948
  import * as THREE13 from "three";
@@ -28507,9 +28665,86 @@ function createManifoldBoard(Manifold, CrossSection, boardData, pcbThickness, ma
28507
28665
  return boardOp;
28508
28666
  }
28509
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
+
28510
28745
  // src/utils/manifold/process-cutouts.ts
28511
28746
  import { su as su11 } from "@tscircuit/circuit-json-util";
28512
- var arePointsClockwise3 = (points) => {
28747
+ var arePointsClockwise4 = (points) => {
28513
28748
  let area = 0;
28514
28749
  for (let i = 0; i < points.length; i++) {
28515
28750
  const j = (i + 1) % points.length;
@@ -28574,7 +28809,7 @@ function processCutoutsForManifold(Manifold, CrossSection, circuitJson, pcbThick
28574
28809
  p.x,
28575
28810
  p.y
28576
28811
  ]);
28577
- if (arePointsClockwise3(pointsVec2)) {
28812
+ if (arePointsClockwise4(pointsVec2)) {
28578
28813
  pointsVec2 = pointsVec2.reverse();
28579
28814
  }
28580
28815
  const crossSection = CrossSection.ofPolygons([pointsVec2]);
@@ -28708,7 +28943,7 @@ var useManifoldBoardBuilder = (manifoldJSModule, circuitJson) => {
28708
28943
  const matColorArray = boardMaterialColors[boardData.material] ?? colors.fr4Green;
28709
28944
  currentGeoms.board = {
28710
28945
  geometry: finalBoardGeom,
28711
- color: new THREE19.Color(
28946
+ color: new THREE20.Color(
28712
28947
  matColorArray[0],
28713
28948
  matColorArray[1],
28714
28949
  matColorArray[2]
@@ -28723,6 +28958,15 @@ var useManifoldBoardBuilder = (manifoldJSModule, circuitJson) => {
28723
28958
  holeUnion
28724
28959
  );
28725
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;
28726
28970
  setGeoms(currentGeoms);
28727
28971
  const traceColorArr = tracesMaterialColors[boardData.material] ?? colors.fr4GreenSolderWithMask;
28728
28972
  const traceColor = `rgb(${Math.round(traceColorArr[0] * 255)}, ${Math.round(traceColorArr[1] * 255)}, ${Math.round(traceColorArr[2] * 255)})`;
@@ -28782,16 +29026,16 @@ var useManifoldBoardBuilder = (manifoldJSModule, circuitJson) => {
28782
29026
  };
28783
29027
 
28784
29028
  // src/utils/manifold/create-three-geometry-meshes.ts
28785
- import * as THREE20 from "three";
29029
+ import * as THREE21 from "three";
28786
29030
  function createGeometryMeshes(geoms) {
28787
29031
  const meshes = [];
28788
29032
  if (!geoms) return meshes;
28789
29033
  if (geoms.board && geoms.board.geometry) {
28790
- const mesh = new THREE20.Mesh(
29034
+ const mesh = new THREE21.Mesh(
28791
29035
  geoms.board.geometry,
28792
- new THREE20.MeshStandardMaterial({
29036
+ new THREE21.MeshStandardMaterial({
28793
29037
  color: geoms.board.color,
28794
- side: THREE20.DoubleSide,
29038
+ side: THREE21.DoubleSide,
28795
29039
  flatShading: true
28796
29040
  })
28797
29041
  );
@@ -28801,11 +29045,11 @@ function createGeometryMeshes(geoms) {
28801
29045
  const createMeshesFromArray = (geomArray) => {
28802
29046
  if (geomArray) {
28803
29047
  geomArray.forEach((comp) => {
28804
- const mesh = new THREE20.Mesh(
29048
+ const mesh = new THREE21.Mesh(
28805
29049
  comp.geometry,
28806
- new THREE20.MeshStandardMaterial({
29050
+ new THREE21.MeshStandardMaterial({
28807
29051
  color: comp.color,
28808
- side: THREE20.DoubleSide,
29052
+ side: THREE21.DoubleSide,
28809
29053
  flatShading: true
28810
29054
  // Consistent with board
28811
29055
  })
@@ -28818,25 +29062,26 @@ function createGeometryMeshes(geoms) {
28818
29062
  createMeshesFromArray(geoms.platedHoles);
28819
29063
  createMeshesFromArray(geoms.smtPads);
28820
29064
  createMeshesFromArray(geoms.vias);
29065
+ createMeshesFromArray(geoms.copperPours);
28821
29066
  return meshes;
28822
29067
  }
28823
29068
 
28824
29069
  // src/utils/manifold/create-three-texture-meshes.ts
28825
- import * as THREE21 from "three";
29070
+ import * as THREE22 from "three";
28826
29071
  function createTextureMeshes(textures, boardData, pcbThickness) {
28827
29072
  const meshes = [];
28828
29073
  if (!textures || !boardData || pcbThickness === null) return meshes;
28829
29074
  const createTexturePlane = (texture, yOffset, isBottomLayer, keySuffix) => {
28830
29075
  if (!texture) return null;
28831
- const planeGeom = new THREE21.PlaneGeometry(boardData.width, boardData.height);
28832
- const material = new THREE21.MeshBasicMaterial({
29076
+ const planeGeom = new THREE22.PlaneGeometry(boardData.width, boardData.height);
29077
+ const material = new THREE22.MeshBasicMaterial({
28833
29078
  map: texture,
28834
29079
  transparent: true,
28835
- side: THREE21.DoubleSide,
29080
+ side: THREE22.DoubleSide,
28836
29081
  depthWrite: false
28837
29082
  // Important for layers to avoid z-fighting issues with board itself
28838
29083
  });
28839
- const mesh = new THREE21.Mesh(planeGeom, material);
29084
+ const mesh = new THREE22.Mesh(planeGeom, material);
28840
29085
  mesh.position.set(boardData.center.x, boardData.center.y, yOffset);
28841
29086
  if (isBottomLayer) {
28842
29087
  mesh.rotation.set(Math.PI, 0, 0);
@@ -29480,11 +29725,11 @@ var CadViewer = (props) => {
29480
29725
  // src/convert-circuit-json-to-3d-svg.ts
29481
29726
  var import_debug = __toESM(require_browser(), 1);
29482
29727
  import { su as su14 } from "@tscircuit/circuit-json-util";
29483
- import * as THREE25 from "three";
29728
+ import * as THREE26 from "three";
29484
29729
  import { SVGRenderer } from "three/examples/jsm/renderers/SVGRenderer.js";
29485
29730
 
29486
29731
  // src/utils/create-geometry-from-polygons.ts
29487
- import * as THREE22 from "three";
29732
+ import * as THREE23 from "three";
29488
29733
  import { BufferGeometry as BufferGeometry3, Float32BufferAttribute as Float32BufferAttribute2 } from "three";
29489
29734
  function createGeometryFromPolygons(polygons) {
29490
29735
  const geometry = new BufferGeometry3();
@@ -29498,12 +29743,12 @@ function createGeometryFromPolygons(polygons) {
29498
29743
  ...polygon2.vertices[i + 1]
29499
29744
  // Third vertex
29500
29745
  );
29501
- const v1 = new THREE22.Vector3(...polygon2.vertices[0]);
29502
- const v2 = new THREE22.Vector3(...polygon2.vertices[i]);
29503
- const v3 = new THREE22.Vector3(...polygon2.vertices[i + 1]);
29504
- const normal = new THREE22.Vector3().crossVectors(
29505
- new THREE22.Vector3().subVectors(v2, v1),
29506
- 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)
29507
29752
  ).normalize();
29508
29753
  normals.push(
29509
29754
  normal.x,
@@ -29526,22 +29771,22 @@ function createGeometryFromPolygons(polygons) {
29526
29771
  // src/utils/render-component.tsx
29527
29772
  var import_modeling3 = __toESM(require_src(), 1);
29528
29773
  var import_jscad_planner2 = __toESM(require_dist(), 1);
29529
- import * as THREE24 from "three";
29774
+ import * as THREE25 from "three";
29530
29775
 
29531
29776
  // src/utils/load-model.ts
29532
- import * as THREE23 from "three";
29777
+ import * as THREE24 from "three";
29533
29778
  import { OBJLoader as OBJLoader2 } from "three/examples/jsm/loaders/OBJLoader.js";
29534
29779
  import { STLLoader as STLLoader2 } from "three/examples/jsm/loaders/STLLoader.js";
29535
29780
  async function load3DModel(url) {
29536
29781
  if (url.endsWith(".stl")) {
29537
29782
  const loader = new STLLoader2();
29538
29783
  const geometry = await loader.loadAsync(url);
29539
- const material = new THREE23.MeshStandardMaterial({
29784
+ const material = new THREE24.MeshStandardMaterial({
29540
29785
  color: 8947848,
29541
29786
  metalness: 0.5,
29542
29787
  roughness: 0.5
29543
29788
  });
29544
- return new THREE23.Mesh(geometry, material);
29789
+ return new THREE24.Mesh(geometry, material);
29545
29790
  }
29546
29791
  if (url.endsWith(".obj")) {
29547
29792
  const loader = new OBJLoader2();
@@ -29566,9 +29811,9 @@ async function renderComponent(component, scene) {
29566
29811
  }
29567
29812
  if (component.rotation) {
29568
29813
  model.rotation.set(
29569
- THREE24.MathUtils.degToRad(component.rotation.x ?? 0),
29570
- THREE24.MathUtils.degToRad(component.rotation.y ?? 0),
29571
- 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)
29572
29817
  );
29573
29818
  }
29574
29819
  scene.add(model);
@@ -29582,13 +29827,13 @@ async function renderComponent(component, scene) {
29582
29827
  );
29583
29828
  if (jscadObject && (jscadObject.polygons || jscadObject.sides)) {
29584
29829
  const threeGeom = convertCSGToThreeGeom(jscadObject);
29585
- const material2 = new THREE24.MeshStandardMaterial({
29830
+ const material2 = new THREE25.MeshStandardMaterial({
29586
29831
  color: 8947848,
29587
29832
  metalness: 0.5,
29588
29833
  roughness: 0.5,
29589
- side: THREE24.DoubleSide
29834
+ side: THREE25.DoubleSide
29590
29835
  });
29591
- const mesh2 = new THREE24.Mesh(threeGeom, material2);
29836
+ const mesh2 = new THREE25.Mesh(threeGeom, material2);
29592
29837
  if (component.position) {
29593
29838
  mesh2.position.set(
29594
29839
  component.position.x ?? 0,
@@ -29598,9 +29843,9 @@ async function renderComponent(component, scene) {
29598
29843
  }
29599
29844
  if (component.rotation) {
29600
29845
  mesh2.rotation.set(
29601
- THREE24.MathUtils.degToRad(component.rotation.x ?? 0),
29602
- THREE24.MathUtils.degToRad(component.rotation.y ?? 0),
29603
- 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)
29604
29849
  );
29605
29850
  }
29606
29851
  scene.add(mesh2);
@@ -29616,17 +29861,17 @@ async function renderComponent(component, scene) {
29616
29861
  if (!geom || !geom.polygons && !geom.sides) {
29617
29862
  continue;
29618
29863
  }
29619
- const color = new THREE24.Color(geomInfo.color);
29864
+ const color = new THREE25.Color(geomInfo.color);
29620
29865
  color.convertLinearToSRGB();
29621
29866
  const geomWithColor = { ...geom, color: [color.r, color.g, color.b] };
29622
29867
  const threeGeom = convertCSGToThreeGeom(geomWithColor);
29623
- const material2 = new THREE24.MeshStandardMaterial({
29868
+ const material2 = new THREE25.MeshStandardMaterial({
29624
29869
  vertexColors: true,
29625
29870
  metalness: 0.2,
29626
29871
  roughness: 0.8,
29627
- side: THREE24.DoubleSide
29872
+ side: THREE25.DoubleSide
29628
29873
  });
29629
- const mesh2 = new THREE24.Mesh(threeGeom, material2);
29874
+ const mesh2 = new THREE25.Mesh(threeGeom, material2);
29630
29875
  if (component.position) {
29631
29876
  mesh2.position.set(
29632
29877
  component.position.x ?? 0,
@@ -29636,22 +29881,22 @@ async function renderComponent(component, scene) {
29636
29881
  }
29637
29882
  if (component.rotation) {
29638
29883
  mesh2.rotation.set(
29639
- THREE24.MathUtils.degToRad(component.rotation.x ?? 0),
29640
- THREE24.MathUtils.degToRad(component.rotation.y ?? 0),
29641
- 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)
29642
29887
  );
29643
29888
  }
29644
29889
  scene.add(mesh2);
29645
29890
  }
29646
29891
  return;
29647
29892
  }
29648
- const geometry = new THREE24.BoxGeometry(0.5, 0.5, 0.5);
29649
- const material = new THREE24.MeshStandardMaterial({
29893
+ const geometry = new THREE25.BoxGeometry(0.5, 0.5, 0.5);
29894
+ const material = new THREE25.MeshStandardMaterial({
29650
29895
  color: 16711680,
29651
29896
  transparent: true,
29652
29897
  opacity: 0.25
29653
29898
  });
29654
- const mesh = new THREE24.Mesh(geometry, material);
29899
+ const mesh = new THREE25.Mesh(geometry, material);
29655
29900
  if (component.position) {
29656
29901
  mesh.position.set(
29657
29902
  component.position.x ?? 0,
@@ -29672,11 +29917,11 @@ async function convertCircuitJsonTo3dSvg(circuitJson, options = {}) {
29672
29917
  padding = 20,
29673
29918
  zoom = 1.5
29674
29919
  } = options;
29675
- const scene = new THREE25.Scene();
29920
+ const scene = new THREE26.Scene();
29676
29921
  const renderer = new SVGRenderer();
29677
29922
  renderer.setSize(width10, height10);
29678
- renderer.setClearColor(new THREE25.Color(backgroundColor), 1);
29679
- const camera = new THREE25.OrthographicCamera();
29923
+ renderer.setClearColor(new THREE26.Color(backgroundColor), 1);
29924
+ const camera = new THREE26.OrthographicCamera();
29680
29925
  const aspect = width10 / height10;
29681
29926
  const frustumSize = 100;
29682
29927
  const halfFrustumSize = frustumSize / 2 / zoom;
@@ -29690,11 +29935,11 @@ async function convertCircuitJsonTo3dSvg(circuitJson, options = {}) {
29690
29935
  camera.position.set(position.x, position.y, position.z);
29691
29936
  camera.up.set(0, 1, 0);
29692
29937
  const lookAt = options.camera?.lookAt ?? { x: 0, y: 0, z: 0 };
29693
- camera.lookAt(new THREE25.Vector3(lookAt.x, lookAt.y, lookAt.z));
29938
+ camera.lookAt(new THREE26.Vector3(lookAt.x, lookAt.y, lookAt.z));
29694
29939
  camera.updateProjectionMatrix();
29695
- const ambientLight = new THREE25.AmbientLight(16777215, Math.PI / 2);
29940
+ const ambientLight = new THREE26.AmbientLight(16777215, Math.PI / 2);
29696
29941
  scene.add(ambientLight);
29697
- const pointLight = new THREE25.PointLight(16777215, Math.PI / 4);
29942
+ const pointLight = new THREE26.PointLight(16777215, Math.PI / 4);
29698
29943
  pointLight.position.set(-10, -10, 10);
29699
29944
  scene.add(pointLight);
29700
29945
  const components = su14(circuitJson).cad_component.list();
@@ -29707,8 +29952,8 @@ async function convertCircuitJsonTo3dSvg(circuitJson, options = {}) {
29707
29952
  const g = geom;
29708
29953
  if (!g.polygons || g.polygons.length === 0) continue;
29709
29954
  const geometry = createGeometryFromPolygons(g.polygons);
29710
- const material = new THREE25.MeshStandardMaterial({
29711
- color: new THREE25.Color(
29955
+ const material = new THREE26.MeshStandardMaterial({
29956
+ color: new THREE26.Color(
29712
29957
  g.color?.[0] ?? 0,
29713
29958
  g.color?.[1] ?? 0,
29714
29959
  g.color?.[2] ?? 0
@@ -29717,18 +29962,18 @@ async function convertCircuitJsonTo3dSvg(circuitJson, options = {}) {
29717
29962
  roughness: 0.8,
29718
29963
  opacity: 0.9,
29719
29964
  transparent: true,
29720
- side: THREE25.DoubleSide
29965
+ side: THREE26.DoubleSide
29721
29966
  });
29722
- const mesh = new THREE25.Mesh(geometry, material);
29967
+ const mesh = new THREE26.Mesh(geometry, material);
29723
29968
  scene.add(mesh);
29724
29969
  }
29725
29970
  }
29726
- const gridHelper = new THREE25.GridHelper(100, 100);
29971
+ const gridHelper = new THREE26.GridHelper(100, 100);
29727
29972
  gridHelper.rotation.x = Math.PI / 2;
29728
29973
  scene.add(gridHelper);
29729
- const box = new THREE25.Box3().setFromObject(scene);
29730
- const center = box.getCenter(new THREE25.Vector3());
29731
- 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());
29732
29977
  scene.position.sub(center);
29733
29978
  const maxDim = Math.max(size2.x, size2.y, size2.z);
29734
29979
  if (maxDim > 0) {