@tscircuit/footprinter 0.0.322 → 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 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
  };
@@ -510,16 +525,13 @@ var passive = (params) => {
510
525
  const crtMinY = Math.min(-(h ?? 0) / 2, -ph / 2, ...silkYs) - excess;
511
526
  const crtMaxY = Math.max((h ?? 0) / 2, ph / 2, ...silkYs) + excess;
512
527
  const courtyard = {
513
- type: "pcb_courtyard_outline",
514
- pcb_courtyard_outline_id: "",
528
+ type: "pcb_courtyard_rect",
529
+ pcb_courtyard_rect_id: "",
515
530
  pcb_component_id: "",
516
- layer: "top",
517
- outline: [
518
- { x: crtMinX, y: crtMinY },
519
- { x: crtMaxX, y: crtMinY },
520
- { x: crtMaxX, y: crtMaxY },
521
- { x: crtMinX, y: crtMaxY }
522
- ]
531
+ center: { x: (crtMinX + crtMaxX) / 2, y: (crtMinY + crtMaxY) / 2 },
532
+ width: crtMaxX - crtMinX,
533
+ height: crtMaxY - crtMinY,
534
+ layer: "top"
523
535
  };
524
536
  if (tht) {
525
537
  return [
@@ -1220,7 +1232,29 @@ var soicWithoutParsing = (parameters) => {
1220
1232
  { x: -sw / 2, y: -sh / 2 }
1221
1233
  ]
1222
1234
  };
1223
- return [...pads, silkscreenBorder, silkscreenRefText];
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
+ ];
1224
1258
  };
1225
1259
 
1226
1260
  // src/fn/quad.ts
@@ -1545,11 +1579,28 @@ var quad = (raw_params) => {
1545
1579
  parameters.h / 2 + (parameters.legsoutside ? parameters.pl * 1.2 : 0.5),
1546
1580
  0.3
1547
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
+ };
1548
1598
  return {
1549
1599
  circuitJson: [
1550
1600
  ...pads,
1551
1601
  ...silkscreen_corners,
1552
- silkscreenRefText
1602
+ silkscreenRefText,
1603
+ courtyard
1553
1604
  ],
1554
1605
  parameters
1555
1606
  };
@@ -2095,7 +2146,24 @@ var sot23_3 = (parameters) => {
2095
2146
  Number.parseInt(parameters.h),
2096
2147
  0.3
2097
2148
  );
2098
- return [...pads, silkscreenRefText];
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];
2099
2167
  };
2100
2168
  var getCcwSot235Coords = (parameters) => {
2101
2169
  const { p, h, pn } = parameters;
@@ -2196,12 +2264,32 @@ var sot23_5 = (parameters) => {
2196
2264
  ],
2197
2265
  stroke_width: 0.05
2198
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
+ };
2199
2286
  return [
2200
2287
  ...pads,
2201
2288
  silkscreenRefText,
2202
2289
  silkscreenPath1,
2203
2290
  silkscreenPath2,
2204
- pin1Indicator
2291
+ pin1Indicator,
2292
+ courtyard
2205
2293
  ];
2206
2294
  };
2207
2295