-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathallen-bike-riser.scad
136 lines (129 loc) · 3.32 KB
/
allen-bike-riser.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
length = 42;
cradle_side_thickness = 4.8;
cradle_thickness = 33;
height = 52;
cradle_radius = 24;
strap_width = 25;
side_wall_height = 11;
tooth_size=5;
tooth_step_angle=21;
test_cradle=false;
$fn = 48;
difference() {
union() {
if (! test_cradle) {
strap_ring();
cube([
length,
cradle_thickness + 2 * cradle_side_thickness,
height],
true);
translate([0, 0, height / 4]) {
cube([
length + 2 * cradle_side_thickness,
cradle_thickness + 2 * cradle_side_thickness,
height/2],
true);
}
}
translate([
0,
0,
height / -2 + sqrt(cradle_radius * cradle_radius - (length * length / 4))
]) {
intersection() {
cube([
length,
cradle_thickness,
2 * cradle_radius],
true);
rotate([
90,
0,
0]) {
cylinder(
r = cradle_radius,
h = cradle_thickness + 2 * cradle_side_thickness,
center = true);
}
}
}
translate([
0,
0,
height / -2
+ sqrt(cradle_radius * cradle_radius - (length * length / 4))]) {
for(a = [-2 * tooth_step_angle : tooth_step_angle : 2 * tooth_step_angle]) {
rotate([0,a,0]) {
translate([0,0,-cradle_radius + 0.3]) {
rotate([0,45,0]) {
cube([tooth_size, cradle_thickness, tooth_size], true);
}
}
}
}
}
if (! test_cradle) {
translate([
0,
0,
0 - side_wall_height - cradle_radius
+ sqrt(cradle_radius * cradle_radius - (length * length / 4))]) {
difference() {
cube([
length,
cradle_thickness + 2 * cradle_side_thickness,
height],
true);
cube([
length + 0.1,
cradle_thickness,
height + 0.1],
true);
}
}
}
}
if (! test_cradle) {
translate([
0,
0,
height / 2 + cradle_radius
- sqrt(cradle_radius * cradle_radius - (length * length / 4))]) {
rotate([
90,
0,
0]) {
cylinder(
r = cradle_radius,
h = cradle_thickness + 2 * cradle_side_thickness + 0.1,
center = true);
}
}
}
}
module strap_ring() {
translate([0, 0, height / 2 - cradle_side_thickness]) {
difference() {
cube([
length + 6 * cradle_side_thickness,
cradle_thickness + 2 * cradle_side_thickness,
2 * cradle_side_thickness],
true);
translate([(length + 3 * cradle_side_thickness) / 2, 0, 0]) {
cube([
cradle_side_thickness,
strap_width,
2 * cradle_side_thickness + 0.1],
true);
}
translate([(length + 3 * cradle_side_thickness) / - 2, 0, 0]) {
cube([
cradle_side_thickness * 4,
strap_width + 2 * cradle_side_thickness,
2 * cradle_side_thickness + 0.1],
true);
}
}
}
}