From e831c3143124197abc377f18c4c7f3c1ca41805a Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Wed, 15 Nov 2023 19:10:38 -0500 Subject: Cheeky little refactor --- case/top.scad | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/case/top.scad b/case/top.scad index 9f95d75..faaa8ba 100644 --- a/case/top.scad +++ b/case/top.scad @@ -126,24 +126,7 @@ module top_case(key_switch_sizes, pcb_screw_holes) { } } - module body() { - translate([0, 0, wall_height - wall_width]) - fascia(); - - /* Upper */ - translate([0, case_length_bottom - wall_width, 0]) - cube([case_width_bottom, wall_width, wall_height - wall_width], false); - - /* Right */ - translate([case_width_bottom - wall_width, 0, 0]) - cube([wall_width, case_length_bottom, wall_height - wall_width], false); - - /* Lower */ - cube([case_width_bottom, wall_width, wall_height - wall_width], false); - - /* Left */ - cube([wall_width, case_length_bottom, wall_height - wall_width], false); - + module supports() { support_x_interval = (keyboard_width + 2 * wall_width - support_width) / 6; support_x_offset = keyboard_x_offset - wall_width; @@ -175,6 +158,25 @@ module top_case(key_switch_sizes, pcb_screw_holes) { } } + module body() { + translate([0, 0, wall_height - wall_width]) + fascia(); + + /* Upper */ + translate([0, case_length_bottom - wall_width, 0]) + cube([case_width_bottom, wall_width, wall_height - wall_width], false); + + /* Right */ + translate([case_width_bottom - wall_width, 0, 0]) + cube([wall_width, case_length_bottom, wall_height - wall_width], false); + + /* Lower */ + cube([case_width_bottom, wall_width, wall_height - wall_width], false); + + /* Left */ + cube([wall_width, case_length_bottom, wall_height - wall_width], false); + } + module screw_holes() { pcb_screw_diameter = 2.5; @@ -270,6 +272,8 @@ module top_case(key_switch_sizes, pcb_screw_holes) { vents(); } + supports(); + translate([keyboard_x_offset, keyboard_y_offset, keyboard_deck_z_offset]) keyboard_deck(); } -- cgit v1.2.3