summaryrefslogtreecommitdiff
authorMichael Krelin <hacker@klever.net>2018-08-12 00:07:46 (UTC)
committer Michael Krelin <hacker@klever.net>2018-08-12 00:07:46 (UTC)
commit60f188ff063a4c6f7e5d4a1078fd520a84f829c4 (patch) (unidiff)
tree0736488044c3c37394d7a2916ad5d7c4eabcc3c2
parente3574275ad904b8ec1b188ee91d0023ea9974cb8 (diff)
downloadextrudery-60f188ff063a4c6f7e5d4a1078fd520a84f829c4.zip
extrudery-60f188ff063a4c6f7e5d4a1078fd520a84f829c4.tar.gz
extrudery-60f188ff063a4c6f7e5d4a1078fd520a84f829c4.tar.bz2
another: potentially even prettier pushfit arrangement
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--another.scad21
1 files changed, 17 insertions, 4 deletions
diff --git a/another.scad b/another.scad
index 6af68b6..4c4af5c 100644
--- a/another.scad
+++ b/another.scad
@@ -1,452 +1,465 @@
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 pf_shell = max(3*layer_height,3*extrusion_width),
47 pf_smooth = true,
47 48
48 // empty spaces 49 // empty spaces
49 idler_travel = 3, // how far should idler travel when pressed 50 idler_travel = 3, // how far should idler travel when pressed
50 idler_clearance=1, 51 idler_clearance=1,
51 pulley_clearance=2, 52 pulley_clearance=2,
52 lever_v_clearance=.7, // vertical clearance for the lever 53 lever_v_clearance=.7, // vertical clearance for the lever
53 spring_d_clearance=1, 54 spring_d_clearance=1,
54 protrusion_tolerance_h=.5, // horizontal tolerance for the motor protrusion 55 protrusion_tolerance_h=.5, // horizontal tolerance for the motor protrusion
55 protrusion_tolerance_v=.5, // vertical tolerance for the motor protrusion 56 protrusion_tolerance_v=.5, // vertical tolerance for the motor protrusion
56 mount_screw_d_tolerance=.4, 57 mount_screw_d_tolerance=.4,
57 idler_v_tolerance=.5, 58 idler_v_tolerance=.5,
58 knob_bore_d_tolerance=.6, 59 knob_bore_d_tolerance=.6,
59 st_nut_h_tolerance=.2, 60 st_nut_h_tolerance=.2,
60 st_nut_d_tolerance=.2,/* TODO: make it st_nut_w_tolerance */ 61 st_nut_d_tolerance=.2,/* TODO: make it st_nut_w_tolerance */
61 st_screw_d_tolerance=.3, 62 st_screw_d_tolerance=.3,
62 63
63 what="lever", // lever|body|knob|springpad|* 64 what="lever", // lever|body|knob|springpad|*
64 left=false, 65 left=false,
65 vitamins = true, 66 vitamins = true,
66 supports = false, bridges = true, 67 supports = false, bridges = true,
67 tensioner = true, 68 tensioner = true,
68 debug = false 69 debug = false
69) { 70) {
70 fnd = 2*PI; fnr = 2*fnd; 71 fnd = 2*PI; fnr = 2*fnd;
71 72
72 lever_shell = mount_screwhead_h+0.5; 73 lever_shell = mount_screwhead_h+0.5;
73 lever_thickness=max(spring_d+spring_d_clearance+layer_height*8,idler_h+idler_v_tolerance+2*lever_shell); 74 lever_thickness=max(spring_d+spring_d_clearance+layer_height*8,idler_h+idler_v_tolerance+2*lever_shell);
74 lsd = idler_d-idler_clearance*2; 75 lsd = idler_d-idler_clearance*2;
75 longwing=gearbox_d/2+spring_d/2+lsd/2; 76 longwing=gearbox_d/2+spring_d/2+lsd/2;
76 h_ = (pulley_d+idler_d)/(2*sqrt(2)); 77 h_ = (pulley_d+idler_d)/(2*sqrt(2));
77 ri = sqrt( pow(h_,2) + pow(mount_d/2-h_,2) ); 78 ri = sqrt( pow(h_,2) + pow(mount_d/2-h_,2) );
78 spring_dl = idler_travel*longwing/ri; 79 spring_dl = idler_travel*longwing/ri;
79 80
80 filament_elevation=protrusion_h+pulley_elevation+teeth_elevation; 81 filament_elevation=protrusion_h+pulley_elevation+teeth_elevation;
81 ls_z = filament_elevation; // leverspace mid-z 82 ls_z = filament_elevation; // leverspace mid-z
82 body_h = max(protrusion_h+bore_l,mount_screw_l-mounthole_depth/2+mount_screwhead_h,ls_z*2); 83 body_h = max(protrusion_h+bore_l,mount_screw_l-mounthole_depth/2+mount_screwhead_h,ls_z*2);
83 ls_h = lever_thickness+lever_v_clearance; // leverspace height 84 ls_h = lever_thickness+lever_v_clearance; // leverspace height
84 85
85 module mirrorleft() { 86 module mirrorleft() {
86 mirror([left?0:1,0,0]) children(); 87 mirror([left?0:1,0,0]) children();
87 } 88 }
88 module place_idler() { 89 module place_idler() {
89 rotate([0,0,45]) 90 rotate([0,0,45])
90 translate([(pulley_d+idler_d)/2,0,0]) 91 translate([(pulley_d+idler_d)/2,0,0])
91 children(); 92 children();
92 } 93 }
93 module finger_indent(d=lever_thickness,depth/*=1*/,r/*=15*/) { 94 module finger_indent(d=lever_thickness,depth/*=1*/,r/*=15*/) {
94 if(depth) { 95 if(depth) {
95 hh = (-4*pow(depth,2)+pow(d,2))/(8*depth); 96 hh = (-4*pow(depth,2)+pow(d,2))/(8*depth);
96 rr = depth+hh; 97 rr = depth+hh;
97 translate([0,0,hh]) sphere(r=rr,$fn=fnr*rr); 98 translate([0,0,hh]) sphere(r=rr,$fn=fnr*rr);
98 }else if(r) { 99 }else if(r) {
99 hh=sqrt(pow(r,2)-pow(d,2)/4); 100 hh=sqrt(pow(r,2)-pow(d,2)/4);
100 translate([0,0,hh]) sphere(r=r,$fn=fnr*r); 101 translate([0,0,hh]) sphere(r=r,$fn=fnr*r);
101 } 102 }
102 } 103 }
103 104
104 % if(vitamins) mirrorleft() { 105 % if(vitamins) mirrorleft() {
105 translate([0,0,-epsilon]) mirror([0,0,1]) cylinder(d=gearbox_d,h=1,$fn=60); 106 translate([0,0,-epsilon]) mirror([0,0,1]) cylinder(d=gearbox_d,h=1,$fn=60);
106 for(zr=[0:90:359]) rotate([0,0,zr]) translate([mount_d/2,0,0]) 107 for(zr=[0:90:359]) rotate([0,0,zr]) translate([mount_d/2,0,0])
107 cylinder(d=mount_screw_d,h=20,$fn=30); 108 cylinder(d=mount_screw_d,h=20,$fn=30);
108 translate([0,0,-epsilon]) cylinder(d=protrusion_d,h=protrusion_h,$fn=30); 109 translate([0,0,-epsilon]) cylinder(d=protrusion_d,h=protrusion_h,$fn=30);
109 translate([0,0,protrusion_h]) { 110 translate([0,0,protrusion_h]) {
110 difference() { 111 difference() {
111 cylinder(d=bore_d,h=bore_l,$fn=30); 112 cylinder(d=bore_d,h=bore_l,$fn=30);
112 translate([-bore_d/2-1,bore_dd-bore_d/2,-1]) 113 translate([-bore_d/2-1,bore_dd-bore_d/2,-1])
113 cube([bore_d+2,bore_d/2,bore_l+2]); 114 cube([bore_d+2,bore_d/2,bore_l+2]);
114 } 115 }
115 translate([0,0,pulley_elevation]) { 116 translate([0,0,pulley_elevation]) {
116 cylinder(d=pulley_d,h=pulley_h,$fn=30); 117 cylinder(d=pulley_d,h=pulley_h,$fn=30);
117 translate([0,0,teeth_elevation]) { 118 translate([0,0,teeth_elevation]) {
118 place_idler() { 119 place_idler() {
119 cylinder(d=idler_d,h=idler_h,center=true,$fn=30); 120 cylinder(d=idler_d,h=idler_h,center=true,$fn=30);
120 cylinder(d=idler_screw_d,h=lever_thickness+2,center=true,$fn=30); 121 cylinder(d=idler_screw_d,h=lever_thickness+2,center=true,$fn=30);
121 }//place idler 122 }//place idler
122 // filament path 123 // filament path
123 rotate([0,0,45]) translate([pulley_d/2,0,0]) { 124 rotate([0,0,45]) translate([pulley_d/2,0,0]) {
124 rotate([90,0,0]) cylinder(d=filament_d,h=gearbox_d*2,center=true,$fn=15); 125 rotate([90,0,0]) cylinder(d=filament_d,h=gearbox_d*2,center=true,$fn=15);
125 rotate([-90,0,0]) 126 rotate([-90,0,0])
126 translate([0,0,mount_d/sqrt(2)/2+mount_screw_d]) 127 translate([0,0,mount_d/sqrt(2)/2+mount_screw_d])
127 pushfit(pf); 128 pushfit(pf);
128 } 129 }
129 }//translate teeth 130 }//translate teeth
130 }//translate pulley 131 }//translate pulley
131 }//translate protrusion 132 }//translate protrusion
132 }//vitamins 133 }//vitamins
133 134
134 module lever() { 135 module lever() {
135 translate([0,0,protrusion_h+pulley_elevation+teeth_elevation]) { 136 translate([0,0,protrusion_h+pulley_elevation+teeth_elevation]) {
136 difference() { 137 difference() {
137 union() { 138 union() {
138 hull() { 139 hull() {
139 place_idler() 140 place_idler()
140 cylinder(d=lsd,h=lever_thickness,center=true,$fn=60); 141 cylinder(d=lsd,h=lever_thickness,center=true,$fn=60);
141 translate([mount_d/2,0,0]) 142 translate([mount_d/2,0,0])
142 cylinder(d=lsd,h=lever_thickness,center=true,$fn=60); 143 cylinder(d=lsd,h=lever_thickness,center=true,$fn=60);
143 }//hull 144 }//hull
144 hull() { 145 hull() {
145 translate([mount_d/2,0,0]) 146 translate([mount_d/2,0,0])
146 cylinder(d=lsd,h=lever_thickness,center=true,$fn=60); 147 cylinder(d=lsd,h=lever_thickness,center=true,$fn=60);
147 translate([mount_d/2,-longwing,0]) rotate([0,90,0]) 148 translate([mount_d/2,-longwing,0]) rotate([0,90,0])
148 cylinder(d=lever_thickness,h=lsd,center=true,$fn=60); 149 cylinder(d=lever_thickness,h=lsd,center=true,$fn=60);
149 }//hull 150 }//hull
150 }//union 151 }//union
151 152
152 // filament path 153 // filament path
153 place_idler() { 154 place_idler() {
154 translate([-idler_d/2,0,0]) rotate([90,0,0]) { 155 translate([-idler_d/2,0,0]) rotate([90,0,0]) {
155 cylinder(d=filament_path_d,h=3*gearbox_d,center=true,$fn=30); 156 cylinder(d=filament_path_d,h=3*gearbox_d,center=true,$fn=30);
156 translate([0,-filament_path_d/2/sqrt(2),0]) rotate([0,0,45]) 157 translate([0,-filament_path_d/2/sqrt(2),0]) rotate([0,0,45])
157 cube(size=[filament_path_d/2,filament_path_d/2,3*gearbox_d],center=true); 158 cube(size=[filament_path_d/2,filament_path_d/2,3*gearbox_d],center=true);
158 }//rotate translate 159 }//rotate translate
159 translate([-idler_d/2,0,0]) 160 translate([-idler_d/2,0,0])
160 rotate([90,0,0]) 161 rotate([90,0,0])
161 translate([0,0, 162 translate([0,0,
162 sqrt(2)*(mount_d-pulley_d+lsd)/2 163 sqrt(2)*(mount_d-pulley_d+lsd)/2
163 ]) { 164 ]) {
164 cylinder(d1=filament_path_d,d2=2*filament_path_d, 165 cylinder(d1=filament_path_d,d2=2*filament_path_d,
165 h=filament_path_d,$fn=2*filament_path_d*fnd); 166 h=filament_path_d,$fn=2*filament_path_d*fnd);
166 translate([0,0,filament_path_d-epsilon]) 167 translate([0,0,filament_path_d-epsilon])
167 cylinder(d=2*filament_path_d,h=lsd,$fn=2*filament_path_d*fnd); 168 cylinder(d=2*filament_path_d,h=lsd,$fn=2*filament_path_d*fnd);
168 } 169 }
169 }//place_idler 170 }//place_idler
170 171
171 // idler space and mounting hole 172 // idler space and mounting hole
172 place_idler() { 173 place_idler() {
173 difference() { 174 difference() {
174 cylinder(d=idler_d+idler_clearance*2,h=idler_h+idler_v_tolerance,center=true,$fn=60); 175 cylinder(d=idler_d+idler_clearance*2,h=idler_h+idler_v_tolerance,center=true,$fn=60);
175 if(supports) for(y=[-lsd/2+extrusion_width:(lsd-2*extrusion_width)/3:lsd/2-extrusion_width]) 176 if(supports) for(y=[-lsd/2+extrusion_width:(lsd-2*extrusion_width)/3:lsd/2-extrusion_width])
176 translate([-lsd/2-1,y-extrusion_width/2,-idler_h/2-idler_v_tolerance/2-1]) 177 translate([-lsd/2-1,y-extrusion_width/2,-idler_h/2-idler_v_tolerance/2-1])
177 cube(size=[lsd+2,extrusion_width,idler_h+idler_v_tolerance+2]); 178 cube(size=[lsd+2,extrusion_width,idler_h+idler_v_tolerance+2]);
178 } 179 }
179 cylinder(d=idler_screw_d,h=lever_thickness+2,center=true,$fn=30); 180 cylinder(d=idler_screw_d,h=lever_thickness+2,center=true,$fn=30);
180 translate([0,0,lever_thickness/2-idler_screwhead_h]) 181 translate([0,0,lever_thickness/2-idler_screwhead_h])
181 cylinder(d=idler_screwhead_d,h=idler_screwhead_h+1,$fn=fnd*idler_screwhead_d); 182 cylinder(d=idler_screwhead_d,h=idler_screwhead_h+1,$fn=fnd*idler_screwhead_d);
182 } 183 }
183 // mounting screw hole 184 // mounting screw hole
184 translate([mount_d/2,0,0]) 185 translate([mount_d/2,0,0])
185 cylinder(d=mount_screw_d+mount_screw_d_tolerance,h=lever_thickness+2,center=true,$fn=fnd*mount_screw_d); 186 cylinder(d=mount_screw_d+mount_screw_d_tolerance,h=lever_thickness+2,center=true,$fn=fnd*mount_screw_d);
186 187
187 // lever end 188 // lever end
188 translate([mount_d/2,0,0]) rotate([0,90,0]) { 189 translate([mount_d/2,0,0]) rotate([0,90,0]) {
189 translate([0,-longwing,lsd/2]) finger_indent(d=lever_thickness-1,r=15); 190 translate([0,-longwing,lsd/2]) finger_indent(d=lever_thickness-1,r=15);
190 translate([0,-longwing,0]) 191 translate([0,-longwing,0])
191 mirror([0,0,1]) 192 mirror([0,0,1])
192 difference() { 193 difference() {
193 cylinder(d=spring_d+spring_d_clearance,h=lsd,$fn=fnd*(spring_d+spring_d_clearance)); 194 cylinder(d=spring_d+spring_d_clearance,h=lsd,$fn=fnd*(spring_d+spring_d_clearance));
194 sphere(d=spring_d*3/4,$fn=fnd*spring_d*3/4); 195 sphere(d=spring_d*3/4,$fn=fnd*spring_d*3/4);
195 } 196 }
196 }//rotate-translate 197 }//rotate-translate
197 }//difference 198 }//difference
198 // bridging patch 199 // bridging patch
199 if(bridges) place_idler() 200 if(bridges) place_idler()
200 translate([0,0,lever_thickness/2-mount_screwhead_h]) 201 translate([0,0,lever_thickness/2-mount_screwhead_h])
201 mirror([0,0,1]) 202 mirror([0,0,1])
202 cylinder(d=mount_screwhead_d,h=layer_height); 203 cylinder(d=mount_screwhead_d,h=layer_height);
203 }//translate 204 }//translate
204 }//lever module 205 }//lever module
205 206
206 module body() { 207 module body() {
207 difference() { 208 difference() {
208 union() { 209 union() {
209 cylinder(d=gearbox_d,h=body_h,$fn=fnd*gearbox_d); 210 cylinder(d=gearbox_d,h=body_h,$fn=fnd*gearbox_d);
210 // finger and spring support 211 // finger and spring support
211 fsw = gearbox_d-(gearbox_d-mount_d)/2-spring_lc; 212 fsw = gearbox_d-(gearbox_d-mount_d)/2-spring_lc;
212 translate([-gearbox_d/2,0,0]) difference() { 213 translate([-gearbox_d/2,0,0]) difference() {
213 union() { 214 union() {
214 hull() { 215 hull() {
215 translate([0,-longwing,ls_z]) 216 translate([0,-longwing,ls_z])
216 rotate([0,90,0]) 217 rotate([0,90,0])
217 cylinder(d=lever_thickness,h=fsw,$fn=fnd*lever_thickness); 218 cylinder(d=lever_thickness,h=fsw,$fn=fnd*lever_thickness);
218 hh=body_h-ls_z; 219 hh=body_h-ls_z;
219 translate([0,0,ls_z-lever_thickness/2]) 220 translate([0,0,ls_z-lever_thickness/2])
220 mirror([0,1,0]) cube(size=[fsw,longwing-hh+lever_thickness/sqrt(2),hh+lever_thickness/2]); 221 mirror([0,1,0]) cube(size=[fsw,longwing-hh+lever_thickness/sqrt(2),hh+lever_thickness/2]);
221 hhh=ls_z; 222 hhh=ls_z;
222 translate([0,0,0]) 223 translate([0,0,0])
223 mirror([0,1,0]) cube(size=[fsw,longwing-hhh+lever_thickness/sqrt(2),hhh+lever_thickness/2]); 224 mirror([0,1,0]) cube(size=[fsw,longwing-hhh+lever_thickness/sqrt(2),hhh+lever_thickness/2]);
224 } 225 }
225 } 226 }
226 translate([0,-longwing,ls_z]) rotate([0,-90,0]) { 227 translate([0,-longwing,ls_z]) rotate([0,-90,0]) {
227 if(!tensioner) finger_indent(d=lever_thickness-1,r=15); else { 228 if(!tensioner) finger_indent(d=lever_thickness-1,r=15); else {
228 mirror([0,0,1]) { 229 mirror([0,0,1]) {
229 translate([0,0,st_thickshell]) 230 translate([0,0,st_thickshell])
230 hull() for(o=[0,spring_d]) translate([0,-o,0]) 231 hull() for(o=[0,spring_d]) translate([0,-o,0])
231 rotate([0,0,30]) 232 rotate([0,0,30])
232 cylinder(d=st_nut_d+st_nut_d_tolerance,h=st_nut_h+st_nut_h_tolerance,$fn=6); 233 cylinder(d=st_nut_d+st_nut_d_tolerance,h=st_nut_h+st_nut_h_tolerance,$fn=6);
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)); 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));
234 bigd = spring_d+spring_d_clearance; 235 bigd = spring_d+spring_d_clearance;
235 hf = (bigd-st_screw_d-st_screw_d_tolerance)/2; 236 hf = (bigd-st_screw_d-st_screw_d_tolerance)/2;
236 translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell-epsilon]) 237 translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell-epsilon])
237 cylinder(d1=st_screw_d+st_screw_d_tolerance,d2=bigd, 238 cylinder(d1=st_screw_d+st_screw_d_tolerance,d2=bigd,
238 h=hf+epsilon, $fn=fnd*bigd); 239 h=hf+epsilon, $fn=fnd*bigd);
239 translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell+hf-epsilon]) 240 translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell+hf-epsilon])
240 cylinder(d=bigd,h=fsw+1,$fn=fnd*bigd); 241 cylinder(d=bigd,h=fsw+1,$fn=fnd*bigd);
241 } 242 }
242 } 243 }
243 } 244 }
244 } // translate 245 } // translate
245 246
246 // pushfit bracket 247 // pushfit bracket
247 translate([0,0,filament_elevation]) 248 translate([0,0,filament_elevation])
248 rotate([0,0,45]) translate([pulley_d/2,0,0]) 249 rotate([0,0,45]) translate([pulley_d/2,0,0])
249 rotate([-90,0,0]) 250 rotate([-90,0,0])
250 translate([0,0,mount_d/sqrt(2)/2+mount_screw_d-gearbox_d/2/*TODO:*/]) { 251 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 if(pf_smooth) {
254 pfbd = pf_d(pf)+2*pf_shell;
255 hull() {
256 cylinder(d=pfbd,h=pfbl,$fn=pfbd*fnd);
257 translate([-epsilon/2,0,0]) {
258 cube(size=[epsilon,filament_elevation,pfbl-filament_elevation+pfbd/2]);
259 mirror([0,1,0])
260 cube(size=[epsilon,body_h-filament_elevation,pfbl-body_h+filament_elevation+pfbd/2]);
261 }//translate
262 }//hull
263 }else{
251 pfb2a = pf_d(pf)+2*pf_shell; pfba = pfb2a/2; 264 pfb2a = pf_d(pf)+2*pf_shell; pfba = pfb2a/2;
252 pfbd = pfb2a/cos(30); 265 pfbd = pfb2a/cos(30);
253 pfbs = pfb2a*tan(30); 266 pfbs = pfb2a*tan(30);
254 pfbl = pf_h(pf)+gearbox_d/2/*TODO:*/;
255 cylinder(d=pfbd,h=pfbl,$fn=6); 267 cylinder(d=pfbd,h=pfbl,$fn=6);
256 translate([-pfbs/2,0,0]) { 268 translate([-pfbs/2,0,0]) {
257 hull() { 269 hull() {
258 translate([0,-pfba,0]) cube(size=[pfbs,pfb2a,pfbl]); 270 translate([0,-pfba,0]) cube(size=[pfbs,pfb2a,pfbl]);
259 cube(size=[pfbs,filament_elevation,pfbl-filament_elevation+pfba]); 271 cube(size=[pfbs,filament_elevation,pfbl-filament_elevation+pfba]);
260 mirror([0,1,0]) 272 mirror([0,1,0])
261 cube(size=[pfbs,body_h-filament_elevation,pfbl-body_h+filament_elevation+pfba]); 273 cube(size=[pfbs,body_h-filament_elevation,pfbl-body_h+filament_elevation+pfba]);
262 } 274 }//hull
263 } 275 }//translate*/
264 } 276 }//if(pf_smooth)
277 }//translate rotate translate rotate translate
265 }//union (first child of difference) 278 }//union (first child of difference)
266 279
267 // protrusion 280 // protrusion
268 translate([0,0,-1]) 281 translate([0,0,-1])
269 cylinder(d=protrusion_d+protrusion_tolerance_h,h=protrusion_h+protrusion_tolerance_v+1,$fn=fnd*(protrusion_d+protrusion_tolerance_h)); 282 cylinder(d=protrusion_d+protrusion_tolerance_h,h=protrusion_h+protrusion_tolerance_v+1,$fn=fnd*(protrusion_d+protrusion_tolerance_h));
270 // mount screw holes 283 // mount screw holes
271 for(zr=[0:90:359]) rotate([0,0,zr]) translate([mount_d/2,0,0]) { 284 for(zr=[0:90:359]) rotate([0,0,zr]) translate([mount_d/2,0,0]) {
272 translate([0,0,mount_screw_l-mounthole_depth/2-(bridges?layer_height:-epsilon)]) 285 translate([0,0,mount_screw_l-mounthole_depth/2-(bridges?layer_height:-epsilon)])
273 mirror([0,0,1]) 286 mirror([0,0,1])
274 cylinder(d=mount_screw_d+mount_screw_d_tolerance, 287 cylinder(d=mount_screw_d+mount_screw_d_tolerance,
275 h=mount_screw_l-mounthole_depth/2+1, 288 h=mount_screw_l-mounthole_depth/2+1,
276 $fn=fnd*(mount_screw_d+mount_screw_d_tolerance)); 289 $fn=fnd*(mount_screw_d+mount_screw_d_tolerance));
277 translate([0,0,mount_screw_l-mounthole_depth/2]) 290 translate([0,0,mount_screw_l-mounthole_depth/2])
278 cylinder(d=mount_screwhead_d,h=body_h+1,$fn=fnd*mount_screwhead_d); 291 cylinder(d=mount_screwhead_d,h=body_h+1,$fn=fnd*mount_screwhead_d);
279 }//for 292 }//for
280 // pushfit 293 // pushfit
281 translate([0,0,filament_elevation]) 294 translate([0,0,filament_elevation])
282 rotate([0,0,45]) translate([pulley_d/2,0,0]) 295 rotate([0,0,45]) translate([pulley_d/2,0,0])
283 rotate([-90,0,0]) 296 rotate([-90,0,0])
284 translate([0,0,mount_d/sqrt(2)/2+mount_screw_d+epsilon]) 297 translate([0,0,mount_d/sqrt(2)/2+mount_screw_d+epsilon])
285 rotate([0,0,180]) { 298 rotate([0,0,180]) {
286 pushfit(pf); 299 pushfit(pf);
287 cylinder(d=filament_guide_d,h=gearbox_d,center=true,$fn=fnd*filament_guide_d); 300 cylinder(d=filament_guide_d,h=gearbox_d,center=true,$fn=fnd*filament_guide_d);
288 translate([0,-filament_guide_d/2/sqrt(2),0]) 301 translate([0,-filament_guide_d/2/sqrt(2),0])
289 rotate([0,0,45]) 302 rotate([0,0,45])
290 cube(size=[filament_guide_d/2,filament_guide_d/2,gearbox_d],center=true); 303 cube(size=[filament_guide_d/2,filament_guide_d/2,gearbox_d],center=true);
291 }//rotate translate rotate translate rotate translate 304 }//rotate translate rotate translate rotate translate
292 // pulley 305 // pulley
293 cylinder(d=pulley_d+pulley_clearance,h=body_h+1,$fn=fnd*(pulley_d+pulley_clearance)); 306 cylinder(d=pulley_d+pulley_clearance,h=body_h+1,$fn=fnd*(pulley_d+pulley_clearance));
294 // leverspace 307 // leverspace
295 hull() for(x=[0,gearbox_d]) 308 hull() for(x=[0,gearbox_d])
296 rotate([0,0,45]) 309 rotate([0,0,45])
297 translate([x,0,ls_z-ls_h/2]) 310 translate([x,0,ls_z-ls_h/2])
298 cylinder(d=idler_d+idler_clearance,h=ls_h,$fn=fnd*(idler_d+idler_clearance)); 311 cylinder(d=idler_d+idler_clearance,h=ls_h,$fn=fnd*(idler_d+idler_clearance));
299 312
300 // idler clearance 313 // idler clearance
301 a=cos(45)*(pulley_d+idler_d)/2; 314 a=cos(45)*(pulley_d+idler_d)/2;
302 b=mount_d/2-a; 315 b=mount_d/2-a;
303 x=sqrt(pow(a,2)+pow(b,2)); 316 x=sqrt(pow(a,2)+pow(b,2));
304 translate([mount_d/2,0,ls_z]) 317 translate([mount_d/2,0,ls_z])
305 intersection() { 318 intersection() {
306 r = x+idler_d/2+idler_clearance; 319 r = x+idler_d/2+idler_clearance;
307 cylinder(r=r,h=ls_h,center=true); 320 cylinder(r=r,h=ls_h,center=true);
308 translate([-r-1,0,-ls_h/2-1]) cube(size=[2*r+2,r+1,ls_h+2]); 321 translate([-r-1,0,-ls_h/2-1]) cube(size=[2*r+2,r+1,ls_h+2]);
309 } 322 }
310 323
311 // back side cutout 324 // back side cutout
312 a0 = asin((mount_screwhead_d+2*extrusion_width)/mount_d); 325 a0 = asin((mount_screwhead_d+2*extrusion_width)/mount_d);
313 a1 = atan((longwing-lever_thickness/2)/(gearbox_d/2)); 326 a1 = atan((longwing-lever_thickness/2)/(gearbox_d/2));
314 translate([0,0,ls_z]) hull() { 327 translate([0,0,ls_z]) hull() {
315 rotate([0,0,-180+a0]) 328 rotate([0,0,-180+a0])
316 rotate_extrude(angle=a1-a0) 329 rotate_extrude(angle=a1-a0)
317 translate([0,-ls_h/2]) 330 translate([0,-ls_h/2])
318 square([sqrt(pow(gearbox_d/2,2)+pow(longwing-lever_thickness/2,2))+1, 331 square([sqrt(pow(gearbox_d/2,2)+pow(longwing-lever_thickness/2,2))+1,
319 ls_h]); 332 ls_h]);
320 cylinder(d=bore_d/2/*TODO:recalculate angles based on this, 333 cylinder(d=bore_d/2/*TODO:recalculate angles based on this,
321 too lazy to do that now*/, 334 too lazy to do that now*/,
322 h=ls_h,center=true); 335 h=ls_h,center=true);
323 } 336 }
324 337
325 rotate([0,0,-45]) 338 rotate([0,0,-45])
326 translate([0,0,ls_z-ls_h/2]) 339 translate([0,0,ls_z-ls_h/2])
327 cube(size=[gearbox_d,gearbox_d,lever_thickness+lever_v_clearance]); 340 cube(size=[gearbox_d,gearbox_d,lever_thickness+lever_v_clearance]);
328 translate([0,0,ls_z-ls_h/2]) { 341 translate([0,0,ls_z-ls_h/2]) {
329 translate([mount_screwhead_d/2,0,0]) 342 translate([mount_screwhead_d/2,0,0])
330 mirror([0,1,0]) 343 mirror([0,1,0])
331 cube(size=[gearbox_d,gearbox_d/2+1,lever_thickness+lever_v_clearance]); 344 cube(size=[gearbox_d,gearbox_d/2+1,lever_thickness+lever_v_clearance]);
332 } 345 }
333 //translate([-mount_d/2,-longwing,filament_elevation]) 346 //translate([-mount_d/2,-longwing,filament_elevation])
334 if(!tensioner) /* XXX: this seems to be bullshit, but it's so old, that it's historical bullshit */ 347 if(!tensioner) /* XXX: this seems to be bullshit, but it's so old, that it's historical bullshit */
335 translate([mount_d/2,-longwing,filament_elevation]) 348 translate([mount_d/2,-longwing,filament_elevation])
336 rotate([0,-90,0]) difference() { 349 rotate([0,-90,0]) difference() {
337 cylinder(d=spring_d+spring_d_clearance,h=spring_lc+spring_dl,$fn=fnd*(spring_d+spring_d_clearance)); 350 cylinder(d=spring_d+spring_d_clearance,h=spring_lc+spring_dl,$fn=fnd*(spring_d+spring_d_clearance));
338 translate([0,0,spring_lc+spring_dl]) sphere(d=spring_d*3/4,$fn=fnd*spring_d*3/4); 351 translate([0,0,spring_lc+spring_dl]) sphere(d=spring_d*3/4,$fn=fnd*spring_d*3/4);
339 } 352 }
340 353
341 }//difference 354 }//difference
342 355
343 if(supports) intersection() { 356 if(supports) intersection() {
344 difference() { 357 difference() {
345 translate([0,0,ls_z-ls_h/2-epsilon]) 358 translate([0,0,ls_z-ls_h/2-epsilon])
346 cylinder(d=gearbox_d,h=ls_h+2*epsilon,$fn=fnd*gearbox_d); 359 cylinder(d=gearbox_d,h=ls_h+2*epsilon,$fn=fnd*gearbox_d);
347 cylinder(d=pulley_d+pulley_clearance,h=body_h+1,$fn=fnd*(pulley_d+pulley_clearance)); 360 cylinder(d=pulley_d+pulley_clearance,h=body_h+1,$fn=fnd*(pulley_d+pulley_clearance));
348 } 361 }
349 // supports 362 // supports
350 // TODO: hardcoded stuff below… 363 // TODO: hardcoded stuff below…
351 if(false) { // parallel 364 if(false) { // parallel
352 for(y=[-gearbox_d:4:gearbox_d]) 365 for(y=[-gearbox_d:4:gearbox_d])
353 translate([0,y-extrusion_width/2,0]) 366 translate([0,y-extrusion_width/2,0])
354 cube(size=[gearbox_d,extrusion_width,body_h]); 367 cube(size=[gearbox_d,extrusion_width,body_h]);
355 }else{ // radial 368 }else{ // radial
356 for(zr=[-65:(65+50)/7:50]) 369 for(zr=[-65:(65+50)/7:50])
357 rotate([0,0,zr]) translate([0,-extrusion_width/2,0]) 370 rotate([0,0,zr]) translate([0,-extrusion_width/2,0])
358 cube(size=[gearbox_d,extrusion_width,body_h]); 371 cube(size=[gearbox_d,extrusion_width,body_h]);
359 } 372 }
360 } 373 }
361 374
362 }//body module 375 }//body module
363 376
364 module springpad() { 377 module springpad() {
365 smalld=st_screw_d+st_screw_d_tolerance+2*extrusion_width; 378 smalld=st_screw_d+st_screw_d_tolerance+2*extrusion_width;
366 bigd = spring_d+spring_d_clearance/2; 379 bigd = spring_d+spring_d_clearance/2;
367 hf = (bigd-smalld)/2; 380 hf = (bigd-smalld)/2;
368 translate([-gearbox_d/2+st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell+1,-longwing,filament_elevation]) 381 translate([-gearbox_d/2+st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell+1,-longwing,filament_elevation])
369 rotate([0,90,0]) difference() { 382 rotate([0,90,0]) difference() {
370 union() { 383 union() {
371 cylinder(d1=smalld,d2=bigd,h=hf,$fn=fnd*bigd); 384 cylinder(d1=smalld,d2=bigd,h=hf,$fn=fnd*bigd);
372 translate([0,0,hf-epsilon]) 385 translate([0,0,hf-epsilon])
373 cylinder(d=bigd,h=hf*2,$fn=fnd*bigd); 386 cylinder(d=bigd,h=hf*2,$fn=fnd*bigd);
374 translate([0,0,3*hf]) 387 translate([0,0,3*hf])
375 sphere(d=spring_d*3/4,$fn=fnd*spring_d*3/4); 388 sphere(d=spring_d*3/4,$fn=fnd*spring_d*3/4);
376 } 389 }
377 translate([0,0,-epsilon]) 390 translate([0,0,-epsilon])
378 cylinder(d=st_screw_d+st_screw_d_tolerance,h=2*hf+epsilon,$fn=fnd*(st_screw_d+st_screw_d_tolerance)); 391 cylinder(d=st_screw_d+st_screw_d_tolerance,h=2*hf+epsilon,$fn=fnd*(st_screw_d+st_screw_d_tolerance));
379 } 392 }
380 } 393 }
381 394
382 module knob() { 395 module knob() {
383 ch = knob_indent_d/2; 396 ch = knob_indent_d/2;
384 translate([0,0,body_h+epsilon]) { 397 translate([0,0,body_h+epsilon]) {
385 mirror([0,0,1]) translate([0,0,-epsilon]) { 398 mirror([0,0,1]) translate([0,0,-epsilon]) {
386 difference() { 399 difference() {
387 cylinder(d=pulley_d,h=knob_bore_l,$fn=fnd*pulley_d); 400 cylinder(d=pulley_d,h=knob_bore_l,$fn=fnd*pulley_d);
388 translate([0,0,-1]) difference() { 401 translate([0,0,-1]) difference() {
389 cylinder(d=bore_d+knob_bore_d_tolerance,h=knob_bore_l+2); 402 cylinder(d=bore_d+knob_bore_d_tolerance,h=knob_bore_l+2);
390 translate([-bore_d/2-1,bore_dd-bore_d/2+knob_bore_d_tolerance/2,-1]) 403 translate([-bore_d/2-1,bore_dd-bore_d/2+knob_bore_d_tolerance/2,-1])
391 cube([bore_d+2,bore_d/2,knob_bore_l+4]); 404 cube([bore_d+2,bore_d/2,knob_bore_l+4]);
392 } 405 }
393 } 406 }
394 } 407 }
395 difference() { 408 difference() {
396 union() { 409 union() {
397 cylinder(d1=gearbox_d-2*ch,d2=gearbox_d,h=ch+epsilon,$fn=fnd*gearbox_d); 410 cylinder(d1=gearbox_d-2*ch,d2=gearbox_d,h=ch+epsilon,$fn=fnd*gearbox_d);
398 translate([0,0,ch]) 411 translate([0,0,ch])
399 cylinder(d=gearbox_d,h=knob_h-2*ch+epsilon,$fn=fnd*gearbox_d); 412 cylinder(d=gearbox_d,h=knob_h-2*ch+epsilon,$fn=fnd*gearbox_d);
400 translate([0,0,knob_h-ch]) 413 translate([0,0,knob_h-ch])
401 cylinder(d1=gearbox_d,d2=gearbox_d-2*ch,h=ch,$fn=fnd*gearbox_d); 414 cylinder(d1=gearbox_d,d2=gearbox_d-2*ch,h=ch,$fn=fnd*gearbox_d);
402 } 415 }
403 for(a=[0:360/knob_indents:359]) rotate([0,0,a]) 416 for(a=[0:360/knob_indents:359]) rotate([0,0,a])
404 translate([0,gearbox_d/2,-1]) 417 translate([0,gearbox_d/2,-1])
405 cylinder(d=knob_indent_d,h=knob_h+2,$fn=fnd*knob_indent_d); 418 cylinder(d=knob_indent_d,h=knob_h+2,$fn=fnd*knob_indent_d);
406 } 419 }
407 } 420 }
408 }//knob module 421 }//knob module
409 422
410 module debug() { 423 module debug() {
411 difference() { 424 difference() {
412 children(); 425 children();
413 if(debug) { 426 if(debug) {
414 // spring tensioner debug cutout 427 // spring tensioner debug cutout
415 if(tensioner) // TODO: collaps copypasted transformations 428 if(tensioner) // TODO: collaps copypasted transformations
416 translate([-gearbox_d/2,0,0]) 429 translate([-gearbox_d/2,0,0])
417 translate([0,-longwing,ls_z]) rotate([0,-90,0]) 430 translate([0,-longwing,ls_z]) rotate([0,-90,0])
418 translate([0,-lever_thickness/2-1,-gearbox_d]) 431 translate([0,-lever_thickness/2-1,-gearbox_d])
419 cube(size=[body_h/2+1,lever_thickness/2+1,gearbox_d+2]); 432 cube(size=[body_h/2+1,lever_thickness/2+1,gearbox_d+2]);
420 // lever axis debug cutout 433 // lever axis debug cutout
421 translate([mount_d/2,0,-1]) 434 translate([mount_d/2,0,-1])
422 rotate([0,0,-45]) 435 rotate([0,0,-45])
423 cube(size=[gearbox_d-mount_d,gearbox_d-mount_d,body_h+knob_h+2]); 436 cube(size=[gearbox_d-mount_d,gearbox_d-mount_d,body_h+knob_h+2]);
424 // idler debug cutout 437 // idler debug cutout
425 translate([0,0,ls_z]) 438 translate([0,0,ls_z])
426 place_idler() 439 place_idler()
427 rotate([0,0,-45]) 440 rotate([0,0,-45])
428 translate([0,0,-lever_thickness/2-epsilon]) 441 translate([0,0,-lever_thickness/2-epsilon])
429 cube(size=[(idler_d+idler_clearance)/2,(idler_d+idler_clearance)/2, 442 cube(size=[(idler_d+idler_clearance)/2,(idler_d+idler_clearance)/2,
430 lever_thickness+2*epsilon]); 443 lever_thickness+2*epsilon]);
431 }//if debug 444 }//if debug
432 }//difference 445 }//difference
433 } 446 }
434 447
435 mirrorleft() 448 mirrorleft()
436 debug() 449 debug()
437 if(what=="lever") color("green",0.7) lever(); 450 if(what=="lever") color("green",0.7) lever();
438 else if(what=="body") color("yellow",0.7) body(); 451 else if(what=="body") color("yellow",0.7) body();
439 else if(what=="knob") color("red",0.7) knob(); 452 else if(what=="knob") color("red",0.7) knob();
440 else if(what=="springpad") color("blue",0.7) springpad(); 453 else if(what=="springpad") color("blue",0.7) springpad();
441 else if(what=="both") { 454 else if(what=="both") {
442 color("green",0.7) lever(); 455 color("green",0.7) lever();
443 color("yellow",0.7) body(); 456 color("yellow",0.7) body();
444 }else{ 457 }else{
445 color("green",0.7) lever(); 458 color("green",0.7) lever();
446 color("yellow",0.7) body(); 459 color("yellow",0.7) body();
447 color("red",0.7) knob(); 460 color("red",0.7) knob();
448 color("blue",0.7) springpad(); 461 color("blue",0.7) springpad();
449 } 462 }
450} 463}
451 464
452the_extruder(what="*",left=false,debug=true); 465the_extruder(what="*",left=false,debug=true);