summaryrefslogtreecommitdiff
authorMichael Krelin <hacker@klever.net>2018-08-11 14:09:22 (UTC)
committer Michael Krelin <hacker@klever.net>2018-08-11 14:09:22 (UTC)
commit495bcda94c4b32b13044cfa9e97c8ea25b32cdfb (patch) (unidiff)
treee2c9f50fe09a5b279bd6c84ad8a419e8fd2b8fa3
parent83611090e9424595714c8fe041a1b8a4d2d36925 (diff)
downloadextrudery-495bcda94c4b32b13044cfa9e97c8ea25b32cdfb.zip
extrudery-495bcda94c4b32b13044cfa9e97c8ea25b32cdfb.tar.gz
extrudery-495bcda94c4b32b13044cfa9e97c8ea25b32cdfb.tar.bz2
smaller and nicer pushfit compartment
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--another.scad22
1 files changed, 18 insertions, 4 deletions
diff --git a/another.scad b/another.scad
index 342d70c..2ea5417 100644
--- a/another.scad
+++ b/another.scad
@@ -1,109 +1,110 @@
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 // idler properties 21 // idler properties
22 idler_d = 9.5, idler_h = 4, idler_id = 3,// idler dimensions: outer and inner diameters and height 22 idler_d = 9.5, idler_h = 4, idler_id = 3,// idler dimensions: outer and inner diameters and height
23 // spring properties 23 // spring properties
24 spring_d = 10, spring_lc = 9.6, // spring diameter and compressed length 24 spring_d = 10, spring_lc = 9.6, // spring diameter and compressed length
25 // filament path properties 25 // filament path properties
26 filament_d = 1.75, 26 filament_d = 1.75,
27 filament_path_d = 2, 27 filament_path_d = 2,
28 filament_guide_d = 4, // PTFE filament guide diameter 28 filament_guide_d = 4, // PTFE filament guide diameter
29 // knob properties 29 // knob properties
30 knob_h = 10, 30 knob_h = 10,
31 knob_bore_l = 4, 31 knob_bore_l = 4,
32 knob_indent_d = 4, 32 knob_indent_d = 4,
33 knob_indents = 12, 33 knob_indents = 12,
34 // spring tensioner 34 // spring tensioner
35 st_nut_d = 9, st_nut_h = 4, 35 st_nut_d = 9, st_nut_h = 4,
36 st_screw_d = 5, 36 st_screw_d = 5,
37 st_thickshell = 8*extrusion_width, st_thinshell = 4*extrusion_width, 37 st_thickshell = 8*extrusion_width, st_thinshell = 4*extrusion_width,
38 38
39 // screw it 39 // screw it
40 mount_screw_d = 3.1, mount_screw_l = 20, 40 mount_screw_d = 3.1, mount_screw_l = 20,
41 mount_screwhead_d=6, mount_screwhead_h=3, 41 mount_screwhead_d=6, mount_screwhead_h=3,
42 idler_screw_d = 3, 42 idler_screw_d = 3,
43 idler_screwhead_d=6, idler_screwhead_h=3, 43 idler_screwhead_d=6, idler_screwhead_h=3,
44 44
45 pf = pushfit_embeddest, 45 pf = pushfit_embeddest,
46 pf_shell = max(3*layer_height,3*extrusion_width),
46 47
47 // empty spaces 48 // empty spaces
48 idler_travel = 3, // how far should idler travel when pressed 49 idler_travel = 3, // how far should idler travel when pressed
49 idler_clearance=1, 50 idler_clearance=1,
50 pulley_clearance=2, 51 pulley_clearance=2,
51 lever_v_clearance=.7, // vertical clearance for the lever 52 lever_v_clearance=.7, // vertical clearance for the lever
52 spring_d_clearance=1, 53 spring_d_clearance=1,
53 protrusion_tolerance_h=.5, // horizontal tolerance for the motor protrusion 54 protrusion_tolerance_h=.5, // horizontal tolerance for the motor protrusion
54 protrusion_tolerance_v=.5, // vertical tolerance for the motor protrusion 55 protrusion_tolerance_v=.5, // vertical tolerance for the motor protrusion
55 mount_screw_d_tolerance=.4, 56 mount_screw_d_tolerance=.4,
56 idler_v_tolerance=.5, 57 idler_v_tolerance=.5,
57 knob_bore_d_tolerance=.6, 58 knob_bore_d_tolerance=.6,
58 st_nut_h_tolerance=.2, 59 st_nut_h_tolerance=.2,
59 st_nut_d_tolerance=.2,/* TODO: make it st_nut_w_tolerance */ 60 st_nut_d_tolerance=.2,/* TODO: make it st_nut_w_tolerance */
60 st_screw_d_tolerance=.3, 61 st_screw_d_tolerance=.3,
61 62
62 what="lever", // lever|body|knob|springpad|* 63 what="lever", // lever|body|knob|springpad|*
63 left=false, 64 left=false,
64 vitamins = true, 65 vitamins = true,
65 supports = false, bridges = true, 66 supports = false, bridges = true,
66 tensioner = true, 67 tensioner = true,
67 debug = false 68 debug = false
68) { 69) {
69 fnd = 2*PI; fnr = 2*fnd; 70 fnd = 2*PI; fnr = 2*fnd;
70 71
71 lever_shell = mount_screwhead_h+0.5; 72 lever_shell = mount_screwhead_h+0.5;
72 lever_thickness=max(spring_d+spring_d_clearance+layer_height*8,idler_h+idler_v_tolerance+2*lever_shell); 73 lever_thickness=max(spring_d+spring_d_clearance+layer_height*8,idler_h+idler_v_tolerance+2*lever_shell);
73 lsd = idler_d-idler_clearance*2; 74 lsd = idler_d-idler_clearance*2;
74 longwing=gearbox_d/2+spring_d/2+lsd/2; 75 longwing=gearbox_d/2+spring_d/2+lsd/2;
75 h_ = (pulley_d+idler_d)/(2*sqrt(2)); 76 h_ = (pulley_d+idler_d)/(2*sqrt(2));
76 ri = sqrt( pow(h_,2) + pow(mount_d/2-h_,2) ); 77 ri = sqrt( pow(h_,2) + pow(mount_d/2-h_,2) );
77 spring_dl = idler_travel*longwing/ri; 78 spring_dl = idler_travel*longwing/ri;
78 79
79 filament_elevation=protrusion_h+pulley_elevation+teeth_elevation; 80 filament_elevation=protrusion_h+pulley_elevation+teeth_elevation;
80 ls_z = filament_elevation; // leverspace mid-z 81 ls_z = filament_elevation; // leverspace mid-z
81 body_h = max(protrusion_h+bore_l,mount_screw_l-mounthole_depth/2+mount_screwhead_h,ls_z*2); 82 body_h = max(protrusion_h+bore_l,mount_screw_l-mounthole_depth/2+mount_screwhead_h,ls_z*2);
82 ls_h = lever_thickness+lever_v_clearance; // leverspace height 83 ls_h = lever_thickness+lever_v_clearance; // leverspace height
83 84
84 module mirrorleft() { 85 module mirrorleft() {
85 mirror([left?0:1,0,0]) children(); 86 mirror([left?0:1,0,0]) children();
86 } 87 }
87 module place_idler() { 88 module place_idler() {
88 rotate([0,0,45]) 89 rotate([0,0,45])
89 translate([(pulley_d+idler_d)/2,0,0]) 90 translate([(pulley_d+idler_d)/2,0,0])
90 children(); 91 children();
91 } 92 }
92 module finger_indent(d=lever_thickness,depth/*=1*/,r/*=15*/) { 93 module finger_indent(d=lever_thickness,depth/*=1*/,r/*=15*/) {
93 if(depth) { 94 if(depth) {
94 hh = (-4*pow(depth,2)+pow(d,2))/(8*depth); 95 hh = (-4*pow(depth,2)+pow(d,2))/(8*depth);
95 rr = depth+hh; 96 rr = depth+hh;
96 translate([0,0,hh]) sphere(r=rr,$fn=fnr*rr); 97 translate([0,0,hh]) sphere(r=rr,$fn=fnr*rr);
97 }else if(r) { 98 }else if(r) {
98 hh=sqrt(pow(r,2)-pow(d,2)/4); 99 hh=sqrt(pow(r,2)-pow(d,2)/4);
99 translate([0,0,hh]) sphere(r=r,$fn=fnr*r); 100 translate([0,0,hh]) sphere(r=r,$fn=fnr*r);
100 } 101 }
101 } 102 }
102 103
103 % if(vitamins) mirrorleft() { 104 % if(vitamins) mirrorleft() {
104 translate([0,0,-epsilon]) mirror([0,0,1]) cylinder(d=gearbox_d,h=1,$fn=60); 105 translate([0,0,-epsilon]) mirror([0,0,1]) cylinder(d=gearbox_d,h=1,$fn=60);
105 for(zr=[0:90:359]) rotate([0,0,zr]) translate([mount_d/2,0,0]) 106 for(zr=[0:90:359]) rotate([0,0,zr]) translate([mount_d/2,0,0])
106 cylinder(d=mount_screw_d,h=20,$fn=30); 107 cylinder(d=mount_screw_d,h=20,$fn=30);
107 translate([0,0,-epsilon]) cylinder(d=protrusion_d,h=protrusion_h,$fn=30); 108 translate([0,0,-epsilon]) cylinder(d=protrusion_d,h=protrusion_h,$fn=30);
108 translate([0,0,protrusion_h]) { 109 translate([0,0,protrusion_h]) {
109 difference() { 110 difference() {
@@ -183,150 +184,163 @@ module the_extruder(
183 translate([mount_d/2,0,0]) 184 translate([mount_d/2,0,0])
184 cylinder(d=mount_screw_d+mount_screw_d_tolerance,h=lever_thickness+2,center=true,$fn=fnd*mount_screw_d); 185 cylinder(d=mount_screw_d+mount_screw_d_tolerance,h=lever_thickness+2,center=true,$fn=fnd*mount_screw_d);
185 186
186 // lever end 187 // lever end
187 translate([mount_d/2,0,0]) rotate([0,90,0]) { 188 translate([mount_d/2,0,0]) rotate([0,90,0]) {
188 translate([0,-longwing,lsd/2]) finger_indent(d=lever_thickness-1,r=15); 189 translate([0,-longwing,lsd/2]) finger_indent(d=lever_thickness-1,r=15);
189 translate([0,-longwing,0]) 190 translate([0,-longwing,0])
190 mirror([0,0,1]) 191 mirror([0,0,1])
191 difference() { 192 difference() {
192 cylinder(d=spring_d+spring_d_clearance,h=lsd,$fn=fnd*(spring_d+spring_d_clearance)); 193 cylinder(d=spring_d+spring_d_clearance,h=lsd,$fn=fnd*(spring_d+spring_d_clearance));
193 sphere(d=spring_d*3/4,$fn=fnd*spring_d*3/4); 194 sphere(d=spring_d*3/4,$fn=fnd*spring_d*3/4);
194 } 195 }
195 }//rotate-translate 196 }//rotate-translate
196 }//difference 197 }//difference
197 // bridging patch 198 // bridging patch
198 if(bridges) place_idler() 199 if(bridges) place_idler()
199 translate([0,0,lever_thickness/2-mount_screwhead_h]) 200 translate([0,0,lever_thickness/2-mount_screwhead_h])
200 mirror([0,0,1]) 201 mirror([0,0,1])
201 cylinder(d=mount_screwhead_d,h=layer_height); 202 cylinder(d=mount_screwhead_d,h=layer_height);
202 }//translate 203 }//translate
203 }//lever module 204 }//lever module
204 205
205 module body() { 206 module body() {
206 difference() { 207 difference() {
207 union() { 208 union() {
208 cylinder(d=gearbox_d,h=body_h,$fn=fnd*gearbox_d); 209 cylinder(d=gearbox_d,h=body_h,$fn=fnd*gearbox_d);
209 // finger and spring support 210 // finger and spring support
210 fsw = gearbox_d-(gearbox_d-mount_d)/2-spring_lc; 211 fsw = gearbox_d-(gearbox_d-mount_d)/2-spring_lc;
211 translate([-gearbox_d/2,0,0]) difference() { 212 translate([-gearbox_d/2,0,0]) difference() {
212 union() { 213 union() {
213 hull() { 214 hull() {
214 translate([0,-longwing,ls_z]) 215 translate([0,-longwing,ls_z])
215 rotate([0,90,0]) 216 rotate([0,90,0])
216 cylinder(d=lever_thickness,h=fsw,$fn=fnd*lever_thickness); 217 cylinder(d=lever_thickness,h=fsw,$fn=fnd*lever_thickness);
217 hh=body_h-ls_z; 218 hh=body_h-ls_z;
218 translate([0,0,ls_z-lever_thickness/2]) 219 translate([0,0,ls_z-lever_thickness/2])
219 mirror([0,1,0]) cube(size=[fsw,longwing-hh+lever_thickness/sqrt(2),hh+lever_thickness/2]); 220 mirror([0,1,0]) cube(size=[fsw,longwing-hh+lever_thickness/sqrt(2),hh+lever_thickness/2]);
220 hhh=ls_z; 221 hhh=ls_z;
221 translate([0,0,0]) 222 translate([0,0,0])
222 mirror([0,1,0]) cube(size=[fsw,longwing-hhh+lever_thickness/sqrt(2),hhh+lever_thickness/2]); 223 mirror([0,1,0]) cube(size=[fsw,longwing-hhh+lever_thickness/sqrt(2),hhh+lever_thickness/2]);
223 } 224 }
224 } 225 }
225 translate([0,-longwing,ls_z]) rotate([0,-90,0]) { 226 translate([0,-longwing,ls_z]) rotate([0,-90,0]) {
226 if(!tensioner) finger_indent(d=lever_thickness-1,r=15); else { 227 if(!tensioner) finger_indent(d=lever_thickness-1,r=15); else {
227 mirror([0,0,1]) { 228 mirror([0,0,1]) {
228 translate([0,0,st_thickshell]) 229 translate([0,0,st_thickshell])
229 hull() for(o=[0,spring_d]) translate([0,-o,0]) 230 hull() for(o=[0,spring_d]) translate([0,-o,0])
230 rotate([0,0,30]) 231 rotate([0,0,30])
231 cylinder(d=st_nut_d+st_nut_d_tolerance,h=st_nut_h+st_nut_h_tolerance,$fn=6); 232 cylinder(d=st_nut_d+st_nut_d_tolerance,h=st_nut_h+st_nut_h_tolerance,$fn=6);
232 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)); 233 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));
233 bigd = spring_d+spring_d_clearance; 234 bigd = spring_d+spring_d_clearance;
234 hf = (bigd-st_screw_d-st_screw_d_tolerance)/2; 235 hf = (bigd-st_screw_d-st_screw_d_tolerance)/2;
235 translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell-epsilon]) 236 translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell-epsilon])
236 cylinder(d1=st_screw_d+st_screw_d_tolerance,d2=bigd, 237 cylinder(d1=st_screw_d+st_screw_d_tolerance,d2=bigd,
237 h=hf+epsilon, $fn=fnd*bigd); 238 h=hf+epsilon, $fn=fnd*bigd);
238 translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell+hf-epsilon]) 239 translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell+hf-epsilon])
239 cylinder(d=bigd,h=fsw+1,$fn=fnd*bigd); 240 cylinder(d=bigd,h=fsw+1,$fn=fnd*bigd);
240 } 241 }
241 } 242 }
242 } 243 }
243 } // translate 244 } // translate
244 245
245 // pushfit bracket 246 // pushfit bracket
246 translate([0,0,filament_elevation]) 247 translate([0,0,filament_elevation])
247 rotate([0,0,45]) translate([pulley_d/2,0,0]) 248 rotate([0,0,45]) translate([(pulley_d-filament_path_d)/2,0,0])
248 rotate([-90,0,0]) 249 rotate([-90,0,0])
249 translate([0,0,mount_d/sqrt(2)/2+mount_screw_d-gearbox_d/2/*TODO:*/]) 250 translate([0,0,mount_d/sqrt(2)/2+mount_screw_d-gearbox_d/2/*TODO:*/]) {
250 cylinder(r=min(body_h-filament_elevation,filament_elevation)/sin(60)-epsilon,h=pf_h(pf)+gearbox_d/2/*TODO:*/,$fn=6); 251 pfb2a = pf_d(pf)+2*pf_shell; pfba = pfb2a/2;
252 pfbd = pfb2a/cos(30);
253 pfbs = pfb2a*tan(30);
254 pfbl = pf_h(pf)+gearbox_d/2/*TODO:*/;
255 cylinder(d=pfbd,h=pfbl,$fn=6);
256 translate([-pfbs/2,0,0]) {
257 hull() {
258 translate([0,-pfba,0]) cube(size=[pfbs,pfb2a,pfbl]);
259 cube(size=[pfbs,filament_elevation,pfbl-filament_elevation+pfba]);
260 mirror([0,1,0])
261 cube(size=[pfbs,body_h-filament_elevation,pfbl-body_h+filament_elevation+pfba]);
262 }
263 }
264 }
251 }//union (first child of difference) 265 }//union (first child of difference)
252 266
253 // protrusion 267 // protrusion
254 translate([0,0,-1]) 268 translate([0,0,-1])
255 cylinder(d=protrusion_d+protrusion_tolerance_h,h=protrusion_h+protrusion_tolerance_v+1,$fn=fnd*(protrusion_d+protrusion_tolerance_h)); 269 cylinder(d=protrusion_d+protrusion_tolerance_h,h=protrusion_h+protrusion_tolerance_v+1,$fn=fnd*(protrusion_d+protrusion_tolerance_h));
256 // mount screw holes 270 // mount screw holes
257 for(zr=[0:90:359]) rotate([0,0,zr]) translate([mount_d/2,0,0]) { 271 for(zr=[0:90:359]) rotate([0,0,zr]) translate([mount_d/2,0,0]) {
258 translate([0,0,mount_screw_l-mounthole_depth/2-(bridges?layer_height:-epsilon)]) 272 translate([0,0,mount_screw_l-mounthole_depth/2-(bridges?layer_height:-epsilon)])
259 mirror([0,0,1]) 273 mirror([0,0,1])
260 cylinder(d=mount_screw_d+mount_screw_d_tolerance, 274 cylinder(d=mount_screw_d+mount_screw_d_tolerance,
261 h=mount_screw_l-mounthole_depth/2+1, 275 h=mount_screw_l-mounthole_depth/2+1,
262 $fn=fnd*(mount_screw_d+mount_screw_d_tolerance)); 276 $fn=fnd*(mount_screw_d+mount_screw_d_tolerance));
263 translate([0,0,mount_screw_l-mounthole_depth/2]) 277 translate([0,0,mount_screw_l-mounthole_depth/2])
264 cylinder(d=mount_screwhead_d,h=body_h+1,$fn=fnd*mount_screwhead_d); 278 cylinder(d=mount_screwhead_d,h=body_h+1,$fn=fnd*mount_screwhead_d);
265 }//for 279 }//for
266 // pushfit 280 // pushfit
267 translate([0,0,filament_elevation]) 281 translate([0,0,filament_elevation])
268 rotate([0,0,45]) translate([pulley_d/2,0,0]) 282 rotate([0,0,45]) translate([(pulley_d-filament_path_d)/2,0,0])
269 rotate([-90,0,0]) 283 rotate([-90,0,0])
270 translate([0,0,mount_d/sqrt(2)/2+mount_screw_d+epsilon]) 284 translate([0,0,mount_d/sqrt(2)/2+mount_screw_d+epsilon])
271 rotate([0,0,180]) { 285 rotate([0,0,180]) {
272 pushfit(pf); 286 pushfit(pf);
273 cylinder(d=filament_guide_d,h=gearbox_d,center=true,$fn=fnd*filament_guide_d); 287 cylinder(d=filament_guide_d,h=gearbox_d,center=true,$fn=fnd*filament_guide_d);
274 translate([0,-filament_guide_d/2/sqrt(2),0]) 288 translate([0,-filament_guide_d/2/sqrt(2),0])
275 rotate([0,0,45]) 289 rotate([0,0,45])
276 cube(size=[filament_guide_d/2,filament_guide_d/2,gearbox_d],center=true); 290 cube(size=[filament_guide_d/2,filament_guide_d/2,gearbox_d],center=true);
277 }//rotate translate rotate translate rotate translate 291 }//rotate translate rotate translate rotate translate
278 // pulley 292 // pulley
279 cylinder(d=pulley_d+pulley_clearance,h=body_h+1,$fn=fnd*(pulley_d+pulley_clearance)); 293 cylinder(d=pulley_d+pulley_clearance,h=body_h+1,$fn=fnd*(pulley_d+pulley_clearance));
280 // leverspace 294 // leverspace
281 hull() for(x=[0,gearbox_d]) 295 hull() for(x=[0,gearbox_d])
282 rotate([0,0,45]) 296 rotate([0,0,45])
283 translate([x,0,ls_z-ls_h/2]) 297 translate([x,0,ls_z-ls_h/2])
284 cylinder(d=idler_d+idler_clearance,h=ls_h,$fn=fnd*(idler_d+idler_clearance)); 298 cylinder(d=idler_d+idler_clearance,h=ls_h,$fn=fnd*(idler_d+idler_clearance));
285 299
286 // idler clearance 300 // idler clearance
287 a=cos(45)*(pulley_d+idler_d)/2; 301 a=cos(45)*(pulley_d+idler_d)/2;
288 b=mount_d/2-a; 302 b=mount_d/2-a;
289 x=sqrt(pow(a,2)+pow(b,2)); 303 x=sqrt(pow(a,2)+pow(b,2));
290 translate([mount_d/2,0,ls_z]) 304 translate([mount_d/2,0,ls_z])
291 intersection() { 305 intersection() {
292 r = x+idler_d/2+idler_clearance; 306 r = x+idler_d/2+idler_clearance;
293 cylinder(r=r,h=ls_h,center=true); 307 cylinder(r=r,h=ls_h,center=true);
294 translate([-r-1,0,-ls_h/2-1]) cube(size=[2*r+2,r+1,ls_h+2]); 308 translate([-r-1,0,-ls_h/2-1]) cube(size=[2*r+2,r+1,ls_h+2]);
295 } 309 }
296 310
297 // back side cutout 311 // back side cutout
298 a0 = asin((mount_screwhead_d+2*extrusion_width)/mount_d); 312 a0 = asin((mount_screwhead_d+2*extrusion_width)/mount_d);
299 a1 = atan((longwing-lever_thickness/2)/(gearbox_d/2)); 313 a1 = atan((longwing-lever_thickness/2)/(gearbox_d/2));
300 translate([0,0,ls_z]) hull() { 314 translate([0,0,ls_z]) hull() {
301 rotate([0,0,-180+a0]) 315 rotate([0,0,-180+a0])
302 rotate_extrude(angle=a1-a0) 316 rotate_extrude(angle=a1-a0)
303 translate([0,-ls_h/2]) 317 translate([0,-ls_h/2])
304 square([sqrt(pow(gearbox_d/2,2)+pow(longwing-lever_thickness/2,2))+1, 318 square([sqrt(pow(gearbox_d/2,2)+pow(longwing-lever_thickness/2,2))+1,
305 ls_h]); 319 ls_h]);
306 cylinder(d=bore_d/2/*TODO:recalculate angles based on this, 320 cylinder(d=bore_d/2/*TODO:recalculate angles based on this,
307 too lazy to do that now*/, 321 too lazy to do that now*/,
308 h=ls_h,center=true); 322 h=ls_h,center=true);
309 } 323 }
310 324
311 rotate([0,0,-45]) 325 rotate([0,0,-45])
312 translate([0,0,ls_z-ls_h/2]) 326 translate([0,0,ls_z-ls_h/2])
313 cube(size=[gearbox_d,gearbox_d,lever_thickness+lever_v_clearance]); 327 cube(size=[gearbox_d,gearbox_d,lever_thickness+lever_v_clearance]);
314 translate([0,0,ls_z-ls_h/2]) { 328 translate([0,0,ls_z-ls_h/2]) {
315 translate([mount_screwhead_d/2,0,0]) 329 translate([mount_screwhead_d/2,0,0])
316 mirror([0,1,0]) 330 mirror([0,1,0])
317 cube(size=[gearbox_d,gearbox_d/2+1,lever_thickness+lever_v_clearance]); 331 cube(size=[gearbox_d,gearbox_d/2+1,lever_thickness+lever_v_clearance]);
318 } 332 }
319 //translate([-mount_d/2,-longwing,filament_elevation]) 333 //translate([-mount_d/2,-longwing,filament_elevation])
320 if(!tensioner) /* XXX: this seems to be bullshit, but it's so old, that it's historical bullshit */ 334 if(!tensioner) /* XXX: this seems to be bullshit, but it's so old, that it's historical bullshit */
321 translate([mount_d/2,-longwing,filament_elevation]) 335 translate([mount_d/2,-longwing,filament_elevation])
322 rotate([0,-90,0]) difference() { 336 rotate([0,-90,0]) difference() {
323 cylinder(d=spring_d+spring_d_clearance,h=spring_lc+spring_dl,$fn=fnd*(spring_d+spring_d_clearance)); 337 cylinder(d=spring_d+spring_d_clearance,h=spring_lc+spring_dl,$fn=fnd*(spring_d+spring_d_clearance));
324 translate([0,0,spring_lc+spring_dl]) sphere(d=spring_d*3/4,$fn=fnd*spring_d*3/4); 338 translate([0,0,spring_lc+spring_dl]) sphere(d=spring_d*3/4,$fn=fnd*spring_d*3/4);
325 } 339 }
326 340
327 }//difference 341 }//difference
328 342
329 if(supports) intersection() { 343 if(supports) intersection() {
330 difference() { 344 difference() {
331 translate([0,0,ls_z-ls_h/2-epsilon]) 345 translate([0,0,ls_z-ls_h/2-epsilon])
332 cylinder(d=gearbox_d,h=ls_h+2*epsilon,$fn=fnd*gearbox_d); 346 cylinder(d=gearbox_d,h=ls_h+2*epsilon,$fn=fnd*gearbox_d);