summaryrefslogtreecommitdiff
authorMichael Krelin <hacker@klever.net>2018-08-25 17:25:36 (UTC)
committer Michael Krelin <hacker@klever.net>2018-08-25 17:25:36 (UTC)
commit0efd2acb72d92bc51a8d56592e4171f619b15f79 (patch) (unidiff)
treede9c32666b22a86ecd77ed7f736961666bef43c2
parent4cb9b4ab0175173b4c89b8d22c571ec05a3aeea7 (diff)
downloadextrudery-0efd2acb72d92bc51a8d56592e4171f619b15f79.zip
extrudery-0efd2acb72d92bc51a8d56592e4171f619b15f79.tar.gz
extrudery-0efd2acb72d92bc51a8d56592e4171f619b15f79.tar.bz2
move fsw
Diffstat (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 a3f5dc9..74b7ffa 100644
--- a/another.scad
+++ b/another.scad
@@ -1,428 +1,428 @@
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 mounthole_min_depth = 3, mounthole_max_depth = 4, 14 mounthole_min_depth = 3, mounthole_max_depth = 4,
15 protrusion_d = 22, protrusion_h = 2.2, // the dimensions of the protrusion on top of gearbox 15 protrusion_d = 22, protrusion_h = 2.2, // the dimensions of the protrusion on top of gearbox
16 bore_d = 8, bore_l = 17.6, 16 bore_d = 8, bore_l = 17.6,
17 bore_dd = 7, 17 bore_dd = 7,
18 // pulley properties 18 // pulley properties
19 pulley_d = 11.5, pulley_h=10, 19 pulley_d = 11.5, pulley_h=10,
20 pulley_elevation = 1, // pulley elevation above the protrusion 20 pulley_elevation = 1, // pulley elevation above the protrusion
21 teeth_elevation = 7.5, // distance from the bottom of the pulley to its teeth 21 teeth_elevation = 7.5, // distance from the bottom of the pulley to its teeth
22 filament_offset = (8.25-(3.0+3.5)/2) - 11.5/2 + 1.75/2, 22 filament_offset = (8.25-(3.0+3.5)/2) - 11.5/2 + 1.75/2,
23 // idler properties 23 // idler properties
24 idler_d = 9.5, idler_h = 4, idler_id = 3,// idler dimensions: outer and inner diameters and height 24 idler_d = 9.5, idler_h = 4, idler_id = 3,// idler dimensions: outer and inner diameters and height
25 // spring properties 25 // spring properties
26 spring_d = 10, spring_lc = 9.6, // spring diameter and compressed length 26 spring_d = 10, spring_lc = 9.6, // spring diameter and compressed length
27 // filament path properties 27 // filament path properties
28 filament_d = 1.75, 28 filament_d = 1.75,
29 filament_path_d = 2, 29 filament_path_d = 2,
30 filament_guide_d = 4, // PTFE filament guide diameter 30 filament_guide_d = 4, // PTFE filament guide diameter
31 // knob properties 31 // knob properties
32 knob_h = 10, 32 knob_h = 10,
33 knob_bore_l = 4, 33 knob_bore_l = 4,
34 knob_indent_d = 4, 34 knob_indent_d = 4,
35 knob_indents = 12, 35 knob_indents = 12,
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 lever_v_clearance=.7, // vertical clearance for the lever 55 lever_v_clearance=.7, // vertical clearance for the lever
56 spring_d_clearance=1, 56 spring_d_clearance=1,
57 protrusion_tolerance_h=.5, // horizontal tolerance for the motor protrusion 57 protrusion_tolerance_h=.5, // horizontal tolerance for the motor protrusion
58 protrusion_tolerance_v=.5, // vertical tolerance for the motor protrusion 58 protrusion_tolerance_v=.5, // vertical tolerance for the motor protrusion
59 mount_screw_d_tolerance=.4, 59 mount_screw_d_tolerance=.4,
60 idler_v_tolerance=.5, 60 idler_v_tolerance=.5,
61 knob_bore_d_tolerance=.6, 61 knob_bore_d_tolerance=.6,
62 st_nut_h_tolerance=.2, 62 st_nut_h_tolerance=.2,
63 st_nut_d_tolerance=.2,/* TODO: make it st_nut_w_tolerance */ 63 st_nut_d_tolerance=.2,/* TODO: make it st_nut_w_tolerance */
64 st_screw_d_tolerance=.5, 64 st_screw_d_tolerance=.5,
65 st_split_w_tolerance = .3, 65 st_split_w_tolerance = .3,
66 66
67 min_z_shell = 4*layer_height, // the very minimal shell thickness along z-axis. 67 min_z_shell = 4*layer_height, // the very minimal shell thickness along z-axis.
68 min_xy_shell = 2*extrusion_width, 68 min_xy_shell = 2*extrusion_width,
69 69
70 what="lever", // lever|body|knob|springpad|* 70 what="lever", // lever|body|knob|springpad|*
71 left=false, 71 left=false,
72 vitamins = true, 72 vitamins = true,
73 supports = false, bridges = true, 73 supports = false, bridges = true,
74 tensioner = true, 74 tensioner = true,
75 debug = false 75 debug = false
76) { 76) {
77 fnd = 2*PI; fnr = 2*fnd; 77 fnd = 2*PI; fnr = 2*fnd;
78 78
79 idler_filament_offset = filament_path_d/2; // -filament_offset; 79 idler_filament_offset = filament_path_d/2; // -filament_offset;
80 lever_shell = mount_screwhead_h+0.5; 80 lever_shell = mount_screwhead_h+0.5;
81 lever_thickness=max(spring_d+spring_d_clearance+layer_height*8,idler_h+idler_v_tolerance+2*lever_shell); 81 lever_thickness=max(spring_d+spring_d_clearance+layer_height*8,idler_h+idler_v_tolerance+2*lever_shell);
82 lsd = idler_d-idler_clearance*2; 82 lsd = idler_d-idler_clearance*2;
83 longwing=gearbox_d/2+spring_d/2+lsd/2; 83 longwing=gearbox_d/2+spring_d/2+lsd/2;
84 shortwing = let(a=mount_d/2,c=(pulley_d+idler_d)/2/sqrt(2)) 84 shortwing = let(a=mount_d/2,c=(pulley_d+idler_d)/2/sqrt(2))
85 sqrt(c*c+pow(a-c,2)); 85 sqrt(c*c+pow(a-c,2));
86 longwing_travel = idler_travel*longwing/shortwing; 86 longwing_travel = idler_travel*longwing/shortwing;
87 h_ = (pulley_d+idler_d)/(2*sqrt(2)); 87 h_ = (pulley_d+idler_d)/(2*sqrt(2));
88 ri = sqrt( pow(h_,2) + pow(mount_d/2-h_,2) ); 88 ri = sqrt( pow(h_,2) + pow(mount_d/2-h_,2) );
89 spring_dl = idler_travel*longwing/ri; 89 spring_dl = idler_travel*longwing/ri;
90 // finger and spring support
91 fsw = gearbox_d-(gearbox_d-mount_d)/2-max(spring_lc,longwing_travel+(gearbox_d-mount_d)/2);
90 92
91 mount_min_depth = mounthole_min_depth ? mounthole_min_depth : mounthole_depth-1; 93 mount_min_depth = mounthole_min_depth ? mounthole_min_depth : mounthole_depth-1;
92 mount_max_depth = mounthole_max_depth ? mounthole_max_depth : mounthole_depth+1; 94 mount_max_depth = mounthole_max_depth ? mounthole_max_depth : mounthole_depth+1;
93 filament_elevation=protrusion_h+pulley_elevation+teeth_elevation; 95 filament_elevation=protrusion_h+pulley_elevation+teeth_elevation;
94 ls_z = filament_elevation; // leverspace mid-z 96 ls_z = filament_elevation; // leverspace mid-z
95 ls_h = lever_thickness+lever_v_clearance; // leverspace height 97 ls_h = lever_thickness+lever_v_clearance; // leverspace height
96 mount_depth = mount_screw_l - (ls_z+ls_h/2+min_z_shell); 98 mount_depth = mount_screw_l - (ls_z+ls_h/2+min_z_shell);
97 body_h = max(protrusion_h+bore_l,mount_screw_l-mount_depth+mount_screwhead_h+min_z_shell,ls_z*2); 99 body_h = max(protrusion_h+bore_l,mount_screw_l-mount_depth+mount_screwhead_h+min_z_shell,ls_z*2);
98 echo("mount depth",mount_depth); 100 echo("mount depth",mount_depth);
99 101
100 module teardrop(r,d,h,center=false,angle=45) { 102 module teardrop(r,d,h,center=false,angle=45) {
101 dd = d ? d : (2*r); 103 dd = d ? d : (2*r);
102 $fn = dd*fnd; 104 $fn = dd*fnd;
103 cylinder(d=dd,h=h,center=center); 105 cylinder(d=dd,h=h,center=center);
104 if(angle>0) translate([0,0,center?-h/2:0]) 106 if(angle>0) translate([0,0,center?-h/2:0])
105 rotate([0,0,angle]) 107 rotate([0,0,angle])
106 cube(size=[d/2,d/2,h]); 108 cube(size=[d/2,d/2,h]);
107 } 109 }
108 110
109 module mirrorleft() { 111 module mirrorleft() {
110 mirror([left?0:1,0,0]) children(); 112 mirror([left?0:1,0,0]) children();
111 } 113 }
112 module place_idler() { 114 module place_idler() {
113 rotate([0,0,45]) 115 rotate([0,0,45])
114 translate([(pulley_d+idler_d)/2,0,0]) 116 translate([(pulley_d+idler_d)/2,0,0])
115 children(); 117 children();
116 } 118 }
117 module finger_indent(d=lever_thickness,depth/*=1*/,r/*=15*/) { 119 module finger_indent(d=lever_thickness,depth/*=1*/,r/*=15*/) {
118 if(depth) { 120 if(depth) {
119 hh = (-4*pow(depth,2)+pow(d,2))/(8*depth); 121 hh = (-4*pow(depth,2)+pow(d,2))/(8*depth);
120 rr = depth+hh; 122 rr = depth+hh;
121 translate([0,0,hh]) sphere(r=rr,$fn=fnr*rr); 123 translate([0,0,hh]) sphere(r=rr,$fn=fnr*rr);
122 }else if(r) { 124 }else if(r) {
123 hh=sqrt(pow(r,2)-pow(d,2)/4); 125 hh=sqrt(pow(r,2)-pow(d,2)/4);
124 translate([0,0,hh]) sphere(r=r,$fn=fnr*r); 126 translate([0,0,hh]) sphere(r=r,$fn=fnr*r);
125 } 127 }
126 } 128 }
127 129
128 % if(vitamins) mirrorleft() { 130 % if(vitamins) mirrorleft() {
129 translate([0,0,-epsilon]) mirror([0,0,1]) cylinder(d=gearbox_d,h=1,$fn=60); 131 translate([0,0,-epsilon]) mirror([0,0,1]) cylinder(d=gearbox_d,h=1,$fn=60);
130 for(zr=[0:90:359]) rotate([0,0,zr]) translate([mount_d/2,0,0]) 132 for(zr=[0:90:359]) rotate([0,0,zr]) translate([mount_d/2,0,0])
131 cylinder(d=mount_screw_d,h=20,$fn=30); 133 cylinder(d=mount_screw_d,h=20,$fn=30);
132 translate([0,0,-epsilon]) cylinder(d=protrusion_d,h=protrusion_h,$fn=30); 134 translate([0,0,-epsilon]) cylinder(d=protrusion_d,h=protrusion_h,$fn=30);
133 translate([0,0,protrusion_h]) { 135 translate([0,0,protrusion_h]) {
134 difference() { 136 difference() {
135 cylinder(d=bore_d,h=bore_l,$fn=30); 137 cylinder(d=bore_d,h=bore_l,$fn=30);
136 translate([-bore_d/2-1,bore_dd-bore_d/2,-1]) 138 translate([-bore_d/2-1,bore_dd-bore_d/2,-1])
137 cube([bore_d+2,bore_d/2,bore_l+2]); 139 cube([bore_d+2,bore_d/2,bore_l+2]);
138 } 140 }
139 translate([0,0,pulley_elevation]) { 141 translate([0,0,pulley_elevation]) {
140 cylinder(d=pulley_d,h=pulley_h,$fn=30); 142 cylinder(d=pulley_d,h=pulley_h,$fn=30);
141 translate([0,0,teeth_elevation]) { 143 translate([0,0,teeth_elevation]) {
142 place_idler() { 144 place_idler() {
143 cylinder(d=idler_d,h=idler_h,center=true,$fn=30); 145 cylinder(d=idler_d,h=idler_h,center=true,$fn=30);
144 cylinder(d=idler_screw_d,h=lever_thickness+2,center=true,$fn=30); 146 cylinder(d=idler_screw_d,h=lever_thickness+2,center=true,$fn=30);
145 }//place idler 147 }//place idler
146 // filament path 148 // filament path
147 rotate([0,0,45]) { 149 rotate([0,0,45]) {
148 translate([pulley_d/2-idler_filament_offset,0,0]) rotate([90,0,0]) { 150 translate([pulley_d/2-idler_filament_offset,0,0]) rotate([90,0,0]) {
149 cylinder(d=filament_d,h=gearbox_d,center=false,$fn=15); 151 cylinder(d=filament_d,h=gearbox_d,center=false,$fn=15);
150 }//rotate translate 152 }//rotate translate
151 translate([pulley_d/2+filament_offset,0,0]) rotate([-90,0,0]) { 153 translate([pulley_d/2+filament_offset,0,0]) rotate([-90,0,0]) {
152 cylinder(d=filament_d,h=gearbox_d,center=false,$fn=15); 154 cylinder(d=filament_d,h=gearbox_d,center=false,$fn=15);
153 translate([0,0,mount_d/sqrt(2)/2+mount_screw_d]) 155 translate([0,0,mount_d/sqrt(2)/2+mount_screw_d])
154 pushfit(pf); 156 pushfit(pf);
155 }//rotate translate 157 }//rotate translate
156 }//rotate 158 }//rotate
157 }//translate teeth 159 }//translate teeth
158 }//translate pulley 160 }//translate pulley
159 }//translate protrusion 161 }//translate protrusion
160 }//vitamins 162 }//vitamins
161 163
162 module lever() { 164 module lever() {
163 translate([0,0,protrusion_h+pulley_elevation+teeth_elevation]) { 165 translate([0,0,protrusion_h+pulley_elevation+teeth_elevation]) {
164 difference() { 166 difference() {
165 union() { 167 union() {
166 hull() { 168 hull() {
167 place_idler() 169 place_idler()
168 cylinder(d=lsd,h=lever_thickness,center=true,$fn=60); 170 cylinder(d=lsd,h=lever_thickness,center=true,$fn=60);
169 translate([mount_d/2,0,0]) 171 translate([mount_d/2,0,0])
170 cylinder(d=lsd,h=lever_thickness,center=true,$fn=60); 172 cylinder(d=lsd,h=lever_thickness,center=true,$fn=60);
171 }//hull 173 }//hull
172 hull() { 174 hull() {
173 translate([mount_d/2,0,0]) 175 translate([mount_d/2,0,0])
174 cylinder(d=lsd,h=lever_thickness,center=true,$fn=60); 176 cylinder(d=lsd,h=lever_thickness,center=true,$fn=60);
175 translate([mount_d/2,-longwing,0]) rotate([0,90,0]) 177 translate([mount_d/2,-longwing,0]) rotate([0,90,0])
176 cylinder(d=lever_thickness,h=lsd,center=true,$fn=60); 178 cylinder(d=lever_thickness,h=lsd,center=true,$fn=60);
177 }//hull 179 }//hull
178 }//union 180 }//union
179 181
180 // filament path 182 // filament path
181 place_idler() 183 place_idler()
182 translate([-idler_d/2-idler_filament_offset,0,0]) 184 translate([-idler_d/2-idler_filament_offset,0,0])
183 rotate([90,0,0]) { 185 rotate([90,0,0]) {
184 mirror([0,1,0]) 186 mirror([0,1,0])
185 teardrop(d=filament_path_d,h=3*gearbox_d,center=true); 187 teardrop(d=filament_path_d,h=3*gearbox_d,center=true);
186 translate([0,0, 188 translate([0,0,
187 sqrt(2)*(mount_d-pulley_d+lsd)/2 189 sqrt(2)*(mount_d-pulley_d+lsd)/2
188 ]) { 190 ]) {
189 cylinder(d1=filament_path_d,d2=2*filament_path_d, 191 cylinder(d1=filament_path_d,d2=2*filament_path_d,
190 h=filament_path_d,$fn=2*filament_path_d*fnd); 192 h=filament_path_d,$fn=2*filament_path_d*fnd);
191 translate([0,0,filament_path_d-epsilon]) 193 translate([0,0,filament_path_d-epsilon])
192 cylinder(d=2*filament_path_d,h=lsd,$fn=2*filament_path_d*fnd); 194 cylinder(d=2*filament_path_d,h=lsd,$fn=2*filament_path_d*fnd);
193 }//translate 195 }//translate
194 }//rotate translate place_idler 196 }//rotate translate place_idler
195 197
196 // idler space and mounting hole 198 // idler space and mounting hole
197 place_idler() { 199 place_idler() {
198 difference() { 200 difference() {
199 cylinder(d=idler_d+idler_clearance*2,h=idler_h+idler_v_tolerance,center=true,$fn=60); 201 cylinder(d=idler_d+idler_clearance*2,h=idler_h+idler_v_tolerance,center=true,$fn=60);
200 if(supports) for(y=[-lsd/2+extrusion_width:(lsd-2*extrusion_width)/3:lsd/2-extrusion_width]) 202 if(supports) for(y=[-lsd/2+extrusion_width:(lsd-2*extrusion_width)/3:lsd/2-extrusion_width])
201 translate([-lsd/2-1,y-extrusion_width/2,-idler_h/2-idler_v_tolerance/2-1]) 203 translate([-lsd/2-1,y-extrusion_width/2,-idler_h/2-idler_v_tolerance/2-1])
202 cube(size=[lsd+2,extrusion_width,idler_h+idler_v_tolerance+2]); 204 cube(size=[lsd+2,extrusion_width,idler_h+idler_v_tolerance+2]);
203 } 205 }
204 cylinder(d=idler_screw_d,h=lever_thickness+2,center=true,$fn=30); 206 cylinder(d=idler_screw_d,h=lever_thickness+2,center=true,$fn=30);
205 translate([0,0,lever_thickness/2-idler_screwhead_h]) 207 translate([0,0,lever_thickness/2-idler_screwhead_h])
206 cylinder(d=idler_screwhead_d,h=idler_screwhead_h+1,$fn=fnd*idler_screwhead_d); 208 cylinder(d=idler_screwhead_d,h=idler_screwhead_h+1,$fn=fnd*idler_screwhead_d);
207 } 209 }
208 // mounting screw hole 210 // mounting screw hole
209 translate([mount_d/2,0,0]) 211 translate([mount_d/2,0,0])
210 cylinder(d=mount_screw_d+mount_screw_d_tolerance,h=lever_thickness+2,center=true,$fn=fnd*mount_screw_d); 212 cylinder(d=mount_screw_d+mount_screw_d_tolerance,h=lever_thickness+2,center=true,$fn=fnd*mount_screw_d);
211 213
212 // lever end 214 // lever end
213 translate([mount_d/2,0,0]) rotate([0,90,0]) { 215 translate([mount_d/2,0,0]) rotate([0,90,0]) {
214 translate([0,-longwing,lsd/2]) finger_indent(d=lever_thickness-1,r=15); 216 translate([0,-longwing,lsd/2]) finger_indent(d=lever_thickness-1,r=15);
215 translate([0,-longwing,0]) 217 translate([0,-longwing,0])
216 mirror([0,0,1]) 218 mirror([0,0,1])
217 difference() { 219 difference() {
218 cylinder(d=spring_d+spring_d_clearance,h=lsd,$fn=fnd*(spring_d+spring_d_clearance)); 220 cylinder(d=spring_d+spring_d_clearance,h=lsd,$fn=fnd*(spring_d+spring_d_clearance));
219 sphere(d=spring_d*3/4,$fn=fnd*spring_d*3/4); 221 sphere(d=spring_d*3/4,$fn=fnd*spring_d*3/4);
220 } 222 }
221 }//rotate-translate 223 }//rotate-translate
222 }//difference 224 }//difference
223 // bridging patch 225 // bridging patch
224 if(bridges) place_idler() 226 if(bridges) place_idler()
225 translate([0,0,lever_thickness/2-mount_screwhead_h]) 227 translate([0,0,lever_thickness/2-mount_screwhead_h])
226 mirror([0,0,1]) 228 mirror([0,0,1])
227 cylinder(d=mount_screwhead_d,h=layer_height); 229 cylinder(d=mount_screwhead_d,h=layer_height);
228 }//translate 230 }//translate
229 }//lever module 231 }//lever module
230 232
231 module body() { 233 module body() {
232 difference() { 234 difference() {
233 union() { 235 union() {
234 cylinder(d=gearbox_d,h=body_h,$fn=fnd*gearbox_d); 236 cylinder(d=gearbox_d,h=body_h,$fn=fnd*gearbox_d);
235 // finger and spring support
236 fsw = gearbox_d-(gearbox_d-mount_d)/2-max(spring_lc,longwing_travel+(gearbox_d-mount_d)/2);
237 translate([-gearbox_d/2,0,0]) difference() { 237 translate([-gearbox_d/2,0,0]) difference() {
238 union() { 238 union() {
239 hull() { 239 hull() {
240 translate([0,-longwing,ls_z]) 240 translate([0,-longwing,ls_z])
241 rotate([0,90,0]) 241 rotate([0,90,0])
242 cylinder(d=lever_thickness,h=fsw,$fn=fnd*lever_thickness); 242 cylinder(d=lever_thickness,h=fsw,$fn=fnd*lever_thickness);
243 hh=body_h-ls_z; 243 hh=body_h-ls_z;
244 translate([0,0,ls_z]) 244 translate([0,0,ls_z])
245 mirror([0,1,0]) cube(size=[fsw,longwing+(st_thinshell+st_split_w_tolerance)/2+st_thickshell,body_h-ls_z]); 245 mirror([0,1,0]) cube(size=[fsw,longwing+(st_thinshell+st_split_w_tolerance)/2+st_thickshell,body_h-ls_z]);
246 hhh=ls_z; 246 hhh=ls_z;
247 translate([0,0,0]) 247 translate([0,0,0])
248 mirror([0,1,0]) cube(size=[fsw,longwing-hhh+lever_thickness/sqrt(2),hhh+lever_thickness/2]); 248 mirror([0,1,0]) cube(size=[fsw,longwing-hhh+lever_thickness/sqrt(2),hhh+lever_thickness/2]);
249 } 249 }
250 } 250 }
251 translate([0,-longwing,ls_z]) rotate([0,-90,0]) { 251 translate([0,-longwing,ls_z]) rotate([0,-90,0]) {
252 if(!tensioner) finger_indent(d=lever_thickness-1,r=15); else { 252 if(!tensioner) finger_indent(d=lever_thickness-1,r=15); else {
253 mirror([0,0,1]) { 253 mirror([0,0,1]) {
254 translate([0,0,st_thickshell]) 254 translate([0,0,st_thickshell])
255 hull() for(o=[0,spring_d]) translate([0,-o,0]) 255 hull() for(o=[0,spring_d]) translate([0,-o,0])
256 rotate([0,0,30]) 256 rotate([0,0,30])
257 cylinder(d=st_nut_d+st_nut_d_tolerance,h=st_nut_h+st_nut_h_tolerance,$fn=6); 257 cylinder(d=st_nut_d+st_nut_d_tolerance,h=st_nut_h+st_nut_h_tolerance,$fn=6);
258 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)); 258 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));
259 bigd = spring_d+spring_d_clearance; 259 bigd = spring_d+spring_d_clearance;
260 hf = (bigd-st_screw_d-st_screw_d_tolerance)/2; 260 hf = (bigd-st_screw_d-st_screw_d_tolerance)/2;
261 translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell-epsilon]) { 261 translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell-epsilon]) {
262 cylinder(d1=st_screw_d+st_screw_d_tolerance,d2=bigd, 262 cylinder(d1=st_screw_d+st_screw_d_tolerance,d2=bigd,
263 h=hf+epsilon, $fn=fnd*bigd); 263 h=hf+epsilon, $fn=fnd*bigd);
264 translate([0,-(st_thinshell+st_split_w_tolerance)/2,0]) 264 translate([0,-(st_thinshell+st_split_w_tolerance)/2,0])
265 cube(size=[body_h-ls_z+1,st_thinshell+st_split_w_tolerance,fsw+1]); 265 cube(size=[body_h-ls_z+1,st_thinshell+st_split_w_tolerance,fsw+1]);
266 } 266 }
267 translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell+hf-epsilon]) 267 translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell+hf-epsilon])
268 cylinder(d=bigd,h=fsw+1,$fn=fnd*bigd); 268 cylinder(d=bigd,h=fsw+1,$fn=fnd*bigd);
269 } 269 }
270 } 270 }
271 } 271 }
272 } // translate 272 } // translate
273 273
274 // pushfit bracket 274 // pushfit bracket
275 translate([0,0,filament_elevation]) 275 translate([0,0,filament_elevation])
276 rotate([0,0,45]) translate([pulley_d/2+filament_offset,0,0]) 276 rotate([0,0,45]) translate([pulley_d/2+filament_offset,0,0])
277 rotate([-90,0,0]) 277 rotate([-90,0,0])
278 translate([0,0,mount_d/sqrt(2)/2+mount_screw_d-gearbox_d/2/*TODO:*/]) { 278 translate([0,0,mount_d/sqrt(2)/2+mount_screw_d-gearbox_d/2/*TODO:*/]) {
279 pfbl = pf_h(pf)+gearbox_d/2; //TODO: 279 pfbl = pf_h(pf)+gearbox_d/2; //TODO:
280 if(pf_smooth) { 280 if(pf_smooth) {
281 pfbd = pf_d(pf)+2*pf_shell; 281 pfbd = pf_d(pf)+2*pf_shell;
282 hull() { 282 hull() {
283 cylinder(d=pfbd,h=pfbl,$fn=pfbd*fnd); 283 cylinder(d=pfbd,h=pfbl,$fn=pfbd*fnd);
284 translate([-epsilon/2,0,0]) { 284 translate([-epsilon/2,0,0]) {
285 cube(size=[epsilon,filament_elevation,pfbl-filament_elevation+pfbd/2]); 285 cube(size=[epsilon,filament_elevation,pfbl-filament_elevation+pfbd/2]);
286 mirror([0,1,0]) 286 mirror([0,1,0])
287 cube(size=[epsilon,body_h-filament_elevation,pfbl-body_h+filament_elevation+pfbd/2]); 287 cube(size=[epsilon,body_h-filament_elevation,pfbl-body_h+filament_elevation+pfbd/2]);
288 }//translate 288 }//translate
289 }//hull 289 }//hull
290 }else{ 290 }else{
291 pfb2a = pf_d(pf)+2*pf_shell; pfba = pfb2a/2; 291 pfb2a = pf_d(pf)+2*pf_shell; pfba = pfb2a/2;
292 pfbd = pfb2a/cos(30); 292 pfbd = pfb2a/cos(30);
293 pfbs = pfb2a*tan(30); 293 pfbs = pfb2a*tan(30);
294 cylinder(d=pfbd,h=pfbl,$fn=6); 294 cylinder(d=pfbd,h=pfbl,$fn=6);
295 translate([-pfbs/2,0,0]) { 295 translate([-pfbs/2,0,0]) {
296 hull() { 296 hull() {
297 translate([0,-pfba,0]) cube(size=[pfbs,pfb2a,pfbl]); 297 translate([0,-pfba,0]) cube(size=[pfbs,pfb2a,pfbl]);
298 cube(size=[pfbs,filament_elevation,pfbl-filament_elevation+pfba]); 298 cube(size=[pfbs,filament_elevation,pfbl-filament_elevation+pfba]);
299 mirror([0,1,0]) 299 mirror([0,1,0])
300 cube(size=[pfbs,body_h-filament_elevation,pfbl-body_h+filament_elevation+pfba]); 300 cube(size=[pfbs,body_h-filament_elevation,pfbl-body_h+filament_elevation+pfba]);
301 }//hull 301 }//hull
302 }//translate*/ 302 }//translate*/
303 }//if(pf_smooth) 303 }//if(pf_smooth)
304 }//translate rotate translate rotate translate 304 }//translate rotate translate rotate translate
305 }//union (first child of difference) 305 }//union (first child of difference)
306 306
307 // protrusion 307 // protrusion
308 translate([0,0,-1]) 308 translate([0,0,-1])
309 cylinder(d=protrusion_d+protrusion_tolerance_h,h=protrusion_h+protrusion_tolerance_v+1,$fn=fnd*(protrusion_d+protrusion_tolerance_h)); 309 cylinder(d=protrusion_d+protrusion_tolerance_h,h=protrusion_h+protrusion_tolerance_v+1,$fn=fnd*(protrusion_d+protrusion_tolerance_h));
310 // mount screw holes 310 // mount screw holes
311 for(zr=[0:90:359]) rotate([0,0,zr]) translate([mount_d/2,0,0]) { 311 for(zr=[0:90:359]) rotate([0,0,zr]) translate([mount_d/2,0,0]) {
312 translate([0,0,mount_screw_l-mount_depth-(bridges?layer_height:-epsilon)]) 312 translate([0,0,mount_screw_l-mount_depth-(bridges?layer_height:-epsilon)])
313 mirror([0,0,1]) 313 mirror([0,0,1])
314 cylinder(d=mount_screw_d+mount_screw_d_tolerance, 314 cylinder(d=mount_screw_d+mount_screw_d_tolerance,
315 h=mount_screw_l-mount_depth+1, 315 h=mount_screw_l-mount_depth+1,
316 $fn=fnd*(mount_screw_d+mount_screw_d_tolerance)); 316 $fn=fnd*(mount_screw_d+mount_screw_d_tolerance));
317 translate([0,0,mount_screw_l-mount_depth]) 317 translate([0,0,mount_screw_l-mount_depth])
318 cylinder(d=mount_screwhead_d,h=body_h+1,$fn=fnd*mount_screwhead_d); 318 cylinder(d=mount_screwhead_d,h=body_h+1,$fn=fnd*mount_screwhead_d);
319 }//for 319 }//for
320 // pushfit 320 // pushfit
321 pf_offset = mount_d/sqrt(2)/2+mount_screw_d; 321 pf_offset = mount_d/sqrt(2)/2+mount_screw_d;
322 translate([0,0,filament_elevation]) 322 translate([0,0,filament_elevation])
323 rotate([0,0,45]) translate([pulley_d/2+filament_offset,0,0]) 323 rotate([0,0,45]) translate([pulley_d/2+filament_offset,0,0])
324 rotate([-90,0,0]) 324 rotate([-90,0,0])
325 translate([0,0,pf_offset]) 325 translate([0,0,pf_offset])
326 rotate([0,0,180]) { 326 rotate([0,0,180]) {
327 pushfit(pf); 327 pushfit(pf);
328 mirror([0,0,1]) { 328 mirror([0,0,1]) {
329 fh = 1.5* (filament_guide_d-filament_path_d)/2; 329 fh = 1.5* (filament_guide_d-filament_path_d)/2;
330 fo = pf_offset-(idler_d+idler_clearance)/2-fh; 330 fo = pf_offset-(idler_d+idler_clearance)/2-fh;
331 translate([0,0,-1]) teardrop(d=filament_guide_d,h=fo-extrusion_width+1,angle=225); 331 translate([0,0,-1]) teardrop(d=filament_guide_d,h=fo-extrusion_width+1,angle=225);
332 translate([0,0,-1]) teardrop(d=filament_path_d,h=gearbox_d/2+1,angle=-225); 332 translate([0,0,-1]) teardrop(d=filament_path_d,h=gearbox_d/2+1,angle=-225);
333 translate([0,0,fo+epsilon]) 333 translate([0,0,fo+epsilon])
334 cylinder(d1=filament_path_d,d2=filament_guide_d,h=fh,$fn=fnd*filament_guide_d); 334 cylinder(d1=filament_path_d,d2=filament_guide_d,h=fh,$fn=fnd*filament_guide_d);
335 }//mirror 335 }//mirror
336 }//rotate translate rotate translate rotate translate 336 }//rotate translate rotate translate rotate translate
337 // pulley 337 // pulley
338 cylinder(d=pulley_d+pulley_d_clearance,h=body_h+1,$fn=fnd*(pulley_d+pulley_d_clearance)); 338 cylinder(d=pulley_d+pulley_d_clearance,h=body_h+1,$fn=fnd*(pulley_d+pulley_d_clearance));
339 339
340 // leverspace 340 // leverspace
341 hull() for(x=[0,gearbox_d]) 341 hull() for(x=[0,gearbox_d])
342 rotate([0,0,45]) 342 rotate([0,0,45])
343 translate([x,0,ls_z-ls_h/2]) 343 translate([x,0,ls_z-ls_h/2])
344 cylinder(d=idler_d+idler_clearance,h=ls_h,$fn=fnd*(idler_d+idler_clearance)); 344 cylinder(d=idler_d+idler_clearance,h=ls_h,$fn=fnd*(idler_d+idler_clearance));
345 345
346 // idler clearance 346 // idler clearance
347 a=cos(45)*(pulley_d+idler_d)/2; 347 a=cos(45)*(pulley_d+idler_d)/2;
348 b=mount_d/2-a; 348 b=mount_d/2-a;
349 x=sqrt(pow(a,2)+pow(b,2)); 349 x=sqrt(pow(a,2)+pow(b,2));
350 translate([mount_d/2,0,ls_z]) 350 translate([mount_d/2,0,ls_z])
351 intersection() { 351 intersection() {
352 r = x+idler_d/2+idler_clearance; 352 r = x+idler_d/2+idler_clearance;
353 cylinder(r=r,h=ls_h,center=true); 353 cylinder(r=r,h=ls_h,center=true);
354 translate([-r-1,0,-ls_h/2-1]) cube(size=[2*r+2,r+1,ls_h+2]); 354 translate([-r-1,0,-ls_h/2-1]) cube(size=[2*r+2,r+1,ls_h+2]);
355 } 355 }
356 356
357 rotate([0,0,-45]) 357 rotate([0,0,-45])
358 translate([0,0,ls_z-ls_h/2]) 358 translate([0,0,ls_z-ls_h/2])
359 cube(size=[gearbox_d,gearbox_d,lever_thickness+lever_v_clearance]); 359 cube(size=[gearbox_d,gearbox_d,lever_thickness+lever_v_clearance]);
360 translate([0,0,ls_z-ls_h/2]) { 360 translate([0,0,ls_z-ls_h/2]) {
361 translate([mount_screwhead_d/2,0,0]) 361 translate([mount_screwhead_d/2,0,0])
362 mirror([0,1,0]) 362 mirror([0,1,0])
363 cube(size=[gearbox_d,gearbox_d/2+1,lever_thickness+lever_v_clearance]); 363 cube(size=[gearbox_d,gearbox_d/2+1,lever_thickness+lever_v_clearance]);
364 } 364 }
365 365
366 // back side cutout 366 // back side cutout
367 // XXX: this is somewhat ugly and potentially bugged, 367 // XXX: this is somewhat ugly and potentially bugged,
368 // but I want to sleep. 368 // but I want to sleep.
369 a0_ = atan( 369 a0_ = atan(
370 (mount_d/sqrt(2)/2+mount_screw_d+pf_h(pf)+gearbox_d/2) 370 (mount_d/sqrt(2)/2+mount_screw_d+pf_h(pf)+gearbox_d/2)
371 / 371 /
372 ( 372 (
373 pulley_d/2+filament_offset- 373 pulley_d/2+filament_offset-
374 (pf_d(pf)+2*pf_shell)/2/cos(30) 374 (pf_d(pf)+2*pf_shell)/2/cos(30)
375 ) 375 )
376 ); 376 );
377 a0 = -135 + ( (a0_>0) ? a0_ : 180+a0_ ); 377 a0 = -135 + ( (a0_>0) ? a0_ : 180+a0_ );
378 a1 = atan((longwing-lever_thickness/2)/(gearbox_d/2)); 378 a1 = atan((longwing-lever_thickness/2)/(gearbox_d/2));
379 translate([0,0,ls_z]) difference() { 379 translate([0,0,ls_z]) difference() {
380 rotate([0,0,-180+a0]) 380 rotate([0,0,-180+a0])
381 rotate_extrude(angle=a1-a0) 381 rotate_extrude(angle=a1-a0)
382 translate([0,-ls_h/2]) 382 translate([0,-ls_h/2])
383 square([sqrt(pow(gearbox_d/2,2)+pow(longwing-lever_thickness/2,2))+1, 383 square([sqrt(pow(gearbox_d/2,2)+pow(longwing-lever_thickness/2,2))+1,
384 ls_h]); 384 ls_h]);
385 translate([-mount_d/2,0,0]) 385 translate([-mount_d/2,0,0])
386 cylinder(d=gearbox_d-mount_d,h=ls_h+2,center=true,$fn=fnd*(gearbox_d-mount_d)); 386 cylinder(d=gearbox_d-mount_d,h=ls_h+2,center=true,$fn=fnd*(gearbox_d-mount_d));
387 }//difference translate 387 }//difference translate
388 388
389 //translate([-mount_d/2,-longwing,filament_elevation]) 389 //translate([-mount_d/2,-longwing,filament_elevation])
390 if(!tensioner) /* XXX: this seems to be bullshit, but it's so old, that it's historical bullshit */ 390 if(!tensioner) /* XXX: this seems to be bullshit, but it's so old, that it's historical bullshit */
391 translate([mount_d/2,-longwing,filament_elevation]) 391 translate([mount_d/2,-longwing,filament_elevation])
392 rotate([0,-90,0]) difference() { 392 rotate([0,-90,0]) difference() {
393 cylinder(d=spring_d+spring_d_clearance,h=spring_lc+spring_dl,$fn=fnd*(spring_d+spring_d_clearance)); 393 cylinder(d=spring_d+spring_d_clearance,h=spring_lc+spring_dl,$fn=fnd*(spring_d+spring_d_clearance));
394 translate([0,0,spring_lc+spring_dl]) sphere(d=spring_d*3/4,$fn=fnd*spring_d*3/4); 394 translate([0,0,spring_lc+spring_dl]) sphere(d=spring_d*3/4,$fn=fnd*spring_d*3/4);
395 } 395 }
396 396
397 }//difference 397 }//difference
398 398
399 if(supports) intersection() { 399 if(supports) intersection() {
400 difference() { 400 difference() {
401 translate([0,0,ls_z-ls_h/2-epsilon]) 401 translate([0,0,ls_z-ls_h/2-epsilon])
402 cylinder(d=gearbox_d,h=ls_h+2*epsilon,$fn=fnd*gearbox_d); 402 cylinder(d=gearbox_d,h=ls_h+2*epsilon,$fn=fnd*gearbox_d);
403 cylinder(d=pulley_d+pulley_d_clearance,h=body_h+1,$fn=fnd*(pulley_d+pulley_d_clearance)); 403 cylinder(d=pulley_d+pulley_d_clearance,h=body_h+1,$fn=fnd*(pulley_d+pulley_d_clearance));
404 } 404 }
405 // supports 405 // supports
406 // TODO: hardcoded stuff below… 406 // TODO: hardcoded stuff below…
407 if(false) { // parallel 407 if(false) { // parallel
408 for(y=[-gearbox_d:4:gearbox_d]) 408 for(y=[-gearbox_d:4:gearbox_d])
409 translate([0,y-extrusion_width/2,0]) 409 translate([0,y-extrusion_width/2,0])
410 cube(size=[gearbox_d,extrusion_width,body_h]); 410 cube(size=[gearbox_d,extrusion_width,body_h]);
411 }else{ // radial 411 }else{ // radial
412 for(zr=[-65:(65+50)/7:50]) 412 for(zr=[-65:(65+50)/7:50])
413 rotate([0,0,zr]) translate([0,-extrusion_width/2,0]) 413 rotate([0,0,zr]) translate([0,-extrusion_width/2,0])
414 cube(size=[gearbox_d,extrusion_width,body_h]); 414 cube(size=[gearbox_d,extrusion_width,body_h]);
415 } 415 }
416 } 416 }
417 417
418 }//body module 418 }//body module
419 419
420 module springpad() { 420 module springpad() {
421 smalld=st_screw_d+st_screw_d_tolerance+2*extrusion_width; 421 smalld=st_screw_d+st_screw_d_tolerance+2*extrusion_width;
422 bigd = spring_d+spring_d_clearance/2; 422 bigd = spring_d+spring_d_clearance/2;
423 hf = (bigd-smalld)/2; 423 hf = (bigd-smalld)/2;
424 h = hf*3.5; 424 h = hf*3.5;
425 translate([-gearbox_d/2+st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell+1,-longwing,filament_elevation]) 425 translate([-gearbox_d/2+st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell+1,-longwing,filament_elevation])
426 rotate([0,90,0]) difference() { 426 rotate([0,90,0]) difference() {
427 union() { 427 union() {
428 cylinder(d1=smalld,d2=bigd,h=hf,$fn=fnd*bigd); 428 cylinder(d1=smalld,d2=bigd,h=hf,$fn=fnd*bigd);