@tscircuit/footprinter 0.0.146 → 0.0.148
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 +2 -0
- package/dist/index.js +167 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1016,6 +1016,7 @@ type Footprinter = {
|
|
|
1016
1016
|
sot723: () => FootprinterParamsBuilder<"w" | "h" | "pl" | "pw">;
|
|
1017
1017
|
sot23: () => FootprinterParamsBuilder<"w" | "h" | "pl" | "pw">;
|
|
1018
1018
|
sot89: () => FootprinterParamsBuilder<"w" | "p" | "pl" | "pw" | "h">;
|
|
1019
|
+
sod323w: () => FootprinterParamsBuilder<"w" | "h" | "p" | "pl" | "pw">;
|
|
1019
1020
|
smc: () => FootprinterParamsBuilder<"w" | "h" | "p" | "pw" | "pl">;
|
|
1020
1021
|
minimelf: () => FootprinterParamsBuilder<"w" | "h" | "p" | "pw" | "pl">;
|
|
1021
1022
|
melf: () => FootprinterParamsBuilder<"w" | "h" | "p" | "pw" | "pl">;
|
|
@@ -1035,6 +1036,7 @@ type Footprinter = {
|
|
|
1035
1036
|
sod723: () => FootprinterParamsBuilder<"w" | "h" | "p" | "pl" | "pw">;
|
|
1036
1037
|
sod523: () => FootprinterParamsBuilder<"w" | "h" | "p" | "pl" | "pw">;
|
|
1037
1038
|
sod323f: () => FootprinterParamsBuilder<"w" | "h" | "p" | "pl" | "pw">;
|
|
1039
|
+
sod323fl: () => FootprinterParamsBuilder<"w" | "h" | "p" | "pl" | "pw">;
|
|
1038
1040
|
sod128: () => FootprinterParamsBuilder<"w" | "h" | "p" | "pl" | "pw">;
|
|
1039
1041
|
sod123f: () => FootprinterParamsBuilder<"w" | "h" | "p" | "pl" | "pw">;
|
|
1040
1042
|
sod123fl: () => FootprinterParamsBuilder<"w" | "h" | "p" | "pl" | "pw">;
|
package/dist/index.js
CHANGED
|
@@ -44,6 +44,8 @@ __export(fn_exports, {
|
|
|
44
44
|
sod128: () => sod128,
|
|
45
45
|
sod323: () => sod323,
|
|
46
46
|
sod323f: () => sod323f,
|
|
47
|
+
sod323fl: () => sod323fl,
|
|
48
|
+
sod323w: () => sod323w,
|
|
47
49
|
sod523: () => sod523,
|
|
48
50
|
sod723: () => sod723,
|
|
49
51
|
sod882: () => sod882,
|
|
@@ -3619,12 +3621,12 @@ var sot89_3 = (parameters) => {
|
|
|
3619
3621
|
const pads = [];
|
|
3620
3622
|
const padGap = Number.parseFloat(parameters.p);
|
|
3621
3623
|
const padWidth = Number.parseFloat(parameters.pw);
|
|
3622
|
-
const
|
|
3624
|
+
const length41 = Number.parseFloat(parameters.w);
|
|
3623
3625
|
const padHeight = Number.parseFloat(parameters.pl);
|
|
3624
3626
|
pads.push(
|
|
3625
|
-
rectpad(1, -
|
|
3626
|
-
rectpad(2, -
|
|
3627
|
-
rectpad(3, -
|
|
3627
|
+
rectpad(1, -length41 / 2, padGap, padHeight, padWidth),
|
|
3628
|
+
rectpad(2, -length41 / 2 + (1.5 - 1.3) / 2, 0, 1.5, padWidth),
|
|
3629
|
+
rectpad(3, -length41 / 2, -padGap, padHeight, padWidth)
|
|
3628
3630
|
);
|
|
3629
3631
|
const silkscreenRefText = silkscreenRef(0, 0, 0.3);
|
|
3630
3632
|
const width = Number.parseFloat(parameters.w) / 2 - 1;
|
|
@@ -3664,7 +3666,7 @@ var sot89_5 = (parameters) => {
|
|
|
3664
3666
|
const pads = [];
|
|
3665
3667
|
const padGap = Number.parseFloat(parameters.p);
|
|
3666
3668
|
const padWidth = Number.parseFloat(parameters.pw);
|
|
3667
|
-
const
|
|
3669
|
+
const length41 = Number.parseFloat(parameters.w);
|
|
3668
3670
|
pads.push(
|
|
3669
3671
|
rectpad(1, -1.85, -1.5, 1.5, 0.7),
|
|
3670
3672
|
rectpad(2, -1.85, 1.5, 1.5, 0.7),
|
|
@@ -5264,6 +5266,166 @@ var msop = (raw_params) => {
|
|
|
5264
5266
|
};
|
|
5265
5267
|
};
|
|
5266
5268
|
|
|
5269
|
+
// src/fn/sod323w.ts
|
|
5270
|
+
import { z as z49 } from "zod";
|
|
5271
|
+
import { length as length39 } from "circuit-json";
|
|
5272
|
+
var sod323w_def = z49.object({
|
|
5273
|
+
fn: z49.string(),
|
|
5274
|
+
num_pins: z49.literal(2).default(2),
|
|
5275
|
+
w: z49.string().default("3.8mm"),
|
|
5276
|
+
h: z49.string().default("1.65mm"),
|
|
5277
|
+
pl: z49.string().default("1.2mm"),
|
|
5278
|
+
pw: z49.string().default("1.2mm"),
|
|
5279
|
+
pad_spacing: z49.string().default("2.6mm")
|
|
5280
|
+
});
|
|
5281
|
+
var sod323w = (raw_params) => {
|
|
5282
|
+
const parameters = sod323w_def.parse(raw_params);
|
|
5283
|
+
const silkscreenRefText = silkscreenRef(
|
|
5284
|
+
0,
|
|
5285
|
+
length39.parse(parameters.h),
|
|
5286
|
+
0.3
|
|
5287
|
+
);
|
|
5288
|
+
const silkscreenLine = {
|
|
5289
|
+
type: "pcb_silkscreen_path",
|
|
5290
|
+
layer: "top",
|
|
5291
|
+
pcb_component_id: "",
|
|
5292
|
+
route: [
|
|
5293
|
+
{
|
|
5294
|
+
x: length39.parse(parameters.pad_spacing) / 2,
|
|
5295
|
+
y: length39.parse(parameters.h) / 2
|
|
5296
|
+
},
|
|
5297
|
+
{
|
|
5298
|
+
x: -length39.parse(parameters.w) / 2 - 0.2,
|
|
5299
|
+
y: length39.parse(parameters.h) / 2
|
|
5300
|
+
},
|
|
5301
|
+
{
|
|
5302
|
+
x: -length39.parse(parameters.w) / 2 - 0.2,
|
|
5303
|
+
y: -length39.parse(parameters.h) / 2
|
|
5304
|
+
},
|
|
5305
|
+
{
|
|
5306
|
+
x: length39.parse(parameters.pad_spacing) / 2,
|
|
5307
|
+
y: -length39.parse(parameters.h) / 2
|
|
5308
|
+
}
|
|
5309
|
+
],
|
|
5310
|
+
stroke_width: 0.1,
|
|
5311
|
+
pcb_silkscreen_path_id: ""
|
|
5312
|
+
};
|
|
5313
|
+
return {
|
|
5314
|
+
circuitJson: sodWithoutParsing14(parameters).concat(
|
|
5315
|
+
silkscreenLine,
|
|
5316
|
+
silkscreenRefText
|
|
5317
|
+
),
|
|
5318
|
+
parameters
|
|
5319
|
+
};
|
|
5320
|
+
};
|
|
5321
|
+
var getSodCoords14 = (parameters) => {
|
|
5322
|
+
const { pn, pad_spacing } = parameters;
|
|
5323
|
+
if (pn === 1) {
|
|
5324
|
+
return { x: -pad_spacing / 2, y: 0 };
|
|
5325
|
+
} else {
|
|
5326
|
+
return { x: pad_spacing / 2, y: 0 };
|
|
5327
|
+
}
|
|
5328
|
+
};
|
|
5329
|
+
var sodWithoutParsing14 = (parameters) => {
|
|
5330
|
+
const pads = [];
|
|
5331
|
+
for (let i = 1; i <= parameters.num_pins; i++) {
|
|
5332
|
+
const { x, y } = getSodCoords14({
|
|
5333
|
+
pn: i,
|
|
5334
|
+
pad_spacing: Number.parseFloat(parameters.pad_spacing)
|
|
5335
|
+
});
|
|
5336
|
+
pads.push(
|
|
5337
|
+
rectpad(
|
|
5338
|
+
i,
|
|
5339
|
+
x,
|
|
5340
|
+
y,
|
|
5341
|
+
Number.parseFloat(parameters.pl),
|
|
5342
|
+
Number.parseFloat(parameters.pw)
|
|
5343
|
+
)
|
|
5344
|
+
);
|
|
5345
|
+
}
|
|
5346
|
+
return pads;
|
|
5347
|
+
};
|
|
5348
|
+
|
|
5349
|
+
// src/fn/sod323fl.ts
|
|
5350
|
+
import { z as z50 } from "zod";
|
|
5351
|
+
import { length as length40 } from "circuit-json";
|
|
5352
|
+
var sod323FL_def = z50.object({
|
|
5353
|
+
fn: z50.string(),
|
|
5354
|
+
num_pins: z50.literal(2).default(2),
|
|
5355
|
+
w: z50.string().default("3.20mm"),
|
|
5356
|
+
h: z50.string().default("1.65mm"),
|
|
5357
|
+
pl: z50.string().default("0.8mm"),
|
|
5358
|
+
pw: z50.string().default("0.9mm"),
|
|
5359
|
+
pad_spacing: z50.string().default("2.1mm")
|
|
5360
|
+
});
|
|
5361
|
+
var sod323fl = (raw_params) => {
|
|
5362
|
+
const parameters = sod323FL_def.parse(raw_params);
|
|
5363
|
+
const silkscreenRefText = silkscreenRef(
|
|
5364
|
+
0,
|
|
5365
|
+
length40.parse(parameters.h),
|
|
5366
|
+
0.3
|
|
5367
|
+
);
|
|
5368
|
+
const silkscreenLine = {
|
|
5369
|
+
type: "pcb_silkscreen_path",
|
|
5370
|
+
layer: "top",
|
|
5371
|
+
pcb_component_id: "",
|
|
5372
|
+
route: [
|
|
5373
|
+
{
|
|
5374
|
+
x: length40.parse(parameters.pad_spacing) / 2,
|
|
5375
|
+
y: length40.parse(parameters.h) / 2
|
|
5376
|
+
},
|
|
5377
|
+
{
|
|
5378
|
+
x: -length40.parse(parameters.w) / 2 - 0.2,
|
|
5379
|
+
y: length40.parse(parameters.h) / 2
|
|
5380
|
+
},
|
|
5381
|
+
{
|
|
5382
|
+
x: -length40.parse(parameters.w) / 2 - 0.2,
|
|
5383
|
+
y: -length40.parse(parameters.h) / 2
|
|
5384
|
+
},
|
|
5385
|
+
{
|
|
5386
|
+
x: length40.parse(parameters.pad_spacing) / 2,
|
|
5387
|
+
y: -length40.parse(parameters.h) / 2
|
|
5388
|
+
}
|
|
5389
|
+
],
|
|
5390
|
+
stroke_width: 0.1,
|
|
5391
|
+
pcb_silkscreen_path_id: ""
|
|
5392
|
+
};
|
|
5393
|
+
return {
|
|
5394
|
+
circuitJson: sodWithoutParsing15(parameters).concat(
|
|
5395
|
+
silkscreenLine,
|
|
5396
|
+
silkscreenRefText
|
|
5397
|
+
),
|
|
5398
|
+
parameters
|
|
5399
|
+
};
|
|
5400
|
+
};
|
|
5401
|
+
var getSodCoords15 = (parameters) => {
|
|
5402
|
+
const { pn, pad_spacing } = parameters;
|
|
5403
|
+
if (pn === 1) {
|
|
5404
|
+
return { x: -pad_spacing / 2, y: 0 };
|
|
5405
|
+
} else {
|
|
5406
|
+
return { x: pad_spacing / 2, y: 0 };
|
|
5407
|
+
}
|
|
5408
|
+
};
|
|
5409
|
+
var sodWithoutParsing15 = (parameters) => {
|
|
5410
|
+
const pads = [];
|
|
5411
|
+
for (let i = 1; i <= parameters.num_pins; i++) {
|
|
5412
|
+
const { x, y } = getSodCoords15({
|
|
5413
|
+
pn: i,
|
|
5414
|
+
pad_spacing: Number.parseFloat(parameters.pad_spacing)
|
|
5415
|
+
});
|
|
5416
|
+
pads.push(
|
|
5417
|
+
rectpad(
|
|
5418
|
+
i,
|
|
5419
|
+
x,
|
|
5420
|
+
y,
|
|
5421
|
+
Number.parseFloat(parameters.pl),
|
|
5422
|
+
Number.parseFloat(parameters.pw)
|
|
5423
|
+
)
|
|
5424
|
+
);
|
|
5425
|
+
}
|
|
5426
|
+
return pads;
|
|
5427
|
+
};
|
|
5428
|
+
|
|
5267
5429
|
// src/helpers/is-not-null.ts
|
|
5268
5430
|
function isNotNull(value) {
|
|
5269
5431
|
return value !== null;
|