Slowly but surely

This commit is contained in:
XANTRONIX 2023-11-26 00:55:14 -05:00
parent 3f65b9f62c
commit 402fbe32bd
4 changed files with 74 additions and 67 deletions

View file

@ -1,4 +1,4 @@
SCAD_MODELS = top-keyboard.scad top-outline.scad
SCAD_MODELS = top-keyboard.scad
SCAD_INCLUDE = params.scad
STL_MODELS = top-keyboard.stl

View file

@ -1,31 +0,0 @@
include <screws.scad>
$fn = 72;
translate([case_length_bottom, 0, 0])
rotate([0, 0, 90])
intersection() {
square([200, 200], false);
union() {
square([wall_width, case_length_bottom], false);
square([case_width_bottom, wall_width], false);
translate([case_width_bottom - wall_width, 0, 0])
square([wall_width, case_length_bottom], false);
translate([0, case_length_bottom - wall_width, 0])
square([case_width_bottom, wall_width], false);
for (screw_post = screw_posts_top_case) {
x = screw_post[0];
y = screw_post[1];
translate([x, y, 0])
difference() {
circle(d=screw_post_diameter_outer);
circle(d=screw_post_diameter_inner);
}
}
}
}

View file

@ -1,20 +0,0 @@
screw_post_lower_y_offset = (keyboard_y_offset - 2 * wall_width) / 2 + wall_width;
screw_post_middle_y_offset = screw_post_lower_y_offset + 65.00;
screw_post_upper_y_offset = screw_post_middle_y_offset + 65.00;
screw_post_x_offset = (keyboard_x_offset - 2 * wall_width) / 2 + wall_width;
screw_posts_top_case = [
/* Upper row */
[screw_post_x_offset, screw_post_upper_y_offset, screw_post_corner_height],
[case_width_bottom / 2, case_length_bottom - 10.0, screw_post_middle_height],
[case_width_bottom - screw_post_x_offset, screw_post_upper_y_offset, screw_post_corner_height],
/* Middle row */
[screw_post_x_offset, screw_post_middle_y_offset, screw_post_corner_height],
[case_width_bottom - screw_post_x_offset, screw_post_middle_y_offset, screw_post_corner_height],
/* Bottom row */
[screw_post_x_offset, screw_post_lower_y_offset, screw_post_corner_height],
[case_width_bottom / 2, screw_post_lower_y_offset, screw_post_corner_height],
[case_width_bottom - screw_post_x_offset, screw_post_lower_y_offset, screw_post_corner_height]
];

View file

@ -1,11 +1,12 @@
$fn = 72;
include <support.scad>
include <screws.scad>
include <keyboard.scad>
include <logo.scad>
module top_case(with_keyboard=false) {
module top_case(with_keyboard=false, as_flat=false) {
eps = 0.01;
accent_width = 1.0000;
accent_depth = 0.5;
accent_y_stride = (keyboard_pcb_length - accent_width) / 5.0;
@ -18,7 +19,26 @@ module top_case(with_keyboard=false) {
vent_x_first = keyboard_x_offset + keyboard_pcb_width - vent_count * 2*vent_width;
vent_y_offset = case_length_bottom - vent_length;
eps = 0.01;
screw_post_lower_y_offset = (keyboard_y_offset - 2 * wall_width) / 2 + wall_width;
screw_post_middle_y_offset = screw_post_lower_y_offset + 65.00;
screw_post_upper_y_offset = screw_post_middle_y_offset + 65.00;
screw_post_x_offset = (keyboard_x_offset - 2 * wall_width) / 2 + wall_width;
screw_posts_top_case = [
/* Upper row */
[screw_post_x_offset, screw_post_upper_y_offset, screw_post_corner_height],
[case_width_bottom / 2, case_length_bottom - 10.0, screw_post_middle_height],
[case_width_bottom - screw_post_x_offset, screw_post_upper_y_offset, screw_post_corner_height],
/* Middle row */
[screw_post_x_offset, screw_post_middle_y_offset, screw_post_corner_height],
[case_width_bottom - screw_post_x_offset, screw_post_middle_y_offset, screw_post_corner_height],
/* Bottom row */
[screw_post_x_offset, screw_post_lower_y_offset, screw_post_corner_height],
[case_width_bottom / 2, screw_post_lower_y_offset, screw_post_corner_height],
[case_width_bottom - screw_post_x_offset, screw_post_lower_y_offset, screw_post_corner_height]
];
module fascia() {
difference() {
@ -195,24 +215,62 @@ module top_case(with_keyboard=false) {
cube([wall_width, case_length_bottom, wall_height]);
}
difference() {
body();
accents();
vents();
badges();
module model() {
difference() {
body();
accents();
vents();
badges();
}
screw_posts();
if (with_keyboard) {
z_offset = wall_height - keyboard_switch_height;
keyboard_supports();
translate([keyboard_x_offset, keyboard_y_offset, z_offset])
keyboard_deck(wall_width);
} else {
supports();
}
}
screw_posts();
module flat() {
translate([case_length_bottom, 0, 0])
rotate([0, 0, 90])
intersection() {
square([200, 200], false);
union() {
square([wall_width, case_length_bottom], false);
square([case_width_bottom, wall_width], false);
if (with_keyboard) {
z_offset = wall_height - keyboard_switch_height;
translate([case_width_bottom - wall_width, 0, 0])
square([wall_width, case_length_bottom], false);
keyboard_supports();
translate([0, case_length_bottom - wall_width, 0])
square([case_width_bottom, wall_width], false);
translate([keyboard_x_offset, keyboard_y_offset, z_offset])
keyboard_deck(wall_width);
for (screw_post = screw_posts_top_case) {
x = screw_post[0];
y = screw_post[1];
translate([x, y, 0])
difference() {
circle(d=screw_post_diameter_outer);
circle(d=screw_post_diameter_inner);
}
}
}
}
}
if (as_flat) {
flat();
} else {
supports();
model();
}
}