]> www.fi.muni.cz Git - things.git/blob - fs-i6-knob.scad
switch holder.scad
[things.git] / fs-i6-knob.scad
1 infty = 100;
2 eps = 0.01;
3
4 pin_d = 6.6;
5 pin_d2 = 8.5;
6 pin_h = 10;
7
8 out_d = 11;
9 wall = 1;
10
11 slot_w = 0.6;
12 slot_h = pin_h;
13 slot_angle = 45;
14
15 difference() {
16         union() {
17                 cylinder(r = out_d/2, h = pin_h);
18                 for (angle = [0:15:360]) rotate([0, 0, angle])
19                         translate([out_d/2, 0, 0])
20                                 cylinder(r = 0.9, $fn = 3, h = pin_h);
21                 // +-90 degree protrusions
22                 for (angle = [90,270]) rotate([0, 0, angle])
23                         translate([out_d/2, 0, 0])
24                         rotate([0, 0, 45])
25                                 cylinder(r = 1.5, $fn = 4, h = pin_h);
26                 // center protrusion
27                 difference() {
28                         translate([out_d/2, 0, 0])
29                                 cylinder(r = 2.5, $fn = 3, h = pin_h);
30                         translate([0, 0, 2*pin_h/3 - wall/2])
31                                 cylinder(r = infty, h = wall);
32                         translate([0, 0, pin_h/3 - wall/2])
33                                 cylinder(r = infty, h = wall);
34                 }
35                 // bottom cylinder
36                 cylinder(r = out_d/2 + 0.9, h = wall, $fn = 360/15);
37                 // top cylinder
38                 translate([0, 0, pin_h - wall])
39                 cylinder(r = out_d/2 + 0.9, h = wall, $fn = 360/15);
40         }
41         difference() {
42                 translate([0, 0, -eps])
43                         cylinder(r = pin_d/2, h = infty, $fn = 32);
44                 rotate([0, 0, slot_angle])
45                 translate([-pin_d/2-eps, -slot_w/2, 0])
46                         cube([pin_d+2*eps, slot_w, slot_h-eps]);
47         }
48 }
49
50                 
51