]> www.fi.muni.cz Git - things.git/blob - terarium-glass-clip.scad
switch holder.scad
[things.git] / terarium-glass-clip.scad
1 eps = 0.01;
2 infty = 100;
3
4 // TODO: subtract 2*spring_w - something from these:
5 v_thick = 4 + 0.3; // thickness of the vertical glass
6 h_thick = 2 + 0.3; // thickness of the horizontal glass
7
8 o_wall = 2.5;
9 i_wall = 1.5;
10 body = 14;
11
12 spring_r = 4;
13 spring_w = 0.7;
14 spring_off = 2.5;
15
16 module spring() {
17         intersection() {
18                 translate([-eps, -infty/2, -infty/2])
19                         cube(infty);
20                 
21                 translate([-spring_r + spring_w, 0, 0])
22                         cylinder(r = spring_r, h = body, $fn = 24);
23         }
24 }
25
26 module body() {
27         difference() {
28                 cube([2*o_wall+i_wall+v_thick+h_thick, body, body]);
29                 // vertical glass
30                 translate([o_wall, body-o_wall-infty, -infty/2])
31                         cube([v_thick, infty, infty]);
32                 // horizontal glass
33                 translate([o_wall+v_thick+i_wall, -infty/2, body-o_wall-infty])
34                         cube([h_thick, infty, infty]);
35         }
36         translate([o_wall, spring_off, 0])
37                 rotate([0,0,0]) spring();
38         translate([o_wall+v_thick, spring_off, 0])
39                 rotate([0,0,180]) spring();
40         translate([o_wall+v_thick+i_wall, 0, spring_off])
41                 rotate([-90,0,0]) spring();
42         translate([o_wall+v_thick+i_wall+h_thick, 0, spring_off])
43                 rotate([-90,180,0]) spring();
44 }
45
46 translate([0, 0, body]) scale([-1,1,1]) rotate([180, 0, 0])
47         body();
48