scad/2d/dice-tower/dice-tower-cover.scad

67 lines
1.8 KiB
OpenSCAD

// defined later in <box.scad>
inch = undef;
golden_ratio = undef;
inner_width = 2*inch;
inner_depth = inner_width * golden_ratio;
inner_height = inner_depth * golden_ratio;
clearance = 0.125*inch;
hole_diameter = 4.1;
include <../box/box.scad>;
//mode = "layout";
//mode = "assembly";
outer_width = inner_width + 1.05*2*thickness;
outer_depth = 1.5*inch;
outer_height = inner_height + thickness - 40 + clearance;
echo(str(outer_width/inch, " by ", outer_depth/inch, " by ", outer_height/inch, " inches"));
inc_front = false;
inc_bottom = false;
rx = (outer_depth - 2*thickness)/2 - (20+thickness/2)/sqrt(2) - thickness;
ry = -outer_height/2 - (20 + thickness/2) + thickness;
module left_side() {
difference() {
union() {
left_side_base();
hull() {
translate([-(outer_depth/2 - 15), -outer_height/2, 0]) circle(15);
translate([ (outer_depth/2 - 15), -outer_height/2, 0]) circle(15);
translate([-rx, ry, 0]) circle(10);
}
}
translate([-rx, ry, 0]) circle(hole_diameter/2, $fn=36);
}
}
module right_side() {
difference() {
union() {
right_side_base();
hull() {
translate([-(outer_depth/2 - 15), -outer_height/2, 0]) circle(15);
translate([ (outer_depth/2 - 15), -outer_height/2, 0]) circle(15);
translate([rx, ry, 0]) circle(10);
}
}
translate([rx, ry, 0]) circle(hole_diameter/2, $fn=36);
}
}
module part_assembly() {
translate([0, rx + (inner_depth - outer_depth)/2 + thickness, clearance + ry + (inner_height - outer_height)/2 + thickness]) {
rotate([-90*$t,0,0]) {
//%translate([50,0,0]) sphere(5);
translate([0,-rx,-ry]) {
std_part_assembly();
}
}
}
%rotate([0,0,180]) import("dice-tower-assembly.stl");
}
explode = 0;