summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--case/case.scad66
1 files changed, 31 insertions, 35 deletions
diff --git a/case/case.scad b/case/case.scad
index c47900e..009ceb4 100644
--- a/case/case.scad
+++ b/case/case.scad
@@ -6,10 +6,11 @@ pcb_height = 95.250;
module keyboard_base_plate(pcb_width, pcb_height) {
pcb_clearance_edge = 1.0;
pcb_clearance_bottom = 2.0;
+
+ thickness = 1.0;
+ corner_radius = thickness / 2.0;
- corner_radius = 0.5;
-
- module corner(translation, rotation) {
+ module round_corner(translation, rotation) {
translate(translation)
rotate(rotation)
rotate_extrude(angle=90) {
@@ -20,7 +21,7 @@ module keyboard_base_plate(pcb_width, pcb_height) {
}
}
- module edge(length, translation, rotation) {
+ module round_edge(length, translation, rotation) {
translate(translation)
rotate(rotation)
linear_extrude(length)
@@ -31,52 +32,47 @@ module keyboard_base_plate(pcb_width, pcb_height) {
}
/* Lower left corner */
- corner([0 - pcb_clearance_edge,
- 0 - pcb_clearance_edge, 0], [-90, 90, 90]);
+ round_corner([0 - pcb_clearance_edge,
+ 0 - pcb_clearance_edge, 0], [-90, 90, 90]);
/* Upper left orner */
- corner([0 - pcb_clearance_edge,
- pcb_clearance_edge + pcb_height, 0], [0, 90, 90]);
+ round_corner([0 - pcb_clearance_edge,
+ pcb_clearance_edge + pcb_height, 0], [0, 90, 90]);
/* Upper right corner */
- corner([pcb_clearance_edge + pcb_width,
- pcb_clearance_edge + pcb_height, 0], [90, 90, 90]);
+ round_corner([pcb_clearance_edge + pcb_width,
+ pcb_clearance_edge + pcb_height, 0], [90, 90, 90]);
/* Lower right corner */
- corner([ pcb_clearance_edge + pcb_width,
- 0 - pcb_clearance_edge, 0], [180, 90, 90]);
+ round_corner([ pcb_clearance_edge + pcb_width,
+ 0 - pcb_clearance_edge, 0], [180, 90, 90]);
/* Top edge */
- edge(2 * pcb_clearance_edge + pcb_width,
- [0 - pcb_clearance_edge,
- pcb_clearance_edge + pcb_height, 0],
- [0, 90, 0]);
+ round_edge( 2 * pcb_clearance_edge + pcb_width,
+ [0 - pcb_clearance_edge,
+ pcb_clearance_edge + pcb_height, 0], [0, 90, 0]);
/* Right edge */
- edge(2 * pcb_clearance_edge + pcb_height,
- [ pcb_clearance_edge + pcb_width,
- 0 - pcb_clearance_edge, 0],
- [270, 0, 0]);
+ round_edge( 2 * pcb_clearance_edge + pcb_height,
+ [ pcb_clearance_edge + pcb_width,
+ 0 - pcb_clearance_edge, 0], [270, 0, 0]);
/* Bottom edge */
- edge(2 * pcb_clearance_edge + pcb_width,
- [0 - pcb_clearance_edge,
- 0 - pcb_clearance_edge,
- 0],
- [90, 180, 90]);
+ round_edge(2 * pcb_clearance_edge + pcb_width,
+ [0 - pcb_clearance_edge,
+ 0 - pcb_clearance_edge, 0], [90, 180, 90]);
/* Left edge */
- edge(2 * pcb_clearance_edge + pcb_width,
- [0 - pcb_clearance_edge,
- 0 - pcb_clearance_edge, 0],
- [270, 90, 0]);
+ round_edge( 2 * pcb_clearance_edge + pcb_height,
+ [0 - pcb_clearance_edge,
+ 0 - pcb_clearance_edge, 0], [270, 90, 0]);
- 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);
+ 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);
}
keyboard_base_plate(pcb_width, pcb_height);