/* tray.scad Copyright (C) 2019 Marcio Teixeira 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; either version 2 of the License, or (at your option) any later version. 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, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ base_plate_width = 113; base_plate_depth = 80; base_plate_thickness = 3; mounting_depth = 60.8; mounting_width = 94.08; module at_corners(width, depth, inset = 0) { for(x = [-width/2 + inset, width/2 - inset]) for(y = [-depth/2 + inset, depth/2 - inset]) translate([x,y]) children(); } module base_plate(corner_r = 5) { translate([0,0,-1]) linear_extrude(base_plate_thickness) difference() { hull() at_corners(base_plate_width, base_plate_depth,corner_r) circle(r=corner_r); at_corners(mounting_width, mounting_depth) circle(r=2); } } module component_cutout(width, depth, w_inset, d_inset) { gap = 1; linear_extrude(base_plate_thickness+1) square([width + gap, depth + gap], center = true); translate([0,0,-2]) linear_extrude(base_plate_thickness+1) square([width - w_inset, depth - d_inset], center = true); } difference() { base_plate(); translate([-29,-10,0]) component_cutout(29.2, 46.33, 4, 0); // SD reader translate([-4,-25,0]) component_cutout(15.5, 15, 1, 0); // LCD connector translate([16,-10,0]) component_cutout(18.1, 43.91, 2.3, 0); // Arduino translate([40,0,0]) component_cutout(22.96, 43.31, 1, 0); // RTC translate([0,27,0]) component_cutout(44.57, 14.12, 0, 1); // RS485 translate([16,-44,-2]) cylinder(r=10,h=5); }