@tscircuit/footprinter 0.0.293 → 0.0.295
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 +89 -45
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -135,7 +135,17 @@ var platedhole = (pn, x, y, id, od) => {
|
|
|
135
135
|
|
|
136
136
|
// src/helpers/platedHoleWithRectPad.ts
|
|
137
137
|
import { mm as mm2 } from "@tscircuit/mm";
|
|
138
|
-
var platedHoleWithRectPad = (
|
|
138
|
+
var platedHoleWithRectPad = (options) => {
|
|
139
|
+
const {
|
|
140
|
+
pn,
|
|
141
|
+
x,
|
|
142
|
+
y,
|
|
143
|
+
holeDiameter,
|
|
144
|
+
rectPadWidth,
|
|
145
|
+
rectPadHeight,
|
|
146
|
+
holeOffsetX = 0,
|
|
147
|
+
holeOffsetY = 0
|
|
148
|
+
} = options;
|
|
139
149
|
return {
|
|
140
150
|
pcb_plated_hole_id: "",
|
|
141
151
|
type: "pcb_plated_hole",
|
|
@@ -235,14 +245,14 @@ var dip = (raw_params) => {
|
|
|
235
245
|
);
|
|
236
246
|
if (i === 0 && !parameters.nosquareplating) {
|
|
237
247
|
platedHoles.push(
|
|
238
|
-
platedHoleWithRectPad(
|
|
239
|
-
i + 1,
|
|
248
|
+
platedHoleWithRectPad({
|
|
249
|
+
pn: i + 1,
|
|
240
250
|
x,
|
|
241
251
|
y,
|
|
242
|
-
parameters.id ?? "0.8mm",
|
|
243
|
-
parameters.od ?? "1mm",
|
|
244
|
-
parameters.od ?? "1mm"
|
|
245
|
-
)
|
|
252
|
+
holeDiameter: parameters.id ?? "0.8mm",
|
|
253
|
+
rectPadWidth: parameters.od ?? "1mm",
|
|
254
|
+
rectPadHeight: parameters.od ?? "1mm"
|
|
255
|
+
})
|
|
246
256
|
);
|
|
247
257
|
continue;
|
|
248
258
|
}
|
|
@@ -2342,7 +2352,14 @@ var pinrow = (raw_params) => {
|
|
|
2342
2352
|
} else {
|
|
2343
2353
|
if (pinNumber === 1 && !parameters.nosquareplating) {
|
|
2344
2354
|
holes.push(
|
|
2345
|
-
platedHoleWithRectPad(
|
|
2355
|
+
platedHoleWithRectPad({
|
|
2356
|
+
pn: pinNumber,
|
|
2357
|
+
x: xoff,
|
|
2358
|
+
y: yoff,
|
|
2359
|
+
holeDiameter: id,
|
|
2360
|
+
rectPadWidth: od,
|
|
2361
|
+
rectPadHeight: od
|
|
2362
|
+
})
|
|
2346
2363
|
);
|
|
2347
2364
|
} else {
|
|
2348
2365
|
holes.push(platedhole(pinNumber, xoff, yoff, id, od));
|
|
@@ -4047,16 +4064,14 @@ var to92 = (raw_params) => {
|
|
|
4047
4064
|
if (parameters.num_pins === 3) {
|
|
4048
4065
|
if (inline) {
|
|
4049
4066
|
platedHoles = [
|
|
4050
|
-
platedHoleWithRectPad(
|
|
4051
|
-
1,
|
|
4052
|
-
-padSpacing7,
|
|
4053
|
-
holeY - padSpacing7,
|
|
4054
|
-
holeDia,
|
|
4055
|
-
padDia,
|
|
4056
|
-
padHeight
|
|
4057
|
-
|
|
4058
|
-
0
|
|
4059
|
-
),
|
|
4067
|
+
platedHoleWithRectPad({
|
|
4068
|
+
pn: 1,
|
|
4069
|
+
x: -padSpacing7,
|
|
4070
|
+
y: holeY - padSpacing7,
|
|
4071
|
+
holeDiameter: holeDia,
|
|
4072
|
+
rectPadWidth: padDia,
|
|
4073
|
+
rectPadHeight: padHeight
|
|
4074
|
+
}),
|
|
4060
4075
|
platedHolePill(2, 0, holeY - padSpacing7, holeDia, padWidth, padHeight),
|
|
4061
4076
|
platedHolePill(
|
|
4062
4077
|
3,
|
|
@@ -4069,32 +4084,28 @@ var to92 = (raw_params) => {
|
|
|
4069
4084
|
];
|
|
4070
4085
|
} else {
|
|
4071
4086
|
platedHoles = [
|
|
4072
|
-
platedHoleWithRectPad(
|
|
4073
|
-
1,
|
|
4074
|
-
-padSpacing7,
|
|
4075
|
-
holeY - padSpacing7,
|
|
4076
|
-
holeDia,
|
|
4077
|
-
padDia,
|
|
4078
|
-
padDia
|
|
4079
|
-
|
|
4080
|
-
0
|
|
4081
|
-
),
|
|
4087
|
+
platedHoleWithRectPad({
|
|
4088
|
+
pn: 1,
|
|
4089
|
+
x: -padSpacing7,
|
|
4090
|
+
y: holeY - padSpacing7,
|
|
4091
|
+
holeDiameter: holeDia,
|
|
4092
|
+
rectPadWidth: padDia,
|
|
4093
|
+
rectPadHeight: padDia
|
|
4094
|
+
}),
|
|
4082
4095
|
platedhole(2, 0, holeY, holeDia, padDia),
|
|
4083
4096
|
platedhole(3, padSpacing7, holeY - padSpacing7, holeDia, padDia)
|
|
4084
4097
|
];
|
|
4085
4098
|
}
|
|
4086
4099
|
} else if (parameters.num_pins === 2) {
|
|
4087
4100
|
platedHoles = [
|
|
4088
|
-
platedHoleWithRectPad(
|
|
4089
|
-
1,
|
|
4090
|
-
-padSpacing7,
|
|
4091
|
-
holeY - padSpacing7,
|
|
4092
|
-
holeDia,
|
|
4093
|
-
padWidth,
|
|
4094
|
-
padHeight
|
|
4095
|
-
|
|
4096
|
-
0
|
|
4097
|
-
),
|
|
4101
|
+
platedHoleWithRectPad({
|
|
4102
|
+
pn: 1,
|
|
4103
|
+
x: -padSpacing7,
|
|
4104
|
+
y: holeY - padSpacing7,
|
|
4105
|
+
holeDiameter: holeDia,
|
|
4106
|
+
rectPadWidth: padWidth,
|
|
4107
|
+
rectPadHeight: padHeight
|
|
4108
|
+
}),
|
|
4098
4109
|
platedHolePill(
|
|
4099
4110
|
2,
|
|
4100
4111
|
padSpacing7,
|
|
@@ -6383,8 +6394,26 @@ function generatePads(variant, numPins, p, id, pw, pl) {
|
|
|
6383
6394
|
const pads = [];
|
|
6384
6395
|
if (variant === "ph") {
|
|
6385
6396
|
const half_p = p / 2;
|
|
6386
|
-
pads.push(
|
|
6387
|
-
|
|
6397
|
+
pads.push(
|
|
6398
|
+
platedHoleWithRectPad({
|
|
6399
|
+
pn: 1,
|
|
6400
|
+
x: -half_p,
|
|
6401
|
+
y: 2,
|
|
6402
|
+
holeDiameter: id,
|
|
6403
|
+
rectPadWidth: pw,
|
|
6404
|
+
rectPadHeight: pl
|
|
6405
|
+
})
|
|
6406
|
+
);
|
|
6407
|
+
pads.push(
|
|
6408
|
+
platedHoleWithRectPad({
|
|
6409
|
+
pn: 2,
|
|
6410
|
+
x: half_p,
|
|
6411
|
+
y: 2,
|
|
6412
|
+
holeDiameter: id,
|
|
6413
|
+
rectPadWidth: pw,
|
|
6414
|
+
rectPadHeight: pl
|
|
6415
|
+
})
|
|
6416
|
+
);
|
|
6388
6417
|
} else {
|
|
6389
6418
|
const startX = -((numPins - 1) / 2) * p;
|
|
6390
6419
|
for (let i = 0; i < numPins; i++) {
|
|
@@ -7924,7 +7953,14 @@ var platedhole2 = (raw_params) => {
|
|
|
7924
7953
|
const { d, pd, squarepad } = params;
|
|
7925
7954
|
return {
|
|
7926
7955
|
circuitJson: [
|
|
7927
|
-
squarepad ? platedHoleWithRectPad(
|
|
7956
|
+
squarepad ? platedHoleWithRectPad({
|
|
7957
|
+
pn: 1,
|
|
7958
|
+
x: 0,
|
|
7959
|
+
y: 0,
|
|
7960
|
+
holeDiameter: d,
|
|
7961
|
+
rectPadWidth: pd,
|
|
7962
|
+
rectPadHeight: pd
|
|
7963
|
+
}) : platedhole(1, 0, 0, d, pd),
|
|
7928
7964
|
silkscreenRef(0, pd / 2 + 0.5, 0.2)
|
|
7929
7965
|
],
|
|
7930
7966
|
parameters: params
|
|
@@ -8228,7 +8264,8 @@ var m2host = (raw_params) => {
|
|
|
8228
8264
|
maxY = Math.max(maxY, y + h / 2);
|
|
8229
8265
|
};
|
|
8230
8266
|
for (const pad2 of pads) {
|
|
8231
|
-
|
|
8267
|
+
const rectPad = pad2;
|
|
8268
|
+
updateBounds(rectPad.x, rectPad.y, rectPad.width, rectPad.height);
|
|
8232
8269
|
}
|
|
8233
8270
|
updateBounds(cutout.center.x, cutout.center.y, cutout.width, cutout.height);
|
|
8234
8271
|
for (const point of pin1Marker.route) {
|
|
@@ -8284,9 +8321,16 @@ var to92l = (raw_params) => {
|
|
|
8284
8321
|
const od = parameters.inline ? 1.05 : Number.parseFloat(parameters.od);
|
|
8285
8322
|
const padH = parameters.inline ? 1.5 : od;
|
|
8286
8323
|
const holes = [
|
|
8287
|
-
platedHoleWithRectPad(
|
|
8288
|
-
|
|
8289
|
-
|
|
8324
|
+
platedHoleWithRectPad({
|
|
8325
|
+
pn: 1,
|
|
8326
|
+
x: 0,
|
|
8327
|
+
y: 0,
|
|
8328
|
+
holeDiameter: parameters.id,
|
|
8329
|
+
rectPadWidth: od,
|
|
8330
|
+
rectPadHeight: padH
|
|
8331
|
+
}),
|
|
8332
|
+
parameters.inline ? platedHolePill(2, p, 0, Number.parseFloat(parameters.id), od, padH) : platedhole(2, p, p, parameters.id, od),
|
|
8333
|
+
parameters.inline ? platedHolePill(3, p * 2, 0, Number.parseFloat(parameters.id), od, padH) : platedhole(3, p * 2, 0, parameters.id, od)
|
|
8290
8334
|
];
|
|
8291
8335
|
const radius = w / 2;
|
|
8292
8336
|
const cx = parameters.inline ? p - 0.09 : p;
|