@tscircuit/footprinter 0.0.260 → 0.0.261

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -74,6 +74,7 @@ __export(fn_exports, {
74
74
  sot723: () => sot723,
75
75
  sot886: () => sot886,
76
76
  sot89: () => sot89,
77
+ sot963: () => sot963,
77
78
  ssop: () => ssop,
78
79
  stampboard: () => stampboard,
79
80
  stampreceiver: () => stampreceiver,
@@ -769,7 +770,8 @@ var extendSoicDef = (newDefaults) => z6.object({
769
770
  pw: length3.default(length3.parse(newDefaults.pw ?? "0.6mm")),
770
771
  pl: length3.default(length3.parse(newDefaults.pl ?? "1.0mm")),
771
772
  legsoutside: z6.boolean().optional().default(newDefaults.legsoutside ?? false),
772
- pillpads: z6.boolean().optional().default(newDefaults.pillpads ?? false)
773
+ pillpads: z6.boolean().optional().default(newDefaults.pillpads ?? false),
774
+ silkscreen_stroke_width: z6.number().optional().default(0.1)
773
775
  }).transform((v) => {
774
776
  if (!v.pw && !v.pl) {
775
777
  v.pw = length3.parse("0.6mm");
@@ -835,7 +837,7 @@ var soicWithoutParsing = (parameters) => {
835
837
  layer: "top",
836
838
  pcb_component_id: "",
837
839
  pcb_silkscreen_path_id: "silkscreen_path_1",
838
- stroke_width: 0.1,
840
+ stroke_width: parameters.silkscreen_stroke_width ?? 0.1,
839
841
  route: [
840
842
  { x: -sw / 2, y: -sh / 2 },
841
843
  { x: -sw / 2, y: sh / 2 },
@@ -4374,14 +4376,14 @@ var sot89_3 = (parameters) => {
4374
4376
  const pads = [];
4375
4377
  const padGap = Number.parseFloat(parameters.p);
4376
4378
  const padWidth = Number.parseFloat(parameters.pw);
4377
- const length48 = Number.parseFloat(parameters.w);
4379
+ const length49 = Number.parseFloat(parameters.w);
4378
4380
  const padHeight = Number.parseFloat(parameters.pl);
4379
4381
  const centerExtra = 0.175;
4380
4382
  const outerPadXShift = (padHeight - (padHeight + centerExtra)) / 2;
4381
4383
  pads.push(
4382
- rectpad(1, -length48 / 2 + outerPadXShift, padGap, padHeight, padWidth),
4383
- rectpad(2, -length48 / 2, 0, padHeight + centerExtra, padWidth),
4384
- rectpad(3, -length48 / 2 + outerPadXShift, -padGap, padHeight, padWidth)
4384
+ rectpad(1, -length49 / 2 + outerPadXShift, padGap, padHeight, padWidth),
4385
+ rectpad(2, -length49 / 2, 0, padHeight + centerExtra, padWidth),
4386
+ rectpad(3, -length49 / 2 + outerPadXShift, -padGap, padHeight, padWidth)
4385
4387
  );
4386
4388
  const silkscreenRefText = silkscreenRef(0, 0, 0.3);
4387
4389
  const width = Number.parseFloat(parameters.w) / 2 - 1;
@@ -4421,7 +4423,7 @@ var sot89_5 = (parameters) => {
4421
4423
  const pads = [];
4422
4424
  const padGap = Number.parseFloat(parameters.p);
4423
4425
  const padWidth = Number.parseFloat(parameters.pw);
4424
- const length48 = Number.parseFloat(parameters.w);
4426
+ const length49 = Number.parseFloat(parameters.w);
4425
4427
  pads.push(
4426
4428
  rectpad(1, -1.85, -1.5, 1.5, 0.7),
4427
4429
  rectpad(2, -1.85, 1.5, 1.5, 0.7),
@@ -6654,20 +6656,101 @@ var sot457 = (rawParams) => {
6654
6656
  };
6655
6657
  };
6656
6658
 
6657
- // src/fn/potentiometer.ts
6659
+ // src/fn/sot963.ts
6658
6660
  import { z as z56 } from "zod";
6659
- var potentiometer_def = z56.object({
6661
+ import { length as length44 } from "circuit-json";
6662
+ var sot963_def = z56.object({
6660
6663
  fn: z56.string(),
6661
- num_pins: z56.union([z56.literal(3), z56.literal(2)]).default(3),
6662
- p: z56.string().default("3.8mm"),
6663
- id: z56.string().default("1.25mm"),
6664
- od: z56.string().default("2.35mm"),
6665
- ca: z56.string().default("14mm").describe(
6664
+ num_pins: z56.literal(6).default(6),
6665
+ w: z56.string().default("1.1mm"),
6666
+ h: z56.string().default("1.45mm"),
6667
+ p: z56.string().default("0.35mm"),
6668
+ pl: z56.string().default("0.2mm"),
6669
+ pw: z56.string().default("0.2mm"),
6670
+ string: z56.string().optional()
6671
+ });
6672
+ var sot963 = (raw_params) => {
6673
+ const parameters = sot963_def.parse({ ...raw_params, fn: "sot963" });
6674
+ const w = length44.parse(parameters.w);
6675
+ const h = length44.parse(parameters.h);
6676
+ const p = length44.parse(parameters.p);
6677
+ const pl = length44.parse(parameters.pl);
6678
+ const pw = length44.parse(parameters.pw);
6679
+ const pads = [];
6680
+ for (let i = 0; i < 6; i++) {
6681
+ const { x, y } = getSot963PadCoord(i + 1, w, p, pl);
6682
+ pads.push(rectpad(i + 1, x, y, pl, pw));
6683
+ }
6684
+ const silkscreenTopLine = {
6685
+ type: "pcb_silkscreen_path",
6686
+ layer: "top",
6687
+ pcb_component_id: "",
6688
+ route: [
6689
+ { x: -w / 2, y: h / 2 },
6690
+ { x: w / 2, y: h / 2 }
6691
+ ],
6692
+ stroke_width: 0.05,
6693
+ pcb_silkscreen_path_id: ""
6694
+ };
6695
+ const silkscreenBottomLine = {
6696
+ type: "pcb_silkscreen_path",
6697
+ layer: "top",
6698
+ pcb_component_id: "",
6699
+ route: [
6700
+ { x: -w / 2, y: -h / 2 },
6701
+ { x: w / 2, y: -h / 2 }
6702
+ ],
6703
+ stroke_width: 0.05,
6704
+ pcb_silkscreen_path_id: ""
6705
+ };
6706
+ const pin1Position = getSot963PadCoord(1, w, p, pl);
6707
+ const pin1Marking = {
6708
+ type: "pcb_silkscreen_path",
6709
+ layer: "top",
6710
+ pcb_component_id: "pin_marker_1",
6711
+ route: [
6712
+ { x: pin1Position.x - pl / 2 - 0.3, y: pin1Position.y },
6713
+ { x: pin1Position.x - pl / 2 - 0.45, y: pin1Position.y + 0.15 },
6714
+ { x: pin1Position.x - pl / 2 - 0.45, y: pin1Position.y - 0.15 },
6715
+ { x: pin1Position.x - pl / 2 - 0.3, y: pin1Position.y }
6716
+ ],
6717
+ stroke_width: 0.05,
6718
+ pcb_silkscreen_path_id: "pin_marker_1"
6719
+ };
6720
+ const silkscreenRefText = silkscreenRef(0, h / 2 + 0.4, 0.25);
6721
+ return {
6722
+ circuitJson: [
6723
+ ...pads,
6724
+ silkscreenTopLine,
6725
+ silkscreenBottomLine,
6726
+ silkscreenRefText,
6727
+ pin1Marking
6728
+ ],
6729
+ parameters
6730
+ };
6731
+ };
6732
+ var getSot963PadCoord = (pn, w, p, pl) => {
6733
+ const padCenterOffset = w / 2 - pl / 2;
6734
+ if (pn <= 3) {
6735
+ return { x: -padCenterOffset, y: p - (pn - 1) * p };
6736
+ }
6737
+ return { x: padCenterOffset, y: -p + (pn - 4) * p };
6738
+ };
6739
+
6740
+ // src/fn/potentiometer.ts
6741
+ import { z as z57 } from "zod";
6742
+ var potentiometer_def = z57.object({
6743
+ fn: z57.string(),
6744
+ num_pins: z57.union([z57.literal(3), z57.literal(2)]).default(3),
6745
+ p: z57.string().default("3.8mm"),
6746
+ id: z57.string().default("1.25mm"),
6747
+ od: z57.string().default("2.35mm"),
6748
+ ca: z57.string().default("14mm").describe(
6666
6749
  "Caliper axis (width or diameter of the potentiometer body or adjustment knob)"
6667
6750
  ),
6668
- w: z56.string().default("5.35mm"),
6669
- h: z56.string().default("4mm"),
6670
- string: z56.string().optional()
6751
+ w: z57.string().default("5.35mm"),
6752
+ h: z57.string().default("4mm"),
6753
+ string: z57.string().optional()
6671
6754
  });
6672
6755
  var potentiometer_acp = (parameters) => {
6673
6756
  const { p, id, od, h, ca } = parameters;
@@ -6734,15 +6817,15 @@ var potentiometer = (raw_params) => {
6734
6817
 
6735
6818
  // src/fn/electrolytic.ts
6736
6819
  import {
6737
- length as length44
6820
+ length as length45
6738
6821
  } from "circuit-json";
6739
- import { z as z57 } from "zod";
6740
- var electrolytic_def = z57.object({
6741
- fn: z57.string(),
6742
- p: length44.optional().default("7.5mm"),
6743
- id: length44.optional().default("1mm"),
6744
- od: length44.optional().default("2mm"),
6745
- d: length44.optional().default("10.5mm")
6822
+ import { z as z58 } from "zod";
6823
+ var electrolytic_def = z58.object({
6824
+ fn: z58.string(),
6825
+ p: length45.optional().default("7.5mm"),
6826
+ id: length45.optional().default("1mm"),
6827
+ od: length45.optional().default("2mm"),
6828
+ d: length45.optional().default("10.5mm")
6746
6829
  });
6747
6830
  var generate_circle_arcs = (centerX, centerY, radius, cut, cutHeight) => {
6748
6831
  const topArc = [];
@@ -6849,22 +6932,22 @@ var electrolytic = (raw_params) => {
6849
6932
  };
6850
6933
 
6851
6934
  // src/fn/smbf.ts
6852
- import { z as z58 } from "zod";
6853
- import { length as length45 } from "circuit-json";
6854
- var smbf_def = z58.object({
6855
- fn: z58.string(),
6856
- num_pins: z58.literal(2).default(2),
6857
- w: z58.string().default("6.5mm"),
6858
- h: z58.string().default("3mm"),
6859
- pl: z58.string().default("1.75mm"),
6860
- pw: z58.string().default("2.40mm"),
6861
- p: z58.string().default("4.75mm")
6935
+ import { z as z59 } from "zod";
6936
+ import { length as length46 } from "circuit-json";
6937
+ var smbf_def = z59.object({
6938
+ fn: z59.string(),
6939
+ num_pins: z59.literal(2).default(2),
6940
+ w: z59.string().default("6.5mm"),
6941
+ h: z59.string().default("3mm"),
6942
+ pl: z59.string().default("1.75mm"),
6943
+ pw: z59.string().default("2.40mm"),
6944
+ p: z59.string().default("4.75mm")
6862
6945
  });
6863
6946
  var smbf = (raw_params) => {
6864
6947
  const parameters = smbf_def.parse(raw_params);
6865
6948
  const silkscreenRefText = silkscreenRef(
6866
6949
  0,
6867
- length45.parse(parameters.h) - 0.5,
6950
+ length46.parse(parameters.h) - 0.5,
6868
6951
  0.3
6869
6952
  );
6870
6953
  const silkscreenLine = {
@@ -6873,20 +6956,20 @@ var smbf = (raw_params) => {
6873
6956
  pcb_component_id: "",
6874
6957
  route: [
6875
6958
  {
6876
- x: length45.parse(parameters.p) / 2,
6877
- y: length45.parse(parameters.h) / 2
6959
+ x: length46.parse(parameters.p) / 2,
6960
+ y: length46.parse(parameters.h) / 2
6878
6961
  },
6879
6962
  {
6880
- x: -length45.parse(parameters.w) / 2 - 0.3,
6881
- y: length45.parse(parameters.h) / 2
6963
+ x: -length46.parse(parameters.w) / 2 - 0.3,
6964
+ y: length46.parse(parameters.h) / 2
6882
6965
  },
6883
6966
  {
6884
- x: -length45.parse(parameters.w) / 2 - 0.3,
6885
- y: -length45.parse(parameters.h) / 2
6967
+ x: -length46.parse(parameters.w) / 2 - 0.3,
6968
+ y: -length46.parse(parameters.h) / 2
6886
6969
  },
6887
6970
  {
6888
- x: length45.parse(parameters.p) / 2,
6889
- y: -length45.parse(parameters.h) / 2
6971
+ x: length46.parse(parameters.p) / 2,
6972
+ y: -length46.parse(parameters.h) / 2
6890
6973
  }
6891
6974
  ],
6892
6975
  stroke_width: 0.1,
@@ -6928,16 +7011,16 @@ var smbfWithoutParsing = (parameters) => {
6928
7011
  };
6929
7012
 
6930
7013
  // src/fn/sot323.ts
6931
- import { z as z59 } from "zod";
6932
- var sot323_def = z59.object({
6933
- fn: z59.string(),
6934
- num_pins: z59.number().default(3),
6935
- w: z59.string().default("2.45mm"),
6936
- h: z59.string().default("2.40mm"),
6937
- pl: z59.string().default("0.70mm"),
6938
- pw: z59.string().default("0.45mm"),
6939
- p: z59.string().default("1mm"),
6940
- string: z59.string().optional()
7014
+ import { z as z60 } from "zod";
7015
+ var sot323_def = z60.object({
7016
+ fn: z60.string(),
7017
+ num_pins: z60.number().default(3),
7018
+ w: z60.string().default("2.45mm"),
7019
+ h: z60.string().default("2.40mm"),
7020
+ pl: z60.string().default("0.70mm"),
7021
+ pw: z60.string().default("0.45mm"),
7022
+ p: z60.string().default("1mm"),
7023
+ string: z60.string().optional()
6941
7024
  });
6942
7025
  var sot323 = (raw_params) => {
6943
7026
  const match = raw_params.string?.match(/^sot323_(\d+)/);
@@ -7025,30 +7108,30 @@ var sot323_3 = (parameters) => {
7025
7108
  };
7026
7109
 
7027
7110
  // src/fn/smtpad.ts
7028
- import { z as z60 } from "zod";
7029
- import { length as length46 } from "circuit-json";
7111
+ import { z as z61 } from "zod";
7112
+ import { length as length47 } from "circuit-json";
7030
7113
  import { mm as mm6 } from "@tscircuit/mm";
7031
- var smtpad_def = z60.object({
7032
- fn: z60.string(),
7033
- circle: z60.boolean().optional(),
7034
- rect: z60.boolean().optional(),
7035
- square: z60.boolean().optional(),
7036
- pill: z60.boolean().optional(),
7037
- d: length46.optional(),
7038
- pd: length46.optional(),
7039
- diameter: length46.optional(),
7040
- r: length46.optional(),
7041
- pr: length46.optional(),
7042
- radius: length46.optional(),
7043
- w: length46.optional(),
7044
- pw: length46.optional(),
7045
- width: length46.optional(),
7046
- h: length46.optional(),
7047
- ph: length46.optional(),
7048
- height: length46.optional(),
7049
- s: length46.optional(),
7050
- size: length46.optional(),
7051
- string: z60.string().optional()
7114
+ var smtpad_def = z61.object({
7115
+ fn: z61.string(),
7116
+ circle: z61.boolean().optional(),
7117
+ rect: z61.boolean().optional(),
7118
+ square: z61.boolean().optional(),
7119
+ pill: z61.boolean().optional(),
7120
+ d: length47.optional(),
7121
+ pd: length47.optional(),
7122
+ diameter: length47.optional(),
7123
+ r: length47.optional(),
7124
+ pr: length47.optional(),
7125
+ radius: length47.optional(),
7126
+ w: length47.optional(),
7127
+ pw: length47.optional(),
7128
+ width: length47.optional(),
7129
+ h: length47.optional(),
7130
+ ph: length47.optional(),
7131
+ height: length47.optional(),
7132
+ s: length47.optional(),
7133
+ size: length47.optional(),
7134
+ string: z61.string().optional()
7052
7135
  }).transform((v) => {
7053
7136
  let shape = "rect";
7054
7137
  if (v.circle) shape = "circle";
@@ -7114,18 +7197,18 @@ var smtpad = (raw_params) => {
7114
7197
  };
7115
7198
 
7116
7199
  // src/fn/platedhole.ts
7117
- import { z as z61 } from "zod";
7118
- import { length as length47 } from "circuit-json";
7200
+ import { z as z62 } from "zod";
7201
+ import { length as length48 } from "circuit-json";
7119
7202
  import { mm as mm7 } from "@tscircuit/mm";
7120
- var platedhole_def = z61.object({
7121
- fn: z61.string(),
7122
- d: length47.optional(),
7123
- hd: length47.optional(),
7124
- r: length47.optional(),
7125
- hr: length47.optional(),
7126
- pd: length47.optional(),
7127
- pr: length47.optional(),
7128
- squarepad: z61.boolean().optional().default(false)
7203
+ var platedhole_def = z62.object({
7204
+ fn: z62.string(),
7205
+ d: length48.optional(),
7206
+ hd: length48.optional(),
7207
+ r: length48.optional(),
7208
+ hr: length48.optional(),
7209
+ pd: length48.optional(),
7210
+ pr: length48.optional(),
7211
+ squarepad: z62.boolean().optional().default(false)
7129
7212
  }).transform((v) => {
7130
7213
  let holeD;
7131
7214
  if (v.d !== void 0) holeD = mm7(v.d);
@@ -7157,14 +7240,14 @@ var platedhole2 = (raw_params) => {
7157
7240
  };
7158
7241
 
7159
7242
  // src/fn/sot.ts
7160
- import { z as z62 } from "zod";
7161
- var sot_def = z62.object({
7162
- fn: z62.string(),
7163
- num_pins: z62.literal(6).default(6),
7164
- h: z62.string().default("1.6mm"),
7165
- pl: z62.string().default("1mm"),
7166
- pw: z62.string().default("0.7mm"),
7167
- p: z62.string().default("0.95mm")
7243
+ import { z as z63 } from "zod";
7244
+ var sot_def = z63.object({
7245
+ fn: z63.string(),
7246
+ num_pins: z63.literal(6).default(6),
7247
+ h: z63.string().default("1.6mm"),
7248
+ pl: z63.string().default("1mm"),
7249
+ pw: z63.string().default("0.7mm"),
7250
+ p: z63.string().default("0.95mm")
7168
7251
  });
7169
7252
  var sot = (raw_params) => {
7170
7253
  const parameters = sot_def.parse(raw_params);
@@ -7281,9 +7364,9 @@ var sotWithoutParsing = (parameters) => {
7281
7364
  };
7282
7365
 
7283
7366
  // src/fn/m2host.ts
7284
- import { z as z63 } from "zod";
7285
- var m2host_def = z63.object({
7286
- fn: z63.string()
7367
+ import { z as z64 } from "zod";
7368
+ var m2host_def = z64.object({
7369
+ fn: z64.string()
7287
7370
  });
7288
7371
  var m2host = (raw_params) => {
7289
7372
  const parameters = m2host_def.parse(raw_params);