@tscircuit/footprinter 0.0.172 → 0.0.173

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
@@ -1074,6 +1074,7 @@ type Footprinter = {
1074
1074
  sma: () => FootprinterParamsBuilder<"w" | "h" | "p" | "pl" | "pw">;
1075
1075
  smf: () => FootprinterParamsBuilder<"w" | "h" | "p" | "pl" | "pw">;
1076
1076
  smb: () => FootprinterParamsBuilder<"w" | "h" | "p" | "pl" | "pw">;
1077
+ smbf: () => FootprinterParamsBuilder<"w" | "h" | "p" | "pl" | "pw">;
1077
1078
  potentiometer: () => FootprinterParamsBuilder<"w" | "h" | "p" | "id" | "od" | "pw" | "ca">;
1078
1079
  electrolytic: () => FootprinterParamsBuilder<"d" | "p" | "id" | "od">;
1079
1080
  sod923: () => FootprinterParamsBuilder<"w" | "h" | "p" | "pl" | "pw">;
package/dist/index.js CHANGED
@@ -36,6 +36,7 @@ __export(fn_exports, {
36
36
  res: () => res,
37
37
  sma: () => sma,
38
38
  smb: () => smb,
39
+ smbf: () => smbf,
39
40
  smc: () => smc,
40
41
  smf: () => smf,
41
42
  sod110: () => sod110,
@@ -4042,12 +4043,12 @@ var sot89_3 = (parameters) => {
4042
4043
  const pads = [];
4043
4044
  const padGap = Number.parseFloat(parameters.p);
4044
4045
  const padWidth = Number.parseFloat(parameters.pw);
4045
- const length44 = Number.parseFloat(parameters.w);
4046
+ const length45 = Number.parseFloat(parameters.w);
4046
4047
  const padHeight = Number.parseFloat(parameters.pl);
4047
4048
  pads.push(
4048
- rectpad(1, -length44 / 2, padGap, padHeight, padWidth),
4049
- rectpad(2, -length44 / 2 + (1.5 - 1.3) / 2, 0, 1.5, padWidth),
4050
- rectpad(3, -length44 / 2, -padGap, padHeight, padWidth)
4049
+ rectpad(1, -length45 / 2, padGap, padHeight, padWidth),
4050
+ rectpad(2, -length45 / 2 + (1.5 - 1.3) / 2, 0, 1.5, padWidth),
4051
+ rectpad(3, -length45 / 2, -padGap, padHeight, padWidth)
4051
4052
  );
4052
4053
  const silkscreenRefText = silkscreenRef(0, 0, 0.3);
4053
4054
  const width = Number.parseFloat(parameters.w) / 2 - 1;
@@ -4087,7 +4088,7 @@ var sot89_5 = (parameters) => {
4087
4088
  const pads = [];
4088
4089
  const padGap = Number.parseFloat(parameters.p);
4089
4090
  const padWidth = Number.parseFloat(parameters.pw);
4090
- const length44 = Number.parseFloat(parameters.w);
4091
+ const length45 = Number.parseFloat(parameters.w);
4091
4092
  pads.push(
4092
4093
  rectpad(1, -1.85, -1.5, 1.5, 0.7),
4093
4094
  rectpad(2, -1.85, 1.5, 1.5, 0.7),
@@ -6433,17 +6434,96 @@ var electrolytic = (raw_params) => {
6433
6434
  };
6434
6435
  };
6435
6436
 
6436
- // src/fn/sot323.ts
6437
+ // src/fn/smbf.ts
6437
6438
  import { z as z56 } from "zod";
6438
- var sot323_def = z56.object({
6439
+ import { length as length44 } from "circuit-json";
6440
+ var smbf_def = z56.object({
6439
6441
  fn: z56.string(),
6440
- num_pins: z56.number().default(3),
6441
- w: z56.string().default("2.45mm"),
6442
- h: z56.string().default("2.40mm"),
6443
- pl: z56.string().default("0.45mm"),
6444
- pw: z56.string().default("0.70mm"),
6445
- p: z56.string().default("1mm"),
6446
- string: z56.string().optional()
6442
+ num_pins: z56.literal(2).default(2),
6443
+ w: z56.string().default("6.5mm"),
6444
+ h: z56.string().default("3mm"),
6445
+ pl: z56.string().default("1.75mm"),
6446
+ pw: z56.string().default("2.40mm"),
6447
+ p: z56.string().default("4.75mm")
6448
+ });
6449
+ var smbf = (raw_params) => {
6450
+ const parameters = smbf_def.parse(raw_params);
6451
+ const silkscreenRefText = silkscreenRef(
6452
+ 0,
6453
+ length44.parse(parameters.h) - 0.5,
6454
+ 0.3
6455
+ );
6456
+ const silkscreenLine = {
6457
+ type: "pcb_silkscreen_path",
6458
+ layer: "top",
6459
+ pcb_component_id: "",
6460
+ route: [
6461
+ {
6462
+ x: length44.parse(parameters.p) / 2,
6463
+ y: length44.parse(parameters.h) / 2
6464
+ },
6465
+ {
6466
+ x: -length44.parse(parameters.w) / 2 - 0.3,
6467
+ y: length44.parse(parameters.h) / 2
6468
+ },
6469
+ {
6470
+ x: -length44.parse(parameters.w) / 2 - 0.3,
6471
+ y: -length44.parse(parameters.h) / 2
6472
+ },
6473
+ {
6474
+ x: length44.parse(parameters.p) / 2,
6475
+ y: -length44.parse(parameters.h) / 2
6476
+ }
6477
+ ],
6478
+ stroke_width: 0.1,
6479
+ pcb_silkscreen_path_id: ""
6480
+ };
6481
+ return {
6482
+ circuitJson: smbfWithoutParsing(parameters).concat(
6483
+ silkscreenLine,
6484
+ silkscreenRefText
6485
+ ),
6486
+ parameters
6487
+ };
6488
+ };
6489
+ var getSmbfCoords = (parameters) => {
6490
+ const { pn, p } = parameters;
6491
+ if (pn === 1) {
6492
+ return { x: -p / 2, y: 0 };
6493
+ }
6494
+ return { x: p / 2, y: 0 };
6495
+ };
6496
+ var smbfWithoutParsing = (parameters) => {
6497
+ const pads = [];
6498
+ for (let i = 1; i <= parameters.num_pins; i++) {
6499
+ const { x, y } = getSmbfCoords({
6500
+ pn: i,
6501
+ p: Number.parseFloat(parameters.p)
6502
+ });
6503
+ pads.push(
6504
+ rectpad(
6505
+ i,
6506
+ x,
6507
+ y,
6508
+ Number.parseFloat(parameters.pl),
6509
+ Number.parseFloat(parameters.pw)
6510
+ )
6511
+ );
6512
+ }
6513
+ return pads;
6514
+ };
6515
+
6516
+ // src/fn/sot323.ts
6517
+ import { z as z57 } from "zod";
6518
+ var sot323_def = z57.object({
6519
+ fn: z57.string(),
6520
+ num_pins: z57.number().default(3),
6521
+ w: z57.string().default("2.45mm"),
6522
+ h: z57.string().default("2.40mm"),
6523
+ pl: z57.string().default("0.45mm"),
6524
+ pw: z57.string().default("0.70mm"),
6525
+ p: z57.string().default("1mm"),
6526
+ string: z57.string().optional()
6447
6527
  });
6448
6528
  var sot323 = (raw_params) => {
6449
6529
  const match = raw_params.string?.match(/^sot323_(\d+)/);