summaryrefslogtreecommitdiff
path: root/another.scad
Unidiff
Diffstat (limited to 'another.scad') (more/less context) (ignore whitespace changes)
-rw-r--r--another.scad73
1 files changed, 36 insertions, 37 deletions
diff --git a/another.scad b/another.scad
index 78d4320..b752f30 100644
--- a/another.scad
+++ b/another.scad
@@ -60,49 +60,49 @@ module the_extruder(
60 mount_screw_d_tolerance=.4, 60 mount_screw_d_tolerance=.4,
61 idler_v_tolerance=.5, 61 idler_v_tolerance=.5,
62 knob_bore_d_tolerance=.6, 62 knob_bore_d_tolerance=.6,
63 st_nut_h_tolerance=.2, 63 st_nut_h_tolerance=.2,
64 st_nut_d_tolerance=.2,/* TODO: make it st_nut_w_tolerance */ 64 st_nut_d_tolerance=.2,/* TODO: make it st_nut_w_tolerance */
65 st_screw_d_tolerance=.5, 65 st_screw_d_tolerance=.5,
66 st_split_w_tolerance = .3, 66 st_split_w_tolerance = .3,
67 67
68 min_z_shell = 4*layer_height, // the very minimal shell thickness along z-axis. 68 min_z_shell = 4*layer_height, // the very minimal shell thickness along z-axis.
69 min_xy_shell = 2*extrusion_width, 69 min_xy_shell = 2*extrusion_width,
70 70
71 what="lever", // lever|body|knob|springpad|* 71 what="lever", // lever|body|knob|springpad|*
72 left=false, 72 left=false,
73 vitamins = true, 73 vitamins = true,
74 supports = false, bridges = true, 74 supports = false, bridges = true,
75 tensioner = true, 75 tensioner = true,
76 debug = false 76 debug = false
77) { 77) {
78 fnd = 2*PI; fnr = 2*fnd; 78 fnd = 2*PI; fnr = 2*fnd;
79 79
80 idler_filament_offset = filament_path_d/2; // -filament_offset; 80 idler_filament_offset = filament_path_d/2; // -filament_offset;
81 lever_shell = mount_screwhead_h+0.5; 81 lever_shell = mount_screwhead_h+0.5;
82 lever_thickness=max(spring_d+spring_d_clearance+layer_height*8,idler_h+idler_v_tolerance+2*lever_shell); 82 lever_thickness=max(spring_d+spring_d_clearance+layer_height*8,idler_h+idler_v_tolerance+2*lever_shell);
83 lsd = idler_d-idler_clearance*2; 83 lsd = idler_d-idler_clearance*2;
84 longwing=gearbox_d/2+spring_d/2+lsd/2; 84 longwing=(mount_d+mount_screw_d+mount_screw_d_tolerance+spring_d+spring_d_clearance)/2+extrusion_width;
85 shortwing = let(a=mount_d/2,c=(pulley_d+idler_d)/2/sqrt(2)) 85 shortwing = let(a=mount_d/2,c=(pulley_d+idler_d)/2/sqrt(2))
86 sqrt(c*c+pow(a-c,2)); 86 sqrt(c*c+pow(a-c,2));
87 longwing_travel = idler_travel*longwing/shortwing; 87 longwing_travel = idler_travel*longwing/shortwing;
88 h_ = (pulley_d+idler_d)/(2*sqrt(2)); 88 h_ = (pulley_d+idler_d)/(2*sqrt(2));
89 ri = sqrt( pow(h_,2) + pow(mount_d/2-h_,2) ); 89 ri = sqrt( pow(h_,2) + pow(mount_d/2-h_,2) );
90 spring_dl = idler_travel*longwing/ri; 90 spring_dl = idler_travel*longwing/ri;
91 // finger and spring support 91 // finger and spring support
92 fsw = gearbox_d-(gearbox_d-mount_d)/2-max(spring_lc,longwing_travel+(gearbox_d-mount_d)/2); 92 fsw = gearbox_d-(gearbox_d-mount_d)/2-max(spring_lc,longwing_travel+(gearbox_d-mount_d)/2);
93 93
94 mount_min_depth = mounthole_min_depth ? mounthole_min_depth : mounthole_depth-1; 94 mount_min_depth = mounthole_min_depth ? mounthole_min_depth : mounthole_depth-1;
95 mount_max_depth = mounthole_max_depth ? mounthole_max_depth : mounthole_depth+1; 95 mount_max_depth = mounthole_max_depth ? mounthole_max_depth : mounthole_depth+1;
96 filament_elevation=protrusion_h+pulley_elevation+teeth_elevation; 96 filament_elevation=protrusion_h+pulley_elevation+teeth_elevation;
97 ls_z = filament_elevation; // leverspace mid-z 97 ls_z = filament_elevation; // leverspace mid-z
98 ls_h = lever_thickness+lever_v_clearance; // leverspace height 98 ls_h = lever_thickness+lever_v_clearance; // leverspace height
99 mount_depth = mount_screw_l - (ls_z+ls_h/2+min_z_shell); 99 mount_depth = mount_screw_l - (ls_z+ls_h/2+min_z_shell);
100 body_h = max(protrusion_h+bore_l,mount_screw_l-mount_depth+mount_screwhead_h+min_z_shell,ls_z*2); 100 body_h = max(protrusion_h+bore_l,mount_screw_l-mount_depth+mount_screwhead_h+min_z_shell,ls_z*2);
101 echo("mount depth",mount_depth); 101 echo("mount depth",mount_depth);
102 102
103 module teardrop(r,d,h,center=false,angle=45) { 103 module teardrop(r,d,h,center=false,angle=45) {
104 dd = d ? d : (2*r); 104 dd = d ? d : (2*r);
105 $fn = dd*fnd; 105 $fn = dd*fnd;
106 cylinder(d=dd,h=h,center=center); 106 cylinder(d=dd,h=h,center=center);
107 if(angle>0) translate([0,0,center?-h/2:0]) 107 if(angle>0) translate([0,0,center?-h/2:0])
108 rotate([0,0,angle]) 108 rotate([0,0,angle])
@@ -214,84 +214,60 @@ module the_extruder(
214 214
215 // lever end 215 // lever end
216 translate([mount_d/2,0,0]) rotate([0,90,0]) { 216 translate([mount_d/2,0,0]) rotate([0,90,0]) {
217 translate([0,-longwing,lsd/2]) finger_indent(d=lever_thickness-1,r=15); 217 translate([0,-longwing,lsd/2]) finger_indent(d=lever_thickness-1,r=15);
218 translate([0,-longwing,0]) 218 translate([0,-longwing,0])
219 mirror([0,0,1]) 219 mirror([0,0,1])
220 difference() { 220 difference() {
221 cylinder(d=spring_d+spring_d_clearance,h=lsd,$fn=fnd*(spring_d+spring_d_clearance)); 221 cylinder(d=spring_d+spring_d_clearance,h=lsd,$fn=fnd*(spring_d+spring_d_clearance));
222 sphere(d=spring_d*3/4,$fn=fnd*spring_d*3/4); 222 sphere(d=spring_d*3/4,$fn=fnd*spring_d*3/4);
223 } 223 }
224 }//rotate-translate 224 }//rotate-translate
225 }//difference 225 }//difference
226 // bridging patch 226 // bridging patch
227 if(bridges) place_idler() 227 if(bridges) place_idler()
228 translate([0,0,lever_thickness/2-mount_screwhead_h]) 228 translate([0,0,lever_thickness/2-mount_screwhead_h])
229 mirror([0,0,1]) 229 mirror([0,0,1])
230 cylinder(d=mount_screwhead_d,h=layer_height); 230 cylinder(d=mount_screwhead_d,h=layer_height);
231 }//translate 231 }//translate
232 }//lever module 232 }//lever module
233 233
234 module body() { 234 module body() {
235 difference() { 235 difference() {
236 union() { 236 union() {
237 cylinder(d=gearbox_d,h=body_h,$fn=fnd*gearbox_d); 237 cylinder(d=gearbox_d,h=body_h,$fn=fnd*gearbox_d);
238 translate([-gearbox_d/2,0,0]) difference() { 238 // spring tensioner part
239 union() { 239 translate([-gearbox_d/2,0,0]) hull() {
240 hull() { 240 translate([0,-longwing,ls_z])
241 translate([0,-longwing,ls_z]) 241 rotate([0,90,0])
242 rotate([0,90,0]) 242 cylinder(d=lever_thickness,h=fsw,$fn=fnd*lever_thickness);
243 cylinder(d=lever_thickness,h=fsw,$fn=fnd*lever_thickness); 243 hh=body_h-ls_z;
244 hh=body_h-ls_z; 244 translate([0,0,ls_z])
245 translate([0,0,ls_z]) 245 mirror([0,1,0]) cube(size=[fsw,longwing+(st_thinshell+st_split_w_tolerance)/2+st_thickshell,body_h-ls_z]);
246 mirror([0,1,0]) cube(size=[fsw,longwing+(st_thinshell+st_split_w_tolerance)/2+st_thickshell,body_h-ls_z]); 246 hhh=ls_z;
247 hhh=ls_z; 247 translate([0,0,0])
248 translate([0,0,0]) 248 mirror([0,1,0]) cube(size=[fsw,longwing-hhh+lever_thickness/sqrt(2),hhh+lever_thickness/2]);
249 mirror([0,1,0]) cube(size=[fsw,longwing-hhh+lever_thickness/sqrt(2),hhh+lever_thickness/2]); 249 }//hull translate
250 }
251 }
252 translate([0,-longwing,ls_z]) rotate([0,-90,0]) {
253 if(!tensioner) finger_indent(d=lever_thickness-1,r=15); else {
254 mirror([0,0,1]) {
255 translate([0,0,st_thickshell])
256 hull() for(o=[0,spring_d]) translate([0,-o,0])
257 rotate([0,0,30])
258 cylinder(d=st_nut_d+st_nut_d_tolerance,h=st_nut_h+st_nut_h_tolerance,$fn=6);
259 translate([0,0,-1]) cylinder(d=st_screw_d+st_screw_d_tolerance,h=fsw+2,$fn=fnd*(st_screw_d+st_screw_d_tolerance));
260 bigd = spring_d+spring_d_clearance;
261 hf = (bigd-st_screw_d-st_screw_d_tolerance)/2;
262 translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell-epsilon]) {
263 cylinder(d1=st_screw_d+st_screw_d_tolerance,d2=bigd,
264 h=hf+epsilon, $fn=fnd*bigd);
265 translate([0,-(st_thinshell+st_split_w_tolerance)/2,0])
266 cube(size=[body_h-ls_z+1,st_thinshell+st_split_w_tolerance,fsw+1]);
267 }
268 translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell+hf-epsilon])
269 cylinder(d=bigd,h=fsw+1,$fn=fnd*bigd);
270 }
271 }
272 }
273 } // translate
274 250
275 // pushfit bracket 251 // pushfit bracket
276 translate([0,0,filament_elevation]) 252 translate([0,0,filament_elevation])
277 rotate([0,0,45]) translate([pulley_d/2+filament_offset,0,0]) 253 rotate([0,0,45]) translate([pulley_d/2+filament_offset,0,0])
278 rotate([-90,0,0]) 254 rotate([-90,0,0])
279 translate([0,0,mount_d/sqrt(2)/2+mount_screw_d-gearbox_d/2/*TODO:*/]) { 255 translate([0,0,mount_d/sqrt(2)/2+mount_screw_d-gearbox_d/2/*TODO:*/]) {
280 pfbl = pf_h(pf)+gearbox_d/2; //TODO: 256 pfbl = pf_h(pf)+gearbox_d/2; //TODO:
281 if(pf_smooth) { 257 if(pf_smooth) {
282 pfbd = pf_d(pf)+2*pf_shell; 258 pfbd = pf_d(pf)+2*pf_shell;
283 hull() { 259 hull() {
284 cylinder(d=pfbd,h=pfbl,$fn=pfbd*fnd); 260 cylinder(d=pfbd,h=pfbl,$fn=pfbd*fnd);
285 translate([-epsilon/2,0,0]) { 261 translate([-epsilon/2,0,0]) {
286 cube(size=[epsilon,filament_elevation,pfbl-filament_elevation+pfbd/2]); 262 cube(size=[epsilon,filament_elevation,pfbl-filament_elevation+pfbd/2]);
287 mirror([0,1,0]) 263 mirror([0,1,0])
288 cube(size=[epsilon,body_h-filament_elevation,pfbl-body_h+filament_elevation+pfbd/2]); 264 cube(size=[epsilon,body_h-filament_elevation,pfbl-body_h+filament_elevation+pfbd/2]);
289 }//translate 265 }//translate
290 }//hull 266 }//hull
291 }else{ 267 }else{
292 pfb2a = pf_d(pf)+2*pf_shell; pfba = pfb2a/2; 268 pfb2a = pf_d(pf)+2*pf_shell; pfba = pfb2a/2;
293 pfbd = pfb2a/cos(30); 269 pfbd = pfb2a/cos(30);
294 pfbs = pfb2a*tan(30); 270 pfbs = pfb2a*tan(30);
295 cylinder(d=pfbd,h=pfbl,$fn=6); 271 cylinder(d=pfbd,h=pfbl,$fn=6);
296 translate([-pfbs/2,0,0]) { 272 translate([-pfbs/2,0,0]) {
297 hull() { 273 hull() {
@@ -365,48 +341,71 @@ module the_extruder(
365 pulley_d/2+filament_offset- 341 pulley_d/2+filament_offset-
366 (pf_d(pf)+2*pf_shell)/2/cos(30) 342 (pf_d(pf)+2*pf_shell)/2/cos(30)
367 ) 343 )
368 ); 344 );
369 a0 = -135 + ( (a0_>0) ? a0_ : 180+a0_ ); 345 a0 = -135 + ( (a0_>0) ? a0_ : 180+a0_ );
370 a1 = atan((longwing-lever_thickness/2)/(gearbox_d/2)); 346 a1 = atan((longwing-lever_thickness/2)/(gearbox_d/2));
371 translate([0,0,ls_z]) difference() { 347 translate([0,0,ls_z]) difference() {
372 rotate([0,0,-180+a0]) 348 rotate([0,0,-180+a0])
373 rotate_extrude(angle=a1-a0) 349 rotate_extrude(angle=a1-a0)
374 translate([0,-ls_h/2]) 350 translate([0,-ls_h/2])
375 square([sqrt(pow(gearbox_d/2,2)+pow(longwing-lever_thickness/2,2))+1, 351 square([sqrt(pow(gearbox_d/2,2)+pow(longwing-lever_thickness/2,2))+1,
376 ls_h]); 352 ls_h]);
377 translate([-mount_d/2,0,0]) 353 translate([-mount_d/2,0,0])
378 cylinder(d=gearbox_d-mount_d,h=ls_h+2,center=true,$fn=fnd*(gearbox_d-mount_d)); 354 cylinder(d=gearbox_d-mount_d,h=ls_h+2,center=true,$fn=fnd*(gearbox_d-mount_d));
379 }//difference translate 355 }//difference translate
380 356
381 //translate([-mount_d/2,-longwing,filament_elevation]) 357 //translate([-mount_d/2,-longwing,filament_elevation])
382 if(!tensioner) /* XXX: this seems to be bullshit, but it's so old, that it's historical bullshit */ 358 if(!tensioner) /* XXX: this seems to be bullshit, but it's so old, that it's historical bullshit */
383 translate([mount_d/2,-longwing,filament_elevation]) 359 translate([mount_d/2,-longwing,filament_elevation])
384 rotate([0,-90,0]) difference() { 360 rotate([0,-90,0]) difference() {
385 cylinder(d=spring_d+spring_d_clearance,h=spring_lc+spring_dl,$fn=fnd*(spring_d+spring_d_clearance)); 361 cylinder(d=spring_d+spring_d_clearance,h=spring_lc+spring_dl,$fn=fnd*(spring_d+spring_d_clearance));
386 translate([0,0,spring_lc+spring_dl]) sphere(d=spring_d*3/4,$fn=fnd*spring_d*3/4); 362 translate([0,0,spring_lc+spring_dl]) sphere(d=spring_d*3/4,$fn=fnd*spring_d*3/4);
387 } 363 }
388 364
365 // spring tensioner
366 translate([-gearbox_d/2,-longwing,ls_z]) rotate([0,-90,0]) {
367 if(!tensioner) finger_indent(d=lever_thickness-1,r=15); else {
368 mirror([0,0,1]) {
369 translate([0,0,st_thickshell])
370 hull() for(o=[0,spring_d]) translate([0,-o,0])
371 rotate([0,0,30])
372 cylinder(d=st_nut_d+st_nut_d_tolerance,h=st_nut_h+st_nut_h_tolerance,$fn=6);
373 translate([0,0,-1]) cylinder(d=st_screw_d+st_screw_d_tolerance,h=fsw+2,$fn=fnd*(st_screw_d+st_screw_d_tolerance));
374 bigd = spring_d+spring_d_clearance;
375 hf = (bigd-st_screw_d-st_screw_d_tolerance)/2;
376 translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell-epsilon]) {
377 cylinder(d1=st_screw_d+st_screw_d_tolerance,d2=bigd,
378 h=hf+epsilon, $fn=fnd*bigd);
379 translate([0,-(st_thinshell+st_split_w_tolerance)/2,0])
380 cube(size=[body_h-ls_z+1,st_thinshell+st_split_w_tolerance,fsw+1]);
381 }
382 translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell+hf-epsilon])
383 cylinder(d=bigd,h=fsw+1,$fn=fnd*bigd);
384 }
385 }
386 }
387
389 }//difference 388 }//difference
390 389
391 if(supports) intersection() { 390 if(supports) intersection() {
392 difference() { 391 difference() {
393 translate([0,0,ls_z-ls_h/2-epsilon]) 392 translate([0,0,ls_z-ls_h/2-epsilon])
394 cylinder(d=gearbox_d,h=ls_h+2*epsilon,$fn=fnd*gearbox_d); 393 cylinder(d=gearbox_d,h=ls_h+2*epsilon,$fn=fnd*gearbox_d);
395 cylinder(d=pulley_d+pulley_d_clearance,h=body_h+1,$fn=fnd*(pulley_d+pulley_d_clearance)); 394 cylinder(d=pulley_d+pulley_d_clearance,h=body_h+1,$fn=fnd*(pulley_d+pulley_d_clearance));
396 } 395 }
397 // supports 396 // supports
398 // TODO: hardcoded stuff below… 397 // TODO: hardcoded stuff below…
399 if(false) { // parallel 398 if(false) { // parallel
400 for(y=[-gearbox_d:4:gearbox_d]) 399 for(y=[-gearbox_d:4:gearbox_d])
401 translate([0,y-extrusion_width/2,0]) 400 translate([0,y-extrusion_width/2,0])
402 cube(size=[gearbox_d,extrusion_width,body_h]); 401 cube(size=[gearbox_d,extrusion_width,body_h]);
403 }else{ // radial 402 }else{ // radial
404 for(zr=[-65:(65+50)/7:50]) 403 for(zr=[-65:(65+50)/7:50])
405 rotate([0,0,zr]) translate([0,-extrusion_width/2,0]) 404 rotate([0,0,zr]) translate([0,-extrusion_width/2,0])
406 cube(size=[gearbox_d,extrusion_width,body_h]); 405 cube(size=[gearbox_d,extrusion_width,body_h]);
407 } 406 }
408 } 407 }
409 408
410 }//body module 409 }//body module
411 410
412 module springpad() { 411 module springpad() {