author | Michael Krelin <hacker@klever.net> | 2018-08-26 19:28:39 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2018-08-26 19:28:39 (UTC) |
commit | d6334783daaca35ad796760be3c44fd80af5e5aa (patch) (unidiff) | |
tree | d29411a27de1d799f52cc381871341f79d30b89c | |
parent | d19aafaa5b0def955a82f3952a3dc9e96dbca954 (diff) | |
download | extrudery-d6334783daaca35ad796760be3c44fd80af5e5aa.zip extrudery-d6334783daaca35ad796760be3c44fd80af5e5aa.tar.gz extrudery-d6334783daaca35ad796760be3c44fd80af5e5aa.tar.bz2 |
collapsed transformations a bit
-rw-r--r-- | another.scad | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/another.scad b/another.scad index e6d9ca3..20ac37a 100644 --- a/another.scad +++ b/another.scad | |||
@@ -338,138 +338,136 @@ module the_extruder( | |||
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_thinshell+st_split_w_tolerance)/2,0]) | 363 | translate([0,-(st_thinshell+st_split_w_tolerance)/2,0]) |
364 | cube(size=[body_h-ls_z+1,st_thinshell+st_split_w_tolerance,fsw+1]); | 364 | cube(size=[body_h-ls_z+1,st_thinshell+st_split_w_tolerance,fsw+1]); |
365 | }//translate | 365 | }//translate |
366 | translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell+hf-epsilon]) | 366 | translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell+hf-epsilon]) |
367 | cylinder(d=bigd,h=fsw+1,$fn=fnd*bigd); | 367 | cylinder(d=bigd,h=fsw+1,$fn=fnd*bigd); |
368 | }//mirror | 368 | }//mirror |
369 | }//translate | 369 | }//translate |
370 | 370 | ||
371 | }//difference | 371 | }//difference |
372 | 372 | ||
373 | }//body module | 373 | }//body module |
374 | 374 | ||
375 | module springpad() { | 375 | module springpad() { |
376 | smalld=st_screw_d+st_screw_d_tolerance+min_xy_shell; | 376 | smalld=st_screw_d+st_screw_d_tolerance+min_xy_shell; |
377 | bigd = spring_d+spring_d_clearance/2; | 377 | bigd = spring_d+spring_d_clearance/2; |
378 | hf = (bigd-smalld)/2; | 378 | hf = (bigd-smalld)/2; |
379 | h = hf*3.5; | 379 | h = hf*3.5; |
380 | translate([-gearbox_d/2+st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell+1,-longwing,filament_elevation]) | 380 | translate([-gearbox_d/2+st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell+1,-longwing,filament_elevation]) |
381 | rotate([0,90,0]) difference() { | 381 | rotate([0,90,0]) difference() { |
382 | union() { | 382 | union() { |
383 | cylinder(d1=smalld,d2=bigd,h=hf,$fn=fnd*bigd); | 383 | cylinder(d1=smalld,d2=bigd,h=hf,$fn=fnd*bigd); |
384 | translate([0,0,hf-epsilon]) | 384 | translate([0,0,hf-epsilon]) |
385 | cylinder(d=bigd,h=h-hf,$fn=fnd*bigd); | 385 | cylinder(d=bigd,h=h-hf,$fn=fnd*bigd); |
386 | translate([0,0,h]) | 386 | translate([0,0,h]) |
387 | sphere(d=spring_d*3/4,$fn=fnd*spring_d*3/4); | 387 | sphere(d=spring_d*3/4,$fn=fnd*spring_d*3/4); |
388 | l = body_h-ls_z; | 388 | l = body_h-ls_z; |
389 | w = st_thinshell; | 389 | w = st_thinshell; |
390 | hull() translate([0,-st_thinshell/2,0]) mirror([1,0,0]) { | 390 | hull() translate([0,-st_thinshell/2,0]) mirror([1,0,0]) { |
391 | translate([0,0,w]) | 391 | translate([0,0,w]) |
392 | cube(size=[l,st_thinshell,w]); | 392 | cube(size=[l,st_thinshell,w]); |
393 | cube(size=[l-w,st_thinshell,2*w]); | 393 | cube(size=[l-w,st_thinshell,2*w]); |
394 | } | 394 | } |
395 | } | 395 | } |
396 | translate([0,0,-epsilon]) | 396 | translate([0,0,-epsilon]) |
397 | cylinder(d=st_screw_d+st_screw_d_tolerance,h=2*hf+epsilon,$fn=fnd*(st_screw_d+st_screw_d_tolerance)); | 397 | cylinder(d=st_screw_d+st_screw_d_tolerance,h=2*hf+epsilon,$fn=fnd*(st_screw_d+st_screw_d_tolerance)); |
398 | } | 398 | } |
399 | } | 399 | } |
400 | 400 | ||
401 | module knob() { | 401 | module knob() { |
402 | ch = knob_indent_d/2; | 402 | ch = knob_indent_d/2; |
403 | translate([0,0,body_h+epsilon]) { | 403 | translate([0,0,body_h+epsilon]) { |
404 | mirror([0,0,1]) translate([0,0,-epsilon]) { | 404 | mirror([0,0,1]) translate([0,0,-epsilon]) { |
405 | difference() { | 405 | difference() { |
406 | cylinder(d=pulley_d,h=knob_bore_l,$fn=fnd*pulley_d); | 406 | cylinder(d=pulley_d,h=knob_bore_l,$fn=fnd*pulley_d); |
407 | translate([0,0,-1]) difference() { | 407 | translate([0,0,-1]) difference() { |
408 | cylinder(d=bore_d+knob_bore_d_tolerance,h=knob_bore_l+2); | 408 | cylinder(d=bore_d+knob_bore_d_tolerance,h=knob_bore_l+2); |
409 | translate([-bore_d/2-1,bore_dd-bore_d/2+knob_bore_d_tolerance/2,-1]) | 409 | translate([-bore_d/2-1,bore_dd-bore_d/2+knob_bore_d_tolerance/2,-1]) |
410 | cube([bore_d+2,bore_d/2,knob_bore_l+4]); | 410 | cube([bore_d+2,bore_d/2,knob_bore_l+4]); |
411 | } | 411 | } |
412 | } | 412 | } |
413 | } | 413 | } |
414 | difference() { | 414 | difference() { |
415 | union() { | 415 | union() { |
416 | cylinder(d1=gearbox_d-2*ch,d2=gearbox_d,h=ch+epsilon,$fn=fnd*gearbox_d); | 416 | cylinder(d1=gearbox_d-2*ch,d2=gearbox_d,h=ch+epsilon,$fn=fnd*gearbox_d); |
417 | translate([0,0,ch]) | 417 | translate([0,0,ch]) |
418 | cylinder(d=gearbox_d,h=knob_h-2*ch+epsilon,$fn=fnd*gearbox_d); | 418 | cylinder(d=gearbox_d,h=knob_h-2*ch+epsilon,$fn=fnd*gearbox_d); |
419 | translate([0,0,knob_h-ch]) | 419 | translate([0,0,knob_h-ch]) |
420 | cylinder(d1=gearbox_d,d2=gearbox_d-2*ch,h=ch,$fn=fnd*gearbox_d); | 420 | cylinder(d1=gearbox_d,d2=gearbox_d-2*ch,h=ch,$fn=fnd*gearbox_d); |
421 | } | 421 | } |
422 | for(a=[0:360/knob_indents:359]) rotate([0,0,a]) | 422 | for(a=[0:360/knob_indents:359]) rotate([0,0,a]) |
423 | translate([0,gearbox_d/2,-1]) | 423 | translate([0,gearbox_d/2,-1]) |
424 | cylinder(d=knob_indent_d,h=knob_h+2,$fn=fnd*knob_indent_d); | 424 | cylinder(d=knob_indent_d,h=knob_h+2,$fn=fnd*knob_indent_d); |
425 | } | 425 | } |
426 | } | 426 | } |
427 | }//knob module | 427 | }//knob module |
428 | 428 | ||
429 | module debug() { | 429 | module debug() { |
430 | difference() { | 430 | difference() { |
431 | children(); | 431 | children(); |
432 | if(debug) { | 432 | if(debug) { |
433 | // spring tensioner debug cutout | 433 | // spring tensioner debug cutout |
434 | // TODO: collapse copypasted transformations | 434 | translate([-gearbox_d/2,-longwing,ls_z]) rotate([0,-90,0]) |
435 | translate([-gearbox_d/2,0,0]) | ||
436 | translate([0,-longwing,ls_z]) rotate([0,-90,0]) | ||
437 | translate([0,-lever_thickness/2-1,-gearbox_d]) | 435 | translate([0,-lever_thickness/2-1,-gearbox_d]) |
438 | cube(size=[body_h/2+1,lever_thickness/2+1,gearbox_d+2]); | 436 | cube(size=[body_h/2+1,lever_thickness/2+1,gearbox_d+2]); |
439 | // lever axis debug cutout | 437 | // lever axis debug cutout |
440 | translate([mount_d/2,0,-1]) | 438 | translate([mount_d/2,0,-1]) |
441 | rotate([0,0,-45]) | 439 | rotate([0,0,-45]) |
442 | cube(size=[gearbox_d-mount_d,gearbox_d-mount_d,body_h+knob_h+2]); | 440 | cube(size=[gearbox_d-mount_d,gearbox_d-mount_d,body_h+knob_h+2]); |
443 | // idler debug cutout | 441 | // idler debug cutout |
444 | translate([0,0,ls_z]) | 442 | translate([0,0,ls_z]) |
445 | place_idler() | 443 | place_idler() |
446 | rotate([0,0,-45]) | 444 | rotate([0,0,-45]) |
447 | translate([0,0,-lever_thickness/2-epsilon]) | 445 | translate([0,0,-lever_thickness/2-epsilon]) |
448 | cube(size=[(idler_d+idler_clearance)/2,(idler_d+idler_clearance)/2, | 446 | cube(size=[(idler_d+idler_clearance)/2,(idler_d+idler_clearance)/2, |
449 | lever_thickness+2*epsilon]); | 447 | lever_thickness+2*epsilon]); |
450 | // pushfit debug cutout | 448 | // pushfit debug cutout |
451 | place_idler() | 449 | place_idler() |
452 | translate([-idler_d/2+filament_offset,0,ls_z]) | 450 | translate([-idler_d/2+filament_offset,0,ls_z]) |
453 | cube(size=[gearbox_d/2,gearbox_d/2+pf_h(pf),body_h-ls_z+1]); | 451 | cube(size=[gearbox_d/2,gearbox_d/2+pf_h(pf),body_h-ls_z+1]); |
454 | }//if debug | 452 | }//if debug |
455 | }//difference | 453 | }//difference |
456 | } | 454 | } |
457 | 455 | ||
458 | mirrorleft() | 456 | mirrorleft() |
459 | debug() | 457 | debug() |
460 | if(what=="lever") color("green",0.7) lever(); | 458 | if(what=="lever") color("green",0.7) lever(); |
461 | else if(what=="body") color("yellow",0.7) body(); | 459 | else if(what=="body") color("yellow",0.7) body(); |
462 | else if(what=="knob") color("red",0.7) knob(); | 460 | else if(what=="knob") color("red",0.7) knob(); |
463 | else if(what=="springpad") color("blue",0.7) springpad(); | 461 | else if(what=="springpad") color("blue",0.7) springpad(); |
464 | else if(what=="both") { | 462 | else if(what=="both") { |
465 | color("green",0.7) lever(); | 463 | color("green",0.7) lever(); |
466 | color("yellow",0.7) body(); | 464 | color("yellow",0.7) body(); |
467 | }else{ | 465 | }else{ |
468 | color("green",0.7) lever(); | 466 | color("green",0.7) lever(); |
469 | color("yellow",0.7) body(); | 467 | color("yellow",0.7) body(); |
470 | color("red",0.7) knob(); | 468 | color("red",0.7) knob(); |
471 | color("blue",0.7) springpad(); | 469 | color("blue",0.7) springpad(); |
472 | } | 470 | } |
473 | } | 471 | } |
474 | 472 | ||
475 | the_extruder(what="*",left=false,debug=true); | 473 | the_extruder(what="*",left=false,debug=true); |