include ; include ; include ; include ; wall = 1.2; box_d = [100, 47, 26]; e = 0.01; module box() { difference() { cube(box_d); translate([wall, wall, wall]) cube(box_d - [wall*2, wall*2, 0]); } } module holes() { space = 5.5; hd = (box_d[2]-wall*2)/2 - space; module hole() { rotate(90, [-1, 0, 0]) cylinder(wall*3, hd, hd); } for (i = [-2:2]) { x = (hd*2 + space)*i; translate([x, 0, 0]) hole(); } } module thermo() { ml = 9; // Main box. difference() { rbox(box_d, wall, 3); // Edge holes. translate([box_d[0]/2, box_d[1]-wall*2, box_d[2]/2]) holes(); // Bottom holes. translate([box_d[0]/2, box_d[1]-11, -wall]) rotate(90, [1, 0, 0]) holes(); } // Battery holder. translate([wall+ml, 1, 0]) battery_holder(cr18650_d); // Partition. translate([ml, 24, 0]) cube([box_d[0] - 10*2, wall, 15]); translate([40+wall, box_d[1] - 23, 0]) cube([wall, 23, 8]); translate([0, box_d[1]-wall*8, box_d[2]/2]) rotate(90, [0, -1, 0]) rotate(90, [0, 0, -1]) color("grey") linear_extrude(1) text("thr v2", size=8, valign="center", font = "Liberation Sans:style=Bold"); } module lid(box=box_d, wall=wall, cx=7, cy=3, rim=2) { dim = [box[0], box[1], wall]; tol = 0.2; module main() { rcube(dim); translate([wall+tol, wall+tol, 0]) rbox(dim - [2*(wall+tol), 2*(wall+tol), 0] + [0, 0, wall + rim], wall, 3); } module holes() { r = dim[0]/(cx*1.6); for (x = [1:cx]) { for (y = [1:cy]) { translate([x*dim[0]/(cx+1), y*dim[1]/(cy+1), -e]) cylinder(rim*2, r/2, r/2); } } } difference() { main(); holes(); } } $fn = 50; //thermo(); lid();