@tscircuit/footprinter 0.0.314 → 0.0.316
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.js +34 -44
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4891,9 +4891,9 @@ var sod_def8 = base_def.extend({
|
|
|
4891
4891
|
num_pins: z43.literal(2).default(2),
|
|
4892
4892
|
w: z43.string().default("4.4mm"),
|
|
4893
4893
|
h: z43.string().default("2.1mm"),
|
|
4894
|
-
pl: z43.string().default("1.
|
|
4895
|
-
pw: z43.string().default("1.
|
|
4896
|
-
p: z43.string().default("2.
|
|
4894
|
+
pl: z43.string().default("1.10mm"),
|
|
4895
|
+
pw: z43.string().default("1.10mm"),
|
|
4896
|
+
p: z43.string().default("2.8mm")
|
|
4897
4897
|
});
|
|
4898
4898
|
var sod123f = (raw_params) => {
|
|
4899
4899
|
const parameters = sod_def8.parse(raw_params);
|
|
@@ -6494,13 +6494,7 @@ var jst_def = base_def.extend({
|
|
|
6494
6494
|
pl: length47.optional(),
|
|
6495
6495
|
w: length47.optional(),
|
|
6496
6496
|
h: length47.optional(),
|
|
6497
|
-
sh: z60.
|
|
6498
|
-
if (typeof v === "string") {
|
|
6499
|
-
const n = Number(v);
|
|
6500
|
-
return Number.isNaN(n) ? true : n;
|
|
6501
|
-
}
|
|
6502
|
-
return v;
|
|
6503
|
-
}).describe(
|
|
6497
|
+
sh: z60.boolean().optional().describe(
|
|
6504
6498
|
'JST SH (Surface-mount) connector family. SH stands for "Super High-density".'
|
|
6505
6499
|
),
|
|
6506
6500
|
ph: z60.boolean().optional().describe(
|
|
@@ -6533,36 +6527,27 @@ function getVariant(params) {
|
|
|
6533
6527
|
function generatePads(variant, numPins, p, id, pw, pl) {
|
|
6534
6528
|
const pads = [];
|
|
6535
6529
|
if (variant === "ph") {
|
|
6536
|
-
const
|
|
6537
|
-
|
|
6538
|
-
|
|
6539
|
-
|
|
6540
|
-
|
|
6541
|
-
|
|
6542
|
-
|
|
6543
|
-
|
|
6544
|
-
|
|
6545
|
-
|
|
6546
|
-
|
|
6547
|
-
|
|
6548
|
-
|
|
6549
|
-
|
|
6550
|
-
x: half_p,
|
|
6551
|
-
y: 2,
|
|
6552
|
-
holeDiameter: id,
|
|
6553
|
-
rectPadWidth: pw,
|
|
6554
|
-
rectPadHeight: pl
|
|
6555
|
-
})
|
|
6556
|
-
);
|
|
6530
|
+
const startX = -((numPins - 1) / 2) * p;
|
|
6531
|
+
for (let i = 0; i < numPins; i++) {
|
|
6532
|
+
const x = startX + i * p;
|
|
6533
|
+
pads.push(
|
|
6534
|
+
platedHoleWithRectPad({
|
|
6535
|
+
pn: i + 1,
|
|
6536
|
+
x,
|
|
6537
|
+
y: 2,
|
|
6538
|
+
holeDiameter: id,
|
|
6539
|
+
rectPadWidth: pw,
|
|
6540
|
+
rectPadHeight: pl
|
|
6541
|
+
})
|
|
6542
|
+
);
|
|
6543
|
+
}
|
|
6557
6544
|
} else {
|
|
6558
6545
|
const startX = -((numPins - 1) / 2) * p;
|
|
6559
6546
|
for (let i = 0; i < numPins; i++) {
|
|
6560
6547
|
const x = startX + i * p;
|
|
6561
|
-
console.log("x si", x);
|
|
6562
6548
|
pads.push(rectpad(i + 1, x, -1.325, pw, pl));
|
|
6563
6549
|
}
|
|
6564
6550
|
const sideOffset = (numPins - 1) / 2 * p + 1.3;
|
|
6565
|
-
console.log("offset", sideOffset);
|
|
6566
6551
|
pads.push(rectpad(numPins + 1, -sideOffset, 1.22, 1.2, 1.8));
|
|
6567
6552
|
pads.push(rectpad(numPins + 2, sideOffset, 1.22, 1.2, 1.8));
|
|
6568
6553
|
}
|
|
@@ -6605,19 +6590,24 @@ var jst = (raw_params) => {
|
|
|
6605
6590
|
const pl = params.pl ?? defaults.pl;
|
|
6606
6591
|
const w = params.w ?? defaults.w;
|
|
6607
6592
|
const h = params.h ?? defaults.h;
|
|
6608
|
-
let numPins
|
|
6609
|
-
|
|
6610
|
-
|
|
6611
|
-
|
|
6612
|
-
|
|
6613
|
-
|
|
6614
|
-
|
|
6615
|
-
|
|
6616
|
-
|
|
6617
|
-
|
|
6618
|
-
numPins =
|
|
6593
|
+
let numPins;
|
|
6594
|
+
const explicitNumPins = raw_params.num_pins;
|
|
6595
|
+
if (typeof explicitNumPins === "number") {
|
|
6596
|
+
numPins = explicitNumPins;
|
|
6597
|
+
}
|
|
6598
|
+
const str = typeof raw_params.string === "string" ? raw_params.string : "";
|
|
6599
|
+
const match = str.match(/(?:^|_)jst(\d+)(?:_|$)/);
|
|
6600
|
+
if (match && match[1]) {
|
|
6601
|
+
const parsed = parseInt(match[1], 10);
|
|
6602
|
+
if (!Number.isNaN(parsed)) {
|
|
6603
|
+
numPins = parsed;
|
|
6619
6604
|
}
|
|
6620
6605
|
}
|
|
6606
|
+
if (typeof numPins !== "number") {
|
|
6607
|
+
throw new Error(
|
|
6608
|
+
`JST requires an explicit pin count (e.g. jst6_sh or .jst(6))${params.string ? `, from string "${params.string}"` : ""}`
|
|
6609
|
+
);
|
|
6610
|
+
}
|
|
6621
6611
|
const pads = generatePads(variant, numPins, p, id, pw, pl);
|
|
6622
6612
|
const silkscreenBody = generateSilkscreenBody(variant, w, h);
|
|
6623
6613
|
const silkscreenRefText = silkscreenRef(0, h / 2 + 1, 0.5);
|