]> www.fi.muni.cz Git - things.git/blob - din-quido-case.scad
DIN rail holder for Papouch Quido in metal case
[things.git] / din-quido-case.scad
1 infty = 300;
2 eps = 0.1;
3
4 wall = 3;
5 stem_wall = 4.5;
6
7 papouch_h = 126 + 0.7;
8 w = 20;
9
10 module din(height) {
11         assign(
12                 din_h = 35,
13                 din_thick = 2,
14                 din_clip = 4,
15                 din_bottom_d = 10,
16                 din_bottom_thick = 1.0,
17                 din_bottom_hole = 0.7
18         ) {
19                 // front part
20                 translate([-din_h/2 -wall, 0, 0])
21                         cube([din_h + 2*wall, wall, height]);
22                 // top plate
23                 translate([din_h/2, 0, 0]) 
24                         cube([wall, 2*wall + din_thick, height]);
25                 // behind the top plate
26                 translate([din_h/2 - din_clip, wall + din_thick, 0])
27                         cube([din_clip + wall, wall, height]);
28
29                 // bottom spring
30                 translate([-din_h/2 - din_bottom_d/2, din_bottom_d/2+wall-din_bottom_thick, 0])
31                 difference() {
32                         cylinder(r = din_bottom_d/2, h = height, $fn = 32);
33                         translate([0, 0, -eps])
34                                 cylinder(r = din_bottom_d/2 - din_bottom_thick,
35                                         h = height+2*eps, $fn = 16);
36                         translate([0, -din_bottom_d/2 + din_bottom_thick, -eps]) 
37                                 cube([din_bottom_d, din_bottom_hole, height + 2*eps]);
38                 };
39         };
40 };
41
42 module case_end(pcb_h, pcb_border, height) {
43         translate([-wall, 0, 0])
44                 cube([wall+pcb_border, wall, height]);
45         translate([-wall, wall-eps, 0])
46                 cube([wall, pcb_h+eps, height]);
47         intersection() {
48                 translate([-wall, wall+pcb_h, 0])
49                         cube([3*wall, 5, height]);
50                 translate([-2, wall+pcb_h + 4, 0])
51                         cylinder(r=5, h=height);
52         }
53 }
54 module papouch(len, height, clip) {
55         // back
56         translate([-len/2-wall, -stem_wall, 0])
57                 cube([len+2*wall, stem_wall+eps, height]);
58         for (x = [-1, 1]) scale([x, 1, 1]) {
59                 translate([-len/2, 0, 0])
60                         case_end(7.5 +0.7, 5, height);
61                 translate([-len/6, 0, 0])
62                         cube([wall, wall, height]);
63         }
64 };
65
66         
67 rotate([0, 0, 180]) din(w);
68 translate([0, stem_wall-wall, 0]) papouch(papouch_h, w, 5.5);
69
70