/* Copyright (C) 2015 Daniel Watson See the end of the file for license conditions. */ // challenge-bot // GNU AGPLv3 (or later at your option) // project available here: // https://challenge-bot.com/ // all measurements are in mm unless stated otherwise // metric version of deck: deck_length = 250; deck_width = deck_length; deck_depth = 5; deck_pitch = 10; deck_grid_hole = 3; deck_hole_type = "square"; deck_centered = true; /* // imperial version of deck deck_length = 203.2; // 8 inches deck_width = deck_length; deck_depth = 25.4 * 3 / 16; // 3 / 16 of an inch deck_pitch = 25.4; // 1 inch deck_grid_hole = 6.35 / 2; // 1/4 inch diameter, 1/8 inch radius deck_hole_type = "circle"; */ module deck_2d(width, length, pitch, hole, hole_type, center = false) { center_width_offset = center ? -(width / 2) : 0; center_length_offset = center ? -(length / 2) : 0; translate([center_width_offset, center_length_offset]) { difference() { square([width, length]); for (y = [0:floor(length / pitch) - 1], x = [0:floor(width / pitch) - 1]) { translate([pitch * (x + 0.5), pitch * (y + 0.5)]) { if (hole_type == "circle") { circle(hole, center = true); } else if (hole_type == "square") { square(hole, center = true); } else { echo(str("don't know the hole type: ", hole_type)); } } } } } } module deck(width, length, depth, pitch, hole, hole_type, center = false) { linear_extrude(height = depth) { deck_2d(width, length, pitch, hole, hole_type, center); } } /* This file is part of challenge-bot. Challenge-bot 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, either version 3 of the License, or (at your option) any later version. GNU Affero Emacs 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 challenge-bot. If not, see . */