@tscircuit/footprinter 0.0.176 → 0.0.178
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.js +57 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -28,6 +28,7 @@ __export(fn_exports, {
|
|
|
28
28
|
msop: () => msop,
|
|
29
29
|
pad: () => pad,
|
|
30
30
|
pinrow: () => pinrow,
|
|
31
|
+
platedhole: () => platedhole3,
|
|
31
32
|
potentiometer: () => potentiometer,
|
|
32
33
|
pushbutton: () => pushbutton,
|
|
33
34
|
qfn: () => qfn,
|
|
@@ -4069,12 +4070,12 @@ var sot89_3 = (parameters) => {
|
|
|
4069
4070
|
const pads = [];
|
|
4070
4071
|
const padGap = Number.parseFloat(parameters.p);
|
|
4071
4072
|
const padWidth = Number.parseFloat(parameters.pw);
|
|
4072
|
-
const
|
|
4073
|
+
const length46 = Number.parseFloat(parameters.w);
|
|
4073
4074
|
const padHeight = Number.parseFloat(parameters.pl);
|
|
4074
4075
|
pads.push(
|
|
4075
|
-
rectpad(1, -
|
|
4076
|
-
rectpad(2, -
|
|
4077
|
-
rectpad(3, -
|
|
4076
|
+
rectpad(1, -length46 / 2, padGap, padHeight, padWidth),
|
|
4077
|
+
rectpad(2, -length46 / 2 + (1.5 - 1.3) / 2, 0, 1.5, padWidth),
|
|
4078
|
+
rectpad(3, -length46 / 2, -padGap, padHeight, padWidth)
|
|
4078
4079
|
);
|
|
4079
4080
|
const silkscreenRefText = silkscreenRef(0, 0, 0.3);
|
|
4080
4081
|
const width = Number.parseFloat(parameters.w) / 2 - 1;
|
|
@@ -4114,7 +4115,7 @@ var sot89_5 = (parameters) => {
|
|
|
4114
4115
|
const pads = [];
|
|
4115
4116
|
const padGap = Number.parseFloat(parameters.p);
|
|
4116
4117
|
const padWidth = Number.parseFloat(parameters.pw);
|
|
4117
|
-
const
|
|
4118
|
+
const length46 = Number.parseFloat(parameters.w);
|
|
4118
4119
|
pads.push(
|
|
4119
4120
|
rectpad(1, -1.85, -1.5, 1.5, 0.7),
|
|
4120
4121
|
rectpad(2, -1.85, 1.5, 1.5, 0.7),
|
|
@@ -6641,6 +6642,57 @@ var sot323_3 = (parameters) => {
|
|
|
6641
6642
|
];
|
|
6642
6643
|
};
|
|
6643
6644
|
|
|
6645
|
+
// src/fn/platedhole.ts
|
|
6646
|
+
import { z as z58 } from "zod";
|
|
6647
|
+
import { length as length45 } from "circuit-json";
|
|
6648
|
+
import { mm as mm6 } from "@tscircuit/mm";
|
|
6649
|
+
var platedhole_def = z58.object({
|
|
6650
|
+
fn: z58.string(),
|
|
6651
|
+
d: length45.optional(),
|
|
6652
|
+
hd: length45.optional(),
|
|
6653
|
+
r: length45.optional(),
|
|
6654
|
+
hr: length45.optional(),
|
|
6655
|
+
pd: length45.optional(),
|
|
6656
|
+
pr: length45.optional(),
|
|
6657
|
+
squarepad: z58.boolean().optional().default(false)
|
|
6658
|
+
}).transform((v) => {
|
|
6659
|
+
let holeD;
|
|
6660
|
+
if (v.d !== void 0)
|
|
6661
|
+
holeD = mm6(v.d);
|
|
6662
|
+
else if (v.hd !== void 0)
|
|
6663
|
+
holeD = mm6(v.hd);
|
|
6664
|
+
else if (v.r !== void 0)
|
|
6665
|
+
holeD = mm6(v.r) * 2;
|
|
6666
|
+
else if (v.hr !== void 0)
|
|
6667
|
+
holeD = mm6(v.hr) * 2;
|
|
6668
|
+
else
|
|
6669
|
+
holeD = mm6("1mm");
|
|
6670
|
+
let padD;
|
|
6671
|
+
if (v.pd !== void 0)
|
|
6672
|
+
padD = mm6(v.pd);
|
|
6673
|
+
else if (v.pr !== void 0)
|
|
6674
|
+
padD = mm6(v.pr) * 2;
|
|
6675
|
+
else
|
|
6676
|
+
padD = holeD * (1.5 / 1);
|
|
6677
|
+
return {
|
|
6678
|
+
fn: v.fn,
|
|
6679
|
+
d: holeD,
|
|
6680
|
+
pd: padD,
|
|
6681
|
+
squarepad: v.squarepad ?? false
|
|
6682
|
+
};
|
|
6683
|
+
});
|
|
6684
|
+
var platedhole3 = (raw_params) => {
|
|
6685
|
+
const params = platedhole_def.parse(raw_params);
|
|
6686
|
+
const { d, pd, squarepad } = params;
|
|
6687
|
+
return {
|
|
6688
|
+
circuitJson: [
|
|
6689
|
+
squarepad ? platedHoleWithRectPad(1, 0, 0, d, pd, pd) : platedhole(1, 0, 0, d, pd),
|
|
6690
|
+
silkscreenRef(0, pd / 2 + 0.5, 0.2)
|
|
6691
|
+
],
|
|
6692
|
+
parameters: params
|
|
6693
|
+
};
|
|
6694
|
+
};
|
|
6695
|
+
|
|
6644
6696
|
// src/helpers/is-not-null.ts
|
|
6645
6697
|
function isNotNull(value) {
|
|
6646
6698
|
return value !== null;
|