@tscircuit/footprinter 0.0.124 → 0.0.126

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
@@ -1014,6 +1014,7 @@ type Footprinter = {
1014
1014
  ms013: () => FootprinterParamsBuilder<"w" | "p">;
1015
1015
  ms012: () => FootprinterParamsBuilder<"w" | "p">;
1016
1016
  lqfp: (num_pins?: number) => FootprinterParamsBuilder<"w" | "h" | "pl" | "pw">;
1017
+ smf: () => FootprinterParamsBuilder<"w" | "h" | "p" | "pl" | "pw">;
1017
1018
  smb: () => FootprinterParamsBuilder<"w" | "h" | "p" | "pl" | "pw">;
1018
1019
  sod923: () => FootprinterParamsBuilder<"w" | "h" | "p" | "pl" | "pw">;
1019
1020
  sod882: () => FootprinterParamsBuilder<"w" | "h" | "p" | "pl" | "pw">;
package/dist/index.js CHANGED
@@ -31,6 +31,7 @@ __export(fn_exports, {
31
31
  quad: () => quad,
32
32
  res: () => res,
33
33
  smb: () => smb,
34
+ smf: () => smf,
34
35
  sod123: () => sod123,
35
36
  sod123f: () => sod123f,
36
37
  sod128: () => sod128,
@@ -1535,10 +1536,10 @@ var pushbutton = (raw_params) => {
1535
1536
  const height = parameters.h;
1536
1537
  const holeDiameter = parameters.id;
1537
1538
  const holes = [
1538
- platedhole(1, -width / 2, height / 2, holeDiameter, holeDiameter * 1.2),
1539
- platedhole(2, -width / 2, -height / 2, holeDiameter, holeDiameter * 1.2),
1540
- platedhole(3, width / 2, -height / 2, holeDiameter, holeDiameter * 1.2),
1541
- platedhole(4, width / 2, height / 2, holeDiameter, holeDiameter * 1.2)
1539
+ platedhole(1, -width / 2, height / 2, holeDiameter, holeDiameter * 1.5),
1540
+ platedhole(2, -width / 2, -height / 2, holeDiameter, holeDiameter * 1.5),
1541
+ platedhole(3, width / 2, -height / 2, holeDiameter, holeDiameter * 1.5),
1542
+ platedhole(4, width / 2, height / 2, holeDiameter, holeDiameter * 1.5)
1542
1543
  ];
1543
1544
  const silkscreenLines = [
1544
1545
  // Vertical lines indicating connections
@@ -3677,23 +3678,23 @@ var microMelfWithoutParsing = (parameters) => {
3677
3678
  return pads;
3678
3679
  };
3679
3680
 
3680
- // src/fn/smb.ts
3681
+ // src/fn/smf.ts
3681
3682
  import { z as z35 } from "zod";
3682
3683
  import { length as length28 } from "circuit-json";
3683
- var smb_def = z35.object({
3684
+ var smf_def = z35.object({
3684
3685
  fn: z35.string(),
3685
3686
  num_pins: z35.literal(2).default(2),
3686
- w: z35.string().default("7.30mm"),
3687
- h: z35.string().default("4.40mm"),
3688
- pl: z35.string().default("2.50mm"),
3689
- pw: z35.string().default("2.30mm"),
3690
- p: z35.string().default("4.30mm")
3687
+ w: z35.string().default("4.80mm"),
3688
+ h: z35.string().default("2.10mm"),
3689
+ pl: z35.string().default("1.30mm"),
3690
+ pw: z35.string().default("1.40mm"),
3691
+ p: z35.string().default("2.9mm")
3691
3692
  });
3692
- var smb = (raw_params) => {
3693
- const parameters = smb_def.parse(raw_params);
3693
+ var smf = (raw_params) => {
3694
+ const parameters = smf_def.parse(raw_params);
3694
3695
  const silkscreenRefText = silkscreenRef(
3695
3696
  0,
3696
- length28.parse(parameters.h) / 2 + 0.5,
3697
+ length28.parse(parameters.h) - 0.5,
3697
3698
  0.3
3698
3699
  );
3699
3700
  const silkscreenLine = {
@@ -3706,11 +3707,11 @@ var smb = (raw_params) => {
3706
3707
  y: length28.parse(parameters.h) / 2
3707
3708
  },
3708
3709
  {
3709
- x: -length28.parse(parameters.w) / 2 - 0.1,
3710
+ x: -length28.parse(parameters.w) / 2,
3710
3711
  y: length28.parse(parameters.h) / 2
3711
3712
  },
3712
3713
  {
3713
- x: -length28.parse(parameters.w) / 2 - 0.1,
3714
+ x: -length28.parse(parameters.w) / 2,
3714
3715
  y: -length28.parse(parameters.h) / 2
3715
3716
  },
3716
3717
  {
@@ -3721,6 +3722,86 @@ var smb = (raw_params) => {
3721
3722
  stroke_width: 0.1,
3722
3723
  pcb_silkscreen_path_id: ""
3723
3724
  };
3725
+ return {
3726
+ circuitJson: smfWithoutParsing(parameters).concat(
3727
+ silkscreenLine,
3728
+ silkscreenRefText
3729
+ ),
3730
+ parameters
3731
+ };
3732
+ };
3733
+ var getSmfCoords = (parameters) => {
3734
+ const { pn, p } = parameters;
3735
+ if (pn === 1) {
3736
+ return { x: -p / 2, y: 0 };
3737
+ } else {
3738
+ return { x: p / 2, y: 0 };
3739
+ }
3740
+ };
3741
+ var smfWithoutParsing = (parameters) => {
3742
+ const pads = [];
3743
+ for (let i = 1; i <= parameters.num_pins; i++) {
3744
+ const { x, y } = getSmfCoords({
3745
+ pn: i,
3746
+ p: Number.parseFloat(parameters.p)
3747
+ });
3748
+ pads.push(
3749
+ rectpad(
3750
+ i,
3751
+ x,
3752
+ y,
3753
+ Number.parseFloat(parameters.pl),
3754
+ Number.parseFloat(parameters.pw)
3755
+ )
3756
+ );
3757
+ }
3758
+ return pads;
3759
+ };
3760
+
3761
+ // src/fn/smb.ts
3762
+ import { z as z36 } from "zod";
3763
+ import { length as length29 } from "circuit-json";
3764
+ var smb_def = z36.object({
3765
+ fn: z36.string(),
3766
+ num_pins: z36.literal(2).default(2),
3767
+ w: z36.string().default("7.30mm"),
3768
+ h: z36.string().default("4.40mm"),
3769
+ pl: z36.string().default("2.50mm"),
3770
+ pw: z36.string().default("2.30mm"),
3771
+ p: z36.string().default("4.30mm")
3772
+ });
3773
+ var smb = (raw_params) => {
3774
+ const parameters = smb_def.parse(raw_params);
3775
+ const silkscreenRefText = silkscreenRef(
3776
+ 0,
3777
+ length29.parse(parameters.h) / 2 + 0.5,
3778
+ 0.3
3779
+ );
3780
+ const silkscreenLine = {
3781
+ type: "pcb_silkscreen_path",
3782
+ layer: "top",
3783
+ pcb_component_id: "",
3784
+ route: [
3785
+ {
3786
+ x: length29.parse(parameters.p) / 2,
3787
+ y: length29.parse(parameters.h) / 2
3788
+ },
3789
+ {
3790
+ x: -length29.parse(parameters.w) / 2 - 0.1,
3791
+ y: length29.parse(parameters.h) / 2
3792
+ },
3793
+ {
3794
+ x: -length29.parse(parameters.w) / 2 - 0.1,
3795
+ y: -length29.parse(parameters.h) / 2
3796
+ },
3797
+ {
3798
+ x: length29.parse(parameters.p) / 2,
3799
+ y: -length29.parse(parameters.h) / 2
3800
+ }
3801
+ ],
3802
+ stroke_width: 0.1,
3803
+ pcb_silkscreen_path_id: ""
3804
+ };
3724
3805
  return {
3725
3806
  circuitJson: smbWithoutParsing(parameters).concat(
3726
3807
  silkscreenLine,