From 2581a453fedec43717c1be04a6b72098a1e0958c Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Sat, 11 Nov 2023 15:37:03 -0500 Subject: Account for PCB edge clearances --- case/case.scad | 55 ++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 38 insertions(+), 17 deletions(-) (limited to 'case') diff --git a/case/case.scad b/case/case.scad index db677a9..c47900e 100644 --- a/case/case.scad +++ b/case/case.scad @@ -30,32 +30,53 @@ module keyboard_base_plate(pcb_width, pcb_height) { } } - /* Lower left rounded corner */ - corner([0, 0, 0], [-90, 90, 90]); + /* Lower left corner */ + corner([0 - pcb_clearance_edge, + 0 - pcb_clearance_edge, 0], [-90, 90, 90]); - /* Upper left rounded corner */ - corner([0, pcb_height, 0], [0, 90, 90]); + /* Upper left orner */ + corner([0 - pcb_clearance_edge, + pcb_clearance_edge + pcb_height, 0], [0, 90, 90]); - /* Upper right rounded corner */ - corner([pcb_width, pcb_height, 0], [90, 90, 90]); + /* Upper right corner */ + corner([pcb_clearance_edge + pcb_width, + pcb_clearance_edge + pcb_height, 0], [90, 90, 90]); - /* Lower right rounded corner */ - corner([pcb_width, 0, 0], [180, 90, 90]); + /* Lower right corner */ + corner([ pcb_clearance_edge + pcb_width, + 0 - pcb_clearance_edge, 0], [180, 90, 90]); /* Top edge */ - edge(pcb_width, [0, pcb_height, 0], [0, 90, 0]); - + edge(2 * pcb_clearance_edge + pcb_width, + [0 - pcb_clearance_edge, + pcb_clearance_edge + pcb_height, 0], + [0, 90, 0]); + /* Right edge */ - edge(pcb_height, [pcb_width, 0, 0], [270, 0, 0]); - + edge(2 * pcb_clearance_edge + pcb_height, + [ pcb_clearance_edge + pcb_width, + 0 - pcb_clearance_edge, 0], + [270, 0, 0]); + /* Bottom edge */ - edge(pcb_width, [0, 0, 0], [90, 180, 90]); - + edge(2 * pcb_clearance_edge + pcb_width, + [0 - pcb_clearance_edge, + 0 - pcb_clearance_edge, + 0], + [90, 180, 90]); + /* Left edge */ - edge(pcb_height, [0, 0, 0], [270, 90, 0]); + edge(2 * pcb_clearance_edge + pcb_width, + [0 - pcb_clearance_edge, + 0 - pcb_clearance_edge, 0], + [270, 90, 0]); - linear_extrude(corner_radius*2); - square([pcb_width, pcb_height], false); + linear_extrude(corner_radius*2) + translate([0 - pcb_clearance_edge, + 0 - pcb_clearance_edge, 0]) + square([2 * pcb_clearance_edge + pcb_width, + 2 * pcb_clearance_edge + pcb_height], + false); } keyboard_base_plate(pcb_width, pcb_height); -- cgit v1.2.3