My head hurts

This commit is contained in:
XANTRONIX 2023-11-15 17:56:39 -05:00
parent 4f5015ea13
commit 249c98bb23

View file

@ -33,6 +33,8 @@ module top_case(key_switch_sizes, pcb_screw_holes) {
keyboard_x_offset = 12.2500;
keyboard_y_offset = 12.2500;
keyboard_deck_z_offset = wall_height - wall_width - keyboard_switch_height;
accent_width = 1.0000;
accent_depth = 0.5;
accent_y_stride = (keyboard_length - accent_width) / 5.0;
@ -84,13 +86,14 @@ module top_case(key_switch_sizes, pcb_screw_holes) {
height = dimensions[1];
module right_triangle(base) {
length = sqrt((base ^ 2) / 2.0);
hypot = sqrt(2 * (base ^ 2 ));
intersection() {
rotate([0, 0, -45])
square([length*2, length*2], true);
difference() {
square([base, base], false);
square([length*2, length*2]);
translate([base, 0, 0])
rotate([0, 0, 45])
square([hypot, hypot], false);
}
}
@ -107,17 +110,16 @@ module top_case(key_switch_sizes, pcb_screw_holes) {
hypotenuse = sqrt(2*(aspect_length^2));
lower_x_offset = aspect_length - (hypotenuse - aspect_length);
right_triangle(aspect_length);
right_triangle(height);
translate([lower_x_offset, 0, 0])
square([1.5 * hypotenuse, aspect_lower_height]);
square([length, aspect_lower_height], false);
translate([3 * aspect_length, 0, 0])
mirror([1, 0, 0])
right_triangle(aspect_length);
right_triangle(height);
}
linear_extrude(width) shape();
translate([0, length, 0]) rotate([-90, 0, -90]) linear_extrude(width) shape();
}
module body() {
@ -137,6 +139,24 @@ module top_case(key_switch_sizes, pcb_screw_holes) {
/* Left */
cube([wall_width, case_length_bottom, wall_height - wall_width], false);
/* Upper vertical supports */
upper_support_length = case_length_bottom
- keyboard_length
- keyboard_y_offset
- 2 * wall_width;
upper_support_y_offset = keyboard_y_offset
+ keyboard_length
+ wall_width;
upper_support_x_offset = keyboard_x_offset - wall_width;
translate([upper_support_x_offset,
upper_support_y_offset,
wall_height - wall_width])
support([upper_support_length, keyboard_switch_height],
1.25);
}
module screw_holes() {
@ -234,11 +254,8 @@ module top_case(key_switch_sizes, pcb_screw_holes) {
vents();
}
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(keyboard_switch_sizes,
keyboard_pcb_screw_holes);
top_case(keyboard_switch_sizes, keyboard_pcb_screw_holes);