summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--another.scad6
1 files changed, 3 insertions, 3 deletions
diff --git a/another.scad b/another.scad
index 50b3a84..6afa9ef 100644
--- a/another.scad
+++ b/another.scad
@@ -1,149 +1,149 @@
1draft=true; 1draft=true;
2layer_height=0.2; extrusion_width=0.4; 2layer_height=0.2; extrusion_width=0.4;
3epsilon=0.01; 3epsilon=0.01;
4$fs=0.0125; 4$fs=0.0125;
5 5
6use <pushfittery.scad>; 6use <pushfittery.scad>;
7include <pushfit_data.scad>; 7include <pushfit_data.scad>;
8 8
9module the_extruder( 9module the_extruder(
10 // motor properties 10 // motor properties
11 gearbox_d = 36, 11 gearbox_d = 36,
12 mount_d = 28, // the distance between opposite mounting holes 12 mount_d = 28, // the distance between opposite mounting holes
13 mounthole_depth = 5, 13 mounthole_depth = 5,
14 protrusion_d = 22, protrusion_h = 2.2, // the dimensions of the protrusion on top of gearbox 14 protrusion_d = 22, protrusion_h = 2.2, // the dimensions of the protrusion on top of gearbox
15 bore_d = 8, bore_l = 17.6, 15 bore_d = 8, bore_l = 17.6,
16 bore_dd = 7, 16 bore_dd = 7,
17 // pulley properties 17 // pulley properties
18 pulley_d = 11.5, pulley_h=10, 18 pulley_d = 11.5, pulley_h=10,
19 pulley_elevation = 1, // pulley elevation above the protrusion 19 pulley_elevation = 1, // pulley elevation above the protrusion
20 teeth_elevation = 7.5, // distance from the bottom of the pulley to its teeth 20 teeth_elevation = 7.5, // distance from the bottom of the pulley to its teeth
21 filament_offset = (8.25-(3.0+3.5)/2) - 11.5/2 + 1.75/2, 21 filament_offset = (8.25-(3.0+3.5)/2) - 11.5/2 + 1.75/2,
22 // idler properties 22 // idler properties
23 idler_d = 9.5, idler_h = 4, idler_id = 3,// idler dimensions: outer and inner diameters and height 23 idler_d = 9.5, idler_h = 4, idler_id = 3,// idler dimensions: outer and inner diameters and height
24 // spring properties 24 // spring properties
25 spring_d = 10, spring_lc = 9.6, // spring diameter and compressed length 25 spring_d = 10, spring_lc = 9.6, // spring diameter and compressed length
26 // filament path properties 26 // filament path properties
27 filament_d = 1.75, 27 filament_d = 1.75,
28 filament_path_d = 2, 28 filament_path_d = 2,
29 filament_guide_d = 4, // PTFE filament guide diameter 29 filament_guide_d = 4, // PTFE filament guide diameter
30 // knob properties 30 // knob properties
31 knob_h = 10, 31 knob_h = 10,
32 knob_bore_l = 4, 32 knob_bore_l = 4,
33 knob_indent_d = 4, 33 knob_indent_d = 4,
34 knob_indents = 12, 34 knob_indents = 12,
35 // spring tensioner 35 // spring tensioner
36 st_nut_d = 9, st_nut_h = 4, 36 st_nut_d = 9, st_nut_h = 4,
37 st_screw_d = 5, 37 st_screw_d = 5,
38 st_thickshell = 8*extrusion_width, st_thinshell = 4*extrusion_width, 38 st_thickshell = 8*extrusion_width, st_thinshell = 4*extrusion_width,
39 39
40 // screw it 40 // screw it
41 mount_screw_d = 3.1, mount_screw_l = 20, 41 mount_screw_d = 3.1, mount_screw_l = 20,
42 mount_screwhead_d=6, mount_screwhead_h=3, 42 mount_screwhead_d=6, mount_screwhead_h=3,
43 idler_screw_d = 3, 43 idler_screw_d = 3,
44 idler_screwhead_d=6, idler_screwhead_h=3, 44 idler_screwhead_d=6, idler_screwhead_h=3,
45 45
46 pf = pushfit_embeddest, 46 pf = pushfit_embeddest,
47 pf_shell = max(3*layer_height,3*extrusion_width), 47 pf_shell = max(3*layer_height,3*extrusion_width),
48 pf_smooth = true, 48 pf_smooth = true,
49 49
50 // empty spaces 50 // empty spaces
51 idler_travel = 3, // how far should idler travel when pressed 51 idler_travel = 3, // how far should idler travel when pressed
52 idler_clearance=1, 52 idler_clearance=1,
53 pulley_clearance=2, 53 pulley_d_clearance=2,
54 lever_v_clearance=.7, // vertical clearance for the lever 54 lever_v_clearance=.7, // vertical clearance for the lever
55 spring_d_clearance=1, 55 spring_d_clearance=1,
56 protrusion_tolerance_h=.5, // horizontal tolerance for the motor protrusion 56 protrusion_tolerance_h=.5, // horizontal tolerance for the motor protrusion
57 protrusion_tolerance_v=.5, // vertical tolerance for the motor protrusion 57 protrusion_tolerance_v=.5, // vertical tolerance for the motor protrusion
58 mount_screw_d_tolerance=.4, 58 mount_screw_d_tolerance=.4,
59 idler_v_tolerance=.5, 59 idler_v_tolerance=.5,
60 knob_bore_d_tolerance=.6, 60 knob_bore_d_tolerance=.6,
61 st_nut_h_tolerance=.2, 61 st_nut_h_tolerance=.2,
62 st_nut_d_tolerance=.2,/* TODO: make it st_nut_w_tolerance */ 62 st_nut_d_tolerance=.2,/* TODO: make it st_nut_w_tolerance */
63 st_screw_d_tolerance=.5, 63 st_screw_d_tolerance=.5,
64 64
65 what="lever", // lever|body|knob|springpad|* 65 what="lever", // lever|body|knob|springpad|*
66 left=false, 66 left=false,
67 vitamins = true, 67 vitamins = true,
68 supports = false, bridges = true, 68 supports = false, bridges = true,
69 tensioner = true, 69 tensioner = true,
70 debug = false 70 debug = false
71) { 71) {
72 fnd = 2*PI; fnr = 2*fnd; 72 fnd = 2*PI; fnr = 2*fnd;
73 73
74 idler_filament_offset = filament_path_d/2; // -filament_offset; 74 idler_filament_offset = filament_path_d/2; // -filament_offset;
75 lever_shell = mount_screwhead_h+0.5; 75 lever_shell = mount_screwhead_h+0.5;
76 lever_thickness=max(spring_d+spring_d_clearance+layer_height*8,idler_h+idler_v_tolerance+2*lever_shell); 76 lever_thickness=max(spring_d+spring_d_clearance+layer_height*8,idler_h+idler_v_tolerance+2*lever_shell);
77 lsd = idler_d-idler_clearance*2; 77 lsd = idler_d-idler_clearance*2;
78 longwing=gearbox_d/2+spring_d/2+lsd/2; 78 longwing=gearbox_d/2+spring_d/2+lsd/2;
79 h_ = (pulley_d+idler_d)/(2*sqrt(2)); 79 h_ = (pulley_d+idler_d)/(2*sqrt(2));
80 ri = sqrt( pow(h_,2) + pow(mount_d/2-h_,2) ); 80 ri = sqrt( pow(h_,2) + pow(mount_d/2-h_,2) );
81 spring_dl = idler_travel*longwing/ri; 81 spring_dl = idler_travel*longwing/ri;
82 82
83 filament_elevation=protrusion_h+pulley_elevation+teeth_elevation; 83 filament_elevation=protrusion_h+pulley_elevation+teeth_elevation;
84 ls_z = filament_elevation; // leverspace mid-z 84 ls_z = filament_elevation; // leverspace mid-z
85 body_h = max(protrusion_h+bore_l,mount_screw_l-mounthole_depth/2+mount_screwhead_h,ls_z*2); 85 body_h = max(protrusion_h+bore_l,mount_screw_l-mounthole_depth/2+mount_screwhead_h,ls_z*2);
86 ls_h = lever_thickness+lever_v_clearance; // leverspace height 86 ls_h = lever_thickness+lever_v_clearance; // leverspace height
87 87
88 module mirrorleft() { 88 module mirrorleft() {
89 mirror([left?0:1,0,0]) children(); 89 mirror([left?0:1,0,0]) children();
90 } 90 }
91 module place_idler() { 91 module place_idler() {
92 rotate([0,0,45]) 92 rotate([0,0,45])
93 translate([(pulley_d+idler_d)/2,0,0]) 93 translate([(pulley_d+idler_d)/2,0,0])
94 children(); 94 children();
95 } 95 }
96 module finger_indent(d=lever_thickness,depth/*=1*/,r/*=15*/) { 96 module finger_indent(d=lever_thickness,depth/*=1*/,r/*=15*/) {
97 if(depth) { 97 if(depth) {
98 hh = (-4*pow(depth,2)+pow(d,2))/(8*depth); 98 hh = (-4*pow(depth,2)+pow(d,2))/(8*depth);
99 rr = depth+hh; 99 rr = depth+hh;
100 translate([0,0,hh]) sphere(r=rr,$fn=fnr*rr); 100 translate([0,0,hh]) sphere(r=rr,$fn=fnr*rr);
101 }else if(r) { 101 }else if(r) {
102 hh=sqrt(pow(r,2)-pow(d,2)/4); 102 hh=sqrt(pow(r,2)-pow(d,2)/4);
103 translate([0,0,hh]) sphere(r=r,$fn=fnr*r); 103 translate([0,0,hh]) sphere(r=r,$fn=fnr*r);
104 } 104 }
105 } 105 }
106 106
107 % if(vitamins) mirrorleft() { 107 % if(vitamins) mirrorleft() {
108 translate([0,0,-epsilon]) mirror([0,0,1]) cylinder(d=gearbox_d,h=1,$fn=60); 108 translate([0,0,-epsilon]) mirror([0,0,1]) cylinder(d=gearbox_d,h=1,$fn=60);
109 for(zr=[0:90:359]) rotate([0,0,zr]) translate([mount_d/2,0,0]) 109 for(zr=[0:90:359]) rotate([0,0,zr]) translate([mount_d/2,0,0])
110 cylinder(d=mount_screw_d,h=20,$fn=30); 110 cylinder(d=mount_screw_d,h=20,$fn=30);
111 translate([0,0,-epsilon]) cylinder(d=protrusion_d,h=protrusion_h,$fn=30); 111 translate([0,0,-epsilon]) cylinder(d=protrusion_d,h=protrusion_h,$fn=30);
112 translate([0,0,protrusion_h]) { 112 translate([0,0,protrusion_h]) {
113 difference() { 113 difference() {
114 cylinder(d=bore_d,h=bore_l,$fn=30); 114 cylinder(d=bore_d,h=bore_l,$fn=30);
115 translate([-bore_d/2-1,bore_dd-bore_d/2,-1]) 115 translate([-bore_d/2-1,bore_dd-bore_d/2,-1])
116 cube([bore_d+2,bore_d/2,bore_l+2]); 116 cube([bore_d+2,bore_d/2,bore_l+2]);
117 } 117 }
118 translate([0,0,pulley_elevation]) { 118 translate([0,0,pulley_elevation]) {
119 cylinder(d=pulley_d,h=pulley_h,$fn=30); 119 cylinder(d=pulley_d,h=pulley_h,$fn=30);
120 translate([0,0,teeth_elevation]) { 120 translate([0,0,teeth_elevation]) {
121 place_idler() { 121 place_idler() {
122 cylinder(d=idler_d,h=idler_h,center=true,$fn=30); 122 cylinder(d=idler_d,h=idler_h,center=true,$fn=30);
123 cylinder(d=idler_screw_d,h=lever_thickness+2,center=true,$fn=30); 123 cylinder(d=idler_screw_d,h=lever_thickness+2,center=true,$fn=30);
124 }//place idler 124 }//place idler
125 // filament path 125 // filament path
126 rotate([0,0,45]) { 126 rotate([0,0,45]) {
127 translate([pulley_d/2-idler_filament_offset,0,0]) rotate([90,0,0]) { 127 translate([pulley_d/2-idler_filament_offset,0,0]) rotate([90,0,0]) {
128 cylinder(d=filament_d,h=gearbox_d,center=false,$fn=15); 128 cylinder(d=filament_d,h=gearbox_d,center=false,$fn=15);
129 }//rotate translate 129 }//rotate translate
130 translate([pulley_d/2+filament_offset,0,0]) rotate([-90,0,0]) { 130 translate([pulley_d/2+filament_offset,0,0]) rotate([-90,0,0]) {
131 cylinder(d=filament_d,h=gearbox_d,center=false,$fn=15); 131 cylinder(d=filament_d,h=gearbox_d,center=false,$fn=15);
132 translate([0,0,mount_d/sqrt(2)/2+mount_screw_d]) 132 translate([0,0,mount_d/sqrt(2)/2+mount_screw_d])
133 pushfit(pf); 133 pushfit(pf);
134 }//rotate translate 134 }//rotate translate
135 }//rotate 135 }//rotate
136 }//translate teeth 136 }//translate teeth
137 }//translate pulley 137 }//translate pulley
138 }//translate protrusion 138 }//translate protrusion
139 }//vitamins 139 }//vitamins
140 140
141 module lever() { 141 module lever() {
142 translate([0,0,protrusion_h+pulley_elevation+teeth_elevation]) { 142 translate([0,0,protrusion_h+pulley_elevation+teeth_elevation]) {
143 difference() { 143 difference() {
144 union() { 144 union() {
145 hull() { 145 hull() {
146 place_idler() 146 place_idler()
147 cylinder(d=lsd,h=lever_thickness,center=true,$fn=60); 147 cylinder(d=lsd,h=lever_thickness,center=true,$fn=60);
148 translate([mount_d/2,0,0]) 148 translate([mount_d/2,0,0])
149 cylinder(d=lsd,h=lever_thickness,center=true,$fn=60); 149 cylinder(d=lsd,h=lever_thickness,center=true,$fn=60);
@@ -216,256 +216,256 @@ module the_extruder(
216 cylinder(d=gearbox_d,h=body_h,$fn=fnd*gearbox_d); 216 cylinder(d=gearbox_d,h=body_h,$fn=fnd*gearbox_d);
217 // finger and spring support 217 // finger and spring support
218 fsw = gearbox_d-(gearbox_d-mount_d)/2-spring_lc; 218 fsw = gearbox_d-(gearbox_d-mount_d)/2-spring_lc;
219 translate([-gearbox_d/2,0,0]) difference() { 219 translate([-gearbox_d/2,0,0]) difference() {
220 union() { 220 union() {
221 hull() { 221 hull() {
222 translate([0,-longwing,ls_z]) 222 translate([0,-longwing,ls_z])
223 rotate([0,90,0]) 223 rotate([0,90,0])
224 cylinder(d=lever_thickness,h=fsw,$fn=fnd*lever_thickness); 224 cylinder(d=lever_thickness,h=fsw,$fn=fnd*lever_thickness);
225 hh=body_h-ls_z; 225 hh=body_h-ls_z;
226 translate([0,0,ls_z-lever_thickness/2]) 226 translate([0,0,ls_z-lever_thickness/2])
227 mirror([0,1,0]) cube(size=[fsw,longwing-hh+lever_thickness/sqrt(2),hh+lever_thickness/2]); 227 mirror([0,1,0]) cube(size=[fsw,longwing-hh+lever_thickness/sqrt(2),hh+lever_thickness/2]);
228 hhh=ls_z; 228 hhh=ls_z;
229 translate([0,0,0]) 229 translate([0,0,0])
230 mirror([0,1,0]) cube(size=[fsw,longwing-hhh+lever_thickness/sqrt(2),hhh+lever_thickness/2]); 230 mirror([0,1,0]) cube(size=[fsw,longwing-hhh+lever_thickness/sqrt(2),hhh+lever_thickness/2]);
231 } 231 }
232 } 232 }
233 translate([0,-longwing,ls_z]) rotate([0,-90,0]) { 233 translate([0,-longwing,ls_z]) rotate([0,-90,0]) {
234 if(!tensioner) finger_indent(d=lever_thickness-1,r=15); else { 234 if(!tensioner) finger_indent(d=lever_thickness-1,r=15); else {
235 mirror([0,0,1]) { 235 mirror([0,0,1]) {
236 translate([0,0,st_thickshell]) 236 translate([0,0,st_thickshell])
237 hull() for(o=[0,spring_d]) translate([0,-o,0]) 237 hull() for(o=[0,spring_d]) translate([0,-o,0])
238 rotate([0,0,30]) 238 rotate([0,0,30])
239 cylinder(d=st_nut_d+st_nut_d_tolerance,h=st_nut_h+st_nut_h_tolerance,$fn=6); 239 cylinder(d=st_nut_d+st_nut_d_tolerance,h=st_nut_h+st_nut_h_tolerance,$fn=6);
240 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)); 240 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));
241 bigd = spring_d+spring_d_clearance; 241 bigd = spring_d+spring_d_clearance;
242 hf = (bigd-st_screw_d-st_screw_d_tolerance)/2; 242 hf = (bigd-st_screw_d-st_screw_d_tolerance)/2;
243 translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell-epsilon]) 243 translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell-epsilon])
244 cylinder(d1=st_screw_d+st_screw_d_tolerance,d2=bigd, 244 cylinder(d1=st_screw_d+st_screw_d_tolerance,d2=bigd,
245 h=hf+epsilon, $fn=fnd*bigd); 245 h=hf+epsilon, $fn=fnd*bigd);
246 translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell+hf-epsilon]) 246 translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell+hf-epsilon])
247 cylinder(d=bigd,h=fsw+1,$fn=fnd*bigd); 247 cylinder(d=bigd,h=fsw+1,$fn=fnd*bigd);
248 } 248 }
249 } 249 }
250 } 250 }
251 } // translate 251 } // translate
252 252
253 // pushfit bracket 253 // pushfit bracket
254 translate([0,0,filament_elevation]) 254 translate([0,0,filament_elevation])
255 rotate([0,0,45]) translate([pulley_d/2+filament_offset,0,0]) 255 rotate([0,0,45]) translate([pulley_d/2+filament_offset,0,0])
256 rotate([-90,0,0]) 256 rotate([-90,0,0])
257 translate([0,0,mount_d/sqrt(2)/2+mount_screw_d-gearbox_d/2/*TODO:*/]) { 257 translate([0,0,mount_d/sqrt(2)/2+mount_screw_d-gearbox_d/2/*TODO:*/]) {
258 pfbl = pf_h(pf)+gearbox_d/2; //TODO: 258 pfbl = pf_h(pf)+gearbox_d/2; //TODO:
259 if(pf_smooth) { 259 if(pf_smooth) {
260 pfbd = pf_d(pf)+2*pf_shell; 260 pfbd = pf_d(pf)+2*pf_shell;
261 hull() { 261 hull() {
262 cylinder(d=pfbd,h=pfbl,$fn=pfbd*fnd); 262 cylinder(d=pfbd,h=pfbl,$fn=pfbd*fnd);
263 translate([-epsilon/2,0,0]) { 263 translate([-epsilon/2,0,0]) {
264 cube(size=[epsilon,filament_elevation,pfbl-filament_elevation+pfbd/2]); 264 cube(size=[epsilon,filament_elevation,pfbl-filament_elevation+pfbd/2]);
265 mirror([0,1,0]) 265 mirror([0,1,0])
266 cube(size=[epsilon,body_h-filament_elevation,pfbl-body_h+filament_elevation+pfbd/2]); 266 cube(size=[epsilon,body_h-filament_elevation,pfbl-body_h+filament_elevation+pfbd/2]);
267 }//translate 267 }//translate
268 }//hull 268 }//hull
269 }else{ 269 }else{
270 pfb2a = pf_d(pf)+2*pf_shell; pfba = pfb2a/2; 270 pfb2a = pf_d(pf)+2*pf_shell; pfba = pfb2a/2;
271 pfbd = pfb2a/cos(30); 271 pfbd = pfb2a/cos(30);
272 pfbs = pfb2a*tan(30); 272 pfbs = pfb2a*tan(30);
273 cylinder(d=pfbd,h=pfbl,$fn=6); 273 cylinder(d=pfbd,h=pfbl,$fn=6);
274 translate([-pfbs/2,0,0]) { 274 translate([-pfbs/2,0,0]) {
275 hull() { 275 hull() {
276 translate([0,-pfba,0]) cube(size=[pfbs,pfb2a,pfbl]); 276 translate([0,-pfba,0]) cube(size=[pfbs,pfb2a,pfbl]);
277 cube(size=[pfbs,filament_elevation,pfbl-filament_elevation+pfba]); 277 cube(size=[pfbs,filament_elevation,pfbl-filament_elevation+pfba]);
278 mirror([0,1,0]) 278 mirror([0,1,0])
279 cube(size=[pfbs,body_h-filament_elevation,pfbl-body_h+filament_elevation+pfba]); 279 cube(size=[pfbs,body_h-filament_elevation,pfbl-body_h+filament_elevation+pfba]);
280 }//hull 280 }//hull
281 }//translate*/ 281 }//translate*/
282 }//if(pf_smooth) 282 }//if(pf_smooth)
283 }//translate rotate translate rotate translate 283 }//translate rotate translate rotate translate
284 }//union (first child of difference) 284 }//union (first child of difference)
285 285
286 // protrusion 286 // protrusion
287 translate([0,0,-1]) 287 translate([0,0,-1])
288 cylinder(d=protrusion_d+protrusion_tolerance_h,h=protrusion_h+protrusion_tolerance_v+1,$fn=fnd*(protrusion_d+protrusion_tolerance_h)); 288 cylinder(d=protrusion_d+protrusion_tolerance_h,h=protrusion_h+protrusion_tolerance_v+1,$fn=fnd*(protrusion_d+protrusion_tolerance_h));
289 // mount screw holes 289 // mount screw holes
290 for(zr=[0:90:359]) rotate([0,0,zr]) translate([mount_d/2,0,0]) { 290 for(zr=[0:90:359]) rotate([0,0,zr]) translate([mount_d/2,0,0]) {
291 translate([0,0,mount_screw_l-mounthole_depth/2-(bridges?layer_height:-epsilon)]) 291 translate([0,0,mount_screw_l-mounthole_depth/2-(bridges?layer_height:-epsilon)])
292 mirror([0,0,1]) 292 mirror([0,0,1])
293 cylinder(d=mount_screw_d+mount_screw_d_tolerance, 293 cylinder(d=mount_screw_d+mount_screw_d_tolerance,
294 h=mount_screw_l-mounthole_depth/2+1, 294 h=mount_screw_l-mounthole_depth/2+1,
295 $fn=fnd*(mount_screw_d+mount_screw_d_tolerance)); 295 $fn=fnd*(mount_screw_d+mount_screw_d_tolerance));
296 translate([0,0,mount_screw_l-mounthole_depth/2]) 296 translate([0,0,mount_screw_l-mounthole_depth/2])
297 cylinder(d=mount_screwhead_d,h=body_h+1,$fn=fnd*mount_screwhead_d); 297 cylinder(d=mount_screwhead_d,h=body_h+1,$fn=fnd*mount_screwhead_d);
298 }//for 298 }//for
299 // pushfit 299 // pushfit
300 translate([0,0,filament_elevation]) 300 translate([0,0,filament_elevation])
301 rotate([0,0,45]) translate([pulley_d/2+filament_offset,0,0]) 301 rotate([0,0,45]) translate([pulley_d/2+filament_offset,0,0])
302 rotate([-90,0,0]) 302 rotate([-90,0,0])
303 translate([0,0,mount_d/sqrt(2)/2+mount_screw_d+epsilon]) 303 translate([0,0,mount_d/sqrt(2)/2+mount_screw_d+epsilon])
304 rotate([0,0,180]) { 304 rotate([0,0,180]) {
305 pushfit(pf); 305 pushfit(pf);
306 cylinder(d=filament_guide_d,h=gearbox_d,center=true,$fn=fnd*filament_guide_d); 306 cylinder(d=filament_guide_d,h=gearbox_d,center=true,$fn=fnd*filament_guide_d);
307 translate([0,-filament_guide_d/2/sqrt(2),0]) 307 translate([0,-filament_guide_d/2/sqrt(2),0])
308 rotate([0,0,45]) 308 rotate([0,0,45])
309 cube(size=[filament_guide_d/2,filament_guide_d/2,gearbox_d],center=true); 309 cube(size=[filament_guide_d/2,filament_guide_d/2,gearbox_d],center=true);
310 }//rotate translate rotate translate rotate translate 310 }//rotate translate rotate translate rotate translate
311 // pulley 311 // pulley
312 cylinder(d=pulley_d+pulley_clearance,h=body_h+1,$fn=fnd*(pulley_d+pulley_clearance)); 312 cylinder(d=pulley_d+pulley_d_clearance,h=body_h+1,$fn=fnd*(pulley_d+pulley_d_clearance));
313 // leverspace 313 // leverspace
314 hull() for(x=[0,gearbox_d]) 314 hull() for(x=[0,gearbox_d])
315 rotate([0,0,45]) 315 rotate([0,0,45])
316 translate([x,0,ls_z-ls_h/2]) 316 translate([x,0,ls_z-ls_h/2])
317 cylinder(d=idler_d+idler_clearance,h=ls_h,$fn=fnd*(idler_d+idler_clearance)); 317 cylinder(d=idler_d+idler_clearance,h=ls_h,$fn=fnd*(idler_d+idler_clearance));
318 318
319 // idler clearance 319 // idler clearance
320 a=cos(45)*(pulley_d+idler_d)/2; 320 a=cos(45)*(pulley_d+idler_d)/2;
321 b=mount_d/2-a; 321 b=mount_d/2-a;
322 x=sqrt(pow(a,2)+pow(b,2)); 322 x=sqrt(pow(a,2)+pow(b,2));
323 translate([mount_d/2,0,ls_z]) 323 translate([mount_d/2,0,ls_z])
324 intersection() { 324 intersection() {
325 r = x+idler_d/2+idler_clearance; 325 r = x+idler_d/2+idler_clearance;
326 cylinder(r=r,h=ls_h,center=true); 326 cylinder(r=r,h=ls_h,center=true);
327 translate([-r-1,0,-ls_h/2-1]) cube(size=[2*r+2,r+1,ls_h+2]); 327 translate([-r-1,0,-ls_h/2-1]) cube(size=[2*r+2,r+1,ls_h+2]);
328 } 328 }
329 329
330 // back side cutout 330 // back side cutout
331 // XXX: this is somewhat ugly and potentially bugged, 331 // XXX: this is somewhat ugly and potentially bugged,
332 // but I want to sleep. 332 // but I want to sleep.
333 a0_ = atan( 333 a0_ = atan(
334 (mount_d/sqrt(2)/2+mount_screw_d+pf_h(pf)+gearbox_d/2) 334 (mount_d/sqrt(2)/2+mount_screw_d+pf_h(pf)+gearbox_d/2)
335 / 335 /
336 ( 336 (
337 pulley_d/2+filament_offset- 337 pulley_d/2+filament_offset-
338 (pf_d(pf)+2*pf_shell)/2/cos(30) 338 (pf_d(pf)+2*pf_shell)/2/cos(30)
339 ) 339 )
340 ); 340 );
341 a0 = -135 + ( (a0_>0) ? a0_ : 180+a0_ ); 341 a0 = -135 + ( (a0_>0) ? a0_ : 180+a0_ );
342 a1 = atan((longwing-lever_thickness/2)/(gearbox_d/2)); 342 a1 = atan((longwing-lever_thickness/2)/(gearbox_d/2));
343 translate([0,0,ls_z]) difference() { 343 translate([0,0,ls_z]) difference() {
344 rotate([0,0,-180+a0]) 344 rotate([0,0,-180+a0])
345 rotate_extrude(angle=a1-a0) 345 rotate_extrude(angle=a1-a0)
346 translate([0,-ls_h/2]) 346 translate([0,-ls_h/2])
347 square([sqrt(pow(gearbox_d/2,2)+pow(longwing-lever_thickness/2,2))+1, 347 square([sqrt(pow(gearbox_d/2,2)+pow(longwing-lever_thickness/2,2))+1,
348 ls_h]); 348 ls_h]);
349 translate([-mount_d/2,0,0]) 349 translate([-mount_d/2,0,0])
350 cylinder(d=gearbox_d-mount_d,h=ls_h+2,center=true,$fn=fnd*(gearbox_d-mount_d)); 350 cylinder(d=gearbox_d-mount_d,h=ls_h+2,center=true,$fn=fnd*(gearbox_d-mount_d));
351 }//difference translate 351 }//difference translate
352 352
353 rotate([0,0,-45]) 353 rotate([0,0,-45])
354 translate([0,0,ls_z-ls_h/2]) 354 translate([0,0,ls_z-ls_h/2])
355 cube(size=[gearbox_d,gearbox_d,lever_thickness+lever_v_clearance]); 355 cube(size=[gearbox_d,gearbox_d,lever_thickness+lever_v_clearance]);
356 translate([0,0,ls_z-ls_h/2]) { 356 translate([0,0,ls_z-ls_h/2]) {
357 translate([mount_screwhead_d/2,0,0]) 357 translate([mount_screwhead_d/2,0,0])
358 mirror([0,1,0]) 358 mirror([0,1,0])
359 cube(size=[gearbox_d,gearbox_d/2+1,lever_thickness+lever_v_clearance]); 359 cube(size=[gearbox_d,gearbox_d/2+1,lever_thickness+lever_v_clearance]);
360 } 360 }
361 //translate([-mount_d/2,-longwing,filament_elevation]) 361 //translate([-mount_d/2,-longwing,filament_elevation])
362 if(!tensioner) /* XXX: this seems to be bullshit, but it's so old, that it's historical bullshit */ 362 if(!tensioner) /* XXX: this seems to be bullshit, but it's so old, that it's historical bullshit */
363 translate([mount_d/2,-longwing,filament_elevation]) 363 translate([mount_d/2,-longwing,filament_elevation])
364 rotate([0,-90,0]) difference() { 364 rotate([0,-90,0]) difference() {
365 cylinder(d=spring_d+spring_d_clearance,h=spring_lc+spring_dl,$fn=fnd*(spring_d+spring_d_clearance)); 365 cylinder(d=spring_d+spring_d_clearance,h=spring_lc+spring_dl,$fn=fnd*(spring_d+spring_d_clearance));
366 translate([0,0,spring_lc+spring_dl]) sphere(d=spring_d*3/4,$fn=fnd*spring_d*3/4); 366 translate([0,0,spring_lc+spring_dl]) sphere(d=spring_d*3/4,$fn=fnd*spring_d*3/4);
367 } 367 }
368 368
369 }//difference 369 }//difference
370 370
371 if(supports) intersection() { 371 if(supports) intersection() {
372 difference() { 372 difference() {
373 translate([0,0,ls_z-ls_h/2-epsilon]) 373 translate([0,0,ls_z-ls_h/2-epsilon])
374 cylinder(d=gearbox_d,h=ls_h+2*epsilon,$fn=fnd*gearbox_d); 374 cylinder(d=gearbox_d,h=ls_h+2*epsilon,$fn=fnd*gearbox_d);
375 cylinder(d=pulley_d+pulley_clearance,h=body_h+1,$fn=fnd*(pulley_d+pulley_clearance)); 375 cylinder(d=pulley_d+pulley_d_clearance,h=body_h+1,$fn=fnd*(pulley_d+pulley_d_clearance));
376 } 376 }
377 // supports 377 // supports
378 // TODO: hardcoded stuff below… 378 // TODO: hardcoded stuff below…
379 if(false) { // parallel 379 if(false) { // parallel
380 for(y=[-gearbox_d:4:gearbox_d]) 380 for(y=[-gearbox_d:4:gearbox_d])
381 translate([0,y-extrusion_width/2,0]) 381 translate([0,y-extrusion_width/2,0])
382 cube(size=[gearbox_d,extrusion_width,body_h]); 382 cube(size=[gearbox_d,extrusion_width,body_h]);
383 }else{ // radial 383 }else{ // radial
384 for(zr=[-65:(65+50)/7:50]) 384 for(zr=[-65:(65+50)/7:50])
385 rotate([0,0,zr]) translate([0,-extrusion_width/2,0]) 385 rotate([0,0,zr]) translate([0,-extrusion_width/2,0])
386 cube(size=[gearbox_d,extrusion_width,body_h]); 386 cube(size=[gearbox_d,extrusion_width,body_h]);
387 } 387 }
388 } 388 }
389 389
390 }//body module 390 }//body module
391 391
392 module springpad() { 392 module springpad() {
393 smalld=st_screw_d+st_screw_d_tolerance+2*extrusion_width; 393 smalld=st_screw_d+st_screw_d_tolerance+2*extrusion_width;
394 bigd = spring_d+spring_d_clearance/2; 394 bigd = spring_d+spring_d_clearance/2;
395 hf = (bigd-smalld)/2; 395 hf = (bigd-smalld)/2;
396 translate([-gearbox_d/2+st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell+1,-longwing,filament_elevation]) 396 translate([-gearbox_d/2+st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell+1,-longwing,filament_elevation])
397 rotate([0,90,0]) difference() { 397 rotate([0,90,0]) difference() {
398 union() { 398 union() {
399 cylinder(d1=smalld,d2=bigd,h=hf,$fn=fnd*bigd); 399 cylinder(d1=smalld,d2=bigd,h=hf,$fn=fnd*bigd);
400 translate([0,0,hf-epsilon]) 400 translate([0,0,hf-epsilon])
401 cylinder(d=bigd,h=hf*2,$fn=fnd*bigd); 401 cylinder(d=bigd,h=hf*2,$fn=fnd*bigd);
402 translate([0,0,3*hf]) 402 translate([0,0,3*hf])
403 sphere(d=spring_d*3/4,$fn=fnd*spring_d*3/4); 403 sphere(d=spring_d*3/4,$fn=fnd*spring_d*3/4);
404 } 404 }
405 translate([0,0,-epsilon]) 405 translate([0,0,-epsilon])
406 cylinder(d=st_screw_d+st_screw_d_tolerance,h=2*hf+epsilon,$fn=fnd*(st_screw_d+st_screw_d_tolerance)); 406 cylinder(d=st_screw_d+st_screw_d_tolerance,h=2*hf+epsilon,$fn=fnd*(st_screw_d+st_screw_d_tolerance));
407 } 407 }
408 } 408 }
409 409
410 module knob() { 410 module knob() {
411 ch = knob_indent_d/2; 411 ch = knob_indent_d/2;
412 translate([0,0,body_h+epsilon]) { 412 translate([0,0,body_h+epsilon]) {
413 mirror([0,0,1]) translate([0,0,-epsilon]) { 413 mirror([0,0,1]) translate([0,0,-epsilon]) {
414 difference() { 414 difference() {
415 cylinder(d=pulley_d,h=knob_bore_l,$fn=fnd*pulley_d); 415 cylinder(d=pulley_d,h=knob_bore_l,$fn=fnd*pulley_d);
416 translate([0,0,-1]) difference() { 416 translate([0,0,-1]) difference() {
417 cylinder(d=bore_d+knob_bore_d_tolerance,h=knob_bore_l+2); 417 cylinder(d=bore_d+knob_bore_d_tolerance,h=knob_bore_l+2);
418 translate([-bore_d/2-1,bore_dd-bore_d/2+knob_bore_d_tolerance/2,-1]) 418 translate([-bore_d/2-1,bore_dd-bore_d/2+knob_bore_d_tolerance/2,-1])
419 cube([bore_d+2,bore_d/2,knob_bore_l+4]); 419 cube([bore_d+2,bore_d/2,knob_bore_l+4]);
420 } 420 }
421 } 421 }
422 } 422 }
423 difference() { 423 difference() {
424 union() { 424 union() {
425 cylinder(d1=gearbox_d-2*ch,d2=gearbox_d,h=ch+epsilon,$fn=fnd*gearbox_d); 425 cylinder(d1=gearbox_d-2*ch,d2=gearbox_d,h=ch+epsilon,$fn=fnd*gearbox_d);
426 translate([0,0,ch]) 426 translate([0,0,ch])
427 cylinder(d=gearbox_d,h=knob_h-2*ch+epsilon,$fn=fnd*gearbox_d); 427 cylinder(d=gearbox_d,h=knob_h-2*ch+epsilon,$fn=fnd*gearbox_d);
428 translate([0,0,knob_h-ch]) 428 translate([0,0,knob_h-ch])
429 cylinder(d1=gearbox_d,d2=gearbox_d-2*ch,h=ch,$fn=fnd*gearbox_d); 429 cylinder(d1=gearbox_d,d2=gearbox_d-2*ch,h=ch,$fn=fnd*gearbox_d);
430 } 430 }
431 for(a=[0:360/knob_indents:359]) rotate([0,0,a]) 431 for(a=[0:360/knob_indents:359]) rotate([0,0,a])
432 translate([0,gearbox_d/2,-1]) 432 translate([0,gearbox_d/2,-1])
433 cylinder(d=knob_indent_d,h=knob_h+2,$fn=fnd*knob_indent_d); 433 cylinder(d=knob_indent_d,h=knob_h+2,$fn=fnd*knob_indent_d);
434 } 434 }
435 } 435 }
436 }//knob module 436 }//knob module
437 437
438 module debug() { 438 module debug() {
439 difference() { 439 difference() {
440 children(); 440 children();
441 if(debug) { 441 if(debug) {
442 // spring tensioner debug cutout 442 // spring tensioner debug cutout
443 if(tensioner) // TODO: collaps copypasted transformations 443 if(tensioner) // TODO: collaps copypasted transformations
444 translate([-gearbox_d/2,0,0]) 444 translate([-gearbox_d/2,0,0])
445 translate([0,-longwing,ls_z]) rotate([0,-90,0]) 445 translate([0,-longwing,ls_z]) rotate([0,-90,0])
446 translate([0,-lever_thickness/2-1,-gearbox_d]) 446 translate([0,-lever_thickness/2-1,-gearbox_d])
447 cube(size=[body_h/2+1,lever_thickness/2+1,gearbox_d+2]); 447 cube(size=[body_h/2+1,lever_thickness/2+1,gearbox_d+2]);
448 // lever axis debug cutout 448 // lever axis debug cutout
449 translate([mount_d/2,0,-1]) 449 translate([mount_d/2,0,-1])
450 rotate([0,0,-45]) 450 rotate([0,0,-45])
451 cube(size=[gearbox_d-mount_d,gearbox_d-mount_d,body_h+knob_h+2]); 451 cube(size=[gearbox_d-mount_d,gearbox_d-mount_d,body_h+knob_h+2]);
452 // idler debug cutout 452 // idler debug cutout
453 translate([0,0,ls_z]) 453 translate([0,0,ls_z])
454 place_idler() 454 place_idler()
455 rotate([0,0,-45]) 455 rotate([0,0,-45])
456 translate([0,0,-lever_thickness/2-epsilon]) 456 translate([0,0,-lever_thickness/2-epsilon])
457 cube(size=[(idler_d+idler_clearance)/2,(idler_d+idler_clearance)/2, 457 cube(size=[(idler_d+idler_clearance)/2,(idler_d+idler_clearance)/2,
458 lever_thickness+2*epsilon]); 458 lever_thickness+2*epsilon]);
459 }//if debug 459 }//if debug
460 }//difference 460 }//difference
461 } 461 }
462 462
463 mirrorleft() 463 mirrorleft()
464 debug() 464 debug()
465 if(what=="lever") color("green",0.7) lever(); 465 if(what=="lever") color("green",0.7) lever();
466 else if(what=="body") color("yellow",0.7) body(); 466 else if(what=="body") color("yellow",0.7) body();
467 else if(what=="knob") color("red",0.7) knob(); 467 else if(what=="knob") color("red",0.7) knob();
468 else if(what=="springpad") color("blue",0.7) springpad(); 468 else if(what=="springpad") color("blue",0.7) springpad();
469 else if(what=="both") { 469 else if(what=="both") {
470 color("green",0.7) lever(); 470 color("green",0.7) lever();
471 color("yellow",0.7) body(); 471 color("yellow",0.7) body();