$fn = $preview ? 12 : 180; include use // https://www.thingiverse.com/thing:4246959/files by james_lan use <3m_bayonet.scad> // dimensions of the esp esp_w = 23; esp_d = 19+4; esp_h = 4; // horizontal spacing between the case and the esp esp_s = 3; // vertical spacing between the lid and the esp lid_s = 0.2; // vertical spacing between the case and the esp for cable management cable_s = 4; // wall thickness of the case wall_t = 2; // screw cylinder wall thickness screw_wall_t = 2; inner_screw_t = 5; screw_h = 16; screw_p = 1.5; //make sure that this is thicker then the diameter of a wall edge //assert(screw_wall_t > sqrt(2*pow(wall_t,2)), "screw wall too thin, screw may intersect with the interiour of the case"); module esp_space(offset) { cube([ esp_w + esp_s + offset*2, esp_d + esp_s + offset*2, esp_h + lid_s + cable_s + offset + 0.001 ]); } module case() { difference() { esp_space(wall_t); translate([wall_t,wall_t,wall_t + 0.001]) esp_space(0); translate([ -0.001, (esp_d + esp_s + wall_t*2)/2 - 5, wall_t + cable_s + esp_h - 3 ]) cube([ wall_t+0.002, 10, 3.5 ]); } } a = (sqrt(2)*(screw_wall_t*2 + inner_screw_t)*0.25)-wall_t; module threads(offset_x, offset_y){ translate([offset_x,offset_y,-screw_h/2+esp_h + lid_s + cable_s + wall_t + 0.01]) threaded_rod( d=inner_screw_t, l=screw_h, pitch=screw_p, left_handed=false, internal=true ); } module screw_cylinder(offset_x, offset_y) { translate([offset_x,offset_y,0]) cylinder( esp_h + lid_s + cable_s+wall_t, d = screw_wall_t*2 + inner_screw_t ); } module 3m_bayonet(lid, offset){ translate([ (esp_w + esp_s + wall_t*2)/2, (esp_d + esp_s + wall_t*2)/2, offset//-7.9 ]) 3m_attachment(); } difference() { union() { case(); screw_cylinder(-a, -a); //screw_cylinder(a+esp_w+esp_s+wall_t*2, -a); //screw_cylinder(-a, a+esp_d+esp_s+wall_t*2); screw_cylinder(a+esp_w+esp_s+wall_t*2, a+esp_d+esp_s+wall_t*2); } threads(-a, -a); //threads(a+esp_w+esp_s+wall_t*2, -a); //threads(-a, a+esp_d+esp_s+wall_t*2); threads(a+esp_w+esp_s+wall_t*2, a+esp_d+esp_s+wall_t*2); translate([ (esp_w + esp_s + wall_t*2)/2, (esp_d + esp_s + wall_t*2)/2, -0.001//-7.9 ]) cylinder( esp_h + lid_s + cable_s+wall_t, d = 26 ); } translate([0,0,5]) difference() { 3m_bayonet(0,-5); esp_space(wall_t); }