@tscircuit/footprinter 0.0.271 → 0.0.273

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
@@ -1807,6 +1807,7 @@ type Footprinter = {
1807
1807
  sot: () => FootprinterParamsBuilder<"w" | "h" | "p" | "pl" | "pw">;
1808
1808
  sot323: () => FootprinterParamsBuilder<"w" | "h" | "p" | "pl" | "pw">;
1809
1809
  sot89: () => FootprinterParamsBuilder<"w" | "p" | "pl" | "pw" | "h">;
1810
+ sot343: () => FootprinterParamsBuilder<"w" | "h" | "p" | "pl" | "pw">;
1810
1811
  sod323w: () => FootprinterParamsBuilder<"w" | "h" | "p" | "pl" | "pw">;
1811
1812
  smc: () => FootprinterParamsBuilder<"w" | "h" | "p" | "pw" | "pl">;
1812
1813
  minimelf: () => FootprinterParamsBuilder<"w" | "h" | "p" | "pw" | "pl">;
package/dist/index.js CHANGED
@@ -68,6 +68,7 @@ __export(fn_exports, {
68
68
  sot23w: () => sot23w,
69
69
  sot25: () => sot25,
70
70
  sot323: () => sot323,
71
+ sot343: () => sot343,
71
72
  sot363: () => sot363,
72
73
  sot457: () => sot457,
73
74
  sot563: () => sot563,
@@ -1614,8 +1615,8 @@ var sot23_5 = (parameters) => {
1614
1615
  pn: 1
1615
1616
  });
1616
1617
  pin1Position.x = pin1Position.x - Number.parseFloat(parameters.pw) * 1.5;
1617
- const triangleHeight = 0.7;
1618
- const triangleWidth = 0.3;
1618
+ const triangleHeight = 0.3;
1619
+ const triangleWidth = 0.4;
1619
1620
  const pin1Indicator = {
1620
1621
  type: "pcb_silkscreen_path",
1621
1622
  layer: "top",
@@ -7438,10 +7439,114 @@ var sotWithoutParsing = (parameters) => {
7438
7439
  ];
7439
7440
  };
7440
7441
 
7441
- // src/fn/m2host.ts
7442
+ // src/fn/sot343.ts
7442
7443
  import { z as z66 } from "zod";
7444
+ var sot343_def = base_def.extend({
7445
+ fn: z66.string(),
7446
+ num_pins: z66.number().default(4),
7447
+ w: z66.string().default("3.2mm"),
7448
+ h: z66.string().default("2.6mm"),
7449
+ pl: z66.string().default("0.65mm"),
7450
+ pw: z66.string().default("0.39mm"),
7451
+ p: z66.string().default("0.65mm"),
7452
+ string: z66.string().optional()
7453
+ });
7454
+ var sot343 = (raw_params) => {
7455
+ const match = raw_params.string?.match(/^sot343_(\d+)/);
7456
+ const numPins = match ? Number.parseInt(match[1], 4) : 4;
7457
+ const parameters = sot343_def.parse({
7458
+ ...raw_params,
7459
+ num_pins: numPins
7460
+ });
7461
+ if (parameters.num_pins === 4) {
7462
+ return {
7463
+ circuitJson: sot343_4(parameters),
7464
+ parameters
7465
+ };
7466
+ }
7467
+ throw new Error("Invalid number of pins");
7468
+ };
7469
+ var getCcwSot343Coords = (parameters) => {
7470
+ const { pn, p } = parameters;
7471
+ if (pn === 1) return { x: -p * 1.92, y: -0.65 };
7472
+ if (pn === 2) return { x: -p * 1.92, y: 0.65 };
7473
+ if (pn === 3) return { x: p, y: 0.65 };
7474
+ if (pn === 4) return { x: p, y: -0.65 };
7475
+ return { x: 0, y: 0 };
7476
+ };
7477
+ var sot343_4 = (parameters) => {
7478
+ const pads = [];
7479
+ const w = Number.parseFloat(parameters.w);
7480
+ const h = Number.parseFloat(parameters.h);
7481
+ const pl = Number.parseFloat(parameters.pl);
7482
+ const pw = Number.parseFloat(parameters.pw);
7483
+ const p = Number.parseFloat(parameters.p);
7484
+ let minX = Infinity;
7485
+ let maxX = -Infinity;
7486
+ let minY = Infinity;
7487
+ let maxY = -Infinity;
7488
+ for (let i = 0; i < parameters.num_pins; i++) {
7489
+ const { x, y } = getCcwSot343Coords({
7490
+ num_pins: parameters.num_pins,
7491
+ pn: i + 1,
7492
+ w,
7493
+ h,
7494
+ pl,
7495
+ p
7496
+ });
7497
+ pads.push(rectpad(i + 1, x, y, pl, pw));
7498
+ if (x < minX) minX = x;
7499
+ if (x > maxX) maxX = x;
7500
+ if (y < minY) minY = y;
7501
+ if (y > maxY) maxY = y;
7502
+ }
7503
+ const silkscreenXOffset = (minX + maxX) / 2;
7504
+ const padVerticalDistance = maxY - minY;
7505
+ const silkscreenMargin = h * 0.3;
7506
+ const offsetY = padVerticalDistance / 2 + silkscreenMargin;
7507
+ let silkscreenLineLength = w * 0.8;
7508
+ if (h <= 2.6) {
7509
+ silkscreenLineLength /= 2;
7510
+ }
7511
+ const silkscreenRefText = silkscreenRef(
7512
+ silkscreenXOffset,
7513
+ offsetY + 0.5,
7514
+ 0.3
7515
+ );
7516
+ const silkscreenPathTop = {
7517
+ layer: "top",
7518
+ pcb_component_id: "",
7519
+ pcb_silkscreen_path_id: "silkscreen_path_top",
7520
+ route: [
7521
+ { x: silkscreenXOffset - silkscreenLineLength / 2, y: offsetY },
7522
+ { x: silkscreenXOffset + silkscreenLineLength / 2, y: offsetY }
7523
+ ],
7524
+ type: "pcb_silkscreen_path",
7525
+ stroke_width: 0.1
7526
+ };
7527
+ const silkscreenPathBottom = {
7528
+ layer: "top",
7529
+ pcb_component_id: "",
7530
+ pcb_silkscreen_path_id: "silkscreen_path_bottom",
7531
+ route: [
7532
+ { x: silkscreenXOffset - silkscreenLineLength / 2, y: -offsetY },
7533
+ { x: silkscreenXOffset + silkscreenLineLength / 2, y: -offsetY }
7534
+ ],
7535
+ type: "pcb_silkscreen_path",
7536
+ stroke_width: 0.1
7537
+ };
7538
+ return [
7539
+ ...pads,
7540
+ silkscreenPathTop,
7541
+ silkscreenPathBottom,
7542
+ silkscreenRefText
7543
+ ];
7544
+ };
7545
+
7546
+ // src/fn/m2host.ts
7547
+ import { z as z67 } from "zod";
7443
7548
  var m2host_def = base_def.extend({
7444
- fn: z66.string()
7549
+ fn: z67.string()
7445
7550
  });
7446
7551
  var m2host = (raw_params) => {
7447
7552
  const parameters = m2host_def.parse(raw_params);