1 /* GNU AGPLv3 (or later at your option)
2 see bottom for more license info */
4 /* spin thing that erin likes */
15 weight_lip_overhang
= 0.3;
16 bearing_lip_overhang
= weight_lip_overhang
;
18 penny_thickness
= 1.52;
19 penny_radius
= 19.05 / 2;
21 _608zz_radius
= 22 / 2;
22 _608zz_inner_radius
= 8.1 / 2;
23 _608zz_cover_radius
= _608zz_radius
;
24 _608zz_cap_footprint_radius
= 12 / 2;
27 _625rs_radius
= 16 / 2;
28 _625rs_inner_radius
= 5 / 2;
30 _625rs_cover_radius
= _625rs_radius
;
31 _625rs_cap_footprint_radius
= _625rs_inner_radius
+ 1;
33 weight_radius
= (weight
== "penny") ? penny_radius
: _608zz_radius
;
34 weight_thickness
= (weight
== "penny") ?
35 penny_thickness
* 5 : _608zz_thickness
;
38 (bearing
== "608zz") ? _608zz_radius
39 : (bearing
== "625rs") ? _625rs_radius
41 bearing_window_radius
= bearing_radius
- bearing_lip_overhang
- 1;
42 bearing_inner_radius
=
43 (bearing
== "608zz") ? _608zz_inner_radius
44 : (bearing
== "625rs") ? _608zz_inner_radius
46 bearing_cover_radius
=
47 (bearing
== "608zz") ? _608zz_cover_radius
48 : (bearing
== "625rs") ? _625rs_cover_radius
50 bearing_cap_footprint_radius
=
51 (bearing
== "608zz") ? _608zz_cap_footprint_radius
52 : (bearing
== "625rs" ) ? _625rs_cap_footprint_radius
55 (bearing
== "608zz") ? _608zz_thickness
56 : (bearing
== "625rs") ? _625rs_thickness
59 spinner_height
= penny_thickness
* 5 + 2;
62 module
cap(bearing_inner_radius
,
63 bearing_cap_footprint_radius
,
66 bearing_window_radius
) {
67 footprint_height
= 4.5;
68 footprint_radius_safety
= 0.2;
70 bearing_thickness_safety
= 0.6;
71 finger_spot_height
= cap_height
/ 10;
75 cylinder(r1
= bearing_cover_radius
- tan(30) * cap_height
,
76 r2
= bearing_cover_radius
,
78 linear_extrude(height
= cap_height
81 circle(bearing_window_radius
- 1); }
82 linear_extrude(height
= cap_height
+ footprint_height
) {
83 circle(bearing_cap_footprint_radius
- footprint_radius_safety
); }
84 linear_extrude(height
= cap_height
86 + bearing_thickness
/ 2
87 - bearing_thickness_safety
) {
88 circle(bearing_inner_radius
); }
90 translate([0, 0, -0.01]) {
91 cylinder(r1
= bearing_inner_radius
,
92 r2
= bearing_inner_radius
- tan(30) * finger_spot_height
,
93 h
= finger_spot_height
); } } }
95 module
donut(height
, footprint_radius
) {
96 bread_radius
= height
/ 2;
98 translate([footprint_radius
, 0]) {
99 circle(bread_radius
); } } }
101 module
donut_hole(height
, footprint_radius
) {
103 cylinder(r
= footprint_radius
, h
= height
, center
= true);
104 donut(height
, footprint_radius
); } }
106 module
jelly_filled(height
, footprint_radius
) {
107 cylinder(r
= footprint_radius
, h
= height
, center
= true);
108 donut(height
, footprint_radius
); }
111 offset(r
= -r
) { offset(delta
= r
) { children(); } } }
113 module
mirrored(axis
) {
115 mirror(axis
) children(); }
117 module
spin_slice(weight_radius
,
122 joiner_radius
= (bearing_radius
+ weight_radius
) / 2;
125 // a = side along x axis
126 a
= bearing_radius
+ weight_radius
+ wall
;
127 // b = side from center to joiner
128 b
= bearing_radius
+ joiner_radius
+ round_extra
;
129 // c = side between joiner and arm center
130 c
= joiner_radius
+ weight_radius
+ round_extra
;
134 cos_C
= (pow(a
, 2) + pow(b
, 2) - pow(c
, 2)) / (2 * a
* b
);
135 sin_C
= sqrt(1 - pow(cos_C
, 2));
137 joiner_xy
= [cos_C
, sin_C
] * b
;
139 for(arm
= [0 : arms
- 1]) {
140 rotate(arm
* (360 / arms
)) {
143 translate(bearing_xy
) {
144 circle(bearing_radius
+ round_extra
); }
145 translate(weight_xy
) {
146 circle(weight_radius
+ round_extra
); }
148 polygon([bearing_xy
, weight_xy
, joiner_xy
]); } }
150 translate(joiner_xy
) {
151 circle(joiner_radius
); } } } } } }
153 module
spin_slices(weight_radius
,
157 weight_lip_overhang
= 0.3,
158 bearing_lip_overhang
= 0.3,
161 layer_height
= 0.15) {
162 thicker_thickness
= (bearing_thickness
> weight_thickness
) ?
163 bearing_thickness
: weight_thickness
;
164 calculated_height
= thicker_thickness
+ 2 * wall
;
165 layers
= 2 * ceil(ceil(calculated_height
/ layer_height
) / 2);
166 actual_height
= layers
* layer_height
;
167 round_radius
= actual_height
/ 2;
169 /* rounding the outside edge of the spinner with a semi-circle leads
170 to a shape that an overhang on the second layer several times the
171 thickness of a printed extrusion width.
173 rather than using a full semi-circle, this code aims to use just the
174 portion in the middle, where the overhang is less severe */
176 old_end
= (layers
/ 2) - 1;
178 /* add one to have some thickness all around weight holes
180 new_start
= old_end
/ 16 + 1;
183 old_range
= old_end
- old_start
;
184 new_range
= new_end
- new_start
;
186 factor
= new_range
/ old_range
;
188 /* initial adjacent is adjusted to (new start - 1) to allow some
189 thickness all around weight holes on first layer */
190 initial_adjacent
= round_radius
- ((new_start
- 1) * layer_height
);
191 initial_angle
= acos(initial_adjacent
/ round_radius
);
192 initial_round_extra
= initial_adjacent
* tan(initial_angle
);
195 mirrored([0, 0, 1]) {
196 for(layer
= [0 : (layers
/ 2) - 1]) {
197 translate([0, 0, layer
* layer_height
- actual_height
/ 2]) {
198 linear_extrude(height
= layer_height
) {
199 new_layer
= (layer
- old_start
) * factor
+ new_start
;
200 adjacent
= round_radius
- (new_layer
* layer_height
);
201 angle
= acos(adjacent
/ round_radius
);
202 round_extra
= adjacent
* tan(angle
) - initial_round_extra
;
203 spin_slice(weight_radius
,
208 cylinder(h
= actual_height
+ 0.1,
209 r
= bearing_radius
- bearing_lip_overhang
,
211 cylinder(h
= bearing_thickness
+ 0.05,
212 r
= bearing_radius
+ 0.15,
214 for(arm
= [0 : arms
- 1]) {
215 rotate(arm
* (360 / arms
)) {
216 translate([bearing_radius
+ wall
+ weight_radius
, 0]) {
217 cylinder(h
= actual_height
+ 0.1,
218 r
= weight_radius
- weight_lip_overhang
,
220 cylinder(h
= weight_thickness
+ 0.05,
221 r
= weight_radius
+ 0.15,
222 center
= true); } } } } }
224 module
spin_donut(weight_radius
,
229 bearing_lip_overhang
,
232 thicker_thickness
= (bearing_thickness
> weight_thickness
)
233 ? bearing_thickness
: weight_thickness
;
234 height
= thicker_thickness
+ wall
* 2;
236 center_to_arm_center
= bearing_radius
+ wall
+ weight_radius
;
238 jelly_filled(height
, bearing_radius
);
239 for(arm
= [0 : arms
]) {
240 rotate(arm
* (360 / arms
)) {
241 translate([center_to_arm_center
, 0, 0]) {
242 jelly_filled(height
, weight_radius
); } } } }
245 This file is part of 3d-printables.
247 3d-printables is free software: you can redistribute it and/or modify
248 it under the terms of the GNU Affero General Public License as published by
249 the Free Software Foundation, either version 3 of the License, or
250 (at your option) any later version.
252 3d-printables is distributed in the hope that it will be useful,
253 but WITHOUT ANY WARRANTY; without even the implied warranty of
254 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
255 GNU Affero General Public License for more details.
257 You should have received a copy of the GNU Affero General Public License
258 along with challenge-bot. If not, see <http://www.gnu.org/licenses/>.