Fixed PCB cutout for right angle pin headers.

This commit is contained in:
Chris Palmer 2020-09-11 12:24:07 +01:00
parent c99ed98a64
commit 81eb183db9
2 changed files with 11 additions and 2 deletions

View File

@ -2476,7 +2476,7 @@ Pin headers and sockets, etc.
|:--- |:--- | |:--- |:--- |
| ```box_header(type, cols = 1, rows = 1, smt = false, cutout = false)``` | Draw box header | | ```box_header(type, cols = 1, rows = 1, smt = false, cutout = false)``` | Draw box header |
| ```idc_transition(type, cols = 5, skip = [], cutout = false)``` | Draw IDC transition header | | ```idc_transition(type, cols = 5, skip = [], cutout = false)``` | Draw IDC transition header |
| ```jst_xh_header(type, pin_count, right_angle=false, colour = false, pin_colour = false)``` | Draw JST XH connector | | ```jst_xh_header(type, pin_count, right_angle = false, colour = false, pin_colour = false)``` | Draw JST XH connector |
| ```pin(type, length = undef)``` | Draw a header pin | | ```pin(type, length = undef)``` | Draw a header pin |
| ```pin_header(type, cols = 1, rows = 1, smt = false, right_angle = false, cutout = false, colour)``` | Draw pin header | | ```pin_header(type, cols = 1, rows = 1, smt = false, right_angle = false, cutout = false, colour)``` | Draw pin header |
| ```pin_socket(type, cols = 1, rows = 1, right_angle = false, height = 0, smt = false, cutout = false, colour)``` | Draw pin socket | | ```pin_socket(type, cols = 1, rows = 1, right_angle = false, height = 0, smt = false, cutout = false, colour)``` | Draw pin socket |

View File

@ -50,8 +50,17 @@ module pin_header(type, cols = 1, rows = 1, smt = false, right_angle = false, cu
ra_offset = 2.4; ra_offset = 2.4;
width = pitch * rows; width = pitch * rows;
if(cutout) module cutout()
dogbone_rectangle([cols * pitch + 2 * panel_clearance, rows * pitch + 2 * panel_clearance, 100], center = false); dogbone_rectangle([cols * pitch + 2 * panel_clearance, rows * pitch + 2 * panel_clearance, 100], center = false);
if(cutout) {
if(right_angle)
translate_z(width / 2)
rotate([-90, 0, 180])
cutout();
else
cutout();
}
else { else {
vitamin(str("pin_header(", type[0], ", ", cols, ", ", rows, vitamin(str("pin_header(", type[0], ", ", cols, ", ", rows,
arg(smt, false, "smt"), arg(right_angle, false, "right_angle"), "): Pin header ", cols, " x ", rows, right_angle ? " right_angle" : "")); arg(smt, false, "smt"), arg(right_angle, false, "right_angle"), "): Pin header ", cols, " x ", rows, right_angle ? " right_angle" : ""));