models/esp_case.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 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
$fn = $preview ? 12 : 180;
include <BOSL/constants.scad>
use <BOSL/threading.scad>
// 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);
}
|