summaryrefslogtreecommitdiff
path: root/another.scad
Unidiff
Diffstat (limited to 'another.scad') (more/less context) (ignore whitespace changes)
-rw-r--r--another.scad4
1 files changed, 2 insertions, 2 deletions
diff --git a/another.scad b/another.scad
index 55fda78..b2e6c74 100644
--- a/another.scad
+++ b/another.scad
@@ -36,97 +36,97 @@ module the_extruder(
36 // spring tensioner 36 // spring tensioner
37 st_nut_d = 9, st_nut_h = 4, 37 st_nut_d = 9, st_nut_h = 4,
38 st_screw_d = 5, 38 st_screw_d = 5,
39 st_thickshell = 8*extrusion_width, st_thinshell = 4*extrusion_width, 39 st_thickshell = 8*extrusion_width, st_thinshell = 4*extrusion_width,
40 40
41 // screw it 41 // screw it
42 mount_screw_d = 3.1, mount_screw_l = 20, 42 mount_screw_d = 3.1, mount_screw_l = 20,
43 mount_screwhead_d=6, mount_screwhead_h=3, 43 mount_screwhead_d=6, mount_screwhead_h=3,
44 idler_screw_d = 3, 44 idler_screw_d = 3,
45 idler_screwhead_d=6, idler_screwhead_h=3, 45 idler_screwhead_d=6, idler_screwhead_h=3,
46 46
47 pf = pushfit_embeddest, 47 pf = pushfit_embeddest,
48 pf_shell = max(3*layer_height,3*extrusion_width), 48 pf_shell = max(3*layer_height,3*extrusion_width),
49 pf_smooth = true, 49 pf_smooth = true,
50 50
51 // empty spaces 51 // empty spaces
52 idler_travel = 3, // how far should idler travel when pressed 52 idler_travel = 3, // how far should idler travel when pressed
53 idler_clearance=1, 53 idler_clearance=1,
54 pulley_d_clearance=2, 54 pulley_d_clearance=2,
55 pulley_small_d_clearance=0.5, 55 pulley_small_d_clearance=0.5,
56 lever_v_clearance=.7, // vertical clearance for the lever 56 lever_v_clearance=.7, // vertical clearance for the lever
57 spring_d_clearance=1, 57 spring_d_clearance=1,
58 protrusion_tolerance_h=.5, // horizontal tolerance for the motor protrusion 58 protrusion_tolerance_h=.5, // horizontal tolerance for the motor protrusion
59 protrusion_tolerance_v=.5, // vertical tolerance for the motor protrusion 59 protrusion_tolerance_v=.5, // vertical tolerance for the motor protrusion
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; // the diameter of lever thingie 83 lsd = idler_d-idler_clearance*2; // the diameter of lever thingie
84 longwing=(mount_d+mount_screw_d+mount_screw_d_tolerance+spring_d+spring_d_clearance)/2+extrusion_width; 84 longwing=(mount_d+mount_screw_d+mount_screw_d_tolerance+spring_d+spring_d_clearance)/2+min_xy_shell;
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])
109 cube(size=[d/2,d/2,h]); 109 cube(size=[d/2,d/2,h]);
110 } 110 }
111 111
112 module mirrorleft() { 112 module mirrorleft() {
113 mirror([left?0:1,0,0]) children(); 113 mirror([left?0:1,0,0]) children();
114 } 114 }
115 module place_idler() { 115 module place_idler() {
116 rotate([0,0,45]) 116 rotate([0,0,45])
117 translate([(pulley_d+idler_d)/2,0,0]) 117 translate([(pulley_d+idler_d)/2,0,0])
118 children(); 118 children();
119 } 119 }
120 module finger_indent(d=lever_thickness,depth/*=1*/,r/*=15*/) { 120 module finger_indent(d=lever_thickness,depth/*=1*/,r/*=15*/) {
121 if(depth) { 121 if(depth) {
122 hh = (-4*pow(depth,2)+pow(d,2))/(8*depth); 122 hh = (-4*pow(depth,2)+pow(d,2))/(8*depth);
123 rr = depth+hh; 123 rr = depth+hh;
124 translate([0,0,hh]) sphere(r=rr,$fn=fnr*rr); 124 translate([0,0,hh]) sphere(r=rr,$fn=fnr*rr);
125 }else if(r) { 125 }else if(r) {
126 hh=sqrt(pow(r,2)-pow(d,2)/4); 126 hh=sqrt(pow(r,2)-pow(d,2)/4);
127 translate([0,0,hh]) sphere(r=r,$fn=fnr*r); 127 translate([0,0,hh]) sphere(r=r,$fn=fnr*r);
128 } 128 }
129 } 129 }
130 130
131 % if(vitamins) mirrorleft() { 131 % if(vitamins) mirrorleft() {
132 translate([0,0,-epsilon]) mirror([0,0,1]) cylinder(d=gearbox_d,h=1,$fn=60); 132 translate([0,0,-epsilon]) mirror([0,0,1]) cylinder(d=gearbox_d,h=1,$fn=60);
@@ -364,97 +364,97 @@ module the_extruder(
364 364
365 // spring tensioner 365 // spring tensioner
366 translate([-gearbox_d/2,-longwing,ls_z]) rotate([0,-90,0]) { 366 translate([-gearbox_d/2,-longwing,ls_z]) rotate([0,-90,0]) {
367 if(!tensioner) finger_indent(d=lever_thickness-1,r=15); else { 367 if(!tensioner) finger_indent(d=lever_thickness-1,r=15); else {
368 mirror([0,0,1]) { 368 mirror([0,0,1]) {
369 translate([0,0,st_thickshell]) 369 translate([0,0,st_thickshell])
370 hull() for(o=[0,spring_d]) translate([0,-o,0]) 370 hull() for(o=[0,spring_d]) translate([0,-o,0])
371 rotate([0,0,30]) 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); 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)); 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; 374 bigd = spring_d+spring_d_clearance;
375 hf = (bigd-st_screw_d-st_screw_d_tolerance)/2; 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]) { 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, 377 cylinder(d1=st_screw_d+st_screw_d_tolerance,d2=bigd,
378 h=hf+epsilon, $fn=fnd*bigd); 378 h=hf+epsilon, $fn=fnd*bigd);
379 translate([0,-(st_thinshell+st_split_w_tolerance)/2,0]) 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]); 380 cube(size=[body_h-ls_z+1,st_thinshell+st_split_w_tolerance,fsw+1]);
381 } 381 }
382 translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell+hf-epsilon]) 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); 383 cylinder(d=bigd,h=fsw+1,$fn=fnd*bigd);
384 } 384 }
385 } 385 }
386 } 386 }
387 387
388 }//difference 388 }//difference
389 389
390 if(supports) intersection() { 390 if(supports) intersection() {
391 difference() { 391 difference() {
392 translate([0,0,ls_z-ls_h/2-epsilon]) 392 translate([0,0,ls_z-ls_h/2-epsilon])
393 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);
394 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));
395 } 395 }
396 // supports 396 // supports
397 // TODO: hardcoded stuff below… 397 // TODO: hardcoded stuff below…
398 if(false) { // parallel 398 if(false) { // parallel
399 for(y=[-gearbox_d:4:gearbox_d]) 399 for(y=[-gearbox_d:4:gearbox_d])
400 translate([0,y-extrusion_width/2,0]) 400 translate([0,y-extrusion_width/2,0])
401 cube(size=[gearbox_d,extrusion_width,body_h]); 401 cube(size=[gearbox_d,extrusion_width,body_h]);
402 }else{ // radial 402 }else{ // radial
403 for(zr=[-65:(65+50)/7:50]) 403 for(zr=[-65:(65+50)/7:50])
404 rotate([0,0,zr]) translate([0,-extrusion_width/2,0]) 404 rotate([0,0,zr]) translate([0,-extrusion_width/2,0])
405 cube(size=[gearbox_d,extrusion_width,body_h]); 405 cube(size=[gearbox_d,extrusion_width,body_h]);
406 } 406 }
407 } 407 }
408 408
409 }//body module 409 }//body module
410 410
411 module springpad() { 411 module springpad() {
412 smalld=st_screw_d+st_screw_d_tolerance+2*extrusion_width; 412 smalld=st_screw_d+st_screw_d_tolerance+min_xy_shell;
413 bigd = spring_d+spring_d_clearance/2; 413 bigd = spring_d+spring_d_clearance/2;
414 hf = (bigd-smalld)/2; 414 hf = (bigd-smalld)/2;
415 h = hf*3.5; 415 h = hf*3.5;
416 translate([-gearbox_d/2+st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell+1,-longwing,filament_elevation]) 416 translate([-gearbox_d/2+st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell+1,-longwing,filament_elevation])
417 rotate([0,90,0]) difference() { 417 rotate([0,90,0]) difference() {
418 union() { 418 union() {
419 cylinder(d1=smalld,d2=bigd,h=hf,$fn=fnd*bigd); 419 cylinder(d1=smalld,d2=bigd,h=hf,$fn=fnd*bigd);
420 translate([0,0,hf-epsilon]) 420 translate([0,0,hf-epsilon])
421 cylinder(d=bigd,h=h-hf,$fn=fnd*bigd); 421 cylinder(d=bigd,h=h-hf,$fn=fnd*bigd);
422 translate([0,0,h]) 422 translate([0,0,h])
423 sphere(d=spring_d*3/4,$fn=fnd*spring_d*3/4); 423 sphere(d=spring_d*3/4,$fn=fnd*spring_d*3/4);
424 l = body_h-ls_z; 424 l = body_h-ls_z;
425 w = st_thinshell; 425 w = st_thinshell;
426 hull() translate([0,-st_thinshell/2,0]) mirror([1,0,0]) { 426 hull() translate([0,-st_thinshell/2,0]) mirror([1,0,0]) {
427 translate([0,0,w]) 427 translate([0,0,w])
428 cube(size=[l,st_thinshell,w]); 428 cube(size=[l,st_thinshell,w]);
429 cube(size=[l-w,st_thinshell,2*w]); 429 cube(size=[l-w,st_thinshell,2*w]);
430 } 430 }
431 } 431 }
432 translate([0,0,-epsilon]) 432 translate([0,0,-epsilon])
433 cylinder(d=st_screw_d+st_screw_d_tolerance,h=2*hf+epsilon,$fn=fnd*(st_screw_d+st_screw_d_tolerance)); 433 cylinder(d=st_screw_d+st_screw_d_tolerance,h=2*hf+epsilon,$fn=fnd*(st_screw_d+st_screw_d_tolerance));
434 } 434 }
435 } 435 }
436 436
437 module knob() { 437 module knob() {
438 ch = knob_indent_d/2; 438 ch = knob_indent_d/2;
439 translate([0,0,body_h+epsilon]) { 439 translate([0,0,body_h+epsilon]) {
440 mirror([0,0,1]) translate([0,0,-epsilon]) { 440 mirror([0,0,1]) translate([0,0,-epsilon]) {
441 difference() { 441 difference() {
442 cylinder(d=pulley_d,h=knob_bore_l,$fn=fnd*pulley_d); 442 cylinder(d=pulley_d,h=knob_bore_l,$fn=fnd*pulley_d);
443 translate([0,0,-1]) difference() { 443 translate([0,0,-1]) difference() {
444 cylinder(d=bore_d+knob_bore_d_tolerance,h=knob_bore_l+2); 444 cylinder(d=bore_d+knob_bore_d_tolerance,h=knob_bore_l+2);
445 translate([-bore_d/2-1,bore_dd-bore_d/2+knob_bore_d_tolerance/2,-1]) 445 translate([-bore_d/2-1,bore_dd-bore_d/2+knob_bore_d_tolerance/2,-1])
446 cube([bore_d+2,bore_d/2,knob_bore_l+4]); 446 cube([bore_d+2,bore_d/2,knob_bore_l+4]);
447 } 447 }
448 } 448 }
449 } 449 }
450 difference() { 450 difference() {
451 union() { 451 union() {
452 cylinder(d1=gearbox_d-2*ch,d2=gearbox_d,h=ch+epsilon,$fn=fnd*gearbox_d); 452 cylinder(d1=gearbox_d-2*ch,d2=gearbox_d,h=ch+epsilon,$fn=fnd*gearbox_d);
453 translate([0,0,ch]) 453 translate([0,0,ch])
454 cylinder(d=gearbox_d,h=knob_h-2*ch+epsilon,$fn=fnd*gearbox_d); 454 cylinder(d=gearbox_d,h=knob_h-2*ch+epsilon,$fn=fnd*gearbox_d);
455 translate([0,0,knob_h-ch]) 455 translate([0,0,knob_h-ch])
456 cylinder(d1=gearbox_d,d2=gearbox_d-2*ch,h=ch,$fn=fnd*gearbox_d); 456 cylinder(d1=gearbox_d,d2=gearbox_d-2*ch,h=ch,$fn=fnd*gearbox_d);
457 } 457 }
458 for(a=[0:360/knob_indents:359]) rotate([0,0,a]) 458 for(a=[0:360/knob_indents:359]) rotate([0,0,a])
459 translate([0,gearbox_d/2,-1]) 459 translate([0,gearbox_d/2,-1])
460 cylinder(d=knob_indent_d,h=knob_h+2,$fn=fnd*knob_indent_d); 460 cylinder(d=knob_indent_d,h=knob_h+2,$fn=fnd*knob_indent_d);