@tscircuit/checks 0.0.179 → 0.0.181
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 +8 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -36,17 +36,17 @@ var getRotatedRectPoints = ({
|
|
|
36
36
|
});
|
|
37
37
|
};
|
|
38
38
|
var getPillCenterLineForPad = (pad) => {
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
);
|
|
44
|
-
const axis =
|
|
39
|
+
const width = pad.type === "pcb_plated_hole" ? pad.outer_width : pad.width;
|
|
40
|
+
const height = pad.type === "pcb_plated_hole" ? pad.outer_height : pad.height;
|
|
41
|
+
const radius = pad.type === "pcb_plated_hole" ? Math.min(width, height) / 2 : pad.radius;
|
|
42
|
+
const ccwRotation = pad.type === "pcb_plated_hole" ? pad.ccw_rotation : pad.shape === "rotated_pill" ? pad.ccw_rotation : 0;
|
|
43
|
+
const halfLineLength = Math.max(Math.max(width, height) / 2 - radius, 0);
|
|
44
|
+
const axis = width >= height ? { x: halfLineLength, y: 0 } : { x: 0, y: halfLineLength };
|
|
45
45
|
const rotatedAxis = rotatePoint(axis, ccwRotation);
|
|
46
46
|
return {
|
|
47
47
|
start: { x: pad.x - rotatedAxis.x, y: pad.y - rotatedAxis.y },
|
|
48
48
|
end: { x: pad.x + rotatedAxis.x, y: pad.y + rotatedAxis.y },
|
|
49
|
-
radius
|
|
49
|
+
radius
|
|
50
50
|
};
|
|
51
51
|
};
|
|
52
52
|
var getPolygonPointsForPad = (pad) => {
|
|
@@ -638,7 +638,7 @@ var getPadRadius = (pad) => {
|
|
|
638
638
|
return Math.min(bounds.maxX - bounds.minX, bounds.maxY - bounds.minY) / 2;
|
|
639
639
|
};
|
|
640
640
|
var isCircularPad = (pad) => pad.type === "pcb_via" || pad.shape === "circle";
|
|
641
|
-
var isPillPad = (pad) => pad.type === "pcb_smtpad" && (pad.shape === "pill" || pad.shape === "rotated_pill");
|
|
641
|
+
var isPillPad = (pad) => pad.type === "pcb_smtpad" && (pad.shape === "pill" || pad.shape === "rotated_pill") || pad.type === "pcb_plated_hole" && (pad.shape === "oval" || pad.shape === "pill");
|
|
642
642
|
var getCircleShape = (pad) => {
|
|
643
643
|
const center = getPadCenter(pad);
|
|
644
644
|
return {
|