1 /* GNU AGPLv3 (or later at your option)
2 see bottom for more license info */
4 /* spin thing that erin likes */
12 weight_lip_overhang
= 0.3;
13 bearing_lip_overhang
= weight_lip_overhang
;
14 // TODO: switch wall_thickness -> wall
17 penny_thickness
= 1.52;
18 penny_radius
= 19.05 / 2;
20 _608zz_radius
= 22 / 2;
21 _608zz_inner_radius
= 8.1 / 2;
22 _608zz_cover_radius
= 19.4 / 2;
23 _608zz_cap_footprint_radius
= 12 / 2;
26 weight_radius
= (weight
== "penny") ? penny_radius
: _608zz_radius
;
27 weight_thickness
= (weight
== "penny") ?
28 penny_thickness
* 5 : _608zz_thickness
;
30 bearing_radius
= (bearing
== "608zz") ? _608zz_radius
: 1/0;
31 bearing_inner_radius
= (bearing
== "608zz") ? _608zz_inner_radius
: 1/0;
32 bearing_cover_radius
= (bearing
== "608zz")
33 ? _608zz_cover_radius
+ wall
35 bearing_cap_footprint_radius
=
36 (bearing
== "608zz") ? _608zz_cap_footprint_radius
: 1/0;
37 bearing_thickness
= (bearing
== "608zz") ? _608zz_thickness
: 1/0;
39 spinner_height
= penny_thickness
* 5 + 2;
42 module
cap(bearing_inner_radius
,
43 bearing_cap_footprint_radius
,
46 footprint_height
= 1.6;
47 footprint_radius_safety
= 0.25;
49 bearing_cover_radius_safety
= 0.75;
50 bearing_thickness_safety
= 0.2;
54 cylinder(r1
= bearing_cover_radius
- tan(30) * cap_height
,
55 r2
= bearing_cover_radius
,
57 linear_extrude(height
= cap_height
+ footprint_height
) {
58 circle(bearing_cap_footprint_radius
- footprint_radius_safety
); }
59 linear_extrude(height
= cap_height
61 + bearing_thickness
/ 2
62 - bearing_thickness_safety
) {
63 circle(bearing_inner_radius
); } }
64 translate([0, 0, -0.01]) {
65 cylinder(r1
= bearing_inner_radius
+ tan(30) * (cap_height
- 1),
66 r2
= bearing_inner_radius
,
67 h
= cap_height
- 1); } } }
69 module
ring(outer_radius
, inner_radius
) {
72 circle(inner_radius
); } }
75 offset(r
= -r
) { offset(delta
= r
) { children(); } } }
77 module
spin_footprint(weight_radius
,
82 thinner_radius
= (bearing_radius
< weight_radius
)?
83 bearing_radius
: weight_radius
;
84 fillet(thinner_radius
) {
85 for(arm
= [0 : arms
- 1]) {
87 circle(bearing_radius
+ round_extra
);
88 rotate( (arm
/ arms
) * 360 ) {
89 translate([bearing_radius
+ wall
+ weight_radius
, 0]) {
90 circle(weight_radius
+ round_extra
); } } } } } }
92 module
mirrored(axis
) {
94 mirror(axis
) children(); }
96 module
spin(weight_radius
,
100 weight_lip_overhang
= 0.3,
101 bearing_lip_overhang
= 0.3,
105 thicker_thickness
= (bearing_thickness
> weight_thickness
) ?
106 bearing_thickness
: weight_thickness
;
107 calculated_height
= thicker_thickness
+ 2 * wall
;
108 layers
= 2 * ceil(ceil(calculated_height
/ layer_height
) / 2);
109 actual_height
= layers
* layer_height
;
110 round_radius
= actual_height
/ 2;
112 mirrored([0, 0, 1]) {
113 for(layer
= [0 : (layers
/ 2) - 1]) {
114 translate([0, 0, layer
* layer_height
- actual_height
/ 2]) {
115 linear_extrude(height
= layer_height
) {
116 adjacent
= round_radius
- (layer
* layer_height
);
117 angle
= acos(adjacent
/ round_radius
);
118 round_extra
= adjacent
* tan(angle
);
119 spin_footprint(weight_radius
,
126 This file is part of 3d-printables.
128 3d-printables is free software: you can redistribute it and/or modify
129 it under the terms of the GNU Affero General Public License as published by
130 the Free Software Foundation, either version 3 of the License, or
131 (at your option) any later version.
133 3d-printables is distributed in the hope that it will be useful,
134 but WITHOUT ANY WARRANTY; without even the implied warranty of
135 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
136 GNU Affero General Public License for more details.
138 You should have received a copy of the GNU Affero General Public License
139 along with challenge-bot. If not, see <http://www.gnu.org/licenses/>.