summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--case/case.scad66
1 files changed, 52 insertions, 14 deletions
diff --git a/case/case.scad b/case/case.scad
index 6641c35..421b8a5 100644
--- a/case/case.scad
+++ b/case/case.scad
@@ -22,7 +22,7 @@ module keyboard_base_plate(pcb_width, pcb_height) {
}
}
- module round_edge(length, translation, rotation) {
+ module round_edge(translation, rotation, length) {
translate(translation)
rotate(rotation)
linear_extrude(length)
@@ -37,7 +37,17 @@ module keyboard_base_plate(pcb_width, pcb_height) {
linear_extrude(dimensions[2])
square([dimensions[0], dimensions[1]], false);
}
-
+
+ module wall_corner(translation, rotation, radius, length) {
+ translate(translation)
+ rotate(rotation)
+ linear_extrude(length)
+ intersection() {
+ circle(r=radius);
+ square([radius, radius], false);
+ }
+ }
+
/* Lower left corner */
round_corner([0 - pcb_clearance_edge,
0 - pcb_clearance_edge, 0], [-90, 90, 90]);
@@ -55,25 +65,53 @@ module keyboard_base_plate(pcb_width, pcb_height) {
0 - pcb_clearance_edge, 0], [180, 90, 90]);
/* Upper edge */
- round_edge( 2 * pcb_clearance_edge + pcb_width,
- [0 - pcb_clearance_edge,
- pcb_clearance_edge + pcb_height, 0], [0, 90, 0]);
+ round_edge([0 - pcb_clearance_edge,
+ pcb_clearance_edge + pcb_height, 0], [0, 90, 0],
+ 2 * pcb_clearance_edge + pcb_width);
/* Right edge */
- round_edge( 2 * pcb_clearance_edge + pcb_height,
- [ pcb_clearance_edge + pcb_width,
- 0 - pcb_clearance_edge, 0], [270, 0, 0]);
+ round_edge([ pcb_clearance_edge + pcb_width,
+ 0 - pcb_clearance_edge, 0], [270, 0, 0],
+ 2 * pcb_clearance_edge + pcb_height);
/* Lower edge */
- round_edge(2 * pcb_clearance_edge + pcb_width,
- [0 - pcb_clearance_edge,
- 0 - pcb_clearance_edge, 0], [90, 180, 90]);
+ round_edge([0 - pcb_clearance_edge,
+ 0 - pcb_clearance_edge, 0], [90, 180, 90],
+ 2 * pcb_clearance_edge + pcb_width);
/* Left edge */
- round_edge( 2 * pcb_clearance_edge + pcb_height,
- [0 - pcb_clearance_edge,
- 0 - pcb_clearance_edge, 0], [270, 90, 0]);
+ round_edge([0 - pcb_clearance_edge,
+ 0 - pcb_clearance_edge, 0], [270, 90, 0],
+ 2 * pcb_clearance_edge + pcb_height);
+ /* Upper right wall corner */
+ wall_corner([pcb_clearance_edge + pcb_width,
+ pcb_clearance_edge + pcb_height, 0],
+ [0, 0, 0],
+ corner_radius,
+ wall_height);
+
+ /* Lower right wall corner */
+ wall_corner([ pcb_clearance_edge + pcb_width,
+ 0 - pcb_clearance_edge, 0],
+ [0, 0, 270],
+ corner_radius,
+ wall_height);
+
+ /* Lower left wall corner */
+ wall_corner([0 - pcb_clearance_edge,
+ 0 - pcb_clearance_edge, 0],
+ [0, 0, 180],
+ corner_radius,
+ wall_height);
+
+ /* Upper left wall corner */
+ wall_corner([0 - pcb_clearance_edge,
+ pcb_clearance_edge + pcb_height, 0],
+ [0, 0, 90],
+ corner_radius,
+ wall_height);
+
/* Upper wall */
side([ 0 - pcb_clearance_edge,
pcb_height, 0],