-rw-r--r-- | another.scad | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/another.scad b/another.scad index 7e7f22d..3d804c1 100644 --- a/another.scad +++ b/another.scad | |||
@@ -8,96 +8,98 @@ include <pushfit_data.scad>; | |||
8 | 8 | ||
9 | module the_extruder( | 9 | module the_extruder( |
10 | // motor properties | 10 | // motor properties |
11 | gearbox_d = 36, | 11 | gearbox_d = 36, |
12 | mount_d = 28, // the distance between opposite mounting holes | 12 | mount_d = 28, // the distance between opposite mounting holes |
13 | mounthole_depth = 5, | 13 | mounthole_depth = 5, |
14 | protrusion_d = 22, protrusion_h = 2.2, // the dimensions of the protrusion on top of gearbox | 14 | protrusion_d = 22, protrusion_h = 2.2, // the dimensions of the protrusion on top of gearbox |
15 | bore_d = 8, bore_l = 17.6, | 15 | bore_d = 8, bore_l = 17.6, |
16 | bore_dd = 7, | 16 | bore_dd = 7, |
17 | // pulley properties | 17 | // pulley properties |
18 | pulley_d = 11.5, pulley_h=10, | 18 | pulley_d = 11.5, pulley_h=10, |
19 | pulley_elevation = 1, // pulley elevation above the protrusion | 19 | pulley_elevation = 1, // pulley elevation above the protrusion |
20 | teeth_elevation = 7.5, // distance from the bottom of the pulley to its teeth | 20 | teeth_elevation = 7.5, // distance from the bottom of the pulley to its teeth |
21 | // idler properties | 21 | // idler properties |
22 | idler_d = 9.5, idler_h = 4, idler_id = 3,// idler dimensions: outer and inner diameters and height | 22 | idler_d = 9.5, idler_h = 4, idler_id = 3,// idler dimensions: outer and inner diameters and height |
23 | // spring properties | 23 | // spring properties |
24 | spring_d = 10, spring_lc = 9.6, // spring diameter and compressed length | 24 | spring_d = 10, spring_lc = 9.6, // spring diameter and compressed length |
25 | // filament path properties | 25 | // filament path properties |
26 | filament_d = 1.75, | 26 | filament_d = 1.75, |
27 | filament_path_d = 2, | 27 | filament_path_d = 2, |
28 | filament_guide_d = 4, // PTFE filament guide diameter | 28 | filament_guide_d = 4, // PTFE filament guide diameter |
29 | // knob properties | 29 | // knob properties |
30 | knob_h = 10, | 30 | knob_h = 10, |
31 | knob_bore_l = 4, | 31 | knob_bore_l = 4, |
32 | knob_indent_d = 4, | 32 | knob_indent_d = 4, |
33 | knob_indents = 12, | 33 | knob_indents = 12, |
34 | // spring tensioner | 34 | // spring tensioner |
35 | st_nut_d = 9, st_nut_h = 4, | 35 | st_nut_d = 9, st_nut_h = 4, |
36 | st_screw_d = 5, | 36 | st_screw_d = 5, |
37 | st_thickshell = 8*extrusion_width, st_thinshell = 4*extrusion_width, | 37 | st_thickshell = 8*extrusion_width, st_thinshell = 4*extrusion_width, |
38 | 38 | ||
39 | // screw it | 39 | // screw it |
40 | mount_screw_d = 3.1, mount_screw_l = 20, | 40 | mount_screw_d = 3.1, mount_screw_l = 20, |
41 | mount_screwhead_d=6, mount_screwhead_h=3, | 41 | mount_screwhead_d=6, mount_screwhead_h=3, |
42 | 42 | ||
43 | pf = pushfit_embeddest, | 43 | pf = pushfit_embeddest, |
44 | 44 | ||
45 | // empty spaces | 45 | // empty spaces |
46 | idler_travel = 3, // how far should idler travel when pressed | 46 | idler_travel = 3, // how far should idler travel when pressed |
47 | idler_clearance=1, | 47 | idler_clearance=1, |
48 | pulley_clearance=2, | 48 | pulley_clearance=2, |
49 | lever_v_clearance=.7, // vertical clearance for the lever | 49 | lever_v_clearance=.7, // vertical clearance for the lever |
50 | spring_d_clearance=1, | 50 | spring_d_clearance=1, |
51 | protrusion_tolerance_h=.5, // horizontal tolerance for the motor protrusion | 51 | protrusion_tolerance_h=.5, // horizontal tolerance for the motor protrusion |
52 | protrusion_tolerance_v=.5, // vertical tolerance for the motor protrusion | 52 | protrusion_tolerance_v=.5, // vertical tolerance for the motor protrusion |
53 | mount_screw_d_tolerance=.4, | 53 | mount_screw_d_tolerance=.4, |
54 | idler_v_tolerance=.5, | 54 | idler_v_tolerance=.5, |
55 | knob_bore_d_tolerance=.6, | 55 | knob_bore_d_tolerance=.6, |
56 | st_nut_h_tolerance=.2, | ||
57 | st_nut_d_tolerance=.2,/* TODO: make it st_nut_w_tolerance */ | ||
56 | 58 | ||
57 | what="lever", // lever|body|knob|springpad|* | 59 | what="lever", // lever|body|knob|springpad|* |
58 | left=false, | 60 | left=false, |
59 | vitamins = true, | 61 | vitamins = true, |
60 | supports = false, bridges = true, | 62 | supports = false, bridges = true, |
61 | tensioner = true, | 63 | tensioner = true, |
62 | debug = false | 64 | debug = false |
63 | ) { | 65 | ) { |
64 | fnd = 2*PI; fnr = 2*fnd; | 66 | fnd = 2*PI; fnr = 2*fnd; |
65 | 67 | ||
66 | lever_shell = mount_screwhead_h+0.5; | 68 | lever_shell = mount_screwhead_h+0.5; |
67 | lever_thickness=max(spring_d+spring_d_clearance+layer_height*8,idler_h+idler_v_tolerance+2*lever_shell); | 69 | lever_thickness=max(spring_d+spring_d_clearance+layer_height*8,idler_h+idler_v_tolerance+2*lever_shell); |
68 | lsd = idler_d-idler_clearance*2; | 70 | lsd = idler_d-idler_clearance*2; |
69 | longwing=gearbox_d/2+spring_d/2+lsd/2; | 71 | longwing=gearbox_d/2+spring_d/2+lsd/2; |
70 | h_ = (pulley_d+idler_d)/(2*sqrt(2)); | 72 | h_ = (pulley_d+idler_d)/(2*sqrt(2)); |
71 | ri = sqrt( pow(h_,2) + pow(mount_d/2-h_,2) ); | 73 | ri = sqrt( pow(h_,2) + pow(mount_d/2-h_,2) ); |
72 | spring_dl = idler_travel*longwing/ri; | 74 | spring_dl = idler_travel*longwing/ri; |
73 | 75 | ||
74 | filament_elevation=protrusion_h+pulley_elevation+teeth_elevation; | 76 | filament_elevation=protrusion_h+pulley_elevation+teeth_elevation; |
75 | ls_z = filament_elevation; // leverspace mid-z | 77 | ls_z = filament_elevation; // leverspace mid-z |
76 | body_h = max(protrusion_h+bore_l,mount_screw_l-mounthole_depth/2+mount_screwhead_h,ls_z*2); | 78 | body_h = max(protrusion_h+bore_l,mount_screw_l-mounthole_depth/2+mount_screwhead_h,ls_z*2); |
77 | ls_h = lever_thickness+lever_v_clearance; // leverspace height | 79 | ls_h = lever_thickness+lever_v_clearance; // leverspace height |
78 | 80 | ||
79 | module mirrorleft() { | 81 | module mirrorleft() { |
80 | mirror([left?0:1,0,0]) children(); | 82 | mirror([left?0:1,0,0]) children(); |
81 | } | 83 | } |
82 | module place_idler() { | 84 | module place_idler() { |
83 | rotate([0,0,45]) | 85 | rotate([0,0,45]) |
84 | translate([(pulley_d+idler_d)/2,0,0]) | 86 | translate([(pulley_d+idler_d)/2,0,0]) |
85 | children(); | 87 | children(); |
86 | } | 88 | } |
87 | module finger_indent(d=lever_thickness,depth/*=1*/,r/*=15*/) { | 89 | module finger_indent(d=lever_thickness,depth/*=1*/,r/*=15*/) { |
88 | if(depth) { | 90 | if(depth) { |
89 | hh = (-4*pow(depth,2)+pow(d,2))/(8*depth); | 91 | hh = (-4*pow(depth,2)+pow(d,2))/(8*depth); |
90 | rr = depth+hh; | 92 | rr = depth+hh; |
91 | translate([0,0,hh]) sphere(r=rr,$fn=fnr*rr); | 93 | translate([0,0,hh]) sphere(r=rr,$fn=fnr*rr); |
92 | }else if(r) { | 94 | }else if(r) { |
93 | hh=sqrt(pow(r,2)-pow(d,2)/4); | 95 | hh=sqrt(pow(r,2)-pow(d,2)/4); |
94 | translate([0,0,hh]) sphere(r=r,$fn=fnr*r); | 96 | translate([0,0,hh]) sphere(r=r,$fn=fnr*r); |
95 | } | 97 | } |
96 | } | 98 | } |
97 | 99 | ||
98 | % if(vitamins) mirrorleft() { | 100 | % if(vitamins) mirrorleft() { |
99 | translate([0,0,-epsilon]) mirror([0,0,1]) cylinder(d=gearbox_d,h=1,$fn=60); | 101 | translate([0,0,-epsilon]) mirror([0,0,1]) cylinder(d=gearbox_d,h=1,$fn=60); |
100 | for(zr=[0:90:359]) rotate([0,0,zr]) translate([mount_d/2,0,0]) | 102 | for(zr=[0:90:359]) rotate([0,0,zr]) translate([mount_d/2,0,0]) |
101 | cylinder(d=mount_screw_d,h=20,$fn=30); | 103 | cylinder(d=mount_screw_d,h=20,$fn=30); |
102 | translate([0,0,-epsilon]) cylinder(d=protrusion_d,h=protrusion_h,$fn=30); | 104 | translate([0,0,-epsilon]) cylinder(d=protrusion_d,h=protrusion_h,$fn=30); |
103 | translate([0,0,protrusion_h]) { | 105 | translate([0,0,protrusion_h]) { |
@@ -167,104 +169,104 @@ module the_extruder( | |||
167 | cylinder(d=mount_screw_d+mount_screw_d_tolerance,h=lever_thickness+2,center=true,$fn=fnd*mount_screw_d); | 169 | cylinder(d=mount_screw_d+mount_screw_d_tolerance,h=lever_thickness+2,center=true,$fn=fnd*mount_screw_d); |
168 | 170 | ||
169 | // lever end | 171 | // lever end |
170 | translate([mount_d/2,0,0]) rotate([0,90,0]) { | 172 | translate([mount_d/2,0,0]) rotate([0,90,0]) { |
171 | translate([0,-longwing,lsd/2]) finger_indent(d=lever_thickness-1,r=15); | 173 | translate([0,-longwing,lsd/2]) finger_indent(d=lever_thickness-1,r=15); |
172 | translate([0,-longwing,0]) | 174 | translate([0,-longwing,0]) |
173 | mirror([0,0,1]) | 175 | mirror([0,0,1]) |
174 | difference() { | 176 | difference() { |
175 | cylinder(d=spring_d+spring_d_clearance,h=lsd,$fn=fnd*(spring_d+spring_d_clearance)); | 177 | cylinder(d=spring_d+spring_d_clearance,h=lsd,$fn=fnd*(spring_d+spring_d_clearance)); |
176 | sphere(d=spring_d*3/4,$fn=fnd*spring_d*3/4); | 178 | sphere(d=spring_d*3/4,$fn=fnd*spring_d*3/4); |
177 | } | 179 | } |
178 | }//rotate-translate | 180 | }//rotate-translate |
179 | }//difference | 181 | }//difference |
180 | // bridging patch | 182 | // bridging patch |
181 | if(bridges) place_idler() | 183 | if(bridges) place_idler() |
182 | translate([0,0,lever_thickness/2-mount_screwhead_h]) | 184 | translate([0,0,lever_thickness/2-mount_screwhead_h]) |
183 | mirror([0,0,1]) | 185 | mirror([0,0,1]) |
184 | cylinder(d=mount_screwhead_d,h=layer_height); | 186 | cylinder(d=mount_screwhead_d,h=layer_height); |
185 | }//translate | 187 | }//translate |
186 | }//lever module | 188 | }//lever module |
187 | 189 | ||
188 | module body() { | 190 | module body() { |
189 | difference() { | 191 | difference() { |
190 | union() { | 192 | union() { |
191 | cylinder(d=gearbox_d,h=body_h,$fn=fnd*gearbox_d); | 193 | cylinder(d=gearbox_d,h=body_h,$fn=fnd*gearbox_d); |
192 | // finger and spring support | 194 | // finger and spring support |
193 | fsw = gearbox_d-(gearbox_d-mount_d)/2-spring_lc; | 195 | fsw = gearbox_d-(gearbox_d-mount_d)/2-spring_lc; |
194 | translate([-gearbox_d/2,0,0]) difference() { | 196 | translate([-gearbox_d/2,0,0]) difference() { |
195 | union() { | 197 | union() { |
196 | hull() { | 198 | hull() { |
197 | translate([0,-longwing,ls_z]) | 199 | translate([0,-longwing,ls_z]) |
198 | rotate([0,90,0]) | 200 | rotate([0,90,0]) |
199 | cylinder(d=lever_thickness,h=fsw,$fn=fnd*lever_thickness); | 201 | cylinder(d=lever_thickness,h=fsw,$fn=fnd*lever_thickness); |
200 | hh=body_h-ls_z; | 202 | hh=body_h-ls_z; |
201 | translate([0,0,ls_z-lever_thickness/2]) | 203 | translate([0,0,ls_z-lever_thickness/2]) |
202 | mirror([0,1,0]) cube(size=[fsw,longwing-hh+lever_thickness/sqrt(2),hh+lever_thickness/2]); | 204 | mirror([0,1,0]) cube(size=[fsw,longwing-hh+lever_thickness/sqrt(2),hh+lever_thickness/2]); |
203 | hhh=ls_z; | 205 | hhh=ls_z; |
204 | translate([0,0,0]) | 206 | translate([0,0,0]) |
205 | mirror([0,1,0]) cube(size=[fsw,longwing-hhh+lever_thickness/sqrt(2),hhh+lever_thickness/2]); | 207 | mirror([0,1,0]) cube(size=[fsw,longwing-hhh+lever_thickness/sqrt(2),hhh+lever_thickness/2]); |
206 | } | 208 | } |
207 | } | 209 | } |
208 | translate([0,-longwing,ls_z]) rotate([0,-90,0]) { | 210 | translate([0,-longwing,ls_z]) rotate([0,-90,0]) { |
209 | if(!tensioner) finger_indent(d=lever_thickness-1,r=15); else { | 211 | if(!tensioner) finger_indent(d=lever_thickness-1,r=15); else { |
210 | if(debug) translate([0,-lever_thickness/2-1,-gearbox_d]) cube(size=[body_h/2+1,lever_thickness/2+1,gearbox_d+2]); | 212 | if(debug) translate([0,-lever_thickness/2-1,-gearbox_d]) cube(size=[body_h/2+1,lever_thickness/2+1,gearbox_d+2]); |
211 | mirror([0,0,1]) { | 213 | mirror([0,0,1]) { |
212 | translate([0,0,st_thickshell]) | 214 | translate([0,0,st_thickshell]) |
213 | hull() for(o=[0,spring_d]) translate([0,-o,0]) | 215 | hull() for(o=[0,spring_d]) translate([0,-o,0]) |
214 | rotate([0,0,30]) | 216 | rotate([0,0,30]) |
215 | cylinder(d=st_nut_d,h=st_nut_h,$fn=6); | 217 | cylinder(d=st_nut_d+st_nut_d_tolerance,h=st_nut_h+st_nut_h_tolerance,$fn=6); |
216 | translate([0,0,-1]) cylinder(d=st_screw_d,h=fsw+2,$fn=fnd*st_screw_d); | 218 | translate([0,0,-1]) cylinder(d=st_screw_d,h=fsw+2,$fn=fnd*st_screw_d); |
217 | bigd = spring_d+spring_d_clearance; | 219 | bigd = spring_d+spring_d_clearance; |
218 | hf = (bigd-st_screw_d)/2; | 220 | hf = (bigd-st_screw_d)/2; |
219 | translate([0,0,st_thickshell+st_nut_h+st_thinshell-epsilon]) | 221 | translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell-epsilon]) |
220 | cylinder(d1=st_screw_d,d2=bigd, | 222 | cylinder(d1=st_screw_d,d2=bigd, |
221 | h=hf+epsilon, $fn=fnd*bigd); | 223 | h=hf+epsilon, $fn=fnd*bigd); |
222 | translate([0,0,st_thickshell+st_nut_h+st_thinshell+hf-epsilon]) | 224 | translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell+hf-epsilon]) |
223 | cylinder(d=bigd,h=fsw+1,$fn=fnd*bigd); | 225 | cylinder(d=bigd,h=fsw+1,$fn=fnd*bigd); |
224 | } | 226 | } |
225 | } | 227 | } |
226 | } | 228 | } |
227 | } // translate | 229 | } // translate |
228 | 230 | ||
229 | // pushfit bracket | 231 | // pushfit bracket |
230 | translate([0,0,filament_elevation]) | 232 | translate([0,0,filament_elevation]) |
231 | rotate([0,0,45]) translate([pulley_d/2,0,0]) | 233 | rotate([0,0,45]) translate([pulley_d/2,0,0]) |
232 | rotate([-90,0,0]) | 234 | rotate([-90,0,0]) |
233 | translate([0,0,mount_d/sqrt(2)/2+mount_screw_d-gearbox_d/2/*TODO:*/]) | 235 | translate([0,0,mount_d/sqrt(2)/2+mount_screw_d-gearbox_d/2/*TODO:*/]) |
234 | cylinder(r=min(body_h-filament_elevation,filament_elevation)/sin(60)-epsilon,h=pf_h(pf)+gearbox_d/2/*TODO:*/,$fn=6); | 236 | cylinder(r=min(body_h-filament_elevation,filament_elevation)/sin(60)-epsilon,h=pf_h(pf)+gearbox_d/2/*TODO:*/,$fn=6); |
235 | }//union (first child of difference) | 237 | }//union (first child of difference) |
236 | 238 | ||
237 | // protrusion | 239 | // protrusion |
238 | translate([0,0,-1]) | 240 | translate([0,0,-1]) |
239 | cylinder(d=protrusion_d+protrusion_tolerance_h,h=protrusion_h+protrusion_tolerance_v+1,$fn=fnd*(protrusion_d+protrusion_tolerance_h)); | 241 | cylinder(d=protrusion_d+protrusion_tolerance_h,h=protrusion_h+protrusion_tolerance_v+1,$fn=fnd*(protrusion_d+protrusion_tolerance_h)); |
240 | // mount screw holes | 242 | // mount screw holes |
241 | for(zr=[0:90:359]) rotate([0,0,zr]) translate([mount_d/2,0,0]) { | 243 | for(zr=[0:90:359]) rotate([0,0,zr]) translate([mount_d/2,0,0]) { |
242 | translate([0,0,mount_screw_l-mounthole_depth/2-(bridges?layer_height:-epsilon)]) | 244 | translate([0,0,mount_screw_l-mounthole_depth/2-(bridges?layer_height:-epsilon)]) |
243 | mirror([0,0,1]) | 245 | mirror([0,0,1]) |
244 | cylinder(d=mount_screw_d+mount_screw_d_tolerance, | 246 | cylinder(d=mount_screw_d+mount_screw_d_tolerance, |
245 | h=mount_screw_l-mounthole_depth/2+1, | 247 | h=mount_screw_l-mounthole_depth/2+1, |
246 | $fn=fnd*(mount_screw_d+mount_screw_d_tolerance)); | 248 | $fn=fnd*(mount_screw_d+mount_screw_d_tolerance)); |
247 | translate([0,0,mount_screw_l-mounthole_depth/2]) | 249 | translate([0,0,mount_screw_l-mounthole_depth/2]) |
248 | cylinder(d=mount_screwhead_d,h=body_h+1,$fn=fnd*mount_screwhead_d); | 250 | cylinder(d=mount_screwhead_d,h=body_h+1,$fn=fnd*mount_screwhead_d); |
249 | }//for | 251 | }//for |
250 | // pushfit | 252 | // pushfit |
251 | translate([0,0,filament_elevation]) | 253 | translate([0,0,filament_elevation]) |
252 | rotate([0,0,45]) translate([pulley_d/2,0,0]) | 254 | rotate([0,0,45]) translate([pulley_d/2,0,0]) |
253 | rotate([-90,0,0]) | 255 | rotate([-90,0,0]) |
254 | translate([0,0,mount_d/sqrt(2)/2+mount_screw_d+epsilon]) | 256 | translate([0,0,mount_d/sqrt(2)/2+mount_screw_d+epsilon]) |
255 | rotate([0,0,180]) { | 257 | rotate([0,0,180]) { |
256 | pushfit(pf); | 258 | pushfit(pf); |
257 | cylinder(d=filament_guide_d,h=gearbox_d,center=true,$fn=fnd*filament_guide_d); | 259 | cylinder(d=filament_guide_d,h=gearbox_d,center=true,$fn=fnd*filament_guide_d); |
258 | translate([0,-filament_guide_d/2/sqrt(2),0]) | 260 | translate([0,-filament_guide_d/2/sqrt(2),0]) |
259 | rotate([0,0,45]) | 261 | rotate([0,0,45]) |
260 | cube(size=[filament_guide_d/2,filament_guide_d/2,gearbox_d],center=true); | 262 | cube(size=[filament_guide_d/2,filament_guide_d/2,gearbox_d],center=true); |
261 | }//rotate translate rotate translate rotate translate | 263 | }//rotate translate rotate translate rotate translate |
262 | // pulley | 264 | // pulley |
263 | cylinder(d=pulley_d+pulley_clearance,h=body_h+1,$fn=fnd*(pulley_d+pulley_clearance)); | 265 | cylinder(d=pulley_d+pulley_clearance,h=body_h+1,$fn=fnd*(pulley_d+pulley_clearance)); |
264 | // leverspace | 266 | // leverspace |
265 | hull() for(x=[0,gearbox_d]) | 267 | hull() for(x=[0,gearbox_d]) |
266 | rotate([0,0,45]) | 268 | rotate([0,0,45]) |
267 | translate([x,0,ls_z-ls_h/2]) | 269 | translate([x,0,ls_z-ls_h/2]) |
268 | cylinder(d=idler_d+idler_clearance,h=ls_h,$fn=fnd*(idler_d+idler_clearance)); | 270 | cylinder(d=idler_d+idler_clearance,h=ls_h,$fn=fnd*(idler_d+idler_clearance)); |
269 | 271 | ||
270 | // idler clearance | 272 | // idler clearance |
@@ -296,97 +298,97 @@ module the_extruder( | |||
296 | translate([0,0,ls_z-ls_h/2]) | 298 | translate([0,0,ls_z-ls_h/2]) |
297 | cube(size=[gearbox_d,gearbox_d,lever_thickness+lever_v_clearance]); | 299 | cube(size=[gearbox_d,gearbox_d,lever_thickness+lever_v_clearance]); |
298 | translate([0,0,ls_z-ls_h/2]) { | 300 | translate([0,0,ls_z-ls_h/2]) { |
299 | translate([mount_screwhead_d/2,0,0]) | 301 | translate([mount_screwhead_d/2,0,0]) |
300 | mirror([0,1,0]) | 302 | mirror([0,1,0]) |
301 | cube(size=[gearbox_d,gearbox_d/2+1,lever_thickness+lever_v_clearance]); | 303 | cube(size=[gearbox_d,gearbox_d/2+1,lever_thickness+lever_v_clearance]); |
302 | } | 304 | } |
303 | //translate([-mount_d/2,-longwing,filament_elevation]) | 305 | //translate([-mount_d/2,-longwing,filament_elevation]) |
304 | if(!tensioner) /* XXX: this seems to be bullshit, but it's so old, that it's historical bullshit */ | 306 | if(!tensioner) /* XXX: this seems to be bullshit, but it's so old, that it's historical bullshit */ |
305 | translate([mount_d/2,-longwing,filament_elevation]) | 307 | translate([mount_d/2,-longwing,filament_elevation]) |
306 | rotate([0,-90,0]) difference() { | 308 | rotate([0,-90,0]) difference() { |
307 | cylinder(d=spring_d+spring_d_clearance,h=spring_lc+spring_dl,$fn=fnd*(spring_d+spring_d_clearance)); | 309 | cylinder(d=spring_d+spring_d_clearance,h=spring_lc+spring_dl,$fn=fnd*(spring_d+spring_d_clearance)); |
308 | translate([0,0,spring_lc+spring_dl]) sphere(d=spring_d*3/4,$fn=fnd*spring_d*3/4); | 310 | translate([0,0,spring_lc+spring_dl]) sphere(d=spring_d*3/4,$fn=fnd*spring_d*3/4); |
309 | } | 311 | } |
310 | 312 | ||
311 | if(debug) { | 313 | if(debug) { |
312 | translate([mount_d/2,0,-1]) | 314 | translate([mount_d/2,0,-1]) |
313 | rotate([0,0,-45]) | 315 | rotate([0,0,-45]) |
314 | cube(size=[gearbox_d-mount_d,gearbox_d-mount_d,body_h+2]); | 316 | cube(size=[gearbox_d-mount_d,gearbox_d-mount_d,body_h+2]); |
315 | } | 317 | } |
316 | 318 | ||
317 | }//difference | 319 | }//difference |
318 | 320 | ||
319 | if(supports) intersection() { | 321 | if(supports) intersection() { |
320 | difference() { | 322 | difference() { |
321 | translate([0,0,ls_z-ls_h/2-epsilon]) | 323 | translate([0,0,ls_z-ls_h/2-epsilon]) |
322 | cylinder(d=gearbox_d,h=ls_h+2*epsilon,$fn=fnd*gearbox_d); | 324 | cylinder(d=gearbox_d,h=ls_h+2*epsilon,$fn=fnd*gearbox_d); |
323 | cylinder(d=pulley_d+pulley_clearance,h=body_h+1,$fn=fnd*(pulley_d+pulley_clearance)); | 325 | cylinder(d=pulley_d+pulley_clearance,h=body_h+1,$fn=fnd*(pulley_d+pulley_clearance)); |
324 | } | 326 | } |
325 | // supports | 327 | // supports |
326 | // TODO: hardcoded stuff below… | 328 | // TODO: hardcoded stuff below… |
327 | if(false) { // parallel | 329 | if(false) { // parallel |
328 | for(y=[-gearbox_d:4:gearbox_d]) | 330 | for(y=[-gearbox_d:4:gearbox_d]) |
329 | translate([0,y-extrusion_width/2,0]) | 331 | translate([0,y-extrusion_width/2,0]) |
330 | cube(size=[gearbox_d,extrusion_width,body_h]); | 332 | cube(size=[gearbox_d,extrusion_width,body_h]); |
331 | }else{ // radial | 333 | }else{ // radial |
332 | for(zr=[-65:(65+50)/7:50]) | 334 | for(zr=[-65:(65+50)/7:50]) |
333 | rotate([0,0,zr]) translate([0,-extrusion_width/2,0]) | 335 | rotate([0,0,zr]) translate([0,-extrusion_width/2,0]) |
334 | cube(size=[gearbox_d,extrusion_width,body_h]); | 336 | cube(size=[gearbox_d,extrusion_width,body_h]); |
335 | } | 337 | } |
336 | } | 338 | } |
337 | 339 | ||
338 | }//body module | 340 | }//body module |
339 | 341 | ||
340 | module springpad() { | 342 | module springpad() { |
341 | smalld=st_screw_d+2*extrusion_width; | 343 | smalld=st_screw_d+2*extrusion_width; |
342 | bigd = spring_d+spring_d_clearance/2; | 344 | bigd = spring_d+spring_d_clearance/2; |
343 | hf = (bigd-smalld)/2; | 345 | hf = (bigd-smalld)/2; |
344 | translate([-gearbox_d/2+st_thickshell+st_nut_h+st_thinshell+1,-longwing,filament_elevation]) | 346 | translate([-gearbox_d/2+st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell+1,-longwing,filament_elevation]) |
345 | rotate([0,90,0]) difference() { | 347 | rotate([0,90,0]) difference() { |
346 | union() { | 348 | union() { |
347 | cylinder(d1=smalld,d2=bigd,h=hf,$fn=fnd*bigd); | 349 | cylinder(d1=smalld,d2=bigd,h=hf,$fn=fnd*bigd); |
348 | translate([0,0,hf-epsilon]) | 350 | translate([0,0,hf-epsilon]) |
349 | cylinder(d=bigd,h=hf*2,$fn=fnd*bigd); | 351 | cylinder(d=bigd,h=hf*2,$fn=fnd*bigd); |
350 | translate([0,0,3*hf]) | 352 | translate([0,0,3*hf]) |
351 | sphere(d=spring_d*3/4,$fn=fnd*spring_d*3/4); | 353 | sphere(d=spring_d*3/4,$fn=fnd*spring_d*3/4); |
352 | } | 354 | } |
353 | translate([0,0,-epsilon]) | 355 | translate([0,0,-epsilon]) |
354 | cylinder(d=st_screw_d,h=2*hf+epsilon,$fn=fnd*st_screw_d); | 356 | cylinder(d=st_screw_d,h=2*hf+epsilon,$fn=fnd*st_screw_d); |
355 | } | 357 | } |
356 | } | 358 | } |
357 | 359 | ||
358 | module knob() { | 360 | module knob() { |
359 | ch = knob_indent_d/2; | 361 | ch = knob_indent_d/2; |
360 | translate([0,0,body_h+epsilon]) { | 362 | translate([0,0,body_h+epsilon]) { |
361 | mirror([0,0,1]) translate([0,0,-epsilon]) { | 363 | mirror([0,0,1]) translate([0,0,-epsilon]) { |
362 | difference() { | 364 | difference() { |
363 | cylinder(d=pulley_d,h=knob_bore_l,$fn=fnd*pulley_d); | 365 | cylinder(d=pulley_d,h=knob_bore_l,$fn=fnd*pulley_d); |
364 | translate([0,0,-1]) difference() { | 366 | translate([0,0,-1]) difference() { |
365 | cylinder(d=bore_d+knob_bore_d_tolerance,h=knob_bore_l+2); | 367 | cylinder(d=bore_d+knob_bore_d_tolerance,h=knob_bore_l+2); |
366 | translate([-bore_d/2-1,bore_dd-bore_d/2+knob_bore_d_tolerance/2,-1]) | 368 | translate([-bore_d/2-1,bore_dd-bore_d/2+knob_bore_d_tolerance/2,-1]) |
367 | cube([bore_d+2,bore_d/2,knob_bore_l+4]); | 369 | cube([bore_d+2,bore_d/2,knob_bore_l+4]); |
368 | } | 370 | } |
369 | } | 371 | } |
370 | } | 372 | } |
371 | difference() { | 373 | difference() { |
372 | union() { | 374 | union() { |
373 | cylinder(d1=gearbox_d-2*ch,d2=gearbox_d,h=ch+epsilon,$fn=fnd*gearbox_d); | 375 | cylinder(d1=gearbox_d-2*ch,d2=gearbox_d,h=ch+epsilon,$fn=fnd*gearbox_d); |
374 | translate([0,0,ch]) | 376 | translate([0,0,ch]) |
375 | cylinder(d=gearbox_d,h=knob_h-2*ch+epsilon,$fn=fnd*gearbox_d); | 377 | cylinder(d=gearbox_d,h=knob_h-2*ch+epsilon,$fn=fnd*gearbox_d); |
376 | translate([0,0,knob_h-ch]) | 378 | translate([0,0,knob_h-ch]) |
377 | cylinder(d1=gearbox_d,d2=gearbox_d-2*ch,h=ch,$fn=fnd*gearbox_d); | 379 | cylinder(d1=gearbox_d,d2=gearbox_d-2*ch,h=ch,$fn=fnd*gearbox_d); |
378 | } | 380 | } |
379 | for(a=[0:360/knob_indents:359]) rotate([0,0,a]) | 381 | for(a=[0:360/knob_indents:359]) rotate([0,0,a]) |
380 | translate([0,gearbox_d/2,-1]) | 382 | translate([0,gearbox_d/2,-1]) |
381 | cylinder(d=knob_indent_d,h=knob_h+2,$fn=fnd*knob_indent_d); | 383 | cylinder(d=knob_indent_d,h=knob_h+2,$fn=fnd*knob_indent_d); |
382 | } | 384 | } |
383 | } | 385 | } |
384 | }//knob module | 386 | }//knob module |
385 | 387 | ||
386 | mirrorleft() | 388 | mirrorleft() |
387 | if(what=="lever") color("green",0.7) lever(); | 389 | if(what=="lever") color("green",0.7) lever(); |
388 | else if(what=="body") color("yellow",0.7) body(); | 390 | else if(what=="body") color("yellow",0.7) body(); |
389 | else if(what=="knob") color("red",0.7) knob(); | 391 | else if(what=="knob") color("red",0.7) knob(); |
390 | else if(what=="springpad") color("blue",0.7) springpad(); | 392 | else if(what=="springpad") color("blue",0.7) springpad(); |
391 | else if(what=="both") { | 393 | else if(what=="both") { |
392 | color("green",0.7) lever(); | 394 | color("green",0.7) lever(); |