diff --git a/side_table.scad b/side_table.scad new file mode 100644 index 0000000..e903cad --- /dev/null +++ b/side_table.scad @@ -0,0 +1,111 @@ +/* Copyright © 2020 tastytea + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +/* A side table. Units are supposed to be cm. + * You will need for this build: + * - 1 kind of lath + * - 1 kind of board + * - A saw (unless you have matching materials) + * - A drill + * - A screwdriver + * - A few screws + * - A rasp + * - A file (optional) + * - Sandpaper + */ + +include; + +$fs = 0.1; + +table_width = 40.0; /* x */ +table_depth = 30.0; /* y */ +table_height = 80.0; /* z */ +table_overhang = 2.0; /* Space between edge of table and leg. */ + +tabletop_height = 2.0; /* z */ + +leg_width = 4.0; /* x */ +leg_depth = 4.0; /* y */ +leg_height = table_height - tabletop_height; /* z */ + +module basic_side_table() +{ + echo("Leg height", leg_height); + + module legs() + { + for (x = [table_overhang, table_width - leg_width - table_overhang]) + { + for (y = [table_overhang, table_depth - leg_depth - table_overhang]) + { + translate([x, y, 0]) + { + cube( + [leg_width, leg_depth, table_height - tabletop_height]); + } + } + } + } + + module bracings() + { + z = leg_height - ceil(leg_height / 3); + echo("bracings start at height", z, "from bottom"); + echo("bracings start at height", leg_height - z - leg_depth, + "from leg top"); + + for (x = [table_overhang, table_width - table_overhang - leg_width]) + { + translate([x, table_overhang + leg_depth, z]) + { + cube([ + leg_width, + table_depth - (leg_depth * 2) - (table_overhang * 2), + leg_depth + ]); + } + } + } + + module top() + { + translate([0, 0, table_height - tabletop_height]) + { + roundedcube(size = [table_width, table_depth, tabletop_height], + radius = 0.3); + } + } + + color("Tan") + { + legs(); + } + + if ((table_height / leg_width) > 10) + { + color("SandyBrown") + { + bracings(); + } + } + + color("BurlyWood") + { + top(); + } +} + +basic_side_table();