@tscircuit/footprinter 0.0.205 → 0.0.207
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 +8 -8
- package/dist/index.js +39 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -377,7 +377,7 @@ declare const any_footprinter_def: z.ZodUnion<[z.ZodObject<{
|
|
|
377
377
|
nosquareplating: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
378
378
|
nopinlabels: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
379
379
|
doublesidedpinlabel: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
380
|
-
|
|
380
|
+
bottomsidepinlabel: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
381
381
|
}, "strip", z.ZodTypeAny, {
|
|
382
382
|
fn: string;
|
|
383
383
|
num_pins: number;
|
|
@@ -393,7 +393,7 @@ declare const any_footprinter_def: z.ZodUnion<[z.ZodObject<{
|
|
|
393
393
|
nosquareplating: boolean;
|
|
394
394
|
nopinlabels: boolean;
|
|
395
395
|
doublesidedpinlabel: boolean;
|
|
396
|
-
|
|
396
|
+
bottomsidepinlabel: boolean;
|
|
397
397
|
male?: boolean | undefined;
|
|
398
398
|
female?: boolean | undefined;
|
|
399
399
|
}, {
|
|
@@ -413,7 +413,7 @@ declare const any_footprinter_def: z.ZodUnion<[z.ZodObject<{
|
|
|
413
413
|
nosquareplating?: boolean | undefined;
|
|
414
414
|
nopinlabels?: boolean | undefined;
|
|
415
415
|
doublesidedpinlabel?: boolean | undefined;
|
|
416
|
-
|
|
416
|
+
bottomsidepinlabel?: boolean | undefined;
|
|
417
417
|
}>, {
|
|
418
418
|
pinlabelAnchorSide: "top" | "bottom" | "left" | "right";
|
|
419
419
|
male: boolean;
|
|
@@ -432,7 +432,7 @@ declare const any_footprinter_def: z.ZodUnion<[z.ZodObject<{
|
|
|
432
432
|
nosquareplating: boolean;
|
|
433
433
|
nopinlabels: boolean;
|
|
434
434
|
doublesidedpinlabel: boolean;
|
|
435
|
-
|
|
435
|
+
bottomsidepinlabel: boolean;
|
|
436
436
|
}, {
|
|
437
437
|
fn: string;
|
|
438
438
|
num_pins?: number | undefined;
|
|
@@ -450,7 +450,7 @@ declare const any_footprinter_def: z.ZodUnion<[z.ZodObject<{
|
|
|
450
450
|
nosquareplating?: boolean | undefined;
|
|
451
451
|
nopinlabels?: boolean | undefined;
|
|
452
452
|
doublesidedpinlabel?: boolean | undefined;
|
|
453
|
-
|
|
453
|
+
bottomsidepinlabel?: boolean | undefined;
|
|
454
454
|
}>, {
|
|
455
455
|
pinlabelAnchorSide: "top" | "bottom" | "left" | "right";
|
|
456
456
|
male: boolean;
|
|
@@ -469,7 +469,7 @@ declare const any_footprinter_def: z.ZodUnion<[z.ZodObject<{
|
|
|
469
469
|
nosquareplating: boolean;
|
|
470
470
|
nopinlabels: boolean;
|
|
471
471
|
doublesidedpinlabel: boolean;
|
|
472
|
-
|
|
472
|
+
bottomsidepinlabel: boolean;
|
|
473
473
|
}, {
|
|
474
474
|
fn: string;
|
|
475
475
|
num_pins?: number | undefined;
|
|
@@ -487,7 +487,7 @@ declare const any_footprinter_def: z.ZodUnion<[z.ZodObject<{
|
|
|
487
487
|
nosquareplating?: boolean | undefined;
|
|
488
488
|
nopinlabels?: boolean | undefined;
|
|
489
489
|
doublesidedpinlabel?: boolean | undefined;
|
|
490
|
-
|
|
490
|
+
bottomsidepinlabel?: boolean | undefined;
|
|
491
491
|
}>, z.ZodEffects<z.ZodObject<{
|
|
492
492
|
fn: z.ZodString;
|
|
493
493
|
cc: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
@@ -1168,7 +1168,7 @@ type Footprinter = {
|
|
|
1168
1168
|
ssop: (num_pins?: number) => FootprinterParamsBuilder<"w" | "p">;
|
|
1169
1169
|
tssop: (num_pins?: number) => FootprinterParamsBuilder<"w" | "p">;
|
|
1170
1170
|
dfn: (num_pins?: number) => FootprinterParamsBuilder<"w" | "p">;
|
|
1171
|
-
pinrow: (num_pins?: number) => FootprinterParamsBuilder<"p" | "id" | "od" | "male" | "female" | "rows" | "pinlabeltextalignleft" | "pinlabeltextaligncenter" | "pinlabeltextalignright" | "pinlabelverticallyinverted" | "pinlabelorthogonal" | "nosquareplating" | "nopinlabels" | "doublesidedpinlabel" | "
|
|
1171
|
+
pinrow: (num_pins?: number) => FootprinterParamsBuilder<"p" | "id" | "od" | "male" | "female" | "rows" | "pinlabeltextalignleft" | "pinlabeltextaligncenter" | "pinlabeltextalignright" | "pinlabelverticallyinverted" | "pinlabelorthogonal" | "nosquareplating" | "nopinlabels" | "doublesidedpinlabel" | "bottomsidepinlabel">;
|
|
1172
1172
|
axial: () => FootprinterParamsBuilder<"p" | "id" | "od">;
|
|
1173
1173
|
hc49: () => FootprinterParamsBuilder<"p" | "id" | "od" | "w" | "h">;
|
|
1174
1174
|
to220: () => FootprinterParamsBuilder<"w" | "h" | "p" | "id" | "od">;
|
package/dist/index.js
CHANGED
|
@@ -1662,7 +1662,7 @@ var pinrow_def = z12.object({
|
|
|
1662
1662
|
nosquareplating: z12.boolean().optional().default(false).describe("do not use rectangular pad for pin 1"),
|
|
1663
1663
|
nopinlabels: z12.boolean().optional().default(false).describe("omit silkscreen pin labels"),
|
|
1664
1664
|
doublesidedpinlabel: z12.boolean().optional().default(false).describe("add silkscreen pins in top and bottom layers"),
|
|
1665
|
-
|
|
1665
|
+
bottomsidepinlabel: z12.boolean().optional().default(false).describe(
|
|
1666
1666
|
"place the silkscreen reference text on the bottom layer instead of top"
|
|
1667
1667
|
)
|
|
1668
1668
|
}).transform((data) => {
|
|
@@ -1697,7 +1697,7 @@ var pinrow = (raw_params) => {
|
|
|
1697
1697
|
pinlabeltextalignright,
|
|
1698
1698
|
nopinlabels,
|
|
1699
1699
|
doublesidedpinlabel,
|
|
1700
|
-
|
|
1700
|
+
bottomsidepinlabel
|
|
1701
1701
|
} = parameters;
|
|
1702
1702
|
let pinlabelTextAlign = "center";
|
|
1703
1703
|
if (pinlabeltextalignleft) pinlabelTextAlign = "left";
|
|
@@ -1742,7 +1742,7 @@ var pinrow = (raw_params) => {
|
|
|
1742
1742
|
anchorSide: pinlabelAnchorSide
|
|
1743
1743
|
});
|
|
1744
1744
|
if (!nopinlabels) {
|
|
1745
|
-
if (!
|
|
1745
|
+
if (!bottomsidepinlabel) {
|
|
1746
1746
|
holes.push(
|
|
1747
1747
|
silkscreenPin({
|
|
1748
1748
|
fs: od / 5,
|
|
@@ -7063,6 +7063,42 @@ var m2host = (raw_params) => {
|
|
|
7063
7063
|
stroke_width: 0.05,
|
|
7064
7064
|
pcb_silkscreen_path_id: "pin_marker_1"
|
|
7065
7065
|
};
|
|
7066
|
+
let minX = Infinity;
|
|
7067
|
+
let maxX = -Infinity;
|
|
7068
|
+
let minY = Infinity;
|
|
7069
|
+
let maxY = -Infinity;
|
|
7070
|
+
const updateBounds = (x, y, w = 0, h = 0) => {
|
|
7071
|
+
minX = Math.min(minX, x - w / 2);
|
|
7072
|
+
maxX = Math.max(maxX, x + w / 2);
|
|
7073
|
+
minY = Math.min(minY, y - h / 2);
|
|
7074
|
+
maxY = Math.max(maxY, y + h / 2);
|
|
7075
|
+
};
|
|
7076
|
+
for (const pad2 of pads) {
|
|
7077
|
+
updateBounds(pad2.x, pad2.y, pad2.width, pad2.height);
|
|
7078
|
+
}
|
|
7079
|
+
updateBounds(cutout.center.x, cutout.center.y, cutout.width, cutout.height);
|
|
7080
|
+
for (const point of pin1Marker.route) {
|
|
7081
|
+
updateBounds(point.x, point.y);
|
|
7082
|
+
}
|
|
7083
|
+
const centerX = (minX + maxX) / 2;
|
|
7084
|
+
const centerY = (minY + maxY) / 2;
|
|
7085
|
+
const translate = (el) => {
|
|
7086
|
+
if (typeof el.x === "number") el.x -= centerX;
|
|
7087
|
+
if (typeof el.y === "number") el.y -= centerY;
|
|
7088
|
+
if (el.center) {
|
|
7089
|
+
el.center.x -= centerX;
|
|
7090
|
+
el.center.y -= centerY;
|
|
7091
|
+
}
|
|
7092
|
+
if (Array.isArray(el.route)) {
|
|
7093
|
+
el.route = el.route.map((p) => ({
|
|
7094
|
+
x: p.x - centerX,
|
|
7095
|
+
y: p.y - centerY
|
|
7096
|
+
}));
|
|
7097
|
+
}
|
|
7098
|
+
};
|
|
7099
|
+
for (const pad2 of pads) translate(pad2);
|
|
7100
|
+
translate(cutout);
|
|
7101
|
+
translate(pin1Marker);
|
|
7066
7102
|
return {
|
|
7067
7103
|
circuitJson: [
|
|
7068
7104
|
...pads,
|