summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--another.scad21
1 files changed, 15 insertions, 6 deletions
diff --git a/another.scad b/another.scad
index a25e047..fd73a61 100644
--- a/another.scad
+++ b/another.scad
@@ -298,212 +298,221 @@ module the_extruder(
298 pushfit(pf); 298 pushfit(pf);
299 mirror([0,0,1]) { 299 mirror([0,0,1]) {
300 fh = 1.5* (filament_guide_d-filament_path_d)/2; 300 fh = 1.5* (filament_guide_d-filament_path_d)/2;
301 fo = pf_offset -filament_path_d /*(idler_d+idler_clearance)/2*/-fh; 301 fo = pf_offset -filament_path_d /*(idler_d+idler_clearance)/2*/-fh;
302 translate([0,0,-1]) teardrop(d=filament_guide_d,h=fo/2,angle=225); 302 translate([0,0,-1]) teardrop(d=filament_guide_d,h=fo/2,angle=225);
303 translate([0,0,-1]) teardrop(d=filament_path_d,h=gearbox_d/2+1,angle=-225); 303 translate([0,0,-1]) teardrop(d=filament_path_d,h=gearbox_d/2+1,angle=-225);
304 translate([0,0,fo+epsilon]) 304 translate([0,0,fo+epsilon])
305 cylinder(d1=filament_path_d,d2=filament_guide_d,h=fh,$fn=fnd*filament_guide_d); 305 cylinder(d1=filament_path_d,d2=filament_guide_d,h=fh,$fn=fnd*filament_guide_d);
306 }//mirror 306 }//mirror
307 }//rotate translate rotate translate rotate translate 307 }//rotate translate rotate translate rotate translate
308 // pulley 308 // pulley
309 cylinder(d=pulley_d+pulley_small_d_clearance,h=body_h+1,$fn=fnd*(pulley_d+pulley_d_clearance)); 309 cylinder(d=pulley_d+pulley_small_d_clearance,h=body_h+1,$fn=fnd*(pulley_d+pulley_d_clearance));
310 cylinder(d=pulley_d+pulley_d_clearance,ls_z-max(idler_h,filament_guide_d)/2,$fn=fnd*(pulley_d+pulley_d_clearance)); 310 cylinder(d=pulley_d+pulley_d_clearance,ls_z-max(idler_h,filament_guide_d)/2,$fn=fnd*(pulley_d+pulley_d_clearance));
311 311
312 translate([0,0,ls_z-ls_h/2]) { 312 translate([0,0,ls_z-ls_h/2]) {
313 // idler travel 313 // idler travel
314 translate([mount_d/2,0,0]) 314 translate([mount_d/2,0,0])
315 rotate([0,0,45]) 315 rotate([0,0,45])
316 rotate_extrude(angle=90,$fn=fnr*(shortwing+(idler_d+idler_clearance)/2)) 316 rotate_extrude(angle=90,$fn=fnr*(shortwing+(idler_d+idler_clearance)/2))
317 square([shortwing+(idler_d+idler_clearance)/2,ls_h]); 317 square([shortwing+(idler_d+idler_clearance)/2,ls_h]);
318 // idler itself 318 // idler itself
319 place_idler() 319 place_idler()
320 cylinder(d=idler_d+idler_clearance,h=ls_h,$fn=fnd*(idler_d+idler_clearance)); 320 cylinder(d=idler_d+idler_clearance,h=ls_h,$fn=fnd*(idler_d+idler_clearance));
321 // lever space 321 // lever space
322 rotate([0,0,45]) 322 rotate([0,0,45])
323 rotate_extrude(angle=-135+max(atan(2*fsw/gearbox_d-1),atan(gearbox_d/mount_d-1))) 323 rotate_extrude(angle=-135+max(atan(2*fsw/gearbox_d-1),atan(gearbox_d/mount_d-1)))
324 square([gearbox_d/2+1,ls_h]); 324 square([gearbox_d/2+1,ls_h]);
325 } 325 }
326 326
327 // back side cutout 327 // back side cutout
328 // XXX: this is somewhat ugly and potentially bugged, 328 // XXX: this is somewhat ugly and potentially bugged,
329 // but I want to sleep. 329 // but I want to sleep.
330 a0_ = atan( 330 a0_ = atan(
331 (pf_offset+pf_h(pf)+gearbox_d/2) 331 (pf_offset+pf_h(pf)+gearbox_d/2)
332 / 332 /
333 ( 333 (
334 pulley_d/2+filament_offset- 334 pulley_d/2+filament_offset-
335 (pf_d(pf)+2*pf_shell)/2/cos(30) 335 (pf_d(pf)+2*pf_shell)/2/cos(30)
336 ) 336 )
337 ); 337 );
338 a0 = -135 + ( (a0_>0) ? a0_ : 180+a0_ ); 338 a0 = -135 + ( (a0_>0) ? a0_ : 180+a0_ );
339 a1 = atan((longwing-lever_thickness/2)/(gearbox_d/2)); 339 a1 = atan((longwing-lever_thickness/2)/(gearbox_d/2));
340 translate([0,0,ls_z]) difference() { 340 translate([0,0,ls_z]) difference() {
341 rotate([0,0,-180+a0]) 341 rotate([0,0,-180+a0])
342 rotate_extrude(angle=a1-a0) 342 rotate_extrude(angle=a1-a0)
343 translate([0,-ls_h/2]) 343 translate([0,-ls_h/2])
344 square([sqrt(pow(gearbox_d/2,2)+pow(longwing-lever_thickness/2,2))+1, 344 square([sqrt(pow(gearbox_d/2,2)+pow(longwing-lever_thickness/2,2))+1,
345 ls_h]); 345 ls_h]);
346 translate([-mount_d/2,0,0]) 346 translate([-mount_d/2,0,0])
347 cylinder(d=gearbox_d-mount_d,h=ls_h+2,center=true,$fn=fnd*(gearbox_d-mount_d)); 347 cylinder(d=gearbox_d-mount_d,h=ls_h+2,center=true,$fn=fnd*(gearbox_d-mount_d));
348 }//difference translate 348 }//difference translate
349 349
350 // spring tensioner 350 // spring tensioner
351 translate([-gearbox_d/2,-longwing,ls_z]) rotate([0,-90,0]) { 351 translate([-gearbox_d/2,-longwing,ls_z]) rotate([0,-90,0]) {
352 mirror([0,0,1]) { 352 mirror([0,0,1]) {
353 translate([0,0,st_thickshell]) 353 translate([0,0,st_thickshell])
354 hull() for(o=[0,spring_d]) translate([0,-o,0]) 354 hull() for(o=[0,spring_d]) translate([0,-o,0])
355 rotate([0,0,30]) 355 rotate([0,0,30])
356 cylinder(d=st_nut_d+st_nut_d_tolerance,h=st_nut_h+st_nut_h_tolerance,$fn=6); 356 cylinder(d=st_nut_d+st_nut_d_tolerance,h=st_nut_h+st_nut_h_tolerance,$fn=6);
357 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)); 357 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));
358 bigd = spring_d+spring_d_clearance; 358 bigd = spring_d+spring_d_clearance;
359 hf = (bigd-st_screw_d-st_screw_d_tolerance)/2; 359 hf = (bigd-st_screw_d-st_screw_d_tolerance)/2;
360 translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell-epsilon]) { 360 translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell-epsilon]) {
361 cylinder(d1=st_screw_d+st_screw_d_tolerance,d2=bigd, 361 cylinder(d1=st_screw_d+st_screw_d_tolerance,d2=bigd,
362 h=hf+epsilon, $fn=fnd*bigd); 362 h=hf+epsilon, $fn=fnd*bigd);
363 translate([0,-(st_split_w+st_split_w_tolerance)/2,0]) hull() { 363 translate([0,-(st_split_w+st_split_w_tolerance)/2,0]) hull() {
364 cube(size=[body_h-ls_z-sp_ch-st_split_w_tolerance,st_split_w+st_split_w_tolerance,fsw+1]); 364 cube(size=[body_h-ls_z-sp_ch-st_split_w_tolerance,st_split_w+st_split_w_tolerance,fsw+1]);
365 translate([0,0,sp_ch+st_split_w_tolerance+1]) 365 translate([0,0,sp_ch+st_split_w_tolerance+1])
366 cube(size=[body_h-ls_z+1,st_split_w+st_split_w_tolerance,fsw+1]); 366 cube(size=[body_h-ls_z+1,st_split_w+st_split_w_tolerance,fsw+1]);
367 } 367 }
368 }//translate 368 }//translate
369 translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell+hf-epsilon]) 369 translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell+hf-epsilon])
370 cylinder(d=bigd,h=fsw+1,$fn=fnd*bigd); 370 cylinder(d=bigd,h=fsw+1,$fn=fnd*bigd);
371 }//mirror 371 }//mirror
372 }//translate 372 }//translate
373 373
374 // label 374 // label
375 body_label(); 375 body_label();
376 376
377 }//difference 377 }//difference
378 378
379 }//body module 379 }//body module
380 module body_label() { 380 module body_label() {
381 if(body_label) { 381 if(body_label) {
382 label=body_label; 382 label=body_label;
383 label_thickness=body_label_thickness; 383 label_thickness=body_label_thickness;
384 label_len = len(label); 384 label_len = len(label);
385 labelspace = [gearbox_d/2-mount_screwhead_d/2-min_xy_shell,longwing-(mount_screwhead_d-st_split_w-st_split_w_tolerance)/2-2*min_xy_shell]; 385 labelspace = [gearbox_d/2-mount_screwhead_d/2-min_xy_shell,longwing-(mount_screwhead_d-st_split_w-st_split_w_tolerance)/2-2*min_xy_shell];
386 translate([0,0,body_h-label_thickness]) 386 translate([0,0,body_h-label_thickness])
387 linear_extrude(height=label_thickness+epsilon,convexity=64) 387 linear_extrude(height=label_thickness+epsilon,convexity=64)
388 translate([-mount_screwhead_d/2-min_xy_shell-labelspace.x/2,-longwing+(st_split_w+st_split_w_tolerance)/2+min_xy_shell+labelspace.y/2]) 388 translate([-mount_screwhead_d/2-min_xy_shell-labelspace.x/2,-longwing+(st_split_w+st_split_w_tolerance)/2+min_xy_shell+labelspace.y/2])
389 mirror([left?0:1,0]) 389 mirror([left?0:1,0])
390 text(text=label,size=labelspace.x/label_len,halign="center",valign="center",font="Arial Black"); 390 text(text=label,size=labelspace.x/label_len,halign="center",valign="center",font="Arial Black");
391 }else sphere(d=epsilon); // to avoid makefile breakage 391 }else sphere(d=epsilon); // to avoid makefile breakage
392 } 392 }
393 393
394 st_bump = 4*extrusion_width;
395 st_bump_tip = 2*extrusion_width;
394 module springpad() { 396 module springpad() {
395 smalld=st_screw_d+st_screw_d_tolerance+min_xy_shell; 397 smalld=st_screw_d+st_screw_d_tolerance+min_xy_shell;
396 bigd = spring_d+spring_d_clearance/2; 398 bigd = spring_d+spring_d_clearance/2;
397 hf = (bigd-smalld)/2; 399 hf = (bigd-smalld)/2;
398 h = max(hf*2,fsw-st_screw_l+hf); 400 h = max(hf*3,fsw-st_screw_l+hf);
399 translate([-gearbox_d/2+fsw-h,-longwing,filament_elevation]) 401 translate([-gearbox_d/2+fsw-h,-longwing,filament_elevation])
400 rotate([0,90,0]) difference() { 402 rotate([0,90,0]) difference() {
401 union() { 403 union() {
402 cylinder(d1=smalld,d2=bigd,h=hf,$fn=fnd*bigd); 404 cylinder(d1=smalld,d2=bigd,h=hf,$fn=fnd*bigd);
403 translate([0,0,hf-epsilon]) 405 translate([0,0,hf-epsilon])
404 cylinder(d=bigd,h=h-hf,$fn=fnd*bigd); 406 cylinder(d=bigd,h=h-hf,$fn=fnd*bigd);
405 translate([0,0,h]) 407 translate([0,0,h])
406 sphere(d=spring_d*3/4,$fn=fnd*spring_d*3/4); 408 sphere(d=spring_d*3/4,$fn=fnd*spring_d*3/4);
407 l = body_h-ls_z; 409 l = body_h-ls_z;
408 w = sp_ch; 410 w = sp_ch;
409 hull() translate([0,-st_split_w/2,0]) mirror([1,0,0]) { 411 translate([0,-st_split_w/2,0]) mirror([1,0,0]) {
410 translate([0,0,w]) 412 hull() {
411 cube(size=[l,st_split_w,w]); 413 translate([0,0,w+st_bump])
412 cube(size=[l-w,st_split_w,2*w]); 414 cube(size=[l+st_bump,st_split_w,w]);
415 cube(size=[l-w,st_split_w,2*w]);
416 }
417 translate([l,0,w+st_bump]) hull() {
418 cube(size=[st_split_w,st_split_w,st_bump]);
419 translate([0,-st_bump+st_bump_tip,st_bump]) mirror([0,0,1])
420 cube(size=[st_split_w,st_split_w+2*(st_bump-st_bump_tip),st_bump_tip]);
421 }
413 } 422 }
414 } 423 }
415 translate([0,0,-epsilon]) 424 translate([0,0,-epsilon])
416 cylinder(d=st_screw_d+st_screw_d_tolerance, 425 cylinder(d=st_screw_d+st_screw_d_tolerance,
417 h=min(st_screw_l,fsw-hf)-fsw+h+2*epsilon,$fn=fnd*(st_screw_d+st_screw_d_tolerance)); 426 h=min(st_screw_l,fsw-hf)-fsw+h+2*epsilon,$fn=fnd*(st_screw_d+st_screw_d_tolerance));
418 } 427 }
419 } 428 }
420 429
421 module knob() { 430 module knob() {
422 ch = knob_indent_d/2; 431 ch = knob_indent_d/2;
423 knob_bore_l = body_h-protrusion_h-pulley_elevation-pulley_h-knob_v_clearance; 432 knob_bore_l = body_h-protrusion_h-pulley_elevation-pulley_h-knob_v_clearance;
424 translate([0,0,body_h+epsilon]) { 433 translate([0,0,body_h+epsilon]) {
425 mirror([0,0,1]) translate([0,0,-epsilon]) { 434 mirror([0,0,1]) translate([0,0,-epsilon]) {
426 difference() { 435 difference() {
427 cylinder(d=pulley_d,h=knob_bore_l,$fn=fnd*pulley_d); 436 cylinder(d=pulley_d,h=knob_bore_l,$fn=fnd*pulley_d);
428 translate([0,0,-1]) difference() { 437 translate([0,0,-1]) difference() {
429 cylinder(d=bore_d+knob_bore_d_tolerance,h=knob_bore_l+2); 438 cylinder(d=bore_d+knob_bore_d_tolerance,h=knob_bore_l+2);
430 translate([-bore_d/2-1,bore_dd-bore_d/2+knob_bore_d_tolerance/2,-1]) 439 translate([-bore_d/2-1,bore_dd-bore_d/2+knob_bore_d_tolerance/2,-1])
431 cube([bore_d+2,bore_d/2,knob_bore_l+4]); 440 cube([bore_d+2,bore_d/2,knob_bore_l+4]);
432 } 441 }
433 } 442 }
434 } 443 }
435 difference() { 444 difference() {
436 hull() { 445 hull() {
437 cylinder(d=gearbox_d-2*ch,h=knob_h,$fn=fnd*gearbox_d); 446 cylinder(d=gearbox_d-2*ch,h=knob_h,$fn=fnd*gearbox_d);
438 translate([0,0,ch]) 447 translate([0,0,ch])
439 cylinder(d=gearbox_d,h=knob_h-2*ch,$fn=fnd*gearbox_d); 448 cylinder(d=gearbox_d,h=knob_h-2*ch,$fn=fnd*gearbox_d);
440 } 449 }
441 for(a=[0:360/knob_indents:359]) rotate([0,0,a]) 450 for(a=[0:360/knob_indents:359]) rotate([0,0,a])
442 translate([0,gearbox_d/2,-1]) 451 translate([0,gearbox_d/2,-1])
443 cylinder(d=knob_indent_d,h=knob_h+2,$fn=fnd*knob_indent_d); 452 cylinder(d=knob_indent_d,h=knob_h+2,$fn=fnd*knob_indent_d);
444 translate([0,0,-body_h-epsilon]) knob_label(); 453 translate([0,0,-body_h-epsilon]) knob_label();
445 } 454 }
446 } 455 }
447 }//knob module 456 }//knob module
448 module knob_label() { 457 module knob_label() {
449 if(knob_label) { 458 if(knob_label) {
450 ll = len(knob_label); 459 ll = len(knob_label);
451 lsl = gearbox_d-knob_indent_d; 460 lsl = gearbox_d-knob_indent_d;
452 ts = knob_label_size?knob_label_size:min(lsl/ll,gearbox_d/4); 461 ts = knob_label_size?knob_label_size:min(lsl/ll,gearbox_d/4);
453 translate([0,0,body_h+epsilon+knob_h-knob_label_thickness]) 462 translate([0,0,body_h+epsilon+knob_h-knob_label_thickness])
454 linear_extrude(height=knob_label_thickness+epsilon,convexity=64) 463 linear_extrude(height=knob_label_thickness+epsilon,convexity=64)
455 mirror([left?0:1,0]) 464 mirror([left?0:1,0])
456 text(text=knob_label,size=ts,halign="center",valign="center",font="Arial Black"); 465 text(text=knob_label,size=ts,halign="center",valign="center",font="Arial Black");
457 }else sphere(d=epsilon); // to avoid makefile breakage 466 }else sphere(d=epsilon); // to avoid makefile breakage
458 } 467 }
459 468
460 module debug() { 469 module debug() {
461 difference() { 470 difference() {
462 children(); 471 children();
463 if(debug) { 472 if(debug) {
464 // spring tensioner debug cutout 473 // spring tensioner debug cutout
465 translate([-gearbox_d/2,-longwing,ls_z]) rotate([0,-90,0]) 474 translate([-gearbox_d/2,-longwing,ls_z]) rotate([0,-90,0])
466 translate([0,-lever_thickness/2-1,-gearbox_d-1]) 475 translate([0,-lever_thickness/2-1,-gearbox_d-1])
467 cube(size=[body_h/2+1,lever_thickness/2+1,gearbox_d+2]); 476 cube(size=[body_h-ls_z+st_bump+1,lever_thickness/2+1,gearbox_d+2]);
468 // lever axis debug cutout 477 // lever axis debug cutout
469 translate([mount_d/2,0,-1]) 478 translate([mount_d/2,0,-1])
470 rotate([0,0,-45]) 479 rotate([0,0,-45])
471 cube(size=[gearbox_d-mount_d,gearbox_d-mount_d,body_h+knob_h+2]); 480 cube(size=[gearbox_d-mount_d,gearbox_d-mount_d,body_h+knob_h+2]);
472 // idler debug cutout 481 // idler debug cutout
473 translate([0,0,ls_z]) 482 translate([0,0,ls_z])
474 place_idler() 483 place_idler()
475 rotate([0,0,-45]) 484 rotate([0,0,-45])
476 translate([0,0,-lever_thickness/2-epsilon]) 485 translate([0,0,-lever_thickness/2-epsilon])
477 cube(size=[lsd*sqrt(2)/2+1,lsd*sqrt(2)/2+1, 486 cube(size=[lsd*sqrt(2)/2+1,lsd*sqrt(2)/2+1,
478 lever_thickness+2*epsilon]); 487 lever_thickness+2*epsilon]);
479 // pushfit debug cutout 488 // pushfit debug cutout
480 place_idler() 489 place_idler()
481 translate([-idler_d/2+filament_offset,0,ls_z]) 490 translate([-idler_d/2+filament_offset,0,ls_z])
482 cube(size=[gearbox_d/2,gearbox_d/2+pf_h(pf),body_h-ls_z+knob_h+1]); 491 cube(size=[gearbox_d/2,gearbox_d/2+pf_h(pf),body_h-ls_z+knob_h+1]);
483 }//if debug 492 }//if debug
484 }//difference 493 }//difference
485 } 494 }
486 495
487 mirrorleft() 496 mirrorleft()
488 debug() 497 debug()
489 if(what=="lever") color("green",0.7) lever(); 498 if(what=="lever") color("green",0.7) lever();
490 else if(what=="body") color("yellow",0.7) body(); 499 else if(what=="body") color("yellow",0.7) body();
491 else if(what=="body.label") color("brown",0.7) body_label(); 500 else if(what=="body.label") color("brown",0.7) body_label();
492 else if(what=="knob") color("red",0.7) knob(); 501 else if(what=="knob") color("red",0.7) knob();
493 else if(what=="knob.label") color("brown",0.7) knob_label(); 502 else if(what=="knob.label") color("brown",0.7) knob_label();
494 else if(what=="springpad") color("blue",0.7) springpad(); 503 else if(what=="springpad") color("blue",0.7) springpad();
495 else if(what=="both") { 504 else if(what=="both") {
496 color("green",0.7) lever(); 505 color("green",0.7) lever();
497 color("yellow",0.7) body(); 506 color("yellow",0.7) body();
498 color("brown",0.7) body_label(); 507 color("brown",0.7) body_label();
499 }else{ 508 }else{
500 color("green",0.7) lever(); 509 color("green",0.7) lever();
501 color("yellow",0.7) body(); 510 color("yellow",0.7) body();
502 color("brown",0.7) body_label(); 511 color("brown",0.7) body_label();
503 color("red",0.7) knob(); 512 color("red",0.7) knob();
504 color("brown",0.7) knob_label(); 513 color("brown",0.7) knob_label();
505 color("blue",0.7) springpad(); 514 color("blue",0.7) springpad();
506 } 515 }
507} 516}
508 517
509the_extruder(what="*",left=false,debug=true); 518the_extruder(what="*",left=false,debug=true);