@tscircuit/3d-viewer 0.0.541 → 0.0.543

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.
Files changed (2) hide show
  1. package/dist/index.js +708 -563
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -638,13 +638,13 @@ var require_fromVec2 = __commonJS({
638
638
  var require_length = __commonJS({
639
639
  "node_modules/@jscad/modeling/src/maths/vec3/length.js"(exports, module) {
640
640
  "use strict";
641
- var length62 = (vector) => {
641
+ var length63 = (vector) => {
642
642
  const x = vector[0];
643
643
  const y = vector[1];
644
644
  const z21 = vector[2];
645
645
  return Math.sqrt(x * x + y * y + z21 * z21);
646
646
  };
647
- module.exports = length62;
647
+ module.exports = length63;
648
648
  }
649
649
  });
650
650
 
@@ -1781,8 +1781,8 @@ var require_fromValues3 = __commonJS({
1781
1781
  var require_length2 = __commonJS({
1782
1782
  "node_modules/@jscad/modeling/src/maths/vec2/length.js"(exports, module) {
1783
1783
  "use strict";
1784
- var length62 = (vector) => Math.sqrt(vector[0] * vector[0] + vector[1] * vector[1]);
1785
- module.exports = length62;
1784
+ var length63 = (vector) => Math.sqrt(vector[0] * vector[0] + vector[1] * vector[1]);
1785
+ module.exports = length63;
1786
1786
  }
1787
1787
  });
1788
1788
 
@@ -2042,14 +2042,14 @@ var require_fromPoints = __commonJS({
2042
2042
  if (!Array.isArray(points)) {
2043
2043
  throw new Error("the given points must be an array");
2044
2044
  }
2045
- let length62 = points.length;
2046
- if (length62 < 3) {
2045
+ let length63 = points.length;
2046
+ if (length63 < 3) {
2047
2047
  throw new Error("the given points must define a closed geometry with three or more points");
2048
2048
  }
2049
- if (vec2.equals(points[0], points[length62 - 1])) --length62;
2049
+ if (vec2.equals(points[0], points[length63 - 1])) --length63;
2050
2050
  const sides2 = [];
2051
- let prevpoint = points[length62 - 1];
2052
- for (let i = 0; i < length62; i++) {
2051
+ let prevpoint = points[length63 - 1];
2052
+ for (let i = 0; i < length63; i++) {
2053
2053
  const point = points[i];
2054
2054
  sides2.push([vec2.clone(prevpoint), vec2.clone(point)]);
2055
2055
  prevpoint = point;
@@ -2664,7 +2664,7 @@ var require_Face = __commonJS({
2664
2664
  var copy = require_copy2();
2665
2665
  var cross = require_cross();
2666
2666
  var dot = require_dot();
2667
- var length62 = require_length();
2667
+ var length63 = require_length();
2668
2668
  var normalize = require_normalize();
2669
2669
  var scale2 = require_scale();
2670
2670
  var subtract4 = require_subtract();
@@ -2713,7 +2713,7 @@ var require_Face = __commonJS({
2713
2713
  e2 = e2.next;
2714
2714
  this.nVertices += 1;
2715
2715
  }
2716
- this.area = length62(this.normal);
2716
+ this.area = length63(this.normal);
2717
2717
  this.normal = scale2(this.normal, this.normal, 1 / this.area);
2718
2718
  }
2719
2719
  computeNormalMinArea(minArea) {
@@ -4984,12 +4984,12 @@ var require_equals5 = __commonJS({
4984
4984
  }
4985
4985
  const apoints = toPoints(a);
4986
4986
  const bpoints = toPoints(b);
4987
- const length62 = apoints.length;
4987
+ const length63 = apoints.length;
4988
4988
  let offset4 = 0;
4989
4989
  do {
4990
4990
  let unequal = false;
4991
- for (let i = 0; i < length62; i++) {
4992
- if (!vec2.equals(apoints[i], bpoints[(i + offset4) % length62])) {
4991
+ for (let i = 0; i < length63; i++) {
4992
+ if (!vec2.equals(apoints[i], bpoints[(i + offset4) % length63])) {
4993
4993
  unequal = true;
4994
4994
  break;
4995
4995
  }
@@ -5000,7 +5000,7 @@ var require_equals5 = __commonJS({
5000
5000
  if (!a.isClosed) {
5001
5001
  return false;
5002
5002
  }
5003
- } while (++offset4 < length62);
5003
+ } while (++offset4 < length63);
5004
5004
  return false;
5005
5005
  };
5006
5006
  module.exports = equals;
@@ -5853,8 +5853,8 @@ var require_length3 = __commonJS({
5853
5853
  "node_modules/@jscad/modeling/src/curves/bezier/length.js"(exports, module) {
5854
5854
  "use strict";
5855
5855
  var lengths = require_lengths();
5856
- var length62 = (segments, bezier) => lengths(segments, bezier)[segments];
5857
- module.exports = length62;
5856
+ var length63 = (segments, bezier) => lengths(segments, bezier)[segments];
5857
+ module.exports = length63;
5858
5858
  }
5859
5859
  });
5860
5860
 
@@ -6515,12 +6515,12 @@ var require_fromPlanes = __commonJS({
6515
6515
  var fromPointAndDirection = require_fromPointAndDirection();
6516
6516
  var fromPlanes = (out, plane1, plane2) => {
6517
6517
  let direction = vec3.cross(vec3.create(), plane1, plane2);
6518
- let length62 = vec3.length(direction);
6519
- if (length62 < EPS) {
6518
+ let length63 = vec3.length(direction);
6519
+ if (length63 < EPS) {
6520
6520
  throw new Error("parallel planes do not intersect");
6521
6521
  }
6522
- length62 = 1 / length62;
6523
- direction = vec3.scale(direction, direction, length62);
6522
+ length63 = 1 / length63;
6523
+ direction = vec3.scale(direction, direction, length63);
6524
6524
  const absx = Math.abs(direction[0]);
6525
6525
  const absy = Math.abs(direction[1]);
6526
6526
  const absz = Math.abs(direction[2]);
@@ -8105,8 +8105,8 @@ var require_roundedCylinder = __commonJS({
8105
8105
  const start = [0, 0, -(height10 / 2)];
8106
8106
  const end = [0, 0, height10 / 2];
8107
8107
  const direction = vec3.subtract(vec3.create(), end, start);
8108
- const length62 = vec3.length(direction);
8109
- if (2 * roundRadius > length62 - EPS) throw new Error("height must be larger than twice roundRadius");
8108
+ const length63 = vec3.length(direction);
8109
+ if (2 * roundRadius > length63 - EPS) throw new Error("height must be larger than twice roundRadius");
8110
8110
  let defaultnormal;
8111
8111
  if (Math.abs(direction[0]) > Math.abs(direction[1])) {
8112
8112
  defaultnormal = vec3.fromValues(0, 1, 0);
@@ -14721,8 +14721,8 @@ import {
14721
14721
  length as length38
14722
14722
  } from "circuit-json";
14723
14723
  import { z as z48 } from "zod";
14724
- import { z as z49 } from "zod";
14725
14724
  import { length as length39 } from "circuit-json";
14725
+ import { z as z49 } from "zod";
14726
14726
  import { z as z50 } from "zod";
14727
14727
  import { length as length40 } from "circuit-json";
14728
14728
  import { z as z51 } from "zod";
@@ -14738,14 +14738,14 @@ import { length as length45 } from "circuit-json";
14738
14738
  import { z as z56 } from "zod";
14739
14739
  import { length as length46 } from "circuit-json";
14740
14740
  import { z as z57 } from "zod";
14741
+ import { length as length47 } from "circuit-json";
14741
14742
  import { z as z58 } from "zod";
14742
14743
  import { z as z59 } from "zod";
14744
+ import { z as z60 } from "zod";
14743
14745
  import {
14744
- length as length47
14746
+ length as length48
14745
14747
  } from "circuit-json";
14746
- import { z as z60 } from "zod";
14747
14748
  import { z as z61 } from "zod";
14748
- import { length as length48 } from "circuit-json";
14749
14749
  import { z as z62 } from "zod";
14750
14750
  import { length as length49 } from "circuit-json";
14751
14751
  import { z as z63 } from "zod";
@@ -14757,29 +14757,31 @@ import { length as length52 } from "circuit-json";
14757
14757
  import { z as z66 } from "zod";
14758
14758
  import { length as length53 } from "circuit-json";
14759
14759
  import { z as z67 } from "zod";
14760
- import { length as length54, distance as distance3 } from "circuit-json";
14761
- import { length as length55 } from "circuit-json";
14760
+ import { length as length54 } from "circuit-json";
14762
14761
  import { z as z68 } from "zod";
14763
- import { z as z69 } from "zod";
14762
+ import { length as length55, distance as distance3 } from "circuit-json";
14764
14763
  import { length as length56 } from "circuit-json";
14764
+ import { z as z69 } from "zod";
14765
14765
  import { z as z70 } from "zod";
14766
+ import { length as length57 } from "circuit-json";
14767
+ import { z as z71 } from "zod";
14766
14768
  import {
14767
- length as length57
14769
+ length as length58
14768
14770
  } from "circuit-json";
14769
- import { z as z71 } from "zod";
14770
14771
  import { z as z72 } from "zod";
14771
- import { length as length58 } from "circuit-json";
14772
14772
  import { z as z73 } from "zod";
14773
- import { z as z74 } from "zod";
14774
14773
  import { length as length59 } from "circuit-json";
14774
+ import { z as z74 } from "zod";
14775
14775
  import { z as z75 } from "zod";
14776
14776
  import { length as length60 } from "circuit-json";
14777
14777
  import { z as z76 } from "zod";
14778
+ import { length as length61 } from "circuit-json";
14778
14779
  import { z as z77 } from "zod";
14779
14780
  import { z as z78 } from "zod";
14780
- import { length as length61 } from "circuit-json";
14781
14781
  import { z as z79 } from "zod";
14782
+ import { length as length62 } from "circuit-json";
14782
14783
  import { z as z80 } from "zod";
14784
+ import { z as z81 } from "zod";
14783
14785
  var __defProp2 = Object.defineProperty;
14784
14786
  var __export = (target, all) => {
14785
14787
  for (var name in all)
@@ -14862,6 +14864,7 @@ __export(fn_exports, {
14862
14864
  stampboard: () => stampboard,
14863
14865
  stampreceiver: () => stampreceiver,
14864
14866
  to220: () => to220,
14867
+ to220f: () => to220f,
14865
14868
  to92: () => to92,
14866
14869
  to92l: () => to92l,
14867
14870
  to92s: () => to92s,
@@ -14912,7 +14915,8 @@ var platedHoleWithRectPad = (options) => {
14912
14915
  rectPadWidth,
14913
14916
  rectPadHeight,
14914
14917
  holeOffsetX = 0,
14915
- holeOffsetY = 0
14918
+ holeOffsetY = 0,
14919
+ rectBorderRadius
14916
14920
  } = options;
14917
14921
  return {
14918
14922
  pcb_plated_hole_id: "",
@@ -14925,6 +14929,9 @@ var platedHoleWithRectPad = (options) => {
14925
14929
  pad_shape: "rect",
14926
14930
  rect_pad_width: mm(rectPadWidth),
14927
14931
  rect_pad_height: mm(rectPadHeight),
14932
+ ...rectBorderRadius !== void 0 && {
14933
+ rect_border_radius: rectBorderRadius
14934
+ },
14928
14935
  pcb_port_id: "",
14929
14936
  layers: ["top", "bottom"],
14930
14937
  port_hints: [pn.toString()],
@@ -15252,19 +15259,37 @@ var passive = (params) => {
15252
15259
  };
15253
15260
  const textY = textbottom ? -ph / 2 - 0.9 : ph / 2 + 0.9;
15254
15261
  const silkscreenRefText = silkscreenRef(0, textY, 0.2);
15262
+ const excess = 0.25;
15263
+ const silkXs = silkscreenLine.route.map((pt) => pt.x);
15264
+ const silkYs = silkscreenLine.route.map((pt) => pt.y);
15265
+ const crtMinX = Math.min(-(w ?? 0) / 2, -(p / 2 + pw / 2), ...silkXs) - excess;
15266
+ const crtMaxX = Math.max((w ?? 0) / 2, p / 2 + pw / 2, ...silkXs) + excess;
15267
+ const crtMinY = Math.min(-(h2 ?? 0) / 2, -ph / 2, ...silkYs) - excess;
15268
+ const crtMaxY = Math.max((h2 ?? 0) / 2, ph / 2, ...silkYs) + excess;
15269
+ const courtyard = {
15270
+ type: "pcb_courtyard_rect",
15271
+ pcb_courtyard_rect_id: "",
15272
+ pcb_component_id: "",
15273
+ center: { x: (crtMinX + crtMaxX) / 2, y: (crtMinY + crtMaxY) / 2 },
15274
+ width: crtMaxX - crtMinX,
15275
+ height: crtMaxY - crtMinY,
15276
+ layer: "top"
15277
+ };
15255
15278
  if (tht) {
15256
15279
  return [
15257
15280
  platedhole(1, -p / 2, 0, pw, pw * 1 / 0.8),
15258
15281
  platedhole(2, p / 2, 0, pw, pw * 1 / 0.8),
15259
15282
  silkscreenLine,
15260
- silkscreenRefText
15283
+ silkscreenRefText,
15284
+ courtyard
15261
15285
  ];
15262
15286
  }
15263
15287
  return [
15264
15288
  rectpad(["1", "left"], -p / 2, 0, pw, ph),
15265
15289
  rectpad(["2", "right"], p / 2, 0, pw, ph),
15266
15290
  silkscreenLine,
15267
- silkscreenRefText
15291
+ silkscreenRefText,
15292
+ courtyard
15268
15293
  ];
15269
15294
  };
15270
15295
  var diode = (parameters) => {
@@ -19717,14 +19742,14 @@ var sot89_3 = (parameters) => {
19717
19742
  const pads = [];
19718
19743
  const padGap = Number.parseFloat(parameters.p);
19719
19744
  const padWidth = Number.parseFloat(parameters.pw);
19720
- const length62 = Number.parseFloat(parameters.w);
19745
+ const length63 = Number.parseFloat(parameters.w);
19721
19746
  const padHeight = Number.parseFloat(parameters.pl);
19722
19747
  const centerExtra = 0.175;
19723
19748
  const outerPadXShift = (padHeight - (padHeight + centerExtra)) / 2;
19724
19749
  pads.push(
19725
- rectpad(1, -length62 / 2 + outerPadXShift, padGap, padHeight, padWidth),
19726
- rectpad(2, -length62 / 2, 0, padHeight + centerExtra, padWidth),
19727
- rectpad(3, -length62 / 2 + outerPadXShift, -padGap, padHeight, padWidth)
19750
+ rectpad(1, -length63 / 2 + outerPadXShift, padGap, padHeight, padWidth),
19751
+ rectpad(2, -length63 / 2, 0, padHeight + centerExtra, padWidth),
19752
+ rectpad(3, -length63 / 2 + outerPadXShift, -padGap, padHeight, padWidth)
19728
19753
  );
19729
19754
  const silkscreenRefText = silkscreenRef(0, 0, 0.3);
19730
19755
  const width10 = Number.parseFloat(parameters.w) / 2 - 1;
@@ -19764,7 +19789,7 @@ var sot89_5 = (parameters) => {
19764
19789
  const pads = [];
19765
19790
  const padGap = Number.parseFloat(parameters.p);
19766
19791
  const padWidth = Number.parseFloat(parameters.pw);
19767
- const length62 = Number.parseFloat(parameters.w);
19792
+ const length63 = Number.parseFloat(parameters.w);
19768
19793
  pads.push(
19769
19794
  rectpad(1, -1.85, -1.5, 1.5, 0.7),
19770
19795
  rectpad(2, -1.85, 1.5, 1.5, 0.7),
@@ -19841,8 +19866,8 @@ var to220_def = base_def.extend({
19841
19866
  });
19842
19867
  var to220 = (raw_params) => {
19843
19868
  const parameters = to220_def.parse(raw_params);
19844
- const { fn, id, od, w, h: h2, string: string3 } = parameters;
19845
- const numPins = Number.parseInt(string3?.split("_")[1] ?? "3");
19869
+ const { id, od, w, h: h2, string: string3 } = parameters;
19870
+ const numPins = parameters.num_pins ?? Number.parseInt(string3?.match(/^to220(?:_|-)(\d+)/i)?.[1] ?? "3");
19846
19871
  const holeY = -1;
19847
19872
  const halfWidth = w / 2;
19848
19873
  const halfHeight = h2 / 2;
@@ -19915,20 +19940,76 @@ var to220 = (raw_params) => {
19915
19940
  parameters: { ...parameters, p: computedPitch }
19916
19941
  };
19917
19942
  };
19918
- var minimelf_def = base_def.extend({
19943
+ var TO220F_PITCH_MM = 2.54;
19944
+ var to220f_def = base_def.extend({
19919
19945
  fn: z49.string(),
19920
- num_pins: z49.literal(2).default(2),
19921
- w: z49.string().default("5.40mm"),
19922
- h: z49.string().default("2.30mm"),
19923
- pl: z49.string().default("1.30mm"),
19924
- pw: z49.string().default("1.70mm"),
19925
- p: z49.string().default("3.5mm")
19946
+ // KiCad TO-220F-3_Vertical: hole=1.2mm, pad=1.905×2.0mm, pitch=2.54mm
19947
+ id: length39.optional().default("1.2mm"),
19948
+ od: length39.optional().default("1.905mm"),
19949
+ ph: length39.optional().default("2mm"),
19950
+ w: length39.optional().default("13mm"),
19951
+ h: length39.optional().default("7mm"),
19952
+ num_pins: z49.number().optional(),
19953
+ string: z49.string().optional()
19954
+ });
19955
+ var to220f = (raw_params) => {
19956
+ const parameters = to220f_def.parse(raw_params);
19957
+ const numPins = parameters.num_pins ?? Number.parseInt(
19958
+ parameters.string?.match(/^to220f(?:_|-)(\d+)/i)?.[1] ?? "3"
19959
+ );
19960
+ const baseResult = to220({
19961
+ ...parameters,
19962
+ fn: "to220",
19963
+ string: parameters.string?.replace(/^to220f/i, "to220"),
19964
+ num_pins: numPins
19965
+ });
19966
+ const holeY = -1;
19967
+ const newHoles = Array.from(
19968
+ { length: numPins },
19969
+ (_, i) => {
19970
+ const x = numPins % 2 === 0 ? (i - numPins / 2 + 0.5) * TO220F_PITCH_MM : (i - Math.floor(numPins / 2)) * TO220F_PITCH_MM;
19971
+ if (i === 0) {
19972
+ return platedHoleWithRectPad({
19973
+ pn: 1,
19974
+ x,
19975
+ y: holeY,
19976
+ holeDiameter: parameters.id,
19977
+ rectPadWidth: parameters.od,
19978
+ rectPadHeight: parameters.ph
19979
+ });
19980
+ }
19981
+ return platedHolePill(
19982
+ i + 1,
19983
+ x,
19984
+ holeY,
19985
+ mm(parameters.id),
19986
+ mm(parameters.od),
19987
+ mm(parameters.ph)
19988
+ );
19989
+ }
19990
+ );
19991
+ const nonHoleElements = baseResult.circuitJson.filter(
19992
+ (e) => e.type !== "pcb_plated_hole"
19993
+ );
19994
+ return {
19995
+ circuitJson: [...newHoles, ...nonHoleElements],
19996
+ parameters: { ...parameters, p: TO220F_PITCH_MM, num_pins: numPins }
19997
+ };
19998
+ };
19999
+ var minimelf_def = base_def.extend({
20000
+ fn: z50.string(),
20001
+ num_pins: z50.literal(2).default(2),
20002
+ w: z50.string().default("5.40mm"),
20003
+ h: z50.string().default("2.30mm"),
20004
+ pl: z50.string().default("1.30mm"),
20005
+ pw: z50.string().default("1.70mm"),
20006
+ p: z50.string().default("3.5mm")
19926
20007
  });
19927
20008
  var minimelf = (raw_params) => {
19928
20009
  const parameters = minimelf_def.parse(raw_params);
19929
20010
  const silkscreenRefText = silkscreenRef(
19930
20011
  0,
19931
- length39.parse(parameters.h) / 2 + 0.4,
20012
+ length40.parse(parameters.h) / 2 + 0.4,
19932
20013
  0.3
19933
20014
  );
19934
20015
  const silkscreenLine = {
@@ -19937,20 +20018,20 @@ var minimelf = (raw_params) => {
19937
20018
  pcb_component_id: "",
19938
20019
  route: [
19939
20020
  {
19940
- x: length39.parse(parameters.p) / 2,
19941
- y: length39.parse(parameters.h) / 2
20021
+ x: length40.parse(parameters.p) / 2,
20022
+ y: length40.parse(parameters.h) / 2
19942
20023
  },
19943
20024
  {
19944
- x: -length39.parse(parameters.w) / 2,
19945
- y: length39.parse(parameters.h) / 2
20025
+ x: -length40.parse(parameters.w) / 2,
20026
+ y: length40.parse(parameters.h) / 2
19946
20027
  },
19947
20028
  {
19948
- x: -length39.parse(parameters.w) / 2,
19949
- y: -length39.parse(parameters.h) / 2
20029
+ x: -length40.parse(parameters.w) / 2,
20030
+ y: -length40.parse(parameters.h) / 2
19950
20031
  },
19951
20032
  {
19952
- x: length39.parse(parameters.p) / 2,
19953
- y: -length39.parse(parameters.h) / 2
20033
+ x: length40.parse(parameters.p) / 2,
20034
+ y: -length40.parse(parameters.h) / 2
19954
20035
  }
19955
20036
  ],
19956
20037
  stroke_width: 0.1,
@@ -19988,19 +20069,19 @@ var miniMelfWithoutParsing = (parameters) => {
19988
20069
  return pads;
19989
20070
  };
19990
20071
  var sod_def11 = base_def.extend({
19991
- fn: z50.string(),
19992
- num_pins: z50.literal(2).default(2),
19993
- w: z50.string().default("1.90mm"),
19994
- h: z50.string().default("1.33mm"),
19995
- pl: z50.string().default("0.5mm"),
19996
- pw: z50.string().default("0.7mm"),
19997
- p: z50.string().default("0.8mm")
20072
+ fn: z51.string(),
20073
+ num_pins: z51.literal(2).default(2),
20074
+ w: z51.string().default("1.90mm"),
20075
+ h: z51.string().default("1.33mm"),
20076
+ pl: z51.string().default("0.5mm"),
20077
+ pw: z51.string().default("0.7mm"),
20078
+ p: z51.string().default("0.8mm")
19998
20079
  });
19999
20080
  var sod882d = (raw_params) => {
20000
20081
  const parameters = sod_def11.parse(raw_params);
20001
20082
  const silkscreenRefText = silkscreenRef(
20002
20083
  0,
20003
- length40.parse(parameters.h) + 0.1,
20084
+ length41.parse(parameters.h) + 0.1,
20004
20085
  0.3
20005
20086
  );
20006
20087
  const silkscreenLine = {
@@ -20009,20 +20090,20 @@ var sod882d = (raw_params) => {
20009
20090
  pcb_component_id: "",
20010
20091
  route: [
20011
20092
  {
20012
- x: length40.parse(parameters.p) / 2 + 0.1,
20013
- y: length40.parse(parameters.h) / 2
20093
+ x: length41.parse(parameters.p) / 2 + 0.1,
20094
+ y: length41.parse(parameters.h) / 2
20014
20095
  },
20015
20096
  {
20016
- x: -length40.parse(parameters.w) / 2,
20017
- y: length40.parse(parameters.h) / 2
20097
+ x: -length41.parse(parameters.w) / 2,
20098
+ y: length41.parse(parameters.h) / 2
20018
20099
  },
20019
20100
  {
20020
- x: -length40.parse(parameters.w) / 2,
20021
- y: -length40.parse(parameters.h) / 2
20101
+ x: -length41.parse(parameters.w) / 2,
20102
+ y: -length41.parse(parameters.h) / 2
20022
20103
  },
20023
20104
  {
20024
- x: length40.parse(parameters.p) / 2 + 0.1,
20025
- y: -length40.parse(parameters.h) / 2
20105
+ x: length41.parse(parameters.p) / 2 + 0.1,
20106
+ y: -length41.parse(parameters.h) / 2
20026
20107
  }
20027
20108
  ],
20028
20109
  stroke_width: 0.1,
@@ -20064,19 +20145,19 @@ var sodWithoutParsing12 = (parameters) => {
20064
20145
  return pads;
20065
20146
  };
20066
20147
  var melf_def = base_def.extend({
20067
- fn: z51.string(),
20068
- num_pins: z51.literal(2).default(2),
20069
- w: z51.string().default("7.0mm"),
20070
- h: z51.string().default("3.35mm"),
20071
- pl: z51.string().default("1.50mm"),
20072
- pw: z51.string().default("2.70mm"),
20073
- p: z51.string().default("4.8mm")
20148
+ fn: z52.string(),
20149
+ num_pins: z52.literal(2).default(2),
20150
+ w: z52.string().default("7.0mm"),
20151
+ h: z52.string().default("3.35mm"),
20152
+ pl: z52.string().default("1.50mm"),
20153
+ pw: z52.string().default("2.70mm"),
20154
+ p: z52.string().default("4.8mm")
20074
20155
  });
20075
20156
  var melf = (raw_params) => {
20076
20157
  const parameters = melf_def.parse(raw_params);
20077
20158
  const silkscreenRefText = silkscreenRef(
20078
20159
  0,
20079
- length41.parse(parameters.h),
20160
+ length42.parse(parameters.h),
20080
20161
  0.3
20081
20162
  );
20082
20163
  const silkscreenLine = {
@@ -20085,20 +20166,20 @@ var melf = (raw_params) => {
20085
20166
  pcb_component_id: "",
20086
20167
  route: [
20087
20168
  {
20088
- x: length41.parse(parameters.p) / 2,
20089
- y: length41.parse(parameters.h) / 2
20169
+ x: length42.parse(parameters.p) / 2,
20170
+ y: length42.parse(parameters.h) / 2
20090
20171
  },
20091
20172
  {
20092
- x: -length41.parse(parameters.w) / 2,
20093
- y: length41.parse(parameters.h) / 2
20173
+ x: -length42.parse(parameters.w) / 2,
20174
+ y: length42.parse(parameters.h) / 2
20094
20175
  },
20095
20176
  {
20096
- x: -length41.parse(parameters.w) / 2,
20097
- y: -length41.parse(parameters.h) / 2
20177
+ x: -length42.parse(parameters.w) / 2,
20178
+ y: -length42.parse(parameters.h) / 2
20098
20179
  },
20099
20180
  {
20100
- x: length41.parse(parameters.p) / 2,
20101
- y: -length41.parse(parameters.h) / 2
20181
+ x: length42.parse(parameters.p) / 2,
20182
+ y: -length42.parse(parameters.h) / 2
20102
20183
  }
20103
20184
  ],
20104
20185
  stroke_width: 0.1,
@@ -20140,19 +20221,19 @@ var melfWithoutParsing = (parameters) => {
20140
20221
  return pads;
20141
20222
  };
20142
20223
  var micromelf_def = base_def.extend({
20143
- fn: z52.string(),
20144
- num_pins: z52.literal(2).default(2),
20145
- w: z52.string().default("3.0mm"),
20146
- h: z52.string().default("1.80mm"),
20147
- pl: z52.string().default("0.80mm"),
20148
- pw: z52.string().default("1.20mm"),
20149
- p: z52.string().default("1.6mm")
20224
+ fn: z53.string(),
20225
+ num_pins: z53.literal(2).default(2),
20226
+ w: z53.string().default("3.0mm"),
20227
+ h: z53.string().default("1.80mm"),
20228
+ pl: z53.string().default("0.80mm"),
20229
+ pw: z53.string().default("1.20mm"),
20230
+ p: z53.string().default("1.6mm")
20150
20231
  });
20151
20232
  var micromelf = (raw_params) => {
20152
20233
  const parameters = micromelf_def.parse(raw_params);
20153
20234
  const silkscreenRefText = silkscreenRef(
20154
20235
  0,
20155
- length42.parse(parameters.h),
20236
+ length43.parse(parameters.h),
20156
20237
  0.3
20157
20238
  );
20158
20239
  const silkscreenLine = {
@@ -20161,20 +20242,20 @@ var micromelf = (raw_params) => {
20161
20242
  pcb_component_id: "",
20162
20243
  route: [
20163
20244
  {
20164
- x: length42.parse(parameters.p) / 2,
20165
- y: length42.parse(parameters.h) / 2
20245
+ x: length43.parse(parameters.p) / 2,
20246
+ y: length43.parse(parameters.h) / 2
20166
20247
  },
20167
20248
  {
20168
- x: -length42.parse(parameters.w) / 2 - 0.1,
20169
- y: length42.parse(parameters.h) / 2
20249
+ x: -length43.parse(parameters.w) / 2 - 0.1,
20250
+ y: length43.parse(parameters.h) / 2
20170
20251
  },
20171
20252
  {
20172
- x: -length42.parse(parameters.w) / 2 - 0.1,
20173
- y: -length42.parse(parameters.h) / 2
20253
+ x: -length43.parse(parameters.w) / 2 - 0.1,
20254
+ y: -length43.parse(parameters.h) / 2
20174
20255
  },
20175
20256
  {
20176
- x: length42.parse(parameters.p) / 2,
20177
- y: -length42.parse(parameters.h) / 2
20257
+ x: length43.parse(parameters.p) / 2,
20258
+ y: -length43.parse(parameters.h) / 2
20178
20259
  }
20179
20260
  ],
20180
20261
  stroke_width: 0.1,
@@ -20216,19 +20297,19 @@ var microMelfWithoutParsing = (parameters) => {
20216
20297
  return pads;
20217
20298
  };
20218
20299
  var sma_def = base_def.extend({
20219
- fn: z53.string(),
20220
- num_pins: z53.literal(2).default(2),
20221
- w: z53.string().default("7.10mm"),
20222
- h: z53.string().default("3.40mm"),
20223
- pl: z53.string().default("2.45mm"),
20224
- pw: z53.string().default("1.80mm"),
20225
- p: z53.string().default("4.05mm")
20300
+ fn: z54.string(),
20301
+ num_pins: z54.literal(2).default(2),
20302
+ w: z54.string().default("7.10mm"),
20303
+ h: z54.string().default("3.40mm"),
20304
+ pl: z54.string().default("2.45mm"),
20305
+ pw: z54.string().default("1.80mm"),
20306
+ p: z54.string().default("4.05mm")
20226
20307
  });
20227
20308
  var sma = (raw_params) => {
20228
20309
  const parameters = sma_def.parse(raw_params);
20229
20310
  const silkscreenRefText = silkscreenRef(
20230
20311
  0,
20231
- length43.parse(parameters.h) / 2 + 0.5,
20312
+ length44.parse(parameters.h) / 2 + 0.5,
20232
20313
  0.3
20233
20314
  );
20234
20315
  const silkscreenLine = {
@@ -20237,20 +20318,20 @@ var sma = (raw_params) => {
20237
20318
  pcb_component_id: "",
20238
20319
  route: [
20239
20320
  {
20240
- x: length43.parse(parameters.p) / 2,
20241
- y: length43.parse(parameters.h) / 2
20321
+ x: length44.parse(parameters.p) / 2,
20322
+ y: length44.parse(parameters.h) / 2
20242
20323
  },
20243
20324
  {
20244
- x: -length43.parse(parameters.w) / 2 - 0.5,
20245
- y: length43.parse(parameters.h) / 2
20325
+ x: -length44.parse(parameters.w) / 2 - 0.5,
20326
+ y: length44.parse(parameters.h) / 2
20246
20327
  },
20247
20328
  {
20248
- x: -length43.parse(parameters.w) / 2 - 0.5,
20249
- y: -length43.parse(parameters.h) / 2
20329
+ x: -length44.parse(parameters.w) / 2 - 0.5,
20330
+ y: -length44.parse(parameters.h) / 2
20250
20331
  },
20251
20332
  {
20252
- x: length43.parse(parameters.p) / 2,
20253
- y: -length43.parse(parameters.h) / 2
20333
+ x: length44.parse(parameters.p) / 2,
20334
+ y: -length44.parse(parameters.h) / 2
20254
20335
  }
20255
20336
  ],
20256
20337
  stroke_width: 0.1,
@@ -20291,19 +20372,19 @@ var smaWithoutParsing = (parameters) => {
20291
20372
  return pads;
20292
20373
  };
20293
20374
  var smf_def = base_def.extend({
20294
- fn: z54.string(),
20295
- num_pins: z54.literal(2).default(2),
20296
- w: z54.string().default("4.80mm"),
20297
- h: z54.string().default("2.10mm"),
20298
- pl: z54.string().default("1.30mm"),
20299
- pw: z54.string().default("1.40mm"),
20300
- p: z54.string().default("2.9mm")
20375
+ fn: z55.string(),
20376
+ num_pins: z55.literal(2).default(2),
20377
+ w: z55.string().default("4.80mm"),
20378
+ h: z55.string().default("2.10mm"),
20379
+ pl: z55.string().default("1.30mm"),
20380
+ pw: z55.string().default("1.40mm"),
20381
+ p: z55.string().default("2.9mm")
20301
20382
  });
20302
20383
  var smf = (raw_params) => {
20303
20384
  const parameters = smf_def.parse(raw_params);
20304
20385
  const silkscreenRefText = silkscreenRef(
20305
20386
  0,
20306
- length44.parse(parameters.h) - 0.5,
20387
+ length45.parse(parameters.h) - 0.5,
20307
20388
  0.3
20308
20389
  );
20309
20390
  const silkscreenLine = {
@@ -20312,20 +20393,20 @@ var smf = (raw_params) => {
20312
20393
  pcb_component_id: "",
20313
20394
  route: [
20314
20395
  {
20315
- x: length44.parse(parameters.p) / 2,
20316
- y: length44.parse(parameters.h) / 2
20396
+ x: length45.parse(parameters.p) / 2,
20397
+ y: length45.parse(parameters.h) / 2
20317
20398
  },
20318
20399
  {
20319
- x: -length44.parse(parameters.w) / 2,
20320
- y: length44.parse(parameters.h) / 2
20400
+ x: -length45.parse(parameters.w) / 2,
20401
+ y: length45.parse(parameters.h) / 2
20321
20402
  },
20322
20403
  {
20323
- x: -length44.parse(parameters.w) / 2,
20324
- y: -length44.parse(parameters.h) / 2
20404
+ x: -length45.parse(parameters.w) / 2,
20405
+ y: -length45.parse(parameters.h) / 2
20325
20406
  },
20326
20407
  {
20327
- x: length44.parse(parameters.p) / 2,
20328
- y: -length44.parse(parameters.h) / 2
20408
+ x: length45.parse(parameters.p) / 2,
20409
+ y: -length45.parse(parameters.h) / 2
20329
20410
  }
20330
20411
  ],
20331
20412
  stroke_width: 0.1,
@@ -20367,19 +20448,19 @@ var smfWithoutParsing = (parameters) => {
20367
20448
  return pads;
20368
20449
  };
20369
20450
  var smb_def = base_def.extend({
20370
- fn: z55.string(),
20371
- num_pins: z55.literal(2).default(2),
20372
- w: z55.string().default("7.30mm"),
20373
- h: z55.string().default("4.40mm"),
20374
- pl: z55.string().default("2.50mm"),
20375
- pw: z55.string().default("2.30mm"),
20376
- p: z55.string().default("4.30mm")
20451
+ fn: z56.string(),
20452
+ num_pins: z56.literal(2).default(2),
20453
+ w: z56.string().default("7.30mm"),
20454
+ h: z56.string().default("4.40mm"),
20455
+ pl: z56.string().default("2.50mm"),
20456
+ pw: z56.string().default("2.30mm"),
20457
+ p: z56.string().default("4.30mm")
20377
20458
  });
20378
20459
  var smb = (raw_params) => {
20379
20460
  const parameters = smb_def.parse(raw_params);
20380
20461
  const silkscreenRefText = silkscreenRef(
20381
20462
  0,
20382
- length45.parse(parameters.h) / 2 + 0.5,
20463
+ length46.parse(parameters.h) / 2 + 0.5,
20383
20464
  0.3
20384
20465
  );
20385
20466
  const silkscreenLine = {
@@ -20388,20 +20469,20 @@ var smb = (raw_params) => {
20388
20469
  pcb_component_id: "",
20389
20470
  route: [
20390
20471
  {
20391
- x: length45.parse(parameters.p) / 2,
20392
- y: length45.parse(parameters.h) / 2
20472
+ x: length46.parse(parameters.p) / 2,
20473
+ y: length46.parse(parameters.h) / 2
20393
20474
  },
20394
20475
  {
20395
- x: -length45.parse(parameters.w) / 2 - 0.1,
20396
- y: length45.parse(parameters.h) / 2
20476
+ x: -length46.parse(parameters.w) / 2 - 0.1,
20477
+ y: length46.parse(parameters.h) / 2
20397
20478
  },
20398
20479
  {
20399
- x: -length45.parse(parameters.w) / 2 - 0.1,
20400
- y: -length45.parse(parameters.h) / 2
20480
+ x: -length46.parse(parameters.w) / 2 - 0.1,
20481
+ y: -length46.parse(parameters.h) / 2
20401
20482
  },
20402
20483
  {
20403
- x: length45.parse(parameters.p) / 2,
20404
- y: -length45.parse(parameters.h) / 2
20484
+ x: length46.parse(parameters.p) / 2,
20485
+ y: -length46.parse(parameters.h) / 2
20405
20486
  }
20406
20487
  ],
20407
20488
  stroke_width: 0.1,
@@ -20443,13 +20524,13 @@ var smbWithoutParsing = (parameters) => {
20443
20524
  return pads;
20444
20525
  };
20445
20526
  var smc_def = base_def.extend({
20446
- fn: z56.string(),
20447
- num_pins: z56.literal(2).default(2),
20448
- w: z56.string().default("10.70mm"),
20449
- h: z56.string().default("6.60mm"),
20450
- pl: z56.string().default("3.30mm"),
20451
- pw: z56.string().default("2.50mm"),
20452
- p: z56.string().default("6.80mm")
20527
+ fn: z57.string(),
20528
+ num_pins: z57.literal(2).default(2),
20529
+ w: z57.string().default("10.70mm"),
20530
+ h: z57.string().default("6.60mm"),
20531
+ pl: z57.string().default("3.30mm"),
20532
+ pw: z57.string().default("2.50mm"),
20533
+ p: z57.string().default("6.80mm")
20453
20534
  });
20454
20535
  var smc = (raw_params) => {
20455
20536
  const parameters = smc_def.parse(raw_params);
@@ -20460,20 +20541,20 @@ var smc = (raw_params) => {
20460
20541
  pcb_component_id: "",
20461
20542
  route: [
20462
20543
  {
20463
- x: length46.parse(parameters.p) / 2,
20464
- y: length46.parse(parameters.h) / 2 - 0.8
20544
+ x: length47.parse(parameters.p) / 2,
20545
+ y: length47.parse(parameters.h) / 2 - 0.8
20465
20546
  },
20466
20547
  {
20467
- x: -length46.parse(parameters.w) / 2 - 0.8,
20468
- y: length46.parse(parameters.h) / 2 - 0.8
20548
+ x: -length47.parse(parameters.w) / 2 - 0.8,
20549
+ y: length47.parse(parameters.h) / 2 - 0.8
20469
20550
  },
20470
20551
  {
20471
- x: -length46.parse(parameters.w) / 2 - 0.8,
20472
- y: -length46.parse(parameters.h) / 2 + 0.8
20552
+ x: -length47.parse(parameters.w) / 2 - 0.8,
20553
+ y: -length47.parse(parameters.h) / 2 + 0.8
20473
20554
  },
20474
20555
  {
20475
- x: length46.parse(parameters.p) / 2,
20476
- y: -length46.parse(parameters.h) / 2 + 0.8
20556
+ x: length47.parse(parameters.p) / 2,
20557
+ y: -length47.parse(parameters.h) / 2 + 0.8
20477
20558
  }
20478
20559
  ],
20479
20560
  stroke_width: 0.1,
@@ -20514,14 +20595,14 @@ var smcWithoutParsing = (parameters) => {
20514
20595
  return pads;
20515
20596
  };
20516
20597
  var sot223_def = base_def.extend({
20517
- fn: z57.string(),
20518
- num_pins: z57.number().default(4),
20519
- w: z57.string().default("8.50mm"),
20520
- h: z57.string().default("6.90mm"),
20521
- pl: z57.string().default("2mm"),
20522
- pw: z57.string().default("1.5mm"),
20523
- p: z57.string().default("2.30mm"),
20524
- string: z57.string().optional()
20598
+ fn: z58.string(),
20599
+ num_pins: z58.number().default(4),
20600
+ w: z58.string().default("8.50mm"),
20601
+ h: z58.string().default("6.90mm"),
20602
+ pl: z58.string().default("2mm"),
20603
+ pw: z58.string().default("1.5mm"),
20604
+ p: z58.string().default("2.30mm"),
20605
+ string: z58.string().optional()
20525
20606
  });
20526
20607
  var sot223 = (raw_params) => {
20527
20608
  const match = raw_params.string?.match(/^sot223_(\d+)/);
@@ -20766,14 +20847,14 @@ var sot223_6 = (parameters) => {
20766
20847
  return [...pads, silkscreenPath1, silkscreenPath2, silkscreenRefText];
20767
20848
  };
20768
20849
  var sot23w_def = base_def.extend({
20769
- fn: z58.string(),
20770
- num_pins: z58.number().default(3),
20771
- w: z58.string().default("3.40mm"),
20772
- h: z58.string().default("3.30mm"),
20773
- pl: z58.string().default("1mm"),
20774
- pw: z58.string().default("0.7mm"),
20775
- p: z58.string().default("1.2mm"),
20776
- string: z58.string().optional()
20850
+ fn: z59.string(),
20851
+ num_pins: z59.number().default(3),
20852
+ w: z59.string().default("3.40mm"),
20853
+ h: z59.string().default("3.30mm"),
20854
+ pl: z59.string().default("1mm"),
20855
+ pw: z59.string().default("0.7mm"),
20856
+ p: z59.string().default("1.2mm"),
20857
+ string: z59.string().optional()
20777
20858
  });
20778
20859
  var sot23w = (raw_params) => {
20779
20860
  const match = raw_params.string?.match(/^sot23w_(\d+)/);
@@ -20860,14 +20941,14 @@ var sot23w_3 = (parameters) => {
20860
20941
  ];
20861
20942
  };
20862
20943
  var to92s_def = base_def.extend({
20863
- fn: z59.string(),
20864
- num_pins: z59.union([z59.literal(3), z59.literal(2)]).default(3),
20865
- p: z59.string().default("1.27mm"),
20866
- id: z59.string().default("0.72mm"),
20867
- od: z59.string().default("0.95mm"),
20868
- w: z59.string().default("2.5mm"),
20869
- h: z59.string().default("4.2mm"),
20870
- string: z59.string().optional()
20944
+ fn: z60.string(),
20945
+ num_pins: z60.union([z60.literal(3), z60.literal(2)]).default(3),
20946
+ p: z60.string().default("1.27mm"),
20947
+ id: z60.string().default("0.72mm"),
20948
+ od: z60.string().default("0.95mm"),
20949
+ w: z60.string().default("2.5mm"),
20950
+ h: z60.string().default("4.2mm"),
20951
+ string: z60.string().optional()
20871
20952
  });
20872
20953
  var to92s_3 = (parameters) => {
20873
20954
  const { p, id, od, w, h: h2 } = parameters;
@@ -20932,41 +21013,53 @@ var to92s = (raw_params) => {
20932
21013
  };
20933
21014
  };
20934
21015
  var jst_def = base_def.extend({
20935
- fn: z60.string(),
20936
- p: length47.optional(),
20937
- id: length47.optional(),
20938
- pw: length47.optional(),
20939
- pl: length47.optional(),
20940
- w: length47.optional(),
20941
- h: length47.optional(),
20942
- sh: z60.boolean().optional().describe(
21016
+ fn: z61.string(),
21017
+ p: length48.optional(),
21018
+ id: length48.optional(),
21019
+ pw: length48.optional(),
21020
+ pl: length48.optional(),
21021
+ w: length48.optional(),
21022
+ h: length48.optional(),
21023
+ sh: z61.boolean().optional().describe(
20943
21024
  'JST SH (Surface-mount) connector family. SH stands for "Super High-density".'
20944
21025
  ),
20945
- ph: z60.boolean().optional().describe(
21026
+ ph: z61.boolean().optional().describe(
20946
21027
  'JST PH (Through-hole) connector family. PH stands for "Pin Header".'
20947
21028
  ),
20948
- string: z60.string().optional()
21029
+ zh: z61.boolean().optional().describe(
21030
+ "JST ZH (Through-hole) connector family. 1.5mm pitch wire-to-board."
21031
+ ),
21032
+ string: z61.string().optional()
20949
21033
  });
20950
21034
  var variantDefaults = {
20951
21035
  ph: {
20952
- p: length47.parse("2.2mm"),
20953
- id: length47.parse("0.70mm"),
20954
- pw: length47.parse("1.20mm"),
20955
- pl: length47.parse("1.20mm"),
20956
- w: length47.parse("6mm"),
20957
- h: length47.parse("5mm")
21036
+ p: length48.parse("2.2mm"),
21037
+ id: length48.parse("0.70mm"),
21038
+ pw: length48.parse("1.20mm"),
21039
+ pl: length48.parse("1.20mm"),
21040
+ w: length48.parse("6mm"),
21041
+ h: length48.parse("5mm")
20958
21042
  },
20959
21043
  sh: {
20960
- p: length47.parse("1mm"),
20961
- pw: length47.parse("0.6mm"),
20962
- pl: length47.parse("1.55mm"),
20963
- w: length47.parse("5.8mm"),
20964
- h: length47.parse("7.8mm")
21044
+ p: length48.parse("1mm"),
21045
+ pw: length48.parse("0.6mm"),
21046
+ pl: length48.parse("1.55mm"),
21047
+ w: length48.parse("5.8mm"),
21048
+ h: length48.parse("7.8mm")
21049
+ },
21050
+ zh: {
21051
+ p: length48.parse("1.5mm"),
21052
+ id: length48.parse("0.73mm"),
21053
+ pw: length48.parse("1.03mm"),
21054
+ pl: length48.parse("1.73mm"),
21055
+ w: length48.parse("3mm"),
21056
+ h: length48.parse("3.5mm")
20965
21057
  }
20966
21058
  };
20967
21059
  function getVariant(params) {
20968
21060
  if (params.sh) return "sh";
20969
21061
  if (params.ph) return "ph";
21062
+ if (params.zh) return "zh";
20970
21063
  return "ph";
20971
21064
  }
20972
21065
  function generatePads(variant, numPins, p, id, pw, pl) {
@@ -20986,6 +21079,26 @@ function generatePads(variant, numPins, p, id, pw, pl) {
20986
21079
  })
20987
21080
  );
20988
21081
  }
21082
+ } else if (variant === "zh") {
21083
+ const startX = -((numPins - 1) / 2) * p;
21084
+ for (let i = 0; i < numPins; i++) {
21085
+ const x = startX + i * p;
21086
+ if (i === 0) {
21087
+ pads.push(
21088
+ platedHoleWithRectPad({
21089
+ pn: i + 1,
21090
+ x,
21091
+ y: 0,
21092
+ holeDiameter: id,
21093
+ rectPadWidth: pw,
21094
+ rectPadHeight: pl,
21095
+ rectBorderRadius: 0.12499977
21096
+ })
21097
+ );
21098
+ } else {
21099
+ pads.push(platedHolePill(i + 1, x, 0, id, pw, pl));
21100
+ }
21101
+ }
20989
21102
  } else {
20990
21103
  const startX = -((numPins - 1) / 2) * p;
20991
21104
  for (let i = 0; i < numPins; i++) {
@@ -20998,7 +21111,7 @@ function generatePads(variant, numPins, p, id, pw, pl) {
20998
21111
  }
20999
21112
  return pads;
21000
21113
  }
21001
- function generateSilkscreenBody(variant, w, h2) {
21114
+ function generateSilkscreenBody(variant, w, h2, numPins, p) {
21002
21115
  if (variant === "ph") {
21003
21116
  return {
21004
21117
  type: "pcb_silkscreen_path",
@@ -21014,6 +21127,26 @@ function generateSilkscreenBody(variant, w, h2) {
21014
21127
  stroke_width: 0.1,
21015
21128
  pcb_silkscreen_path_id: ""
21016
21129
  };
21130
+ } else if (variant === "zh" && numPins && p) {
21131
+ const pinSpan = (numPins - 1) * p;
21132
+ const bodyLeft = -pinSpan / 2 - 1.5;
21133
+ const bodyRight = pinSpan / 2 + 1.5;
21134
+ const bodyTop = -h2 / 2;
21135
+ const bodyBottom = h2 / 2;
21136
+ return {
21137
+ type: "pcb_silkscreen_path",
21138
+ layer: "top",
21139
+ pcb_component_id: "",
21140
+ route: [
21141
+ { x: bodyLeft, y: bodyTop },
21142
+ { x: bodyRight, y: bodyTop },
21143
+ { x: bodyRight, y: bodyBottom },
21144
+ { x: bodyLeft, y: bodyBottom },
21145
+ { x: bodyLeft, y: bodyTop }
21146
+ ],
21147
+ stroke_width: 0.1,
21148
+ pcb_silkscreen_path_id: ""
21149
+ };
21017
21150
  } else {
21018
21151
  return {
21019
21152
  type: "pcb_silkscreen_path",
@@ -21042,8 +21175,15 @@ var jst = (raw_params) => {
21042
21175
  }
21043
21176
  const str = typeof raw_params.string === "string" ? raw_params.string : "";
21044
21177
  const match = str.match(/(?:^|_)jst(\d+)(?:_|$)/);
21178
+ const zhMatch = str.match(/(?:^|_)zh(\d+)(?:_|$)/);
21045
21179
  if (match && match[1]) {
21046
- const parsed = parseInt(match[1], 10);
21180
+ const parsed = Number.parseInt(match[1], 10);
21181
+ if (!Number.isNaN(parsed)) {
21182
+ numPins = parsed;
21183
+ }
21184
+ }
21185
+ if (zhMatch && zhMatch[1]) {
21186
+ const parsed = Number.parseInt(zhMatch[1], 10);
21047
21187
  if (!Number.isNaN(parsed)) {
21048
21188
  numPins = parsed;
21049
21189
  }
@@ -21054,7 +21194,7 @@ var jst = (raw_params) => {
21054
21194
  );
21055
21195
  }
21056
21196
  const pads = generatePads(variant, numPins, p, id, pw, pl);
21057
- const silkscreenBody = generateSilkscreenBody(variant, w, h2);
21197
+ const silkscreenBody = generateSilkscreenBody(variant, w, h2, numPins, p);
21058
21198
  const silkscreenRefText = silkscreenRef(0, h2 / 2 + 1, 0.5);
21059
21199
  return {
21060
21200
  circuitJson: [...pads, silkscreenBody, silkscreenRefText],
@@ -21068,24 +21208,25 @@ var jst = (raw_params) => {
21068
21208
  h: h2,
21069
21209
  num_pins: numPins,
21070
21210
  sh: variant === "sh",
21071
- ph: variant === "ph"
21211
+ ph: variant === "ph",
21212
+ zh: variant === "zh"
21072
21213
  }
21073
21214
  };
21074
21215
  };
21075
21216
  var sod_def12 = base_def.extend({
21076
- fn: z61.string(),
21077
- num_pins: z61.literal(2).default(2),
21078
- w: z61.string().default("3.30mm"),
21079
- h: z61.string().default("1.70mm"),
21080
- pl: z61.string().default("0.80mm"),
21081
- pw: z61.string().default("1mm"),
21082
- p: z61.string().default("1.90mm")
21217
+ fn: z62.string(),
21218
+ num_pins: z62.literal(2).default(2),
21219
+ w: z62.string().default("3.30mm"),
21220
+ h: z62.string().default("1.70mm"),
21221
+ pl: z62.string().default("0.80mm"),
21222
+ pw: z62.string().default("1mm"),
21223
+ p: z62.string().default("1.90mm")
21083
21224
  });
21084
21225
  var sod110 = (raw_params) => {
21085
21226
  const parameters = sod_def12.parse(raw_params);
21086
21227
  const silkscreenRefText = silkscreenRef(
21087
21228
  0,
21088
- length48.parse(parameters.h) / 2 + 0.5,
21229
+ length49.parse(parameters.h) / 2 + 0.5,
21089
21230
  0.3
21090
21231
  );
21091
21232
  const silkscreenLine = {
@@ -21094,20 +21235,20 @@ var sod110 = (raw_params) => {
21094
21235
  pcb_component_id: "",
21095
21236
  route: [
21096
21237
  {
21097
- x: length48.parse(parameters.p) / 2,
21098
- y: length48.parse(parameters.h) / 2
21238
+ x: length49.parse(parameters.p) / 2,
21239
+ y: length49.parse(parameters.h) / 2
21099
21240
  },
21100
21241
  {
21101
- x: -length48.parse(parameters.w) / 2,
21102
- y: length48.parse(parameters.h) / 2
21242
+ x: -length49.parse(parameters.w) / 2,
21243
+ y: length49.parse(parameters.h) / 2
21103
21244
  },
21104
21245
  {
21105
- x: -length48.parse(parameters.w) / 2,
21106
- y: -length48.parse(parameters.h) / 2
21246
+ x: -length49.parse(parameters.w) / 2,
21247
+ y: -length49.parse(parameters.h) / 2
21107
21248
  },
21108
21249
  {
21109
- x: length48.parse(parameters.p) / 2,
21110
- y: -length48.parse(parameters.h) / 2
21250
+ x: length49.parse(parameters.p) / 2,
21251
+ y: -length49.parse(parameters.h) / 2
21111
21252
  }
21112
21253
  ],
21113
21254
  stroke_width: 0.1,
@@ -21176,23 +21317,23 @@ var getDefaultValues = (num_pins) => {
21176
21317
  }
21177
21318
  };
21178
21319
  var vssop_def = base_def.extend({
21179
- fn: z62.string(),
21180
- num_pins: z62.union([z62.literal(8), z62.literal(10)]).default(8),
21181
- w: z62.string().optional(),
21182
- h: z62.string().optional(),
21183
- p: z62.string().optional(),
21184
- pl: z62.string().optional(),
21185
- pw: z62.string().optional(),
21186
- string: z62.string().optional()
21320
+ fn: z63.string(),
21321
+ num_pins: z63.union([z63.literal(8), z63.literal(10)]).default(8),
21322
+ w: z63.string().optional(),
21323
+ h: z63.string().optional(),
21324
+ p: z63.string().optional(),
21325
+ pl: z63.string().optional(),
21326
+ pw: z63.string().optional(),
21327
+ string: z63.string().optional()
21187
21328
  });
21188
21329
  var vssop = (raw_params) => {
21189
21330
  const parameters = vssop_def.parse(raw_params);
21190
21331
  const defaults = getDefaultValues(parameters.num_pins);
21191
- const w = length49.parse(parameters.w || defaults.w);
21192
- const h2 = length49.parse(parameters.h || defaults.h);
21193
- const p = length49.parse(parameters.p || defaults.p);
21194
- const pl = length49.parse(parameters.pl || defaults.pl);
21195
- const pw = length49.parse(parameters.pw || defaults.pw);
21332
+ const w = length50.parse(parameters.w || defaults.w);
21333
+ const h2 = length50.parse(parameters.h || defaults.h);
21334
+ const p = length50.parse(parameters.p || defaults.p);
21335
+ const pl = length50.parse(parameters.pl || defaults.pl);
21336
+ const pw = length50.parse(parameters.pw || defaults.pw);
21196
21337
  const pads = [];
21197
21338
  const half = parameters.num_pins / 2;
21198
21339
  for (let i = 0; i < parameters.num_pins; i++) {
@@ -21269,7 +21410,7 @@ var getVssopPadCoord = (pinCount, pn, w, p) => {
21269
21410
  const col = pn <= half ? -1 : 1;
21270
21411
  const row = (half - 1) / 2 - rowIndex;
21271
21412
  return {
21272
- x: col * length49.parse(pinCount === 8 ? "1.8mm" : "2.2mm"),
21413
+ x: col * length50.parse(pinCount === 8 ? "1.8mm" : "2.2mm"),
21273
21414
  y: row * p
21274
21415
  };
21275
21416
  };
@@ -21310,14 +21451,14 @@ var getDefaultValues2 = (num_pins) => {
21310
21451
  }
21311
21452
  };
21312
21453
  var msop_def = base_def.extend({
21313
- fn: z63.string(),
21314
- num_pins: z63.union([z63.literal(8), z63.literal(10), z63.literal(12), z63.literal(16)]).default(8),
21315
- w: z63.string().optional(),
21316
- h: z63.string().optional(),
21317
- p: z63.string().optional(),
21318
- pl: z63.string().optional(),
21319
- pw: z63.string().optional(),
21320
- string: z63.string().optional()
21454
+ fn: z64.string(),
21455
+ num_pins: z64.union([z64.literal(8), z64.literal(10), z64.literal(12), z64.literal(16)]).default(8),
21456
+ w: z64.string().optional(),
21457
+ h: z64.string().optional(),
21458
+ p: z64.string().optional(),
21459
+ pl: z64.string().optional(),
21460
+ pw: z64.string().optional(),
21461
+ string: z64.string().optional()
21321
21462
  });
21322
21463
  var getMsopCoords = (pinCount, pn, w, p) => {
21323
21464
  const half = pinCount / 2;
@@ -21325,18 +21466,18 @@ var getMsopCoords = (pinCount, pn, w, p) => {
21325
21466
  const col = pn <= half ? -1 : 1;
21326
21467
  const row = (half - 1) / 2 - rowIndex;
21327
21468
  return {
21328
- x: col * length50.parse("2mm"),
21469
+ x: col * length51.parse("2mm"),
21329
21470
  y: row * p
21330
21471
  };
21331
21472
  };
21332
21473
  var msop = (raw_params) => {
21333
21474
  const parameters = msop_def.parse(raw_params);
21334
21475
  const defaults = getDefaultValues2(parameters.num_pins);
21335
- const w = length50.parse(parameters.w || defaults.w);
21336
- const h2 = length50.parse(parameters.h || defaults.h);
21337
- const p = length50.parse(parameters.p || defaults.p);
21338
- const pl = length50.parse(parameters.pl || defaults.pl);
21339
- const pw = length50.parse(parameters.pw || defaults.pw);
21476
+ const w = length51.parse(parameters.w || defaults.w);
21477
+ const h2 = length51.parse(parameters.h || defaults.h);
21478
+ const p = length51.parse(parameters.p || defaults.p);
21479
+ const pl = length51.parse(parameters.pl || defaults.pl);
21480
+ const pw = length51.parse(parameters.pw || defaults.pw);
21340
21481
  const pads = [];
21341
21482
  for (let i = 0; i < parameters.num_pins; i++) {
21342
21483
  const { x, y } = getMsopCoords(parameters.num_pins, i + 1, w, p);
@@ -21406,19 +21547,19 @@ var msop = (raw_params) => {
21406
21547
  };
21407
21548
  };
21408
21549
  var sod323w_def = base_def.extend({
21409
- fn: z64.string(),
21410
- num_pins: z64.literal(2).default(2),
21411
- w: z64.string().default("3.8mm"),
21412
- h: z64.string().default("1.65mm"),
21413
- pl: z64.string().default("1.2mm"),
21414
- pw: z64.string().default("1.2mm"),
21415
- pad_spacing: z64.string().default("2.6mm")
21550
+ fn: z65.string(),
21551
+ num_pins: z65.literal(2).default(2),
21552
+ w: z65.string().default("3.8mm"),
21553
+ h: z65.string().default("1.65mm"),
21554
+ pl: z65.string().default("1.2mm"),
21555
+ pw: z65.string().default("1.2mm"),
21556
+ pad_spacing: z65.string().default("2.6mm")
21416
21557
  });
21417
21558
  var sod323w = (raw_params) => {
21418
21559
  const parameters = sod323w_def.parse(raw_params);
21419
21560
  const silkscreenRefText = silkscreenRef(
21420
21561
  0,
21421
- length51.parse(parameters.h),
21562
+ length52.parse(parameters.h),
21422
21563
  0.3
21423
21564
  );
21424
21565
  const silkscreenLine = {
@@ -21427,20 +21568,20 @@ var sod323w = (raw_params) => {
21427
21568
  pcb_component_id: "",
21428
21569
  route: [
21429
21570
  {
21430
- x: length51.parse(parameters.pad_spacing) / 2,
21431
- y: length51.parse(parameters.h) / 2
21571
+ x: length52.parse(parameters.pad_spacing) / 2,
21572
+ y: length52.parse(parameters.h) / 2
21432
21573
  },
21433
21574
  {
21434
- x: -length51.parse(parameters.w) / 2 - 0.2,
21435
- y: length51.parse(parameters.h) / 2
21575
+ x: -length52.parse(parameters.w) / 2 - 0.2,
21576
+ y: length52.parse(parameters.h) / 2
21436
21577
  },
21437
21578
  {
21438
- x: -length51.parse(parameters.w) / 2 - 0.2,
21439
- y: -length51.parse(parameters.h) / 2
21579
+ x: -length52.parse(parameters.w) / 2 - 0.2,
21580
+ y: -length52.parse(parameters.h) / 2
21440
21581
  },
21441
21582
  {
21442
- x: length51.parse(parameters.pad_spacing) / 2,
21443
- y: -length51.parse(parameters.h) / 2
21583
+ x: length52.parse(parameters.pad_spacing) / 2,
21584
+ y: -length52.parse(parameters.h) / 2
21444
21585
  }
21445
21586
  ],
21446
21587
  stroke_width: 0.1,
@@ -21482,19 +21623,19 @@ var sodWithoutParsing14 = (parameters) => {
21482
21623
  return pads;
21483
21624
  };
21484
21625
  var sod323FL_def = base_def.extend({
21485
- fn: z65.string(),
21486
- num_pins: z65.literal(2).default(2),
21487
- w: z65.string().default("3.20mm"),
21488
- h: z65.string().default("1.65mm"),
21489
- pl: z65.string().default("0.8mm"),
21490
- pw: z65.string().default("0.9mm"),
21491
- pad_spacing: z65.string().default("2.1mm")
21626
+ fn: z66.string(),
21627
+ num_pins: z66.literal(2).default(2),
21628
+ w: z66.string().default("3.20mm"),
21629
+ h: z66.string().default("1.65mm"),
21630
+ pl: z66.string().default("0.8mm"),
21631
+ pw: z66.string().default("0.9mm"),
21632
+ pad_spacing: z66.string().default("2.1mm")
21492
21633
  });
21493
21634
  var sod323fl = (raw_params) => {
21494
21635
  const parameters = sod323FL_def.parse(raw_params);
21495
21636
  const silkscreenRefText = silkscreenRef(
21496
21637
  0,
21497
- length52.parse(parameters.h),
21638
+ length53.parse(parameters.h),
21498
21639
  0.3
21499
21640
  );
21500
21641
  const silkscreenLine = {
@@ -21503,20 +21644,20 @@ var sod323fl = (raw_params) => {
21503
21644
  pcb_component_id: "",
21504
21645
  route: [
21505
21646
  {
21506
- x: length52.parse(parameters.pad_spacing) / 2,
21507
- y: length52.parse(parameters.h) / 2
21647
+ x: length53.parse(parameters.pad_spacing) / 2,
21648
+ y: length53.parse(parameters.h) / 2
21508
21649
  },
21509
21650
  {
21510
- x: -length52.parse(parameters.w) / 2 - 0.2,
21511
- y: length52.parse(parameters.h) / 2
21651
+ x: -length53.parse(parameters.w) / 2 - 0.2,
21652
+ y: length53.parse(parameters.h) / 2
21512
21653
  },
21513
21654
  {
21514
- x: -length52.parse(parameters.w) / 2 - 0.2,
21515
- y: -length52.parse(parameters.h) / 2
21655
+ x: -length53.parse(parameters.w) / 2 - 0.2,
21656
+ y: -length53.parse(parameters.h) / 2
21516
21657
  },
21517
21658
  {
21518
- x: length52.parse(parameters.pad_spacing) / 2,
21519
- y: -length52.parse(parameters.h) / 2
21659
+ x: length53.parse(parameters.pad_spacing) / 2,
21660
+ y: -length53.parse(parameters.h) / 2
21520
21661
  }
21521
21662
  ],
21522
21663
  stroke_width: 0.1,
@@ -21558,17 +21699,17 @@ var sodWithoutParsing15 = (parameters) => {
21558
21699
  return pads;
21559
21700
  };
21560
21701
  var son_def = base_def.extend({
21561
- fn: z66.string(),
21562
- num_pins: z66.union([z66.literal(6), z66.literal(8)]).default(8),
21563
- w: z66.string().default("3mm"),
21564
- h: z66.string().default("3mm"),
21565
- p: z66.string().default("0.5mm"),
21566
- pl: z66.string().default("0.52mm"),
21567
- pw: z66.string().default("0.35mm"),
21568
- epw: z66.string().default("1.40mm"),
21569
- eph: z66.string().default("1.60mm"),
21570
- string: z66.string().optional(),
21571
- ep: z66.boolean().default(false)
21702
+ fn: z67.string(),
21703
+ num_pins: z67.union([z67.literal(6), z67.literal(8)]).default(8),
21704
+ w: z67.string().default("3mm"),
21705
+ h: z67.string().default("3mm"),
21706
+ p: z67.string().default("0.5mm"),
21707
+ pl: z67.string().default("0.52mm"),
21708
+ pw: z67.string().default("0.35mm"),
21709
+ epw: z67.string().default("1.40mm"),
21710
+ eph: z67.string().default("1.60mm"),
21711
+ string: z67.string().optional(),
21712
+ ep: z67.boolean().default(false)
21572
21713
  });
21573
21714
  var son = (raw_params) => {
21574
21715
  if (raw_params.string && raw_params.string.includes("_ep")) {
@@ -21580,13 +21721,13 @@ var son = (raw_params) => {
21580
21721
  ...raw_params,
21581
21722
  num_pins: numPins
21582
21723
  });
21583
- const w = length53.parse(parameters.w);
21584
- const h2 = length53.parse(parameters.h);
21585
- const p = length53.parse(parameters.p);
21586
- const pl = length53.parse(parameters.pl);
21587
- const pw = length53.parse(parameters.pw);
21588
- const epw = length53.parse(parameters.epw);
21589
- const eph = length53.parse(parameters.eph);
21724
+ const w = length54.parse(parameters.w);
21725
+ const h2 = length54.parse(parameters.h);
21726
+ const p = length54.parse(parameters.p);
21727
+ const pl = length54.parse(parameters.pl);
21728
+ const pw = length54.parse(parameters.pw);
21729
+ const epw = length54.parse(parameters.epw);
21730
+ const eph = length54.parse(parameters.eph);
21590
21731
  const pads = [];
21591
21732
  for (let i = 0; i < parameters.num_pins; i++) {
21592
21733
  const { x, y } = getSonPadCoord(parameters.num_pins, i + 1, w, p);
@@ -21664,20 +21805,20 @@ var getSonPadCoord = (num_pins, pn, w, p) => {
21664
21805
  const col = pn <= half ? -1 : 1;
21665
21806
  const row = (half - 1) / 2 - rowIndex;
21666
21807
  return {
21667
- x: col * length53.parse("1.4mm"),
21808
+ x: col * length54.parse("1.4mm"),
21668
21809
  y: row * p
21669
21810
  };
21670
21811
  };
21671
21812
  var vson_def = base_def.extend({
21672
- fn: z67.string(),
21673
- num_pins: z67.number().optional().default(8),
21813
+ fn: z68.string(),
21814
+ num_pins: z68.number().optional().default(8),
21674
21815
  p: distance3.describe("pitch (distance between center of each pin)"),
21675
- w: length54.describe("width between vertical rows of pins"),
21816
+ w: length55.describe("width between vertical rows of pins"),
21676
21817
  grid: dim2d.describe("width and height of the border of the footprint"),
21677
21818
  ep: dim2d.default("0x0mm").describe("width and height of the central exposed thermal pad"),
21678
- epx: length54.default("0mm").describe("x offset of the center of the central exposed thermal pad"),
21679
- pinw: length54.describe("width of the pin pads"),
21680
- pinh: length54.describe("height of the pin pads")
21819
+ epx: length55.default("0mm").describe("x offset of the center of the central exposed thermal pad"),
21820
+ pinw: length55.describe("width of the pin pads"),
21821
+ pinh: length55.describe("height of the pin pads")
21681
21822
  });
21682
21823
  var vson = (raw_params) => {
21683
21824
  const parameters = vson_def.parse(raw_params);
@@ -21784,9 +21925,9 @@ var getSilkscreenPaths = (grid2) => {
21784
21925
  };
21785
21926
  var solderjumper = (params) => {
21786
21927
  const { num_pins, bridged, p = 2.54, pw = 1.5, ph = 1.5 } = params;
21787
- const padSpacing7 = length55.parse(p);
21788
- const padWidth = length55.parse(pw);
21789
- const padHeight = length55.parse(ph);
21928
+ const padSpacing7 = length56.parse(p);
21929
+ const padWidth = length56.parse(pw);
21930
+ const padHeight = length56.parse(ph);
21790
21931
  const traceWidth = Math.min(padHeight / 4, 0.5);
21791
21932
  const pads = [];
21792
21933
  for (let i = 0; i < num_pins; i++) {
@@ -21873,32 +22014,32 @@ var solderjumper = (params) => {
21873
22014
  };
21874
22015
  };
21875
22016
  var commonSchema = {
21876
- fn: z68.literal("sot457"),
21877
- num_pins: z68.literal(6).default(6),
21878
- pillh: z68.string().default("0.45mm"),
21879
- pillw: z68.string().default("1.45mm"),
21880
- pl: z68.string(),
21881
- pw: z68.string(),
21882
- p: z68.string(),
21883
- wave: z68.boolean().optional(),
21884
- reflow: z68.boolean().optional()
22017
+ fn: z69.literal("sot457"),
22018
+ num_pins: z69.literal(6).default(6),
22019
+ pillh: z69.string().default("0.45mm"),
22020
+ pillw: z69.string().default("1.45mm"),
22021
+ pl: z69.string(),
22022
+ pw: z69.string(),
22023
+ p: z69.string(),
22024
+ wave: z69.boolean().optional(),
22025
+ reflow: z69.boolean().optional()
21885
22026
  };
21886
22027
  var sot457DefSchema = base_def.extend({
21887
22028
  ...commonSchema,
21888
- h: z68.string().default("2.5mm"),
21889
- w: z68.string().default("2.7mm"),
21890
- pl: z68.string().default("0.8mm"),
21891
- pw: z68.string().default("0.55mm"),
21892
- p: z68.string().default("0.95mm")
22029
+ h: z69.string().default("2.5mm"),
22030
+ w: z69.string().default("2.7mm"),
22031
+ pl: z69.string().default("0.8mm"),
22032
+ pw: z69.string().default("0.55mm"),
22033
+ p: z69.string().default("0.95mm")
21893
22034
  });
21894
22035
  var sot457WaveSchema = base_def.extend({
21895
22036
  ...commonSchema,
21896
- h: z68.string().default("3mm"),
21897
- w: z68.string().default("4mm"),
21898
- pillr: z68.string().default("0.225mm"),
21899
- pl: z68.string().default("1.45mm"),
21900
- pw: z68.string().default("1.5mm"),
21901
- p: z68.string().default("1.475mm")
22037
+ h: z69.string().default("3mm"),
22038
+ w: z69.string().default("4mm"),
22039
+ pillr: z69.string().default("0.225mm"),
22040
+ pl: z69.string().default("1.45mm"),
22041
+ pw: z69.string().default("1.5mm"),
22042
+ p: z69.string().default("1.475mm")
21902
22043
  }).transform((data) => ({
21903
22044
  ...data,
21904
22045
  wave: data.wave ?? (data.reflow === void 0 ? true : !data.reflow),
@@ -22036,22 +22177,22 @@ var sot457 = (rawParams) => {
22036
22177
  };
22037
22178
  };
22038
22179
  var sot963_def = base_def.extend({
22039
- fn: z69.string(),
22040
- num_pins: z69.literal(6).default(6),
22041
- w: z69.string().default("1.1mm"),
22042
- h: z69.string().default("1.45mm"),
22043
- p: z69.string().default("0.35mm"),
22044
- pl: z69.string().default("0.2mm"),
22045
- pw: z69.string().default("0.2mm"),
22046
- string: z69.string().optional()
22180
+ fn: z70.string(),
22181
+ num_pins: z70.literal(6).default(6),
22182
+ w: z70.string().default("1.1mm"),
22183
+ h: z70.string().default("1.45mm"),
22184
+ p: z70.string().default("0.35mm"),
22185
+ pl: z70.string().default("0.2mm"),
22186
+ pw: z70.string().default("0.2mm"),
22187
+ string: z70.string().optional()
22047
22188
  });
22048
22189
  var sot963 = (raw_params) => {
22049
22190
  const parameters = sot963_def.parse({ ...raw_params, fn: "sot963" });
22050
- const w = length56.parse(parameters.w);
22051
- const h2 = length56.parse(parameters.h);
22052
- const p = length56.parse(parameters.p);
22053
- const pl = length56.parse(parameters.pl);
22054
- const pw = length56.parse(parameters.pw);
22191
+ const w = length57.parse(parameters.w);
22192
+ const h2 = length57.parse(parameters.h);
22193
+ const p = length57.parse(parameters.p);
22194
+ const pl = length57.parse(parameters.pl);
22195
+ const pw = length57.parse(parameters.pw);
22055
22196
  const pads = [];
22056
22197
  for (let i = 0; i < 6; i++) {
22057
22198
  const { x, y } = getSot963PadCoord(i + 1, w, p, pl);
@@ -22113,17 +22254,17 @@ var getSot963PadCoord = (pn, w, p, pl) => {
22113
22254
  return { x: padCenterOffset, y: -p + (pn - 4) * p };
22114
22255
  };
22115
22256
  var potentiometer_def = base_def.extend({
22116
- fn: z70.string(),
22117
- num_pins: z70.union([z70.literal(3), z70.literal(2)]).default(3),
22118
- p: z70.string().default("3.8mm"),
22119
- id: z70.string().default("1.25mm"),
22120
- od: z70.string().default("2.35mm"),
22121
- ca: z70.string().default("14mm").describe(
22257
+ fn: z71.string(),
22258
+ num_pins: z71.union([z71.literal(3), z71.literal(2)]).default(3),
22259
+ p: z71.string().default("3.8mm"),
22260
+ id: z71.string().default("1.25mm"),
22261
+ od: z71.string().default("2.35mm"),
22262
+ ca: z71.string().default("14mm").describe(
22122
22263
  "Caliper axis (width or diameter of the potentiometer body or adjustment knob)"
22123
22264
  ),
22124
- w: z70.string().default("5.35mm"),
22125
- h: z70.string().default("4mm"),
22126
- string: z70.string().optional()
22265
+ w: z71.string().default("5.35mm"),
22266
+ h: z71.string().default("4mm"),
22267
+ string: z71.string().optional()
22127
22268
  });
22128
22269
  var potentiometer_acp = (parameters) => {
22129
22270
  const { p, id, od, h: h2, ca } = parameters;
@@ -22188,11 +22329,11 @@ var potentiometer = (raw_params) => {
22188
22329
  };
22189
22330
  };
22190
22331
  var electrolytic_def = base_def.extend({
22191
- fn: z71.string(),
22192
- p: length57.optional().default("7.5mm"),
22193
- id: length57.optional().default("1mm"),
22194
- od: length57.optional().default("2mm"),
22195
- d: length57.optional().default("10.5mm")
22332
+ fn: z72.string(),
22333
+ p: length58.optional().default("7.5mm"),
22334
+ id: length58.optional().default("1mm"),
22335
+ od: length58.optional().default("2mm"),
22336
+ d: length58.optional().default("10.5mm")
22196
22337
  });
22197
22338
  var generate_circle_arcs = (centerX, centerY, radius, cut, cutHeight) => {
22198
22339
  const topArc = [];
@@ -22298,19 +22439,19 @@ var electrolytic = (raw_params) => {
22298
22439
  };
22299
22440
  };
22300
22441
  var smbf_def = base_def.extend({
22301
- fn: z72.string(),
22302
- num_pins: z72.literal(2).default(2),
22303
- w: z72.string().default("6.5mm"),
22304
- h: z72.string().default("3mm"),
22305
- pl: z72.string().default("1.75mm"),
22306
- pw: z72.string().default("2.40mm"),
22307
- p: z72.string().default("4.75mm")
22442
+ fn: z73.string(),
22443
+ num_pins: z73.literal(2).default(2),
22444
+ w: z73.string().default("6.5mm"),
22445
+ h: z73.string().default("3mm"),
22446
+ pl: z73.string().default("1.75mm"),
22447
+ pw: z73.string().default("2.40mm"),
22448
+ p: z73.string().default("4.75mm")
22308
22449
  });
22309
22450
  var smbf = (raw_params) => {
22310
22451
  const parameters = smbf_def.parse(raw_params);
22311
22452
  const silkscreenRefText = silkscreenRef(
22312
22453
  0,
22313
- length58.parse(parameters.h) - 0.5,
22454
+ length59.parse(parameters.h) - 0.5,
22314
22455
  0.3
22315
22456
  );
22316
22457
  const silkscreenLine = {
@@ -22319,20 +22460,20 @@ var smbf = (raw_params) => {
22319
22460
  pcb_component_id: "",
22320
22461
  route: [
22321
22462
  {
22322
- x: length58.parse(parameters.p) / 2,
22323
- y: length58.parse(parameters.h) / 2
22463
+ x: length59.parse(parameters.p) / 2,
22464
+ y: length59.parse(parameters.h) / 2
22324
22465
  },
22325
22466
  {
22326
- x: -length58.parse(parameters.w) / 2 - 0.3,
22327
- y: length58.parse(parameters.h) / 2
22467
+ x: -length59.parse(parameters.w) / 2 - 0.3,
22468
+ y: length59.parse(parameters.h) / 2
22328
22469
  },
22329
22470
  {
22330
- x: -length58.parse(parameters.w) / 2 - 0.3,
22331
- y: -length58.parse(parameters.h) / 2
22471
+ x: -length59.parse(parameters.w) / 2 - 0.3,
22472
+ y: -length59.parse(parameters.h) / 2
22332
22473
  },
22333
22474
  {
22334
- x: length58.parse(parameters.p) / 2,
22335
- y: -length58.parse(parameters.h) / 2
22475
+ x: length59.parse(parameters.p) / 2,
22476
+ y: -length59.parse(parameters.h) / 2
22336
22477
  }
22337
22478
  ],
22338
22479
  stroke_width: 0.1,
@@ -22373,14 +22514,14 @@ var smbfWithoutParsing = (parameters) => {
22373
22514
  return pads;
22374
22515
  };
22375
22516
  var sot323_def = base_def.extend({
22376
- fn: z73.string(),
22377
- num_pins: z73.number().default(3),
22378
- w: z73.string().default("2.45mm"),
22379
- h: z73.string().default("2.40mm"),
22380
- pl: z73.string().default("0.92mm"),
22381
- pw: z73.string().default("0.45mm"),
22382
- p: z73.string().default("0.891mm"),
22383
- string: z73.string().optional()
22517
+ fn: z74.string(),
22518
+ num_pins: z74.number().default(3),
22519
+ w: z74.string().default("2.45mm"),
22520
+ h: z74.string().default("2.40mm"),
22521
+ pl: z74.string().default("0.92mm"),
22522
+ pw: z74.string().default("0.45mm"),
22523
+ p: z74.string().default("0.891mm"),
22524
+ string: z74.string().optional()
22384
22525
  });
22385
22526
  var sot323 = (raw_params) => {
22386
22527
  const match = raw_params.string?.match(/^sot323_(\d+)/);
@@ -22467,26 +22608,26 @@ var sot323_3 = (parameters) => {
22467
22608
  ];
22468
22609
  };
22469
22610
  var smtpad_def = base_def.extend({
22470
- fn: z74.string(),
22471
- circle: z74.boolean().optional(),
22472
- rect: z74.boolean().optional(),
22473
- square: z74.boolean().optional(),
22474
- pill: z74.boolean().optional(),
22475
- d: length59.optional(),
22476
- pd: length59.optional(),
22477
- diameter: length59.optional(),
22478
- r: length59.optional(),
22479
- pr: length59.optional(),
22480
- radius: length59.optional(),
22481
- w: length59.optional(),
22482
- pw: length59.optional(),
22483
- width: length59.optional(),
22484
- h: length59.optional(),
22485
- ph: length59.optional(),
22486
- height: length59.optional(),
22487
- s: length59.optional(),
22488
- size: length59.optional(),
22489
- string: z74.string().optional()
22611
+ fn: z75.string(),
22612
+ circle: z75.boolean().optional(),
22613
+ rect: z75.boolean().optional(),
22614
+ square: z75.boolean().optional(),
22615
+ pill: z75.boolean().optional(),
22616
+ d: length60.optional(),
22617
+ pd: length60.optional(),
22618
+ diameter: length60.optional(),
22619
+ r: length60.optional(),
22620
+ pr: length60.optional(),
22621
+ radius: length60.optional(),
22622
+ w: length60.optional(),
22623
+ pw: length60.optional(),
22624
+ width: length60.optional(),
22625
+ h: length60.optional(),
22626
+ ph: length60.optional(),
22627
+ height: length60.optional(),
22628
+ s: length60.optional(),
22629
+ size: length60.optional(),
22630
+ string: z75.string().optional()
22490
22631
  }).transform((v) => {
22491
22632
  let shape = "rect";
22492
22633
  if (v.circle) shape = "circle";
@@ -22551,14 +22692,14 @@ var smtpad = (raw_params) => {
22551
22692
  };
22552
22693
  };
22553
22694
  var platedhole_def = base_def.extend({
22554
- fn: z75.string(),
22555
- d: length60.optional(),
22556
- hd: length60.optional(),
22557
- r: length60.optional(),
22558
- hr: length60.optional(),
22559
- pd: length60.optional(),
22560
- pr: length60.optional(),
22561
- squarepad: z75.boolean().optional().default(false)
22695
+ fn: z76.string(),
22696
+ d: length61.optional(),
22697
+ hd: length61.optional(),
22698
+ r: length61.optional(),
22699
+ hr: length61.optional(),
22700
+ pd: length61.optional(),
22701
+ pr: length61.optional(),
22702
+ squarepad: z76.boolean().optional().default(false)
22562
22703
  }).transform((v) => {
22563
22704
  let holeD;
22564
22705
  if (v.d !== void 0) holeD = mm(v.d);
@@ -22596,12 +22737,12 @@ var platedhole2 = (raw_params) => {
22596
22737
  };
22597
22738
  };
22598
22739
  var sot_def = base_def.extend({
22599
- fn: z76.string(),
22600
- num_pins: z76.literal(6).default(6),
22601
- h: z76.string().default("1.6mm"),
22602
- pl: z76.string().default("1mm"),
22603
- pw: z76.string().default("0.7mm"),
22604
- p: z76.string().default("0.95mm")
22740
+ fn: z77.string(),
22741
+ num_pins: z77.literal(6).default(6),
22742
+ h: z77.string().default("1.6mm"),
22743
+ pl: z77.string().default("1mm"),
22744
+ pw: z77.string().default("0.7mm"),
22745
+ p: z77.string().default("0.95mm")
22605
22746
  });
22606
22747
  var sot = (raw_params) => {
22607
22748
  const parameters = sot_def.parse(raw_params);
@@ -22717,14 +22858,14 @@ var sotWithoutParsing = (parameters) => {
22717
22858
  ];
22718
22859
  };
22719
22860
  var sot343_def = base_def.extend({
22720
- fn: z77.string(),
22721
- num_pins: z77.number().default(4),
22722
- w: z77.string().default("3.2mm"),
22723
- h: z77.string().default("2.6mm"),
22724
- pl: z77.string().default("1.05mm"),
22725
- pw: z77.string().default("0.45mm"),
22726
- p: z77.string().default("0.55mm"),
22727
- string: z77.string().optional()
22861
+ fn: z78.string(),
22862
+ num_pins: z78.number().default(4),
22863
+ w: z78.string().default("3.2mm"),
22864
+ h: z78.string().default("2.6mm"),
22865
+ pl: z78.string().default("1.05mm"),
22866
+ pw: z78.string().default("0.45mm"),
22867
+ p: z78.string().default("0.55mm"),
22868
+ string: z78.string().optional()
22728
22869
  });
22729
22870
  var sot343 = (raw_params) => {
22730
22871
  const match = raw_params.string?.match(/^sot343_(\d+)/);
@@ -22818,7 +22959,7 @@ var sot343_4 = (parameters) => {
22818
22959
  ];
22819
22960
  };
22820
22961
  var m2host_def = base_def.extend({
22821
- fn: z78.string()
22962
+ fn: z79.string()
22822
22963
  });
22823
22964
  var m2host = (raw_params) => {
22824
22965
  const parameters = m2host_def.parse(raw_params);
@@ -22921,39 +23062,39 @@ var m2host = (raw_params) => {
22921
23062
  };
22922
23063
  };
22923
23064
  var mountedpcbmodule_def = base_def.extend({
22924
- fn: z79.string(),
22925
- numPins: z79.number().optional().default(0),
22926
- rows: z79.union([z79.string(), z79.number()]).transform((val) => Number(val)).optional().default(1).describe("number of rows"),
22927
- p: length61.default("2.54mm").describe("pitch"),
22928
- id: length61.default("1.0mm").describe("inner diameter"),
22929
- od: length61.default("1.5mm").describe("outer diameter"),
22930
- male: z79.boolean().optional().describe("the module uses male headers"),
22931
- nopin: z79.boolean().optional().default(false).describe("omit pins rendering"),
22932
- female: z79.boolean().optional().describe("the module uses female headers"),
22933
- smd: z79.boolean().optional().describe("surface mount device"),
22934
- pinlabeltextalignleft: z79.boolean().optional().default(false),
22935
- pinlabeltextaligncenter: z79.boolean().optional().default(false),
22936
- pinlabeltextalignright: z79.boolean().optional().default(false),
22937
- pinlabelverticallyinverted: z79.boolean().optional().default(false),
22938
- pinlabelorthogonal: z79.boolean().optional().default(false),
22939
- nopinlabels: z79.boolean().optional().default(false).describe("omit silkscreen pin labels"),
22940
- doublesidedpinlabel: z79.boolean().optional().default(false).describe("add silkscreen pins in top and bottom layers"),
22941
- bottomsidepinlabel: z79.boolean().optional().default(false).describe(
23065
+ fn: z80.string(),
23066
+ numPins: z80.number().optional().default(0),
23067
+ rows: z80.union([z80.string(), z80.number()]).transform((val) => Number(val)).optional().default(1).describe("number of rows"),
23068
+ p: length62.default("2.54mm").describe("pitch"),
23069
+ id: length62.default("1.0mm").describe("inner diameter"),
23070
+ od: length62.default("1.5mm").describe("outer diameter"),
23071
+ male: z80.boolean().optional().describe("the module uses male headers"),
23072
+ nopin: z80.boolean().optional().default(false).describe("omit pins rendering"),
23073
+ female: z80.boolean().optional().describe("the module uses female headers"),
23074
+ smd: z80.boolean().optional().describe("surface mount device"),
23075
+ pinlabeltextalignleft: z80.boolean().optional().default(false),
23076
+ pinlabeltextaligncenter: z80.boolean().optional().default(false),
23077
+ pinlabeltextalignright: z80.boolean().optional().default(false),
23078
+ pinlabelverticallyinverted: z80.boolean().optional().default(false),
23079
+ pinlabelorthogonal: z80.boolean().optional().default(false),
23080
+ nopinlabels: z80.boolean().optional().default(false).describe("omit silkscreen pin labels"),
23081
+ doublesidedpinlabel: z80.boolean().optional().default(false).describe("add silkscreen pins in top and bottom layers"),
23082
+ bottomsidepinlabel: z80.boolean().optional().default(false).describe(
22942
23083
  "place the silkscreen reference text on the bottom layer instead of top"
22943
23084
  ),
22944
- pinRowSide: z79.enum(["left", "right", "top", "bottom"]).optional().default("left"),
22945
- pinrowleft: z79.boolean().optional().default(false),
22946
- pinrowright: z79.boolean().optional().default(false),
22947
- pinrowtop: z79.boolean().optional().default(false),
22948
- pinrowbottom: z79.boolean().optional().default(false),
22949
- pinrowleftpins: z79.union([z79.string(), z79.number()]).transform((val) => Number(val)).optional(),
22950
- pinrowrightpins: z79.union([z79.string(), z79.number()]).transform((val) => Number(val)).optional(),
22951
- pinrowtoppins: z79.union([z79.string(), z79.number()]).transform((val) => Number(val)).optional(),
22952
- pinrowbottompins: z79.union([z79.string(), z79.number()]).transform((val) => Number(val)).optional(),
22953
- width: length61.optional(),
22954
- height: length61.optional(),
22955
- pinRowHoleEdgeToEdgeDist: length61.default("2mm"),
22956
- holes: z79.union([z79.string(), z79.array(z79.string())]).optional().transform((val) => {
23085
+ pinRowSide: z80.enum(["left", "right", "top", "bottom"]).optional().default("left"),
23086
+ pinrowleft: z80.boolean().optional().default(false),
23087
+ pinrowright: z80.boolean().optional().default(false),
23088
+ pinrowtop: z80.boolean().optional().default(false),
23089
+ pinrowbottom: z80.boolean().optional().default(false),
23090
+ pinrowleftpins: z80.union([z80.string(), z80.number()]).transform((val) => Number(val)).optional(),
23091
+ pinrowrightpins: z80.union([z80.string(), z80.number()]).transform((val) => Number(val)).optional(),
23092
+ pinrowtoppins: z80.union([z80.string(), z80.number()]).transform((val) => Number(val)).optional(),
23093
+ pinrowbottompins: z80.union([z80.string(), z80.number()]).transform((val) => Number(val)).optional(),
23094
+ width: length62.optional(),
23095
+ height: length62.optional(),
23096
+ pinRowHoleEdgeToEdgeDist: length62.default("2mm"),
23097
+ holes: z80.union([z80.string(), z80.array(z80.string())]).optional().transform((val) => {
22957
23098
  if (!val) return val;
22958
23099
  if (Array.isArray(val)) return val;
22959
23100
  if (val.startsWith("(") && val.endsWith(")")) {
@@ -22961,23 +23102,23 @@ var mountedpcbmodule_def = base_def.extend({
22961
23102
  }
22962
23103
  return [val];
22963
23104
  }),
22964
- holeXDist: length61.optional(),
22965
- holeYDist: length61.optional(),
22966
- holeInset: length61.default("1mm"),
22967
- pinrow: z79.union([z79.string(), z79.number()]).optional(),
22968
- usbposition: z79.enum(["left", "right", "top", "bottom"]).optional().default("left"),
22969
- usbleft: z79.boolean().optional().default(false),
22970
- usbtop: z79.boolean().optional().default(false),
22971
- usbright: z79.boolean().optional().default(false),
22972
- usbbottom: z79.boolean().optional().default(false),
22973
- usbtype: z79.enum(["micro", "c"]).optional(),
22974
- usbmicro: z79.boolean().optional().default(false),
22975
- usbc: z79.boolean().optional().default(false),
22976
- screen: z79.boolean().optional().default(false).describe("add silkscreen outline for screen/display area"),
22977
- screenwidth: length61.optional(),
22978
- screenheight: length61.optional(),
22979
- screencenteroffsetx: length61.optional(),
22980
- screencenteroffsety: length61.optional()
23105
+ holeXDist: length62.optional(),
23106
+ holeYDist: length62.optional(),
23107
+ holeInset: length62.default("1mm"),
23108
+ pinrow: z80.union([z80.string(), z80.number()]).optional(),
23109
+ usbposition: z80.enum(["left", "right", "top", "bottom"]).optional().default("left"),
23110
+ usbleft: z80.boolean().optional().default(false),
23111
+ usbtop: z80.boolean().optional().default(false),
23112
+ usbright: z80.boolean().optional().default(false),
23113
+ usbbottom: z80.boolean().optional().default(false),
23114
+ usbtype: z80.enum(["micro", "c"]).optional(),
23115
+ usbmicro: z80.boolean().optional().default(false),
23116
+ usbc: z80.boolean().optional().default(false),
23117
+ screen: z80.boolean().optional().default(false).describe("add silkscreen outline for screen/display area"),
23118
+ screenwidth: length62.optional(),
23119
+ screenheight: length62.optional(),
23120
+ screencenteroffsetx: length62.optional(),
23121
+ screencenteroffsety: length62.optional()
22981
23122
  }).transform((data) => {
22982
23123
  const pinlabelAnchorSide = determinePinlabelAnchorSide(data);
22983
23124
  let pinRowSide = data.pinRowSide;
@@ -23069,7 +23210,7 @@ var mountedpcbmodule_def = base_def.extend({
23069
23210
  }).superRefine((data, ctx) => {
23070
23211
  if (data.male && data.female) {
23071
23212
  ctx.addIssue({
23072
- code: z79.ZodIssueCode.custom,
23213
+ code: z80.ZodIssueCode.custom,
23073
23214
  message: "'male' and 'female' cannot both be true; it should be male or female.",
23074
23215
  path: ["male", "female"]
23075
23216
  });
@@ -23411,14 +23552,14 @@ var mountedpcbmodule = (raw_params) => {
23411
23552
  };
23412
23553
  };
23413
23554
  var to92l_def = base_def.extend({
23414
- fn: z80.string(),
23415
- num_pins: z80.number().default(3),
23416
- inline: z80.boolean().default(false),
23417
- p: z80.string().default("1.27mm"),
23418
- id: z80.string().default("0.75mm"),
23419
- od: z80.string().default("1.3mm"),
23420
- w: z80.string().default("4.8mm"),
23421
- h: z80.string().default("4.0mm")
23555
+ fn: z81.string(),
23556
+ num_pins: z81.number().default(3),
23557
+ inline: z81.boolean().default(false),
23558
+ p: z81.string().default("1.27mm"),
23559
+ id: z81.string().default("0.75mm"),
23560
+ od: z81.string().default("1.3mm"),
23561
+ w: z81.string().default("4.8mm"),
23562
+ h: z81.string().default("4.0mm")
23422
23563
  });
23423
23564
  var to92l = (raw_params) => {
23424
23565
  const parameters = to92l_def.parse(raw_params);
@@ -23473,9 +23614,24 @@ var to92l = (raw_params) => {
23473
23614
  parameters
23474
23615
  };
23475
23616
  };
23476
- function isNotNull(value) {
23477
- return value !== null && value !== void 0;
23478
- }
23617
+ var applyNoRefDes = (elements, parameters) => {
23618
+ const refs = elements.filter(
23619
+ (el) => el.type === "pcb_silkscreen_text"
23620
+ );
23621
+ if (refs.length === 0) return elements;
23622
+ for (const ref of refs) {
23623
+ if (parameters.norefdes) {
23624
+ ref.text = "";
23625
+ }
23626
+ }
23627
+ return elements;
23628
+ };
23629
+ var applyNoSilkscreen = (elements, parameters) => {
23630
+ if (!parameters.nosilkscreen) return elements;
23631
+ return elements.filter((element) => {
23632
+ return element.type !== "pcb_silkscreen_path" && element.type !== "pcb_silkscreen_text";
23633
+ });
23634
+ };
23479
23635
  var applyOrigin = (elements, origin) => {
23480
23636
  if (!origin) return elements;
23481
23637
  const pads = elements.filter(
@@ -23568,27 +23724,16 @@ var applyOrigin = (elements, origin) => {
23568
23724
  }
23569
23725
  return elements;
23570
23726
  };
23571
- var applyNoRefDes = (elements, parameters) => {
23572
- const refs = elements.filter(
23573
- (el) => el.type === "pcb_silkscreen_text"
23574
- );
23575
- if (refs.length === 0) return elements;
23576
- for (const ref of refs) {
23577
- if (parameters.norefdes) {
23578
- ref.text = "";
23579
- }
23580
- }
23581
- return elements;
23582
- };
23583
- var applyNoSilkscreen = (elements, parameters) => {
23584
- if (!parameters.nosilkscreen) return elements;
23585
- return elements.filter((element) => {
23586
- return element.type !== "pcb_silkscreen_path" && element.type !== "pcb_silkscreen_text";
23587
- });
23727
+ function isNotNull(value) {
23728
+ return value !== null && value !== void 0;
23729
+ }
23730
+ var normalizeDefinition = (def) => {
23731
+ return def.trim().replace(/^sot-223-(\d+)(?=_|$)/i, "sot223_$1").replace(/^to-220f-(\d+)(?=_|$)/i, "to220f_$1");
23588
23732
  };
23589
23733
  var string2 = (def) => {
23590
23734
  let fp2 = footprinter();
23591
- const modifiedDef = def.replace(/^((?:\d{4}|\d{5}))(?=$|_|x)/, "res$1");
23735
+ const normalizedDef = normalizeDefinition(def);
23736
+ const modifiedDef = normalizedDef.replace(/^((?:\d{4}|\d{5}))(?=$|_|x)/, "res$1").replace(/^zh(\d+)(?:$|_)/, "jst$1_zh");
23592
23737
  const def_parts = modifiedDef.split(/_(?!metric)/).map((s) => {
23593
23738
  const m = s.match(/([a-zA-Z]+)([\(\d\.\+\?].*)?/);
23594
23739
  if (!m) return null;
@@ -23601,7 +23746,7 @@ var string2 = (def) => {
23601
23746
  for (const { fn, v } of def_parts) {
23602
23747
  fp2 = fp2[fn](v);
23603
23748
  }
23604
- fp2.setString(def);
23749
+ fp2.setString(normalizedDef);
23605
23750
  return fp2;
23606
23751
  };
23607
23752
  var getFootprintNames = () => {
@@ -23739,7 +23884,7 @@ var jsxs = (type, props, _key) => h(type, props);
23739
23884
  var ChipBody = ({
23740
23885
  center,
23741
23886
  width: width10,
23742
- length: length62,
23887
+ length: length63,
23743
23888
  height: height10,
23744
23889
  heightAboveSurface: heightAboveSurface2 = 0.15,
23745
23890
  color = "#555",
@@ -23756,24 +23901,24 @@ var ChipBody = ({
23756
23901
  }) => {
23757
23902
  const straightHeight = height10 * straightHeightRatio;
23758
23903
  const taperHeight = height10 - straightHeight;
23759
- const taperInset = Math.min(width10, length62) * taperRatio;
23904
+ const taperInset = Math.min(width10, length63) * taperRatio;
23760
23905
  const faceWidth = Math.max(width10 - taperInset, width10 * faceRatio);
23761
- const faceLength = Math.max(length62 - taperInset, length62 * faceRatio);
23762
- const defaultNotchRadius = Math.min(width10, length62) * 0.12;
23906
+ const faceLength = Math.max(length63 - taperInset, length63 * faceRatio);
23907
+ const defaultNotchRadius = Math.min(width10, length63) * 0.12;
23763
23908
  const actualNotchRadius = notchRadius ?? defaultNotchRadius;
23764
23909
  const defaultNotchPosition = {
23765
23910
  x: 0,
23766
- y: length62 / 2 - actualNotchRadius * 0.25,
23911
+ y: length63 / 2 - actualNotchRadius * 0.25,
23767
23912
  z: height10
23768
23913
  };
23769
23914
  const actualNotchPosition = notchPosition ?? defaultNotchPosition;
23770
23915
  const body = /* @__PURE__ */ jsxs(Union, { children: [
23771
23916
  /* @__PURE__ */ jsxs(Hull, { children: [
23772
23917
  /* @__PURE__ */ jsx2(Translate, { z: 5e-3, children: /* @__PURE__ */ jsx2(Cuboid, { size: [faceWidth, faceLength, 0.01] }) }),
23773
- /* @__PURE__ */ jsx2(Translate, { z: straightHeight, children: /* @__PURE__ */ jsx2(Cuboid, { size: [width10, length62, 0.01] }) })
23918
+ /* @__PURE__ */ jsx2(Translate, { z: straightHeight, children: /* @__PURE__ */ jsx2(Cuboid, { size: [width10, length63, 0.01] }) })
23774
23919
  ] }),
23775
23920
  /* @__PURE__ */ jsxs(Hull, { children: [
23776
- /* @__PURE__ */ jsx2(Translate, { z: straightHeight, children: /* @__PURE__ */ jsx2(Cuboid, { size: [width10, length62, 0.01] }) }),
23921
+ /* @__PURE__ */ jsx2(Translate, { z: straightHeight, children: /* @__PURE__ */ jsx2(Cuboid, { size: [width10, length63, 0.01] }) }),
23777
23922
  /* @__PURE__ */ jsx2(Translate, { z: straightHeight + taperHeight, children: /* @__PURE__ */ jsx2(Cuboid, { size: [faceWidth, faceLength, 0.01] }) })
23778
23923
  ] })
23779
23924
  ] });
@@ -23790,7 +23935,7 @@ var ChipBody = ({
23790
23935
  let finalBody = body;
23791
23936
  if (chamferSize > 0) {
23792
23937
  const xOffset = width10 / 2;
23793
- const yOffset = length62 / 2;
23938
+ const yOffset = length63 / 2;
23794
23939
  finalBody = /* @__PURE__ */ jsxs(Subtract, { children: [
23795
23940
  body,
23796
23941
  chamferCutout(xOffset, yOffset),
@@ -23816,8 +23961,8 @@ function getExpandedStroke(strokeInput, width10) {
23816
23961
  function getNormal(p1, p2) {
23817
23962
  const dx = p2.x - p1.x;
23818
23963
  const dy = p2.y - p1.y;
23819
- const length62 = Math.sqrt(dx * dx + dy * dy);
23820
- return { x: -dy / length62, y: dx / length62 };
23964
+ const length63 = Math.sqrt(dx * dx + dy * dy);
23965
+ return { x: -dy / length63, y: dx / length63 };
23821
23966
  }
23822
23967
  function addPoint(point, normal, factor) {
23823
23968
  const newPoint = {
@@ -25104,11 +25249,11 @@ var FemaleHeaderRow = ({
25104
25249
  };
25105
25250
  var PushButton = ({
25106
25251
  width: width10,
25107
- length: length62,
25252
+ length: length63,
25108
25253
  innerDiameter = 1
25109
25254
  }) => {
25110
25255
  const bodyWidth = width10;
25111
- const bodyLength10 = length62;
25256
+ const bodyLength10 = length63;
25112
25257
  const bodyHeight = width10 * 0.7;
25113
25258
  const legWidth = innerDiameter / 2.5;
25114
25259
  return /* @__PURE__ */ jsxs(Fragment2, { children: [
@@ -29732,7 +29877,7 @@ import * as THREE16 from "three";
29732
29877
  // package.json
29733
29878
  var package_default = {
29734
29879
  name: "@tscircuit/3d-viewer",
29735
- version: "0.0.540",
29880
+ version: "0.0.542",
29736
29881
  main: "./dist/index.js",
29737
29882
  module: "./dist/index.js",
29738
29883
  type: "module",
@@ -29800,7 +29945,7 @@ var package_default = {
29800
29945
  "react-use-gesture": "^9.1.3",
29801
29946
  semver: "^7.7.0",
29802
29947
  "strip-ansi": "^7.1.0",
29803
- tscircuit: "^0.0.1456",
29948
+ tscircuit: "^0.0.1532",
29804
29949
  tsup: "^8.3.6",
29805
29950
  typescript: "^5.7.3",
29806
29951
  vite: "^7.1.5",
@@ -30940,8 +31085,8 @@ var M = 0.01;
30940
31085
  var colors = {
30941
31086
  copper: [0.9, 0.6, 0.2],
30942
31087
  fr4Tan: [0.6, 0.43, 0.28],
30943
- fr4SolderMaskGreen: [0.02, 0.1, 0.04],
30944
- fr4TracesWithMaskGreen: [0, 0.5, 0.25],
31088
+ fr4SolderMaskGreen: [0.015, 0.059, 0.027],
31089
+ fr4TracesWithMaskGreen: [0.063, 0.141, 0.023],
30945
31090
  fr4TracesWithoutMaskTan: [0.6, 0.43, 0.28],
30946
31091
  fr1Tan: [0.8, 0.4, 0.2],
30947
31092
  fr1TracesWithMaskCopper: [0.9, 0.6, 0.2],
@@ -31313,8 +31458,8 @@ var platedHole = (plated_hole, ctx, options = {}) => {
31313
31458
  const copperHeight = copperFillHeight;
31314
31459
  const createPillSection = (width10, height10, thickness) => {
31315
31460
  const radius = height10 / 2;
31316
- const length62 = Math.abs(width10 - height10);
31317
- if (length62 <= 1e-6) {
31461
+ const length63 = Math.abs(width10 - height10);
31462
+ if (length63 <= 1e-6) {
31318
31463
  return (0, import_primitives4.cylinder)({
31319
31464
  center: [plated_hole.x, plated_hole.y, 0],
31320
31465
  radius,
@@ -31323,15 +31468,15 @@ var platedHole = (plated_hole, ctx, options = {}) => {
31323
31468
  }
31324
31469
  const rect = (0, import_primitives4.cuboid)({
31325
31470
  center: [plated_hole.x, plated_hole.y, 0],
31326
- size: shouldRotate ? [height10, length62, thickness] : [length62, height10, thickness]
31471
+ size: shouldRotate ? [height10, length63, thickness] : [length63, height10, thickness]
31327
31472
  });
31328
31473
  const leftCap = (0, import_primitives4.cylinder)({
31329
- center: shouldRotate ? [plated_hole.x, plated_hole.y - length62 / 2, 0] : [plated_hole.x - length62 / 2, plated_hole.y, 0],
31474
+ center: shouldRotate ? [plated_hole.x, plated_hole.y - length63 / 2, 0] : [plated_hole.x - length63 / 2, plated_hole.y, 0],
31330
31475
  radius,
31331
31476
  height: thickness
31332
31477
  });
31333
31478
  const rightCap = (0, import_primitives4.cylinder)({
31334
- center: shouldRotate ? [plated_hole.x, plated_hole.y + length62 / 2, 0] : [plated_hole.x + length62 / 2, plated_hole.y, 0],
31479
+ center: shouldRotate ? [plated_hole.x, plated_hole.y + length63 / 2, 0] : [plated_hole.x + length63 / 2, plated_hole.y, 0],
31335
31480
  radius,
31336
31481
  height: thickness
31337
31482
  });
@@ -32179,18 +32324,18 @@ var BoardGeomBuilder = class {
32179
32324
  );
32180
32325
  }
32181
32326
  const radius = Math.min(w, h2) / 2;
32182
- const length62 = Math.abs(w - h2);
32327
+ const length63 = Math.abs(w - h2);
32183
32328
  if (w > h2) {
32184
32329
  return (0, import_booleans4.union)(
32185
- (0, import_primitives6.cuboid)({ center: [0, 0, 0], size: [length62, h2, depth] }),
32186
- (0, import_primitives6.cylinder)({ center: [-length62 / 2, 0, 0], radius, height: depth }),
32187
- (0, import_primitives6.cylinder)({ center: [length62 / 2, 0, 0], radius, height: depth })
32330
+ (0, import_primitives6.cuboid)({ center: [0, 0, 0], size: [length63, h2, depth] }),
32331
+ (0, import_primitives6.cylinder)({ center: [-length63 / 2, 0, 0], radius, height: depth }),
32332
+ (0, import_primitives6.cylinder)({ center: [length63 / 2, 0, 0], radius, height: depth })
32188
32333
  );
32189
32334
  }
32190
32335
  return (0, import_booleans4.union)(
32191
- (0, import_primitives6.cuboid)({ center: [0, 0, 0], size: [w, length62, depth] }),
32192
- (0, import_primitives6.cylinder)({ center: [0, -length62 / 2, 0], radius, height: depth }),
32193
- (0, import_primitives6.cylinder)({ center: [0, length62 / 2, 0], radius, height: depth })
32336
+ (0, import_primitives6.cuboid)({ center: [0, 0, 0], size: [w, length63, depth] }),
32337
+ (0, import_primitives6.cylinder)({ center: [0, -length63 / 2, 0], radius, height: depth }),
32338
+ (0, import_primitives6.cylinder)({ center: [0, length63 / 2, 0], radius, height: depth })
32194
32339
  );
32195
32340
  };
32196
32341
  let boardHole = createHoleGeom(
@@ -37589,9 +37734,9 @@ function getAlignmentSides(placement, rects, rtl) {
37589
37734
  }
37590
37735
  const alignment = getAlignment(placement);
37591
37736
  const alignmentAxis = getAlignmentAxis(placement);
37592
- const length62 = getAxisLength(alignmentAxis);
37737
+ const length63 = getAxisLength(alignmentAxis);
37593
37738
  let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
37594
- if (rects.reference[length62] > rects.floating[length62]) {
37739
+ if (rects.reference[length63] > rects.floating[length63]) {
37595
37740
  mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
37596
37741
  }
37597
37742
  return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
@@ -37897,28 +38042,28 @@ var arrow = (options) => ({
37897
38042
  y
37898
38043
  };
37899
38044
  const axis = getAlignmentAxis(placement);
37900
- const length62 = getAxisLength(axis);
38045
+ const length63 = getAxisLength(axis);
37901
38046
  const arrowDimensions = await platform2.getDimensions(element);
37902
38047
  const isYAxis = axis === "y";
37903
38048
  const minProp = isYAxis ? "top" : "left";
37904
38049
  const maxProp = isYAxis ? "bottom" : "right";
37905
38050
  const clientProp = isYAxis ? "clientHeight" : "clientWidth";
37906
- const endDiff = rects.reference[length62] + rects.reference[axis] - coords[axis] - rects.floating[length62];
38051
+ const endDiff = rects.reference[length63] + rects.reference[axis] - coords[axis] - rects.floating[length63];
37907
38052
  const startDiff = coords[axis] - rects.reference[axis];
37908
38053
  const arrowOffsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(element));
37909
38054
  let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
37910
38055
  if (!clientSize || !await (platform2.isElement == null ? void 0 : platform2.isElement(arrowOffsetParent))) {
37911
- clientSize = elements.floating[clientProp] || rects.floating[length62];
38056
+ clientSize = elements.floating[clientProp] || rects.floating[length63];
37912
38057
  }
37913
38058
  const centerToReference = endDiff / 2 - startDiff / 2;
37914
- const largestPossiblePadding = clientSize / 2 - arrowDimensions[length62] / 2 - 1;
38059
+ const largestPossiblePadding = clientSize / 2 - arrowDimensions[length63] / 2 - 1;
37915
38060
  const minPadding = min(paddingObject[minProp], largestPossiblePadding);
37916
38061
  const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
37917
38062
  const min$1 = minPadding;
37918
- const max2 = clientSize - arrowDimensions[length62] - maxPadding;
37919
- const center = clientSize / 2 - arrowDimensions[length62] / 2 + centerToReference;
38063
+ const max2 = clientSize - arrowDimensions[length63] - maxPadding;
38064
+ const center = clientSize / 2 - arrowDimensions[length63] / 2 + centerToReference;
37920
38065
  const offset4 = clamp2(min$1, center, max2);
37921
- const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset4 && rects.reference[length62] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length62] / 2 < 0;
38066
+ const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset4 && rects.reference[length63] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length63] / 2 < 0;
37922
38067
  const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max2 : 0;
37923
38068
  return {
37924
38069
  [axis]: coords[axis] + alignmentOffset,
@@ -39177,14 +39322,14 @@ function deepEqual(a, b) {
39177
39322
  if (typeof a === "function" && a.toString() === b.toString()) {
39178
39323
  return true;
39179
39324
  }
39180
- let length62;
39325
+ let length63;
39181
39326
  let i;
39182
39327
  let keys;
39183
39328
  if (a && b && typeof a === "object") {
39184
39329
  if (Array.isArray(a)) {
39185
- length62 = a.length;
39186
- if (length62 !== b.length) return false;
39187
- for (i = length62; i-- !== 0; ) {
39330
+ length63 = a.length;
39331
+ if (length63 !== b.length) return false;
39332
+ for (i = length63; i-- !== 0; ) {
39188
39333
  if (!deepEqual(a[i], b[i])) {
39189
39334
  return false;
39190
39335
  }
@@ -39192,16 +39337,16 @@ function deepEqual(a, b) {
39192
39337
  return true;
39193
39338
  }
39194
39339
  keys = Object.keys(a);
39195
- length62 = keys.length;
39196
- if (length62 !== Object.keys(b).length) {
39340
+ length63 = keys.length;
39341
+ if (length63 !== Object.keys(b).length) {
39197
39342
  return false;
39198
39343
  }
39199
- for (i = length62; i-- !== 0; ) {
39344
+ for (i = length63; i-- !== 0; ) {
39200
39345
  if (!{}.hasOwnProperty.call(b, keys[i])) {
39201
39346
  return false;
39202
39347
  }
39203
39348
  }
39204
- for (i = length62; i-- !== 0; ) {
39349
+ for (i = length63; i-- !== 0; ) {
39205
39350
  const key = keys[i];
39206
39351
  if (key === "_owner" && a.$$typeof) {
39207
39352
  continue;