]> www.fi.muni.cz Git - things.git/blob - zachod-tlacitka.scad
switch holder.scad
[things.git] / zachod-tlacitka.scad
1 eps = 0.01;
2 infty = 200;
3
4 hole_d = 38.5;
5 hole_overhang = 50;
6 tube_d = 6.0 + 1.0;
7 hole_h = 12.5;
8 hole_split = 22;
9 wall = 2.0;
10
11 lock_w = 3;
12 lock_l = 1.2;
13
14 module body() {
15         cylinder(r = hole_overhang/2, h = wall, $fn = 128);
16         cylinder(r = hole_d/2, h = hole_h + 2*wall, $fn = 128);
17         for (x = [-1, 1]) translate([x*hole_split/2, 0, hole_h+2*wall-eps])
18                 cylinder(r1 = (hole_d-hole_split)/2, r2 = tube_d/2+wall, h = hole_h, $fn = 128);
19         for (angle = [0:120:360]) rotate([0, 0, 90+angle])
20                 translate([hole_d/2-wall, -lock_w/2, hole_h-wall]) hull() {
21                         cube([wall, lock_w, eps]);
22                         translate([0, 0, 2.5*wall])
23                                 cube([lock_l+wall, lock_w, wall/2]);
24                 }
25 }
26
27 difference() {
28         body();
29         for (x = [-1, 1]) translate([x*hole_split/2, 0, -eps])
30                 cylinder(r = tube_d/2, h = infty, $fn = 128);
31 }
32
33 tube_d_fest = 5.7;
34 pin_d1 = 12;
35 pin_d2 = 18;
36 pin_h = 15;
37
38 module pin() {
39         difference() {
40                 cylinder (r1 = pin_d2/2, r2 = pin_d1/2, h = pin_h, $fn = 128);
41                 translate([-tube_d_fest/2, -tube_d_fest/2, wall])
42                         cube([tube_d_fest, tube_d_fest, infty]);
43         }
44 }
45
46 for (y = [-1, 1]) translate([hole_overhang/2 + pin_d2/2 + wall, y*(pin_d2/2 + wall), 0])
47         pin();