-
Notifications
You must be signed in to change notification settings - Fork 0
/
brush-holder.scad
93 lines (80 loc) · 2.01 KB
/
brush-holder.scad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
// Copyright (C) 2023, Vishal Verma
// SPDX-License-Identifier: GPL-2.0-only
// Mount for the Philips One toothbrush (Sonicare)
// to mount to a mirror. Use suction tape such as:
// https://www.amazon.com/dp/B08DCWQJ9R
// on the flat side to attach to a smooth flat surface.
$fn=200;
in_d = 17;
ht = 85;
wall = 1.5;
curve_r = 1;
curve_ends = true;
flat_x = in_d + wall * 2;
flat_y = in_d / 2 + wall;
end_cap_ht = in_d / 2 + wall;
module torus(cs_r, r)
{
rotate_extrude()
translate([r + cs_r, 0, 0])
circle(cs_r);
}
module body()
{
difference() {
cylinder(d = in_d + 2 * wall, h = ht);
translate([0, 0, wall])
cylinder(d = in_d, h = ht);
}
translate([0, 0, ht])
torus(wall / 2, in_d / 2);
}
module flat_side()
{
difference() {
translate([-in_d / 2 - wall, 0, 0]) {
if (curve_ends == true) {
// cube with curved sides
hull() {
translate([curve_r, 0, 0])
cylinder(r = curve_r, h = ht);
translate([flat_x - curve_r, 0, 0])
cylinder(r = curve_r, h = ht);
translate([curve_r, flat_y - curve_r, 0])
cylinder(r = curve_r, h = ht);
translate([flat_x - curve_r, flat_y - curve_r, 0])
cylinder(r = curve_r, h = ht);
}
} else {
cube([flat_x, flat_y, ht]);
}
}
translate([0, 0, -1])
cylinder(d = in_d + 2 * wall, h = ht - (wall / 2) + 2);
}
}
module end_cap()
{
difference() {
cylinder(d = in_d + 2 * wall, h = end_cap_ht);
translate([0, 0, end_cap_ht])
sphere(d = in_d);
}
}
module drain()
{
translate([0, 0, -1])
cylinder(r = wall, h = wall + 2);
}
module main()
{
difference() {
union() {
body();
flat_side();
end_cap();
}
drain();
}
}
main();