@tscircuit/footprinter 0.0.278 → 0.0.280
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 +36 -1
- package/dist/index.js +63 -25
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -548,6 +548,11 @@ declare const any_footprinter_def: z.ZodUnion<[z.ZodObject<{
|
|
|
548
548
|
od: z.ZodDefault<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
549
549
|
male: z.ZodOptional<z.ZodBoolean>;
|
|
550
550
|
female: z.ZodOptional<z.ZodBoolean>;
|
|
551
|
+
smd: z.ZodOptional<z.ZodBoolean>;
|
|
552
|
+
surfacemount: z.ZodOptional<z.ZodBoolean>;
|
|
553
|
+
rightangle: z.ZodOptional<z.ZodBoolean>;
|
|
554
|
+
pw: z.ZodDefault<z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>>;
|
|
555
|
+
pl: z.ZodDefault<z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>>;
|
|
551
556
|
pinlabeltextalignleft: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
552
557
|
pinlabeltextaligncenter: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
553
558
|
pinlabeltextalignright: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
@@ -564,6 +569,8 @@ declare const any_footprinter_def: z.ZodUnion<[z.ZodObject<{
|
|
|
564
569
|
id: number;
|
|
565
570
|
od: number;
|
|
566
571
|
nosquareplating: boolean;
|
|
572
|
+
pw: number;
|
|
573
|
+
pl: number;
|
|
567
574
|
pinlabeltextalignleft: boolean;
|
|
568
575
|
pinlabeltextalignright: boolean;
|
|
569
576
|
pinlabelorthogonal: boolean;
|
|
@@ -579,6 +586,9 @@ declare const any_footprinter_def: z.ZodUnion<[z.ZodObject<{
|
|
|
579
586
|
nosilkscreen?: boolean | undefined;
|
|
580
587
|
male?: boolean | undefined;
|
|
581
588
|
female?: boolean | undefined;
|
|
589
|
+
smd?: boolean | undefined;
|
|
590
|
+
surfacemount?: boolean | undefined;
|
|
591
|
+
rightangle?: boolean | undefined;
|
|
582
592
|
}, {
|
|
583
593
|
fn: string;
|
|
584
594
|
norefdes?: boolean | undefined;
|
|
@@ -592,10 +602,15 @@ declare const any_footprinter_def: z.ZodUnion<[z.ZodObject<{
|
|
|
592
602
|
nosquareplating?: boolean | undefined;
|
|
593
603
|
male?: boolean | undefined;
|
|
594
604
|
female?: boolean | undefined;
|
|
605
|
+
pw?: string | number | undefined;
|
|
606
|
+
pl?: string | number | undefined;
|
|
595
607
|
pinlabeltextalignleft?: boolean | undefined;
|
|
596
608
|
pinlabeltextalignright?: boolean | undefined;
|
|
597
609
|
pinlabelorthogonal?: boolean | undefined;
|
|
598
610
|
rows?: string | number | undefined;
|
|
611
|
+
smd?: boolean | undefined;
|
|
612
|
+
surfacemount?: boolean | undefined;
|
|
613
|
+
rightangle?: boolean | undefined;
|
|
599
614
|
pinlabeltextaligncenter?: boolean | undefined;
|
|
600
615
|
pinlabelverticallyinverted?: boolean | undefined;
|
|
601
616
|
nopinlabels?: boolean | undefined;
|
|
@@ -605,12 +620,16 @@ declare const any_footprinter_def: z.ZodUnion<[z.ZodObject<{
|
|
|
605
620
|
pinlabelAnchorSide: "top" | "bottom" | "left" | "right";
|
|
606
621
|
male: boolean;
|
|
607
622
|
female: boolean;
|
|
623
|
+
smd: boolean;
|
|
624
|
+
rightangle: boolean;
|
|
608
625
|
fn: string;
|
|
609
626
|
num_pins: number;
|
|
610
627
|
p: number;
|
|
611
628
|
id: number;
|
|
612
629
|
od: number;
|
|
613
630
|
nosquareplating: boolean;
|
|
631
|
+
pw: number;
|
|
632
|
+
pl: number;
|
|
614
633
|
pinlabeltextalignleft: boolean;
|
|
615
634
|
pinlabeltextalignright: boolean;
|
|
616
635
|
pinlabelorthogonal: boolean;
|
|
@@ -624,6 +643,7 @@ declare const any_footprinter_def: z.ZodUnion<[z.ZodObject<{
|
|
|
624
643
|
invert?: boolean | undefined;
|
|
625
644
|
faceup?: boolean | undefined;
|
|
626
645
|
nosilkscreen?: boolean | undefined;
|
|
646
|
+
surfacemount?: boolean | undefined;
|
|
627
647
|
}, {
|
|
628
648
|
fn: string;
|
|
629
649
|
norefdes?: boolean | undefined;
|
|
@@ -637,10 +657,15 @@ declare const any_footprinter_def: z.ZodUnion<[z.ZodObject<{
|
|
|
637
657
|
nosquareplating?: boolean | undefined;
|
|
638
658
|
male?: boolean | undefined;
|
|
639
659
|
female?: boolean | undefined;
|
|
660
|
+
pw?: string | number | undefined;
|
|
661
|
+
pl?: string | number | undefined;
|
|
640
662
|
pinlabeltextalignleft?: boolean | undefined;
|
|
641
663
|
pinlabeltextalignright?: boolean | undefined;
|
|
642
664
|
pinlabelorthogonal?: boolean | undefined;
|
|
643
665
|
rows?: string | number | undefined;
|
|
666
|
+
smd?: boolean | undefined;
|
|
667
|
+
surfacemount?: boolean | undefined;
|
|
668
|
+
rightangle?: boolean | undefined;
|
|
644
669
|
pinlabeltextaligncenter?: boolean | undefined;
|
|
645
670
|
pinlabelverticallyinverted?: boolean | undefined;
|
|
646
671
|
nopinlabels?: boolean | undefined;
|
|
@@ -650,12 +675,16 @@ declare const any_footprinter_def: z.ZodUnion<[z.ZodObject<{
|
|
|
650
675
|
pinlabelAnchorSide: "top" | "bottom" | "left" | "right";
|
|
651
676
|
male: boolean;
|
|
652
677
|
female: boolean;
|
|
678
|
+
smd: boolean;
|
|
679
|
+
rightangle: boolean;
|
|
653
680
|
fn: string;
|
|
654
681
|
num_pins: number;
|
|
655
682
|
p: number;
|
|
656
683
|
id: number;
|
|
657
684
|
od: number;
|
|
658
685
|
nosquareplating: boolean;
|
|
686
|
+
pw: number;
|
|
687
|
+
pl: number;
|
|
659
688
|
pinlabeltextalignleft: boolean;
|
|
660
689
|
pinlabeltextalignright: boolean;
|
|
661
690
|
pinlabelorthogonal: boolean;
|
|
@@ -669,6 +698,7 @@ declare const any_footprinter_def: z.ZodUnion<[z.ZodObject<{
|
|
|
669
698
|
invert?: boolean | undefined;
|
|
670
699
|
faceup?: boolean | undefined;
|
|
671
700
|
nosilkscreen?: boolean | undefined;
|
|
701
|
+
surfacemount?: boolean | undefined;
|
|
672
702
|
}, {
|
|
673
703
|
fn: string;
|
|
674
704
|
norefdes?: boolean | undefined;
|
|
@@ -682,10 +712,15 @@ declare const any_footprinter_def: z.ZodUnion<[z.ZodObject<{
|
|
|
682
712
|
nosquareplating?: boolean | undefined;
|
|
683
713
|
male?: boolean | undefined;
|
|
684
714
|
female?: boolean | undefined;
|
|
715
|
+
pw?: string | number | undefined;
|
|
716
|
+
pl?: string | number | undefined;
|
|
685
717
|
pinlabeltextalignleft?: boolean | undefined;
|
|
686
718
|
pinlabeltextalignright?: boolean | undefined;
|
|
687
719
|
pinlabelorthogonal?: boolean | undefined;
|
|
688
720
|
rows?: string | number | undefined;
|
|
721
|
+
smd?: boolean | undefined;
|
|
722
|
+
surfacemount?: boolean | undefined;
|
|
723
|
+
rightangle?: boolean | undefined;
|
|
689
724
|
pinlabeltextaligncenter?: boolean | undefined;
|
|
690
725
|
pinlabelverticallyinverted?: boolean | undefined;
|
|
691
726
|
nopinlabels?: boolean | undefined;
|
|
@@ -1793,7 +1828,7 @@ type Footprinter = {
|
|
|
1793
1828
|
ssop: (num_pins?: number) => FootprinterParamsBuilder<"w" | "p">;
|
|
1794
1829
|
tssop: (num_pins?: number) => FootprinterParamsBuilder<"w" | "p">;
|
|
1795
1830
|
dfn: (num_pins?: number) => FootprinterParamsBuilder<"w" | "p">;
|
|
1796
|
-
pinrow: (num_pins?: number) => FootprinterParamsBuilder<"p" | "id" | "od" | "male" | "female" | "rows" | "pinlabeltextalignleft" | "pinlabeltextaligncenter" | "pinlabeltextalignright" | "pinlabelverticallyinverted" | "pinlabelorthogonal" | "nosquareplating" | "nopinlabels" | "doublesidedpinlabel" | "bottomsidepinlabel">;
|
|
1831
|
+
pinrow: (num_pins?: number) => FootprinterParamsBuilder<"p" | "id" | "od" | "male" | "female" | "rows" | "smd" | "surfacemount" | "rightangle" | "pw" | "pl" | "pinlabeltextalignleft" | "pinlabeltextaligncenter" | "pinlabeltextalignright" | "pinlabelverticallyinverted" | "pinlabelorthogonal" | "nosquareplating" | "nopinlabels" | "doublesidedpinlabel" | "bottomsidepinlabel">;
|
|
1797
1832
|
axial: () => FootprinterParamsBuilder<"p" | "id" | "od">;
|
|
1798
1833
|
hc49: () => FootprinterParamsBuilder<"p" | "id" | "od" | "w" | "h">;
|
|
1799
1834
|
to220: () => FootprinterParamsBuilder<"w" | "h" | "p" | "id" | "od">;
|
package/dist/index.js
CHANGED
|
@@ -1858,6 +1858,11 @@ var pinrow_def = base_def.extend({
|
|
|
1858
1858
|
od: length6.default("1.5mm").describe("outer diameter"),
|
|
1859
1859
|
male: z14.boolean().optional().describe("for male pin headers"),
|
|
1860
1860
|
female: z14.boolean().optional().describe("for female pin headers"),
|
|
1861
|
+
smd: z14.boolean().optional().describe("surface mount device"),
|
|
1862
|
+
surfacemount: z14.boolean().optional().describe("surface mount device (verbose)"),
|
|
1863
|
+
rightangle: z14.boolean().optional().describe("right angle"),
|
|
1864
|
+
pw: length6.optional().default("1.0mm").describe("pad width for SMD"),
|
|
1865
|
+
pl: length6.optional().default("2.0mm").describe("pad length for SMD"),
|
|
1861
1866
|
pinlabeltextalignleft: z14.boolean().optional().default(false),
|
|
1862
1867
|
pinlabeltextaligncenter: z14.boolean().optional().default(false),
|
|
1863
1868
|
pinlabeltextalignright: z14.boolean().optional().default(false),
|
|
@@ -1874,8 +1879,10 @@ var pinrow_def = base_def.extend({
|
|
|
1874
1879
|
return {
|
|
1875
1880
|
...data,
|
|
1876
1881
|
pinlabelAnchorSide,
|
|
1877
|
-
male: data.male ??
|
|
1878
|
-
female: data.female ?? false
|
|
1882
|
+
male: data.male ?? !data.female,
|
|
1883
|
+
female: data.female ?? false,
|
|
1884
|
+
smd: data.smd ?? data.surfacemount ?? false,
|
|
1885
|
+
rightangle: data.rightangle ?? false
|
|
1879
1886
|
};
|
|
1880
1887
|
}).superRefine((data, ctx) => {
|
|
1881
1888
|
if (data.male && data.female) {
|
|
@@ -1913,37 +1920,68 @@ var pinrow = (raw_params) => {
|
|
|
1913
1920
|
xoff,
|
|
1914
1921
|
yoff,
|
|
1915
1922
|
od: od2,
|
|
1916
|
-
anchorSide
|
|
1923
|
+
anchorSide,
|
|
1924
|
+
smd,
|
|
1925
|
+
pw,
|
|
1926
|
+
pl
|
|
1917
1927
|
}) => {
|
|
1918
|
-
let dx = 0
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1928
|
+
let dx = 0;
|
|
1929
|
+
let dy = 0;
|
|
1930
|
+
if (smd) {
|
|
1931
|
+
const offset = od2 / 5;
|
|
1932
|
+
switch (anchorSide) {
|
|
1933
|
+
case "right":
|
|
1934
|
+
dx = pw / 2 + offset;
|
|
1935
|
+
break;
|
|
1936
|
+
case "top":
|
|
1937
|
+
dy = pl / 2 + offset;
|
|
1938
|
+
break;
|
|
1939
|
+
case "bottom":
|
|
1940
|
+
dy = -(pl / 2 + offset);
|
|
1941
|
+
break;
|
|
1942
|
+
case "left":
|
|
1943
|
+
dx = -(pw / 2 + offset);
|
|
1944
|
+
break;
|
|
1945
|
+
}
|
|
1946
|
+
} else {
|
|
1947
|
+
const offset = od2 * 0.75;
|
|
1948
|
+
switch (anchorSide) {
|
|
1949
|
+
case "right":
|
|
1950
|
+
dx = offset;
|
|
1951
|
+
break;
|
|
1952
|
+
case "top":
|
|
1953
|
+
dy = offset;
|
|
1954
|
+
break;
|
|
1955
|
+
case "bottom":
|
|
1956
|
+
dy = -offset;
|
|
1957
|
+
break;
|
|
1958
|
+
case "left":
|
|
1959
|
+
dx = -offset;
|
|
1960
|
+
break;
|
|
1961
|
+
}
|
|
1933
1962
|
}
|
|
1934
1963
|
return { anchor_x: xoff + dx, anchor_y: yoff + dy };
|
|
1935
1964
|
};
|
|
1936
1965
|
const addPin = (pinNumber, xoff, yoff) => {
|
|
1937
|
-
if (
|
|
1938
|
-
holes.push(
|
|
1966
|
+
if (parameters.smd) {
|
|
1967
|
+
holes.push(rectpad(pinNumber, xoff, yoff, parameters.pw, parameters.pl));
|
|
1939
1968
|
} else {
|
|
1940
|
-
|
|
1969
|
+
if (pinNumber === 1 && !parameters.nosquareplating) {
|
|
1970
|
+
holes.push(
|
|
1971
|
+
platedHoleWithRectPad(pinNumber, xoff, yoff, id, od, od, 0, 0)
|
|
1972
|
+
);
|
|
1973
|
+
} else {
|
|
1974
|
+
holes.push(platedhole(pinNumber, xoff, yoff, id, od));
|
|
1975
|
+
}
|
|
1941
1976
|
}
|
|
1942
1977
|
const { anchor_x, anchor_y } = calculateAnchorPosition({
|
|
1943
1978
|
xoff,
|
|
1944
1979
|
yoff,
|
|
1945
1980
|
od,
|
|
1946
|
-
anchorSide: pinlabelAnchorSide
|
|
1981
|
+
anchorSide: pinlabelAnchorSide,
|
|
1982
|
+
smd: parameters.smd,
|
|
1983
|
+
pw: parameters.pw,
|
|
1984
|
+
pl: parameters.pl
|
|
1947
1985
|
});
|
|
1948
1986
|
if (!nopinlabels) {
|
|
1949
1987
|
if (!bottomsidepinlabel) {
|
|
@@ -7513,9 +7551,9 @@ var sot343_def = base_def.extend({
|
|
|
7513
7551
|
num_pins: z66.number().default(4),
|
|
7514
7552
|
w: z66.string().default("3.2mm"),
|
|
7515
7553
|
h: z66.string().default("2.6mm"),
|
|
7516
|
-
pl: z66.string().default("
|
|
7517
|
-
pw: z66.string().default("0.
|
|
7518
|
-
p: z66.string().default("0.
|
|
7554
|
+
pl: z66.string().default("1.35mm"),
|
|
7555
|
+
pw: z66.string().default("0.50mm"),
|
|
7556
|
+
p: z66.string().default("0.6mm"),
|
|
7519
7557
|
string: z66.string().optional()
|
|
7520
7558
|
});
|
|
7521
7559
|
var sot343 = (raw_params) => {
|