/* Copyright © 2020 tastytea * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 3. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ /* A shelf with cubical drawers. Units are supposed to be cm. The drawers begin * 80cm above the ground. You will need 1 kind of lath, 1 kind of board, * handles, a saw and a few screws for this build. */ $fa = 1; $fs = 0.2; drawer_size = 20; /* Cube */ lath_width = 2.4; /* x */ lath_depth = 4.8; /* y */ board_height = 1.0; /* z */ module drawer() { /* Sides */ color("brown") { cube([board_height, drawer_size, drawer_size]); translate([drawer_size - board_height, 0, 0]) { cube([board_height, drawer_size, drawer_size]); } } /* Front & back */ color("darkred") { translate([board_height, 0, 0]) { cube([drawer_size - (board_height * 2), board_height, drawer_size]); } translate([board_height, drawer_size - board_height, 0]) { cube([drawer_size - (board_height * 2), board_height, drawer_size]); } } /* Bottom */ color([0.4, 0.2, 0.2]) { translate([board_height, board_height, 0]) { cube([ drawer_size - (board_height * 2), drawer_size - (board_height * 2), board_height ]); } } /* Handle */ translate([drawer_size / 2, 0, drawer_size / 2]) { color([0.4, 0.2, 0.2]) { rotate([90, 0, 0]) { cylinder(h = 0.5, d = 1.5); } translate([0, -1.5, 0]) { sphere(d = 3, false); } } } } module lath(length) { cube([lath_width, lath_depth, length]); } module shelf() { /* Posts */ color("olive") { for (x = [0, drawer_size + lath_width]) { for (y = [0, drawer_size - lath_depth]) { translate([x, y, 0]) { lath(80 + (drawer_size * 4) + (board_height * 5)); } } } } /* Cross laths */ color("darkgreen") { for (x = [0, drawer_size + lath_width]) { for (z = [drawer_size, 60, 150]) { translate([x, drawer_size - lath_depth, z]) { rotate([90, 0, 0]) { lath(drawer_size - lath_depth * 2); } } } } } /* Bottoms */ color([0.2, 0.4, 0.2]) { for (z = [ 80, 80 + drawer_size + board_height, 80 + (drawer_size * 2) + (board_height * 2), 80 + (drawer_size * 3) + (board_height * 3), 80 + (drawer_size * 4) + (board_height * 4) ]) translate([lath_width, 0, z]) { cube([drawer_size, drawer_size, board_height]); } } } shelf(); translate([lath_width, -10, 80 + board_height]) { drawer(); translate([0, 0, drawer_size + board_height]) { drawer(); } translate([0, 0, (drawer_size * 2) + (board_height * 2)]) { drawer(); } translate([0, 0, (drawer_size * 3) + (board_height * 3)]) { drawer(); } }