@tscircuit/footprinter 0.0.317 → 0.0.319
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 +610 -544
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -82,6 +82,7 @@ __export(fn_exports, {
|
|
|
82
82
|
stampboard: () => stampboard,
|
|
83
83
|
stampreceiver: () => stampreceiver,
|
|
84
84
|
to220: () => to220,
|
|
85
|
+
to220f: () => to220f,
|
|
85
86
|
to92: () => to92,
|
|
86
87
|
to92l: () => to92l,
|
|
87
88
|
to92s: () => to92s,
|
|
@@ -5223,14 +5224,14 @@ var sot89_3 = (parameters) => {
|
|
|
5223
5224
|
const pads = [];
|
|
5224
5225
|
const padGap = Number.parseFloat(parameters.p);
|
|
5225
5226
|
const padWidth = Number.parseFloat(parameters.pw);
|
|
5226
|
-
const
|
|
5227
|
+
const length63 = Number.parseFloat(parameters.w);
|
|
5227
5228
|
const padHeight = Number.parseFloat(parameters.pl);
|
|
5228
5229
|
const centerExtra = 0.175;
|
|
5229
5230
|
const outerPadXShift = (padHeight - (padHeight + centerExtra)) / 2;
|
|
5230
5231
|
pads.push(
|
|
5231
|
-
rectpad(1, -
|
|
5232
|
-
rectpad(2, -
|
|
5233
|
-
rectpad(3, -
|
|
5232
|
+
rectpad(1, -length63 / 2 + outerPadXShift, padGap, padHeight, padWidth),
|
|
5233
|
+
rectpad(2, -length63 / 2, 0, padHeight + centerExtra, padWidth),
|
|
5234
|
+
rectpad(3, -length63 / 2 + outerPadXShift, -padGap, padHeight, padWidth)
|
|
5234
5235
|
);
|
|
5235
5236
|
const silkscreenRefText = silkscreenRef(0, 0, 0.3);
|
|
5236
5237
|
const width = Number.parseFloat(parameters.w) / 2 - 1;
|
|
@@ -5270,7 +5271,7 @@ var sot89_5 = (parameters) => {
|
|
|
5270
5271
|
const pads = [];
|
|
5271
5272
|
const padGap = Number.parseFloat(parameters.p);
|
|
5272
5273
|
const padWidth = Number.parseFloat(parameters.pw);
|
|
5273
|
-
const
|
|
5274
|
+
const length63 = Number.parseFloat(parameters.w);
|
|
5274
5275
|
pads.push(
|
|
5275
5276
|
rectpad(1, -1.85, -1.5, 1.5, 0.7),
|
|
5276
5277
|
rectpad(2, -1.85, 1.5, 1.5, 0.7),
|
|
@@ -5353,8 +5354,8 @@ var to220_def = base_def.extend({
|
|
|
5353
5354
|
});
|
|
5354
5355
|
var to220 = (raw_params) => {
|
|
5355
5356
|
const parameters = to220_def.parse(raw_params);
|
|
5356
|
-
const {
|
|
5357
|
-
const numPins = Number.parseInt(string3?.
|
|
5357
|
+
const { id, od, w, h, string: string3 } = parameters;
|
|
5358
|
+
const numPins = parameters.num_pins ?? Number.parseInt(string3?.match(/^to220(?:_|-)(\d+)/i)?.[1] ?? "3");
|
|
5358
5359
|
const holeY = -1;
|
|
5359
5360
|
const halfWidth = w / 2;
|
|
5360
5361
|
const halfHeight = h / 2;
|
|
@@ -5428,23 +5429,84 @@ var to220 = (raw_params) => {
|
|
|
5428
5429
|
};
|
|
5429
5430
|
};
|
|
5430
5431
|
|
|
5431
|
-
// src/fn/
|
|
5432
|
-
import {
|
|
5432
|
+
// src/fn/to220f.ts
|
|
5433
|
+
import { mm as mm14 } from "@tscircuit/mm";
|
|
5433
5434
|
import { length as length39 } from "circuit-json";
|
|
5434
|
-
|
|
5435
|
+
import { z as z49 } from "zod";
|
|
5436
|
+
var TO220F_PITCH_MM = 2.54;
|
|
5437
|
+
var to220f_def = base_def.extend({
|
|
5435
5438
|
fn: z49.string(),
|
|
5436
|
-
|
|
5437
|
-
|
|
5438
|
-
|
|
5439
|
-
|
|
5440
|
-
|
|
5441
|
-
|
|
5439
|
+
// KiCad TO-220F-3_Vertical: hole=1.2mm, pad=1.905×2.0mm, pitch=2.54mm
|
|
5440
|
+
id: length39.optional().default("1.2mm"),
|
|
5441
|
+
od: length39.optional().default("1.905mm"),
|
|
5442
|
+
ph: length39.optional().default("2mm"),
|
|
5443
|
+
w: length39.optional().default("13mm"),
|
|
5444
|
+
h: length39.optional().default("7mm"),
|
|
5445
|
+
num_pins: z49.number().optional(),
|
|
5446
|
+
string: z49.string().optional()
|
|
5447
|
+
});
|
|
5448
|
+
var to220f = (raw_params) => {
|
|
5449
|
+
const parameters = to220f_def.parse(raw_params);
|
|
5450
|
+
const numPins = parameters.num_pins ?? Number.parseInt(
|
|
5451
|
+
parameters.string?.match(/^to220f(?:_|-)(\d+)/i)?.[1] ?? "3"
|
|
5452
|
+
);
|
|
5453
|
+
const baseResult = to220({
|
|
5454
|
+
...parameters,
|
|
5455
|
+
fn: "to220",
|
|
5456
|
+
string: parameters.string?.replace(/^to220f/i, "to220"),
|
|
5457
|
+
num_pins: numPins
|
|
5458
|
+
});
|
|
5459
|
+
const holeY = -1;
|
|
5460
|
+
const newHoles = Array.from(
|
|
5461
|
+
{ length: numPins },
|
|
5462
|
+
(_, i) => {
|
|
5463
|
+
const x = numPins % 2 === 0 ? (i - numPins / 2 + 0.5) * TO220F_PITCH_MM : (i - Math.floor(numPins / 2)) * TO220F_PITCH_MM;
|
|
5464
|
+
if (i === 0) {
|
|
5465
|
+
return platedHoleWithRectPad({
|
|
5466
|
+
pn: 1,
|
|
5467
|
+
x,
|
|
5468
|
+
y: holeY,
|
|
5469
|
+
holeDiameter: parameters.id,
|
|
5470
|
+
rectPadWidth: parameters.od,
|
|
5471
|
+
rectPadHeight: parameters.ph
|
|
5472
|
+
});
|
|
5473
|
+
}
|
|
5474
|
+
return platedHolePill(
|
|
5475
|
+
i + 1,
|
|
5476
|
+
x,
|
|
5477
|
+
holeY,
|
|
5478
|
+
mm14(parameters.id),
|
|
5479
|
+
mm14(parameters.od),
|
|
5480
|
+
mm14(parameters.ph)
|
|
5481
|
+
);
|
|
5482
|
+
}
|
|
5483
|
+
);
|
|
5484
|
+
const nonHoleElements = baseResult.circuitJson.filter(
|
|
5485
|
+
(e) => e.type !== "pcb_plated_hole"
|
|
5486
|
+
);
|
|
5487
|
+
return {
|
|
5488
|
+
circuitJson: [...newHoles, ...nonHoleElements],
|
|
5489
|
+
parameters: { ...parameters, p: TO220F_PITCH_MM, num_pins: numPins }
|
|
5490
|
+
};
|
|
5491
|
+
};
|
|
5492
|
+
|
|
5493
|
+
// src/fn/minimelf.ts
|
|
5494
|
+
import { z as z50 } from "zod";
|
|
5495
|
+
import { length as length40 } from "circuit-json";
|
|
5496
|
+
var minimelf_def = base_def.extend({
|
|
5497
|
+
fn: z50.string(),
|
|
5498
|
+
num_pins: z50.literal(2).default(2),
|
|
5499
|
+
w: z50.string().default("5.40mm"),
|
|
5500
|
+
h: z50.string().default("2.30mm"),
|
|
5501
|
+
pl: z50.string().default("1.30mm"),
|
|
5502
|
+
pw: z50.string().default("1.70mm"),
|
|
5503
|
+
p: z50.string().default("3.5mm")
|
|
5442
5504
|
});
|
|
5443
5505
|
var minimelf = (raw_params) => {
|
|
5444
5506
|
const parameters = minimelf_def.parse(raw_params);
|
|
5445
5507
|
const silkscreenRefText = silkscreenRef(
|
|
5446
5508
|
0,
|
|
5447
|
-
|
|
5509
|
+
length40.parse(parameters.h) / 2 + 0.4,
|
|
5448
5510
|
0.3
|
|
5449
5511
|
);
|
|
5450
5512
|
const silkscreenLine = {
|
|
@@ -5453,20 +5515,20 @@ var minimelf = (raw_params) => {
|
|
|
5453
5515
|
pcb_component_id: "",
|
|
5454
5516
|
route: [
|
|
5455
5517
|
{
|
|
5456
|
-
x:
|
|
5457
|
-
y:
|
|
5518
|
+
x: length40.parse(parameters.p) / 2,
|
|
5519
|
+
y: length40.parse(parameters.h) / 2
|
|
5458
5520
|
},
|
|
5459
5521
|
{
|
|
5460
|
-
x: -
|
|
5461
|
-
y:
|
|
5522
|
+
x: -length40.parse(parameters.w) / 2,
|
|
5523
|
+
y: length40.parse(parameters.h) / 2
|
|
5462
5524
|
},
|
|
5463
5525
|
{
|
|
5464
|
-
x: -
|
|
5465
|
-
y: -
|
|
5526
|
+
x: -length40.parse(parameters.w) / 2,
|
|
5527
|
+
y: -length40.parse(parameters.h) / 2
|
|
5466
5528
|
},
|
|
5467
5529
|
{
|
|
5468
|
-
x:
|
|
5469
|
-
y: -
|
|
5530
|
+
x: length40.parse(parameters.p) / 2,
|
|
5531
|
+
y: -length40.parse(parameters.h) / 2
|
|
5470
5532
|
}
|
|
5471
5533
|
],
|
|
5472
5534
|
stroke_width: 0.1,
|
|
@@ -5505,22 +5567,22 @@ var miniMelfWithoutParsing = (parameters) => {
|
|
|
5505
5567
|
};
|
|
5506
5568
|
|
|
5507
5569
|
// src/fn/sod882d.ts
|
|
5508
|
-
import { z as
|
|
5509
|
-
import { length as
|
|
5570
|
+
import { z as z51 } from "zod";
|
|
5571
|
+
import { length as length41 } from "circuit-json";
|
|
5510
5572
|
var sod_def11 = base_def.extend({
|
|
5511
|
-
fn:
|
|
5512
|
-
num_pins:
|
|
5513
|
-
w:
|
|
5514
|
-
h:
|
|
5515
|
-
pl:
|
|
5516
|
-
pw:
|
|
5517
|
-
p:
|
|
5573
|
+
fn: z51.string(),
|
|
5574
|
+
num_pins: z51.literal(2).default(2),
|
|
5575
|
+
w: z51.string().default("1.90mm"),
|
|
5576
|
+
h: z51.string().default("1.33mm"),
|
|
5577
|
+
pl: z51.string().default("0.5mm"),
|
|
5578
|
+
pw: z51.string().default("0.7mm"),
|
|
5579
|
+
p: z51.string().default("0.8mm")
|
|
5518
5580
|
});
|
|
5519
5581
|
var sod882d = (raw_params) => {
|
|
5520
5582
|
const parameters = sod_def11.parse(raw_params);
|
|
5521
5583
|
const silkscreenRefText = silkscreenRef(
|
|
5522
5584
|
0,
|
|
5523
|
-
|
|
5585
|
+
length41.parse(parameters.h) + 0.1,
|
|
5524
5586
|
0.3
|
|
5525
5587
|
);
|
|
5526
5588
|
const silkscreenLine = {
|
|
@@ -5529,20 +5591,20 @@ var sod882d = (raw_params) => {
|
|
|
5529
5591
|
pcb_component_id: "",
|
|
5530
5592
|
route: [
|
|
5531
5593
|
{
|
|
5532
|
-
x:
|
|
5533
|
-
y:
|
|
5594
|
+
x: length41.parse(parameters.p) / 2 + 0.1,
|
|
5595
|
+
y: length41.parse(parameters.h) / 2
|
|
5534
5596
|
},
|
|
5535
5597
|
{
|
|
5536
|
-
x: -
|
|
5537
|
-
y:
|
|
5598
|
+
x: -length41.parse(parameters.w) / 2,
|
|
5599
|
+
y: length41.parse(parameters.h) / 2
|
|
5538
5600
|
},
|
|
5539
5601
|
{
|
|
5540
|
-
x: -
|
|
5541
|
-
y: -
|
|
5602
|
+
x: -length41.parse(parameters.w) / 2,
|
|
5603
|
+
y: -length41.parse(parameters.h) / 2
|
|
5542
5604
|
},
|
|
5543
5605
|
{
|
|
5544
|
-
x:
|
|
5545
|
-
y: -
|
|
5606
|
+
x: length41.parse(parameters.p) / 2 + 0.1,
|
|
5607
|
+
y: -length41.parse(parameters.h) / 2
|
|
5546
5608
|
}
|
|
5547
5609
|
],
|
|
5548
5610
|
stroke_width: 0.1,
|
|
@@ -5585,22 +5647,22 @@ var sodWithoutParsing12 = (parameters) => {
|
|
|
5585
5647
|
};
|
|
5586
5648
|
|
|
5587
5649
|
// src/fn/melf.ts
|
|
5588
|
-
import { z as
|
|
5589
|
-
import { length as
|
|
5650
|
+
import { z as z52 } from "zod";
|
|
5651
|
+
import { length as length42 } from "circuit-json";
|
|
5590
5652
|
var melf_def = base_def.extend({
|
|
5591
|
-
fn:
|
|
5592
|
-
num_pins:
|
|
5593
|
-
w:
|
|
5594
|
-
h:
|
|
5595
|
-
pl:
|
|
5596
|
-
pw:
|
|
5597
|
-
p:
|
|
5653
|
+
fn: z52.string(),
|
|
5654
|
+
num_pins: z52.literal(2).default(2),
|
|
5655
|
+
w: z52.string().default("7.0mm"),
|
|
5656
|
+
h: z52.string().default("3.35mm"),
|
|
5657
|
+
pl: z52.string().default("1.50mm"),
|
|
5658
|
+
pw: z52.string().default("2.70mm"),
|
|
5659
|
+
p: z52.string().default("4.8mm")
|
|
5598
5660
|
});
|
|
5599
5661
|
var melf = (raw_params) => {
|
|
5600
5662
|
const parameters = melf_def.parse(raw_params);
|
|
5601
5663
|
const silkscreenRefText = silkscreenRef(
|
|
5602
5664
|
0,
|
|
5603
|
-
|
|
5665
|
+
length42.parse(parameters.h),
|
|
5604
5666
|
0.3
|
|
5605
5667
|
);
|
|
5606
5668
|
const silkscreenLine = {
|
|
@@ -5609,20 +5671,20 @@ var melf = (raw_params) => {
|
|
|
5609
5671
|
pcb_component_id: "",
|
|
5610
5672
|
route: [
|
|
5611
5673
|
{
|
|
5612
|
-
x:
|
|
5613
|
-
y:
|
|
5674
|
+
x: length42.parse(parameters.p) / 2,
|
|
5675
|
+
y: length42.parse(parameters.h) / 2
|
|
5614
5676
|
},
|
|
5615
5677
|
{
|
|
5616
|
-
x: -
|
|
5617
|
-
y:
|
|
5678
|
+
x: -length42.parse(parameters.w) / 2,
|
|
5679
|
+
y: length42.parse(parameters.h) / 2
|
|
5618
5680
|
},
|
|
5619
5681
|
{
|
|
5620
|
-
x: -
|
|
5621
|
-
y: -
|
|
5682
|
+
x: -length42.parse(parameters.w) / 2,
|
|
5683
|
+
y: -length42.parse(parameters.h) / 2
|
|
5622
5684
|
},
|
|
5623
5685
|
{
|
|
5624
|
-
x:
|
|
5625
|
-
y: -
|
|
5686
|
+
x: length42.parse(parameters.p) / 2,
|
|
5687
|
+
y: -length42.parse(parameters.h) / 2
|
|
5626
5688
|
}
|
|
5627
5689
|
],
|
|
5628
5690
|
stroke_width: 0.1,
|
|
@@ -5665,22 +5727,22 @@ var melfWithoutParsing = (parameters) => {
|
|
|
5665
5727
|
};
|
|
5666
5728
|
|
|
5667
5729
|
// src/fn/micromelf.ts
|
|
5668
|
-
import { z as
|
|
5669
|
-
import { length as
|
|
5730
|
+
import { z as z53 } from "zod";
|
|
5731
|
+
import { length as length43 } from "circuit-json";
|
|
5670
5732
|
var micromelf_def = base_def.extend({
|
|
5671
|
-
fn:
|
|
5672
|
-
num_pins:
|
|
5673
|
-
w:
|
|
5674
|
-
h:
|
|
5675
|
-
pl:
|
|
5676
|
-
pw:
|
|
5677
|
-
p:
|
|
5733
|
+
fn: z53.string(),
|
|
5734
|
+
num_pins: z53.literal(2).default(2),
|
|
5735
|
+
w: z53.string().default("3.0mm"),
|
|
5736
|
+
h: z53.string().default("1.80mm"),
|
|
5737
|
+
pl: z53.string().default("0.80mm"),
|
|
5738
|
+
pw: z53.string().default("1.20mm"),
|
|
5739
|
+
p: z53.string().default("1.6mm")
|
|
5678
5740
|
});
|
|
5679
5741
|
var micromelf = (raw_params) => {
|
|
5680
5742
|
const parameters = micromelf_def.parse(raw_params);
|
|
5681
5743
|
const silkscreenRefText = silkscreenRef(
|
|
5682
5744
|
0,
|
|
5683
|
-
|
|
5745
|
+
length43.parse(parameters.h),
|
|
5684
5746
|
0.3
|
|
5685
5747
|
);
|
|
5686
5748
|
const silkscreenLine = {
|
|
@@ -5689,20 +5751,20 @@ var micromelf = (raw_params) => {
|
|
|
5689
5751
|
pcb_component_id: "",
|
|
5690
5752
|
route: [
|
|
5691
5753
|
{
|
|
5692
|
-
x:
|
|
5693
|
-
y:
|
|
5754
|
+
x: length43.parse(parameters.p) / 2,
|
|
5755
|
+
y: length43.parse(parameters.h) / 2
|
|
5694
5756
|
},
|
|
5695
5757
|
{
|
|
5696
|
-
x: -
|
|
5697
|
-
y:
|
|
5758
|
+
x: -length43.parse(parameters.w) / 2 - 0.1,
|
|
5759
|
+
y: length43.parse(parameters.h) / 2
|
|
5698
5760
|
},
|
|
5699
5761
|
{
|
|
5700
|
-
x: -
|
|
5701
|
-
y: -
|
|
5762
|
+
x: -length43.parse(parameters.w) / 2 - 0.1,
|
|
5763
|
+
y: -length43.parse(parameters.h) / 2
|
|
5702
5764
|
},
|
|
5703
5765
|
{
|
|
5704
|
-
x:
|
|
5705
|
-
y: -
|
|
5766
|
+
x: length43.parse(parameters.p) / 2,
|
|
5767
|
+
y: -length43.parse(parameters.h) / 2
|
|
5706
5768
|
}
|
|
5707
5769
|
],
|
|
5708
5770
|
stroke_width: 0.1,
|
|
@@ -5745,22 +5807,22 @@ var microMelfWithoutParsing = (parameters) => {
|
|
|
5745
5807
|
};
|
|
5746
5808
|
|
|
5747
5809
|
// src/fn/sma.ts
|
|
5748
|
-
import { z as
|
|
5749
|
-
import { length as
|
|
5810
|
+
import { z as z54 } from "zod";
|
|
5811
|
+
import { length as length44 } from "circuit-json";
|
|
5750
5812
|
var sma_def = base_def.extend({
|
|
5751
|
-
fn:
|
|
5752
|
-
num_pins:
|
|
5753
|
-
w:
|
|
5754
|
-
h:
|
|
5755
|
-
pl:
|
|
5756
|
-
pw:
|
|
5757
|
-
p:
|
|
5813
|
+
fn: z54.string(),
|
|
5814
|
+
num_pins: z54.literal(2).default(2),
|
|
5815
|
+
w: z54.string().default("7.10mm"),
|
|
5816
|
+
h: z54.string().default("3.40mm"),
|
|
5817
|
+
pl: z54.string().default("2.45mm"),
|
|
5818
|
+
pw: z54.string().default("1.80mm"),
|
|
5819
|
+
p: z54.string().default("4.05mm")
|
|
5758
5820
|
});
|
|
5759
5821
|
var sma = (raw_params) => {
|
|
5760
5822
|
const parameters = sma_def.parse(raw_params);
|
|
5761
5823
|
const silkscreenRefText = silkscreenRef(
|
|
5762
5824
|
0,
|
|
5763
|
-
|
|
5825
|
+
length44.parse(parameters.h) / 2 + 0.5,
|
|
5764
5826
|
0.3
|
|
5765
5827
|
);
|
|
5766
5828
|
const silkscreenLine = {
|
|
@@ -5769,20 +5831,20 @@ var sma = (raw_params) => {
|
|
|
5769
5831
|
pcb_component_id: "",
|
|
5770
5832
|
route: [
|
|
5771
5833
|
{
|
|
5772
|
-
x:
|
|
5773
|
-
y:
|
|
5834
|
+
x: length44.parse(parameters.p) / 2,
|
|
5835
|
+
y: length44.parse(parameters.h) / 2
|
|
5774
5836
|
},
|
|
5775
5837
|
{
|
|
5776
|
-
x: -
|
|
5777
|
-
y:
|
|
5838
|
+
x: -length44.parse(parameters.w) / 2 - 0.5,
|
|
5839
|
+
y: length44.parse(parameters.h) / 2
|
|
5778
5840
|
},
|
|
5779
5841
|
{
|
|
5780
|
-
x: -
|
|
5781
|
-
y: -
|
|
5842
|
+
x: -length44.parse(parameters.w) / 2 - 0.5,
|
|
5843
|
+
y: -length44.parse(parameters.h) / 2
|
|
5782
5844
|
},
|
|
5783
5845
|
{
|
|
5784
|
-
x:
|
|
5785
|
-
y: -
|
|
5846
|
+
x: length44.parse(parameters.p) / 2,
|
|
5847
|
+
y: -length44.parse(parameters.h) / 2
|
|
5786
5848
|
}
|
|
5787
5849
|
],
|
|
5788
5850
|
stroke_width: 0.1,
|
|
@@ -5824,22 +5886,22 @@ var smaWithoutParsing = (parameters) => {
|
|
|
5824
5886
|
};
|
|
5825
5887
|
|
|
5826
5888
|
// src/fn/smf.ts
|
|
5827
|
-
import { z as
|
|
5828
|
-
import { length as
|
|
5889
|
+
import { z as z55 } from "zod";
|
|
5890
|
+
import { length as length45 } from "circuit-json";
|
|
5829
5891
|
var smf_def = base_def.extend({
|
|
5830
|
-
fn:
|
|
5831
|
-
num_pins:
|
|
5832
|
-
w:
|
|
5833
|
-
h:
|
|
5834
|
-
pl:
|
|
5835
|
-
pw:
|
|
5836
|
-
p:
|
|
5892
|
+
fn: z55.string(),
|
|
5893
|
+
num_pins: z55.literal(2).default(2),
|
|
5894
|
+
w: z55.string().default("4.80mm"),
|
|
5895
|
+
h: z55.string().default("2.10mm"),
|
|
5896
|
+
pl: z55.string().default("1.30mm"),
|
|
5897
|
+
pw: z55.string().default("1.40mm"),
|
|
5898
|
+
p: z55.string().default("2.9mm")
|
|
5837
5899
|
});
|
|
5838
5900
|
var smf = (raw_params) => {
|
|
5839
5901
|
const parameters = smf_def.parse(raw_params);
|
|
5840
5902
|
const silkscreenRefText = silkscreenRef(
|
|
5841
5903
|
0,
|
|
5842
|
-
|
|
5904
|
+
length45.parse(parameters.h) - 0.5,
|
|
5843
5905
|
0.3
|
|
5844
5906
|
);
|
|
5845
5907
|
const silkscreenLine = {
|
|
@@ -5848,20 +5910,20 @@ var smf = (raw_params) => {
|
|
|
5848
5910
|
pcb_component_id: "",
|
|
5849
5911
|
route: [
|
|
5850
5912
|
{
|
|
5851
|
-
x:
|
|
5852
|
-
y:
|
|
5913
|
+
x: length45.parse(parameters.p) / 2,
|
|
5914
|
+
y: length45.parse(parameters.h) / 2
|
|
5853
5915
|
},
|
|
5854
5916
|
{
|
|
5855
|
-
x: -
|
|
5856
|
-
y:
|
|
5917
|
+
x: -length45.parse(parameters.w) / 2,
|
|
5918
|
+
y: length45.parse(parameters.h) / 2
|
|
5857
5919
|
},
|
|
5858
5920
|
{
|
|
5859
|
-
x: -
|
|
5860
|
-
y: -
|
|
5921
|
+
x: -length45.parse(parameters.w) / 2,
|
|
5922
|
+
y: -length45.parse(parameters.h) / 2
|
|
5861
5923
|
},
|
|
5862
5924
|
{
|
|
5863
|
-
x:
|
|
5864
|
-
y: -
|
|
5925
|
+
x: length45.parse(parameters.p) / 2,
|
|
5926
|
+
y: -length45.parse(parameters.h) / 2
|
|
5865
5927
|
}
|
|
5866
5928
|
],
|
|
5867
5929
|
stroke_width: 0.1,
|
|
@@ -5904,22 +5966,22 @@ var smfWithoutParsing = (parameters) => {
|
|
|
5904
5966
|
};
|
|
5905
5967
|
|
|
5906
5968
|
// src/fn/smb.ts
|
|
5907
|
-
import { z as
|
|
5908
|
-
import { length as
|
|
5969
|
+
import { z as z56 } from "zod";
|
|
5970
|
+
import { length as length46 } from "circuit-json";
|
|
5909
5971
|
var smb_def = base_def.extend({
|
|
5910
|
-
fn:
|
|
5911
|
-
num_pins:
|
|
5912
|
-
w:
|
|
5913
|
-
h:
|
|
5914
|
-
pl:
|
|
5915
|
-
pw:
|
|
5916
|
-
p:
|
|
5972
|
+
fn: z56.string(),
|
|
5973
|
+
num_pins: z56.literal(2).default(2),
|
|
5974
|
+
w: z56.string().default("7.30mm"),
|
|
5975
|
+
h: z56.string().default("4.40mm"),
|
|
5976
|
+
pl: z56.string().default("2.50mm"),
|
|
5977
|
+
pw: z56.string().default("2.30mm"),
|
|
5978
|
+
p: z56.string().default("4.30mm")
|
|
5917
5979
|
});
|
|
5918
5980
|
var smb = (raw_params) => {
|
|
5919
5981
|
const parameters = smb_def.parse(raw_params);
|
|
5920
5982
|
const silkscreenRefText = silkscreenRef(
|
|
5921
5983
|
0,
|
|
5922
|
-
|
|
5984
|
+
length46.parse(parameters.h) / 2 + 0.5,
|
|
5923
5985
|
0.3
|
|
5924
5986
|
);
|
|
5925
5987
|
const silkscreenLine = {
|
|
@@ -5928,20 +5990,20 @@ var smb = (raw_params) => {
|
|
|
5928
5990
|
pcb_component_id: "",
|
|
5929
5991
|
route: [
|
|
5930
5992
|
{
|
|
5931
|
-
x:
|
|
5932
|
-
y:
|
|
5993
|
+
x: length46.parse(parameters.p) / 2,
|
|
5994
|
+
y: length46.parse(parameters.h) / 2
|
|
5933
5995
|
},
|
|
5934
5996
|
{
|
|
5935
|
-
x: -
|
|
5936
|
-
y:
|
|
5997
|
+
x: -length46.parse(parameters.w) / 2 - 0.1,
|
|
5998
|
+
y: length46.parse(parameters.h) / 2
|
|
5937
5999
|
},
|
|
5938
6000
|
{
|
|
5939
|
-
x: -
|
|
5940
|
-
y: -
|
|
6001
|
+
x: -length46.parse(parameters.w) / 2 - 0.1,
|
|
6002
|
+
y: -length46.parse(parameters.h) / 2
|
|
5941
6003
|
},
|
|
5942
6004
|
{
|
|
5943
|
-
x:
|
|
5944
|
-
y: -
|
|
6005
|
+
x: length46.parse(parameters.p) / 2,
|
|
6006
|
+
y: -length46.parse(parameters.h) / 2
|
|
5945
6007
|
}
|
|
5946
6008
|
],
|
|
5947
6009
|
stroke_width: 0.1,
|
|
@@ -5984,16 +6046,16 @@ var smbWithoutParsing = (parameters) => {
|
|
|
5984
6046
|
};
|
|
5985
6047
|
|
|
5986
6048
|
// src/fn/smc.ts
|
|
5987
|
-
import { z as
|
|
5988
|
-
import { length as
|
|
6049
|
+
import { z as z57 } from "zod";
|
|
6050
|
+
import { length as length47 } from "circuit-json";
|
|
5989
6051
|
var smc_def = base_def.extend({
|
|
5990
|
-
fn:
|
|
5991
|
-
num_pins:
|
|
5992
|
-
w:
|
|
5993
|
-
h:
|
|
5994
|
-
pl:
|
|
5995
|
-
pw:
|
|
5996
|
-
p:
|
|
6052
|
+
fn: z57.string(),
|
|
6053
|
+
num_pins: z57.literal(2).default(2),
|
|
6054
|
+
w: z57.string().default("10.70mm"),
|
|
6055
|
+
h: z57.string().default("6.60mm"),
|
|
6056
|
+
pl: z57.string().default("3.30mm"),
|
|
6057
|
+
pw: z57.string().default("2.50mm"),
|
|
6058
|
+
p: z57.string().default("6.80mm")
|
|
5997
6059
|
});
|
|
5998
6060
|
var smc = (raw_params) => {
|
|
5999
6061
|
const parameters = smc_def.parse(raw_params);
|
|
@@ -6004,20 +6066,20 @@ var smc = (raw_params) => {
|
|
|
6004
6066
|
pcb_component_id: "",
|
|
6005
6067
|
route: [
|
|
6006
6068
|
{
|
|
6007
|
-
x:
|
|
6008
|
-
y:
|
|
6069
|
+
x: length47.parse(parameters.p) / 2,
|
|
6070
|
+
y: length47.parse(parameters.h) / 2 - 0.8
|
|
6009
6071
|
},
|
|
6010
6072
|
{
|
|
6011
|
-
x: -
|
|
6012
|
-
y:
|
|
6073
|
+
x: -length47.parse(parameters.w) / 2 - 0.8,
|
|
6074
|
+
y: length47.parse(parameters.h) / 2 - 0.8
|
|
6013
6075
|
},
|
|
6014
6076
|
{
|
|
6015
|
-
x: -
|
|
6016
|
-
y: -
|
|
6077
|
+
x: -length47.parse(parameters.w) / 2 - 0.8,
|
|
6078
|
+
y: -length47.parse(parameters.h) / 2 + 0.8
|
|
6017
6079
|
},
|
|
6018
6080
|
{
|
|
6019
|
-
x:
|
|
6020
|
-
y: -
|
|
6081
|
+
x: length47.parse(parameters.p) / 2,
|
|
6082
|
+
y: -length47.parse(parameters.h) / 2 + 0.8
|
|
6021
6083
|
}
|
|
6022
6084
|
],
|
|
6023
6085
|
stroke_width: 0.1,
|
|
@@ -6059,16 +6121,16 @@ var smcWithoutParsing = (parameters) => {
|
|
|
6059
6121
|
};
|
|
6060
6122
|
|
|
6061
6123
|
// src/fn/sot223.ts
|
|
6062
|
-
import { z as
|
|
6124
|
+
import { z as z58 } from "zod";
|
|
6063
6125
|
var sot223_def = base_def.extend({
|
|
6064
|
-
fn:
|
|
6065
|
-
num_pins:
|
|
6066
|
-
w:
|
|
6067
|
-
h:
|
|
6068
|
-
pl:
|
|
6069
|
-
pw:
|
|
6070
|
-
p:
|
|
6071
|
-
string:
|
|
6126
|
+
fn: z58.string(),
|
|
6127
|
+
num_pins: z58.number().default(4),
|
|
6128
|
+
w: z58.string().default("8.50mm"),
|
|
6129
|
+
h: z58.string().default("6.90mm"),
|
|
6130
|
+
pl: z58.string().default("2mm"),
|
|
6131
|
+
pw: z58.string().default("1.5mm"),
|
|
6132
|
+
p: z58.string().default("2.30mm"),
|
|
6133
|
+
string: z58.string().optional()
|
|
6072
6134
|
});
|
|
6073
6135
|
var sot223 = (raw_params) => {
|
|
6074
6136
|
const match = raw_params.string?.match(/^sot223_(\d+)/);
|
|
@@ -6314,16 +6376,16 @@ var sot223_6 = (parameters) => {
|
|
|
6314
6376
|
};
|
|
6315
6377
|
|
|
6316
6378
|
// src/fn/sot23w.ts
|
|
6317
|
-
import { z as
|
|
6379
|
+
import { z as z59 } from "zod";
|
|
6318
6380
|
var sot23w_def = base_def.extend({
|
|
6319
|
-
fn:
|
|
6320
|
-
num_pins:
|
|
6321
|
-
w:
|
|
6322
|
-
h:
|
|
6323
|
-
pl:
|
|
6324
|
-
pw:
|
|
6325
|
-
p:
|
|
6326
|
-
string:
|
|
6381
|
+
fn: z59.string(),
|
|
6382
|
+
num_pins: z59.number().default(3),
|
|
6383
|
+
w: z59.string().default("3.40mm"),
|
|
6384
|
+
h: z59.string().default("3.30mm"),
|
|
6385
|
+
pl: z59.string().default("1mm"),
|
|
6386
|
+
pw: z59.string().default("0.7mm"),
|
|
6387
|
+
p: z59.string().default("1.2mm"),
|
|
6388
|
+
string: z59.string().optional()
|
|
6327
6389
|
});
|
|
6328
6390
|
var sot23w = (raw_params) => {
|
|
6329
6391
|
const match = raw_params.string?.match(/^sot23w_(\d+)/);
|
|
@@ -6411,16 +6473,16 @@ var sot23w_3 = (parameters) => {
|
|
|
6411
6473
|
};
|
|
6412
6474
|
|
|
6413
6475
|
// src/fn/to92s.ts
|
|
6414
|
-
import { z as
|
|
6476
|
+
import { z as z60 } from "zod";
|
|
6415
6477
|
var to92s_def = base_def.extend({
|
|
6416
|
-
fn:
|
|
6417
|
-
num_pins:
|
|
6418
|
-
p:
|
|
6419
|
-
id:
|
|
6420
|
-
od:
|
|
6421
|
-
w:
|
|
6422
|
-
h:
|
|
6423
|
-
string:
|
|
6478
|
+
fn: z60.string(),
|
|
6479
|
+
num_pins: z60.union([z60.literal(3), z60.literal(2)]).default(3),
|
|
6480
|
+
p: z60.string().default("1.27mm"),
|
|
6481
|
+
id: z60.string().default("0.72mm"),
|
|
6482
|
+
od: z60.string().default("0.95mm"),
|
|
6483
|
+
w: z60.string().default("2.5mm"),
|
|
6484
|
+
h: z60.string().default("4.2mm"),
|
|
6485
|
+
string: z60.string().optional()
|
|
6424
6486
|
});
|
|
6425
6487
|
var to92s_3 = (parameters) => {
|
|
6426
6488
|
const { p, id, od, w, h } = parameters;
|
|
@@ -6487,51 +6549,51 @@ var to92s = (raw_params) => {
|
|
|
6487
6549
|
|
|
6488
6550
|
// src/fn/jst.ts
|
|
6489
6551
|
import {
|
|
6490
|
-
length as
|
|
6552
|
+
length as length48
|
|
6491
6553
|
} from "circuit-json";
|
|
6492
|
-
import { z as
|
|
6554
|
+
import { z as z61 } from "zod";
|
|
6493
6555
|
var jst_def = base_def.extend({
|
|
6494
|
-
fn:
|
|
6495
|
-
p:
|
|
6496
|
-
id:
|
|
6497
|
-
pw:
|
|
6498
|
-
pl:
|
|
6499
|
-
w:
|
|
6500
|
-
h:
|
|
6501
|
-
sh:
|
|
6556
|
+
fn: z61.string(),
|
|
6557
|
+
p: length48.optional(),
|
|
6558
|
+
id: length48.optional(),
|
|
6559
|
+
pw: length48.optional(),
|
|
6560
|
+
pl: length48.optional(),
|
|
6561
|
+
w: length48.optional(),
|
|
6562
|
+
h: length48.optional(),
|
|
6563
|
+
sh: z61.boolean().optional().describe(
|
|
6502
6564
|
'JST SH (Surface-mount) connector family. SH stands for "Super High-density".'
|
|
6503
6565
|
),
|
|
6504
|
-
ph:
|
|
6566
|
+
ph: z61.boolean().optional().describe(
|
|
6505
6567
|
'JST PH (Through-hole) connector family. PH stands for "Pin Header".'
|
|
6506
6568
|
),
|
|
6507
|
-
zh:
|
|
6569
|
+
zh: z61.boolean().optional().describe(
|
|
6508
6570
|
"JST ZH (Through-hole) connector family. 1.5mm pitch wire-to-board."
|
|
6509
6571
|
),
|
|
6510
|
-
string:
|
|
6572
|
+
string: z61.string().optional()
|
|
6511
6573
|
});
|
|
6512
6574
|
var variantDefaults = {
|
|
6513
6575
|
ph: {
|
|
6514
|
-
p:
|
|
6515
|
-
id:
|
|
6516
|
-
pw:
|
|
6517
|
-
pl:
|
|
6518
|
-
w:
|
|
6519
|
-
h:
|
|
6576
|
+
p: length48.parse("2.2mm"),
|
|
6577
|
+
id: length48.parse("0.70mm"),
|
|
6578
|
+
pw: length48.parse("1.20mm"),
|
|
6579
|
+
pl: length48.parse("1.20mm"),
|
|
6580
|
+
w: length48.parse("6mm"),
|
|
6581
|
+
h: length48.parse("5mm")
|
|
6520
6582
|
},
|
|
6521
6583
|
sh: {
|
|
6522
|
-
p:
|
|
6523
|
-
pw:
|
|
6524
|
-
pl:
|
|
6525
|
-
w:
|
|
6526
|
-
h:
|
|
6584
|
+
p: length48.parse("1mm"),
|
|
6585
|
+
pw: length48.parse("0.6mm"),
|
|
6586
|
+
pl: length48.parse("1.55mm"),
|
|
6587
|
+
w: length48.parse("5.8mm"),
|
|
6588
|
+
h: length48.parse("7.8mm")
|
|
6527
6589
|
},
|
|
6528
6590
|
zh: {
|
|
6529
|
-
p:
|
|
6530
|
-
id:
|
|
6531
|
-
pw:
|
|
6532
|
-
pl:
|
|
6533
|
-
w:
|
|
6534
|
-
h:
|
|
6591
|
+
p: length48.parse("1.5mm"),
|
|
6592
|
+
id: length48.parse("0.73mm"),
|
|
6593
|
+
pw: length48.parse("1.03mm"),
|
|
6594
|
+
pl: length48.parse("1.73mm"),
|
|
6595
|
+
w: length48.parse("3mm"),
|
|
6596
|
+
h: length48.parse("3.5mm")
|
|
6535
6597
|
}
|
|
6536
6598
|
};
|
|
6537
6599
|
function getVariant(params) {
|
|
@@ -6693,22 +6755,22 @@ var jst = (raw_params) => {
|
|
|
6693
6755
|
};
|
|
6694
6756
|
|
|
6695
6757
|
// src/fn/sod110.ts
|
|
6696
|
-
import { z as
|
|
6697
|
-
import { length as
|
|
6758
|
+
import { z as z62 } from "zod";
|
|
6759
|
+
import { length as length49 } from "circuit-json";
|
|
6698
6760
|
var sod_def12 = base_def.extend({
|
|
6699
|
-
fn:
|
|
6700
|
-
num_pins:
|
|
6701
|
-
w:
|
|
6702
|
-
h:
|
|
6703
|
-
pl:
|
|
6704
|
-
pw:
|
|
6705
|
-
p:
|
|
6761
|
+
fn: z62.string(),
|
|
6762
|
+
num_pins: z62.literal(2).default(2),
|
|
6763
|
+
w: z62.string().default("3.30mm"),
|
|
6764
|
+
h: z62.string().default("1.70mm"),
|
|
6765
|
+
pl: z62.string().default("0.80mm"),
|
|
6766
|
+
pw: z62.string().default("1mm"),
|
|
6767
|
+
p: z62.string().default("1.90mm")
|
|
6706
6768
|
});
|
|
6707
6769
|
var sod110 = (raw_params) => {
|
|
6708
6770
|
const parameters = sod_def12.parse(raw_params);
|
|
6709
6771
|
const silkscreenRefText = silkscreenRef(
|
|
6710
6772
|
0,
|
|
6711
|
-
|
|
6773
|
+
length49.parse(parameters.h) / 2 + 0.5,
|
|
6712
6774
|
0.3
|
|
6713
6775
|
);
|
|
6714
6776
|
const silkscreenLine = {
|
|
@@ -6717,20 +6779,20 @@ var sod110 = (raw_params) => {
|
|
|
6717
6779
|
pcb_component_id: "",
|
|
6718
6780
|
route: [
|
|
6719
6781
|
{
|
|
6720
|
-
x:
|
|
6721
|
-
y:
|
|
6782
|
+
x: length49.parse(parameters.p) / 2,
|
|
6783
|
+
y: length49.parse(parameters.h) / 2
|
|
6722
6784
|
},
|
|
6723
6785
|
{
|
|
6724
|
-
x: -
|
|
6725
|
-
y:
|
|
6786
|
+
x: -length49.parse(parameters.w) / 2,
|
|
6787
|
+
y: length49.parse(parameters.h) / 2
|
|
6726
6788
|
},
|
|
6727
6789
|
{
|
|
6728
|
-
x: -
|
|
6729
|
-
y: -
|
|
6790
|
+
x: -length49.parse(parameters.w) / 2,
|
|
6791
|
+
y: -length49.parse(parameters.h) / 2
|
|
6730
6792
|
},
|
|
6731
6793
|
{
|
|
6732
|
-
x:
|
|
6733
|
-
y: -
|
|
6794
|
+
x: length49.parse(parameters.p) / 2,
|
|
6795
|
+
y: -length49.parse(parameters.h) / 2
|
|
6734
6796
|
}
|
|
6735
6797
|
],
|
|
6736
6798
|
stroke_width: 0.1,
|
|
@@ -6772,8 +6834,8 @@ var sodWithoutParsing13 = (parameters) => {
|
|
|
6772
6834
|
};
|
|
6773
6835
|
|
|
6774
6836
|
// src/fn/vssop.ts
|
|
6775
|
-
import { z as
|
|
6776
|
-
import { length as
|
|
6837
|
+
import { z as z63 } from "zod";
|
|
6838
|
+
import { length as length50 } from "circuit-json";
|
|
6777
6839
|
var getDefaultValues = (num_pins) => {
|
|
6778
6840
|
switch (num_pins) {
|
|
6779
6841
|
case 8:
|
|
@@ -6803,23 +6865,23 @@ var getDefaultValues = (num_pins) => {
|
|
|
6803
6865
|
}
|
|
6804
6866
|
};
|
|
6805
6867
|
var vssop_def = base_def.extend({
|
|
6806
|
-
fn:
|
|
6807
|
-
num_pins:
|
|
6808
|
-
w:
|
|
6809
|
-
h:
|
|
6810
|
-
p:
|
|
6811
|
-
pl:
|
|
6812
|
-
pw:
|
|
6813
|
-
string:
|
|
6868
|
+
fn: z63.string(),
|
|
6869
|
+
num_pins: z63.union([z63.literal(8), z63.literal(10)]).default(8),
|
|
6870
|
+
w: z63.string().optional(),
|
|
6871
|
+
h: z63.string().optional(),
|
|
6872
|
+
p: z63.string().optional(),
|
|
6873
|
+
pl: z63.string().optional(),
|
|
6874
|
+
pw: z63.string().optional(),
|
|
6875
|
+
string: z63.string().optional()
|
|
6814
6876
|
});
|
|
6815
6877
|
var vssop = (raw_params) => {
|
|
6816
6878
|
const parameters = vssop_def.parse(raw_params);
|
|
6817
6879
|
const defaults = getDefaultValues(parameters.num_pins);
|
|
6818
|
-
const w =
|
|
6819
|
-
const h =
|
|
6820
|
-
const p =
|
|
6821
|
-
const pl =
|
|
6822
|
-
const pw =
|
|
6880
|
+
const w = length50.parse(parameters.w || defaults.w);
|
|
6881
|
+
const h = length50.parse(parameters.h || defaults.h);
|
|
6882
|
+
const p = length50.parse(parameters.p || defaults.p);
|
|
6883
|
+
const pl = length50.parse(parameters.pl || defaults.pl);
|
|
6884
|
+
const pw = length50.parse(parameters.pw || defaults.pw);
|
|
6823
6885
|
const pads = [];
|
|
6824
6886
|
const half = parameters.num_pins / 2;
|
|
6825
6887
|
for (let i = 0; i < parameters.num_pins; i++) {
|
|
@@ -6896,14 +6958,14 @@ var getVssopPadCoord = (pinCount, pn, w, p) => {
|
|
|
6896
6958
|
const col = pn <= half ? -1 : 1;
|
|
6897
6959
|
const row = (half - 1) / 2 - rowIndex;
|
|
6898
6960
|
return {
|
|
6899
|
-
x: col *
|
|
6961
|
+
x: col * length50.parse(pinCount === 8 ? "1.8mm" : "2.2mm"),
|
|
6900
6962
|
y: row * p
|
|
6901
6963
|
};
|
|
6902
6964
|
};
|
|
6903
6965
|
|
|
6904
6966
|
// src/fn/msop.ts
|
|
6905
|
-
import { z as
|
|
6906
|
-
import { length as
|
|
6967
|
+
import { z as z64 } from "zod";
|
|
6968
|
+
import { length as length51 } from "circuit-json";
|
|
6907
6969
|
var getDefaultValues2 = (num_pins) => {
|
|
6908
6970
|
switch (num_pins) {
|
|
6909
6971
|
case 10:
|
|
@@ -6941,14 +7003,14 @@ var getDefaultValues2 = (num_pins) => {
|
|
|
6941
7003
|
}
|
|
6942
7004
|
};
|
|
6943
7005
|
var msop_def = base_def.extend({
|
|
6944
|
-
fn:
|
|
6945
|
-
num_pins:
|
|
6946
|
-
w:
|
|
6947
|
-
h:
|
|
6948
|
-
p:
|
|
6949
|
-
pl:
|
|
6950
|
-
pw:
|
|
6951
|
-
string:
|
|
7006
|
+
fn: z64.string(),
|
|
7007
|
+
num_pins: z64.union([z64.literal(8), z64.literal(10), z64.literal(12), z64.literal(16)]).default(8),
|
|
7008
|
+
w: z64.string().optional(),
|
|
7009
|
+
h: z64.string().optional(),
|
|
7010
|
+
p: z64.string().optional(),
|
|
7011
|
+
pl: z64.string().optional(),
|
|
7012
|
+
pw: z64.string().optional(),
|
|
7013
|
+
string: z64.string().optional()
|
|
6952
7014
|
});
|
|
6953
7015
|
var getMsopCoords = (pinCount, pn, w, p) => {
|
|
6954
7016
|
const half = pinCount / 2;
|
|
@@ -6956,18 +7018,18 @@ var getMsopCoords = (pinCount, pn, w, p) => {
|
|
|
6956
7018
|
const col = pn <= half ? -1 : 1;
|
|
6957
7019
|
const row = (half - 1) / 2 - rowIndex;
|
|
6958
7020
|
return {
|
|
6959
|
-
x: col *
|
|
7021
|
+
x: col * length51.parse("2mm"),
|
|
6960
7022
|
y: row * p
|
|
6961
7023
|
};
|
|
6962
7024
|
};
|
|
6963
7025
|
var msop = (raw_params) => {
|
|
6964
7026
|
const parameters = msop_def.parse(raw_params);
|
|
6965
7027
|
const defaults = getDefaultValues2(parameters.num_pins);
|
|
6966
|
-
const w =
|
|
6967
|
-
const h =
|
|
6968
|
-
const p =
|
|
6969
|
-
const pl =
|
|
6970
|
-
const pw =
|
|
7028
|
+
const w = length51.parse(parameters.w || defaults.w);
|
|
7029
|
+
const h = length51.parse(parameters.h || defaults.h);
|
|
7030
|
+
const p = length51.parse(parameters.p || defaults.p);
|
|
7031
|
+
const pl = length51.parse(parameters.pl || defaults.pl);
|
|
7032
|
+
const pw = length51.parse(parameters.pw || defaults.pw);
|
|
6971
7033
|
const pads = [];
|
|
6972
7034
|
for (let i = 0; i < parameters.num_pins; i++) {
|
|
6973
7035
|
const { x, y } = getMsopCoords(parameters.num_pins, i + 1, w, p);
|
|
@@ -7038,22 +7100,22 @@ var msop = (raw_params) => {
|
|
|
7038
7100
|
};
|
|
7039
7101
|
|
|
7040
7102
|
// src/fn/sod323w.ts
|
|
7041
|
-
import { z as
|
|
7042
|
-
import { length as
|
|
7103
|
+
import { z as z65 } from "zod";
|
|
7104
|
+
import { length as length52 } from "circuit-json";
|
|
7043
7105
|
var sod323w_def = base_def.extend({
|
|
7044
|
-
fn:
|
|
7045
|
-
num_pins:
|
|
7046
|
-
w:
|
|
7047
|
-
h:
|
|
7048
|
-
pl:
|
|
7049
|
-
pw:
|
|
7050
|
-
pad_spacing:
|
|
7106
|
+
fn: z65.string(),
|
|
7107
|
+
num_pins: z65.literal(2).default(2),
|
|
7108
|
+
w: z65.string().default("3.8mm"),
|
|
7109
|
+
h: z65.string().default("1.65mm"),
|
|
7110
|
+
pl: z65.string().default("1.2mm"),
|
|
7111
|
+
pw: z65.string().default("1.2mm"),
|
|
7112
|
+
pad_spacing: z65.string().default("2.6mm")
|
|
7051
7113
|
});
|
|
7052
7114
|
var sod323w = (raw_params) => {
|
|
7053
7115
|
const parameters = sod323w_def.parse(raw_params);
|
|
7054
7116
|
const silkscreenRefText = silkscreenRef(
|
|
7055
7117
|
0,
|
|
7056
|
-
|
|
7118
|
+
length52.parse(parameters.h),
|
|
7057
7119
|
0.3
|
|
7058
7120
|
);
|
|
7059
7121
|
const silkscreenLine = {
|
|
@@ -7062,20 +7124,20 @@ var sod323w = (raw_params) => {
|
|
|
7062
7124
|
pcb_component_id: "",
|
|
7063
7125
|
route: [
|
|
7064
7126
|
{
|
|
7065
|
-
x:
|
|
7066
|
-
y:
|
|
7127
|
+
x: length52.parse(parameters.pad_spacing) / 2,
|
|
7128
|
+
y: length52.parse(parameters.h) / 2
|
|
7067
7129
|
},
|
|
7068
7130
|
{
|
|
7069
|
-
x: -
|
|
7070
|
-
y:
|
|
7131
|
+
x: -length52.parse(parameters.w) / 2 - 0.2,
|
|
7132
|
+
y: length52.parse(parameters.h) / 2
|
|
7071
7133
|
},
|
|
7072
7134
|
{
|
|
7073
|
-
x: -
|
|
7074
|
-
y: -
|
|
7135
|
+
x: -length52.parse(parameters.w) / 2 - 0.2,
|
|
7136
|
+
y: -length52.parse(parameters.h) / 2
|
|
7075
7137
|
},
|
|
7076
7138
|
{
|
|
7077
|
-
x:
|
|
7078
|
-
y: -
|
|
7139
|
+
x: length52.parse(parameters.pad_spacing) / 2,
|
|
7140
|
+
y: -length52.parse(parameters.h) / 2
|
|
7079
7141
|
}
|
|
7080
7142
|
],
|
|
7081
7143
|
stroke_width: 0.1,
|
|
@@ -7118,22 +7180,22 @@ var sodWithoutParsing14 = (parameters) => {
|
|
|
7118
7180
|
};
|
|
7119
7181
|
|
|
7120
7182
|
// src/fn/sod323fl.ts
|
|
7121
|
-
import { z as
|
|
7122
|
-
import { length as
|
|
7183
|
+
import { z as z66 } from "zod";
|
|
7184
|
+
import { length as length53 } from "circuit-json";
|
|
7123
7185
|
var sod323FL_def = base_def.extend({
|
|
7124
|
-
fn:
|
|
7125
|
-
num_pins:
|
|
7126
|
-
w:
|
|
7127
|
-
h:
|
|
7128
|
-
pl:
|
|
7129
|
-
pw:
|
|
7130
|
-
pad_spacing:
|
|
7186
|
+
fn: z66.string(),
|
|
7187
|
+
num_pins: z66.literal(2).default(2),
|
|
7188
|
+
w: z66.string().default("3.20mm"),
|
|
7189
|
+
h: z66.string().default("1.65mm"),
|
|
7190
|
+
pl: z66.string().default("0.8mm"),
|
|
7191
|
+
pw: z66.string().default("0.9mm"),
|
|
7192
|
+
pad_spacing: z66.string().default("2.1mm")
|
|
7131
7193
|
});
|
|
7132
7194
|
var sod323fl = (raw_params) => {
|
|
7133
7195
|
const parameters = sod323FL_def.parse(raw_params);
|
|
7134
7196
|
const silkscreenRefText = silkscreenRef(
|
|
7135
7197
|
0,
|
|
7136
|
-
|
|
7198
|
+
length53.parse(parameters.h),
|
|
7137
7199
|
0.3
|
|
7138
7200
|
);
|
|
7139
7201
|
const silkscreenLine = {
|
|
@@ -7142,20 +7204,20 @@ var sod323fl = (raw_params) => {
|
|
|
7142
7204
|
pcb_component_id: "",
|
|
7143
7205
|
route: [
|
|
7144
7206
|
{
|
|
7145
|
-
x:
|
|
7146
|
-
y:
|
|
7207
|
+
x: length53.parse(parameters.pad_spacing) / 2,
|
|
7208
|
+
y: length53.parse(parameters.h) / 2
|
|
7147
7209
|
},
|
|
7148
7210
|
{
|
|
7149
|
-
x: -
|
|
7150
|
-
y:
|
|
7211
|
+
x: -length53.parse(parameters.w) / 2 - 0.2,
|
|
7212
|
+
y: length53.parse(parameters.h) / 2
|
|
7151
7213
|
},
|
|
7152
7214
|
{
|
|
7153
|
-
x: -
|
|
7154
|
-
y: -
|
|
7215
|
+
x: -length53.parse(parameters.w) / 2 - 0.2,
|
|
7216
|
+
y: -length53.parse(parameters.h) / 2
|
|
7155
7217
|
},
|
|
7156
7218
|
{
|
|
7157
|
-
x:
|
|
7158
|
-
y: -
|
|
7219
|
+
x: length53.parse(parameters.pad_spacing) / 2,
|
|
7220
|
+
y: -length53.parse(parameters.h) / 2
|
|
7159
7221
|
}
|
|
7160
7222
|
],
|
|
7161
7223
|
stroke_width: 0.1,
|
|
@@ -7198,20 +7260,20 @@ var sodWithoutParsing15 = (parameters) => {
|
|
|
7198
7260
|
};
|
|
7199
7261
|
|
|
7200
7262
|
// src/fn/son.ts
|
|
7201
|
-
import { z as
|
|
7202
|
-
import { length as
|
|
7263
|
+
import { z as z67 } from "zod";
|
|
7264
|
+
import { length as length54 } from "circuit-json";
|
|
7203
7265
|
var son_def = base_def.extend({
|
|
7204
|
-
fn:
|
|
7205
|
-
num_pins:
|
|
7206
|
-
w:
|
|
7207
|
-
h:
|
|
7208
|
-
p:
|
|
7209
|
-
pl:
|
|
7210
|
-
pw:
|
|
7211
|
-
epw:
|
|
7212
|
-
eph:
|
|
7213
|
-
string:
|
|
7214
|
-
ep:
|
|
7266
|
+
fn: z67.string(),
|
|
7267
|
+
num_pins: z67.union([z67.literal(6), z67.literal(8)]).default(8),
|
|
7268
|
+
w: z67.string().default("3mm"),
|
|
7269
|
+
h: z67.string().default("3mm"),
|
|
7270
|
+
p: z67.string().default("0.5mm"),
|
|
7271
|
+
pl: z67.string().default("0.52mm"),
|
|
7272
|
+
pw: z67.string().default("0.35mm"),
|
|
7273
|
+
epw: z67.string().default("1.40mm"),
|
|
7274
|
+
eph: z67.string().default("1.60mm"),
|
|
7275
|
+
string: z67.string().optional(),
|
|
7276
|
+
ep: z67.boolean().default(false)
|
|
7215
7277
|
});
|
|
7216
7278
|
var son = (raw_params) => {
|
|
7217
7279
|
if (raw_params.string && raw_params.string.includes("_ep")) {
|
|
@@ -7223,13 +7285,13 @@ var son = (raw_params) => {
|
|
|
7223
7285
|
...raw_params,
|
|
7224
7286
|
num_pins: numPins
|
|
7225
7287
|
});
|
|
7226
|
-
const w =
|
|
7227
|
-
const h =
|
|
7228
|
-
const p =
|
|
7229
|
-
const pl =
|
|
7230
|
-
const pw =
|
|
7231
|
-
const epw =
|
|
7232
|
-
const eph =
|
|
7288
|
+
const w = length54.parse(parameters.w);
|
|
7289
|
+
const h = length54.parse(parameters.h);
|
|
7290
|
+
const p = length54.parse(parameters.p);
|
|
7291
|
+
const pl = length54.parse(parameters.pl);
|
|
7292
|
+
const pw = length54.parse(parameters.pw);
|
|
7293
|
+
const epw = length54.parse(parameters.epw);
|
|
7294
|
+
const eph = length54.parse(parameters.eph);
|
|
7233
7295
|
const pads = [];
|
|
7234
7296
|
for (let i = 0; i < parameters.num_pins; i++) {
|
|
7235
7297
|
const { x, y } = getSonPadCoord(parameters.num_pins, i + 1, w, p);
|
|
@@ -7307,24 +7369,24 @@ var getSonPadCoord = (num_pins, pn, w, p) => {
|
|
|
7307
7369
|
const col = pn <= half ? -1 : 1;
|
|
7308
7370
|
const row = (half - 1) / 2 - rowIndex;
|
|
7309
7371
|
return {
|
|
7310
|
-
x: col *
|
|
7372
|
+
x: col * length54.parse("1.4mm"),
|
|
7311
7373
|
y: row * p
|
|
7312
7374
|
};
|
|
7313
7375
|
};
|
|
7314
7376
|
|
|
7315
7377
|
// src/fn/vson.ts
|
|
7316
|
-
import { z as
|
|
7317
|
-
import { length as
|
|
7378
|
+
import { z as z68 } from "zod";
|
|
7379
|
+
import { length as length55, distance as distance3 } from "circuit-json";
|
|
7318
7380
|
var vson_def = base_def.extend({
|
|
7319
|
-
fn:
|
|
7320
|
-
num_pins:
|
|
7381
|
+
fn: z68.string(),
|
|
7382
|
+
num_pins: z68.number().optional().default(8),
|
|
7321
7383
|
p: distance3.describe("pitch (distance between center of each pin)"),
|
|
7322
|
-
w:
|
|
7384
|
+
w: length55.describe("width between vertical rows of pins"),
|
|
7323
7385
|
grid: dim2d.describe("width and height of the border of the footprint"),
|
|
7324
7386
|
ep: dim2d.default("0x0mm").describe("width and height of the central exposed thermal pad"),
|
|
7325
|
-
epx:
|
|
7326
|
-
pinw:
|
|
7327
|
-
pinh:
|
|
7387
|
+
epx: length55.default("0mm").describe("x offset of the center of the central exposed thermal pad"),
|
|
7388
|
+
pinw: length55.describe("width of the pin pads"),
|
|
7389
|
+
pinh: length55.describe("height of the pin pads")
|
|
7328
7390
|
});
|
|
7329
7391
|
var vson = (raw_params) => {
|
|
7330
7392
|
const parameters = vson_def.parse(raw_params);
|
|
@@ -7431,12 +7493,12 @@ var getSilkscreenPaths = (grid) => {
|
|
|
7431
7493
|
};
|
|
7432
7494
|
|
|
7433
7495
|
// src/fn/solderjumper.ts
|
|
7434
|
-
import { length as
|
|
7496
|
+
import { length as length56 } from "circuit-json";
|
|
7435
7497
|
var solderjumper = (params) => {
|
|
7436
7498
|
const { num_pins, bridged, p = 2.54, pw = 1.5, ph = 1.5 } = params;
|
|
7437
|
-
const padSpacing7 =
|
|
7438
|
-
const padWidth =
|
|
7439
|
-
const padHeight =
|
|
7499
|
+
const padSpacing7 = length56.parse(p);
|
|
7500
|
+
const padWidth = length56.parse(pw);
|
|
7501
|
+
const padHeight = length56.parse(ph);
|
|
7440
7502
|
const traceWidth = Math.min(padHeight / 4, 0.5);
|
|
7441
7503
|
const pads = [];
|
|
7442
7504
|
for (let i = 0; i < num_pins; i++) {
|
|
@@ -7524,34 +7586,34 @@ var solderjumper = (params) => {
|
|
|
7524
7586
|
};
|
|
7525
7587
|
|
|
7526
7588
|
// src/fn/sot457.ts
|
|
7527
|
-
import { z as
|
|
7589
|
+
import { z as z69 } from "zod";
|
|
7528
7590
|
var commonSchema = {
|
|
7529
|
-
fn:
|
|
7530
|
-
num_pins:
|
|
7531
|
-
pillh:
|
|
7532
|
-
pillw:
|
|
7533
|
-
pl:
|
|
7534
|
-
pw:
|
|
7535
|
-
p:
|
|
7536
|
-
wave:
|
|
7537
|
-
reflow:
|
|
7591
|
+
fn: z69.literal("sot457"),
|
|
7592
|
+
num_pins: z69.literal(6).default(6),
|
|
7593
|
+
pillh: z69.string().default("0.45mm"),
|
|
7594
|
+
pillw: z69.string().default("1.45mm"),
|
|
7595
|
+
pl: z69.string(),
|
|
7596
|
+
pw: z69.string(),
|
|
7597
|
+
p: z69.string(),
|
|
7598
|
+
wave: z69.boolean().optional(),
|
|
7599
|
+
reflow: z69.boolean().optional()
|
|
7538
7600
|
};
|
|
7539
7601
|
var sot457DefSchema = base_def.extend({
|
|
7540
7602
|
...commonSchema,
|
|
7541
|
-
h:
|
|
7542
|
-
w:
|
|
7543
|
-
pl:
|
|
7544
|
-
pw:
|
|
7545
|
-
p:
|
|
7603
|
+
h: z69.string().default("2.5mm"),
|
|
7604
|
+
w: z69.string().default("2.7mm"),
|
|
7605
|
+
pl: z69.string().default("0.8mm"),
|
|
7606
|
+
pw: z69.string().default("0.55mm"),
|
|
7607
|
+
p: z69.string().default("0.95mm")
|
|
7546
7608
|
});
|
|
7547
7609
|
var sot457WaveSchema = base_def.extend({
|
|
7548
7610
|
...commonSchema,
|
|
7549
|
-
h:
|
|
7550
|
-
w:
|
|
7551
|
-
pillr:
|
|
7552
|
-
pl:
|
|
7553
|
-
pw:
|
|
7554
|
-
p:
|
|
7611
|
+
h: z69.string().default("3mm"),
|
|
7612
|
+
w: z69.string().default("4mm"),
|
|
7613
|
+
pillr: z69.string().default("0.225mm"),
|
|
7614
|
+
pl: z69.string().default("1.45mm"),
|
|
7615
|
+
pw: z69.string().default("1.5mm"),
|
|
7616
|
+
p: z69.string().default("1.475mm")
|
|
7555
7617
|
}).transform((data) => ({
|
|
7556
7618
|
...data,
|
|
7557
7619
|
wave: data.wave ?? (data.reflow === void 0 ? true : !data.reflow),
|
|
@@ -7690,25 +7752,25 @@ var sot457 = (rawParams) => {
|
|
|
7690
7752
|
};
|
|
7691
7753
|
|
|
7692
7754
|
// src/fn/sot963.ts
|
|
7693
|
-
import { z as
|
|
7694
|
-
import { length as
|
|
7755
|
+
import { z as z70 } from "zod";
|
|
7756
|
+
import { length as length57 } from "circuit-json";
|
|
7695
7757
|
var sot963_def = base_def.extend({
|
|
7696
|
-
fn:
|
|
7697
|
-
num_pins:
|
|
7698
|
-
w:
|
|
7699
|
-
h:
|
|
7700
|
-
p:
|
|
7701
|
-
pl:
|
|
7702
|
-
pw:
|
|
7703
|
-
string:
|
|
7758
|
+
fn: z70.string(),
|
|
7759
|
+
num_pins: z70.literal(6).default(6),
|
|
7760
|
+
w: z70.string().default("1.1mm"),
|
|
7761
|
+
h: z70.string().default("1.45mm"),
|
|
7762
|
+
p: z70.string().default("0.35mm"),
|
|
7763
|
+
pl: z70.string().default("0.2mm"),
|
|
7764
|
+
pw: z70.string().default("0.2mm"),
|
|
7765
|
+
string: z70.string().optional()
|
|
7704
7766
|
});
|
|
7705
7767
|
var sot963 = (raw_params) => {
|
|
7706
7768
|
const parameters = sot963_def.parse({ ...raw_params, fn: "sot963" });
|
|
7707
|
-
const w =
|
|
7708
|
-
const h =
|
|
7709
|
-
const p =
|
|
7710
|
-
const pl =
|
|
7711
|
-
const pw =
|
|
7769
|
+
const w = length57.parse(parameters.w);
|
|
7770
|
+
const h = length57.parse(parameters.h);
|
|
7771
|
+
const p = length57.parse(parameters.p);
|
|
7772
|
+
const pl = length57.parse(parameters.pl);
|
|
7773
|
+
const pw = length57.parse(parameters.pw);
|
|
7712
7774
|
const pads = [];
|
|
7713
7775
|
for (let i = 0; i < 6; i++) {
|
|
7714
7776
|
const { x, y } = getSot963PadCoord(i + 1, w, p, pl);
|
|
@@ -7771,19 +7833,19 @@ var getSot963PadCoord = (pn, w, p, pl) => {
|
|
|
7771
7833
|
};
|
|
7772
7834
|
|
|
7773
7835
|
// src/fn/potentiometer.ts
|
|
7774
|
-
import { z as
|
|
7836
|
+
import { z as z71 } from "zod";
|
|
7775
7837
|
var potentiometer_def = base_def.extend({
|
|
7776
|
-
fn:
|
|
7777
|
-
num_pins:
|
|
7778
|
-
p:
|
|
7779
|
-
id:
|
|
7780
|
-
od:
|
|
7781
|
-
ca:
|
|
7838
|
+
fn: z71.string(),
|
|
7839
|
+
num_pins: z71.union([z71.literal(3), z71.literal(2)]).default(3),
|
|
7840
|
+
p: z71.string().default("3.8mm"),
|
|
7841
|
+
id: z71.string().default("1.25mm"),
|
|
7842
|
+
od: z71.string().default("2.35mm"),
|
|
7843
|
+
ca: z71.string().default("14mm").describe(
|
|
7782
7844
|
"Caliper axis (width or diameter of the potentiometer body or adjustment knob)"
|
|
7783
7845
|
),
|
|
7784
|
-
w:
|
|
7785
|
-
h:
|
|
7786
|
-
string:
|
|
7846
|
+
w: z71.string().default("5.35mm"),
|
|
7847
|
+
h: z71.string().default("4mm"),
|
|
7848
|
+
string: z71.string().optional()
|
|
7787
7849
|
});
|
|
7788
7850
|
var potentiometer_acp = (parameters) => {
|
|
7789
7851
|
const { p, id, od, h, ca } = parameters;
|
|
@@ -7850,15 +7912,15 @@ var potentiometer = (raw_params) => {
|
|
|
7850
7912
|
|
|
7851
7913
|
// src/fn/electrolytic.ts
|
|
7852
7914
|
import {
|
|
7853
|
-
length as
|
|
7915
|
+
length as length58
|
|
7854
7916
|
} from "circuit-json";
|
|
7855
|
-
import { z as
|
|
7917
|
+
import { z as z72 } from "zod";
|
|
7856
7918
|
var electrolytic_def = base_def.extend({
|
|
7857
|
-
fn:
|
|
7858
|
-
p:
|
|
7859
|
-
id:
|
|
7860
|
-
od:
|
|
7861
|
-
d:
|
|
7919
|
+
fn: z72.string(),
|
|
7920
|
+
p: length58.optional().default("7.5mm"),
|
|
7921
|
+
id: length58.optional().default("1mm"),
|
|
7922
|
+
od: length58.optional().default("2mm"),
|
|
7923
|
+
d: length58.optional().default("10.5mm")
|
|
7862
7924
|
});
|
|
7863
7925
|
var generate_circle_arcs = (centerX, centerY, radius, cut, cutHeight) => {
|
|
7864
7926
|
const topArc = [];
|
|
@@ -7965,22 +8027,22 @@ var electrolytic = (raw_params) => {
|
|
|
7965
8027
|
};
|
|
7966
8028
|
|
|
7967
8029
|
// src/fn/smbf.ts
|
|
7968
|
-
import { z as
|
|
7969
|
-
import { length as
|
|
8030
|
+
import { z as z73 } from "zod";
|
|
8031
|
+
import { length as length59 } from "circuit-json";
|
|
7970
8032
|
var smbf_def = base_def.extend({
|
|
7971
|
-
fn:
|
|
7972
|
-
num_pins:
|
|
7973
|
-
w:
|
|
7974
|
-
h:
|
|
7975
|
-
pl:
|
|
7976
|
-
pw:
|
|
7977
|
-
p:
|
|
8033
|
+
fn: z73.string(),
|
|
8034
|
+
num_pins: z73.literal(2).default(2),
|
|
8035
|
+
w: z73.string().default("6.5mm"),
|
|
8036
|
+
h: z73.string().default("3mm"),
|
|
8037
|
+
pl: z73.string().default("1.75mm"),
|
|
8038
|
+
pw: z73.string().default("2.40mm"),
|
|
8039
|
+
p: z73.string().default("4.75mm")
|
|
7978
8040
|
});
|
|
7979
8041
|
var smbf = (raw_params) => {
|
|
7980
8042
|
const parameters = smbf_def.parse(raw_params);
|
|
7981
8043
|
const silkscreenRefText = silkscreenRef(
|
|
7982
8044
|
0,
|
|
7983
|
-
|
|
8045
|
+
length59.parse(parameters.h) - 0.5,
|
|
7984
8046
|
0.3
|
|
7985
8047
|
);
|
|
7986
8048
|
const silkscreenLine = {
|
|
@@ -7989,20 +8051,20 @@ var smbf = (raw_params) => {
|
|
|
7989
8051
|
pcb_component_id: "",
|
|
7990
8052
|
route: [
|
|
7991
8053
|
{
|
|
7992
|
-
x:
|
|
7993
|
-
y:
|
|
8054
|
+
x: length59.parse(parameters.p) / 2,
|
|
8055
|
+
y: length59.parse(parameters.h) / 2
|
|
7994
8056
|
},
|
|
7995
8057
|
{
|
|
7996
|
-
x: -
|
|
7997
|
-
y:
|
|
8058
|
+
x: -length59.parse(parameters.w) / 2 - 0.3,
|
|
8059
|
+
y: length59.parse(parameters.h) / 2
|
|
7998
8060
|
},
|
|
7999
8061
|
{
|
|
8000
|
-
x: -
|
|
8001
|
-
y: -
|
|
8062
|
+
x: -length59.parse(parameters.w) / 2 - 0.3,
|
|
8063
|
+
y: -length59.parse(parameters.h) / 2
|
|
8002
8064
|
},
|
|
8003
8065
|
{
|
|
8004
|
-
x:
|
|
8005
|
-
y: -
|
|
8066
|
+
x: length59.parse(parameters.p) / 2,
|
|
8067
|
+
y: -length59.parse(parameters.h) / 2
|
|
8006
8068
|
}
|
|
8007
8069
|
],
|
|
8008
8070
|
stroke_width: 0.1,
|
|
@@ -8044,16 +8106,16 @@ var smbfWithoutParsing = (parameters) => {
|
|
|
8044
8106
|
};
|
|
8045
8107
|
|
|
8046
8108
|
// src/fn/sot323.ts
|
|
8047
|
-
import { z as
|
|
8109
|
+
import { z as z74 } from "zod";
|
|
8048
8110
|
var sot323_def = base_def.extend({
|
|
8049
|
-
fn:
|
|
8050
|
-
num_pins:
|
|
8051
|
-
w:
|
|
8052
|
-
h:
|
|
8053
|
-
pl:
|
|
8054
|
-
pw:
|
|
8055
|
-
p:
|
|
8056
|
-
string:
|
|
8111
|
+
fn: z74.string(),
|
|
8112
|
+
num_pins: z74.number().default(3),
|
|
8113
|
+
w: z74.string().default("2.45mm"),
|
|
8114
|
+
h: z74.string().default("2.40mm"),
|
|
8115
|
+
pl: z74.string().default("0.92mm"),
|
|
8116
|
+
pw: z74.string().default("0.45mm"),
|
|
8117
|
+
p: z74.string().default("0.891mm"),
|
|
8118
|
+
string: z74.string().optional()
|
|
8057
8119
|
});
|
|
8058
8120
|
var sot323 = (raw_params) => {
|
|
8059
8121
|
const match = raw_params.string?.match(/^sot323_(\d+)/);
|
|
@@ -8141,30 +8203,30 @@ var sot323_3 = (parameters) => {
|
|
|
8141
8203
|
};
|
|
8142
8204
|
|
|
8143
8205
|
// src/fn/smtpad.ts
|
|
8144
|
-
import { z as
|
|
8145
|
-
import { length as
|
|
8146
|
-
import { mm as
|
|
8206
|
+
import { z as z75 } from "zod";
|
|
8207
|
+
import { length as length60 } from "circuit-json";
|
|
8208
|
+
import { mm as mm15 } from "@tscircuit/mm";
|
|
8147
8209
|
var smtpad_def = base_def.extend({
|
|
8148
|
-
fn:
|
|
8149
|
-
circle:
|
|
8150
|
-
rect:
|
|
8151
|
-
square:
|
|
8152
|
-
pill:
|
|
8153
|
-
d:
|
|
8154
|
-
pd:
|
|
8155
|
-
diameter:
|
|
8156
|
-
r:
|
|
8157
|
-
pr:
|
|
8158
|
-
radius:
|
|
8159
|
-
w:
|
|
8160
|
-
pw:
|
|
8161
|
-
width:
|
|
8162
|
-
h:
|
|
8163
|
-
ph:
|
|
8164
|
-
height:
|
|
8165
|
-
s:
|
|
8166
|
-
size:
|
|
8167
|
-
string:
|
|
8210
|
+
fn: z75.string(),
|
|
8211
|
+
circle: z75.boolean().optional(),
|
|
8212
|
+
rect: z75.boolean().optional(),
|
|
8213
|
+
square: z75.boolean().optional(),
|
|
8214
|
+
pill: z75.boolean().optional(),
|
|
8215
|
+
d: length60.optional(),
|
|
8216
|
+
pd: length60.optional(),
|
|
8217
|
+
diameter: length60.optional(),
|
|
8218
|
+
r: length60.optional(),
|
|
8219
|
+
pr: length60.optional(),
|
|
8220
|
+
radius: length60.optional(),
|
|
8221
|
+
w: length60.optional(),
|
|
8222
|
+
pw: length60.optional(),
|
|
8223
|
+
width: length60.optional(),
|
|
8224
|
+
h: length60.optional(),
|
|
8225
|
+
ph: length60.optional(),
|
|
8226
|
+
height: length60.optional(),
|
|
8227
|
+
s: length60.optional(),
|
|
8228
|
+
size: length60.optional(),
|
|
8229
|
+
string: z75.string().optional()
|
|
8168
8230
|
}).transform((v) => {
|
|
8169
8231
|
let shape = "rect";
|
|
8170
8232
|
if (v.circle) shape = "circle";
|
|
@@ -8175,27 +8237,27 @@ var smtpad_def = base_def.extend({
|
|
|
8175
8237
|
let width;
|
|
8176
8238
|
let height;
|
|
8177
8239
|
if (shape === "circle") {
|
|
8178
|
-
if (v.r !== void 0) radius =
|
|
8179
|
-
else if (v.pr !== void 0) radius =
|
|
8180
|
-
else if (v.radius !== void 0) radius =
|
|
8181
|
-
else if (v.d !== void 0) radius =
|
|
8182
|
-
else if (v.pd !== void 0) radius =
|
|
8183
|
-
else if (v.diameter !== void 0) radius =
|
|
8184
|
-
else radius =
|
|
8240
|
+
if (v.r !== void 0) radius = mm15(v.r);
|
|
8241
|
+
else if (v.pr !== void 0) radius = mm15(v.pr);
|
|
8242
|
+
else if (v.radius !== void 0) radius = mm15(v.radius);
|
|
8243
|
+
else if (v.d !== void 0) radius = mm15(v.d) / 2;
|
|
8244
|
+
else if (v.pd !== void 0) radius = mm15(v.pd) / 2;
|
|
8245
|
+
else if (v.diameter !== void 0) radius = mm15(v.diameter) / 2;
|
|
8246
|
+
else radius = mm15("1mm") / 2;
|
|
8185
8247
|
} else {
|
|
8186
|
-
if (v.w !== void 0) width =
|
|
8187
|
-
else if (v.pw !== void 0) width =
|
|
8188
|
-
else if (v.width !== void 0) width =
|
|
8189
|
-
else if (v.s !== void 0) width =
|
|
8190
|
-
else if (v.size !== void 0) width =
|
|
8191
|
-
else width =
|
|
8192
|
-
if (v.h !== void 0) height =
|
|
8193
|
-
else if (v.ph !== void 0) height =
|
|
8194
|
-
else if (v.height !== void 0) height =
|
|
8248
|
+
if (v.w !== void 0) width = mm15(v.w);
|
|
8249
|
+
else if (v.pw !== void 0) width = mm15(v.pw);
|
|
8250
|
+
else if (v.width !== void 0) width = mm15(v.width);
|
|
8251
|
+
else if (v.s !== void 0) width = mm15(v.s);
|
|
8252
|
+
else if (v.size !== void 0) width = mm15(v.size);
|
|
8253
|
+
else width = mm15("1mm");
|
|
8254
|
+
if (v.h !== void 0) height = mm15(v.h);
|
|
8255
|
+
else if (v.ph !== void 0) height = mm15(v.ph);
|
|
8256
|
+
else if (v.height !== void 0) height = mm15(v.height);
|
|
8195
8257
|
else if (shape === "square") height = width;
|
|
8196
8258
|
else if (shape === "rect")
|
|
8197
8259
|
height = width;
|
|
8198
|
-
else height =
|
|
8260
|
+
else height = mm15("1mm");
|
|
8199
8261
|
}
|
|
8200
8262
|
return {
|
|
8201
8263
|
fn: v.fn,
|
|
@@ -8230,28 +8292,28 @@ var smtpad = (raw_params) => {
|
|
|
8230
8292
|
};
|
|
8231
8293
|
|
|
8232
8294
|
// src/fn/platedhole.ts
|
|
8233
|
-
import { z as
|
|
8234
|
-
import { length as
|
|
8235
|
-
import { mm as
|
|
8295
|
+
import { z as z76 } from "zod";
|
|
8296
|
+
import { length as length61 } from "circuit-json";
|
|
8297
|
+
import { mm as mm16 } from "@tscircuit/mm";
|
|
8236
8298
|
var platedhole_def = base_def.extend({
|
|
8237
|
-
fn:
|
|
8238
|
-
d:
|
|
8239
|
-
hd:
|
|
8240
|
-
r:
|
|
8241
|
-
hr:
|
|
8242
|
-
pd:
|
|
8243
|
-
pr:
|
|
8244
|
-
squarepad:
|
|
8299
|
+
fn: z76.string(),
|
|
8300
|
+
d: length61.optional(),
|
|
8301
|
+
hd: length61.optional(),
|
|
8302
|
+
r: length61.optional(),
|
|
8303
|
+
hr: length61.optional(),
|
|
8304
|
+
pd: length61.optional(),
|
|
8305
|
+
pr: length61.optional(),
|
|
8306
|
+
squarepad: z76.boolean().optional().default(false)
|
|
8245
8307
|
}).transform((v) => {
|
|
8246
8308
|
let holeD;
|
|
8247
|
-
if (v.d !== void 0) holeD =
|
|
8248
|
-
else if (v.hd !== void 0) holeD =
|
|
8249
|
-
else if (v.r !== void 0) holeD =
|
|
8250
|
-
else if (v.hr !== void 0) holeD =
|
|
8251
|
-
else holeD =
|
|
8309
|
+
if (v.d !== void 0) holeD = mm16(v.d);
|
|
8310
|
+
else if (v.hd !== void 0) holeD = mm16(v.hd);
|
|
8311
|
+
else if (v.r !== void 0) holeD = mm16(v.r) * 2;
|
|
8312
|
+
else if (v.hr !== void 0) holeD = mm16(v.hr) * 2;
|
|
8313
|
+
else holeD = mm16("1mm");
|
|
8252
8314
|
let padD;
|
|
8253
|
-
if (v.pd !== void 0) padD =
|
|
8254
|
-
else if (v.pr !== void 0) padD =
|
|
8315
|
+
if (v.pd !== void 0) padD = mm16(v.pd);
|
|
8316
|
+
else if (v.pr !== void 0) padD = mm16(v.pr) * 2;
|
|
8255
8317
|
else padD = holeD * (1.5 / 1);
|
|
8256
8318
|
return {
|
|
8257
8319
|
fn: v.fn,
|
|
@@ -8280,14 +8342,14 @@ var platedhole2 = (raw_params) => {
|
|
|
8280
8342
|
};
|
|
8281
8343
|
|
|
8282
8344
|
// src/fn/sot.ts
|
|
8283
|
-
import { z as
|
|
8345
|
+
import { z as z77 } from "zod";
|
|
8284
8346
|
var sot_def = base_def.extend({
|
|
8285
|
-
fn:
|
|
8286
|
-
num_pins:
|
|
8287
|
-
h:
|
|
8288
|
-
pl:
|
|
8289
|
-
pw:
|
|
8290
|
-
p:
|
|
8347
|
+
fn: z77.string(),
|
|
8348
|
+
num_pins: z77.literal(6).default(6),
|
|
8349
|
+
h: z77.string().default("1.6mm"),
|
|
8350
|
+
pl: z77.string().default("1mm"),
|
|
8351
|
+
pw: z77.string().default("0.7mm"),
|
|
8352
|
+
p: z77.string().default("0.95mm")
|
|
8291
8353
|
});
|
|
8292
8354
|
var sot = (raw_params) => {
|
|
8293
8355
|
const parameters = sot_def.parse(raw_params);
|
|
@@ -8404,16 +8466,16 @@ var sotWithoutParsing = (parameters) => {
|
|
|
8404
8466
|
};
|
|
8405
8467
|
|
|
8406
8468
|
// src/fn/sot343.ts
|
|
8407
|
-
import { z as
|
|
8469
|
+
import { z as z78 } from "zod";
|
|
8408
8470
|
var sot343_def = base_def.extend({
|
|
8409
|
-
fn:
|
|
8410
|
-
num_pins:
|
|
8411
|
-
w:
|
|
8412
|
-
h:
|
|
8413
|
-
pl:
|
|
8414
|
-
pw:
|
|
8415
|
-
p:
|
|
8416
|
-
string:
|
|
8471
|
+
fn: z78.string(),
|
|
8472
|
+
num_pins: z78.number().default(4),
|
|
8473
|
+
w: z78.string().default("3.2mm"),
|
|
8474
|
+
h: z78.string().default("2.6mm"),
|
|
8475
|
+
pl: z78.string().default("1.05mm"),
|
|
8476
|
+
pw: z78.string().default("0.45mm"),
|
|
8477
|
+
p: z78.string().default("0.55mm"),
|
|
8478
|
+
string: z78.string().optional()
|
|
8417
8479
|
});
|
|
8418
8480
|
var sot343 = (raw_params) => {
|
|
8419
8481
|
const match = raw_params.string?.match(/^sot343_(\d+)/);
|
|
@@ -8508,9 +8570,9 @@ var sot343_4 = (parameters) => {
|
|
|
8508
8570
|
};
|
|
8509
8571
|
|
|
8510
8572
|
// src/fn/m2host.ts
|
|
8511
|
-
import { z as
|
|
8573
|
+
import { z as z79 } from "zod";
|
|
8512
8574
|
var m2host_def = base_def.extend({
|
|
8513
|
-
fn:
|
|
8575
|
+
fn: z79.string()
|
|
8514
8576
|
});
|
|
8515
8577
|
var m2host = (raw_params) => {
|
|
8516
8578
|
const parameters = m2host_def.parse(raw_params);
|
|
@@ -8614,42 +8676,42 @@ var m2host = (raw_params) => {
|
|
|
8614
8676
|
};
|
|
8615
8677
|
|
|
8616
8678
|
// src/fn/mountedpcbmodule.ts
|
|
8617
|
-
import { length as
|
|
8618
|
-
import { z as
|
|
8679
|
+
import { length as length62 } from "circuit-json";
|
|
8680
|
+
import { z as z80 } from "zod";
|
|
8619
8681
|
var mountedpcbmodule_def = base_def.extend({
|
|
8620
|
-
fn:
|
|
8621
|
-
numPins:
|
|
8622
|
-
rows:
|
|
8623
|
-
p:
|
|
8624
|
-
id:
|
|
8625
|
-
od:
|
|
8626
|
-
male:
|
|
8627
|
-
nopin:
|
|
8628
|
-
female:
|
|
8629
|
-
smd:
|
|
8630
|
-
pinlabeltextalignleft:
|
|
8631
|
-
pinlabeltextaligncenter:
|
|
8632
|
-
pinlabeltextalignright:
|
|
8633
|
-
pinlabelverticallyinverted:
|
|
8634
|
-
pinlabelorthogonal:
|
|
8635
|
-
nopinlabels:
|
|
8636
|
-
doublesidedpinlabel:
|
|
8637
|
-
bottomsidepinlabel:
|
|
8682
|
+
fn: z80.string(),
|
|
8683
|
+
numPins: z80.number().optional().default(0),
|
|
8684
|
+
rows: z80.union([z80.string(), z80.number()]).transform((val) => Number(val)).optional().default(1).describe("number of rows"),
|
|
8685
|
+
p: length62.default("2.54mm").describe("pitch"),
|
|
8686
|
+
id: length62.default("1.0mm").describe("inner diameter"),
|
|
8687
|
+
od: length62.default("1.5mm").describe("outer diameter"),
|
|
8688
|
+
male: z80.boolean().optional().describe("the module uses male headers"),
|
|
8689
|
+
nopin: z80.boolean().optional().default(false).describe("omit pins rendering"),
|
|
8690
|
+
female: z80.boolean().optional().describe("the module uses female headers"),
|
|
8691
|
+
smd: z80.boolean().optional().describe("surface mount device"),
|
|
8692
|
+
pinlabeltextalignleft: z80.boolean().optional().default(false),
|
|
8693
|
+
pinlabeltextaligncenter: z80.boolean().optional().default(false),
|
|
8694
|
+
pinlabeltextalignright: z80.boolean().optional().default(false),
|
|
8695
|
+
pinlabelverticallyinverted: z80.boolean().optional().default(false),
|
|
8696
|
+
pinlabelorthogonal: z80.boolean().optional().default(false),
|
|
8697
|
+
nopinlabels: z80.boolean().optional().default(false).describe("omit silkscreen pin labels"),
|
|
8698
|
+
doublesidedpinlabel: z80.boolean().optional().default(false).describe("add silkscreen pins in top and bottom layers"),
|
|
8699
|
+
bottomsidepinlabel: z80.boolean().optional().default(false).describe(
|
|
8638
8700
|
"place the silkscreen reference text on the bottom layer instead of top"
|
|
8639
8701
|
),
|
|
8640
|
-
pinRowSide:
|
|
8641
|
-
pinrowleft:
|
|
8642
|
-
pinrowright:
|
|
8643
|
-
pinrowtop:
|
|
8644
|
-
pinrowbottom:
|
|
8645
|
-
pinrowleftpins:
|
|
8646
|
-
pinrowrightpins:
|
|
8647
|
-
pinrowtoppins:
|
|
8648
|
-
pinrowbottompins:
|
|
8649
|
-
width:
|
|
8650
|
-
height:
|
|
8651
|
-
pinRowHoleEdgeToEdgeDist:
|
|
8652
|
-
holes:
|
|
8702
|
+
pinRowSide: z80.enum(["left", "right", "top", "bottom"]).optional().default("left"),
|
|
8703
|
+
pinrowleft: z80.boolean().optional().default(false),
|
|
8704
|
+
pinrowright: z80.boolean().optional().default(false),
|
|
8705
|
+
pinrowtop: z80.boolean().optional().default(false),
|
|
8706
|
+
pinrowbottom: z80.boolean().optional().default(false),
|
|
8707
|
+
pinrowleftpins: z80.union([z80.string(), z80.number()]).transform((val) => Number(val)).optional(),
|
|
8708
|
+
pinrowrightpins: z80.union([z80.string(), z80.number()]).transform((val) => Number(val)).optional(),
|
|
8709
|
+
pinrowtoppins: z80.union([z80.string(), z80.number()]).transform((val) => Number(val)).optional(),
|
|
8710
|
+
pinrowbottompins: z80.union([z80.string(), z80.number()]).transform((val) => Number(val)).optional(),
|
|
8711
|
+
width: length62.optional(),
|
|
8712
|
+
height: length62.optional(),
|
|
8713
|
+
pinRowHoleEdgeToEdgeDist: length62.default("2mm"),
|
|
8714
|
+
holes: z80.union([z80.string(), z80.array(z80.string())]).optional().transform((val) => {
|
|
8653
8715
|
if (!val) return val;
|
|
8654
8716
|
if (Array.isArray(val)) return val;
|
|
8655
8717
|
if (val.startsWith("(") && val.endsWith(")")) {
|
|
@@ -8657,23 +8719,23 @@ var mountedpcbmodule_def = base_def.extend({
|
|
|
8657
8719
|
}
|
|
8658
8720
|
return [val];
|
|
8659
8721
|
}),
|
|
8660
|
-
holeXDist:
|
|
8661
|
-
holeYDist:
|
|
8662
|
-
holeInset:
|
|
8663
|
-
pinrow:
|
|
8664
|
-
usbposition:
|
|
8665
|
-
usbleft:
|
|
8666
|
-
usbtop:
|
|
8667
|
-
usbright:
|
|
8668
|
-
usbbottom:
|
|
8669
|
-
usbtype:
|
|
8670
|
-
usbmicro:
|
|
8671
|
-
usbc:
|
|
8672
|
-
screen:
|
|
8673
|
-
screenwidth:
|
|
8674
|
-
screenheight:
|
|
8675
|
-
screencenteroffsetx:
|
|
8676
|
-
screencenteroffsety:
|
|
8722
|
+
holeXDist: length62.optional(),
|
|
8723
|
+
holeYDist: length62.optional(),
|
|
8724
|
+
holeInset: length62.default("1mm"),
|
|
8725
|
+
pinrow: z80.union([z80.string(), z80.number()]).optional(),
|
|
8726
|
+
usbposition: z80.enum(["left", "right", "top", "bottom"]).optional().default("left"),
|
|
8727
|
+
usbleft: z80.boolean().optional().default(false),
|
|
8728
|
+
usbtop: z80.boolean().optional().default(false),
|
|
8729
|
+
usbright: z80.boolean().optional().default(false),
|
|
8730
|
+
usbbottom: z80.boolean().optional().default(false),
|
|
8731
|
+
usbtype: z80.enum(["micro", "c"]).optional(),
|
|
8732
|
+
usbmicro: z80.boolean().optional().default(false),
|
|
8733
|
+
usbc: z80.boolean().optional().default(false),
|
|
8734
|
+
screen: z80.boolean().optional().default(false).describe("add silkscreen outline for screen/display area"),
|
|
8735
|
+
screenwidth: length62.optional(),
|
|
8736
|
+
screenheight: length62.optional(),
|
|
8737
|
+
screencenteroffsetx: length62.optional(),
|
|
8738
|
+
screencenteroffsety: length62.optional()
|
|
8677
8739
|
}).transform((data) => {
|
|
8678
8740
|
const pinlabelAnchorSide = determinePinlabelAnchorSide(data);
|
|
8679
8741
|
let pinRowSide = data.pinRowSide;
|
|
@@ -8765,7 +8827,7 @@ var mountedpcbmodule_def = base_def.extend({
|
|
|
8765
8827
|
}).superRefine((data, ctx) => {
|
|
8766
8828
|
if (data.male && data.female) {
|
|
8767
8829
|
ctx.addIssue({
|
|
8768
|
-
code:
|
|
8830
|
+
code: z80.ZodIssueCode.custom,
|
|
8769
8831
|
message: "'male' and 'female' cannot both be true; it should be male or female.",
|
|
8770
8832
|
path: ["male", "female"]
|
|
8771
8833
|
});
|
|
@@ -9108,16 +9170,16 @@ var mountedpcbmodule = (raw_params) => {
|
|
|
9108
9170
|
};
|
|
9109
9171
|
|
|
9110
9172
|
// src/fn/to92l.ts
|
|
9111
|
-
import { z as
|
|
9173
|
+
import { z as z81 } from "zod";
|
|
9112
9174
|
var to92l_def = base_def.extend({
|
|
9113
|
-
fn:
|
|
9114
|
-
num_pins:
|
|
9115
|
-
inline:
|
|
9116
|
-
p:
|
|
9117
|
-
id:
|
|
9118
|
-
od:
|
|
9119
|
-
w:
|
|
9120
|
-
h:
|
|
9175
|
+
fn: z81.string(),
|
|
9176
|
+
num_pins: z81.number().default(3),
|
|
9177
|
+
inline: z81.boolean().default(false),
|
|
9178
|
+
p: z81.string().default("1.27mm"),
|
|
9179
|
+
id: z81.string().default("0.75mm"),
|
|
9180
|
+
od: z81.string().default("1.3mm"),
|
|
9181
|
+
w: z81.string().default("4.8mm"),
|
|
9182
|
+
h: z81.string().default("4.0mm")
|
|
9121
9183
|
});
|
|
9122
9184
|
var to92l = (raw_params) => {
|
|
9123
9185
|
const parameters = to92l_def.parse(raw_params);
|
|
@@ -9295,9 +9357,13 @@ function isNotNull(value) {
|
|
|
9295
9357
|
}
|
|
9296
9358
|
|
|
9297
9359
|
// src/footprinter.ts
|
|
9360
|
+
var normalizeDefinition = (def) => {
|
|
9361
|
+
return def.trim().replace(/^sot-223-(\d+)(?=_|$)/i, "sot223_$1").replace(/^to-220f-(\d+)(?=_|$)/i, "to220f_$1");
|
|
9362
|
+
};
|
|
9298
9363
|
var string2 = (def) => {
|
|
9299
9364
|
let fp2 = footprinter();
|
|
9300
|
-
const
|
|
9365
|
+
const normalizedDef = normalizeDefinition(def);
|
|
9366
|
+
const modifiedDef = normalizedDef.replace(/^((?:\d{4}|\d{5}))(?=$|_|x)/, "res$1").replace(/^zh(\d+)(?:$|_)/, "jst$1_zh");
|
|
9301
9367
|
const def_parts = modifiedDef.split(/_(?!metric)/).map((s) => {
|
|
9302
9368
|
const m = s.match(/([a-zA-Z]+)([\(\d\.\+\?].*)?/);
|
|
9303
9369
|
if (!m) return null;
|
|
@@ -9310,7 +9376,7 @@ var string2 = (def) => {
|
|
|
9310
9376
|
for (const { fn, v } of def_parts) {
|
|
9311
9377
|
fp2 = fp2[fn](v);
|
|
9312
9378
|
}
|
|
9313
|
-
fp2.setString(
|
|
9379
|
+
fp2.setString(normalizedDef);
|
|
9314
9380
|
return fp2;
|
|
9315
9381
|
};
|
|
9316
9382
|
var getFootprintNames = () => {
|