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