]> www.fi.muni.cz Git - things.git/blob - rc-control-horn.scad
switch holder.scad
[things.git] / rc-control-horn.scad
1 eps = 0.01;
2 infty = 100;
3
4 wall = 1;
5
6 slot_off = 4;
7
8 slot_l = 10;
9 slot_depth = 2.5;
10 side_w = 4;
11
12 base_l = 4 + slot_l;
13
14 hole_h = 10;
15 hole_d = 1.5;
16 hole_step = 1.5*hole_d;
17 n_holes = 3;
18
19 hole_side = 1.5*wall;
20
21 module horn() {
22         difference() {
23         hull() {
24                 // base
25                 translate([slot_off, 0, 0])
26                         cube([base_l, wall, wall]);
27
28                         for (y = [1:n_holes]) {
29                                 translate([0, hole_h -(y-1)*hole_step, 0])
30                                         cylinder(r = hole_d/2 + hole_side,
31                                                 h = wall, $fn = 6);
32                         }
33                 }
34
35                 for (y = [1:n_holes]) {
36                         translate([0, hole_h -(y-1)*hole_step, -eps])
37                                 cylinder(r = hole_d/2, h = wall + 2*eps, $fn = 6);
38                 }
39         }
40
41
42         // side support
43         translate([slot_off, 0, 0])
44                 cube([base_l, wall, side_w]);
45
46         // slot
47         hull() {
48                 translate([slot_off + (base_l - slot_l)/2, -slot_depth/2, 0])
49                         cube([slot_l, slot_depth/2, wall]);
50                 translate([slot_off + (base_l - slot_l)/2 + wall, -slot_depth, 0])
51                         cube([slot_l - 2*wall, slot_depth/2+eps, wall]);
52         }
53 }
54
55 for (x = [-1, 1]) scale([x, 1, 1])
56         translate([hole_side + hole_d/2 + 2*wall, 0, 0]) horn();