2023-11-13 20:19:42 -05:00
|
|
|
$fn = 72;
|
|
|
|
|
2023-11-14 12:46:52 -05:00
|
|
|
module top_case() {
|
|
|
|
case_width_top = 317.5000;
|
|
|
|
case_width_bottom = 320.0000;
|
|
|
|
case_length_top = 150.0000;
|
|
|
|
case_length_bottom = 151.5000;
|
|
|
|
|
|
|
|
wall_width = 2.5000;
|
|
|
|
wall_height = 17.2500;
|
|
|
|
|
|
|
|
key_switch_width = 19.0500;
|
|
|
|
key_switch_length = 19.0500;
|
|
|
|
keyboard_width = key_switch_width * 13.5;
|
|
|
|
keyboard_length = key_switch_length * 5.0;
|
|
|
|
keyboard_x_offset = 12.2500;
|
|
|
|
keyboard_y_offset = 12.2500;
|
|
|
|
|
|
|
|
accent_width = 1.0000;
|
|
|
|
accent_depth = 0.5;
|
|
|
|
accent_y_stride = (keyboard_length - accent_width) / 5.0;
|
|
|
|
accent_y_bottom = keyboard_y_offset;
|
|
|
|
|
|
|
|
fin_width = 2.0000;
|
|
|
|
fin_gap_width = 2.0000;
|
|
|
|
fin_gap_length = 2.0000;
|
|
|
|
fin_gap_height = 12.0000;
|
|
|
|
fin_gap_count = 32;
|
|
|
|
fin_gap_x_first = keyboard_x_offset + keyboard_width - fin_gap_count * (fin_width + fin_gap_width);
|
|
|
|
fin_gap_y_offset = case_length_bottom - fin_gap_length;
|
|
|
|
|
|
|
|
module fascia() {
|
|
|
|
linear_extrude(wall_width)
|
|
|
|
difference() {
|
|
|
|
square([case_width_bottom, case_length_bottom], false);
|
|
|
|
translate([keyboard_x_offset, keyboard_y_offset, 0])
|
|
|
|
square([keyboard_width, keyboard_length], false);
|
|
|
|
}
|
2023-11-13 23:19:15 -05:00
|
|
|
}
|
2023-11-13 21:43:43 -05:00
|
|
|
|
2023-11-14 12:46:52 -05:00
|
|
|
module fin_gaps() {
|
|
|
|
for (i = [0:fin_gap_count]) {
|
|
|
|
x = fin_gap_x_first + (i * (fin_width + fin_gap_width));
|
2023-11-14 12:35:19 -05:00
|
|
|
|
2023-11-14 12:46:52 -05:00
|
|
|
translate([x, fin_gap_y_offset, wall_height - fin_gap_height])
|
|
|
|
cube([fin_gap_width, fin_gap_length, fin_gap_height], false);
|
|
|
|
}
|
|
|
|
}
|
2023-11-13 21:43:43 -05:00
|
|
|
|
2023-11-14 12:46:52 -05:00
|
|
|
module accents() {
|
|
|
|
for (y = [accent_y_bottom: accent_y_stride: case_length_bottom]) {
|
|
|
|
/* Top */
|
|
|
|
translate([0, y, wall_height - accent_depth])
|
|
|
|
cube([case_width_bottom, accent_width, accent_depth], false);
|
2023-11-14 12:35:19 -05:00
|
|
|
|
2023-11-14 12:46:52 -05:00
|
|
|
/* Right */
|
|
|
|
translate([case_width_bottom - accent_depth, y, 0])
|
|
|
|
cube([accent_depth, accent_width, wall_height], false);
|
2023-11-14 12:35:19 -05:00
|
|
|
|
2023-11-14 12:46:52 -05:00
|
|
|
/* Left */
|
|
|
|
translate([0, y, 0])
|
|
|
|
cube([accent_depth, accent_width, wall_height], false);
|
|
|
|
}
|
2023-11-14 00:01:47 -05:00
|
|
|
}
|
|
|
|
|
2023-11-14 12:46:52 -05:00
|
|
|
module body() {
|
|
|
|
translate([0, 0, wall_height - wall_width])
|
|
|
|
fascia();
|
2023-11-14 12:35:19 -05:00
|
|
|
|
2023-11-14 12:46:52 -05:00
|
|
|
/* Upper */
|
|
|
|
translate([0, case_length_bottom - wall_width, 0])
|
2023-11-14 16:15:35 -05:00
|
|
|
cube([case_width_bottom, wall_width, wall_height], false);
|
2023-11-14 12:35:19 -05:00
|
|
|
|
2023-11-14 12:46:52 -05:00
|
|
|
/* Right */
|
|
|
|
translate([case_width_bottom - wall_width, 0, 0])
|
|
|
|
cube([wall_width, case_length_bottom, wall_height], false);
|
2023-11-14 12:35:19 -05:00
|
|
|
|
2023-11-14 12:46:52 -05:00
|
|
|
/* Lower */
|
|
|
|
cube([case_width_bottom, wall_width, wall_height], false);
|
2023-11-14 12:35:19 -05:00
|
|
|
|
2023-11-14 12:46:52 -05:00
|
|
|
/* Left */
|
|
|
|
cube([wall_width, case_length_bottom, wall_height - wall_width], false);
|
|
|
|
}
|
2023-11-13 23:44:55 -05:00
|
|
|
|
2023-11-14 16:15:35 -05:00
|
|
|
module keyboard_deck() {
|
|
|
|
key_switch_footprint = [16.0, 16.0];
|
|
|
|
|
|
|
|
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]
|
|
|
|
];
|
|
|
|
|
|
|
|
function add(v) = [for(p=v) 1]*v;
|
|
|
|
function slice(v, x, y) = [for (i=[x:y]) v[i]];
|
|
|
|
function addrange(v, x, y) = add(slice(v, x, y));
|
|
|
|
|
|
|
|
module key_switch_plate(key_switch_size) {
|
|
|
|
plate_width = key_switch_width * key_switch_size;
|
|
|
|
plate_length = key_switch_length;
|
|
|
|
|
|
|
|
if (key_switch_size <= 0.5) {
|
|
|
|
cube([key_switch_width * key_switch_size,
|
|
|
|
key_switch_length,
|
|
|
|
wall_width], false);
|
|
|
|
} else {
|
|
|
|
hole_width = key_switch_footprint[0];
|
|
|
|
hole_length = key_switch_footprint[1];
|
|
|
|
|
|
|
|
hole_x = plate_width / 2 - hole_width / 2;
|
|
|
|
hole_y = plate_length / 2 - hole_length / 2;
|
|
|
|
|
|
|
|
linear_extrude(wall_width)
|
|
|
|
difference() {
|
|
|
|
square([plate_width, plate_length], false);
|
|
|
|
|
|
|
|
translate([hole_x, hole_y, 0])
|
|
|
|
square([hole_width, hole_length], false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
rows = len(key_switch_sizes);
|
|
|
|
|
|
|
|
for (i = [0: rows-1]) {
|
|
|
|
y = key_switch_length * (rows - 1 - i);
|
|
|
|
key_switch_row = key_switch_sizes[i];
|
|
|
|
cols = len(key_switch_row);
|
|
|
|
|
|
|
|
for (j = [0: cols-1]) {
|
|
|
|
x = key_switch_width * ((j == 0)? 0: addrange(key_switch_row, 0, j-1));
|
|
|
|
key_switch_size = key_switch_row[j];
|
|
|
|
|
|
|
|
translate([x, y, 0])
|
|
|
|
key_switch_plate(key_switch_size);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-11-14 12:46:52 -05:00
|
|
|
difference() {
|
|
|
|
body();
|
|
|
|
accents();
|
|
|
|
fin_gaps();
|
|
|
|
}
|
2023-11-14 12:35:19 -05:00
|
|
|
}
|
2023-11-14 12:46:52 -05:00
|
|
|
|
|
|
|
top_case();
|