@tscircuit/footprinter 0.0.311 → 0.0.313
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 +327 -207
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -87,6 +87,7 @@ __export(fn_exports, {
|
|
|
87
87
|
to92s: () => to92s,
|
|
88
88
|
tqfp: () => tqfp,
|
|
89
89
|
tssop: () => tssop,
|
|
90
|
+
vson: () => vson,
|
|
90
91
|
vssop: () => vssop
|
|
91
92
|
});
|
|
92
93
|
|
|
@@ -4363,7 +4364,12 @@ var sodWithoutParsing2 = (parameters) => {
|
|
|
4363
4364
|
};
|
|
4364
4365
|
|
|
4365
4366
|
// src/fn/sop8.ts
|
|
4366
|
-
var sop8_def = extendSoicDef({
|
|
4367
|
+
var sop8_def = extendSoicDef({
|
|
4368
|
+
w: "7.05mm",
|
|
4369
|
+
p: "1.27mm",
|
|
4370
|
+
pw: "0.65mm",
|
|
4371
|
+
pl: "1.975mm"
|
|
4372
|
+
});
|
|
4367
4373
|
var sop8 = (raw_params) => {
|
|
4368
4374
|
const parameters = sop8_def.parse(raw_params);
|
|
4369
4375
|
const pads = [];
|
|
@@ -4381,19 +4387,15 @@ var sop8 = (raw_params) => {
|
|
|
4381
4387
|
);
|
|
4382
4388
|
}
|
|
4383
4389
|
const sh = (parameters.num_pins / 2 - 1) * parameters.p + parameters.pw;
|
|
4384
|
-
const silkscreenRefText = silkscreenRef(
|
|
4385
|
-
0,
|
|
4386
|
-
sh / 2 - 0.5,
|
|
4387
|
-
sh / 12
|
|
4388
|
-
);
|
|
4390
|
+
const silkscreenRefText = silkscreenRef(0, sh / 2 + 1, sh / 12);
|
|
4389
4391
|
const silkscreenLine = {
|
|
4390
4392
|
layer: "top",
|
|
4391
4393
|
pcb_component_id: "",
|
|
4392
4394
|
pcb_silkscreen_path_id: "",
|
|
4393
4395
|
type: "pcb_silkscreen_path",
|
|
4394
4396
|
route: [
|
|
4395
|
-
{ x: -parameters.w / 3, y: sh / 2 + 0.
|
|
4396
|
-
{ x: parameters.w / 3, y: sh / 2 + 0.
|
|
4397
|
+
{ x: -parameters.w / 3, y: sh / 2 + 0.4 },
|
|
4398
|
+
{ x: parameters.w / 3, y: sh / 2 + 0.4 }
|
|
4397
4399
|
],
|
|
4398
4400
|
stroke_width: 0.1
|
|
4399
4401
|
};
|
|
@@ -5217,14 +5219,14 @@ var sot89_3 = (parameters) => {
|
|
|
5217
5219
|
const pads = [];
|
|
5218
5220
|
const padGap = Number.parseFloat(parameters.p);
|
|
5219
5221
|
const padWidth = Number.parseFloat(parameters.pw);
|
|
5220
|
-
const
|
|
5222
|
+
const length62 = Number.parseFloat(parameters.w);
|
|
5221
5223
|
const padHeight = Number.parseFloat(parameters.pl);
|
|
5222
5224
|
const centerExtra = 0.175;
|
|
5223
5225
|
const outerPadXShift = (padHeight - (padHeight + centerExtra)) / 2;
|
|
5224
5226
|
pads.push(
|
|
5225
|
-
rectpad(1, -
|
|
5226
|
-
rectpad(2, -
|
|
5227
|
-
rectpad(3, -
|
|
5227
|
+
rectpad(1, -length62 / 2 + outerPadXShift, padGap, padHeight, padWidth),
|
|
5228
|
+
rectpad(2, -length62 / 2, 0, padHeight + centerExtra, padWidth),
|
|
5229
|
+
rectpad(3, -length62 / 2 + outerPadXShift, -padGap, padHeight, padWidth)
|
|
5228
5230
|
);
|
|
5229
5231
|
const silkscreenRefText = silkscreenRef(0, 0, 0.3);
|
|
5230
5232
|
const width = Number.parseFloat(parameters.w) / 2 - 1;
|
|
@@ -5264,7 +5266,7 @@ var sot89_5 = (parameters) => {
|
|
|
5264
5266
|
const pads = [];
|
|
5265
5267
|
const padGap = Number.parseFloat(parameters.p);
|
|
5266
5268
|
const padWidth = Number.parseFloat(parameters.pw);
|
|
5267
|
-
const
|
|
5269
|
+
const length62 = Number.parseFloat(parameters.w);
|
|
5268
5270
|
pads.push(
|
|
5269
5271
|
rectpad(1, -1.85, -1.5, 1.5, 0.7),
|
|
5270
5272
|
rectpad(2, -1.85, 1.5, 1.5, 0.7),
|
|
@@ -7256,13 +7258,131 @@ var getSonPadCoord = (num_pins, pn, w, p) => {
|
|
|
7256
7258
|
};
|
|
7257
7259
|
};
|
|
7258
7260
|
|
|
7261
|
+
// src/fn/vson.ts
|
|
7262
|
+
import { z as z67 } from "zod";
|
|
7263
|
+
import { length as length54, distance as distance3 } from "circuit-json";
|
|
7264
|
+
var vson_def = base_def.extend({
|
|
7265
|
+
fn: z67.string(),
|
|
7266
|
+
num_pins: z67.number().optional().default(8),
|
|
7267
|
+
p: distance3.describe("pitch (distance between center of each pin)"),
|
|
7268
|
+
w: length54.describe("width between vertical rows of pins"),
|
|
7269
|
+
grid: dim2d.describe("width and height of the border of the footprint"),
|
|
7270
|
+
ep: dim2d.default("0x0mm").describe("width and height of the central exposed thermal pad"),
|
|
7271
|
+
epx: length54.default("0mm").describe("x offset of the center of the central exposed thermal pad"),
|
|
7272
|
+
pinw: length54.describe("width of the pin pads"),
|
|
7273
|
+
pinh: length54.describe("height of the pin pads")
|
|
7274
|
+
});
|
|
7275
|
+
var vson = (raw_params) => {
|
|
7276
|
+
const parameters = vson_def.parse(raw_params);
|
|
7277
|
+
const { num_pins, p, w, grid, ep, epx, pinw, pinh } = parameters;
|
|
7278
|
+
if (num_pins % 2 !== 0) {
|
|
7279
|
+
throw new Error("invalid number of pins");
|
|
7280
|
+
}
|
|
7281
|
+
const pads = [];
|
|
7282
|
+
for (let i = 0; i < num_pins; i++) {
|
|
7283
|
+
const { pinX, pinY } = getCcwVsonCoords({
|
|
7284
|
+
pinCount: num_pins,
|
|
7285
|
+
pinIndex: i,
|
|
7286
|
+
width: w,
|
|
7287
|
+
pitch: p
|
|
7288
|
+
});
|
|
7289
|
+
pads.push(rectpad(i + 1, pinX, pinY, pinw, pinh));
|
|
7290
|
+
}
|
|
7291
|
+
if (ep.x > 0 && ep.y > 0) {
|
|
7292
|
+
pads.push(rectpad(parameters.num_pins + 1, epx, 0, ep.x, ep.y));
|
|
7293
|
+
}
|
|
7294
|
+
const silkscreenPaths = getSilkscreenPaths(grid);
|
|
7295
|
+
const silkscreenRefText = silkscreenRef(
|
|
7296
|
+
0,
|
|
7297
|
+
grid.y / 2 + p,
|
|
7298
|
+
grid.y / 6
|
|
7299
|
+
);
|
|
7300
|
+
return {
|
|
7301
|
+
circuitJson: [...pads, ...silkscreenPaths, silkscreenRefText],
|
|
7302
|
+
parameters
|
|
7303
|
+
};
|
|
7304
|
+
};
|
|
7305
|
+
var getCcwVsonCoords = (params) => {
|
|
7306
|
+
let pinY = 0;
|
|
7307
|
+
let pinX = 0;
|
|
7308
|
+
const centerY = (params.pinCount / 2 - 1) * params.pitch / 2;
|
|
7309
|
+
const pinHalf = params.pinCount / 2;
|
|
7310
|
+
if (params.pinIndex + 1 <= pinHalf) {
|
|
7311
|
+
pinY = params.pitch * params.pinIndex - centerY;
|
|
7312
|
+
pinX = 0 - params.width / 2;
|
|
7313
|
+
} else {
|
|
7314
|
+
pinY = params.pitch * (params.pinCount - params.pinIndex - 1) - centerY;
|
|
7315
|
+
pinX = params.width / 2;
|
|
7316
|
+
}
|
|
7317
|
+
return { pinX, pinY };
|
|
7318
|
+
};
|
|
7319
|
+
var getSilkscreenPaths = (grid) => {
|
|
7320
|
+
const borderMargin = 0.1;
|
|
7321
|
+
const cornerLine = grid.y / 30;
|
|
7322
|
+
const silkscreenPaths = [
|
|
7323
|
+
// top silkscreen path
|
|
7324
|
+
{
|
|
7325
|
+
layer: "top",
|
|
7326
|
+
pcb_component_id: "",
|
|
7327
|
+
pcb_silkscreen_path_id: "",
|
|
7328
|
+
type: "pcb_silkscreen_path",
|
|
7329
|
+
route: [
|
|
7330
|
+
{
|
|
7331
|
+
x: -grid.x / 2 - borderMargin,
|
|
7332
|
+
y: grid.y / 2 + borderMargin - cornerLine
|
|
7333
|
+
},
|
|
7334
|
+
{
|
|
7335
|
+
x: -grid.x / 2 - borderMargin,
|
|
7336
|
+
y: grid.y / 2 + borderMargin
|
|
7337
|
+
},
|
|
7338
|
+
{
|
|
7339
|
+
x: grid.x / 2 + borderMargin,
|
|
7340
|
+
y: grid.y / 2 + borderMargin
|
|
7341
|
+
},
|
|
7342
|
+
{
|
|
7343
|
+
x: grid.x / 2 + borderMargin,
|
|
7344
|
+
y: grid.y / 2 + borderMargin - cornerLine
|
|
7345
|
+
}
|
|
7346
|
+
],
|
|
7347
|
+
stroke_width: grid.y / 30
|
|
7348
|
+
},
|
|
7349
|
+
// bottom silkscreen path
|
|
7350
|
+
{
|
|
7351
|
+
layer: "top",
|
|
7352
|
+
pcb_component_id: "",
|
|
7353
|
+
pcb_silkscreen_path_id: "",
|
|
7354
|
+
type: "pcb_silkscreen_path",
|
|
7355
|
+
route: [
|
|
7356
|
+
{
|
|
7357
|
+
x: -grid.x / 2 - borderMargin,
|
|
7358
|
+
y: -grid.y / 2 - borderMargin + cornerLine
|
|
7359
|
+
},
|
|
7360
|
+
{
|
|
7361
|
+
x: -grid.x / 2 - borderMargin,
|
|
7362
|
+
y: -grid.y / 2 - borderMargin
|
|
7363
|
+
},
|
|
7364
|
+
{
|
|
7365
|
+
x: grid.x / 2 + borderMargin,
|
|
7366
|
+
y: -grid.y / 2 - borderMargin
|
|
7367
|
+
},
|
|
7368
|
+
{
|
|
7369
|
+
x: grid.x / 2 + borderMargin,
|
|
7370
|
+
y: -grid.y / 2 - borderMargin + cornerLine
|
|
7371
|
+
}
|
|
7372
|
+
],
|
|
7373
|
+
stroke_width: grid.y / 30
|
|
7374
|
+
}
|
|
7375
|
+
];
|
|
7376
|
+
return silkscreenPaths;
|
|
7377
|
+
};
|
|
7378
|
+
|
|
7259
7379
|
// src/fn/solderjumper.ts
|
|
7260
|
-
import { length as
|
|
7380
|
+
import { length as length55 } from "circuit-json";
|
|
7261
7381
|
var solderjumper = (params) => {
|
|
7262
7382
|
const { num_pins, bridged, p = 2.54, pw = 1.5, ph = 1.5 } = params;
|
|
7263
|
-
const padSpacing7 =
|
|
7264
|
-
const padWidth =
|
|
7265
|
-
const padHeight =
|
|
7383
|
+
const padSpacing7 = length55.parse(p);
|
|
7384
|
+
const padWidth = length55.parse(pw);
|
|
7385
|
+
const padHeight = length55.parse(ph);
|
|
7266
7386
|
const traceWidth = Math.min(padHeight / 4, 0.5);
|
|
7267
7387
|
const pads = [];
|
|
7268
7388
|
for (let i = 0; i < num_pins; i++) {
|
|
@@ -7350,34 +7470,34 @@ var solderjumper = (params) => {
|
|
|
7350
7470
|
};
|
|
7351
7471
|
|
|
7352
7472
|
// src/fn/sot457.ts
|
|
7353
|
-
import { z as
|
|
7473
|
+
import { z as z68 } from "zod";
|
|
7354
7474
|
var commonSchema = {
|
|
7355
|
-
fn:
|
|
7356
|
-
num_pins:
|
|
7357
|
-
pillh:
|
|
7358
|
-
pillw:
|
|
7359
|
-
pl:
|
|
7360
|
-
pw:
|
|
7361
|
-
p:
|
|
7362
|
-
wave:
|
|
7363
|
-
reflow:
|
|
7475
|
+
fn: z68.literal("sot457"),
|
|
7476
|
+
num_pins: z68.literal(6).default(6),
|
|
7477
|
+
pillh: z68.string().default("0.45mm"),
|
|
7478
|
+
pillw: z68.string().default("1.45mm"),
|
|
7479
|
+
pl: z68.string(),
|
|
7480
|
+
pw: z68.string(),
|
|
7481
|
+
p: z68.string(),
|
|
7482
|
+
wave: z68.boolean().optional(),
|
|
7483
|
+
reflow: z68.boolean().optional()
|
|
7364
7484
|
};
|
|
7365
7485
|
var sot457DefSchema = base_def.extend({
|
|
7366
7486
|
...commonSchema,
|
|
7367
|
-
h:
|
|
7368
|
-
w:
|
|
7369
|
-
pl:
|
|
7370
|
-
pw:
|
|
7371
|
-
p:
|
|
7487
|
+
h: z68.string().default("2.5mm"),
|
|
7488
|
+
w: z68.string().default("2.7mm"),
|
|
7489
|
+
pl: z68.string().default("0.8mm"),
|
|
7490
|
+
pw: z68.string().default("0.55mm"),
|
|
7491
|
+
p: z68.string().default("0.95mm")
|
|
7372
7492
|
});
|
|
7373
7493
|
var sot457WaveSchema = base_def.extend({
|
|
7374
7494
|
...commonSchema,
|
|
7375
|
-
h:
|
|
7376
|
-
w:
|
|
7377
|
-
pillr:
|
|
7378
|
-
pl:
|
|
7379
|
-
pw:
|
|
7380
|
-
p:
|
|
7495
|
+
h: z68.string().default("3mm"),
|
|
7496
|
+
w: z68.string().default("4mm"),
|
|
7497
|
+
pillr: z68.string().default("0.225mm"),
|
|
7498
|
+
pl: z68.string().default("1.45mm"),
|
|
7499
|
+
pw: z68.string().default("1.5mm"),
|
|
7500
|
+
p: z68.string().default("1.475mm")
|
|
7381
7501
|
}).transform((data) => ({
|
|
7382
7502
|
...data,
|
|
7383
7503
|
wave: data.wave ?? (data.reflow === void 0 ? true : !data.reflow),
|
|
@@ -7516,25 +7636,25 @@ var sot457 = (rawParams) => {
|
|
|
7516
7636
|
};
|
|
7517
7637
|
|
|
7518
7638
|
// src/fn/sot963.ts
|
|
7519
|
-
import { z as
|
|
7520
|
-
import { length as
|
|
7639
|
+
import { z as z69 } from "zod";
|
|
7640
|
+
import { length as length56 } from "circuit-json";
|
|
7521
7641
|
var sot963_def = base_def.extend({
|
|
7522
|
-
fn:
|
|
7523
|
-
num_pins:
|
|
7524
|
-
w:
|
|
7525
|
-
h:
|
|
7526
|
-
p:
|
|
7527
|
-
pl:
|
|
7528
|
-
pw:
|
|
7529
|
-
string:
|
|
7642
|
+
fn: z69.string(),
|
|
7643
|
+
num_pins: z69.literal(6).default(6),
|
|
7644
|
+
w: z69.string().default("1.1mm"),
|
|
7645
|
+
h: z69.string().default("1.45mm"),
|
|
7646
|
+
p: z69.string().default("0.35mm"),
|
|
7647
|
+
pl: z69.string().default("0.2mm"),
|
|
7648
|
+
pw: z69.string().default("0.2mm"),
|
|
7649
|
+
string: z69.string().optional()
|
|
7530
7650
|
});
|
|
7531
7651
|
var sot963 = (raw_params) => {
|
|
7532
7652
|
const parameters = sot963_def.parse({ ...raw_params, fn: "sot963" });
|
|
7533
|
-
const w =
|
|
7534
|
-
const h =
|
|
7535
|
-
const p =
|
|
7536
|
-
const pl =
|
|
7537
|
-
const pw =
|
|
7653
|
+
const w = length56.parse(parameters.w);
|
|
7654
|
+
const h = length56.parse(parameters.h);
|
|
7655
|
+
const p = length56.parse(parameters.p);
|
|
7656
|
+
const pl = length56.parse(parameters.pl);
|
|
7657
|
+
const pw = length56.parse(parameters.pw);
|
|
7538
7658
|
const pads = [];
|
|
7539
7659
|
for (let i = 0; i < 6; i++) {
|
|
7540
7660
|
const { x, y } = getSot963PadCoord(i + 1, w, p, pl);
|
|
@@ -7597,19 +7717,19 @@ var getSot963PadCoord = (pn, w, p, pl) => {
|
|
|
7597
7717
|
};
|
|
7598
7718
|
|
|
7599
7719
|
// src/fn/potentiometer.ts
|
|
7600
|
-
import { z as
|
|
7720
|
+
import { z as z70 } from "zod";
|
|
7601
7721
|
var potentiometer_def = base_def.extend({
|
|
7602
|
-
fn:
|
|
7603
|
-
num_pins:
|
|
7604
|
-
p:
|
|
7605
|
-
id:
|
|
7606
|
-
od:
|
|
7607
|
-
ca:
|
|
7722
|
+
fn: z70.string(),
|
|
7723
|
+
num_pins: z70.union([z70.literal(3), z70.literal(2)]).default(3),
|
|
7724
|
+
p: z70.string().default("3.8mm"),
|
|
7725
|
+
id: z70.string().default("1.25mm"),
|
|
7726
|
+
od: z70.string().default("2.35mm"),
|
|
7727
|
+
ca: z70.string().default("14mm").describe(
|
|
7608
7728
|
"Caliper axis (width or diameter of the potentiometer body or adjustment knob)"
|
|
7609
7729
|
),
|
|
7610
|
-
w:
|
|
7611
|
-
h:
|
|
7612
|
-
string:
|
|
7730
|
+
w: z70.string().default("5.35mm"),
|
|
7731
|
+
h: z70.string().default("4mm"),
|
|
7732
|
+
string: z70.string().optional()
|
|
7613
7733
|
});
|
|
7614
7734
|
var potentiometer_acp = (parameters) => {
|
|
7615
7735
|
const { p, id, od, h, ca } = parameters;
|
|
@@ -7676,15 +7796,15 @@ var potentiometer = (raw_params) => {
|
|
|
7676
7796
|
|
|
7677
7797
|
// src/fn/electrolytic.ts
|
|
7678
7798
|
import {
|
|
7679
|
-
length as
|
|
7799
|
+
length as length57
|
|
7680
7800
|
} from "circuit-json";
|
|
7681
|
-
import { z as
|
|
7801
|
+
import { z as z71 } from "zod";
|
|
7682
7802
|
var electrolytic_def = base_def.extend({
|
|
7683
|
-
fn:
|
|
7684
|
-
p:
|
|
7685
|
-
id:
|
|
7686
|
-
od:
|
|
7687
|
-
d:
|
|
7803
|
+
fn: z71.string(),
|
|
7804
|
+
p: length57.optional().default("7.5mm"),
|
|
7805
|
+
id: length57.optional().default("1mm"),
|
|
7806
|
+
od: length57.optional().default("2mm"),
|
|
7807
|
+
d: length57.optional().default("10.5mm")
|
|
7688
7808
|
});
|
|
7689
7809
|
var generate_circle_arcs = (centerX, centerY, radius, cut, cutHeight) => {
|
|
7690
7810
|
const topArc = [];
|
|
@@ -7791,22 +7911,22 @@ var electrolytic = (raw_params) => {
|
|
|
7791
7911
|
};
|
|
7792
7912
|
|
|
7793
7913
|
// src/fn/smbf.ts
|
|
7794
|
-
import { z as
|
|
7795
|
-
import { length as
|
|
7914
|
+
import { z as z72 } from "zod";
|
|
7915
|
+
import { length as length58 } from "circuit-json";
|
|
7796
7916
|
var smbf_def = base_def.extend({
|
|
7797
|
-
fn:
|
|
7798
|
-
num_pins:
|
|
7799
|
-
w:
|
|
7800
|
-
h:
|
|
7801
|
-
pl:
|
|
7802
|
-
pw:
|
|
7803
|
-
p:
|
|
7917
|
+
fn: z72.string(),
|
|
7918
|
+
num_pins: z72.literal(2).default(2),
|
|
7919
|
+
w: z72.string().default("6.5mm"),
|
|
7920
|
+
h: z72.string().default("3mm"),
|
|
7921
|
+
pl: z72.string().default("1.75mm"),
|
|
7922
|
+
pw: z72.string().default("2.40mm"),
|
|
7923
|
+
p: z72.string().default("4.75mm")
|
|
7804
7924
|
});
|
|
7805
7925
|
var smbf = (raw_params) => {
|
|
7806
7926
|
const parameters = smbf_def.parse(raw_params);
|
|
7807
7927
|
const silkscreenRefText = silkscreenRef(
|
|
7808
7928
|
0,
|
|
7809
|
-
|
|
7929
|
+
length58.parse(parameters.h) - 0.5,
|
|
7810
7930
|
0.3
|
|
7811
7931
|
);
|
|
7812
7932
|
const silkscreenLine = {
|
|
@@ -7815,20 +7935,20 @@ var smbf = (raw_params) => {
|
|
|
7815
7935
|
pcb_component_id: "",
|
|
7816
7936
|
route: [
|
|
7817
7937
|
{
|
|
7818
|
-
x:
|
|
7819
|
-
y:
|
|
7938
|
+
x: length58.parse(parameters.p) / 2,
|
|
7939
|
+
y: length58.parse(parameters.h) / 2
|
|
7820
7940
|
},
|
|
7821
7941
|
{
|
|
7822
|
-
x: -
|
|
7823
|
-
y:
|
|
7942
|
+
x: -length58.parse(parameters.w) / 2 - 0.3,
|
|
7943
|
+
y: length58.parse(parameters.h) / 2
|
|
7824
7944
|
},
|
|
7825
7945
|
{
|
|
7826
|
-
x: -
|
|
7827
|
-
y: -
|
|
7946
|
+
x: -length58.parse(parameters.w) / 2 - 0.3,
|
|
7947
|
+
y: -length58.parse(parameters.h) / 2
|
|
7828
7948
|
},
|
|
7829
7949
|
{
|
|
7830
|
-
x:
|
|
7831
|
-
y: -
|
|
7950
|
+
x: length58.parse(parameters.p) / 2,
|
|
7951
|
+
y: -length58.parse(parameters.h) / 2
|
|
7832
7952
|
}
|
|
7833
7953
|
],
|
|
7834
7954
|
stroke_width: 0.1,
|
|
@@ -7870,16 +7990,16 @@ var smbfWithoutParsing = (parameters) => {
|
|
|
7870
7990
|
};
|
|
7871
7991
|
|
|
7872
7992
|
// src/fn/sot323.ts
|
|
7873
|
-
import { z as
|
|
7993
|
+
import { z as z73 } from "zod";
|
|
7874
7994
|
var sot323_def = base_def.extend({
|
|
7875
|
-
fn:
|
|
7876
|
-
num_pins:
|
|
7877
|
-
w:
|
|
7878
|
-
h:
|
|
7879
|
-
pl:
|
|
7880
|
-
pw:
|
|
7881
|
-
p:
|
|
7882
|
-
string:
|
|
7995
|
+
fn: z73.string(),
|
|
7996
|
+
num_pins: z73.number().default(3),
|
|
7997
|
+
w: z73.string().default("2.45mm"),
|
|
7998
|
+
h: z73.string().default("2.40mm"),
|
|
7999
|
+
pl: z73.string().default("0.92mm"),
|
|
8000
|
+
pw: z73.string().default("0.45mm"),
|
|
8001
|
+
p: z73.string().default("0.891mm"),
|
|
8002
|
+
string: z73.string().optional()
|
|
7883
8003
|
});
|
|
7884
8004
|
var sot323 = (raw_params) => {
|
|
7885
8005
|
const match = raw_params.string?.match(/^sot323_(\d+)/);
|
|
@@ -7967,30 +8087,30 @@ var sot323_3 = (parameters) => {
|
|
|
7967
8087
|
};
|
|
7968
8088
|
|
|
7969
8089
|
// src/fn/smtpad.ts
|
|
7970
|
-
import { z as
|
|
7971
|
-
import { length as
|
|
8090
|
+
import { z as z74 } from "zod";
|
|
8091
|
+
import { length as length59 } from "circuit-json";
|
|
7972
8092
|
import { mm as mm14 } from "@tscircuit/mm";
|
|
7973
8093
|
var smtpad_def = base_def.extend({
|
|
7974
|
-
fn:
|
|
7975
|
-
circle:
|
|
7976
|
-
rect:
|
|
7977
|
-
square:
|
|
7978
|
-
pill:
|
|
7979
|
-
d:
|
|
7980
|
-
pd:
|
|
7981
|
-
diameter:
|
|
7982
|
-
r:
|
|
7983
|
-
pr:
|
|
7984
|
-
radius:
|
|
7985
|
-
w:
|
|
7986
|
-
pw:
|
|
7987
|
-
width:
|
|
7988
|
-
h:
|
|
7989
|
-
ph:
|
|
7990
|
-
height:
|
|
7991
|
-
s:
|
|
7992
|
-
size:
|
|
7993
|
-
string:
|
|
8094
|
+
fn: z74.string(),
|
|
8095
|
+
circle: z74.boolean().optional(),
|
|
8096
|
+
rect: z74.boolean().optional(),
|
|
8097
|
+
square: z74.boolean().optional(),
|
|
8098
|
+
pill: z74.boolean().optional(),
|
|
8099
|
+
d: length59.optional(),
|
|
8100
|
+
pd: length59.optional(),
|
|
8101
|
+
diameter: length59.optional(),
|
|
8102
|
+
r: length59.optional(),
|
|
8103
|
+
pr: length59.optional(),
|
|
8104
|
+
radius: length59.optional(),
|
|
8105
|
+
w: length59.optional(),
|
|
8106
|
+
pw: length59.optional(),
|
|
8107
|
+
width: length59.optional(),
|
|
8108
|
+
h: length59.optional(),
|
|
8109
|
+
ph: length59.optional(),
|
|
8110
|
+
height: length59.optional(),
|
|
8111
|
+
s: length59.optional(),
|
|
8112
|
+
size: length59.optional(),
|
|
8113
|
+
string: z74.string().optional()
|
|
7994
8114
|
}).transform((v) => {
|
|
7995
8115
|
let shape = "rect";
|
|
7996
8116
|
if (v.circle) shape = "circle";
|
|
@@ -8056,18 +8176,18 @@ var smtpad = (raw_params) => {
|
|
|
8056
8176
|
};
|
|
8057
8177
|
|
|
8058
8178
|
// src/fn/platedhole.ts
|
|
8059
|
-
import { z as
|
|
8060
|
-
import { length as
|
|
8179
|
+
import { z as z75 } from "zod";
|
|
8180
|
+
import { length as length60 } from "circuit-json";
|
|
8061
8181
|
import { mm as mm15 } from "@tscircuit/mm";
|
|
8062
8182
|
var platedhole_def = base_def.extend({
|
|
8063
|
-
fn:
|
|
8064
|
-
d:
|
|
8065
|
-
hd:
|
|
8066
|
-
r:
|
|
8067
|
-
hr:
|
|
8068
|
-
pd:
|
|
8069
|
-
pr:
|
|
8070
|
-
squarepad:
|
|
8183
|
+
fn: z75.string(),
|
|
8184
|
+
d: length60.optional(),
|
|
8185
|
+
hd: length60.optional(),
|
|
8186
|
+
r: length60.optional(),
|
|
8187
|
+
hr: length60.optional(),
|
|
8188
|
+
pd: length60.optional(),
|
|
8189
|
+
pr: length60.optional(),
|
|
8190
|
+
squarepad: z75.boolean().optional().default(false)
|
|
8071
8191
|
}).transform((v) => {
|
|
8072
8192
|
let holeD;
|
|
8073
8193
|
if (v.d !== void 0) holeD = mm15(v.d);
|
|
@@ -8106,14 +8226,14 @@ var platedhole2 = (raw_params) => {
|
|
|
8106
8226
|
};
|
|
8107
8227
|
|
|
8108
8228
|
// src/fn/sot.ts
|
|
8109
|
-
import { z as
|
|
8229
|
+
import { z as z76 } from "zod";
|
|
8110
8230
|
var sot_def = base_def.extend({
|
|
8111
|
-
fn:
|
|
8112
|
-
num_pins:
|
|
8113
|
-
h:
|
|
8114
|
-
pl:
|
|
8115
|
-
pw:
|
|
8116
|
-
p:
|
|
8231
|
+
fn: z76.string(),
|
|
8232
|
+
num_pins: z76.literal(6).default(6),
|
|
8233
|
+
h: z76.string().default("1.6mm"),
|
|
8234
|
+
pl: z76.string().default("1mm"),
|
|
8235
|
+
pw: z76.string().default("0.7mm"),
|
|
8236
|
+
p: z76.string().default("0.95mm")
|
|
8117
8237
|
});
|
|
8118
8238
|
var sot = (raw_params) => {
|
|
8119
8239
|
const parameters = sot_def.parse(raw_params);
|
|
@@ -8230,16 +8350,16 @@ var sotWithoutParsing = (parameters) => {
|
|
|
8230
8350
|
};
|
|
8231
8351
|
|
|
8232
8352
|
// src/fn/sot343.ts
|
|
8233
|
-
import { z as
|
|
8353
|
+
import { z as z77 } from "zod";
|
|
8234
8354
|
var sot343_def = base_def.extend({
|
|
8235
|
-
fn:
|
|
8236
|
-
num_pins:
|
|
8237
|
-
w:
|
|
8238
|
-
h:
|
|
8239
|
-
pl:
|
|
8240
|
-
pw:
|
|
8241
|
-
p:
|
|
8242
|
-
string:
|
|
8355
|
+
fn: z77.string(),
|
|
8356
|
+
num_pins: z77.number().default(4),
|
|
8357
|
+
w: z77.string().default("3.2mm"),
|
|
8358
|
+
h: z77.string().default("2.6mm"),
|
|
8359
|
+
pl: z77.string().default("1.05mm"),
|
|
8360
|
+
pw: z77.string().default("0.45mm"),
|
|
8361
|
+
p: z77.string().default("0.55mm"),
|
|
8362
|
+
string: z77.string().optional()
|
|
8243
8363
|
});
|
|
8244
8364
|
var sot343 = (raw_params) => {
|
|
8245
8365
|
const match = raw_params.string?.match(/^sot343_(\d+)/);
|
|
@@ -8334,9 +8454,9 @@ var sot343_4 = (parameters) => {
|
|
|
8334
8454
|
};
|
|
8335
8455
|
|
|
8336
8456
|
// src/fn/m2host.ts
|
|
8337
|
-
import { z as
|
|
8457
|
+
import { z as z78 } from "zod";
|
|
8338
8458
|
var m2host_def = base_def.extend({
|
|
8339
|
-
fn:
|
|
8459
|
+
fn: z78.string()
|
|
8340
8460
|
});
|
|
8341
8461
|
var m2host = (raw_params) => {
|
|
8342
8462
|
const parameters = m2host_def.parse(raw_params);
|
|
@@ -8440,42 +8560,42 @@ var m2host = (raw_params) => {
|
|
|
8440
8560
|
};
|
|
8441
8561
|
|
|
8442
8562
|
// src/fn/mountedpcbmodule.ts
|
|
8443
|
-
import { length as
|
|
8444
|
-
import { z as
|
|
8563
|
+
import { length as length61 } from "circuit-json";
|
|
8564
|
+
import { z as z79 } from "zod";
|
|
8445
8565
|
var mountedpcbmodule_def = base_def.extend({
|
|
8446
|
-
fn:
|
|
8447
|
-
numPins:
|
|
8448
|
-
rows:
|
|
8449
|
-
p:
|
|
8450
|
-
id:
|
|
8451
|
-
od:
|
|
8452
|
-
male:
|
|
8453
|
-
nopin:
|
|
8454
|
-
female:
|
|
8455
|
-
smd:
|
|
8456
|
-
pinlabeltextalignleft:
|
|
8457
|
-
pinlabeltextaligncenter:
|
|
8458
|
-
pinlabeltextalignright:
|
|
8459
|
-
pinlabelverticallyinverted:
|
|
8460
|
-
pinlabelorthogonal:
|
|
8461
|
-
nopinlabels:
|
|
8462
|
-
doublesidedpinlabel:
|
|
8463
|
-
bottomsidepinlabel:
|
|
8566
|
+
fn: z79.string(),
|
|
8567
|
+
numPins: z79.number().optional().default(0),
|
|
8568
|
+
rows: z79.union([z79.string(), z79.number()]).transform((val) => Number(val)).optional().default(1).describe("number of rows"),
|
|
8569
|
+
p: length61.default("2.54mm").describe("pitch"),
|
|
8570
|
+
id: length61.default("1.0mm").describe("inner diameter"),
|
|
8571
|
+
od: length61.default("1.5mm").describe("outer diameter"),
|
|
8572
|
+
male: z79.boolean().optional().describe("the module uses male headers"),
|
|
8573
|
+
nopin: z79.boolean().optional().default(false).describe("omit pins rendering"),
|
|
8574
|
+
female: z79.boolean().optional().describe("the module uses female headers"),
|
|
8575
|
+
smd: z79.boolean().optional().describe("surface mount device"),
|
|
8576
|
+
pinlabeltextalignleft: z79.boolean().optional().default(false),
|
|
8577
|
+
pinlabeltextaligncenter: z79.boolean().optional().default(false),
|
|
8578
|
+
pinlabeltextalignright: z79.boolean().optional().default(false),
|
|
8579
|
+
pinlabelverticallyinverted: z79.boolean().optional().default(false),
|
|
8580
|
+
pinlabelorthogonal: z79.boolean().optional().default(false),
|
|
8581
|
+
nopinlabels: z79.boolean().optional().default(false).describe("omit silkscreen pin labels"),
|
|
8582
|
+
doublesidedpinlabel: z79.boolean().optional().default(false).describe("add silkscreen pins in top and bottom layers"),
|
|
8583
|
+
bottomsidepinlabel: z79.boolean().optional().default(false).describe(
|
|
8464
8584
|
"place the silkscreen reference text on the bottom layer instead of top"
|
|
8465
8585
|
),
|
|
8466
|
-
pinRowSide:
|
|
8467
|
-
pinrowleft:
|
|
8468
|
-
pinrowright:
|
|
8469
|
-
pinrowtop:
|
|
8470
|
-
pinrowbottom:
|
|
8471
|
-
pinrowleftpins:
|
|
8472
|
-
pinrowrightpins:
|
|
8473
|
-
pinrowtoppins:
|
|
8474
|
-
pinrowbottompins:
|
|
8475
|
-
width:
|
|
8476
|
-
height:
|
|
8477
|
-
pinRowHoleEdgeToEdgeDist:
|
|
8478
|
-
holes:
|
|
8586
|
+
pinRowSide: z79.enum(["left", "right", "top", "bottom"]).optional().default("left"),
|
|
8587
|
+
pinrowleft: z79.boolean().optional().default(false),
|
|
8588
|
+
pinrowright: z79.boolean().optional().default(false),
|
|
8589
|
+
pinrowtop: z79.boolean().optional().default(false),
|
|
8590
|
+
pinrowbottom: z79.boolean().optional().default(false),
|
|
8591
|
+
pinrowleftpins: z79.union([z79.string(), z79.number()]).transform((val) => Number(val)).optional(),
|
|
8592
|
+
pinrowrightpins: z79.union([z79.string(), z79.number()]).transform((val) => Number(val)).optional(),
|
|
8593
|
+
pinrowtoppins: z79.union([z79.string(), z79.number()]).transform((val) => Number(val)).optional(),
|
|
8594
|
+
pinrowbottompins: z79.union([z79.string(), z79.number()]).transform((val) => Number(val)).optional(),
|
|
8595
|
+
width: length61.optional(),
|
|
8596
|
+
height: length61.optional(),
|
|
8597
|
+
pinRowHoleEdgeToEdgeDist: length61.default("2mm"),
|
|
8598
|
+
holes: z79.union([z79.string(), z79.array(z79.string())]).optional().transform((val) => {
|
|
8479
8599
|
if (!val) return val;
|
|
8480
8600
|
if (Array.isArray(val)) return val;
|
|
8481
8601
|
if (val.startsWith("(") && val.endsWith(")")) {
|
|
@@ -8483,23 +8603,23 @@ var mountedpcbmodule_def = base_def.extend({
|
|
|
8483
8603
|
}
|
|
8484
8604
|
return [val];
|
|
8485
8605
|
}),
|
|
8486
|
-
holeXDist:
|
|
8487
|
-
holeYDist:
|
|
8488
|
-
holeInset:
|
|
8489
|
-
pinrow:
|
|
8490
|
-
usbposition:
|
|
8491
|
-
usbleft:
|
|
8492
|
-
usbtop:
|
|
8493
|
-
usbright:
|
|
8494
|
-
usbbottom:
|
|
8495
|
-
usbtype:
|
|
8496
|
-
usbmicro:
|
|
8497
|
-
usbc:
|
|
8498
|
-
screen:
|
|
8499
|
-
screenwidth:
|
|
8500
|
-
screenheight:
|
|
8501
|
-
screencenteroffsetx:
|
|
8502
|
-
screencenteroffsety:
|
|
8606
|
+
holeXDist: length61.optional(),
|
|
8607
|
+
holeYDist: length61.optional(),
|
|
8608
|
+
holeInset: length61.default("1mm"),
|
|
8609
|
+
pinrow: z79.union([z79.string(), z79.number()]).optional(),
|
|
8610
|
+
usbposition: z79.enum(["left", "right", "top", "bottom"]).optional().default("left"),
|
|
8611
|
+
usbleft: z79.boolean().optional().default(false),
|
|
8612
|
+
usbtop: z79.boolean().optional().default(false),
|
|
8613
|
+
usbright: z79.boolean().optional().default(false),
|
|
8614
|
+
usbbottom: z79.boolean().optional().default(false),
|
|
8615
|
+
usbtype: z79.enum(["micro", "c"]).optional(),
|
|
8616
|
+
usbmicro: z79.boolean().optional().default(false),
|
|
8617
|
+
usbc: z79.boolean().optional().default(false),
|
|
8618
|
+
screen: z79.boolean().optional().default(false).describe("add silkscreen outline for screen/display area"),
|
|
8619
|
+
screenwidth: length61.optional(),
|
|
8620
|
+
screenheight: length61.optional(),
|
|
8621
|
+
screencenteroffsetx: length61.optional(),
|
|
8622
|
+
screencenteroffsety: length61.optional()
|
|
8503
8623
|
}).transform((data) => {
|
|
8504
8624
|
const pinlabelAnchorSide = determinePinlabelAnchorSide(data);
|
|
8505
8625
|
let pinRowSide = data.pinRowSide;
|
|
@@ -8591,7 +8711,7 @@ var mountedpcbmodule_def = base_def.extend({
|
|
|
8591
8711
|
}).superRefine((data, ctx) => {
|
|
8592
8712
|
if (data.male && data.female) {
|
|
8593
8713
|
ctx.addIssue({
|
|
8594
|
-
code:
|
|
8714
|
+
code: z79.ZodIssueCode.custom,
|
|
8595
8715
|
message: "'male' and 'female' cannot both be true; it should be male or female.",
|
|
8596
8716
|
path: ["male", "female"]
|
|
8597
8717
|
});
|
|
@@ -8934,16 +9054,16 @@ var mountedpcbmodule = (raw_params) => {
|
|
|
8934
9054
|
};
|
|
8935
9055
|
|
|
8936
9056
|
// src/fn/to92l.ts
|
|
8937
|
-
import { z as
|
|
9057
|
+
import { z as z80 } from "zod";
|
|
8938
9058
|
var to92l_def = base_def.extend({
|
|
8939
|
-
fn:
|
|
8940
|
-
num_pins:
|
|
8941
|
-
inline:
|
|
8942
|
-
p:
|
|
8943
|
-
id:
|
|
8944
|
-
od:
|
|
8945
|
-
w:
|
|
8946
|
-
h:
|
|
9059
|
+
fn: z80.string(),
|
|
9060
|
+
num_pins: z80.number().default(3),
|
|
9061
|
+
inline: z80.boolean().default(false),
|
|
9062
|
+
p: z80.string().default("1.27mm"),
|
|
9063
|
+
id: z80.string().default("0.75mm"),
|
|
9064
|
+
od: z80.string().default("1.3mm"),
|
|
9065
|
+
w: z80.string().default("4.8mm"),
|
|
9066
|
+
h: z80.string().default("4.0mm")
|
|
8947
9067
|
});
|
|
8948
9068
|
var to92l = (raw_params) => {
|
|
8949
9069
|
const parameters = to92l_def.parse(raw_params);
|