@tscircuit/footprinter 0.0.139 → 0.0.140
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 -1
- package/dist/index.js +224 -96
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1015,7 +1015,7 @@ type Footprinter = {
|
|
|
1015
1015
|
sot563: () => FootprinterParamsBuilder<"w" | "p" | "pl" | "pw">;
|
|
1016
1016
|
sot723: () => FootprinterParamsBuilder<"w" | "h" | "pl" | "pw">;
|
|
1017
1017
|
sot23: () => FootprinterParamsBuilder<"w" | "h" | "pl" | "pw">;
|
|
1018
|
-
sot89: () => FootprinterParamsBuilder<"w" | "p" | "pl">;
|
|
1018
|
+
sot89: () => FootprinterParamsBuilder<"w" | "p" | "pl" | "pw" | "h">;
|
|
1019
1019
|
smc: () => FootprinterParamsBuilder<"w" | "h" | "p" | "pw" | "pl">;
|
|
1020
1020
|
minimelf: () => FootprinterParamsBuilder<"w" | "h" | "p" | "pw" | "pl">;
|
|
1021
1021
|
melf: () => FootprinterParamsBuilder<"w" | "h" | "p" | "pw" | "pl">;
|
package/dist/index.js
CHANGED
|
@@ -52,6 +52,7 @@ __export(fn_exports, {
|
|
|
52
52
|
sot363: () => sot363,
|
|
53
53
|
sot563: () => sot563,
|
|
54
54
|
sot723: () => sot723,
|
|
55
|
+
sot89: () => sot89,
|
|
55
56
|
ssop: () => ssop,
|
|
56
57
|
stampboard: () => stampboard,
|
|
57
58
|
stampreceiver: () => stampreceiver,
|
|
@@ -3516,20 +3517,147 @@ var sodWithoutParsing10 = (parameters) => {
|
|
|
3516
3517
|
return pads;
|
|
3517
3518
|
};
|
|
3518
3519
|
|
|
3520
|
+
// src/fn/sot89.ts
|
|
3521
|
+
import { z as z31 } from "zod";
|
|
3522
|
+
var sot89_def = z31.object({
|
|
3523
|
+
fn: z31.string(),
|
|
3524
|
+
num_pins: z31.union([z31.literal(3), z31.literal(5)]).default(3),
|
|
3525
|
+
w: z31.string().default("4.80mm"),
|
|
3526
|
+
h: z31.string().default("4.80mm"),
|
|
3527
|
+
pl: z31.string().default("1.3mm"),
|
|
3528
|
+
pw: z31.string().default("0.9mm"),
|
|
3529
|
+
p: z31.string().default("1.5mm"),
|
|
3530
|
+
string: z31.string().optional()
|
|
3531
|
+
});
|
|
3532
|
+
var sot89_3 = (parameters) => {
|
|
3533
|
+
const pads = [];
|
|
3534
|
+
const padGap = Number.parseFloat(parameters.p);
|
|
3535
|
+
const padWidth = Number.parseFloat(parameters.pw);
|
|
3536
|
+
const length35 = Number.parseFloat(parameters.w);
|
|
3537
|
+
const padHeight = Number.parseFloat(parameters.pl);
|
|
3538
|
+
pads.push(
|
|
3539
|
+
rectpad(1, -length35 / 2, padGap, padHeight, padWidth),
|
|
3540
|
+
rectpad(2, -length35 / 2 + (1.5 - 1.3) / 2, 0, 1.5, padWidth),
|
|
3541
|
+
rectpad(3, -length35 / 2, -padGap, padHeight, padWidth)
|
|
3542
|
+
);
|
|
3543
|
+
const silkscreenRefText = silkscreenRef(0, 0, 0.3);
|
|
3544
|
+
const width = Number.parseFloat(parameters.w) / 2 - 1;
|
|
3545
|
+
const height = Number.parseFloat(parameters.h) / 2;
|
|
3546
|
+
const silkscreenPath1 = {
|
|
3547
|
+
layer: "top",
|
|
3548
|
+
pcb_component_id: "",
|
|
3549
|
+
pcb_silkscreen_path_id: "silkscreen_path_1",
|
|
3550
|
+
route: [
|
|
3551
|
+
{ x: -width, y: height },
|
|
3552
|
+
{ x: width, y: height },
|
|
3553
|
+
{ x: width, y: height / 2 + 0.5 }
|
|
3554
|
+
],
|
|
3555
|
+
type: "pcb_silkscreen_path",
|
|
3556
|
+
stroke_width: 0.1
|
|
3557
|
+
};
|
|
3558
|
+
const silkscreenPath2 = {
|
|
3559
|
+
layer: "top",
|
|
3560
|
+
pcb_component_id: "",
|
|
3561
|
+
pcb_silkscreen_path_id: "silkscreen_path_2",
|
|
3562
|
+
route: [
|
|
3563
|
+
{ x: -width, y: -height },
|
|
3564
|
+
{ x: width, y: -height },
|
|
3565
|
+
{ x: width, y: -height / 2 - 0.5 }
|
|
3566
|
+
],
|
|
3567
|
+
type: "pcb_silkscreen_path",
|
|
3568
|
+
stroke_width: 0.1
|
|
3569
|
+
};
|
|
3570
|
+
return [
|
|
3571
|
+
...pads,
|
|
3572
|
+
silkscreenPath1,
|
|
3573
|
+
silkscreenPath2,
|
|
3574
|
+
silkscreenRefText
|
|
3575
|
+
];
|
|
3576
|
+
};
|
|
3577
|
+
var sot89_5 = (parameters) => {
|
|
3578
|
+
const pads = [];
|
|
3579
|
+
const padGap = Number.parseFloat(parameters.p);
|
|
3580
|
+
const padWidth = Number.parseFloat(parameters.pw);
|
|
3581
|
+
const length35 = Number.parseFloat(parameters.w);
|
|
3582
|
+
pads.push(
|
|
3583
|
+
rectpad(1, -1.85, -1.5, 1.5, 0.7),
|
|
3584
|
+
rectpad(2, -1.85, 1.5, 1.5, 0.7),
|
|
3585
|
+
rectpad(3, 0, 0, 0.8, 2),
|
|
3586
|
+
rectpad(4, 1.85, -1.5, 1.5, 0.7),
|
|
3587
|
+
rectpad(5, 1.85, 1.5, 1.5, 0.7)
|
|
3588
|
+
);
|
|
3589
|
+
const silkscreenRefText = silkscreenRef(
|
|
3590
|
+
0,
|
|
3591
|
+
Number.parseFloat(parameters.h) / 2 + 0.5,
|
|
3592
|
+
0.3
|
|
3593
|
+
);
|
|
3594
|
+
const width = Number.parseFloat(parameters.w) / 2 - 1;
|
|
3595
|
+
const height = Number.parseFloat(parameters.h) / 2;
|
|
3596
|
+
const silkscreenPath1 = {
|
|
3597
|
+
layer: "top",
|
|
3598
|
+
pcb_component_id: "",
|
|
3599
|
+
pcb_silkscreen_path_id: "silkscreen_path_1",
|
|
3600
|
+
route: [
|
|
3601
|
+
{ x: -width, y: height },
|
|
3602
|
+
{ x: width, y: height }
|
|
3603
|
+
],
|
|
3604
|
+
type: "pcb_silkscreen_path",
|
|
3605
|
+
stroke_width: 0.1
|
|
3606
|
+
};
|
|
3607
|
+
const silkscreenPath2 = {
|
|
3608
|
+
layer: "top",
|
|
3609
|
+
pcb_component_id: "",
|
|
3610
|
+
pcb_silkscreen_path_id: "silkscreen_path_2",
|
|
3611
|
+
route: [
|
|
3612
|
+
{ x: -width, y: -height },
|
|
3613
|
+
{ x: width, y: -height }
|
|
3614
|
+
],
|
|
3615
|
+
type: "pcb_silkscreen_path",
|
|
3616
|
+
stroke_width: 0.1
|
|
3617
|
+
};
|
|
3618
|
+
return [
|
|
3619
|
+
...pads,
|
|
3620
|
+
silkscreenPath1,
|
|
3621
|
+
silkscreenPath2,
|
|
3622
|
+
silkscreenRefText
|
|
3623
|
+
];
|
|
3624
|
+
};
|
|
3625
|
+
var sot89 = (raw_params) => {
|
|
3626
|
+
const match = raw_params.string?.match(/^sot89_(\d+)/);
|
|
3627
|
+
const numPins = match ? Number.parseInt(match[1], 10) : 3;
|
|
3628
|
+
const parameters = sot89_def.parse({
|
|
3629
|
+
...raw_params,
|
|
3630
|
+
num_pins: numPins
|
|
3631
|
+
});
|
|
3632
|
+
if (parameters.num_pins === 3) {
|
|
3633
|
+
return {
|
|
3634
|
+
circuitJson: sot89_3(parameters),
|
|
3635
|
+
parameters
|
|
3636
|
+
};
|
|
3637
|
+
}
|
|
3638
|
+
if (parameters.num_pins === 5) {
|
|
3639
|
+
return {
|
|
3640
|
+
circuitJson: sot89_5(parameters),
|
|
3641
|
+
parameters
|
|
3642
|
+
};
|
|
3643
|
+
}
|
|
3644
|
+
throw new Error("Invalid number of pins for SOT89");
|
|
3645
|
+
};
|
|
3646
|
+
|
|
3519
3647
|
// src/fn/to220.ts
|
|
3520
3648
|
import {
|
|
3521
3649
|
length as length25
|
|
3522
3650
|
} from "circuit-json";
|
|
3523
|
-
import { z as
|
|
3524
|
-
var to220_def =
|
|
3525
|
-
fn:
|
|
3651
|
+
import { z as z32 } from "zod";
|
|
3652
|
+
var to220_def = z32.object({
|
|
3653
|
+
fn: z32.string(),
|
|
3526
3654
|
p: length25.optional().default("5.0mm"),
|
|
3527
3655
|
id: length25.optional().default("1.0mm"),
|
|
3528
3656
|
od: length25.optional().default("1.9mm"),
|
|
3529
3657
|
w: length25.optional().default("13mm"),
|
|
3530
3658
|
h: length25.optional().default("7mm"),
|
|
3531
|
-
num_pins:
|
|
3532
|
-
string:
|
|
3659
|
+
num_pins: z32.number().optional(),
|
|
3660
|
+
string: z32.string().optional()
|
|
3533
3661
|
});
|
|
3534
3662
|
var to220 = (raw_params) => {
|
|
3535
3663
|
const parameters = to220_def.parse(raw_params);
|
|
@@ -3609,16 +3737,16 @@ var to220 = (raw_params) => {
|
|
|
3609
3737
|
};
|
|
3610
3738
|
|
|
3611
3739
|
// src/fn/minimelf.ts
|
|
3612
|
-
import { z as
|
|
3740
|
+
import { z as z33 } from "zod";
|
|
3613
3741
|
import { length as length26 } from "circuit-json";
|
|
3614
|
-
var minimelf_def =
|
|
3615
|
-
fn:
|
|
3616
|
-
num_pins:
|
|
3617
|
-
w:
|
|
3618
|
-
h:
|
|
3619
|
-
pl:
|
|
3620
|
-
pw:
|
|
3621
|
-
p:
|
|
3742
|
+
var minimelf_def = z33.object({
|
|
3743
|
+
fn: z33.string(),
|
|
3744
|
+
num_pins: z33.literal(2).default(2),
|
|
3745
|
+
w: z33.string().default("5.40mm"),
|
|
3746
|
+
h: z33.string().default("2.30mm"),
|
|
3747
|
+
pl: z33.string().default("1.30mm"),
|
|
3748
|
+
pw: z33.string().default("1.70mm"),
|
|
3749
|
+
p: z33.string().default("3.5mm")
|
|
3622
3750
|
});
|
|
3623
3751
|
var minimelf = (raw_params) => {
|
|
3624
3752
|
const parameters = minimelf_def.parse(raw_params);
|
|
@@ -3685,16 +3813,16 @@ var miniMelfWithoutParsing = (parameters) => {
|
|
|
3685
3813
|
};
|
|
3686
3814
|
|
|
3687
3815
|
// src/fn/sod882d.ts
|
|
3688
|
-
import { z as
|
|
3816
|
+
import { z as z34 } from "zod";
|
|
3689
3817
|
import { length as length27 } from "circuit-json";
|
|
3690
|
-
var sod_def11 =
|
|
3691
|
-
fn:
|
|
3692
|
-
num_pins:
|
|
3693
|
-
w:
|
|
3694
|
-
h:
|
|
3695
|
-
pl:
|
|
3696
|
-
pw:
|
|
3697
|
-
p:
|
|
3818
|
+
var sod_def11 = z34.object({
|
|
3819
|
+
fn: z34.string(),
|
|
3820
|
+
num_pins: z34.literal(2).default(2),
|
|
3821
|
+
w: z34.string().default("1.90mm"),
|
|
3822
|
+
h: z34.string().default("1.33mm"),
|
|
3823
|
+
pl: z34.string().default("0.5mm"),
|
|
3824
|
+
pw: z34.string().default("0.7mm"),
|
|
3825
|
+
p: z34.string().default("0.8mm")
|
|
3698
3826
|
});
|
|
3699
3827
|
var sod882d = (raw_params) => {
|
|
3700
3828
|
const parameters = sod_def11.parse(raw_params);
|
|
@@ -3765,16 +3893,16 @@ var sodWithoutParsing11 = (parameters) => {
|
|
|
3765
3893
|
};
|
|
3766
3894
|
|
|
3767
3895
|
// src/fn/melf.ts
|
|
3768
|
-
import { z as
|
|
3896
|
+
import { z as z35 } from "zod";
|
|
3769
3897
|
import { length as length28 } from "circuit-json";
|
|
3770
|
-
var melf_def =
|
|
3771
|
-
fn:
|
|
3772
|
-
num_pins:
|
|
3773
|
-
w:
|
|
3774
|
-
h:
|
|
3775
|
-
pl:
|
|
3776
|
-
pw:
|
|
3777
|
-
p:
|
|
3898
|
+
var melf_def = z35.object({
|
|
3899
|
+
fn: z35.string(),
|
|
3900
|
+
num_pins: z35.literal(2).default(2),
|
|
3901
|
+
w: z35.string().default("7.0mm"),
|
|
3902
|
+
h: z35.string().default("3.35mm"),
|
|
3903
|
+
pl: z35.string().default("1.50mm"),
|
|
3904
|
+
pw: z35.string().default("2.70mm"),
|
|
3905
|
+
p: z35.string().default("4.8mm")
|
|
3778
3906
|
});
|
|
3779
3907
|
var melf = (raw_params) => {
|
|
3780
3908
|
const parameters = melf_def.parse(raw_params);
|
|
@@ -3845,16 +3973,16 @@ var melfWithoutParsing = (parameters) => {
|
|
|
3845
3973
|
};
|
|
3846
3974
|
|
|
3847
3975
|
// src/fn/micromelf.ts
|
|
3848
|
-
import { z as
|
|
3976
|
+
import { z as z36 } from "zod";
|
|
3849
3977
|
import { length as length29 } from "circuit-json";
|
|
3850
|
-
var micromelf_def =
|
|
3851
|
-
fn:
|
|
3852
|
-
num_pins:
|
|
3853
|
-
w:
|
|
3854
|
-
h:
|
|
3855
|
-
pl:
|
|
3856
|
-
pw:
|
|
3857
|
-
p:
|
|
3978
|
+
var micromelf_def = z36.object({
|
|
3979
|
+
fn: z36.string(),
|
|
3980
|
+
num_pins: z36.literal(2).default(2),
|
|
3981
|
+
w: z36.string().default("3.0mm"),
|
|
3982
|
+
h: z36.string().default("1.80mm"),
|
|
3983
|
+
pl: z36.string().default("0.80mm"),
|
|
3984
|
+
pw: z36.string().default("1.20mm"),
|
|
3985
|
+
p: z36.string().default("1.6mm")
|
|
3858
3986
|
});
|
|
3859
3987
|
var micromelf = (raw_params) => {
|
|
3860
3988
|
const parameters = micromelf_def.parse(raw_params);
|
|
@@ -3925,16 +4053,16 @@ var microMelfWithoutParsing = (parameters) => {
|
|
|
3925
4053
|
};
|
|
3926
4054
|
|
|
3927
4055
|
// src/fn/sma.ts
|
|
3928
|
-
import { z as
|
|
4056
|
+
import { z as z37 } from "zod";
|
|
3929
4057
|
import { length as length30 } from "circuit-json";
|
|
3930
|
-
var sma_def =
|
|
3931
|
-
fn:
|
|
3932
|
-
num_pins:
|
|
3933
|
-
w:
|
|
3934
|
-
h:
|
|
3935
|
-
pl:
|
|
3936
|
-
pw:
|
|
3937
|
-
p:
|
|
4058
|
+
var sma_def = z37.object({
|
|
4059
|
+
fn: z37.string(),
|
|
4060
|
+
num_pins: z37.literal(2).default(2),
|
|
4061
|
+
w: z37.string().default("7.10mm"),
|
|
4062
|
+
h: z37.string().default("3.40mm"),
|
|
4063
|
+
pl: z37.string().default("2.45mm"),
|
|
4064
|
+
pw: z37.string().default("1.80mm"),
|
|
4065
|
+
p: z37.string().default("4.05mm")
|
|
3938
4066
|
});
|
|
3939
4067
|
var sma = (raw_params) => {
|
|
3940
4068
|
const parameters = sma_def.parse(raw_params);
|
|
@@ -4004,16 +4132,16 @@ var smaWithoutParsing = (parameters) => {
|
|
|
4004
4132
|
};
|
|
4005
4133
|
|
|
4006
4134
|
// src/fn/smf.ts
|
|
4007
|
-
import { z as
|
|
4135
|
+
import { z as z38 } from "zod";
|
|
4008
4136
|
import { length as length31 } from "circuit-json";
|
|
4009
|
-
var smf_def =
|
|
4010
|
-
fn:
|
|
4011
|
-
num_pins:
|
|
4012
|
-
w:
|
|
4013
|
-
h:
|
|
4014
|
-
pl:
|
|
4015
|
-
pw:
|
|
4016
|
-
p:
|
|
4137
|
+
var smf_def = z38.object({
|
|
4138
|
+
fn: z38.string(),
|
|
4139
|
+
num_pins: z38.literal(2).default(2),
|
|
4140
|
+
w: z38.string().default("4.80mm"),
|
|
4141
|
+
h: z38.string().default("2.10mm"),
|
|
4142
|
+
pl: z38.string().default("1.30mm"),
|
|
4143
|
+
pw: z38.string().default("1.40mm"),
|
|
4144
|
+
p: z38.string().default("2.9mm")
|
|
4017
4145
|
});
|
|
4018
4146
|
var smf = (raw_params) => {
|
|
4019
4147
|
const parameters = smf_def.parse(raw_params);
|
|
@@ -4084,16 +4212,16 @@ var smfWithoutParsing = (parameters) => {
|
|
|
4084
4212
|
};
|
|
4085
4213
|
|
|
4086
4214
|
// src/fn/smb.ts
|
|
4087
|
-
import { z as
|
|
4215
|
+
import { z as z39 } from "zod";
|
|
4088
4216
|
import { length as length32 } from "circuit-json";
|
|
4089
|
-
var smb_def =
|
|
4090
|
-
fn:
|
|
4091
|
-
num_pins:
|
|
4092
|
-
w:
|
|
4093
|
-
h:
|
|
4094
|
-
pl:
|
|
4095
|
-
pw:
|
|
4096
|
-
p:
|
|
4217
|
+
var smb_def = z39.object({
|
|
4218
|
+
fn: z39.string(),
|
|
4219
|
+
num_pins: z39.literal(2).default(2),
|
|
4220
|
+
w: z39.string().default("7.30mm"),
|
|
4221
|
+
h: z39.string().default("4.40mm"),
|
|
4222
|
+
pl: z39.string().default("2.50mm"),
|
|
4223
|
+
pw: z39.string().default("2.30mm"),
|
|
4224
|
+
p: z39.string().default("4.30mm")
|
|
4097
4225
|
});
|
|
4098
4226
|
var smb = (raw_params) => {
|
|
4099
4227
|
const parameters = smb_def.parse(raw_params);
|
|
@@ -4164,16 +4292,16 @@ var smbWithoutParsing = (parameters) => {
|
|
|
4164
4292
|
};
|
|
4165
4293
|
|
|
4166
4294
|
// src/fn/vssop8.ts
|
|
4167
|
-
import { z as
|
|
4295
|
+
import { z as z40 } from "zod";
|
|
4168
4296
|
import { length as length33 } from "circuit-json";
|
|
4169
|
-
var vssop8_def =
|
|
4170
|
-
fn:
|
|
4171
|
-
num_pins:
|
|
4172
|
-
w:
|
|
4173
|
-
h:
|
|
4174
|
-
p:
|
|
4175
|
-
pl:
|
|
4176
|
-
pw:
|
|
4297
|
+
var vssop8_def = z40.object({
|
|
4298
|
+
fn: z40.string(),
|
|
4299
|
+
num_pins: z40.literal(8).default(8),
|
|
4300
|
+
w: z40.string().default("3.06mm"),
|
|
4301
|
+
h: z40.string().default("3.14mm"),
|
|
4302
|
+
p: z40.string().default("0.65mm"),
|
|
4303
|
+
pl: z40.string().default("1.6mm"),
|
|
4304
|
+
pw: z40.string().default("0.5mm")
|
|
4177
4305
|
});
|
|
4178
4306
|
var vssop8 = (raw_params) => {
|
|
4179
4307
|
const parameters = vssop8_def.parse(raw_params);
|
|
@@ -4265,16 +4393,16 @@ var getVssop8Pads = (parameters, pad_spacing) => {
|
|
|
4265
4393
|
};
|
|
4266
4394
|
|
|
4267
4395
|
// src/fn/smc.ts
|
|
4268
|
-
import { z as
|
|
4396
|
+
import { z as z41 } from "zod";
|
|
4269
4397
|
import { length as length34 } from "circuit-json";
|
|
4270
|
-
var smc_def =
|
|
4271
|
-
fn:
|
|
4272
|
-
num_pins:
|
|
4273
|
-
w:
|
|
4274
|
-
h:
|
|
4275
|
-
pl:
|
|
4276
|
-
pw:
|
|
4277
|
-
p:
|
|
4398
|
+
var smc_def = z41.object({
|
|
4399
|
+
fn: z41.string(),
|
|
4400
|
+
num_pins: z41.literal(2).default(2),
|
|
4401
|
+
w: z41.string().default("10.70mm"),
|
|
4402
|
+
h: z41.string().default("6.60mm"),
|
|
4403
|
+
pl: z41.string().default("3.30mm"),
|
|
4404
|
+
pw: z41.string().default("2.50mm"),
|
|
4405
|
+
p: z41.string().default("6.80mm")
|
|
4278
4406
|
});
|
|
4279
4407
|
var smc = (raw_params) => {
|
|
4280
4408
|
const parameters = smc_def.parse(raw_params);
|
|
@@ -4340,16 +4468,16 @@ var smcWithoutParsing = (parameters) => {
|
|
|
4340
4468
|
};
|
|
4341
4469
|
|
|
4342
4470
|
// src/fn/sot223.ts
|
|
4343
|
-
import { z as
|
|
4344
|
-
var sot223_def =
|
|
4345
|
-
fn:
|
|
4346
|
-
num_pins:
|
|
4347
|
-
w:
|
|
4348
|
-
h:
|
|
4349
|
-
pl:
|
|
4350
|
-
pw:
|
|
4351
|
-
p:
|
|
4352
|
-
string:
|
|
4471
|
+
import { z as z42 } from "zod";
|
|
4472
|
+
var sot223_def = z42.object({
|
|
4473
|
+
fn: z42.string(),
|
|
4474
|
+
num_pins: z42.number().default(4),
|
|
4475
|
+
w: z42.string().default("8.50mm"),
|
|
4476
|
+
h: z42.string().default("6.90mm"),
|
|
4477
|
+
pl: z42.string().default("2mm"),
|
|
4478
|
+
pw: z42.string().default("1.5mm"),
|
|
4479
|
+
p: z42.string().default("2.30mm"),
|
|
4480
|
+
string: z42.string().optional()
|
|
4353
4481
|
});
|
|
4354
4482
|
var sot223 = (raw_params) => {
|
|
4355
4483
|
const match = raw_params.string?.match(/^sot223_(\d+)/);
|