@tscircuit/footprinter 0.0.310 → 0.0.312
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 +344 -203
- 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
|
|
|
@@ -5217,14 +5218,14 @@ var sot89_3 = (parameters) => {
|
|
|
5217
5218
|
const pads = [];
|
|
5218
5219
|
const padGap = Number.parseFloat(parameters.p);
|
|
5219
5220
|
const padWidth = Number.parseFloat(parameters.pw);
|
|
5220
|
-
const
|
|
5221
|
+
const length62 = Number.parseFloat(parameters.w);
|
|
5221
5222
|
const padHeight = Number.parseFloat(parameters.pl);
|
|
5222
5223
|
const centerExtra = 0.175;
|
|
5223
5224
|
const outerPadXShift = (padHeight - (padHeight + centerExtra)) / 2;
|
|
5224
5225
|
pads.push(
|
|
5225
|
-
rectpad(1, -
|
|
5226
|
-
rectpad(2, -
|
|
5227
|
-
rectpad(3, -
|
|
5226
|
+
rectpad(1, -length62 / 2 + outerPadXShift, padGap, padHeight, padWidth),
|
|
5227
|
+
rectpad(2, -length62 / 2, 0, padHeight + centerExtra, padWidth),
|
|
5228
|
+
rectpad(3, -length62 / 2 + outerPadXShift, -padGap, padHeight, padWidth)
|
|
5228
5229
|
);
|
|
5229
5230
|
const silkscreenRefText = silkscreenRef(0, 0, 0.3);
|
|
5230
5231
|
const width = Number.parseFloat(parameters.w) / 2 - 1;
|
|
@@ -5264,7 +5265,7 @@ var sot89_5 = (parameters) => {
|
|
|
5264
5265
|
const pads = [];
|
|
5265
5266
|
const padGap = Number.parseFloat(parameters.p);
|
|
5266
5267
|
const padWidth = Number.parseFloat(parameters.pw);
|
|
5267
|
-
const
|
|
5268
|
+
const length62 = Number.parseFloat(parameters.w);
|
|
5268
5269
|
pads.push(
|
|
5269
5270
|
rectpad(1, -1.85, -1.5, 1.5, 0.7),
|
|
5270
5271
|
rectpad(2, -1.85, 1.5, 1.5, 0.7),
|
|
@@ -7256,13 +7257,131 @@ var getSonPadCoord = (num_pins, pn, w, p) => {
|
|
|
7256
7257
|
};
|
|
7257
7258
|
};
|
|
7258
7259
|
|
|
7260
|
+
// src/fn/vson.ts
|
|
7261
|
+
import { z as z67 } from "zod";
|
|
7262
|
+
import { length as length54, distance as distance3 } from "circuit-json";
|
|
7263
|
+
var vson_def = base_def.extend({
|
|
7264
|
+
fn: z67.string(),
|
|
7265
|
+
num_pins: z67.number().optional().default(8),
|
|
7266
|
+
p: distance3.describe("pitch (distance between center of each pin)"),
|
|
7267
|
+
w: length54.describe("width between vertical rows of pins"),
|
|
7268
|
+
grid: dim2d.describe("width and height of the border of the footprint"),
|
|
7269
|
+
ep: dim2d.default("0x0mm").describe("width and height of the central exposed thermal pad"),
|
|
7270
|
+
epx: length54.default("0mm").describe("x offset of the center of the central exposed thermal pad"),
|
|
7271
|
+
pinw: length54.describe("width of the pin pads"),
|
|
7272
|
+
pinh: length54.describe("height of the pin pads")
|
|
7273
|
+
});
|
|
7274
|
+
var vson = (raw_params) => {
|
|
7275
|
+
const parameters = vson_def.parse(raw_params);
|
|
7276
|
+
const { num_pins, p, w, grid, ep, epx, pinw, pinh } = parameters;
|
|
7277
|
+
if (num_pins % 2 !== 0) {
|
|
7278
|
+
throw new Error("invalid number of pins");
|
|
7279
|
+
}
|
|
7280
|
+
const pads = [];
|
|
7281
|
+
for (let i = 0; i < num_pins; i++) {
|
|
7282
|
+
const { pinX, pinY } = getCcwVsonCoords({
|
|
7283
|
+
pinCount: num_pins,
|
|
7284
|
+
pinIndex: i,
|
|
7285
|
+
width: w,
|
|
7286
|
+
pitch: p
|
|
7287
|
+
});
|
|
7288
|
+
pads.push(rectpad(i + 1, pinX, pinY, pinw, pinh));
|
|
7289
|
+
}
|
|
7290
|
+
if (ep.x > 0 && ep.y > 0) {
|
|
7291
|
+
pads.push(rectpad(parameters.num_pins + 1, epx, 0, ep.x, ep.y));
|
|
7292
|
+
}
|
|
7293
|
+
const silkscreenPaths = getSilkscreenPaths(grid);
|
|
7294
|
+
const silkscreenRefText = silkscreenRef(
|
|
7295
|
+
0,
|
|
7296
|
+
grid.y / 2 + p,
|
|
7297
|
+
grid.y / 6
|
|
7298
|
+
);
|
|
7299
|
+
return {
|
|
7300
|
+
circuitJson: [...pads, ...silkscreenPaths, silkscreenRefText],
|
|
7301
|
+
parameters
|
|
7302
|
+
};
|
|
7303
|
+
};
|
|
7304
|
+
var getCcwVsonCoords = (params) => {
|
|
7305
|
+
let pinY = 0;
|
|
7306
|
+
let pinX = 0;
|
|
7307
|
+
const centerY = (params.pinCount / 2 - 1) * params.pitch / 2;
|
|
7308
|
+
const pinHalf = params.pinCount / 2;
|
|
7309
|
+
if (params.pinIndex + 1 <= pinHalf) {
|
|
7310
|
+
pinY = params.pitch * params.pinIndex - centerY;
|
|
7311
|
+
pinX = 0 - params.width / 2;
|
|
7312
|
+
} else {
|
|
7313
|
+
pinY = params.pitch * (params.pinCount - params.pinIndex - 1) - centerY;
|
|
7314
|
+
pinX = params.width / 2;
|
|
7315
|
+
}
|
|
7316
|
+
return { pinX, pinY };
|
|
7317
|
+
};
|
|
7318
|
+
var getSilkscreenPaths = (grid) => {
|
|
7319
|
+
const borderMargin = 0.1;
|
|
7320
|
+
const cornerLine = grid.y / 30;
|
|
7321
|
+
const silkscreenPaths = [
|
|
7322
|
+
// top silkscreen path
|
|
7323
|
+
{
|
|
7324
|
+
layer: "top",
|
|
7325
|
+
pcb_component_id: "",
|
|
7326
|
+
pcb_silkscreen_path_id: "",
|
|
7327
|
+
type: "pcb_silkscreen_path",
|
|
7328
|
+
route: [
|
|
7329
|
+
{
|
|
7330
|
+
x: -grid.x / 2 - borderMargin,
|
|
7331
|
+
y: grid.y / 2 + borderMargin - cornerLine
|
|
7332
|
+
},
|
|
7333
|
+
{
|
|
7334
|
+
x: -grid.x / 2 - borderMargin,
|
|
7335
|
+
y: grid.y / 2 + borderMargin
|
|
7336
|
+
},
|
|
7337
|
+
{
|
|
7338
|
+
x: grid.x / 2 + borderMargin,
|
|
7339
|
+
y: grid.y / 2 + borderMargin
|
|
7340
|
+
},
|
|
7341
|
+
{
|
|
7342
|
+
x: grid.x / 2 + borderMargin,
|
|
7343
|
+
y: grid.y / 2 + borderMargin - cornerLine
|
|
7344
|
+
}
|
|
7345
|
+
],
|
|
7346
|
+
stroke_width: grid.y / 30
|
|
7347
|
+
},
|
|
7348
|
+
// bottom silkscreen path
|
|
7349
|
+
{
|
|
7350
|
+
layer: "top",
|
|
7351
|
+
pcb_component_id: "",
|
|
7352
|
+
pcb_silkscreen_path_id: "",
|
|
7353
|
+
type: "pcb_silkscreen_path",
|
|
7354
|
+
route: [
|
|
7355
|
+
{
|
|
7356
|
+
x: -grid.x / 2 - borderMargin,
|
|
7357
|
+
y: -grid.y / 2 - borderMargin + cornerLine
|
|
7358
|
+
},
|
|
7359
|
+
{
|
|
7360
|
+
x: -grid.x / 2 - borderMargin,
|
|
7361
|
+
y: -grid.y / 2 - borderMargin
|
|
7362
|
+
},
|
|
7363
|
+
{
|
|
7364
|
+
x: grid.x / 2 + borderMargin,
|
|
7365
|
+
y: -grid.y / 2 - borderMargin
|
|
7366
|
+
},
|
|
7367
|
+
{
|
|
7368
|
+
x: grid.x / 2 + borderMargin,
|
|
7369
|
+
y: -grid.y / 2 - borderMargin + cornerLine
|
|
7370
|
+
}
|
|
7371
|
+
],
|
|
7372
|
+
stroke_width: grid.y / 30
|
|
7373
|
+
}
|
|
7374
|
+
];
|
|
7375
|
+
return silkscreenPaths;
|
|
7376
|
+
};
|
|
7377
|
+
|
|
7259
7378
|
// src/fn/solderjumper.ts
|
|
7260
|
-
import { length as
|
|
7379
|
+
import { length as length55 } from "circuit-json";
|
|
7261
7380
|
var solderjumper = (params) => {
|
|
7262
7381
|
const { num_pins, bridged, p = 2.54, pw = 1.5, ph = 1.5 } = params;
|
|
7263
|
-
const padSpacing7 =
|
|
7264
|
-
const padWidth =
|
|
7265
|
-
const padHeight =
|
|
7382
|
+
const padSpacing7 = length55.parse(p);
|
|
7383
|
+
const padWidth = length55.parse(pw);
|
|
7384
|
+
const padHeight = length55.parse(ph);
|
|
7266
7385
|
const traceWidth = Math.min(padHeight / 4, 0.5);
|
|
7267
7386
|
const pads = [];
|
|
7268
7387
|
for (let i = 0; i < num_pins; i++) {
|
|
@@ -7350,34 +7469,34 @@ var solderjumper = (params) => {
|
|
|
7350
7469
|
};
|
|
7351
7470
|
|
|
7352
7471
|
// src/fn/sot457.ts
|
|
7353
|
-
import { z as
|
|
7472
|
+
import { z as z68 } from "zod";
|
|
7354
7473
|
var commonSchema = {
|
|
7355
|
-
fn:
|
|
7356
|
-
num_pins:
|
|
7357
|
-
pillh:
|
|
7358
|
-
pillw:
|
|
7359
|
-
pl:
|
|
7360
|
-
pw:
|
|
7361
|
-
p:
|
|
7362
|
-
wave:
|
|
7363
|
-
reflow:
|
|
7474
|
+
fn: z68.literal("sot457"),
|
|
7475
|
+
num_pins: z68.literal(6).default(6),
|
|
7476
|
+
pillh: z68.string().default("0.45mm"),
|
|
7477
|
+
pillw: z68.string().default("1.45mm"),
|
|
7478
|
+
pl: z68.string(),
|
|
7479
|
+
pw: z68.string(),
|
|
7480
|
+
p: z68.string(),
|
|
7481
|
+
wave: z68.boolean().optional(),
|
|
7482
|
+
reflow: z68.boolean().optional()
|
|
7364
7483
|
};
|
|
7365
7484
|
var sot457DefSchema = base_def.extend({
|
|
7366
7485
|
...commonSchema,
|
|
7367
|
-
h:
|
|
7368
|
-
w:
|
|
7369
|
-
pl:
|
|
7370
|
-
pw:
|
|
7371
|
-
p:
|
|
7486
|
+
h: z68.string().default("2.5mm"),
|
|
7487
|
+
w: z68.string().default("2.7mm"),
|
|
7488
|
+
pl: z68.string().default("0.8mm"),
|
|
7489
|
+
pw: z68.string().default("0.55mm"),
|
|
7490
|
+
p: z68.string().default("0.95mm")
|
|
7372
7491
|
});
|
|
7373
7492
|
var sot457WaveSchema = base_def.extend({
|
|
7374
7493
|
...commonSchema,
|
|
7375
|
-
h:
|
|
7376
|
-
w:
|
|
7377
|
-
pillr:
|
|
7378
|
-
pl:
|
|
7379
|
-
pw:
|
|
7380
|
-
p:
|
|
7494
|
+
h: z68.string().default("3mm"),
|
|
7495
|
+
w: z68.string().default("4mm"),
|
|
7496
|
+
pillr: z68.string().default("0.225mm"),
|
|
7497
|
+
pl: z68.string().default("1.45mm"),
|
|
7498
|
+
pw: z68.string().default("1.5mm"),
|
|
7499
|
+
p: z68.string().default("1.475mm")
|
|
7381
7500
|
}).transform((data) => ({
|
|
7382
7501
|
...data,
|
|
7383
7502
|
wave: data.wave ?? (data.reflow === void 0 ? true : !data.reflow),
|
|
@@ -7516,25 +7635,25 @@ var sot457 = (rawParams) => {
|
|
|
7516
7635
|
};
|
|
7517
7636
|
|
|
7518
7637
|
// src/fn/sot963.ts
|
|
7519
|
-
import { z as
|
|
7520
|
-
import { length as
|
|
7638
|
+
import { z as z69 } from "zod";
|
|
7639
|
+
import { length as length56 } from "circuit-json";
|
|
7521
7640
|
var sot963_def = base_def.extend({
|
|
7522
|
-
fn:
|
|
7523
|
-
num_pins:
|
|
7524
|
-
w:
|
|
7525
|
-
h:
|
|
7526
|
-
p:
|
|
7527
|
-
pl:
|
|
7528
|
-
pw:
|
|
7529
|
-
string:
|
|
7641
|
+
fn: z69.string(),
|
|
7642
|
+
num_pins: z69.literal(6).default(6),
|
|
7643
|
+
w: z69.string().default("1.1mm"),
|
|
7644
|
+
h: z69.string().default("1.45mm"),
|
|
7645
|
+
p: z69.string().default("0.35mm"),
|
|
7646
|
+
pl: z69.string().default("0.2mm"),
|
|
7647
|
+
pw: z69.string().default("0.2mm"),
|
|
7648
|
+
string: z69.string().optional()
|
|
7530
7649
|
});
|
|
7531
7650
|
var sot963 = (raw_params) => {
|
|
7532
7651
|
const parameters = sot963_def.parse({ ...raw_params, fn: "sot963" });
|
|
7533
|
-
const w =
|
|
7534
|
-
const h =
|
|
7535
|
-
const p =
|
|
7536
|
-
const pl =
|
|
7537
|
-
const pw =
|
|
7652
|
+
const w = length56.parse(parameters.w);
|
|
7653
|
+
const h = length56.parse(parameters.h);
|
|
7654
|
+
const p = length56.parse(parameters.p);
|
|
7655
|
+
const pl = length56.parse(parameters.pl);
|
|
7656
|
+
const pw = length56.parse(parameters.pw);
|
|
7538
7657
|
const pads = [];
|
|
7539
7658
|
for (let i = 0; i < 6; i++) {
|
|
7540
7659
|
const { x, y } = getSot963PadCoord(i + 1, w, p, pl);
|
|
@@ -7597,19 +7716,19 @@ var getSot963PadCoord = (pn, w, p, pl) => {
|
|
|
7597
7716
|
};
|
|
7598
7717
|
|
|
7599
7718
|
// src/fn/potentiometer.ts
|
|
7600
|
-
import { z as
|
|
7719
|
+
import { z as z70 } from "zod";
|
|
7601
7720
|
var potentiometer_def = base_def.extend({
|
|
7602
|
-
fn:
|
|
7603
|
-
num_pins:
|
|
7604
|
-
p:
|
|
7605
|
-
id:
|
|
7606
|
-
od:
|
|
7607
|
-
ca:
|
|
7721
|
+
fn: z70.string(),
|
|
7722
|
+
num_pins: z70.union([z70.literal(3), z70.literal(2)]).default(3),
|
|
7723
|
+
p: z70.string().default("3.8mm"),
|
|
7724
|
+
id: z70.string().default("1.25mm"),
|
|
7725
|
+
od: z70.string().default("2.35mm"),
|
|
7726
|
+
ca: z70.string().default("14mm").describe(
|
|
7608
7727
|
"Caliper axis (width or diameter of the potentiometer body or adjustment knob)"
|
|
7609
7728
|
),
|
|
7610
|
-
w:
|
|
7611
|
-
h:
|
|
7612
|
-
string:
|
|
7729
|
+
w: z70.string().default("5.35mm"),
|
|
7730
|
+
h: z70.string().default("4mm"),
|
|
7731
|
+
string: z70.string().optional()
|
|
7613
7732
|
});
|
|
7614
7733
|
var potentiometer_acp = (parameters) => {
|
|
7615
7734
|
const { p, id, od, h, ca } = parameters;
|
|
@@ -7676,15 +7795,15 @@ var potentiometer = (raw_params) => {
|
|
|
7676
7795
|
|
|
7677
7796
|
// src/fn/electrolytic.ts
|
|
7678
7797
|
import {
|
|
7679
|
-
length as
|
|
7798
|
+
length as length57
|
|
7680
7799
|
} from "circuit-json";
|
|
7681
|
-
import { z as
|
|
7800
|
+
import { z as z71 } from "zod";
|
|
7682
7801
|
var electrolytic_def = base_def.extend({
|
|
7683
|
-
fn:
|
|
7684
|
-
p:
|
|
7685
|
-
id:
|
|
7686
|
-
od:
|
|
7687
|
-
d:
|
|
7802
|
+
fn: z71.string(),
|
|
7803
|
+
p: length57.optional().default("7.5mm"),
|
|
7804
|
+
id: length57.optional().default("1mm"),
|
|
7805
|
+
od: length57.optional().default("2mm"),
|
|
7806
|
+
d: length57.optional().default("10.5mm")
|
|
7688
7807
|
});
|
|
7689
7808
|
var generate_circle_arcs = (centerX, centerY, radius, cut, cutHeight) => {
|
|
7690
7809
|
const topArc = [];
|
|
@@ -7791,22 +7910,22 @@ var electrolytic = (raw_params) => {
|
|
|
7791
7910
|
};
|
|
7792
7911
|
|
|
7793
7912
|
// src/fn/smbf.ts
|
|
7794
|
-
import { z as
|
|
7795
|
-
import { length as
|
|
7913
|
+
import { z as z72 } from "zod";
|
|
7914
|
+
import { length as length58 } from "circuit-json";
|
|
7796
7915
|
var smbf_def = base_def.extend({
|
|
7797
|
-
fn:
|
|
7798
|
-
num_pins:
|
|
7799
|
-
w:
|
|
7800
|
-
h:
|
|
7801
|
-
pl:
|
|
7802
|
-
pw:
|
|
7803
|
-
p:
|
|
7916
|
+
fn: z72.string(),
|
|
7917
|
+
num_pins: z72.literal(2).default(2),
|
|
7918
|
+
w: z72.string().default("6.5mm"),
|
|
7919
|
+
h: z72.string().default("3mm"),
|
|
7920
|
+
pl: z72.string().default("1.75mm"),
|
|
7921
|
+
pw: z72.string().default("2.40mm"),
|
|
7922
|
+
p: z72.string().default("4.75mm")
|
|
7804
7923
|
});
|
|
7805
7924
|
var smbf = (raw_params) => {
|
|
7806
7925
|
const parameters = smbf_def.parse(raw_params);
|
|
7807
7926
|
const silkscreenRefText = silkscreenRef(
|
|
7808
7927
|
0,
|
|
7809
|
-
|
|
7928
|
+
length58.parse(parameters.h) - 0.5,
|
|
7810
7929
|
0.3
|
|
7811
7930
|
);
|
|
7812
7931
|
const silkscreenLine = {
|
|
@@ -7815,20 +7934,20 @@ var smbf = (raw_params) => {
|
|
|
7815
7934
|
pcb_component_id: "",
|
|
7816
7935
|
route: [
|
|
7817
7936
|
{
|
|
7818
|
-
x:
|
|
7819
|
-
y:
|
|
7937
|
+
x: length58.parse(parameters.p) / 2,
|
|
7938
|
+
y: length58.parse(parameters.h) / 2
|
|
7820
7939
|
},
|
|
7821
7940
|
{
|
|
7822
|
-
x: -
|
|
7823
|
-
y:
|
|
7941
|
+
x: -length58.parse(parameters.w) / 2 - 0.3,
|
|
7942
|
+
y: length58.parse(parameters.h) / 2
|
|
7824
7943
|
},
|
|
7825
7944
|
{
|
|
7826
|
-
x: -
|
|
7827
|
-
y: -
|
|
7945
|
+
x: -length58.parse(parameters.w) / 2 - 0.3,
|
|
7946
|
+
y: -length58.parse(parameters.h) / 2
|
|
7828
7947
|
},
|
|
7829
7948
|
{
|
|
7830
|
-
x:
|
|
7831
|
-
y: -
|
|
7949
|
+
x: length58.parse(parameters.p) / 2,
|
|
7950
|
+
y: -length58.parse(parameters.h) / 2
|
|
7832
7951
|
}
|
|
7833
7952
|
],
|
|
7834
7953
|
stroke_width: 0.1,
|
|
@@ -7870,16 +7989,16 @@ var smbfWithoutParsing = (parameters) => {
|
|
|
7870
7989
|
};
|
|
7871
7990
|
|
|
7872
7991
|
// src/fn/sot323.ts
|
|
7873
|
-
import { z as
|
|
7992
|
+
import { z as z73 } from "zod";
|
|
7874
7993
|
var sot323_def = base_def.extend({
|
|
7875
|
-
fn:
|
|
7876
|
-
num_pins:
|
|
7877
|
-
w:
|
|
7878
|
-
h:
|
|
7879
|
-
pl:
|
|
7880
|
-
pw:
|
|
7881
|
-
p:
|
|
7882
|
-
string:
|
|
7994
|
+
fn: z73.string(),
|
|
7995
|
+
num_pins: z73.number().default(3),
|
|
7996
|
+
w: z73.string().default("2.45mm"),
|
|
7997
|
+
h: z73.string().default("2.40mm"),
|
|
7998
|
+
pl: z73.string().default("0.92mm"),
|
|
7999
|
+
pw: z73.string().default("0.45mm"),
|
|
8000
|
+
p: z73.string().default("0.891mm"),
|
|
8001
|
+
string: z73.string().optional()
|
|
7883
8002
|
});
|
|
7884
8003
|
var sot323 = (raw_params) => {
|
|
7885
8004
|
const match = raw_params.string?.match(/^sot323_(\d+)/);
|
|
@@ -7967,30 +8086,30 @@ var sot323_3 = (parameters) => {
|
|
|
7967
8086
|
};
|
|
7968
8087
|
|
|
7969
8088
|
// src/fn/smtpad.ts
|
|
7970
|
-
import { z as
|
|
7971
|
-
import { length as
|
|
8089
|
+
import { z as z74 } from "zod";
|
|
8090
|
+
import { length as length59 } from "circuit-json";
|
|
7972
8091
|
import { mm as mm14 } from "@tscircuit/mm";
|
|
7973
8092
|
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:
|
|
8093
|
+
fn: z74.string(),
|
|
8094
|
+
circle: z74.boolean().optional(),
|
|
8095
|
+
rect: z74.boolean().optional(),
|
|
8096
|
+
square: z74.boolean().optional(),
|
|
8097
|
+
pill: z74.boolean().optional(),
|
|
8098
|
+
d: length59.optional(),
|
|
8099
|
+
pd: length59.optional(),
|
|
8100
|
+
diameter: length59.optional(),
|
|
8101
|
+
r: length59.optional(),
|
|
8102
|
+
pr: length59.optional(),
|
|
8103
|
+
radius: length59.optional(),
|
|
8104
|
+
w: length59.optional(),
|
|
8105
|
+
pw: length59.optional(),
|
|
8106
|
+
width: length59.optional(),
|
|
8107
|
+
h: length59.optional(),
|
|
8108
|
+
ph: length59.optional(),
|
|
8109
|
+
height: length59.optional(),
|
|
8110
|
+
s: length59.optional(),
|
|
8111
|
+
size: length59.optional(),
|
|
8112
|
+
string: z74.string().optional()
|
|
7994
8113
|
}).transform((v) => {
|
|
7995
8114
|
let shape = "rect";
|
|
7996
8115
|
if (v.circle) shape = "circle";
|
|
@@ -8056,18 +8175,18 @@ var smtpad = (raw_params) => {
|
|
|
8056
8175
|
};
|
|
8057
8176
|
|
|
8058
8177
|
// src/fn/platedhole.ts
|
|
8059
|
-
import { z as
|
|
8060
|
-
import { length as
|
|
8178
|
+
import { z as z75 } from "zod";
|
|
8179
|
+
import { length as length60 } from "circuit-json";
|
|
8061
8180
|
import { mm as mm15 } from "@tscircuit/mm";
|
|
8062
8181
|
var platedhole_def = base_def.extend({
|
|
8063
|
-
fn:
|
|
8064
|
-
d:
|
|
8065
|
-
hd:
|
|
8066
|
-
r:
|
|
8067
|
-
hr:
|
|
8068
|
-
pd:
|
|
8069
|
-
pr:
|
|
8070
|
-
squarepad:
|
|
8182
|
+
fn: z75.string(),
|
|
8183
|
+
d: length60.optional(),
|
|
8184
|
+
hd: length60.optional(),
|
|
8185
|
+
r: length60.optional(),
|
|
8186
|
+
hr: length60.optional(),
|
|
8187
|
+
pd: length60.optional(),
|
|
8188
|
+
pr: length60.optional(),
|
|
8189
|
+
squarepad: z75.boolean().optional().default(false)
|
|
8071
8190
|
}).transform((v) => {
|
|
8072
8191
|
let holeD;
|
|
8073
8192
|
if (v.d !== void 0) holeD = mm15(v.d);
|
|
@@ -8106,14 +8225,14 @@ var platedhole2 = (raw_params) => {
|
|
|
8106
8225
|
};
|
|
8107
8226
|
|
|
8108
8227
|
// src/fn/sot.ts
|
|
8109
|
-
import { z as
|
|
8228
|
+
import { z as z76 } from "zod";
|
|
8110
8229
|
var sot_def = base_def.extend({
|
|
8111
|
-
fn:
|
|
8112
|
-
num_pins:
|
|
8113
|
-
h:
|
|
8114
|
-
pl:
|
|
8115
|
-
pw:
|
|
8116
|
-
p:
|
|
8230
|
+
fn: z76.string(),
|
|
8231
|
+
num_pins: z76.literal(6).default(6),
|
|
8232
|
+
h: z76.string().default("1.6mm"),
|
|
8233
|
+
pl: z76.string().default("1mm"),
|
|
8234
|
+
pw: z76.string().default("0.7mm"),
|
|
8235
|
+
p: z76.string().default("0.95mm")
|
|
8117
8236
|
});
|
|
8118
8237
|
var sot = (raw_params) => {
|
|
8119
8238
|
const parameters = sot_def.parse(raw_params);
|
|
@@ -8230,16 +8349,16 @@ var sotWithoutParsing = (parameters) => {
|
|
|
8230
8349
|
};
|
|
8231
8350
|
|
|
8232
8351
|
// src/fn/sot343.ts
|
|
8233
|
-
import { z as
|
|
8352
|
+
import { z as z77 } from "zod";
|
|
8234
8353
|
var sot343_def = base_def.extend({
|
|
8235
|
-
fn:
|
|
8236
|
-
num_pins:
|
|
8237
|
-
w:
|
|
8238
|
-
h:
|
|
8239
|
-
pl:
|
|
8240
|
-
pw:
|
|
8241
|
-
p:
|
|
8242
|
-
string:
|
|
8354
|
+
fn: z77.string(),
|
|
8355
|
+
num_pins: z77.number().default(4),
|
|
8356
|
+
w: z77.string().default("3.2mm"),
|
|
8357
|
+
h: z77.string().default("2.6mm"),
|
|
8358
|
+
pl: z77.string().default("1.05mm"),
|
|
8359
|
+
pw: z77.string().default("0.45mm"),
|
|
8360
|
+
p: z77.string().default("0.55mm"),
|
|
8361
|
+
string: z77.string().optional()
|
|
8243
8362
|
});
|
|
8244
8363
|
var sot343 = (raw_params) => {
|
|
8245
8364
|
const match = raw_params.string?.match(/^sot343_(\d+)/);
|
|
@@ -8334,9 +8453,9 @@ var sot343_4 = (parameters) => {
|
|
|
8334
8453
|
};
|
|
8335
8454
|
|
|
8336
8455
|
// src/fn/m2host.ts
|
|
8337
|
-
import { z as
|
|
8456
|
+
import { z as z78 } from "zod";
|
|
8338
8457
|
var m2host_def = base_def.extend({
|
|
8339
|
-
fn:
|
|
8458
|
+
fn: z78.string()
|
|
8340
8459
|
});
|
|
8341
8460
|
var m2host = (raw_params) => {
|
|
8342
8461
|
const parameters = m2host_def.parse(raw_params);
|
|
@@ -8440,42 +8559,42 @@ var m2host = (raw_params) => {
|
|
|
8440
8559
|
};
|
|
8441
8560
|
|
|
8442
8561
|
// src/fn/mountedpcbmodule.ts
|
|
8443
|
-
import { length as
|
|
8444
|
-
import { z as
|
|
8562
|
+
import { length as length61 } from "circuit-json";
|
|
8563
|
+
import { z as z79 } from "zod";
|
|
8445
8564
|
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:
|
|
8565
|
+
fn: z79.string(),
|
|
8566
|
+
numPins: z79.number().optional().default(0),
|
|
8567
|
+
rows: z79.union([z79.string(), z79.number()]).transform((val) => Number(val)).optional().default(1).describe("number of rows"),
|
|
8568
|
+
p: length61.default("2.54mm").describe("pitch"),
|
|
8569
|
+
id: length61.default("1.0mm").describe("inner diameter"),
|
|
8570
|
+
od: length61.default("1.5mm").describe("outer diameter"),
|
|
8571
|
+
male: z79.boolean().optional().describe("the module uses male headers"),
|
|
8572
|
+
nopin: z79.boolean().optional().default(false).describe("omit pins rendering"),
|
|
8573
|
+
female: z79.boolean().optional().describe("the module uses female headers"),
|
|
8574
|
+
smd: z79.boolean().optional().describe("surface mount device"),
|
|
8575
|
+
pinlabeltextalignleft: z79.boolean().optional().default(false),
|
|
8576
|
+
pinlabeltextaligncenter: z79.boolean().optional().default(false),
|
|
8577
|
+
pinlabeltextalignright: z79.boolean().optional().default(false),
|
|
8578
|
+
pinlabelverticallyinverted: z79.boolean().optional().default(false),
|
|
8579
|
+
pinlabelorthogonal: z79.boolean().optional().default(false),
|
|
8580
|
+
nopinlabels: z79.boolean().optional().default(false).describe("omit silkscreen pin labels"),
|
|
8581
|
+
doublesidedpinlabel: z79.boolean().optional().default(false).describe("add silkscreen pins in top and bottom layers"),
|
|
8582
|
+
bottomsidepinlabel: z79.boolean().optional().default(false).describe(
|
|
8464
8583
|
"place the silkscreen reference text on the bottom layer instead of top"
|
|
8465
8584
|
),
|
|
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:
|
|
8585
|
+
pinRowSide: z79.enum(["left", "right", "top", "bottom"]).optional().default("left"),
|
|
8586
|
+
pinrowleft: z79.boolean().optional().default(false),
|
|
8587
|
+
pinrowright: z79.boolean().optional().default(false),
|
|
8588
|
+
pinrowtop: z79.boolean().optional().default(false),
|
|
8589
|
+
pinrowbottom: z79.boolean().optional().default(false),
|
|
8590
|
+
pinrowleftpins: z79.union([z79.string(), z79.number()]).transform((val) => Number(val)).optional(),
|
|
8591
|
+
pinrowrightpins: z79.union([z79.string(), z79.number()]).transform((val) => Number(val)).optional(),
|
|
8592
|
+
pinrowtoppins: z79.union([z79.string(), z79.number()]).transform((val) => Number(val)).optional(),
|
|
8593
|
+
pinrowbottompins: z79.union([z79.string(), z79.number()]).transform((val) => Number(val)).optional(),
|
|
8594
|
+
width: length61.optional(),
|
|
8595
|
+
height: length61.optional(),
|
|
8596
|
+
pinRowHoleEdgeToEdgeDist: length61.default("2mm"),
|
|
8597
|
+
holes: z79.union([z79.string(), z79.array(z79.string())]).optional().transform((val) => {
|
|
8479
8598
|
if (!val) return val;
|
|
8480
8599
|
if (Array.isArray(val)) return val;
|
|
8481
8600
|
if (val.startsWith("(") && val.endsWith(")")) {
|
|
@@ -8483,19 +8602,23 @@ var mountedpcbmodule_def = base_def.extend({
|
|
|
8483
8602
|
}
|
|
8484
8603
|
return [val];
|
|
8485
8604
|
}),
|
|
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:
|
|
8605
|
+
holeXDist: length61.optional(),
|
|
8606
|
+
holeYDist: length61.optional(),
|
|
8607
|
+
holeInset: length61.default("1mm"),
|
|
8608
|
+
pinrow: z79.union([z79.string(), z79.number()]).optional(),
|
|
8609
|
+
usbposition: z79.enum(["left", "right", "top", "bottom"]).optional().default("left"),
|
|
8610
|
+
usbleft: z79.boolean().optional().default(false),
|
|
8611
|
+
usbtop: z79.boolean().optional().default(false),
|
|
8612
|
+
usbright: z79.boolean().optional().default(false),
|
|
8613
|
+
usbbottom: z79.boolean().optional().default(false),
|
|
8614
|
+
usbtype: z79.enum(["micro", "c"]).optional(),
|
|
8615
|
+
usbmicro: z79.boolean().optional().default(false),
|
|
8616
|
+
usbc: z79.boolean().optional().default(false),
|
|
8617
|
+
screen: z79.boolean().optional().default(false).describe("add silkscreen outline for screen/display area"),
|
|
8618
|
+
screenwidth: length61.optional(),
|
|
8619
|
+
screenheight: length61.optional(),
|
|
8620
|
+
screencenteroffsetx: length61.optional(),
|
|
8621
|
+
screencenteroffsety: length61.optional()
|
|
8499
8622
|
}).transform((data) => {
|
|
8500
8623
|
const pinlabelAnchorSide = determinePinlabelAnchorSide(data);
|
|
8501
8624
|
let pinRowSide = data.pinRowSide;
|
|
@@ -8559,6 +8682,12 @@ var mountedpcbmodule_def = base_def.extend({
|
|
|
8559
8682
|
calculatedWidth = 10;
|
|
8560
8683
|
calculatedHeight = 10;
|
|
8561
8684
|
}
|
|
8685
|
+
const finalWidth = data.width ?? calculatedWidth;
|
|
8686
|
+
const finalHeight = data.height ?? calculatedHeight;
|
|
8687
|
+
const screenWidth = data.screenwidth ?? finalWidth * 0.95;
|
|
8688
|
+
const screenHeight = data.screenheight ?? finalHeight * 0.95;
|
|
8689
|
+
const screenCenterOffsetX = data.screencenteroffsetx ?? 0;
|
|
8690
|
+
const screenCenterOffsetY = data.screencenteroffsety ?? 0;
|
|
8562
8691
|
return {
|
|
8563
8692
|
...data,
|
|
8564
8693
|
pinlabelAnchorSide,
|
|
@@ -8567,8 +8696,12 @@ var mountedpcbmodule_def = base_def.extend({
|
|
|
8567
8696
|
usbtype,
|
|
8568
8697
|
male: data.male ?? !data.female,
|
|
8569
8698
|
female: data.female ?? false,
|
|
8570
|
-
width:
|
|
8571
|
-
height:
|
|
8699
|
+
width: finalWidth,
|
|
8700
|
+
height: finalHeight,
|
|
8701
|
+
screenwidth: screenWidth,
|
|
8702
|
+
screenheight: screenHeight,
|
|
8703
|
+
screencenteroffsetx: screenCenterOffsetX,
|
|
8704
|
+
screencenteroffsety: screenCenterOffsetY,
|
|
8572
8705
|
pinrowleftpins: sidePinCounts.left,
|
|
8573
8706
|
pinrowrightpins: sidePinCounts.right,
|
|
8574
8707
|
pinrowtoppins: sidePinCounts.top,
|
|
@@ -8577,7 +8710,7 @@ var mountedpcbmodule_def = base_def.extend({
|
|
|
8577
8710
|
}).superRefine((data, ctx) => {
|
|
8578
8711
|
if (data.male && data.female) {
|
|
8579
8712
|
ctx.addIssue({
|
|
8580
|
-
code:
|
|
8713
|
+
code: z79.ZodIssueCode.custom,
|
|
8581
8714
|
message: "'male' and 'female' cannot both be true; it should be male or female.",
|
|
8582
8715
|
path: ["male", "female"]
|
|
8583
8716
|
});
|
|
@@ -8613,7 +8746,11 @@ var mountedpcbmodule = (raw_params) => {
|
|
|
8613
8746
|
pinrowbottompins,
|
|
8614
8747
|
usbposition,
|
|
8615
8748
|
usbtype,
|
|
8616
|
-
screen
|
|
8749
|
+
screen,
|
|
8750
|
+
screenwidth,
|
|
8751
|
+
screenheight,
|
|
8752
|
+
screencenteroffsetx,
|
|
8753
|
+
screencenteroffsety
|
|
8617
8754
|
} = parameters;
|
|
8618
8755
|
let pinlabelTextAlign = "center";
|
|
8619
8756
|
if (pinlabeltextalignleft) pinlabelTextAlign = "left";
|
|
@@ -8894,12 +9031,16 @@ var mountedpcbmodule = (raw_params) => {
|
|
|
8894
9031
|
elements.push(silkscreenpath(usbRect, { stroke_width: 0.1, layer: "top" }));
|
|
8895
9032
|
}
|
|
8896
9033
|
if (screen) {
|
|
9034
|
+
const halfScreenWidth = screenwidth / 2;
|
|
9035
|
+
const halfScreenHeight = screenheight / 2;
|
|
9036
|
+
const centerX = screencenteroffsetx;
|
|
9037
|
+
const centerY = screencenteroffsety;
|
|
8897
9038
|
const screenOutline = [
|
|
8898
|
-
{ x: -
|
|
8899
|
-
{ x:
|
|
8900
|
-
{ x:
|
|
8901
|
-
{ x: -
|
|
8902
|
-
{ x: -
|
|
9039
|
+
{ x: -halfScreenWidth + centerX, y: -halfScreenHeight + centerY },
|
|
9040
|
+
{ x: halfScreenWidth + centerX, y: -halfScreenHeight + centerY },
|
|
9041
|
+
{ x: halfScreenWidth + centerX, y: halfScreenHeight + centerY },
|
|
9042
|
+
{ x: -halfScreenWidth + centerX, y: halfScreenHeight + centerY },
|
|
9043
|
+
{ x: -halfScreenWidth + centerX, y: -halfScreenHeight + centerY }
|
|
8903
9044
|
];
|
|
8904
9045
|
elements.push(
|
|
8905
9046
|
silkscreenpath(screenOutline, { stroke_width: 0.05, layer: "top" })
|
|
@@ -8912,16 +9053,16 @@ var mountedpcbmodule = (raw_params) => {
|
|
|
8912
9053
|
};
|
|
8913
9054
|
|
|
8914
9055
|
// src/fn/to92l.ts
|
|
8915
|
-
import { z as
|
|
9056
|
+
import { z as z80 } from "zod";
|
|
8916
9057
|
var to92l_def = base_def.extend({
|
|
8917
|
-
fn:
|
|
8918
|
-
num_pins:
|
|
8919
|
-
inline:
|
|
8920
|
-
p:
|
|
8921
|
-
id:
|
|
8922
|
-
od:
|
|
8923
|
-
w:
|
|
8924
|
-
h:
|
|
9058
|
+
fn: z80.string(),
|
|
9059
|
+
num_pins: z80.number().default(3),
|
|
9060
|
+
inline: z80.boolean().default(false),
|
|
9061
|
+
p: z80.string().default("1.27mm"),
|
|
9062
|
+
id: z80.string().default("0.75mm"),
|
|
9063
|
+
od: z80.string().default("1.3mm"),
|
|
9064
|
+
w: z80.string().default("4.8mm"),
|
|
9065
|
+
h: z80.string().default("4.0mm")
|
|
8925
9066
|
});
|
|
8926
9067
|
var to92l = (raw_params) => {
|
|
8927
9068
|
const parameters = to92l_def.parse(raw_params);
|