@tscircuit/footprinter 0.0.320 → 0.0.321
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 +20 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -502,19 +502,37 @@ var passive = (params) => {
|
|
|
502
502
|
};
|
|
503
503
|
const textY = textbottom ? -ph / 2 - 0.9 : ph / 2 + 0.9;
|
|
504
504
|
const silkscreenRefText = silkscreenRef(0, textY, 0.2);
|
|
505
|
+
const excess = 0.25;
|
|
506
|
+
const silkXs = silkscreenLine.route.map((pt) => pt.x);
|
|
507
|
+
const silkYs = silkscreenLine.route.map((pt) => pt.y);
|
|
508
|
+
const crtMinX = Math.min(-(w ?? 0) / 2, -(p / 2 + pw / 2), ...silkXs) - excess;
|
|
509
|
+
const crtMaxX = Math.max((w ?? 0) / 2, p / 2 + pw / 2, ...silkXs) + excess;
|
|
510
|
+
const crtMinY = Math.min(-(h ?? 0) / 2, -ph / 2, ...silkYs) - excess;
|
|
511
|
+
const crtMaxY = Math.max((h ?? 0) / 2, ph / 2, ...silkYs) + excess;
|
|
512
|
+
const courtyard = {
|
|
513
|
+
type: "pcb_courtyard_rect",
|
|
514
|
+
pcb_courtyard_rect_id: "",
|
|
515
|
+
pcb_component_id: "",
|
|
516
|
+
center: { x: (crtMinX + crtMaxX) / 2, y: (crtMinY + crtMaxY) / 2 },
|
|
517
|
+
width: crtMaxX - crtMinX,
|
|
518
|
+
height: crtMaxY - crtMinY,
|
|
519
|
+
layer: "top"
|
|
520
|
+
};
|
|
505
521
|
if (tht) {
|
|
506
522
|
return [
|
|
507
523
|
platedhole(1, -p / 2, 0, pw, pw * 1 / 0.8),
|
|
508
524
|
platedhole(2, p / 2, 0, pw, pw * 1 / 0.8),
|
|
509
525
|
silkscreenLine,
|
|
510
|
-
silkscreenRefText
|
|
526
|
+
silkscreenRefText,
|
|
527
|
+
courtyard
|
|
511
528
|
];
|
|
512
529
|
}
|
|
513
530
|
return [
|
|
514
531
|
rectpad(["1", "left"], -p / 2, 0, pw, ph),
|
|
515
532
|
rectpad(["2", "right"], p / 2, 0, pw, ph),
|
|
516
533
|
silkscreenLine,
|
|
517
|
-
silkscreenRefText
|
|
534
|
+
silkscreenRefText,
|
|
535
|
+
courtyard
|
|
518
536
|
];
|
|
519
537
|
};
|
|
520
538
|
|