From 81eb183db9890baddc3251b83c3309b781f3a5c8 Mon Sep 17 00:00:00 2001 From: Chris Palmer Date: Fri, 11 Sep 2020 12:24:07 +0100 Subject: [PATCH] Fixed PCB cutout for right angle pin headers. --- readme.md | 2 +- vitamins/pin_header.scad | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index c02b715..783e48f 100644 --- a/readme.md +++ b/readme.md @@ -2476,7 +2476,7 @@ Pin headers and sockets, etc. |:--- |:--- | | ```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 | -| ```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_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 | diff --git a/vitamins/pin_header.scad b/vitamins/pin_header.scad index e337a65..08d6902 100644 --- a/vitamins/pin_header.scad +++ b/vitamins/pin_header.scad @@ -50,8 +50,17 @@ module pin_header(type, cols = 1, rows = 1, smt = false, right_angle = false, cu ra_offset = 2.4; width = pitch * rows; - if(cutout) + module cutout() 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 { 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" : ""));