]> www.fi.muni.cz Git - things.git/blob - toothbrush-holder-9x3.scad
dual-led-strips second version
[things.git] / toothbrush-holder-9x3.scad
1 epsilon=0.01;
2 infty=400;
3
4 module cut_ellipse(height, dist, x) {
5         difference() {
6                 translate([0, dist, height/2-x])
7                         rotate([90, 0, 0])
8                         scale([0.6, 1, 1])
9                         cylinder(r=height/2, h=2);
10                 translate([0, 0, -infty/2])
11                         cube(infty, center=true);
12         };
13 };
14
15 module clip() {
16         translate([-1.5, 0, -1])
17                 cube([1.5, 8, 9]);
18         translate([0, 0, -1]) difference() {
19                 cube([3, 3, 9]);
20                 translate([3-epsilon, 3-epsilon, -epsilon])
21                         cylinder(r=3, h=9+2*epsilon);
22         };
23         translate([0, 0, -1])
24                 difference() {
25                         translate([-1, 8, 0])
26                                 cylinder(r=2, h=9);
27                         translate([-infty/2-1.5+epsilon, 0, 0])
28                                 cube(infty, center=true);
29                 };
30 };
31
32 module stem() {
33         hull() {
34                 cut_ellipse(25, 31, 4);
35                 cut_ellipse(10, 24, 6);
36         };
37
38         // left-side and right-side clip
39         difference() {
40                 union() {
41                         translate([3.75, 31-epsilon, 0])
42                                 rotate([0, 15, 0])
43                                         scale([-1, 1, 1])
44                                                 clip();
45
46                         translate([-3.75, 31-epsilon, 0])
47                                 rotate([0, -15, 0])
48                                         clip();
49                 };
50
51                 translate([0, 0, -infty/2])
52                         cube(infty, center=true);
53         };
54
55         for (dist=[0:9.5:19])
56                 translate([0, dist, 0])
57                         interdental_cylinder();
58 };
59
60 module stem_minus() {
61         for (dist=[0:9.5:19])
62                 translate([0, dist, 0])
63                         interdental_hole();
64 }
65
66 module body() {
67         difference() { union() {
68         for (angle=[-24:6:24]) {
69                 translate([0, -112, 0])
70                 rotate([0, 0, angle])
71                 translate([0, 130, 0])
72                 difference() {
73                         stem();
74                         stem_minus();
75                 }
76         };
77                         
78         translate([0, -112, 0]) difference() {
79                 union() {
80                         cylinder(r=126, h=11);
81                         translate([0, 0, 11-epsilon])
82                         scale([1, 1, 0.07])
83                         sphere(r=126);
84                         difference() {
85                                 union() {
86                                         difference() {
87                                         cylinder(r=159, h=11);
88                                         translate([0,0,-infty/2])
89                                                 cylinder(r=158, h=infty);
90                                         };
91                                 };
92                         
93                 rotate([0, 0, -24])
94                         translate([infty/2, 0, 0])
95                                 cube(infty, center=true);
96                 rotate([0, 0, 24])
97                         translate([-infty/2, 0, 0])
98                                 cube(infty, center=true);
99                         };
100                 };
101                 translate([0, 112-infty/2-epsilon, 0])
102                         cube(infty, center=true);
103 /*
104                 translate([0, 0, -infty/2-epsilon])
105                         cube(infty, center=true);
106                 rotate([0, 0, -28])
107                         translate([infty/2, 0, 0])
108                                 cube(infty, center=true);
109                 rotate([0, 0, 28])
110                         translate([-infty/2, 0, 0])
111                                 cube(infty, center=true);
112 */
113         };
114         // rear-side protrusion
115         translate([-50, 1, 6])
116                 rotate([0, 90, 0])
117                         cylinder(r=3, h=40, $fn=4);
118         // rear-side protrusion
119         translate([10, 1, 6])
120                 rotate([0, 90, 0])
121                         cylinder(r=3, h=40, $fn=4);
122         };
123         // screw head hole
124         rotate([-90, 0, 0])
125                 translate([0,-6,3])
126                 cylinder(r=3.5, h=55);
127         // screw head
128         rotate([-90, 0, 0])
129                 translate([0,-6,-infty/2])
130                 cylinder(r=1.75, h=infty, $fn=6);
131         };
132 };
133
134 module interdental_hole() {
135         translate([0, 0, -infty/2])
136                 cylinder(r=4, h=infty);
137 }
138
139 module interdental_cylinder() {
140         // translate([-5.5, -5.5, 0]) cube([11, 11, 8]);
141         difference() {
142                 cylinder(r=5.5, h=11);
143                 translate([-infty/2, 0, 19])
144                         rotate([0, 90, 0])
145                                 cylinder(r=9, h=infty);
146         }
147 /*
148         difference() {
149                 translate([0, -5.50, 3])
150                 rotate([-90, 0, 0])
151                         cylinder(r=5, h=11);
152                 translate([0, 0, -infty/2-epsilon])
153                         cube(infty, center=true);
154         };
155 */
156 };
157
158
159 /*
160 for (angle=[-45:18:45]) {
161         rotate([0, 0, angle])
162                 for (dist=[30:10:60])
163                         translate([dist, 0, 0])
164                                 difference() {
165                                         interdental_cylinder();
166                                         interdental_hole();
167                                 }
168 };
169
170
171 difference() {
172         body();
173
174         rotate([-90, 0, 0])
175                 translate([0,-4,3])
176                 cylinder(r=3, h=infty);
177         rotate([-90, 0, 0])
178                 translate([0,-4,-epsilon])
179                 cylinder(r=1.5, h=infty);
180 };
181 */
182
183 body($fn=128);
184 /* 
185 difference() {
186         stem();
187         stem_minus();
188 };
189 */