From 5defa38e5b083cd0537a1954697257ea930eed79 Mon Sep 17 00:00:00 2001 From: Jesse McDonald Date: Thu, 18 Jan 2018 00:10:11 -0600 Subject: [PATCH] Add a matching cover/tray for the dice tower. --- .gitignore | 1 + 2d/box/box.scad | 6 ++- 2d/dice-tower/dice-tower-cover.scad | 67 +++++++++++++++++++++++++++++ 3 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 2d/dice-tower/dice-tower-cover.scad diff --git a/.gitignore b/.gitignore index ab482a5..395065f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ *.svg *.dxf +*.stl diff --git a/2d/box/box.scad b/2d/box/box.scad index dc6796b..2ab7489 100644 --- a/2d/box/box.scad +++ b/2d/box/box.scad @@ -180,7 +180,7 @@ module part_layout_wdh() { } module extra_layout() {} -module part_layout() { +module std_part_layout() { if (outer_width > outer_height) part_layout_wdh(); else @@ -188,13 +188,14 @@ module part_layout() { extra_layout(); } +module part_layout() { std_part_layout(); } module thicken() { linear_extrude(height=thickness, center=true, convexity=10) children(); } module extra_assembly() {} -module part_assembly() { +module std_part_assembly() { if (inc_left) color("red") translate([ -(outer_width/2 - thickness/2 + explode),0,0]) rotate([90,0,270]) thicken() left_side(); if (inc_front) color("green") translate([0, -(outer_depth/2 - thickness/2 + explode),0]) rotate([90,0,0]) thicken() front_side(); if (inc_right) color("blue") translate([ (outer_width/2 - thickness/2 + explode),0,0]) rotate([90,0,90]) thicken() right_side(); @@ -203,6 +204,7 @@ module part_assembly() { if (inc_bottom) color("magenta") translate([0,0,-(outer_height/2 - thickness/2 + explode)]) rotate([180,0,0]) thicken() bottom_side(); extra_assembly(); } +module part_assembly() { std_part_assembly(); } if (mode == "assembly") part_assembly(); diff --git a/2d/dice-tower/dice-tower-cover.scad b/2d/dice-tower/dice-tower-cover.scad new file mode 100644 index 0000000..158a9fb --- /dev/null +++ b/2d/dice-tower/dice-tower-cover.scad @@ -0,0 +1,67 @@ +// defined later in +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); + } +} + +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); + } +} + +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; \ No newline at end of file