Loads better!!!1

This commit is contained in:
XANTRONIX 2023-11-12 23:57:34 -05:00
parent 6aa3214273
commit de917273f3

View file

@ -6,11 +6,11 @@ pcb_length = 95.250;
module keyboard_base_plate(pcb_width, pcb_length) { module keyboard_base_plate(pcb_width, pcb_length) {
pcb_clearance_edge = 1.0; pcb_clearance_edge = 1.0;
pcb_clearance_bottom = 2.0; pcb_clearance_bottom = 2.0;
pcb_screw_hole_diameter = 1.5; pcb_screw_hole_diameter = 1.5;
thickness = 1.75; thickness = 1.75;
corner_radius = thickness / 4; corner_radius = 1.25;
case_color = [0.5, 0.5, 0.5, 1.0]; case_color = [0.5, 0.5, 0.5, 1.0];
@ -57,14 +57,14 @@ module keyboard_base_plate(pcb_width, pcb_length) {
square(corner_radius*2); square(corner_radius*2);
} }
} }
module side(translation, dimensions) { module side(translation, dimensions) {
color(case_color) color(case_color)
translate(translation) translate(translation)
linear_extrude(dimensions[2]) linear_extrude(dimensions[2])
square([dimensions[0], dimensions[1]], false); square([dimensions[0], dimensions[1]], false);
} }
module wall_corner(translation, rotation, radius, length) { module wall_corner(translation, rotation, radius, length) {
color(case_color) color(case_color)
translate(translation) translate(translation)
@ -75,7 +75,7 @@ module keyboard_base_plate(pcb_width, pcb_length) {
square([radius, radius], false); square([radius, radius], false);
} }
} }
module screw_post(translation, h, d1, d2) { module screw_post(translation, h, d1, d2) {
color(case_color) color(case_color)
translate(translation) translate(translation)
@ -84,23 +84,23 @@ module keyboard_base_plate(pcb_width, pcb_length) {
cylinder(h=h, r=d2/2.0); cylinder(h=h, r=d2/2.0);
} }
} }
module ridges(width, height) { module ridges(width, height) {
horizontal = [ horizontal = [
(bottom_length / 3), (bottom_length / 3),
(bottom_length / 3) * 2 (bottom_length / 3) * 2
]; ];
vertical = [ vertical = [
(bottom_width / 3), (bottom_width / 3),
(bottom_width / 3) * 2 (bottom_width / 3) * 2
]; ];
for (y = horizontal) { for (y = horizontal) {
side([0 - pcb_clearance_edge, y, 0], side([0 - pcb_clearance_edge, y, 0],
[bottom_width, width, height]); [bottom_width, width, height]);
} }
for (x = vertical) { for (x = vertical) {
side([x, 0 - pcb_clearance_edge, 0], side([x, 0 - pcb_clearance_edge, 0],
[width, bottom_length, height]); [width, bottom_length, height]);
@ -112,19 +112,19 @@ module keyboard_base_plate(pcb_width, pcb_length) {
pcb_clearance_edge + pcb_length, pcb_clearance_edge + pcb_length,
-thickness + corner_radius], -thickness + corner_radius],
[wall_width, thickness, wall_height + thickness - corner_radius]); [wall_width, thickness, wall_height + thickness - corner_radius]);
/* Right wall */ /* Right wall */
side([ pcb_clearance_edge + pcb_width, side([ pcb_clearance_edge + pcb_width,
-pcb_clearance_edge - thickness + corner_radius, -pcb_clearance_edge - thickness + corner_radius,
-thickness + corner_radius], -thickness + corner_radius],
[thickness, wall_length, wall_height + thickness - corner_radius]); [thickness, wall_length, wall_height + thickness - corner_radius]);
/* Lower wall */ /* Lower wall */
side([-pcb_clearance_edge - thickness + corner_radius, side([-pcb_clearance_edge - thickness + corner_radius,
-pcb_clearance_edge - thickness, -pcb_clearance_edge - thickness,
-thickness + corner_radius], -thickness + corner_radius],
[wall_width, thickness, wall_height + thickness - corner_radius]); [wall_width, thickness, wall_height + thickness - corner_radius]);
/* Left wall */ /* Left wall */
side([-pcb_clearance_edge - thickness, side([-pcb_clearance_edge - thickness,
-pcb_clearance_edge - thickness + corner_radius, -pcb_clearance_edge - thickness + corner_radius,
@ -138,7 +138,7 @@ module keyboard_base_plate(pcb_width, pcb_length) {
[0, 0, 0], [0, 0, 0],
corner_radius, corner_radius,
wall_height + thickness - corner_radius); wall_height + thickness - corner_radius);
/* Lower right wall corner */ /* Lower right wall corner */
wall_corner([ thickness + pcb_clearance_edge + pcb_width - corner_radius, wall_corner([ thickness + pcb_clearance_edge + pcb_width - corner_radius,
0 - thickness - pcb_clearance_edge + corner_radius, 0 - thickness - pcb_clearance_edge + corner_radius,
@ -154,7 +154,7 @@ module keyboard_base_plate(pcb_width, pcb_length) {
[0, 0, 180], [0, 0, 180],
corner_radius, corner_radius,
wall_height + thickness - corner_radius); wall_height + thickness - corner_radius);
/* Upper left wall corner */ /* Upper left wall corner */
wall_corner([-pcb_clearance_edge - thickness + corner_radius, wall_corner([-pcb_clearance_edge - thickness + corner_radius,
pcb_clearance_edge + pcb_length + thickness - corner_radius, pcb_clearance_edge + pcb_length + thickness - corner_radius,
@ -162,7 +162,7 @@ module keyboard_base_plate(pcb_width, pcb_length) {
[0, 0, 90], [0, 0, 90],
corner_radius, corner_radius,
wall_height + thickness - corner_radius); wall_height + thickness - corner_radius);
/* Bottom plate */ /* Bottom plate */
side([-pcb_clearance_edge - thickness + corner_radius, side([-pcb_clearance_edge - thickness + corner_radius,
-pcb_clearance_edge - thickness + corner_radius, -pcb_clearance_edge - thickness + corner_radius,
@ -170,34 +170,34 @@ module keyboard_base_plate(pcb_width, pcb_length) {
[bottom_width + 2 * thickness - 2 * corner_radius, [bottom_width + 2 * thickness - 2 * corner_radius,
bottom_length + 2 * thickness - 2 * corner_radius, bottom_length + 2 * thickness - 2 * corner_radius,
thickness]); thickness]);
/* Upper edge */ /* Upper edge */
round_edge([-pcb_clearance_edge - thickness + corner_radius, round_edge([-pcb_clearance_edge - thickness + corner_radius,
pcb_clearance_edge + thickness + pcb_length - corner_radius, pcb_clearance_edge + thickness + pcb_length - corner_radius,
-thickness + corner_radius], -thickness + corner_radius],
[0, 90, 0], [0, 90, 0],
bottom_width + thickness + 2 * corner_radius); wall_width);
/* Right edge */ /* Right edge */
round_edge([ pcb_clearance_edge + thickness + pcb_width - corner_radius, round_edge([ pcb_clearance_edge + thickness + pcb_width - corner_radius,
-pcb_clearance_edge - thickness + corner_radius, -pcb_clearance_edge - thickness + corner_radius,
-thickness + corner_radius], -thickness + corner_radius],
[270, 0, 0], [270, 0, 0],
bottom_length + thickness + 2 * corner_radius); wall_length);
/* Lower edge */ /* Lower edge */
round_edge([-pcb_clearance_edge - thickness + corner_radius, round_edge([-pcb_clearance_edge - thickness + corner_radius,
-pcb_clearance_edge - thickness + corner_radius, -pcb_clearance_edge - thickness + corner_radius,
-thickness + corner_radius], -thickness + corner_radius],
[90, 180, 90], [90, 180, 90],
bottom_width + thickness + 2 * corner_radius); wall_width);
/* Left edge */ /* Left edge */
round_edge([-pcb_clearance_edge - thickness + corner_radius, round_edge([-pcb_clearance_edge - thickness + corner_radius,
-pcb_clearance_edge - thickness + corner_radius, -pcb_clearance_edge - thickness + corner_radius,
-thickness + corner_radius], -thickness + corner_radius],
[270, 90, 0], [270, 90, 0],
bottom_length + thickness + 2 * corner_radius); wall_length);
/* Upper right corner */ /* Upper right corner */
round_corner([pcb_clearance_edge + thickness + pcb_width - corner_radius, round_corner([pcb_clearance_edge + thickness + pcb_width - corner_radius,
@ -230,7 +230,7 @@ module keyboard_base_plate(pcb_width, pcb_length) {
pcb_screw_hole_diameter * 2, pcb_screw_hole_diameter * 2,
pcb_screw_hole_diameter); pcb_screw_hole_diameter);
} }
/* Ridges (for rigidity!) */ /* Ridges (for rigidity!) */
ridges(thickness * 2, pcb_clearance_bottom / 2); ridges(thickness * 2, pcb_clearance_bottom / 2);
} }