@tscircuit/footprinter 0.0.268 → 0.0.270
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 +107 -1
- package/dist/index.js +22 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -106,7 +106,8 @@ import { z } from "zod";
|
|
|
106
106
|
var base_def = z.object({
|
|
107
107
|
norefdes: z.boolean().optional().describe("disable reference designator label"),
|
|
108
108
|
invert: z.boolean().optional().describe("hint to invert the orientation of the 3D model"),
|
|
109
|
-
faceup: z.boolean().optional().describe("The male pin header should face upwards, out of the top layer")
|
|
109
|
+
faceup: z.boolean().optional().describe("The male pin header should face upwards, out of the top layer"),
|
|
110
|
+
nosilkscreen: z.boolean().optional().describe("omit all silkscreen elements from the footprint")
|
|
110
111
|
});
|
|
111
112
|
|
|
112
113
|
// src/fn/dip.ts
|
|
@@ -131,7 +132,7 @@ var platedhole = (pn, x, y, id, od) => {
|
|
|
131
132
|
|
|
132
133
|
// src/helpers/platedHoleWithRectPad.ts
|
|
133
134
|
import { mm as mm2 } from "@tscircuit/mm";
|
|
134
|
-
var platedHoleWithRectPad = (pn, x, y, holeDiameter, rectPadWidth, rectPadHeight) => {
|
|
135
|
+
var platedHoleWithRectPad = (pn, x, y, holeDiameter, rectPadWidth, rectPadHeight, holeOffsetX, holeOffsetY) => {
|
|
135
136
|
return {
|
|
136
137
|
pcb_plated_hole_id: "",
|
|
137
138
|
type: "pcb_plated_hole",
|
|
@@ -145,7 +146,9 @@ var platedHoleWithRectPad = (pn, x, y, holeDiameter, rectPadWidth, rectPadHeight
|
|
|
145
146
|
rect_pad_height: mm2(rectPadHeight),
|
|
146
147
|
pcb_port_id: "",
|
|
147
148
|
layers: ["top", "bottom"],
|
|
148
|
-
port_hints: [pn.toString()]
|
|
149
|
+
port_hints: [pn.toString()],
|
|
150
|
+
hole_offset_x: holeOffsetX,
|
|
151
|
+
hole_offset_y: holeOffsetY
|
|
149
152
|
};
|
|
150
153
|
};
|
|
151
154
|
|
|
@@ -7651,6 +7654,14 @@ var applyNoRefDes = (elements, parameters) => {
|
|
|
7651
7654
|
return elements;
|
|
7652
7655
|
};
|
|
7653
7656
|
|
|
7657
|
+
// src/helpers/apply-nosilkscreen.ts
|
|
7658
|
+
var applyNoSilkscreen = (elements, parameters) => {
|
|
7659
|
+
if (!parameters.nosilkscreen) return elements;
|
|
7660
|
+
return elements.filter((element) => {
|
|
7661
|
+
return element.type !== "pcb_silkscreen_path" && element.type !== "pcb_silkscreen_text";
|
|
7662
|
+
});
|
|
7663
|
+
};
|
|
7664
|
+
|
|
7654
7665
|
// src/footprinter.ts
|
|
7655
7666
|
var string2 = (def) => {
|
|
7656
7667
|
let fp2 = footprinter();
|
|
@@ -7698,10 +7709,15 @@ var footprinter = () => {
|
|
|
7698
7709
|
if ("fn" in target && fn_exports[target.fn]) {
|
|
7699
7710
|
return () => {
|
|
7700
7711
|
const { circuitJson } = fn_exports[target.fn](target);
|
|
7701
|
-
|
|
7702
|
-
|
|
7703
|
-
target
|
|
7712
|
+
const circuitWithoutSilkscreen = applyNoSilkscreen(
|
|
7713
|
+
circuitJson,
|
|
7714
|
+
target
|
|
7715
|
+
);
|
|
7716
|
+
const circuitWithoutRefDes = applyNoRefDes(
|
|
7717
|
+
circuitWithoutSilkscreen,
|
|
7718
|
+
target
|
|
7704
7719
|
);
|
|
7720
|
+
return applyOrigin(circuitWithoutRefDes, target.origin);
|
|
7705
7721
|
};
|
|
7706
7722
|
}
|
|
7707
7723
|
if (!fn_exports[target.fn]) {
|