Enclosure with standoffs

This commit is contained in:
2025-12-03 11:44:17 +01:00
parent ef94b6bb46
commit 496f0a9ba3
2 changed files with 100 additions and 6 deletions

View File

@@ -1,15 +1,42 @@
// FABULA open source storyteller enclosure // FABULA open source storyteller enclosure
// Global dimensions, change here
width = 120; width = 120;
height = 60; height = 60;
depth = 40; depth = 40;
screw_diameter = 3;
// Internal global variables
rounded_edge_diameter = height;
box_cut_height = 10;
standoff_diameter=screw_diameter*3;
// Screw standoff
module standoff() {
cylinder(h = depth, d = standoff_diameter, center = true);
}
// Screw hole, to be subtracted from standoff and box
module screw_hole() {
// Hole where the screw will thread into
cylinder(h = depth - 2, d = screw_diameter, center = true);
// Hole where the screw will pass with slack, without threading (in the lid)
translate([0, 0, depth/2 - box_cut_height/2]) {
cylinder(h = box_cut_height + 2, d = screw_diameter*1.5, center = true);
}
// Screw head bevel
bevel_depth = 1;
translate([0, 0, depth/2 - bevel_depth/2 + 0.1]) {
cylinder(h = bevel_depth, d2 = screw_diameter * 2.5, d1 = screw_diameter*1.5, center = true);
}
}
// Main body // Main body
module main_body() { module main_body() {
rounded_edge_diameter = height;
module half_body() { module half_body() {
cube([width - rounded_edge_diameter/2, height/2, depth]); cube([width - rounded_edge_diameter/2, height/2, depth]);
cylinder(h = depth, d = rounded_edge_diameter, $fn=64); cylinder(h = depth, d = rounded_edge_diameter, $fn=256);
} }
union() { union() {
@@ -26,9 +53,70 @@ module main_body() {
} }
} }
// Closed Box
module closed_box() {
// Hollow box
difference() {
union() {
difference() { difference() {
main_body(); main_body();
scale([0.9, 0.9, 0.9]) { scale([0.95, 0.95, 0.95]) {
main_body(); main_body();
} }
} }
// Screws standoffs near curved edges
translate([width/2 - rounded_edge_diameter/2, -height/2 + standoff_diameter/2, 0]) {
standoff();
}
translate([-width/2 + rounded_edge_diameter/2, height/2 - standoff_diameter/2, 0]) {
standoff();
}
// Screws standoff near sharp edges
translate([-width/2 + standoff_diameter/2, -height/2 + standoff_diameter/2, 0]) {
standoff();
}
translate([width/2 - standoff_diameter/2, height/2 - standoff_diameter/2, 0]) {
standoff();
}
}
// Screw holes near curved edges
translate([width/2 - rounded_edge_diameter/2, -height/2 + standoff_diameter/2, 0]) {
screw_hole();
}
translate([-width/2 + rounded_edge_diameter/2, height/2 - standoff_diameter/2, 0]) {
screw_hole();
}
// Screws holes near sharp edges
translate([-width/2 + standoff_diameter/2, -height/2 + standoff_diameter/2, 0]) {
screw_hole();
}
translate([width/2 - standoff_diameter/2, height/2 - standoff_diameter/2, 0]) {
screw_hole();
}
}
}
// Lower box
module box() {
difference() {
closed_box();
translate([0, 0, depth - box_cut_height]) {
cube([width*2, height*2, depth], true);
}
}
}
// Upper cap
module cap() {
// TODO: Flangia interna che non interferisca con gli standoff
difference() {
closed_box();
translate([0, 0, - box_cut_height]) {
cube([width*2, height*2, depth], true);
}
}
}
closed_box();

6
enclosure/main.scad Normal file
View File

@@ -0,0 +1,6 @@
use <fabula_enclosure.scad>
$fn=32;
translate([0, -50, 0]) box();
translate([0, 50, 0]) rotate([180, 0, 0]) cap();