@tscircuit/footprinter 0.0.323 → 0.0.324
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 +96 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -316,12 +316,27 @@ var dip = (raw_params) => {
|
|
|
316
316
|
});
|
|
317
317
|
}
|
|
318
318
|
const silkscreenRefText = silkscreenRef(0, sh / 2 + 0.5, 0.4);
|
|
319
|
+
const courtyardPadding = 0.25;
|
|
320
|
+
const crtMinX = -(parameters.w / 2 + parameters.od / 2) - courtyardPadding;
|
|
321
|
+
const crtMaxX = parameters.w / 2 + parameters.od / 2 + courtyardPadding;
|
|
322
|
+
const crtMinY = -sh / 2 - courtyardPadding;
|
|
323
|
+
const crtMaxY = sh / 2 + courtyardPadding;
|
|
324
|
+
const courtyard = {
|
|
325
|
+
type: "pcb_courtyard_rect",
|
|
326
|
+
pcb_courtyard_rect_id: "",
|
|
327
|
+
pcb_component_id: "",
|
|
328
|
+
center: { x: (crtMinX + crtMaxX) / 2, y: (crtMinY + crtMaxY) / 2 },
|
|
329
|
+
width: crtMaxX - crtMinX,
|
|
330
|
+
height: crtMaxY - crtMinY,
|
|
331
|
+
layer: "top"
|
|
332
|
+
};
|
|
319
333
|
return {
|
|
320
334
|
circuitJson: [
|
|
321
335
|
...platedHoles,
|
|
322
336
|
silkscreenBorder,
|
|
323
337
|
silkscreenRefText,
|
|
324
|
-
...silkscreenPins
|
|
338
|
+
...silkscreenPins,
|
|
339
|
+
courtyard
|
|
325
340
|
],
|
|
326
341
|
parameters
|
|
327
342
|
};
|
|
@@ -1217,7 +1232,29 @@ var soicWithoutParsing = (parameters) => {
|
|
|
1217
1232
|
{ x: -sw / 2, y: -sh / 2 }
|
|
1218
1233
|
]
|
|
1219
1234
|
};
|
|
1220
|
-
|
|
1235
|
+
const courtyardPadding = 0.25;
|
|
1236
|
+
const silkXs = silkscreenBorder.route.map((pt) => pt.x);
|
|
1237
|
+
const silkYs = silkscreenBorder.route.map((pt) => pt.y);
|
|
1238
|
+
const padXExtent = parameters.legsoutside ? parameters.w / 2 + parameters.pl : parameters.w / 2;
|
|
1239
|
+
const crtMinX = Math.min(-padXExtent, ...silkXs) - courtyardPadding;
|
|
1240
|
+
const crtMaxX = Math.max(padXExtent, ...silkXs) + courtyardPadding;
|
|
1241
|
+
const crtMinY = Math.min(...silkYs) - courtyardPadding;
|
|
1242
|
+
const crtMaxY = Math.max(...silkYs) + courtyardPadding;
|
|
1243
|
+
const courtyard = {
|
|
1244
|
+
type: "pcb_courtyard_rect",
|
|
1245
|
+
pcb_courtyard_rect_id: "",
|
|
1246
|
+
pcb_component_id: "",
|
|
1247
|
+
center: { x: (crtMinX + crtMaxX) / 2, y: (crtMinY + crtMaxY) / 2 },
|
|
1248
|
+
width: crtMaxX - crtMinX,
|
|
1249
|
+
height: crtMaxY - crtMinY,
|
|
1250
|
+
layer: "top"
|
|
1251
|
+
};
|
|
1252
|
+
return [
|
|
1253
|
+
...pads,
|
|
1254
|
+
silkscreenBorder,
|
|
1255
|
+
silkscreenRefText,
|
|
1256
|
+
courtyard
|
|
1257
|
+
];
|
|
1221
1258
|
};
|
|
1222
1259
|
|
|
1223
1260
|
// src/fn/quad.ts
|
|
@@ -1542,11 +1579,28 @@ var quad = (raw_params) => {
|
|
|
1542
1579
|
parameters.h / 2 + (parameters.legsoutside ? parameters.pl * 1.2 : 0.5),
|
|
1543
1580
|
0.3
|
|
1544
1581
|
);
|
|
1582
|
+
const courtyardPadding = 0.25;
|
|
1583
|
+
const padExtentX = parameters.legsoutside ? parameters.w / 2 + parameters.pl : parameters.w / 2;
|
|
1584
|
+
const padExtentY = parameters.legsoutside ? parameters.h / 2 + parameters.pl : parameters.h / 2;
|
|
1585
|
+
const crtMinX = -padExtentX - courtyardPadding;
|
|
1586
|
+
const crtMaxX = padExtentX + courtyardPadding;
|
|
1587
|
+
const crtMinY = -padExtentY - courtyardPadding;
|
|
1588
|
+
const crtMaxY = padExtentY + courtyardPadding;
|
|
1589
|
+
const courtyard = {
|
|
1590
|
+
type: "pcb_courtyard_rect",
|
|
1591
|
+
pcb_courtyard_rect_id: "",
|
|
1592
|
+
pcb_component_id: "",
|
|
1593
|
+
center: { x: (crtMinX + crtMaxX) / 2, y: (crtMinY + crtMaxY) / 2 },
|
|
1594
|
+
width: crtMaxX - crtMinX,
|
|
1595
|
+
height: crtMaxY - crtMinY,
|
|
1596
|
+
layer: "top"
|
|
1597
|
+
};
|
|
1545
1598
|
return {
|
|
1546
1599
|
circuitJson: [
|
|
1547
1600
|
...pads,
|
|
1548
1601
|
...silkscreen_corners,
|
|
1549
|
-
silkscreenRefText
|
|
1602
|
+
silkscreenRefText,
|
|
1603
|
+
courtyard
|
|
1550
1604
|
],
|
|
1551
1605
|
parameters
|
|
1552
1606
|
};
|
|
@@ -2092,7 +2146,24 @@ var sot23_3 = (parameters) => {
|
|
|
2092
2146
|
Number.parseInt(parameters.h),
|
|
2093
2147
|
0.3
|
|
2094
2148
|
);
|
|
2095
|
-
|
|
2149
|
+
const courtyardPadding = 0.25;
|
|
2150
|
+
const pl_val = Number.parseFloat(parameters.pl);
|
|
2151
|
+
const pw_val = Number.parseFloat(parameters.pw);
|
|
2152
|
+
const p_val = Number.parseFloat(parameters.p);
|
|
2153
|
+
const crtMinX = -1.155 - pl_val / 2 - courtyardPadding;
|
|
2154
|
+
const crtMaxX = 1.15 + pl_val / 2 + courtyardPadding;
|
|
2155
|
+
const crtMinY = -(p_val + pw_val / 2) - courtyardPadding;
|
|
2156
|
+
const crtMaxY = p_val + pw_val / 2 + courtyardPadding;
|
|
2157
|
+
const courtyard = {
|
|
2158
|
+
type: "pcb_courtyard_rect",
|
|
2159
|
+
pcb_courtyard_rect_id: "",
|
|
2160
|
+
pcb_component_id: "",
|
|
2161
|
+
center: { x: (crtMinX + crtMaxX) / 2, y: (crtMinY + crtMaxY) / 2 },
|
|
2162
|
+
width: crtMaxX - crtMinX,
|
|
2163
|
+
height: crtMaxY - crtMinY,
|
|
2164
|
+
layer: "top"
|
|
2165
|
+
};
|
|
2166
|
+
return [...pads, silkscreenRefText, courtyard];
|
|
2096
2167
|
};
|
|
2097
2168
|
var getCcwSot235Coords = (parameters) => {
|
|
2098
2169
|
const { p, h, pn } = parameters;
|
|
@@ -2193,12 +2264,32 @@ var sot23_5 = (parameters) => {
|
|
|
2193
2264
|
],
|
|
2194
2265
|
stroke_width: 0.05
|
|
2195
2266
|
};
|
|
2267
|
+
const courtyardPadding = 0.25;
|
|
2268
|
+
const pl_val = Number.parseFloat(parameters.pl);
|
|
2269
|
+
const pw_val = Number.parseFloat(parameters.pw);
|
|
2270
|
+
const p_val = Number.parseFloat(parameters.p);
|
|
2271
|
+
const silkY = height / 2 + p_val / 1.3;
|
|
2272
|
+
const padYExtent = p_val + pw_val / 2;
|
|
2273
|
+
const crtMinX = -(height / 2 + 0.5 + pl_val / 2) - courtyardPadding;
|
|
2274
|
+
const crtMaxX = height / 2 + 0.5 + pl_val / 2 + courtyardPadding;
|
|
2275
|
+
const crtMinY = -Math.max(silkY, padYExtent) - courtyardPadding;
|
|
2276
|
+
const crtMaxY = Math.max(silkY, padYExtent) + courtyardPadding;
|
|
2277
|
+
const courtyard = {
|
|
2278
|
+
type: "pcb_courtyard_rect",
|
|
2279
|
+
pcb_courtyard_rect_id: "",
|
|
2280
|
+
pcb_component_id: "",
|
|
2281
|
+
center: { x: (crtMinX + crtMaxX) / 2, y: (crtMinY + crtMaxY) / 2 },
|
|
2282
|
+
width: crtMaxX - crtMinX,
|
|
2283
|
+
height: crtMaxY - crtMinY,
|
|
2284
|
+
layer: "top"
|
|
2285
|
+
};
|
|
2196
2286
|
return [
|
|
2197
2287
|
...pads,
|
|
2198
2288
|
silkscreenRefText,
|
|
2199
2289
|
silkscreenPath1,
|
|
2200
2290
|
silkscreenPath2,
|
|
2201
|
-
pin1Indicator
|
|
2291
|
+
pin1Indicator,
|
|
2292
|
+
courtyard
|
|
2202
2293
|
];
|
|
2203
2294
|
};
|
|
2204
2295
|
|