@tscircuit/footprinter 0.0.142 → 0.0.143

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.d.ts CHANGED
@@ -1041,6 +1041,7 @@ type Footprinter = {
1041
1041
  sod123w: () => FootprinterParamsBuilder<"w" | "h" | "p" | "pl" | "pw">;
1042
1042
  sod110: () => FootprinterParamsBuilder<"w" | "h" | "p" | "pl" | "pw">;
1043
1043
  to92: () => FootprinterParamsBuilder<"w" | "h" | "p" | "id" | "od" | "inline">;
1044
+ to92s: () => FootprinterParamsBuilder<"w" | "h" | "p" | "id" | "od">;
1044
1045
  sot223: () => FootprinterParamsBuilder<"w" | "h" | "p" | "pl" | "pw">;
1045
1046
  pushbutton: () => FootprinterParamsBuilder<"tllabel" | "trlabel" | "bllabel" | "brlabel">;
1046
1047
  stampboard: () => FootprinterParamsBuilder<"w" | "h" | "left" | "right" | "top" | "bottom" | "p" | "pw" | "pl" | "innerhole" | "innerholeedgedistance">;
package/dist/index.js CHANGED
@@ -60,6 +60,7 @@ __export(fn_exports, {
60
60
  stampreceiver: () => stampreceiver,
61
61
  to220: () => to220,
62
62
  to92: () => to92,
63
+ to92s: () => to92s,
63
64
  tssop: () => tssop,
64
65
  vssop8: () => vssop8
65
66
  });
@@ -4724,11 +4725,86 @@ var sot223_6 = (parameters) => {
4724
4725
  return [...pads, silkscreenPath1, silkscreenPath2, silkscreenRefText];
4725
4726
  };
4726
4727
 
4728
+ // src/fn/to92s.ts
4729
+ import { z as z43 } from "zod";
4730
+ var to92s_def = z43.object({
4731
+ fn: z43.string(),
4732
+ num_pins: z43.union([z43.literal(3), z43.literal(2)]).default(3),
4733
+ p: z43.string().default("1.27mm"),
4734
+ id: z43.string().default("0.72mm"),
4735
+ od: z43.string().default("0.95mm"),
4736
+ w: z43.string().default("2.5mm"),
4737
+ h: z43.string().default("4.2mm"),
4738
+ string: z43.string().optional()
4739
+ });
4740
+ var to92s_3 = (parameters) => {
4741
+ const { p, id, od, w, h } = parameters;
4742
+ const holeY = Number.parseFloat(h) / 2;
4743
+ const padSpacing = Number.parseFloat(p);
4744
+ return [
4745
+ platedhole(1, -padSpacing, holeY - padSpacing, id, od),
4746
+ platedhole(2, 0, holeY - padSpacing, id, od),
4747
+ platedhole(3, padSpacing, holeY - padSpacing, id, od)
4748
+ ];
4749
+ };
4750
+ var to92s_2 = (parameters) => {
4751
+ const { p, id, od, h } = parameters;
4752
+ const holeY = Number.parseFloat(h) / 2;
4753
+ const padSpacing = Number.parseFloat(p);
4754
+ return [
4755
+ platedhole(1, -padSpacing, holeY - padSpacing, id, od),
4756
+ platedhole(2, padSpacing, holeY - padSpacing, id, od)
4757
+ ];
4758
+ };
4759
+ var to92s = (raw_params) => {
4760
+ const match = raw_params.string?.match(/^to92s_(\d+)/);
4761
+ const numPins = match ? Number.parseInt(match[1], 10) : 3;
4762
+ const parameters = to92s_def.parse({
4763
+ ...raw_params,
4764
+ num_pins: numPins
4765
+ });
4766
+ let platedHoles = [];
4767
+ if (parameters.num_pins === 3) {
4768
+ platedHoles = to92s_3(parameters);
4769
+ } else if (parameters.num_pins === 2) {
4770
+ platedHoles = to92s_2(parameters);
4771
+ } else {
4772
+ throw new Error("Invalid number of pins for TO-92");
4773
+ }
4774
+ const holeY = Number.parseFloat(parameters.h) / 2;
4775
+ const padSpacing = Number.parseFloat(parameters.p);
4776
+ const silkscreenBody = {
4777
+ type: "pcb_silkscreen_path",
4778
+ layer: "top",
4779
+ pcb_component_id: "",
4780
+ route: [
4781
+ { x: -holeY, y: holeY - padSpacing },
4782
+ { x: -1.9, y: 0 },
4783
+ { x: 1.9, y: 0 },
4784
+ { x: holeY, y: holeY - padSpacing },
4785
+ { x: 1.5, y: Number.parseFloat(parameters.h) / 2 + 0.5 },
4786
+ { x: -1.5, y: Number.parseFloat(parameters.h) / 2 + 0.5 },
4787
+ { x: -holeY, y: holeY - padSpacing }
4788
+ ],
4789
+ stroke_width: 0.1,
4790
+ pcb_silkscreen_path_id: ""
4791
+ };
4792
+ const silkscreenRefText = silkscreenRef(0, holeY + 1, 0.5);
4793
+ return {
4794
+ circuitJson: [
4795
+ ...platedHoles,
4796
+ silkscreenBody,
4797
+ silkscreenRefText
4798
+ ],
4799
+ parameters
4800
+ };
4801
+ };
4802
+
4727
4803
  // src/fn/jst.ts
4728
4804
  import {
4729
4805
  length as length35
4730
4806
  } from "circuit-json";
4731
- import { z as z43 } from "zod";
4807
+ import { z as z44 } from "zod";
4732
4808
 
4733
4809
  // src/helpers/platedHoleWithRectPad.ts
4734
4810
  import { mm as mm4 } from "@tscircuit/mm";
@@ -4751,8 +4827,8 @@ var platedHoleWithRectPad = (pn, x, y, holeDiameter, rectPadWidth, rectPadHeight
4751
4827
  };
4752
4828
 
4753
4829
  // src/fn/jst.ts
4754
- var jst_def = z43.object({
4755
- fn: z43.string(),
4830
+ var jst_def = z44.object({
4831
+ fn: z44.string(),
4756
4832
  p: length35.optional().default("2.2mm"),
4757
4833
  id: length35.optional().default("0.70mm"),
4758
4834
  pw: length35.optional().default("1.20mm"),
@@ -4794,16 +4870,16 @@ var jst = (raw_params) => {
4794
4870
  };
4795
4871
 
4796
4872
  // src/fn/sod110.ts
4797
- import { z as z44 } from "zod";
4873
+ import { z as z45 } from "zod";
4798
4874
  import { length as length36 } from "circuit-json";
4799
- var sod_def12 = z44.object({
4800
- fn: z44.string(),
4801
- num_pins: z44.literal(2).default(2),
4802
- w: z44.string().default("3.30mm"),
4803
- h: z44.string().default("1.70mm"),
4804
- pl: z44.string().default("0.80mm"),
4805
- pw: z44.string().default("1mm"),
4806
- p: z44.string().default("1.90mm")
4875
+ var sod_def12 = z45.object({
4876
+ fn: z45.string(),
4877
+ num_pins: z45.literal(2).default(2),
4878
+ w: z45.string().default("3.30mm"),
4879
+ h: z45.string().default("1.70mm"),
4880
+ pl: z45.string().default("0.80mm"),
4881
+ pw: z45.string().default("1mm"),
4882
+ p: z45.string().default("1.90mm")
4807
4883
  });
4808
4884
  var sod110 = (raw_params) => {
4809
4885
  const parameters = sod_def12.parse(raw_params);