Try to do a proper job of this

This commit is contained in:
XANTRONIX 2023-11-11 14:21:39 -05:00
parent b46f3dd374
commit ec44dc2e6a

View file

@ -1,84 +1,61 @@
pcb_clearance_edge = 1.0; $fn = 72;
pcb_clearance_bottom = 2.0;
pcb_width = 257.175; pcb_width = 257.175;
pcb_height = 95.250; pcb_height = 95.250;
corner_radius = 0.5; module keyboard_base_plate(pcb_width, pcb_height) {
$fn = 72; pcb_clearance_edge = 1.0;
pcb_clearance_bottom = 2.0;
/* Lower left rounded corner */ corner_radius = 0.5;
rotate([-90, 90, 90])
rotate_extrude(angle = 90) { module corner(translation, rotation) {
intersection() { translate(translation)
circle(r=corner_radius); rotate(rotation)
square(corner_radius*2); rotate_extrude(angle=90) {
intersection() {
circle(r=corner_radius);
square(corner_radius*2);
}
} }
} }
/* Lower right rounded corner */ module edge(length, translation, rotation) {
translate([pcb_width, 0, 0]) translate(translation)
rotate([270, 0, 0]) rotate(rotation)
linear_extrude(pcb_height) linear_extrude(length)
intersection() {
circle(r=corner_radius);
square(corner_radius*2);
}
/* Upper left rounded corner */
translate([0, pcb_height, 0])
rotate([0, 90, 90])
rotate_extrude(angle = 90) {
intersection() {
circle(r=corner_radius);
square(corner_radius*2);
}
}
/* Upper right rounded corner */
translate([pcb_width, pcb_height, 0])
rotate([90, 90, 90])
rotate_extrude(angle = 90) {
intersection() { intersection() {
circle(r=corner_radius); circle(r=corner_radius);
square(corner_radius*2); square(corner_radius*2);
} }
} }
/* Left rounded edge */ /* Lower left rounded corner */
rotate([270, 90, 0]) corner([0, 0, 0], [-90, 90, 90]);
linear_extrude(pcb_height)
intersection() { /* Upper left rounded corner */
circle(r=corner_radius); corner([0, pcb_height, 0], [0, 90, 90]);
square(corner_radius*2);
} /* Upper right rounded corner */
corner([pcb_width, pcb_height, 0], [90, 90, 90]);
/* Bottom rounded edge */
rotate([90, 180, 90]) /* Lower right rounded corner */
linear_extrude(pcb_width) corner([pcb_width, 0, 0], [180, 90, 90]);
intersection() {
circle(r=corner_radius); /* Top edge */
square(corner_radius*2); edge(pcb_width, [0, pcb_height, 0], [0, 90, 0]);
}
/* Right edge */
/* Right rounded edge */ edge(pcb_height, [pcb_width, 0, 0], [270, 0, 0]);
translate([pcb_width, 0, 0])
rotate([180, 90, 90]) /* Bottom edge */
rotate_extrude(angle = 90) { edge(pcb_width, [0, 0, 0], [90, 180, 90]);
intersection() {
circle(r=corner_radius); /* Left edge */
square(corner_radius*2); edge(pcb_height, [0, 0, 0], [270, 90, 0]);
}
} linear_extrude(corner_radius*2);
square([pcb_width, pcb_height], false);
}
/* Top rounded edge */
translate([0, pcb_height, 0]) keyboard_base_plate(pcb_width, pcb_height);
rotate([0, 90, 0])
linear_extrude(pcb_width)
intersection() {
circle(r=corner_radius);
square(corner_radius*2);
}
square([pcb_width, pcb_height], false);