summaryrefslogtreecommitdiff
authorMichael Krelin <hacker@klever.net>2018-08-12 21:20:15 (UTC)
committer Michael Krelin <hacker@klever.net>2018-08-12 21:20:15 (UTC)
commitf123d3acb5e918b6a21af0a65bba4dc0395c73f3 (patch) (unidiff)
treeac940d2b2c28ce486eee0b34872345d92e789901
parent6c61457ea7bfaf0edc28f9e771bf608e2a9bc405 (diff)
downloadextrudery-f123d3acb5e918b6a21af0a65bba4dc0395c73f3.zip
extrudery-f123d3acb5e918b6a21af0a65bba4dc0395c73f3.tar.gz
extrudery-f123d3acb5e918b6a21af0a65bba4dc0395c73f3.tar.bz2
finetune filament offset relative to the pulley
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--another.scad13
1 files changed, 7 insertions, 6 deletions
diff --git a/another.scad b/another.scad
index b80d0d0..a93d21a 100644
--- a/another.scad
+++ b/another.scad
@@ -1,44 +1,45 @@
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 // idler properties 22 // idler properties
22 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
23 // spring properties 24 // spring properties
24 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
25 // filament path properties 26 // filament path properties
26 filament_d = 1.75, 27 filament_d = 1.75,
27 filament_path_d = 2, 28 filament_path_d = 2,
28 filament_guide_d = 4, // PTFE filament guide diameter 29 filament_guide_d = 4, // PTFE filament guide diameter
29 // knob properties 30 // knob properties
30 knob_h = 10, 31 knob_h = 10,
31 knob_bore_l = 4, 32 knob_bore_l = 4,
32 knob_indent_d = 4, 33 knob_indent_d = 4,
33 knob_indents = 12, 34 knob_indents = 12,
34 // spring tensioner 35 // spring tensioner
35 st_nut_d = 9, st_nut_h = 4, 36 st_nut_d = 9, st_nut_h = 4,
36 st_screw_d = 5, 37 st_screw_d = 5,
37 st_thickshell = 8*extrusion_width, st_thinshell = 4*extrusion_width, 38 st_thickshell = 8*extrusion_width, st_thinshell = 4*extrusion_width,
38 39
39 // screw it 40 // screw it
40 mount_screw_d = 3.1, mount_screw_l = 20, 41 mount_screw_d = 3.1, mount_screw_l = 20,
41 mount_screwhead_d=6, mount_screwhead_h=3, 42 mount_screwhead_d=6, mount_screwhead_h=3,
42 idler_screw_d = 3, 43 idler_screw_d = 3,
43 idler_screwhead_d=6, idler_screwhead_h=3, 44 idler_screwhead_d=6, idler_screwhead_h=3,
44 45
@@ -100,85 +101,85 @@ module the_extruder(
100 hh=sqrt(pow(r,2)-pow(d,2)/4); 101 hh=sqrt(pow(r,2)-pow(d,2)/4);
101 translate([0,0,hh]) sphere(r=r,$fn=fnr*r); 102 translate([0,0,hh]) sphere(r=r,$fn=fnr*r);
102 } 103 }
103 } 104 }
104 105
105 % if(vitamins) mirrorleft() { 106 % if(vitamins) mirrorleft() {
106 translate([0,0,-epsilon]) mirror([0,0,1]) cylinder(d=gearbox_d,h=1,$fn=60); 107 translate([0,0,-epsilon]) mirror([0,0,1]) cylinder(d=gearbox_d,h=1,$fn=60);
107 for(zr=[0:90:359]) rotate([0,0,zr]) translate([mount_d/2,0,0]) 108 for(zr=[0:90:359]) rotate([0,0,zr]) translate([mount_d/2,0,0])
108 cylinder(d=mount_screw_d,h=20,$fn=30); 109 cylinder(d=mount_screw_d,h=20,$fn=30);
109 translate([0,0,-epsilon]) cylinder(d=protrusion_d,h=protrusion_h,$fn=30); 110 translate([0,0,-epsilon]) cylinder(d=protrusion_d,h=protrusion_h,$fn=30);
110 translate([0,0,protrusion_h]) { 111 translate([0,0,protrusion_h]) {
111 difference() { 112 difference() {
112 cylinder(d=bore_d,h=bore_l,$fn=30); 113 cylinder(d=bore_d,h=bore_l,$fn=30);
113 translate([-bore_d/2-1,bore_dd-bore_d/2,-1]) 114 translate([-bore_d/2-1,bore_dd-bore_d/2,-1])
114 cube([bore_d+2,bore_d/2,bore_l+2]); 115 cube([bore_d+2,bore_d/2,bore_l+2]);
115 } 116 }
116 translate([0,0,pulley_elevation]) { 117 translate([0,0,pulley_elevation]) {
117 cylinder(d=pulley_d,h=pulley_h,$fn=30); 118 cylinder(d=pulley_d,h=pulley_h,$fn=30);
118 translate([0,0,teeth_elevation]) { 119 translate([0,0,teeth_elevation]) {
119 place_idler() { 120 place_idler() {
120 cylinder(d=idler_d,h=idler_h,center=true,$fn=30); 121 cylinder(d=idler_d,h=idler_h,center=true,$fn=30);
121 cylinder(d=idler_screw_d,h=lever_thickness+2,center=true,$fn=30); 122 cylinder(d=idler_screw_d,h=lever_thickness+2,center=true,$fn=30);
122 }//place idler 123 }//place idler
123 // filament path 124 // filament path
124 rotate([0,0,45]) translate([pulley_d/2,0,0]) { 125 rotate([0,0,45]) translate([pulley_d/2+filament_offset,0,0]) {
125 rotate([90,0,0]) cylinder(d=filament_d,h=gearbox_d*2,center=true,$fn=15); 126 rotate([90,0,0]) cylinder(d=filament_d,h=gearbox_d*2,center=true,$fn=15);
126 rotate([-90,0,0]) 127 rotate([-90,0,0])
127 translate([0,0,mount_d/sqrt(2)/2+mount_screw_d]) 128 translate([0,0,mount_d/sqrt(2)/2+mount_screw_d])
128 pushfit(pf); 129 pushfit(pf);
129 } 130 }
130 }//translate teeth 131 }//translate teeth
131 }//translate pulley 132 }//translate pulley
132 }//translate protrusion 133 }//translate protrusion
133 }//vitamins 134 }//vitamins
134 135
135 module lever() { 136 module lever() {
136 translate([0,0,protrusion_h+pulley_elevation+teeth_elevation]) { 137 translate([0,0,protrusion_h+pulley_elevation+teeth_elevation]) {
137 difference() { 138 difference() {
138 union() { 139 union() {
139 hull() { 140 hull() {
140 place_idler() 141 place_idler()
141 cylinder(d=lsd,h=lever_thickness,center=true,$fn=60); 142 cylinder(d=lsd,h=lever_thickness,center=true,$fn=60);
142 translate([mount_d/2,0,0]) 143 translate([mount_d/2,0,0])
143 cylinder(d=lsd,h=lever_thickness,center=true,$fn=60); 144 cylinder(d=lsd,h=lever_thickness,center=true,$fn=60);
144 }//hull 145 }//hull
145 hull() { 146 hull() {
146 translate([mount_d/2,0,0]) 147 translate([mount_d/2,0,0])
147 cylinder(d=lsd,h=lever_thickness,center=true,$fn=60); 148 cylinder(d=lsd,h=lever_thickness,center=true,$fn=60);
148 translate([mount_d/2,-longwing,0]) rotate([0,90,0]) 149 translate([mount_d/2,-longwing,0]) rotate([0,90,0])
149 cylinder(d=lever_thickness,h=lsd,center=true,$fn=60); 150 cylinder(d=lever_thickness,h=lsd,center=true,$fn=60);
150 }//hull 151 }//hull
151 }//union 152 }//union
152 153
153 // filament path 154 // filament path
154 place_idler() { 155 place_idler() {
155 translate([-idler_d/2,0,0]) rotate([90,0,0]) { 156 translate([-idler_d/2+filament_offset,0,0]) rotate([90,0,0]) {
156 cylinder(d=filament_path_d,h=3*gearbox_d,center=true,$fn=30); 157 cylinder(d=filament_path_d,h=3*gearbox_d,center=true,$fn=30);
157 translate([0,-filament_path_d/2/sqrt(2),0]) rotate([0,0,45]) 158 translate([0,-filament_path_d/2/sqrt(2),0]) rotate([0,0,45])
158 cube(size=[filament_path_d/2,filament_path_d/2,3*gearbox_d],center=true); 159 cube(size=[filament_path_d/2,filament_path_d/2,3*gearbox_d],center=true);
159 }//rotate translate 160 }//rotate translate
160 translate([-idler_d/2,0,0]) 161 translate([-idler_d/2+filament_offset,0,0])
161 rotate([90,0,0]) 162 rotate([90,0,0])
162 translate([0,0, 163 translate([0,0,
163 sqrt(2)*(mount_d-pulley_d+lsd)/2 164 sqrt(2)*(mount_d-pulley_d+lsd)/2
164 ]) { 165 ]) {
165 cylinder(d1=filament_path_d,d2=2*filament_path_d, 166 cylinder(d1=filament_path_d,d2=2*filament_path_d,
166 h=filament_path_d,$fn=2*filament_path_d*fnd); 167 h=filament_path_d,$fn=2*filament_path_d*fnd);
167 translate([0,0,filament_path_d-epsilon]) 168 translate([0,0,filament_path_d-epsilon])
168 cylinder(d=2*filament_path_d,h=lsd,$fn=2*filament_path_d*fnd); 169 cylinder(d=2*filament_path_d,h=lsd,$fn=2*filament_path_d*fnd);
169 } 170 }
170 }//place_idler 171 }//place_idler
171 172
172 // idler space and mounting hole 173 // idler space and mounting hole
173 place_idler() { 174 place_idler() {
174 difference() { 175 difference() {
175 cylinder(d=idler_d+idler_clearance*2,h=idler_h+idler_v_tolerance,center=true,$fn=60); 176 cylinder(d=idler_d+idler_clearance*2,h=idler_h+idler_v_tolerance,center=true,$fn=60);
176 if(supports) for(y=[-lsd/2+extrusion_width:(lsd-2*extrusion_width)/3:lsd/2-extrusion_width]) 177 if(supports) for(y=[-lsd/2+extrusion_width:(lsd-2*extrusion_width)/3:lsd/2-extrusion_width])
177 translate([-lsd/2-1,y-extrusion_width/2,-idler_h/2-idler_v_tolerance/2-1]) 178 translate([-lsd/2-1,y-extrusion_width/2,-idler_h/2-idler_v_tolerance/2-1])
178 cube(size=[lsd+2,extrusion_width,idler_h+idler_v_tolerance+2]); 179 cube(size=[lsd+2,extrusion_width,idler_h+idler_v_tolerance+2]);
179 } 180 }
180 cylinder(d=idler_screw_d,h=lever_thickness+2,center=true,$fn=30); 181 cylinder(d=idler_screw_d,h=lever_thickness+2,center=true,$fn=30);
181 translate([0,0,lever_thickness/2-idler_screwhead_h]) 182 translate([0,0,lever_thickness/2-idler_screwhead_h])
182 cylinder(d=idler_screwhead_d,h=idler_screwhead_h+1,$fn=fnd*idler_screwhead_d); 183 cylinder(d=idler_screwhead_d,h=idler_screwhead_h+1,$fn=fnd*idler_screwhead_d);
183 } 184 }
184 // mounting screw hole 185 // mounting screw hole
@@ -225,131 +226,131 @@ module the_extruder(
225 } 226 }
226 } 227 }
227 translate([0,-longwing,ls_z]) rotate([0,-90,0]) { 228 translate([0,-longwing,ls_z]) rotate([0,-90,0]) {
228 if(!tensioner) finger_indent(d=lever_thickness-1,r=15); else { 229 if(!tensioner) finger_indent(d=lever_thickness-1,r=15); else {
229 mirror([0,0,1]) { 230 mirror([0,0,1]) {
230 translate([0,0,st_thickshell]) 231 translate([0,0,st_thickshell])
231 hull() for(o=[0,spring_d]) translate([0,-o,0]) 232 hull() for(o=[0,spring_d]) translate([0,-o,0])
232 rotate([0,0,30]) 233 rotate([0,0,30])
233 cylinder(d=st_nut_d+st_nut_d_tolerance,h=st_nut_h+st_nut_h_tolerance,$fn=6); 234 cylinder(d=st_nut_d+st_nut_d_tolerance,h=st_nut_h+st_nut_h_tolerance,$fn=6);
234 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)); 235 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));
235 bigd = spring_d+spring_d_clearance; 236 bigd = spring_d+spring_d_clearance;
236 hf = (bigd-st_screw_d-st_screw_d_tolerance)/2; 237 hf = (bigd-st_screw_d-st_screw_d_tolerance)/2;
237 translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell-epsilon]) 238 translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell-epsilon])
238 cylinder(d1=st_screw_d+st_screw_d_tolerance,d2=bigd, 239 cylinder(d1=st_screw_d+st_screw_d_tolerance,d2=bigd,
239 h=hf+epsilon, $fn=fnd*bigd); 240 h=hf+epsilon, $fn=fnd*bigd);
240 translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell+hf-epsilon]) 241 translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell+hf-epsilon])
241 cylinder(d=bigd,h=fsw+1,$fn=fnd*bigd); 242 cylinder(d=bigd,h=fsw+1,$fn=fnd*bigd);
242 } 243 }
243 } 244 }
244 } 245 }
245 } // translate 246 } // translate
246 247
247 // pushfit bracket 248 // pushfit bracket
248 translate([0,0,filament_elevation]) 249 translate([0,0,filament_elevation])
249 rotate([0,0,45]) translate([pulley_d/2,0,0]) 250 rotate([0,0,45]) translate([pulley_d/2+filament_offset,0,0])
250 rotate([-90,0,0]) 251 rotate([-90,0,0])
251 translate([0,0,mount_d/sqrt(2)/2+mount_screw_d-gearbox_d/2/*TODO:*/]) { 252 translate([0,0,mount_d/sqrt(2)/2+mount_screw_d-gearbox_d/2/*TODO:*/]) {
252 pfbl = pf_h(pf)+gearbox_d/2; //TODO: 253 pfbl = pf_h(pf)+gearbox_d/2; //TODO:
253 if(pf_smooth) { 254 if(pf_smooth) {
254 pfbd = pf_d(pf)+2*pf_shell; 255 pfbd = pf_d(pf)+2*pf_shell;
255 hull() { 256 hull() {
256 cylinder(d=pfbd,h=pfbl,$fn=pfbd*fnd); 257 cylinder(d=pfbd,h=pfbl,$fn=pfbd*fnd);
257 translate([-epsilon/2,0,0]) { 258 translate([-epsilon/2,0,0]) {
258 cube(size=[epsilon,filament_elevation,pfbl-filament_elevation+pfbd/2]); 259 cube(size=[epsilon,filament_elevation,pfbl-filament_elevation+pfbd/2]);
259 mirror([0,1,0]) 260 mirror([0,1,0])
260 cube(size=[epsilon,body_h-filament_elevation,pfbl-body_h+filament_elevation+pfbd/2]); 261 cube(size=[epsilon,body_h-filament_elevation,pfbl-body_h+filament_elevation+pfbd/2]);
261 }//translate 262 }//translate
262 }//hull 263 }//hull
263 }else{ 264 }else{
264 pfb2a = pf_d(pf)+2*pf_shell; pfba = pfb2a/2; 265 pfb2a = pf_d(pf)+2*pf_shell; pfba = pfb2a/2;
265 pfbd = pfb2a/cos(30); 266 pfbd = pfb2a/cos(30);
266 pfbs = pfb2a*tan(30); 267 pfbs = pfb2a*tan(30);
267 cylinder(d=pfbd,h=pfbl,$fn=6); 268 cylinder(d=pfbd,h=pfbl,$fn=6);
268 translate([-pfbs/2,0,0]) { 269 translate([-pfbs/2,0,0]) {
269 hull() { 270 hull() {
270 translate([0,-pfba,0]) cube(size=[pfbs,pfb2a,pfbl]); 271 translate([0,-pfba,0]) cube(size=[pfbs,pfb2a,pfbl]);
271 cube(size=[pfbs,filament_elevation,pfbl-filament_elevation+pfba]); 272 cube(size=[pfbs,filament_elevation,pfbl-filament_elevation+pfba]);
272 mirror([0,1,0]) 273 mirror([0,1,0])
273 cube(size=[pfbs,body_h-filament_elevation,pfbl-body_h+filament_elevation+pfba]); 274 cube(size=[pfbs,body_h-filament_elevation,pfbl-body_h+filament_elevation+pfba]);
274 }//hull 275 }//hull
275 }//translate*/ 276 }//translate*/
276 }//if(pf_smooth) 277 }//if(pf_smooth)
277 }//translate rotate translate rotate translate 278 }//translate rotate translate rotate translate
278 }//union (first child of difference) 279 }//union (first child of difference)
279 280
280 // protrusion 281 // protrusion
281 translate([0,0,-1]) 282 translate([0,0,-1])
282 cylinder(d=protrusion_d+protrusion_tolerance_h,h=protrusion_h+protrusion_tolerance_v+1,$fn=fnd*(protrusion_d+protrusion_tolerance_h)); 283 cylinder(d=protrusion_d+protrusion_tolerance_h,h=protrusion_h+protrusion_tolerance_v+1,$fn=fnd*(protrusion_d+protrusion_tolerance_h));
283 // mount screw holes 284 // mount screw holes
284 for(zr=[0:90:359]) rotate([0,0,zr]) translate([mount_d/2,0,0]) { 285 for(zr=[0:90:359]) rotate([0,0,zr]) translate([mount_d/2,0,0]) {
285 translate([0,0,mount_screw_l-mounthole_depth/2-(bridges?layer_height:-epsilon)]) 286 translate([0,0,mount_screw_l-mounthole_depth/2-(bridges?layer_height:-epsilon)])
286 mirror([0,0,1]) 287 mirror([0,0,1])
287 cylinder(d=mount_screw_d+mount_screw_d_tolerance, 288 cylinder(d=mount_screw_d+mount_screw_d_tolerance,
288 h=mount_screw_l-mounthole_depth/2+1, 289 h=mount_screw_l-mounthole_depth/2+1,
289 $fn=fnd*(mount_screw_d+mount_screw_d_tolerance)); 290 $fn=fnd*(mount_screw_d+mount_screw_d_tolerance));
290 translate([0,0,mount_screw_l-mounthole_depth/2]) 291 translate([0,0,mount_screw_l-mounthole_depth/2])
291 cylinder(d=mount_screwhead_d,h=body_h+1,$fn=fnd*mount_screwhead_d); 292 cylinder(d=mount_screwhead_d,h=body_h+1,$fn=fnd*mount_screwhead_d);
292 }//for 293 }//for
293 // pushfit 294 // pushfit
294 translate([0,0,filament_elevation]) 295 translate([0,0,filament_elevation])
295 rotate([0,0,45]) translate([pulley_d/2,0,0]) 296 rotate([0,0,45]) translate([pulley_d/2+filament_offset,0,0])
296 rotate([-90,0,0]) 297 rotate([-90,0,0])
297 translate([0,0,mount_d/sqrt(2)/2+mount_screw_d+epsilon]) 298 translate([0,0,mount_d/sqrt(2)/2+mount_screw_d+epsilon])
298 rotate([0,0,180]) { 299 rotate([0,0,180]) {
299 pushfit(pf); 300 pushfit(pf);
300 cylinder(d=filament_guide_d,h=gearbox_d,center=true,$fn=fnd*filament_guide_d); 301 cylinder(d=filament_guide_d,h=gearbox_d,center=true,$fn=fnd*filament_guide_d);
301 translate([0,-filament_guide_d/2/sqrt(2),0]) 302 translate([0,-filament_guide_d/2/sqrt(2),0])
302 rotate([0,0,45]) 303 rotate([0,0,45])
303 cube(size=[filament_guide_d/2,filament_guide_d/2,gearbox_d],center=true); 304 cube(size=[filament_guide_d/2,filament_guide_d/2,gearbox_d],center=true);
304 }//rotate translate rotate translate rotate translate 305 }//rotate translate rotate translate rotate translate
305 // pulley 306 // pulley
306 cylinder(d=pulley_d+pulley_clearance,h=body_h+1,$fn=fnd*(pulley_d+pulley_clearance)); 307 cylinder(d=pulley_d+pulley_clearance,h=body_h+1,$fn=fnd*(pulley_d+pulley_clearance));
307 // leverspace 308 // leverspace
308 hull() for(x=[0,gearbox_d]) 309 hull() for(x=[0,gearbox_d])
309 rotate([0,0,45]) 310 rotate([0,0,45])
310 translate([x,0,ls_z-ls_h/2]) 311 translate([x,0,ls_z-ls_h/2])
311 cylinder(d=idler_d+idler_clearance,h=ls_h,$fn=fnd*(idler_d+idler_clearance)); 312 cylinder(d=idler_d+idler_clearance,h=ls_h,$fn=fnd*(idler_d+idler_clearance));
312 313
313 // idler clearance 314 // idler clearance
314 a=cos(45)*(pulley_d+idler_d)/2; 315 a=cos(45)*(pulley_d+idler_d)/2;
315 b=mount_d/2-a; 316 b=mount_d/2-a;
316 x=sqrt(pow(a,2)+pow(b,2)); 317 x=sqrt(pow(a,2)+pow(b,2));
317 translate([mount_d/2,0,ls_z]) 318 translate([mount_d/2,0,ls_z])
318 intersection() { 319 intersection() {
319 r = x+idler_d/2+idler_clearance; 320 r = x+idler_d/2+idler_clearance;
320 cylinder(r=r,h=ls_h,center=true); 321 cylinder(r=r,h=ls_h,center=true);
321 translate([-r-1,0,-ls_h/2-1]) cube(size=[2*r+2,r+1,ls_h+2]); 322 translate([-r-1,0,-ls_h/2-1]) cube(size=[2*r+2,r+1,ls_h+2]);
322 } 323 }
323 324
324 // back side cutout 325 // back side cutout
325 // XXX: this is somewhat ugly and potentially bugged, 326 // XXX: this is somewhat ugly and potentially bugged,
326 // but I want to sleep. 327 // but I want to sleep.
327 a0_ = atan( 328 a0_ = atan(
328 (mount_d/sqrt(2)/2+mount_screw_d+pf_h(pf)+gearbox_d/2) 329 (mount_d/sqrt(2)/2+mount_screw_d+pf_h(pf)+gearbox_d/2)
329 / 330 /
330 ( 331 (
331 pulley_d/2- 332 pulley_d/2+filament_offset-
332 (pf_d(pf)+2*pf_shell)/2/cos(30) 333 (pf_d(pf)+2*pf_shell)/2/cos(30)
333 ) 334 )
334 ); 335 );
335 a0 = -135 + ( (a0_>0) ? a0_ : 180+a0_ ); 336 a0 = -135 + ( (a0_>0) ? a0_ : 180+a0_ );
336 a1 = atan((longwing-lever_thickness/2)/(gearbox_d/2)); 337 a1 = atan((longwing-lever_thickness/2)/(gearbox_d/2));
337 translate([0,0,ls_z]) difference() { 338 translate([0,0,ls_z]) difference() {
338 rotate([0,0,-180+a0]) 339 rotate([0,0,-180+a0])
339 rotate_extrude(angle=a1-a0) 340 rotate_extrude(angle=a1-a0)
340 translate([0,-ls_h/2]) 341 translate([0,-ls_h/2])
341 square([sqrt(pow(gearbox_d/2,2)+pow(longwing-lever_thickness/2,2))+1, 342 square([sqrt(pow(gearbox_d/2,2)+pow(longwing-lever_thickness/2,2))+1,
342 ls_h]); 343 ls_h]);
343 translate([-mount_d/2,0,0]) 344 translate([-mount_d/2,0,0])
344 cylinder(d=gearbox_d-mount_d,h=ls_h+2,center=true,$fn=fnd*(gearbox_d-mount_d)); 345 cylinder(d=gearbox_d-mount_d,h=ls_h+2,center=true,$fn=fnd*(gearbox_d-mount_d));
345 }//difference translate 346 }//difference translate
346 347
347 rotate([0,0,-45]) 348 rotate([0,0,-45])
348 translate([0,0,ls_z-ls_h/2]) 349 translate([0,0,ls_z-ls_h/2])
349 cube(size=[gearbox_d,gearbox_d,lever_thickness+lever_v_clearance]); 350 cube(size=[gearbox_d,gearbox_d,lever_thickness+lever_v_clearance]);
350 translate([0,0,ls_z-ls_h/2]) { 351 translate([0,0,ls_z-ls_h/2]) {
351 translate([mount_screwhead_d/2,0,0]) 352 translate([mount_screwhead_d/2,0,0])
352 mirror([0,1,0]) 353 mirror([0,1,0])
353 cube(size=[gearbox_d,gearbox_d/2+1,lever_thickness+lever_v_clearance]); 354 cube(size=[gearbox_d,gearbox_d/2+1,lever_thickness+lever_v_clearance]);
354 } 355 }
355 //translate([-mount_d/2,-longwing,filament_elevation]) 356 //translate([-mount_d/2,-longwing,filament_elevation])