@tscircuit/footprinter 0.0.143 → 0.0.144
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 +1 -0
- package/dist/index.js +118 -20
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1043,6 +1043,7 @@ type Footprinter = {
|
|
|
1043
1043
|
to92: () => FootprinterParamsBuilder<"w" | "h" | "p" | "id" | "od" | "inline">;
|
|
1044
1044
|
to92s: () => FootprinterParamsBuilder<"w" | "h" | "p" | "id" | "od">;
|
|
1045
1045
|
sot223: () => FootprinterParamsBuilder<"w" | "h" | "p" | "pl" | "pw">;
|
|
1046
|
+
sot23w: () => FootprinterParamsBuilder<"w" | "h" | "p" | "pl" | "pw">;
|
|
1046
1047
|
pushbutton: () => FootprinterParamsBuilder<"tllabel" | "trlabel" | "bllabel" | "brlabel">;
|
|
1047
1048
|
stampboard: () => FootprinterParamsBuilder<"w" | "h" | "left" | "right" | "top" | "bottom" | "p" | "pw" | "pl" | "innerhole" | "innerholeedgedistance">;
|
|
1048
1049
|
stampreceiver: () => FootprinterParamsBuilder<"w" | "h" | "left" | "right" | "top" | "bottom" | "p" | "pw" | "pl" | "innerhole" | "innerholeedgedistance">;
|
package/dist/index.js
CHANGED
|
@@ -51,6 +51,7 @@ __export(fn_exports, {
|
|
|
51
51
|
sop8: () => sop8,
|
|
52
52
|
sot223: () => sot223,
|
|
53
53
|
sot23: () => sot23,
|
|
54
|
+
sot23w: () => sot23w,
|
|
54
55
|
sot363: () => sot363,
|
|
55
56
|
sot563: () => sot563,
|
|
56
57
|
sot723: () => sot723,
|
|
@@ -4725,18 +4726,115 @@ var sot223_6 = (parameters) => {
|
|
|
4725
4726
|
return [...pads, silkscreenPath1, silkscreenPath2, silkscreenRefText];
|
|
4726
4727
|
};
|
|
4727
4728
|
|
|
4728
|
-
// src/fn/
|
|
4729
|
+
// src/fn/sot23w.ts
|
|
4729
4730
|
import { z as z43 } from "zod";
|
|
4730
|
-
var
|
|
4731
|
+
var sot23w_def = z43.object({
|
|
4731
4732
|
fn: z43.string(),
|
|
4732
|
-
num_pins: z43.
|
|
4733
|
-
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
|
|
4737
|
-
|
|
4733
|
+
num_pins: z43.number().default(3),
|
|
4734
|
+
w: z43.string().default("3.40mm"),
|
|
4735
|
+
h: z43.string().default("3.30mm"),
|
|
4736
|
+
pl: z43.string().default("1mm"),
|
|
4737
|
+
pw: z43.string().default("0.7mm"),
|
|
4738
|
+
p: z43.string().default("1.2mm"),
|
|
4738
4739
|
string: z43.string().optional()
|
|
4739
4740
|
});
|
|
4741
|
+
var sot23w = (raw_params) => {
|
|
4742
|
+
const match = raw_params.string?.match(/^sot23w_(\d+)/);
|
|
4743
|
+
const numPins = match ? Number.parseInt(match[1], 3) : 3;
|
|
4744
|
+
const parameters = sot23w_def.parse({
|
|
4745
|
+
...raw_params,
|
|
4746
|
+
num_pins: numPins
|
|
4747
|
+
});
|
|
4748
|
+
if (parameters.num_pins === 3) {
|
|
4749
|
+
return {
|
|
4750
|
+
circuitJson: sot23w_3(parameters),
|
|
4751
|
+
parameters
|
|
4752
|
+
};
|
|
4753
|
+
}
|
|
4754
|
+
throw new Error("Invalid number of pins");
|
|
4755
|
+
};
|
|
4756
|
+
var getCcwSot23wCoords = (parameters) => {
|
|
4757
|
+
const { pn, w, h, pl, p } = parameters;
|
|
4758
|
+
if (pn === 1) {
|
|
4759
|
+
return { x: -p, y: 0.95 };
|
|
4760
|
+
}
|
|
4761
|
+
if (pn === 2) {
|
|
4762
|
+
return { x: -p, y: -0.95 };
|
|
4763
|
+
}
|
|
4764
|
+
return { x: p, y: 0 };
|
|
4765
|
+
};
|
|
4766
|
+
var sot23w_3 = (parameters) => {
|
|
4767
|
+
const pads = [];
|
|
4768
|
+
for (let i = 0; i < parameters.num_pins; i++) {
|
|
4769
|
+
const { x, y } = getCcwSot23wCoords({
|
|
4770
|
+
num_pins: parameters.num_pins,
|
|
4771
|
+
pn: i + 1,
|
|
4772
|
+
w: Number.parseFloat(parameters.w),
|
|
4773
|
+
h: Number.parseFloat(parameters.h),
|
|
4774
|
+
pl: Number.parseFloat(parameters.pl),
|
|
4775
|
+
p: Number.parseFloat(parameters.p)
|
|
4776
|
+
});
|
|
4777
|
+
pads.push(
|
|
4778
|
+
rectpad(
|
|
4779
|
+
i + 1,
|
|
4780
|
+
x,
|
|
4781
|
+
y,
|
|
4782
|
+
Number.parseFloat(parameters.pl),
|
|
4783
|
+
Number.parseFloat(parameters.pw)
|
|
4784
|
+
)
|
|
4785
|
+
);
|
|
4786
|
+
}
|
|
4787
|
+
const silkscreenRefText = silkscreenRef(
|
|
4788
|
+
0,
|
|
4789
|
+
Number.parseInt(parameters.h) / 2 + 1,
|
|
4790
|
+
0.3
|
|
4791
|
+
);
|
|
4792
|
+
const width = Number.parseFloat(parameters.w) / 2 - 1;
|
|
4793
|
+
const height = Number.parseFloat(parameters.h) / 2;
|
|
4794
|
+
const silkscreenPath1 = {
|
|
4795
|
+
layer: "top",
|
|
4796
|
+
pcb_component_id: "",
|
|
4797
|
+
pcb_silkscreen_path_id: "silkscreen_path_1",
|
|
4798
|
+
route: [
|
|
4799
|
+
{ x: -width, y: height },
|
|
4800
|
+
{ x: width + 0.3, y: height },
|
|
4801
|
+
{ x: width + 0.3, y: height / 2 }
|
|
4802
|
+
],
|
|
4803
|
+
type: "pcb_silkscreen_path",
|
|
4804
|
+
stroke_width: 0.1
|
|
4805
|
+
};
|
|
4806
|
+
const silkscreenPath2 = {
|
|
4807
|
+
layer: "top",
|
|
4808
|
+
pcb_component_id: "",
|
|
4809
|
+
pcb_silkscreen_path_id: "silkscreen_path_2",
|
|
4810
|
+
route: [
|
|
4811
|
+
{ x: -width, y: -height },
|
|
4812
|
+
{ x: width + 0.3, y: -height },
|
|
4813
|
+
{ x: width + 0.3, y: -height / 2 }
|
|
4814
|
+
],
|
|
4815
|
+
type: "pcb_silkscreen_path",
|
|
4816
|
+
stroke_width: 0.1
|
|
4817
|
+
};
|
|
4818
|
+
return [
|
|
4819
|
+
...pads,
|
|
4820
|
+
silkscreenPath1,
|
|
4821
|
+
silkscreenPath2,
|
|
4822
|
+
silkscreenRefText
|
|
4823
|
+
];
|
|
4824
|
+
};
|
|
4825
|
+
|
|
4826
|
+
// src/fn/to92s.ts
|
|
4827
|
+
import { z as z44 } from "zod";
|
|
4828
|
+
var to92s_def = z44.object({
|
|
4829
|
+
fn: z44.string(),
|
|
4830
|
+
num_pins: z44.union([z44.literal(3), z44.literal(2)]).default(3),
|
|
4831
|
+
p: z44.string().default("1.27mm"),
|
|
4832
|
+
id: z44.string().default("0.72mm"),
|
|
4833
|
+
od: z44.string().default("0.95mm"),
|
|
4834
|
+
w: z44.string().default("2.5mm"),
|
|
4835
|
+
h: z44.string().default("4.2mm"),
|
|
4836
|
+
string: z44.string().optional()
|
|
4837
|
+
});
|
|
4740
4838
|
var to92s_3 = (parameters) => {
|
|
4741
4839
|
const { p, id, od, w, h } = parameters;
|
|
4742
4840
|
const holeY = Number.parseFloat(h) / 2;
|
|
@@ -4804,7 +4902,7 @@ var to92s = (raw_params) => {
|
|
|
4804
4902
|
import {
|
|
4805
4903
|
length as length35
|
|
4806
4904
|
} from "circuit-json";
|
|
4807
|
-
import { z as
|
|
4905
|
+
import { z as z45 } from "zod";
|
|
4808
4906
|
|
|
4809
4907
|
// src/helpers/platedHoleWithRectPad.ts
|
|
4810
4908
|
import { mm as mm4 } from "@tscircuit/mm";
|
|
@@ -4827,8 +4925,8 @@ var platedHoleWithRectPad = (pn, x, y, holeDiameter, rectPadWidth, rectPadHeight
|
|
|
4827
4925
|
};
|
|
4828
4926
|
|
|
4829
4927
|
// src/fn/jst.ts
|
|
4830
|
-
var jst_def =
|
|
4831
|
-
fn:
|
|
4928
|
+
var jst_def = z45.object({
|
|
4929
|
+
fn: z45.string(),
|
|
4832
4930
|
p: length35.optional().default("2.2mm"),
|
|
4833
4931
|
id: length35.optional().default("0.70mm"),
|
|
4834
4932
|
pw: length35.optional().default("1.20mm"),
|
|
@@ -4870,16 +4968,16 @@ var jst = (raw_params) => {
|
|
|
4870
4968
|
};
|
|
4871
4969
|
|
|
4872
4970
|
// src/fn/sod110.ts
|
|
4873
|
-
import { z as
|
|
4971
|
+
import { z as z46 } from "zod";
|
|
4874
4972
|
import { length as length36 } from "circuit-json";
|
|
4875
|
-
var sod_def12 =
|
|
4876
|
-
fn:
|
|
4877
|
-
num_pins:
|
|
4878
|
-
w:
|
|
4879
|
-
h:
|
|
4880
|
-
pl:
|
|
4881
|
-
pw:
|
|
4882
|
-
p:
|
|
4973
|
+
var sod_def12 = z46.object({
|
|
4974
|
+
fn: z46.string(),
|
|
4975
|
+
num_pins: z46.literal(2).default(2),
|
|
4976
|
+
w: z46.string().default("3.30mm"),
|
|
4977
|
+
h: z46.string().default("1.70mm"),
|
|
4978
|
+
pl: z46.string().default("0.80mm"),
|
|
4979
|
+
pw: z46.string().default("1mm"),
|
|
4980
|
+
p: z46.string().default("1.90mm")
|
|
4883
4981
|
});
|
|
4884
4982
|
var sod110 = (raw_params) => {
|
|
4885
4983
|
const parameters = sod_def12.parse(raw_params);
|