summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--case/compact.scad26
-rw-r--r--case/top.scad39
2 files changed, 13 insertions, 52 deletions
diff --git a/case/compact.scad b/case/compact.scad
index 870d446..347cca1 100644
--- a/case/compact.scad
+++ b/case/compact.scad
@@ -1,24 +1,6 @@
$fn = 72;
-pcb_width = 257.175;
-pcb_length = 95.250;
-pcb_height = 1.600;
-
-pcb_screw_holes = [
- [ 4.7625, 85.7250],
- [ 66.6750, 85.7250],
- [161.9250, 85.7250],
- [238.1250, 85.7250],
- [ 61.9125, 47.6250],
- [138.1125, 47.6250],
- [214.3125, 47.6250],
- [ 20.2406, 9.5250],
- [123.8250, 9.5250],
- [238.1250, 9.5250]
-];
-
-switch_leg_length = 3.30;
-switch_height = 11.10;
+include <keyboard.scad>
module keyboard_base_plate(pcb_dimensions, pcb_screw_holes, switch_z_range) {
pcb_width = pcb_dimensions[0];
@@ -242,6 +224,6 @@ module keyboard_base_plate(pcb_dimensions, pcb_screw_holes, switch_z_range) {
ridges(thickness * 2, pcb_clearance_bottom / 2);
}
-keyboard_base_plate([pcb_width, pcb_length, pcb_height],
- pcb_screw_holes,
- [-switch_leg_length, switch_height]);
+keyboard_base_plate([keyboard_pcb_width, keyboard_pcb_length, keyboard_pcb_height],
+ keyboard_pcb_screw_holes,
+ [-keyboard_switch_leg_length, keyboard_switch_height]);
diff --git a/case/top.scad b/case/top.scad
index cac8696..337c4ca 100644
--- a/case/top.scad
+++ b/case/top.scad
@@ -1,5 +1,7 @@
$fn = 72;
+include <keyboard.scad>
+
/*
* Top screw holes are 15mm from top of case
* Side screws are 6.5mm from side of case
@@ -16,30 +18,6 @@ $fn = 72;
* First vertical ridge Y offset: 8mm
*/
-key_switch_height = 11.10;
-key_switch_sizes = [
- [0.5, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0],
- [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.5],
- [1.25, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.25],
- [1.75, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.75],
- [1.0, 1.25, 1.25, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]
-];
-
-pcb_height = 1.600;
-pcb_screw_holes = [
- [ 4.7625, 85.7250],
- [ 66.6750, 85.7250],
- [161.9250, 85.7250],
- [238.1250, 85.7250],
- [ 61.9125, 47.6250],
- [138.1125, 47.6250],
- [214.3125, 47.6250],
- [ 20.2406, 9.5250],
- [123.8250, 9.5250],
- [238.1250, 9.5250]
-];
-
-
module top_case(key_switch_sizes, pcb_screw_holes) {
case_width_top = 317.5000;
case_width_bottom = 320.0000;
@@ -166,19 +144,19 @@ module top_case(key_switch_sizes, pcb_screw_holes) {
module walls() {
/* Upper */
translate([-wall_width, keyboard_length, 0])
- cube([keyboard_width + 2 * wall_width, wall_width, key_switch_height], false);
+ cube([keyboard_width + 2 * wall_width, wall_width, keyboard_switch_height], false);
/* Right */
translate([keyboard_width, -wall_width, 0])
- cube([wall_width, keyboard_length + 2 * wall_width, key_switch_height], false);
+ cube([wall_width, keyboard_length + 2 * wall_width, keyboard_switch_height], false);
/* Lower */
translate([-wall_width, -wall_width, 0])
- cube([keyboard_width + 2 * wall_width, wall_width, key_switch_height], false);
+ cube([keyboard_width + 2 * wall_width, wall_width, keyboard_switch_height], false);
/* Left */
translate([-wall_width, -wall_width, 0])
- cube([wall_width, keyboard_length + 2 * wall_width, key_switch_height], false);
+ cube([wall_width, keyboard_length + 2 * wall_width, keyboard_switch_height], false);
}
module body() {
@@ -217,10 +195,11 @@ module top_case(key_switch_sizes, pcb_screw_holes) {
fin_gaps();
}
- keyboard_deck_z_offset = wall_height - wall_width - key_switch_height;
+ keyboard_deck_z_offset = wall_height - wall_width - keyboard_switch_height;
translate([keyboard_x_offset, keyboard_y_offset, keyboard_deck_z_offset])
keyboard_deck();
}
-top_case(key_switch_sizes, pcb_screw_holes);
+top_case(keyboard_switch_sizes,
+ keyboard_pcb_screw_holes);