xantronix-z32/case/case.scad

62 lines
1.4 KiB
OpenSCAD
Raw Normal View History

2023-11-11 14:21:39 -05:00
$fn = 72;
2023-11-11 04:28:53 -05:00
pcb_width = 257.175;
pcb_height = 95.250;
2023-11-11 14:21:39 -05:00
module keyboard_base_plate(pcb_width, pcb_height) {
pcb_clearance_edge = 1.0;
pcb_clearance_bottom = 2.0;
2023-11-11 14:21:39 -05:00
corner_radius = 0.5;
module corner(translation, rotation) {
translate(translation)
rotate(rotation)
rotate_extrude(angle=90) {
intersection() {
circle(r=corner_radius);
square(corner_radius*2);
}
}
}
2023-11-11 14:21:39 -05:00
module edge(length, translation, rotation) {
translate(translation)
rotate(rotation)
linear_extrude(length)
intersection() {
2023-11-11 04:28:53 -05:00
circle(r=corner_radius);
square(corner_radius*2);
}
}
2023-11-11 14:21:39 -05:00
/* Lower left rounded corner */
corner([0, 0, 0], [-90, 90, 90]);
/* Upper left rounded corner */
corner([0, pcb_height, 0], [0, 90, 90]);
/* Upper right rounded corner */
corner([pcb_width, pcb_height, 0], [90, 90, 90]);
/* Lower right rounded corner */
corner([pcb_width, 0, 0], [180, 90, 90]);
/* Top edge */
edge(pcb_width, [0, pcb_height, 0], [0, 90, 0]);
/* Right edge */
edge(pcb_height, [pcb_width, 0, 0], [270, 0, 0]);
/* Bottom edge */
edge(pcb_width, [0, 0, 0], [90, 180, 90]);
/* Left edge */
edge(pcb_height, [0, 0, 0], [270, 90, 0]);
linear_extrude(corner_radius*2);
square([pcb_width, pcb_height], false);
}
keyboard_base_plate(pcb_width, pcb_height);