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