summaryrefslogtreecommitdiff
path: root/another.scad
Unidiff
Diffstat (limited to 'another.scad') (more/less context) (show whitespace changes)
-rw-r--r--another.scad18
1 files changed, 12 insertions, 6 deletions
diff --git a/another.scad b/another.scad
index f01e765..3955e49 100644
--- a/another.scad
+++ b/another.scad
@@ -316,162 +316,168 @@ module the_extruder(
316 square([gearbox_d/2+1,ls_h]); 316 square([gearbox_d/2+1,ls_h]);
317 } 317 }
318 318
319 // back side cutout 319 // back side cutout
320 // XXX: this is somewhat ugly and potentially bugged, 320 // XXX: this is somewhat ugly and potentially bugged,
321 // but I want to sleep. 321 // but I want to sleep.
322 a0_ = atan( 322 a0_ = atan(
323 (mount_d/sqrt(2)/2+mount_screw_d+pf_h(pf)+gearbox_d/2) 323 (mount_d/sqrt(2)/2+mount_screw_d+pf_h(pf)+gearbox_d/2)
324 / 324 /
325 ( 325 (
326 pulley_d/2+filament_offset- 326 pulley_d/2+filament_offset-
327 (pf_d(pf)+2*pf_shell)/2/cos(30) 327 (pf_d(pf)+2*pf_shell)/2/cos(30)
328 ) 328 )
329 ); 329 );
330 a0 = -135 + ( (a0_>0) ? a0_ : 180+a0_ ); 330 a0 = -135 + ( (a0_>0) ? a0_ : 180+a0_ );
331 a1 = atan((longwing-lever_thickness/2)/(gearbox_d/2)); 331 a1 = atan((longwing-lever_thickness/2)/(gearbox_d/2));
332 translate([0,0,ls_z]) difference() { 332 translate([0,0,ls_z]) difference() {
333 rotate([0,0,-180+a0]) 333 rotate([0,0,-180+a0])
334 rotate_extrude(angle=a1-a0) 334 rotate_extrude(angle=a1-a0)
335 translate([0,-ls_h/2]) 335 translate([0,-ls_h/2])
336 square([sqrt(pow(gearbox_d/2,2)+pow(longwing-lever_thickness/2,2))+1, 336 square([sqrt(pow(gearbox_d/2,2)+pow(longwing-lever_thickness/2,2))+1,
337 ls_h]); 337 ls_h]);
338 translate([-mount_d/2,0,0]) 338 translate([-mount_d/2,0,0])
339 cylinder(d=gearbox_d-mount_d,h=ls_h+2,center=true,$fn=fnd*(gearbox_d-mount_d)); 339 cylinder(d=gearbox_d-mount_d,h=ls_h+2,center=true,$fn=fnd*(gearbox_d-mount_d));
340 }//difference translate 340 }//difference translate
341 341
342 // spring tensioner 342 // spring tensioner
343 translate([-gearbox_d/2,-longwing,ls_z]) rotate([0,-90,0]) { 343 translate([-gearbox_d/2,-longwing,ls_z]) rotate([0,-90,0]) {
344 mirror([0,0,1]) { 344 mirror([0,0,1]) {
345 translate([0,0,st_thickshell]) 345 translate([0,0,st_thickshell])
346 hull() for(o=[0,spring_d]) translate([0,-o,0]) 346 hull() for(o=[0,spring_d]) translate([0,-o,0])
347 rotate([0,0,30]) 347 rotate([0,0,30])
348 cylinder(d=st_nut_d+st_nut_d_tolerance,h=st_nut_h+st_nut_h_tolerance,$fn=6); 348 cylinder(d=st_nut_d+st_nut_d_tolerance,h=st_nut_h+st_nut_h_tolerance,$fn=6);
349 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)); 349 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));
350 bigd = spring_d+spring_d_clearance; 350 bigd = spring_d+spring_d_clearance;
351 hf = (bigd-st_screw_d-st_screw_d_tolerance)/2; 351 hf = (bigd-st_screw_d-st_screw_d_tolerance)/2;
352 translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell-epsilon]) { 352 translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell-epsilon]) {
353 cylinder(d1=st_screw_d+st_screw_d_tolerance,d2=bigd, 353 cylinder(d1=st_screw_d+st_screw_d_tolerance,d2=bigd,
354 h=hf+epsilon, $fn=fnd*bigd); 354 h=hf+epsilon, $fn=fnd*bigd);
355 translate([0,-(st_split_w+st_split_w_tolerance)/2,0]) 355 translate([0,-(st_split_w+st_split_w_tolerance)/2,0])
356 cube(size=[body_h-ls_z+1,st_split_w+st_split_w_tolerance,fsw+1]); 356 cube(size=[body_h-ls_z+1,st_split_w+st_split_w_tolerance,fsw+1]);
357 }//translate 357 }//translate
358 translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell+hf-epsilon]) 358 translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell+hf-epsilon])
359 cylinder(d=bigd,h=fsw+1,$fn=fnd*bigd); 359 cylinder(d=bigd,h=fsw+1,$fn=fnd*bigd);
360 }//mirror 360 }//mirror
361 }//translate 361 }//translate
362 362
363 // label 363 // label
364 if(body_label) let(label=body_label,label_thickness=body_label_thickness) { 364 body_label();
365 label_thickness = 2*layer_height; 365
366 }//difference
367
368 }//body module
369 module body_label() {
370 if(body_label) {
371 label=body_label;
372 label_thickness=body_label_thickness;
366 label_len = len(label); 373 label_len = len(label);
367 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]; 374 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];
368 translate([0,0,body_h-label_thickness]) 375 translate([0,0,body_h-label_thickness])
369 linear_extrude(height=label_thickness+epsilon,convexity=64) 376 linear_extrude(height=label_thickness+epsilon,convexity=64)
370 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]) 377 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])
371 mirror([left?0:1,0]) 378 mirror([left?0:1,0])
372 text(text=label,size=labelspace.x/label_len,halign="center",valign="center",font="Arial Black"); 379 text(text=label,size=labelspace.x/label_len,halign="center",valign="center",font="Arial Black");
373 }//if(body_label) 380 }//if(body_label)
374 381 }
375 }//difference
376
377 }//body module
378 382
379 module springpad() { 383 module springpad() {
380 smalld=st_screw_d+st_screw_d_tolerance+min_xy_shell; 384 smalld=st_screw_d+st_screw_d_tolerance+min_xy_shell;
381 bigd = spring_d+spring_d_clearance/2; 385 bigd = spring_d+spring_d_clearance/2;
382 hf = (bigd-smalld)/2; 386 hf = (bigd-smalld)/2;
383 h = hf*3.5; 387 h = hf*3.5;
384 translate([-gearbox_d/2+st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell+1,-longwing,filament_elevation]) 388 translate([-gearbox_d/2+st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell+1,-longwing,filament_elevation])
385 rotate([0,90,0]) difference() { 389 rotate([0,90,0]) difference() {
386 union() { 390 union() {
387 cylinder(d1=smalld,d2=bigd,h=hf,$fn=fnd*bigd); 391 cylinder(d1=smalld,d2=bigd,h=hf,$fn=fnd*bigd);
388 translate([0,0,hf-epsilon]) 392 translate([0,0,hf-epsilon])
389 cylinder(d=bigd,h=h-hf,$fn=fnd*bigd); 393 cylinder(d=bigd,h=h-hf,$fn=fnd*bigd);
390 translate([0,0,h]) 394 translate([0,0,h])
391 sphere(d=spring_d*3/4,$fn=fnd*spring_d*3/4); 395 sphere(d=spring_d*3/4,$fn=fnd*spring_d*3/4);
392 l = body_h-ls_z; 396 l = body_h-ls_z;
393 w = st_split_w; 397 w = st_split_w;
394 hull() translate([0,-st_split_w/2,0]) mirror([1,0,0]) { 398 hull() translate([0,-st_split_w/2,0]) mirror([1,0,0]) {
395 translate([0,0,w]) 399 translate([0,0,w])
396 cube(size=[l,st_split_w,w]); 400 cube(size=[l,st_split_w,w]);
397 cube(size=[l-w,st_split_w,2*w]); 401 cube(size=[l-w,st_split_w,2*w]);
398 } 402 }
399 } 403 }
400 translate([0,0,-epsilon]) 404 translate([0,0,-epsilon])
401 cylinder(d=st_screw_d+st_screw_d_tolerance,h=2*hf+epsilon,$fn=fnd*(st_screw_d+st_screw_d_tolerance)); 405 cylinder(d=st_screw_d+st_screw_d_tolerance,h=2*hf+epsilon,$fn=fnd*(st_screw_d+st_screw_d_tolerance));
402 } 406 }
403 } 407 }
404 408
405 module knob() { 409 module knob() {
406 ch = knob_indent_d/2; 410 ch = knob_indent_d/2;
407 translate([0,0,body_h+epsilon]) { 411 translate([0,0,body_h+epsilon]) {
408 mirror([0,0,1]) translate([0,0,-epsilon]) { 412 mirror([0,0,1]) translate([0,0,-epsilon]) {
409 difference() { 413 difference() {
410 cylinder(d=pulley_d,h=knob_bore_l,$fn=fnd*pulley_d); 414 cylinder(d=pulley_d,h=knob_bore_l,$fn=fnd*pulley_d);
411 translate([0,0,-1]) difference() { 415 translate([0,0,-1]) difference() {
412 cylinder(d=bore_d+knob_bore_d_tolerance,h=knob_bore_l+2); 416 cylinder(d=bore_d+knob_bore_d_tolerance,h=knob_bore_l+2);
413 translate([-bore_d/2-1,bore_dd-bore_d/2+knob_bore_d_tolerance/2,-1]) 417 translate([-bore_d/2-1,bore_dd-bore_d/2+knob_bore_d_tolerance/2,-1])
414 cube([bore_d+2,bore_d/2,knob_bore_l+4]); 418 cube([bore_d+2,bore_d/2,knob_bore_l+4]);
415 } 419 }
416 } 420 }
417 } 421 }
418 difference() { 422 difference() {
419 union() { 423 union() {
420 cylinder(d1=gearbox_d-2*ch,d2=gearbox_d,h=ch+epsilon,$fn=fnd*gearbox_d); 424 cylinder(d1=gearbox_d-2*ch,d2=gearbox_d,h=ch+epsilon,$fn=fnd*gearbox_d);
421 translate([0,0,ch]) 425 translate([0,0,ch])
422 cylinder(d=gearbox_d,h=knob_h-2*ch+epsilon,$fn=fnd*gearbox_d); 426 cylinder(d=gearbox_d,h=knob_h-2*ch+epsilon,$fn=fnd*gearbox_d);
423 translate([0,0,knob_h-ch]) 427 translate([0,0,knob_h-ch])
424 cylinder(d1=gearbox_d,d2=gearbox_d-2*ch,h=ch,$fn=fnd*gearbox_d); 428 cylinder(d1=gearbox_d,d2=gearbox_d-2*ch,h=ch,$fn=fnd*gearbox_d);
425 } 429 }
426 for(a=[0:360/knob_indents:359]) rotate([0,0,a]) 430 for(a=[0:360/knob_indents:359]) rotate([0,0,a])
427 translate([0,gearbox_d/2,-1]) 431 translate([0,gearbox_d/2,-1])
428 cylinder(d=knob_indent_d,h=knob_h+2,$fn=fnd*knob_indent_d); 432 cylinder(d=knob_indent_d,h=knob_h+2,$fn=fnd*knob_indent_d);
429 } 433 }
430 } 434 }
431 }//knob module 435 }//knob module
432 436
433 module debug() { 437 module debug() {
434 difference() { 438 difference() {
435 children(); 439 children();
436 if(debug) { 440 if(debug) {
437 // spring tensioner debug cutout 441 // spring tensioner debug cutout
438 translate([-gearbox_d/2,-longwing,ls_z]) rotate([0,-90,0]) 442 translate([-gearbox_d/2,-longwing,ls_z]) rotate([0,-90,0])
439 translate([0,-lever_thickness/2-1,-gearbox_d]) 443 translate([0,-lever_thickness/2-1,-gearbox_d])
440 cube(size=[body_h/2+1,lever_thickness/2+1,gearbox_d+2]); 444 cube(size=[body_h/2+1,lever_thickness/2+1,gearbox_d+2]);
441 // lever axis debug cutout 445 // lever axis debug cutout
442 translate([mount_d/2,0,-1]) 446 translate([mount_d/2,0,-1])
443 rotate([0,0,-45]) 447 rotate([0,0,-45])
444 cube(size=[gearbox_d-mount_d,gearbox_d-mount_d,body_h+knob_h+2]); 448 cube(size=[gearbox_d-mount_d,gearbox_d-mount_d,body_h+knob_h+2]);
445 // idler debug cutout 449 // idler debug cutout
446 translate([0,0,ls_z]) 450 translate([0,0,ls_z])
447 place_idler() 451 place_idler()
448 rotate([0,0,-45]) 452 rotate([0,0,-45])
449 translate([0,0,-lever_thickness/2-epsilon]) 453 translate([0,0,-lever_thickness/2-epsilon])
450 cube(size=[lsd*sqrt(2)/2+1,lsd*sqrt(2)/2+1, 454 cube(size=[lsd*sqrt(2)/2+1,lsd*sqrt(2)/2+1,
451 lever_thickness+2*epsilon]); 455 lever_thickness+2*epsilon]);
452 // pushfit debug cutout 456 // pushfit debug cutout
453 place_idler() 457 place_idler()
454 translate([-idler_d/2+filament_offset,0,ls_z]) 458 translate([-idler_d/2+filament_offset,0,ls_z])
455 cube(size=[gearbox_d/2,gearbox_d/2+pf_h(pf),body_h-ls_z+knob_h+1]); 459 cube(size=[gearbox_d/2,gearbox_d/2+pf_h(pf),body_h-ls_z+knob_h+1]);
456 }//if debug 460 }//if debug
457 }//difference 461 }//difference
458 } 462 }
459 463
460 mirrorleft() 464 mirrorleft()
461 debug() 465 debug()
462 if(what=="lever") color("green",0.7) lever(); 466 if(what=="lever") color("green",0.7) lever();
463 else if(what=="body") color("yellow",0.7) body(); 467 else if(what=="body") color("yellow",0.7) body();
468 else if(what=="body.label") color("brown",0.7) body_label();
464 else if(what=="knob") color("red",0.7) knob(); 469 else if(what=="knob") color("red",0.7) knob();
465 else if(what=="springpad") color("blue",0.7) springpad(); 470 else if(what=="springpad") color("blue",0.7) springpad();
466 else if(what=="both") { 471 else if(what=="both") {
467 color("green",0.7) lever(); 472 color("green",0.7) lever();
468 color("yellow",0.7) body(); 473 color("yellow",0.7) body();
474 color("brown",0.7) body_label();
469 }else{ 475 }else{
470 color("green",0.7) lever(); 476 color("green",0.7) lever();
471 color("yellow",0.7) body(); 477 color("yellow",0.7) body();
472 color("red",0.7) knob(); 478 color("red",0.7) knob();
473 color("blue",0.7) springpad(); 479 color("blue",0.7) springpad();
474 } 480 }
475} 481}
476 482
477the_extruder(what="*",left=false,debug=true); 483the_extruder(what="*",left=false,debug=true);