models/esp_lid.scad (view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
$fn = $preview ? 18 : 360;
include <BOSL/constants.scad>
use <BOSL/threading.scad>
// dimensions of the esp
esp_w = 23;
esp_d = 19+4;
lid_h = 0.75
;
// horizontal spacing between the case and the esp
esp_s = 3;
// wall thickness of the case
wall_t = 2;
// screw alignment wall thickness
screw_wall_t = 2;
inner_screw_t = 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 case() {
module esp_space(offset) {
cube([
esp_w + esp_s + offset*2,
esp_d + esp_s + offset*2,
lid_h + offset + 0.001
]);
}
esp_space(wall_t);
}
a = (sqrt(2)*(screw_wall_t*2 + inner_screw_t)*0.25)-wall_t;
module screw_cylinder(d, h_diff, offset_x, offset_y) {
translate([offset_x,offset_y,-h_diff/2])
cylinder(
lid_h + wall_t+h_diff,
d = d
);
}
difference() {
union() {
case();
screw_cylinder(screw_wall_t*2 + inner_screw_t, 0, -a, -a);
//screw_cylinder(screw_wall_t*2 + inner_screw_t, 0, a+esp_w+esp_s+wall_t*2, -a);
//screw_cylinder(screw_wall_t*2 + inner_screw_t, 0, -a, a+esp_d+esp_s+wall_t*2);
screw_cylinder(screw_wall_t*2 + inner_screw_t, 0, a+esp_w+esp_s+wall_t*2, a+esp_d+esp_s+wall_t*2);
}
screw_cylinder(inner_screw_t, 0.01, -a, -a);
//screw_cylinder(inner_screw_t, 0.01, a+esp_w+esp_s+wall_t*2, -a);
//screw_cylinder(inner_screw_t, 0.01, -a, a+esp_d+esp_s+wall_t*2);
screw_cylinder(inner_screw_t, 0.01, a+esp_w+esp_s+wall_t*2, a+esp_d+esp_s+wall_t*2);
}
|