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