]> www.fi.muni.cz Git - things.git/blob - toothbrush-holder-9x2.scad
screw+ziptie holder
[things.git] / toothbrush-holder-9x2.scad
1 eps=0.01;
2 infty=400;
3
4 off_center = 112;
5 ext_angle = 56;
6
7 main_depth = 42;
8
9 module off_c() {
10         translate([0, -off_center, 0])
11                 children();
12 };
13
14 module off_c_rot(angle) {
15         off_c()
16         rotate([0, 0, angle])
17         translate([0, off_center, 0])
18                 children();
19 }
20
21 module interdental_hole() {
22         translate([0, 0, -infty/2])
23                 cylinder(r=4.1, h=infty);
24         translate([0, 0, 20])
25         scale ([2, 1, 1]) sphere(10, center=true);
26 }
27
28 module toothbrush_hole() {
29         difference() {
30                 union() {
31                         translate([0, 0, 2])
32                                 cylinder(r1=4, r2=8, h = 13);
33                         translate([0, 0, -1])
34                                 cylinder(r=4, h = 3+eps);
35                 };
36                 translate([-infty/2, -4.5-infty, -infty/2])
37                         cube(infty);
38         }
39         translate([-3, 0, -infty/2]) cube([6, infty, infty]);
40 }
41
42 module body() {
43         intersection() {
44                 off_c() rotate([0, 0, 0]) {
45                         cylinder(r = main_depth + off_center, h = 12, $fn = 60);
46                         //translate([0, 0, 12-eps])
47                         //      cylinder(r1 = 150, r2 = 0,h = 10, $fn = 60);
48                 };
49                 translate([-infty/2, 0, -infty/2]) cube(infty);
50                 off_c_rot(ext_angle/2) translate([0, -infty/2, -infty/2]) cube(infty);
51                 off_c_rot(-ext_angle/2) translate([0, -infty/2, -infty/2])
52                         scale([-1, 1, 1]) cube(infty);
53         };
54         // rear-side protrusion
55         translate([-50, 1, 6])
56                 rotate([0, 90, 0])
57                         cylinder(r=3, h=40, $fn=4);
58         // rear-side protrusion
59         translate([10, 1, 6])
60                 rotate([0, 90, 0])
61                         cylinder(r=3, h=40, $fn=4);
62         // off_c() cube(1, center=true);
63 };
64
65 module body_neg() {
66         // screw head hole
67         rotate([-90, 0, 0])
68                 translate([0,-6,5])
69                 cylinder(r=3.5, h=infty);
70         // screw head
71         rotate([-90, 0, 0])
72                 translate([0,-6,-infty/2])
73                 cylinder(r=1.75, h=infty, $fn=6);
74
75         for (angle = [-24:6:24]) {
76                 off_c_rot(angle)
77                         translate([0, 38, 0])
78                                 render() toothbrush_hole();
79                 for (dist = [17,27])
80                         off_c_rot(angle)
81                         translate([0, dist, 0])
82                                 interdental_hole();
83         }
84 }
85
86 difference() {
87         body();
88         body_neg();
89 }
90