]> www.fi.muni.cz Git - things.git/blob - towelbar-antislide.scad
switch holder.scad
[things.git] / towelbar-antislide.scad
1 infty=200;
2 eps=0.01;
3
4 bar_diam = 20;
5 body_h = 7;
6 body_l = 150;
7
8 wall = 1.5;
9
10 spike_w_bot = 1;
11 spike_w_top = 6;
12 spike_l = 5;
13
14 spike_count = 8;
15 spike_dist = body_l/(spike_count + 1);
16
17 module spike() {
18         hull() {
19                 translate([-spike_w_top/2, 0, body_h/2-eps])
20                         cube([spike_w_top, bar_diam/2+wall/2, eps]);
21                 translate([-spike_w_bot/2, 0, -body_h/2])
22                         cube([spike_w_bot, bar_diam/2 + wall + spike_l, eps]);
23         }
24 }
25
26 difference() {
27         union() {
28                 translate([-body_l/2, 0, 0])
29                         rotate([0, 90, 0])
30                                 cylinder(r = bar_diam/2 + wall, h = body_l);
31                 for (i = [-spike_count/2:1:spike_count/2])
32                         translate([i*spike_dist, 0, 0]) spike();
33         }
34                         
35         // tube hole
36         translate([-body_l/2-eps, 0, 0])
37                 rotate([0, 90, 0])
38                         cylinder(r = bar_diam/2, h = body_l + 2*eps);
39         // cut the bottom
40         translate([-infty/2, -infty/2, -infty-body_h/2]) cube(infty);
41         // cut the top
42         translate([-infty/2, -infty/2, body_h/2]) cube(infty);
43         // cut the rear half
44         translate([-infty/2, -infty, -infty/2]) cube(infty);
45 }