simplify the frame and use roundedcube for it
This commit is contained in:
parent
6c04c1b2f2
commit
7faa28b4b1
@ -16,6 +16,8 @@
|
||||
* bullet-system-stick. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
include <roundedcube.scad>
|
||||
|
||||
/* QUASI-CONSTANTS */
|
||||
|
||||
// adjustments
|
||||
@ -150,7 +152,7 @@ module topplate() {
|
||||
|
||||
module frame_box() {
|
||||
difference() {
|
||||
cube([frame_x, frame_y, frame_z], center=true);
|
||||
roundedcube([frame_x, frame_y, frame_z], center=true, radius=3);
|
||||
cube([frame_x-26, frame_y-26, frame_z+5], center=true);
|
||||
}
|
||||
}
|
||||
@ -159,13 +161,6 @@ module frame_mount_column() {
|
||||
cube([20, 20, frame_z], center=true);
|
||||
}
|
||||
|
||||
module frame_panel_surround() {
|
||||
difference() {
|
||||
cube([frame_x, frame_y, top_plate_z], center=true);
|
||||
scale([1, 1, 2]) base_topplate();
|
||||
}
|
||||
}
|
||||
|
||||
module frame_side_chopper() {
|
||||
translate([frame_x/2, 0, 0]) cube([8, 2*(frame_y+top_plate_y), 2*(frame_z+top_plate_z)], center=true);
|
||||
}
|
||||
@ -188,8 +183,6 @@ module frame_cable_routing_hole() {
|
||||
|
||||
module base_frame() {
|
||||
frame_box();
|
||||
translate([0, 0, frame_z/2 + top_plate_z/2])
|
||||
frame_panel_surround();
|
||||
translate([(top_plate_x/2)-10, (top_plate_y/2)-10, 0])
|
||||
frame_mount_column();
|
||||
translate([-((top_plate_x/2)-10), (top_plate_y/2)-10, 0])
|
||||
@ -203,6 +196,7 @@ module base_frame() {
|
||||
module frame() {
|
||||
difference() {
|
||||
base_frame();
|
||||
translate([0, 0, frame_z/2]) scale([1, 1, 2]) base_topplate();
|
||||
translate([(top_plate_x/2)-10, (top_plate_y/2)-10, 0])
|
||||
frame_hex_bolt_hole();
|
||||
translate([-((top_plate_x/2)-10), (top_plate_y/2)-10, 0])
|
||||
|
55
src/roundedcube.scad
Normal file
55
src/roundedcube.scad
Normal file
@ -0,0 +1,55 @@
|
||||
// More information: https://danielupshaw.com/openscad-rounded-corners/
|
||||
|
||||
// Set to 0.01 for higher definition curves (renders slower)
|
||||
$fs = 0.15;
|
||||
|
||||
module roundedcube(size = [1, 1, 1], center = false, radius = 0.5, apply_to = "all") {
|
||||
// If single value, convert to [x, y, z] vector
|
||||
size = (size[0] == undef) ? [size, size, size] : size;
|
||||
|
||||
translate_min = radius;
|
||||
translate_xmax = size[0] - radius;
|
||||
translate_ymax = size[1] - radius;
|
||||
translate_zmax = size[2] - radius;
|
||||
|
||||
diameter = radius * 2;
|
||||
|
||||
obj_translate = (center == false) ?
|
||||
[0, 0, 0] : [
|
||||
-(size[0] / 2),
|
||||
-(size[1] / 2),
|
||||
-(size[2] / 2)
|
||||
];
|
||||
|
||||
translate(v = obj_translate) {
|
||||
hull() {
|
||||
for (translate_x = [translate_min, translate_xmax]) {
|
||||
x_at = (translate_x == translate_min) ? "min" : "max";
|
||||
for (translate_y = [translate_min, translate_ymax]) {
|
||||
y_at = (translate_y == translate_min) ? "min" : "max";
|
||||
for (translate_z = [translate_min, translate_zmax]) {
|
||||
z_at = (translate_z == translate_min) ? "min" : "max";
|
||||
|
||||
translate(v = [translate_x, translate_y, translate_z])
|
||||
if (
|
||||
(apply_to == "all") ||
|
||||
(apply_to == "xmin" && x_at == "min") || (apply_to == "xmax" && x_at == "max") ||
|
||||
(apply_to == "ymin" && y_at == "min") || (apply_to == "ymax" && y_at == "max") ||
|
||||
(apply_to == "zmin" && z_at == "min") || (apply_to == "zmax" && z_at == "max")
|
||||
) {
|
||||
sphere(r = radius);
|
||||
} else {
|
||||
rotate =
|
||||
(apply_to == "xmin" || apply_to == "xmax" || apply_to == "x") ? [0, 90, 0] : (
|
||||
(apply_to == "ymin" || apply_to == "ymax" || apply_to == "y") ? [90, 90, 0] :
|
||||
[0, 0, 0]
|
||||
);
|
||||
rotate(a = rotate)
|
||||
cylinder(h = diameter, r = radius, center = true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user