Add case walls

This commit is contained in:
XANTRONIX 2023-11-11 18:12:21 -05:00
parent 16ab969f7a
commit f7ed749597

View file

@ -8,7 +8,7 @@ module keyboard_base_plate(pcb_width, pcb_height) {
pcb_clearance_bottom = 2.0;
thickness = 2.0;
height = 14.0;
wall_height = 14.0;
corner_radius = thickness / 2.0;
module round_corner(translation, rotation) {
@ -32,6 +32,12 @@ module keyboard_base_plate(pcb_width, pcb_height) {
}
}
module side(translation, dimensions) {
translate(translation)
linear_extrude(dimensions[2])
square([dimensions[0], dimensions[1]], false);
}
/* Lower left corner */
round_corner([0 - pcb_clearance_edge,
0 - pcb_clearance_edge, 0], [-90, 90, 90]);
@ -48,7 +54,7 @@ module keyboard_base_plate(pcb_width, pcb_height) {
round_corner([ pcb_clearance_edge + pcb_width,
0 - pcb_clearance_edge, 0], [180, 90, 90]);
/* Top edge */
/* Upper edge */
round_edge( 2 * pcb_clearance_edge + pcb_width,
[0 - pcb_clearance_edge,
pcb_clearance_edge + pcb_height, 0], [0, 90, 0]);
@ -58,7 +64,7 @@ module keyboard_base_plate(pcb_width, pcb_height) {
[ pcb_clearance_edge + pcb_width,
0 - pcb_clearance_edge, 0], [270, 0, 0]);
/* Bottom edge */
/* Lower edge */
round_edge(2 * pcb_clearance_edge + pcb_width,
[0 - pcb_clearance_edge,
0 - pcb_clearance_edge, 0], [90, 180, 90]);
@ -68,12 +74,32 @@ module keyboard_base_plate(pcb_width, pcb_height) {
[0 - pcb_clearance_edge,
0 - pcb_clearance_edge, 0], [270, 90, 0]);
linear_extrude(thickness)
translate([0 - pcb_clearance_edge,
0 - pcb_clearance_edge, 0])
square([2 * pcb_clearance_edge + pcb_width,
2 * pcb_clearance_edge + pcb_height],
false);
/* Upper wall */
side([ 0 - pcb_clearance_edge,
pcb_height, 0],
[thickness + pcb_width,
thickness,
wall_height]);
/* Right wall */
side([pcb_width, 0 - pcb_clearance_edge, 0],
[thickness, thickness + pcb_height, wall_height]);
/* Lower wall */
side([0 - pcb_clearance_edge, 0 - thickness, 0],
[thickness + pcb_width, thickness, wall_height]);
/* Left wall */
side([0 - thickness, 0 - pcb_clearance_edge, 0],
[thickness, thickness + pcb_height, wall_height]);
/* Bottom plate */
side([ 0 - pcb_clearance_edge,
0 - pcb_clearance_edge,
-thickness / 2],
[2 * pcb_clearance_edge + pcb_width,
2 * pcb_clearance_edge + pcb_height,
thickness]);
}
keyboard_base_plate(pcb_width, pcb_height);