author | Michael Krelin <hacker@klever.net> | 2018-09-04 20:16:04 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2018-09-04 20:16:04 (UTC) |
commit | 1ad17a1b1dc1365e201a6f9d647ec31bda42beb7 (patch) (unidiff) | |
tree | faf83fa869f7797dc9b1ea43b36e666c5c85187b | |
parent | 416fff4142cc472af0e4c26a89df0c2e0957b518 (diff) | |
download | extrudery-1ad17a1b1dc1365e201a6f9d647ec31bda42beb7.zip extrudery-1ad17a1b1dc1365e201a6f9d647ec31bda42beb7.tar.gz extrudery-1ad17a1b1dc1365e201a6f9d647ec31bda42beb7.tar.bz2 |
Revert "increase default bore_d tolerance"
This reverts commit 183ac2d4948c69d97b5491dcf83fb238d53ac121.
-rw-r--r-- | another.scad | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/another.scad b/another.scad index f3305a1..a25e047 100644 --- a/another.scad +++ b/another.scad | |||
@@ -1,509 +1,509 @@ | |||
1 | draft=true; | 1 | draft=true; |
2 | layer_height=0.2; extrusion_width=0.4; | 2 | layer_height=0.2; extrusion_width=0.4; |
3 | epsilon=0.01; | 3 | epsilon=0.01; |
4 | $fs=0.0125; | 4 | $fs=0.0125; |
5 | 5 | ||
6 | use <pushfittery.scad>; | 6 | use <pushfittery.scad>; |
7 | include <pushfit_data.scad>; | 7 | include <pushfit_data.scad>; |
8 | include <pulley_data.scad>; | 8 | include <pulley_data.scad>; |
9 | 9 | ||
10 | module the_extruder( | 10 | module the_extruder( |
11 | // motor properties | 11 | // motor properties |
12 | gearbox_d = 36, | 12 | gearbox_d = 36, |
13 | mount_d = 28, // the distance between opposite mounting holes | 13 | mount_d = 28, // the distance between opposite mounting holes |
14 | mounthole_depth = 5, | 14 | mounthole_depth = 5, |
15 | mounthole_min_depth = 3, mounthole_max_depth = 4, | 15 | mounthole_min_depth = 3, mounthole_max_depth = 4, |
16 | protrusion_d = 22, protrusion_h = 2.2, // the dimensions of the protrusion on top of gearbox | 16 | protrusion_d = 22, protrusion_h = 2.2, // the dimensions of the protrusion on top of gearbox |
17 | bore_d = 8, bore_l = 17.6, | 17 | bore_d = 8, bore_l = 17.6, |
18 | bore_dd = 7, | 18 | bore_dd = 7, |
19 | // pulley properties | 19 | // pulley properties |
20 | pulley = pulley_e3d, | 20 | pulley = pulley_e3d, |
21 | pulley_elevation = 1, // pulley elevation above the protrusion | 21 | pulley_elevation = 1, // pulley elevation above the protrusion |
22 | // idler properties | 22 | // idler properties |
23 | idler_d = 10, idler_h = 4, idler_id = 3,// idler dimensions: outer and inner diameters and height | 23 | idler_d = 10, idler_h = 4, idler_id = 3,// idler dimensions: outer and inner diameters and height |
24 | // spring properties | 24 | // spring properties |
25 | spring_d = 10, spring_lc = 9.6, // spring diameter and compressed length | 25 | spring_d = 10, spring_lc = 9.6, // spring diameter and compressed length |
26 | // filament path properties | 26 | // filament path properties |
27 | filament_d = 1.75, | 27 | filament_d = 1.75, |
28 | filament_path_d = 2, | 28 | filament_path_d = 2, |
29 | filament_guide_d = 4, // PTFE filament guide diameter | 29 | filament_guide_d = 4, // PTFE filament guide diameter |
30 | // knob properties | 30 | // knob properties |
31 | knob_h = 10, | 31 | knob_h = 10, |
32 | knob_indent_d = 4, | 32 | knob_indent_d = 4, |
33 | knob_indents = 12, | 33 | knob_indents = 12, |
34 | knob_v_clearance = 1, | 34 | knob_v_clearance = 1, |
35 | // spring tensioner | 35 | // spring tensioner |
36 | st_nut_d = 9, st_nut_h = 4, | 36 | st_nut_d = 9, st_nut_h = 4, |
37 | st_screw_d = 5, st_screw_l = 16, | 37 | st_screw_d = 5, st_screw_l = 16, |
38 | st_thickshell = 8*extrusion_width, st_thinshell = 2*extrusion_width, | 38 | st_thickshell = 8*extrusion_width, st_thinshell = 2*extrusion_width, |
39 | st_split_w = 4*extrusion_width, | 39 | st_split_w = 4*extrusion_width, |
40 | 40 | ||
41 | // screw it | 41 | // screw it |
42 | mount_screw_d = 3.1, mount_screw_l = 20, | 42 | mount_screw_d = 3.1, mount_screw_l = 20, |
43 | mount_screwhead_d=6, mount_screwhead_h=3, | 43 | mount_screwhead_d=6, mount_screwhead_h=3, |
44 | idler_screw_d = 3, | 44 | idler_screw_d = 3, |
45 | idler_screwhead_d=6, idler_screwhead_h=3, | 45 | idler_screwhead_d=6, idler_screwhead_h=3, |
46 | 46 | ||
47 | pf = pushfit_metal, | 47 | pf = pushfit_metal, |
48 | pf_shell = max(3*layer_height,3*extrusion_width), | 48 | pf_shell = max(3*layer_height,3*extrusion_width), |
49 | 49 | ||
50 | // empty spaces | 50 | // empty spaces |
51 | idler_travel = 1.75*2, // how far should idler travel when pressed | 51 | idler_travel = 1.75*2, // how far should idler travel when pressed |
52 | idler_clearance=.5, | 52 | idler_clearance=.5, |
53 | pulley_small_d_clearance=.5, | 53 | pulley_small_d_clearance=.5, |
54 | lever_v_clearance=.7, // vertical clearance for the lever | 54 | lever_v_clearance=.7, // vertical clearance for the lever |
55 | spring_d_clearance=1, | 55 | spring_d_clearance=1, |
56 | protrusion_tolerance_h=.5, // horizontal tolerance for the motor protrusion | 56 | protrusion_tolerance_h=.5, // horizontal tolerance for the motor protrusion |
57 | protrusion_tolerance_v=.5, // vertical tolerance for the motor protrusion | 57 | protrusion_tolerance_v=.5, // vertical tolerance for the motor protrusion |
58 | mount_screw_d_tolerance=.4, | 58 | mount_screw_d_tolerance=.4, |
59 | idler_v_tolerance=.5, | 59 | idler_v_tolerance=.5, |
60 | knob_bore_d_tolerance=.8, | 60 | knob_bore_d_tolerance=.6, |
61 | st_nut_h_tolerance=.2, | 61 | st_nut_h_tolerance=.2, |
62 | st_nut_d_tolerance=.2,/* TODO: make it st_nut_w_tolerance */ | 62 | st_nut_d_tolerance=.2,/* TODO: make it st_nut_w_tolerance */ |
63 | st_screw_d_tolerance=.5, | 63 | st_screw_d_tolerance=.5, |
64 | st_split_w_tolerance = .3, | 64 | st_split_w_tolerance = .3, |
65 | 65 | ||
66 | min_z_shell = 4*layer_height, // the very minimal shell thickness along z-axis. | 66 | min_z_shell = 4*layer_height, // the very minimal shell thickness along z-axis. |
67 | min_xy_shell = 2*extrusion_width, | 67 | min_xy_shell = 2*extrusion_width, |
68 | 68 | ||
69 | body_label = "another", body_label_thickness = layer_height, | 69 | body_label = "another", body_label_thickness = layer_height, |
70 | knob_label = "another", knob_label_thickness = 2*layer_height, knob_label_size=undef, | 70 | knob_label = "another", knob_label_thickness = 2*layer_height, knob_label_size=undef, |
71 | 71 | ||
72 | what="lever", // lever|body|knob|springpad|* | 72 | what="lever", // lever|body|knob|springpad|* |
73 | left=false, | 73 | left=false, |
74 | vitamins = true, | 74 | vitamins = true, |
75 | bridges = true, | 75 | bridges = true, |
76 | debug = false, | 76 | debug = false, |
77 | ) { | 77 | ) { |
78 | fnd = 2*PI; fnr = 2*fnd; | 78 | fnd = 2*PI; fnr = 2*fnd; |
79 | function lu(m,k) = m[search([k],m)[0]][1]; | 79 | function lu(m,k) = m[search([k],m)[0]][1]; |
80 | 80 | ||
81 | pulley_d = lu(pulley,"d"); | 81 | pulley_d = lu(pulley,"d"); |
82 | pulley_h = lu(pulley,"h"); | 82 | pulley_h = lu(pulley,"h"); |
83 | teeth_elevation = lu(pulley,"fe"); | 83 | teeth_elevation = lu(pulley,"fe"); |
84 | filament_offset = lu(pulley,"g")+filament_d/2; | 84 | filament_offset = lu(pulley,"g")+filament_d/2; |
85 | pulley_d_clearance = lu(pulley,"ssrc")*2; | 85 | pulley_d_clearance = lu(pulley,"ssrc")*2; |
86 | 86 | ||
87 | sp_ch = st_split_w; | 87 | sp_ch = st_split_w; |
88 | 88 | ||
89 | idler_filament_offset = filament_path_d/2; | 89 | idler_filament_offset = filament_path_d/2; |
90 | lever_shell = mount_screwhead_h+0.5; | 90 | lever_shell = mount_screwhead_h+0.5; |
91 | lever_thickness=max(spring_d+spring_d_clearance+layer_height*8,idler_h+idler_v_tolerance+2*lever_shell); | 91 | lever_thickness=max(spring_d+spring_d_clearance+layer_height*8,idler_h+idler_v_tolerance+2*lever_shell); |
92 | lsd = min(gearbox_d-mount_d,idler_d-idler_clearance*2); // the diameter of lever thingie | 92 | lsd = min(gearbox_d-mount_d,idler_d-idler_clearance*2); // the diameter of lever thingie |
93 | longwing=(mount_d+mount_screw_d+mount_screw_d_tolerance+spring_d+spring_d_clearance)/2+min_xy_shell; | 93 | longwing=(mount_d+mount_screw_d+mount_screw_d_tolerance+spring_d+spring_d_clearance)/2+min_xy_shell; |
94 | shortwing = let(a=mount_d/2,c=(pulley_d+idler_d)/2/sqrt(2)) | 94 | shortwing = let(a=mount_d/2,c=(pulley_d+idler_d)/2/sqrt(2)) |
95 | sqrt(c*c+pow(a-c,2)); | 95 | sqrt(c*c+pow(a-c,2)); |
96 | longwing_travel = idler_travel*longwing/shortwing; | 96 | longwing_travel = idler_travel*longwing/shortwing; |
97 | h_ = (pulley_d+idler_d)/(2*sqrt(2)); | 97 | h_ = (pulley_d+idler_d)/(2*sqrt(2)); |
98 | ri = sqrt( pow(h_,2) + pow(mount_d/2-h_,2) ); | 98 | ri = sqrt( pow(h_,2) + pow(mount_d/2-h_,2) ); |
99 | spring_dl = idler_travel*longwing/ri; | 99 | spring_dl = idler_travel*longwing/ri; |
100 | // finger and spring support width | 100 | // finger and spring support width |
101 | fsw = gearbox_d-(gearbox_d-mount_d)/2-max(spring_lc,longwing_travel+(gearbox_d-mount_d)/2); | 101 | fsw = gearbox_d-(gearbox_d-mount_d)/2-max(spring_lc,longwing_travel+(gearbox_d-mount_d)/2); |
102 | 102 | ||
103 | mount_min_depth = mounthole_min_depth ? mounthole_min_depth : mounthole_depth-1; | 103 | mount_min_depth = mounthole_min_depth ? mounthole_min_depth : mounthole_depth-1; |
104 | mount_max_depth = mounthole_max_depth ? mounthole_max_depth : mounthole_depth+1; | 104 | mount_max_depth = mounthole_max_depth ? mounthole_max_depth : mounthole_depth+1; |
105 | filament_elevation=protrusion_h+pulley_elevation+teeth_elevation; | 105 | filament_elevation=protrusion_h+pulley_elevation+teeth_elevation; |
106 | ls_z = filament_elevation; // leverspace mid-z | 106 | ls_z = filament_elevation; // leverspace mid-z |
107 | ls_h = lever_thickness+lever_v_clearance; // leverspace height | 107 | ls_h = lever_thickness+lever_v_clearance; // leverspace height |
108 | mount_depth = mount_screw_l - (ls_z+ls_h/2+min_z_shell); | 108 | mount_depth = mount_screw_l - (ls_z+ls_h/2+min_z_shell); |
109 | body_h = max(protrusion_h+bore_l,mount_screw_l-mount_depth+mount_screwhead_h+min_z_shell,ls_z*2); | 109 | body_h = max(protrusion_h+bore_l,mount_screw_l-mount_depth+mount_screwhead_h+min_z_shell,ls_z*2); |
110 | echo("mount depth",mount_depth); | 110 | echo("mount depth",mount_depth); |
111 | 111 | ||
112 | pf_offset = mount_d/sqrt(2)/2+mount_screw_d/2+min_xy_shell; | 112 | pf_offset = mount_d/sqrt(2)/2+mount_screw_d/2+min_xy_shell; |
113 | 113 | ||
114 | module teardrop(r,d,h,center=false,angle=45) { | 114 | module teardrop(r,d,h,center=false,angle=45) { |
115 | dd = d ? d : (2*r); | 115 | dd = d ? d : (2*r); |
116 | $fn = dd*fnd; | 116 | $fn = dd*fnd; |
117 | cylinder(d=dd,h=h,center=center); | 117 | cylinder(d=dd,h=h,center=center); |
118 | if(angle>0) translate([0,0,center?-h/2:0]) | 118 | if(angle>0) translate([0,0,center?-h/2:0]) |
119 | rotate([0,0,angle]) | 119 | rotate([0,0,angle]) |
120 | cube(size=[d/2,d/2,h]); | 120 | cube(size=[d/2,d/2,h]); |
121 | } | 121 | } |
122 | 122 | ||
123 | module mirrorleft() { | 123 | module mirrorleft() { |
124 | mirror([left?0:1,0,0]) children(); | 124 | mirror([left?0:1,0,0]) children(); |
125 | } | 125 | } |
126 | module place_idler() { | 126 | module place_idler() { |
127 | rotate([0,0,45]) | 127 | rotate([0,0,45]) |
128 | translate([(pulley_d+idler_d)/2,0,0]) | 128 | translate([(pulley_d+idler_d)/2,0,0]) |
129 | children(); | 129 | children(); |
130 | } | 130 | } |
131 | module finger_indent(d=lever_thickness,depth/*=1*/,r/*=15*/) { | 131 | module finger_indent(d=lever_thickness,depth/*=1*/,r/*=15*/) { |
132 | if(depth) { | 132 | if(depth) { |
133 | hh = (-4*pow(depth,2)+pow(d,2))/(8*depth); | 133 | hh = (-4*pow(depth,2)+pow(d,2))/(8*depth); |
134 | rr = depth+hh; | 134 | rr = depth+hh; |
135 | translate([0,0,hh]) sphere(r=rr,$fn=fnr*rr); | 135 | translate([0,0,hh]) sphere(r=rr,$fn=fnr*rr); |
136 | }else if(r) { | 136 | }else if(r) { |
137 | hh=sqrt(pow(r,2)-pow(d,2)/4); | 137 | hh=sqrt(pow(r,2)-pow(d,2)/4); |
138 | translate([0,0,hh]) sphere(r=r,$fn=fnr*r); | 138 | translate([0,0,hh]) sphere(r=r,$fn=fnr*r); |
139 | } | 139 | } |
140 | } | 140 | } |
141 | 141 | ||
142 | % if(vitamins) mirrorleft() { | 142 | % if(vitamins) mirrorleft() { |
143 | translate([0,0,-epsilon]) mirror([0,0,1]) cylinder(d=gearbox_d,h=1,$fn=60); | 143 | translate([0,0,-epsilon]) mirror([0,0,1]) cylinder(d=gearbox_d,h=1,$fn=60); |
144 | for(zr=[0:90:359]) rotate([0,0,zr]) translate([mount_d/2,0,0]) | 144 | for(zr=[0:90:359]) rotate([0,0,zr]) translate([mount_d/2,0,0]) |
145 | cylinder(d=mount_screw_d,h=20,$fn=30); | 145 | cylinder(d=mount_screw_d,h=20,$fn=30); |
146 | translate([0,0,-epsilon]) cylinder(d=protrusion_d,h=protrusion_h,$fn=30); | 146 | translate([0,0,-epsilon]) cylinder(d=protrusion_d,h=protrusion_h,$fn=30); |
147 | translate([0,0,protrusion_h]) { | 147 | translate([0,0,protrusion_h]) { |
148 | difference() { | 148 | difference() { |
149 | cylinder(d=bore_d,h=bore_l,$fn=30); | 149 | cylinder(d=bore_d,h=bore_l,$fn=30); |
150 | translate([-bore_d/2-1,bore_dd-bore_d/2,-1]) | 150 | translate([-bore_d/2-1,bore_dd-bore_d/2,-1]) |
151 | cube([bore_d+2,bore_d/2,bore_l+2]); | 151 | cube([bore_d+2,bore_d/2,bore_l+2]); |
152 | } | 152 | } |
153 | translate([0,0,pulley_elevation]) { | 153 | translate([0,0,pulley_elevation]) { |
154 | cylinder(d=pulley_d,h=pulley_h,$fn=30); | 154 | cylinder(d=pulley_d,h=pulley_h,$fn=30); |
155 | translate([0,0,teeth_elevation]) { | 155 | translate([0,0,teeth_elevation]) { |
156 | place_idler() { | 156 | place_idler() { |
157 | cylinder(d=idler_d,h=idler_h,center=true,$fn=30); | 157 | cylinder(d=idler_d,h=idler_h,center=true,$fn=30); |
158 | cylinder(d=idler_screw_d,h=lever_thickness+2,center=true,$fn=30); | 158 | cylinder(d=idler_screw_d,h=lever_thickness+2,center=true,$fn=30); |
159 | }//place idler | 159 | }//place idler |
160 | // filament path | 160 | // filament path |
161 | rotate([0,0,45]) { | 161 | rotate([0,0,45]) { |
162 | translate([pulley_d/2-idler_filament_offset,0,0]) rotate([90,0,0]) { | 162 | translate([pulley_d/2-idler_filament_offset,0,0]) rotate([90,0,0]) { |
163 | cylinder(d=filament_d,h=gearbox_d,center=false,$fn=15); | 163 | cylinder(d=filament_d,h=gearbox_d,center=false,$fn=15); |
164 | }//rotate translate | 164 | }//rotate translate |
165 | translate([pulley_d/2+filament_offset,0,0]) rotate([-90,0,0]) { | 165 | translate([pulley_d/2+filament_offset,0,0]) rotate([-90,0,0]) { |
166 | cylinder(d=filament_d,h=gearbox_d,center=false,$fn=15); | 166 | cylinder(d=filament_d,h=gearbox_d,center=false,$fn=15); |
167 | translate([0,0,pf_offset]) | 167 | translate([0,0,pf_offset]) |
168 | pushfit(pf); | 168 | pushfit(pf); |
169 | }//rotate translate | 169 | }//rotate translate |
170 | }//rotate | 170 | }//rotate |
171 | }//translate teeth | 171 | }//translate teeth |
172 | }//translate pulley | 172 | }//translate pulley |
173 | }//translate protrusion | 173 | }//translate protrusion |
174 | // spring tensioner screw | 174 | // spring tensioner screw |
175 | translate([-gearbox_d/2,-longwing,ls_z]) | 175 | translate([-gearbox_d/2,-longwing,ls_z]) |
176 | rotate([0,90,0]) | 176 | rotate([0,90,0]) |
177 | cylinder(d=st_screw_d,h=st_screw_l); | 177 | cylinder(d=st_screw_d,h=st_screw_l); |
178 | }//mirrorleft if(vitamins) | 178 | }//mirrorleft if(vitamins) |
179 | 179 | ||
180 | module lever() { | 180 | module lever() { |
181 | translate([0,0,protrusion_h+pulley_elevation+teeth_elevation]) { | 181 | translate([0,0,protrusion_h+pulley_elevation+teeth_elevation]) { |
182 | difference() { | 182 | difference() { |
183 | union() { | 183 | union() { |
184 | hull() { | 184 | hull() { |
185 | place_idler() | 185 | place_idler() |
186 | cylinder(d=lsd,h=lever_thickness,center=true,$fn=60); | 186 | cylinder(d=lsd,h=lever_thickness,center=true,$fn=60); |
187 | translate([mount_d/2,0,0]) | 187 | translate([mount_d/2,0,0]) |
188 | cylinder(d=lsd,h=lever_thickness,center=true,$fn=60); | 188 | cylinder(d=lsd,h=lever_thickness,center=true,$fn=60); |
189 | }//hull | 189 | }//hull |
190 | hull() { | 190 | hull() { |
191 | translate([mount_d/2,0,0]) | 191 | translate([mount_d/2,0,0]) |
192 | cylinder(d=lsd,h=lever_thickness,center=true,$fn=60); | 192 | cylinder(d=lsd,h=lever_thickness,center=true,$fn=60); |
193 | translate([mount_d/2,-longwing,0]) rotate([0,90,0]) | 193 | translate([mount_d/2,-longwing,0]) rotate([0,90,0]) |
194 | cylinder(d=lever_thickness,h=lsd,center=true,$fn=60); | 194 | cylinder(d=lever_thickness,h=lsd,center=true,$fn=60); |
195 | }//hull | 195 | }//hull |
196 | }//union | 196 | }//union |
197 | 197 | ||
198 | // filament path | 198 | // filament path |
199 | place_idler() | 199 | place_idler() |
200 | translate([-idler_d/2-idler_filament_offset,0,0]) | 200 | translate([-idler_d/2-idler_filament_offset,0,0]) |
201 | rotate([90,0,0]) { | 201 | rotate([90,0,0]) { |
202 | mirror([0,1,0]) | 202 | mirror([0,1,0]) |
203 | teardrop(d=filament_path_d,h=3*gearbox_d,center=true); | 203 | teardrop(d=filament_path_d,h=3*gearbox_d,center=true); |
204 | translate([0,0, | 204 | translate([0,0, |
205 | sqrt(2)*(mount_d-pulley_d+lsd)/2 | 205 | sqrt(2)*(mount_d-pulley_d+lsd)/2 |
206 | ]) { | 206 | ]) { |
207 | cylinder(d1=filament_path_d,d2=2*filament_path_d, | 207 | cylinder(d1=filament_path_d,d2=2*filament_path_d, |
208 | h=filament_path_d,$fn=2*filament_path_d*fnd); | 208 | h=filament_path_d,$fn=2*filament_path_d*fnd); |
209 | translate([0,0,filament_path_d-epsilon]) | 209 | translate([0,0,filament_path_d-epsilon]) |
210 | cylinder(d=2*filament_path_d,h=lsd*sqrt(2),$fn=2*filament_path_d*fnd); | 210 | cylinder(d=2*filament_path_d,h=lsd*sqrt(2),$fn=2*filament_path_d*fnd); |
211 | }//translate | 211 | }//translate |
212 | }//rotate translate place_idler | 212 | }//rotate translate place_idler |
213 | 213 | ||
214 | // idler space and mounting hole | 214 | // idler space and mounting hole |
215 | place_idler() { | 215 | place_idler() { |
216 | cylinder(d=idler_d+idler_clearance*2,h=idler_h+idler_v_tolerance,center=true,$fn=60); | 216 | cylinder(d=idler_d+idler_clearance*2,h=idler_h+idler_v_tolerance,center=true,$fn=60); |
217 | cylinder(d=idler_screw_d,h=lever_thickness+2,center=true,$fn=30); | 217 | cylinder(d=idler_screw_d,h=lever_thickness+2,center=true,$fn=30); |
218 | translate([0,0,lever_thickness/2-idler_screwhead_h]) | 218 | translate([0,0,lever_thickness/2-idler_screwhead_h]) |
219 | cylinder(d=idler_screwhead_d,h=idler_screwhead_h+1,$fn=fnd*idler_screwhead_d); | 219 | cylinder(d=idler_screwhead_d,h=idler_screwhead_h+1,$fn=fnd*idler_screwhead_d); |
220 | } | 220 | } |
221 | // mounting screw hole | 221 | // mounting screw hole |
222 | translate([mount_d/2,0,0]) | 222 | translate([mount_d/2,0,0]) |
223 | cylinder(d=mount_screw_d+mount_screw_d_tolerance,h=lever_thickness+2,center=true,$fn=fnd*mount_screw_d); | 223 | cylinder(d=mount_screw_d+mount_screw_d_tolerance,h=lever_thickness+2,center=true,$fn=fnd*mount_screw_d); |
224 | 224 | ||
225 | // lever end | 225 | // lever end |
226 | translate([mount_d/2,0,0]) rotate([0,90,0]) { | 226 | translate([mount_d/2,0,0]) rotate([0,90,0]) { |
227 | translate([0,-longwing,lsd/2]) finger_indent(d=lever_thickness-1,r=15); | 227 | translate([0,-longwing,lsd/2]) finger_indent(d=lever_thickness-1,r=15); |
228 | translate([0,-longwing,0]) | 228 | translate([0,-longwing,0]) |
229 | mirror([0,0,1]) | 229 | mirror([0,0,1]) |
230 | difference() { | 230 | difference() { |
231 | cylinder(d=spring_d+spring_d_clearance,h=lsd,$fn=fnd*(spring_d+spring_d_clearance)); | 231 | cylinder(d=spring_d+spring_d_clearance,h=lsd,$fn=fnd*(spring_d+spring_d_clearance)); |
232 | sphere(d=spring_d*3/4,$fn=fnd*spring_d*3/4); | 232 | sphere(d=spring_d*3/4,$fn=fnd*spring_d*3/4); |
233 | } | 233 | } |
234 | }//rotate-translate | 234 | }//rotate-translate |
235 | }//difference | 235 | }//difference |
236 | // bridging patch | 236 | // bridging patch |
237 | if(bridges) place_idler() | 237 | if(bridges) place_idler() |
238 | translate([0,0,lever_thickness/2-mount_screwhead_h]) | 238 | translate([0,0,lever_thickness/2-mount_screwhead_h]) |
239 | mirror([0,0,1]) | 239 | mirror([0,0,1]) |
240 | cylinder(d=mount_screwhead_d,h=layer_height); | 240 | cylinder(d=mount_screwhead_d,h=layer_height); |
241 | }//translate | 241 | }//translate |
242 | }//lever module | 242 | }//lever module |
243 | 243 | ||
244 | module body() { | 244 | module body() { |
245 | difference() { | 245 | difference() { |
246 | union() { | 246 | union() { |
247 | cylinder(d=gearbox_d,h=body_h,$fn=fnd*gearbox_d); | 247 | cylinder(d=gearbox_d,h=body_h,$fn=fnd*gearbox_d); |
248 | // spring tensioner part | 248 | // spring tensioner part |
249 | translate([-gearbox_d/2,0,0]) hull() { | 249 | translate([-gearbox_d/2,0,0]) hull() { |
250 | translate([0,-longwing,ls_z]) | 250 | translate([0,-longwing,ls_z]) |
251 | rotate([0,90,0]) | 251 | rotate([0,90,0]) |
252 | cylinder(d=lever_thickness,h=fsw,$fn=fnd*lever_thickness); | 252 | cylinder(d=lever_thickness,h=fsw,$fn=fnd*lever_thickness); |
253 | hh=body_h-ls_z; | 253 | hh=body_h-ls_z; |
254 | translate([0,0,ls_z]) | 254 | translate([0,0,ls_z]) |
255 | mirror([0,1,0]) cube(size=[fsw,longwing+(st_split_w+st_split_w_tolerance)/2+st_thickshell,body_h-ls_z]); | 255 | mirror([0,1,0]) cube(size=[fsw,longwing+(st_split_w+st_split_w_tolerance)/2+st_thickshell,body_h-ls_z]); |
256 | hhh=ls_z; | 256 | hhh=ls_z; |
257 | translate([0,0,0]) | 257 | translate([0,0,0]) |
258 | mirror([0,1,0]) cube(size=[fsw,longwing-hhh+lever_thickness/sqrt(2),hhh+lever_thickness/2]); | 258 | mirror([0,1,0]) cube(size=[fsw,longwing-hhh+lever_thickness/sqrt(2),hhh+lever_thickness/2]); |
259 | }//hull translate | 259 | }//hull translate |
260 | 260 | ||
261 | // pushfit bracket | 261 | // pushfit bracket |
262 | translate([0,0,filament_elevation]) | 262 | translate([0,0,filament_elevation]) |
263 | rotate([0,0,45]) translate([pulley_d/2+filament_offset,0,0]) | 263 | rotate([0,0,45]) translate([pulley_d/2+filament_offset,0,0]) |
264 | rotate([-90,0,0]) | 264 | rotate([-90,0,0]) |
265 | translate([0,0,pf_offset-gearbox_d/2/*TODO:*/]) { | 265 | translate([0,0,pf_offset-gearbox_d/2/*TODO:*/]) { |
266 | pfbl = pf_h(pf)+gearbox_d/2; //TODO: | 266 | pfbl = pf_h(pf)+gearbox_d/2; //TODO: |
267 | pfbd = pf_d(pf)+2*pf_shell; | 267 | pfbd = pf_d(pf)+2*pf_shell; |
268 | hull() { | 268 | hull() { |
269 | cylinder(d=pfbd,h=pfbl,$fn=pfbd*fnd); | 269 | cylinder(d=pfbd,h=pfbl,$fn=pfbd*fnd); |
270 | translate([-epsilon/2,0,0]) { | 270 | translate([-epsilon/2,0,0]) { |
271 | cube(size=[epsilon,filament_elevation,pfbl-filament_elevation+pfbd/2]); | 271 | cube(size=[epsilon,filament_elevation,pfbl-filament_elevation+pfbd/2]); |
272 | mirror([0,1,0]) | 272 | mirror([0,1,0]) |
273 | cube(size=[epsilon,body_h-filament_elevation,pfbl-body_h+filament_elevation+pfbd/2]); | 273 | cube(size=[epsilon,body_h-filament_elevation,pfbl-body_h+filament_elevation+pfbd/2]); |
274 | }//translate | 274 | }//translate |
275 | }//hull | 275 | }//hull |
276 | }//translate rotate translate rotate translate | 276 | }//translate rotate translate rotate translate |
277 | }//union (first child of difference) | 277 | }//union (first child of difference) |
278 | 278 | ||
279 | // protrusion | 279 | // protrusion |
280 | translate([0,0,-1]) | 280 | translate([0,0,-1]) |
281 | cylinder(d=protrusion_d+protrusion_tolerance_h,h=protrusion_h+protrusion_tolerance_v+1,$fn=fnd*(protrusion_d+protrusion_tolerance_h)); | 281 | cylinder(d=protrusion_d+protrusion_tolerance_h,h=protrusion_h+protrusion_tolerance_v+1,$fn=fnd*(protrusion_d+protrusion_tolerance_h)); |
282 | // mount screw holes | 282 | // mount screw holes |
283 | for(zr=[0:90:359]) rotate([0,0,zr]) translate([mount_d/2,0,0]) { | 283 | for(zr=[0:90:359]) rotate([0,0,zr]) translate([mount_d/2,0,0]) { |
284 | translate([0,0,mount_screw_l-mount_depth-(bridges?layer_height:-epsilon)]) | 284 | translate([0,0,mount_screw_l-mount_depth-(bridges?layer_height:-epsilon)]) |
285 | mirror([0,0,1]) | 285 | mirror([0,0,1]) |
286 | cylinder(d=mount_screw_d+mount_screw_d_tolerance, | 286 | cylinder(d=mount_screw_d+mount_screw_d_tolerance, |
287 | h=mount_screw_l-mount_depth+1, | 287 | h=mount_screw_l-mount_depth+1, |
288 | $fn=fnd*(mount_screw_d+mount_screw_d_tolerance)); | 288 | $fn=fnd*(mount_screw_d+mount_screw_d_tolerance)); |
289 | translate([0,0,mount_screw_l-mount_depth]) | 289 | translate([0,0,mount_screw_l-mount_depth]) |
290 | cylinder(d=mount_screwhead_d,h=body_h+1,$fn=fnd*mount_screwhead_d); | 290 | cylinder(d=mount_screwhead_d,h=body_h+1,$fn=fnd*mount_screwhead_d); |
291 | }//for | 291 | }//for |
292 | // pushfit | 292 | // pushfit |
293 | translate([0,0,filament_elevation]) | 293 | translate([0,0,filament_elevation]) |
294 | rotate([0,0,45]) translate([pulley_d/2+filament_offset,0,0]) | 294 | rotate([0,0,45]) translate([pulley_d/2+filament_offset,0,0]) |
295 | rotate([-90,0,0]) | 295 | rotate([-90,0,0]) |
296 | translate([0,0,pf_offset]) | 296 | translate([0,0,pf_offset]) |
297 | rotate([0,0,180]) { | 297 | rotate([0,0,180]) { |
298 | pushfit(pf); | 298 | pushfit(pf); |
299 | mirror([0,0,1]) { | 299 | mirror([0,0,1]) { |
300 | fh = 1.5* (filament_guide_d-filament_path_d)/2; | 300 | fh = 1.5* (filament_guide_d-filament_path_d)/2; |
301 | fo = pf_offset -filament_path_d /*(idler_d+idler_clearance)/2*/-fh; | 301 | fo = pf_offset -filament_path_d /*(idler_d+idler_clearance)/2*/-fh; |
302 | translate([0,0,-1]) teardrop(d=filament_guide_d,h=fo/2,angle=225); | 302 | translate([0,0,-1]) teardrop(d=filament_guide_d,h=fo/2,angle=225); |
303 | translate([0,0,-1]) teardrop(d=filament_path_d,h=gearbox_d/2+1,angle=-225); | 303 | translate([0,0,-1]) teardrop(d=filament_path_d,h=gearbox_d/2+1,angle=-225); |
304 | translate([0,0,fo+epsilon]) | 304 | translate([0,0,fo+epsilon]) |
305 | cylinder(d1=filament_path_d,d2=filament_guide_d,h=fh,$fn=fnd*filament_guide_d); | 305 | cylinder(d1=filament_path_d,d2=filament_guide_d,h=fh,$fn=fnd*filament_guide_d); |
306 | }//mirror | 306 | }//mirror |
307 | }//rotate translate rotate translate rotate translate | 307 | }//rotate translate rotate translate rotate translate |
308 | // pulley | 308 | // pulley |
309 | cylinder(d=pulley_d+pulley_small_d_clearance,h=body_h+1,$fn=fnd*(pulley_d+pulley_d_clearance)); | 309 | cylinder(d=pulley_d+pulley_small_d_clearance,h=body_h+1,$fn=fnd*(pulley_d+pulley_d_clearance)); |
310 | cylinder(d=pulley_d+pulley_d_clearance,ls_z-max(idler_h,filament_guide_d)/2,$fn=fnd*(pulley_d+pulley_d_clearance)); | 310 | cylinder(d=pulley_d+pulley_d_clearance,ls_z-max(idler_h,filament_guide_d)/2,$fn=fnd*(pulley_d+pulley_d_clearance)); |
311 | 311 | ||
312 | translate([0,0,ls_z-ls_h/2]) { | 312 | translate([0,0,ls_z-ls_h/2]) { |
313 | // idler travel | 313 | // idler travel |
314 | translate([mount_d/2,0,0]) | 314 | translate([mount_d/2,0,0]) |
315 | rotate([0,0,45]) | 315 | rotate([0,0,45]) |
316 | rotate_extrude(angle=90,$fn=fnr*(shortwing+(idler_d+idler_clearance)/2)) | 316 | rotate_extrude(angle=90,$fn=fnr*(shortwing+(idler_d+idler_clearance)/2)) |
317 | square([shortwing+(idler_d+idler_clearance)/2,ls_h]); | 317 | square([shortwing+(idler_d+idler_clearance)/2,ls_h]); |
318 | // idler itself | 318 | // idler itself |
319 | place_idler() | 319 | place_idler() |
320 | cylinder(d=idler_d+idler_clearance,h=ls_h,$fn=fnd*(idler_d+idler_clearance)); | 320 | cylinder(d=idler_d+idler_clearance,h=ls_h,$fn=fnd*(idler_d+idler_clearance)); |
321 | // lever space | 321 | // lever space |
322 | rotate([0,0,45]) | 322 | rotate([0,0,45]) |
323 | rotate_extrude(angle=-135+max(atan(2*fsw/gearbox_d-1),atan(gearbox_d/mount_d-1))) | 323 | rotate_extrude(angle=-135+max(atan(2*fsw/gearbox_d-1),atan(gearbox_d/mount_d-1))) |
324 | square([gearbox_d/2+1,ls_h]); | 324 | square([gearbox_d/2+1,ls_h]); |
325 | } | 325 | } |
326 | 326 | ||
327 | // back side cutout | 327 | // back side cutout |
328 | // XXX: this is somewhat ugly and potentially bugged, | 328 | // XXX: this is somewhat ugly and potentially bugged, |
329 | // but I want to sleep. | 329 | // but I want to sleep. |
330 | a0_ = atan( | 330 | a0_ = atan( |
331 | (pf_offset+pf_h(pf)+gearbox_d/2) | 331 | (pf_offset+pf_h(pf)+gearbox_d/2) |
332 | / | 332 | / |
333 | ( | 333 | ( |
334 | pulley_d/2+filament_offset- | 334 | pulley_d/2+filament_offset- |
335 | (pf_d(pf)+2*pf_shell)/2/cos(30) | 335 | (pf_d(pf)+2*pf_shell)/2/cos(30) |
336 | ) | 336 | ) |
337 | ); | 337 | ); |
338 | a0 = -135 + ( (a0_>0) ? a0_ : 180+a0_ ); | 338 | a0 = -135 + ( (a0_>0) ? a0_ : 180+a0_ ); |
339 | a1 = atan((longwing-lever_thickness/2)/(gearbox_d/2)); | 339 | a1 = atan((longwing-lever_thickness/2)/(gearbox_d/2)); |
340 | translate([0,0,ls_z]) difference() { | 340 | translate([0,0,ls_z]) difference() { |
341 | rotate([0,0,-180+a0]) | 341 | rotate([0,0,-180+a0]) |
342 | rotate_extrude(angle=a1-a0) | 342 | rotate_extrude(angle=a1-a0) |
343 | translate([0,-ls_h/2]) | 343 | translate([0,-ls_h/2]) |
344 | square([sqrt(pow(gearbox_d/2,2)+pow(longwing-lever_thickness/2,2))+1, | 344 | square([sqrt(pow(gearbox_d/2,2)+pow(longwing-lever_thickness/2,2))+1, |
345 | ls_h]); | 345 | ls_h]); |
346 | translate([-mount_d/2,0,0]) | 346 | translate([-mount_d/2,0,0]) |
347 | cylinder(d=gearbox_d-mount_d,h=ls_h+2,center=true,$fn=fnd*(gearbox_d-mount_d)); | 347 | cylinder(d=gearbox_d-mount_d,h=ls_h+2,center=true,$fn=fnd*(gearbox_d-mount_d)); |
348 | }//difference translate | 348 | }//difference translate |
349 | 349 | ||
350 | // spring tensioner | 350 | // spring tensioner |
351 | translate([-gearbox_d/2,-longwing,ls_z]) rotate([0,-90,0]) { | 351 | translate([-gearbox_d/2,-longwing,ls_z]) rotate([0,-90,0]) { |
352 | mirror([0,0,1]) { | 352 | mirror([0,0,1]) { |
353 | translate([0,0,st_thickshell]) | 353 | translate([0,0,st_thickshell]) |
354 | hull() for(o=[0,spring_d]) translate([0,-o,0]) | 354 | hull() for(o=[0,spring_d]) translate([0,-o,0]) |
355 | rotate([0,0,30]) | 355 | rotate([0,0,30]) |
356 | cylinder(d=st_nut_d+st_nut_d_tolerance,h=st_nut_h+st_nut_h_tolerance,$fn=6); | 356 | cylinder(d=st_nut_d+st_nut_d_tolerance,h=st_nut_h+st_nut_h_tolerance,$fn=6); |
357 | 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)); | 357 | 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)); |
358 | bigd = spring_d+spring_d_clearance; | 358 | bigd = spring_d+spring_d_clearance; |
359 | hf = (bigd-st_screw_d-st_screw_d_tolerance)/2; | 359 | hf = (bigd-st_screw_d-st_screw_d_tolerance)/2; |
360 | translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell-epsilon]) { | 360 | translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell-epsilon]) { |
361 | cylinder(d1=st_screw_d+st_screw_d_tolerance,d2=bigd, | 361 | cylinder(d1=st_screw_d+st_screw_d_tolerance,d2=bigd, |
362 | h=hf+epsilon, $fn=fnd*bigd); | 362 | h=hf+epsilon, $fn=fnd*bigd); |
363 | translate([0,-(st_split_w+st_split_w_tolerance)/2,0]) hull() { | 363 | translate([0,-(st_split_w+st_split_w_tolerance)/2,0]) hull() { |
364 | cube(size=[body_h-ls_z-sp_ch-st_split_w_tolerance,st_split_w+st_split_w_tolerance,fsw+1]); | 364 | cube(size=[body_h-ls_z-sp_ch-st_split_w_tolerance,st_split_w+st_split_w_tolerance,fsw+1]); |
365 | translate([0,0,sp_ch+st_split_w_tolerance+1]) | 365 | translate([0,0,sp_ch+st_split_w_tolerance+1]) |
366 | cube(size=[body_h-ls_z+1,st_split_w+st_split_w_tolerance,fsw+1]); | 366 | cube(size=[body_h-ls_z+1,st_split_w+st_split_w_tolerance,fsw+1]); |
367 | } | 367 | } |
368 | }//translate | 368 | }//translate |
369 | translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell+hf-epsilon]) | 369 | translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell+hf-epsilon]) |
370 | cylinder(d=bigd,h=fsw+1,$fn=fnd*bigd); | 370 | cylinder(d=bigd,h=fsw+1,$fn=fnd*bigd); |
371 | }//mirror | 371 | }//mirror |
372 | }//translate | 372 | }//translate |
373 | 373 | ||
374 | // label | 374 | // label |
375 | body_label(); | 375 | body_label(); |
376 | 376 | ||
377 | }//difference | 377 | }//difference |
378 | 378 | ||
379 | }//body module | 379 | }//body module |
380 | module body_label() { | 380 | module body_label() { |
381 | if(body_label) { | 381 | if(body_label) { |
382 | label=body_label; | 382 | label=body_label; |
383 | label_thickness=body_label_thickness; | 383 | label_thickness=body_label_thickness; |
384 | label_len = len(label); | 384 | label_len = len(label); |
385 | labelspace = [gearbox_d/2-mount_screwhead_d/2-min_xy_shell,longwing-(mount_screwhead_d-st_split_w-st_split_w_tolerance)/2-2*min_xy_shell]; | 385 | labelspace = [gearbox_d/2-mount_screwhead_d/2-min_xy_shell,longwing-(mount_screwhead_d-st_split_w-st_split_w_tolerance)/2-2*min_xy_shell]; |
386 | translate([0,0,body_h-label_thickness]) | 386 | translate([0,0,body_h-label_thickness]) |
387 | linear_extrude(height=label_thickness+epsilon,convexity=64) | 387 | linear_extrude(height=label_thickness+epsilon,convexity=64) |
388 | translate([-mount_screwhead_d/2-min_xy_shell-labelspace.x/2,-longwing+(st_split_w+st_split_w_tolerance)/2+min_xy_shell+labelspace.y/2]) | 388 | translate([-mount_screwhead_d/2-min_xy_shell-labelspace.x/2,-longwing+(st_split_w+st_split_w_tolerance)/2+min_xy_shell+labelspace.y/2]) |
389 | mirror([left?0:1,0]) | 389 | mirror([left?0:1,0]) |
390 | text(text=label,size=labelspace.x/label_len,halign="center",valign="center",font="Arial Black"); | 390 | text(text=label,size=labelspace.x/label_len,halign="center",valign="center",font="Arial Black"); |
391 | }else sphere(d=epsilon); // to avoid makefile breakage | 391 | }else sphere(d=epsilon); // to avoid makefile breakage |
392 | } | 392 | } |
393 | 393 | ||
394 | module springpad() { | 394 | module springpad() { |
395 | smalld=st_screw_d+st_screw_d_tolerance+min_xy_shell; | 395 | smalld=st_screw_d+st_screw_d_tolerance+min_xy_shell; |
396 | bigd = spring_d+spring_d_clearance/2; | 396 | bigd = spring_d+spring_d_clearance/2; |
397 | hf = (bigd-smalld)/2; | 397 | hf = (bigd-smalld)/2; |
398 | h = max(hf*2,fsw-st_screw_l+hf); | 398 | h = max(hf*2,fsw-st_screw_l+hf); |
399 | translate([-gearbox_d/2+fsw-h,-longwing,filament_elevation]) | 399 | translate([-gearbox_d/2+fsw-h,-longwing,filament_elevation]) |
400 | rotate([0,90,0]) difference() { | 400 | rotate([0,90,0]) difference() { |
401 | union() { | 401 | union() { |
402 | cylinder(d1=smalld,d2=bigd,h=hf,$fn=fnd*bigd); | 402 | cylinder(d1=smalld,d2=bigd,h=hf,$fn=fnd*bigd); |
403 | translate([0,0,hf-epsilon]) | 403 | translate([0,0,hf-epsilon]) |
404 | cylinder(d=bigd,h=h-hf,$fn=fnd*bigd); | 404 | cylinder(d=bigd,h=h-hf,$fn=fnd*bigd); |
405 | translate([0,0,h]) | 405 | translate([0,0,h]) |
406 | sphere(d=spring_d*3/4,$fn=fnd*spring_d*3/4); | 406 | sphere(d=spring_d*3/4,$fn=fnd*spring_d*3/4); |
407 | l = body_h-ls_z; | 407 | l = body_h-ls_z; |
408 | w = sp_ch; | 408 | w = sp_ch; |
409 | hull() translate([0,-st_split_w/2,0]) mirror([1,0,0]) { | 409 | hull() translate([0,-st_split_w/2,0]) mirror([1,0,0]) { |
410 | translate([0,0,w]) | 410 | translate([0,0,w]) |
411 | cube(size=[l,st_split_w,w]); | 411 | cube(size=[l,st_split_w,w]); |
412 | cube(size=[l-w,st_split_w,2*w]); | 412 | cube(size=[l-w,st_split_w,2*w]); |
413 | } | 413 | } |
414 | } | 414 | } |
415 | translate([0,0,-epsilon]) | 415 | translate([0,0,-epsilon]) |
416 | cylinder(d=st_screw_d+st_screw_d_tolerance, | 416 | cylinder(d=st_screw_d+st_screw_d_tolerance, |
417 | h=min(st_screw_l,fsw-hf)-fsw+h+2*epsilon,$fn=fnd*(st_screw_d+st_screw_d_tolerance)); | 417 | h=min(st_screw_l,fsw-hf)-fsw+h+2*epsilon,$fn=fnd*(st_screw_d+st_screw_d_tolerance)); |
418 | } | 418 | } |
419 | } | 419 | } |
420 | 420 | ||
421 | module knob() { | 421 | module knob() { |
422 | ch = knob_indent_d/2; | 422 | ch = knob_indent_d/2; |
423 | knob_bore_l = body_h-protrusion_h-pulley_elevation-pulley_h-knob_v_clearance; | 423 | knob_bore_l = body_h-protrusion_h-pulley_elevation-pulley_h-knob_v_clearance; |
424 | translate([0,0,body_h+epsilon]) { | 424 | translate([0,0,body_h+epsilon]) { |
425 | mirror([0,0,1]) translate([0,0,-epsilon]) { | 425 | mirror([0,0,1]) translate([0,0,-epsilon]) { |
426 | difference() { | 426 | difference() { |
427 | cylinder(d=pulley_d,h=knob_bore_l,$fn=fnd*pulley_d); | 427 | cylinder(d=pulley_d,h=knob_bore_l,$fn=fnd*pulley_d); |
428 | translate([0,0,-1]) difference() { | 428 | translate([0,0,-1]) difference() { |
429 | cylinder(d=bore_d+knob_bore_d_tolerance,h=knob_bore_l+2); | 429 | cylinder(d=bore_d+knob_bore_d_tolerance,h=knob_bore_l+2); |
430 | translate([-bore_d/2-1,bore_dd-bore_d/2+knob_bore_d_tolerance/2,-1]) | 430 | translate([-bore_d/2-1,bore_dd-bore_d/2+knob_bore_d_tolerance/2,-1]) |
431 | cube([bore_d+2,bore_d/2,knob_bore_l+4]); | 431 | cube([bore_d+2,bore_d/2,knob_bore_l+4]); |
432 | } | 432 | } |
433 | } | 433 | } |
434 | } | 434 | } |
435 | difference() { | 435 | difference() { |
436 | hull() { | 436 | hull() { |
437 | cylinder(d=gearbox_d-2*ch,h=knob_h,$fn=fnd*gearbox_d); | 437 | cylinder(d=gearbox_d-2*ch,h=knob_h,$fn=fnd*gearbox_d); |
438 | translate([0,0,ch]) | 438 | translate([0,0,ch]) |
439 | cylinder(d=gearbox_d,h=knob_h-2*ch,$fn=fnd*gearbox_d); | 439 | cylinder(d=gearbox_d,h=knob_h-2*ch,$fn=fnd*gearbox_d); |
440 | } | 440 | } |
441 | for(a=[0:360/knob_indents:359]) rotate([0,0,a]) | 441 | for(a=[0:360/knob_indents:359]) rotate([0,0,a]) |
442 | translate([0,gearbox_d/2,-1]) | 442 | translate([0,gearbox_d/2,-1]) |
443 | cylinder(d=knob_indent_d,h=knob_h+2,$fn=fnd*knob_indent_d); | 443 | cylinder(d=knob_indent_d,h=knob_h+2,$fn=fnd*knob_indent_d); |
444 | translate([0,0,-body_h-epsilon]) knob_label(); | 444 | translate([0,0,-body_h-epsilon]) knob_label(); |
445 | } | 445 | } |
446 | } | 446 | } |
447 | }//knob module | 447 | }//knob module |
448 | module knob_label() { | 448 | module knob_label() { |
449 | if(knob_label) { | 449 | if(knob_label) { |
450 | ll = len(knob_label); | 450 | ll = len(knob_label); |
451 | lsl = gearbox_d-knob_indent_d; | 451 | lsl = gearbox_d-knob_indent_d; |
452 | ts = knob_label_size?knob_label_size:min(lsl/ll,gearbox_d/4); | 452 | ts = knob_label_size?knob_label_size:min(lsl/ll,gearbox_d/4); |
453 | translate([0,0,body_h+epsilon+knob_h-knob_label_thickness]) | 453 | translate([0,0,body_h+epsilon+knob_h-knob_label_thickness]) |
454 | linear_extrude(height=knob_label_thickness+epsilon,convexity=64) | 454 | linear_extrude(height=knob_label_thickness+epsilon,convexity=64) |
455 | mirror([left?0:1,0]) | 455 | mirror([left?0:1,0]) |
456 | text(text=knob_label,size=ts,halign="center",valign="center",font="Arial Black"); | 456 | text(text=knob_label,size=ts,halign="center",valign="center",font="Arial Black"); |
457 | }else sphere(d=epsilon); // to avoid makefile breakage | 457 | }else sphere(d=epsilon); // to avoid makefile breakage |
458 | } | 458 | } |
459 | 459 | ||
460 | module debug() { | 460 | module debug() { |
461 | difference() { | 461 | difference() { |
462 | children(); | 462 | children(); |
463 | if(debug) { | 463 | if(debug) { |
464 | // spring tensioner debug cutout | 464 | // spring tensioner debug cutout |
465 | translate([-gearbox_d/2,-longwing,ls_z]) rotate([0,-90,0]) | 465 | translate([-gearbox_d/2,-longwing,ls_z]) rotate([0,-90,0]) |
466 | translate([0,-lever_thickness/2-1,-gearbox_d-1]) | 466 | translate([0,-lever_thickness/2-1,-gearbox_d-1]) |
467 | cube(size=[body_h/2+1,lever_thickness/2+1,gearbox_d+2]); | 467 | cube(size=[body_h/2+1,lever_thickness/2+1,gearbox_d+2]); |
468 | // lever axis debug cutout | 468 | // lever axis debug cutout |
469 | translate([mount_d/2,0,-1]) | 469 | translate([mount_d/2,0,-1]) |
470 | rotate([0,0,-45]) | 470 | rotate([0,0,-45]) |
471 | cube(size=[gearbox_d-mount_d,gearbox_d-mount_d,body_h+knob_h+2]); | 471 | cube(size=[gearbox_d-mount_d,gearbox_d-mount_d,body_h+knob_h+2]); |
472 | // idler debug cutout | 472 | // idler debug cutout |
473 | translate([0,0,ls_z]) | 473 | translate([0,0,ls_z]) |
474 | place_idler() | 474 | place_idler() |
475 | rotate([0,0,-45]) | 475 | rotate([0,0,-45]) |
476 | translate([0,0,-lever_thickness/2-epsilon]) | 476 | translate([0,0,-lever_thickness/2-epsilon]) |
477 | cube(size=[lsd*sqrt(2)/2+1,lsd*sqrt(2)/2+1, | 477 | cube(size=[lsd*sqrt(2)/2+1,lsd*sqrt(2)/2+1, |
478 | lever_thickness+2*epsilon]); | 478 | lever_thickness+2*epsilon]); |
479 | // pushfit debug cutout | 479 | // pushfit debug cutout |
480 | place_idler() | 480 | place_idler() |
481 | translate([-idler_d/2+filament_offset,0,ls_z]) | 481 | translate([-idler_d/2+filament_offset,0,ls_z]) |
482 | cube(size=[gearbox_d/2,gearbox_d/2+pf_h(pf),body_h-ls_z+knob_h+1]); | 482 | cube(size=[gearbox_d/2,gearbox_d/2+pf_h(pf),body_h-ls_z+knob_h+1]); |
483 | }//if debug | 483 | }//if debug |
484 | }//difference | 484 | }//difference |
485 | } | 485 | } |
486 | 486 | ||
487 | mirrorleft() | 487 | mirrorleft() |
488 | debug() | 488 | debug() |
489 | if(what=="lever") color("green",0.7) lever(); | 489 | if(what=="lever") color("green",0.7) lever(); |
490 | else if(what=="body") color("yellow",0.7) body(); | 490 | else if(what=="body") color("yellow",0.7) body(); |
491 | else if(what=="body.label") color("brown",0.7) body_label(); | 491 | else if(what=="body.label") color("brown",0.7) body_label(); |
492 | else if(what=="knob") color("red",0.7) knob(); | 492 | else if(what=="knob") color("red",0.7) knob(); |
493 | else if(what=="knob.label") color("brown",0.7) knob_label(); | 493 | else if(what=="knob.label") color("brown",0.7) knob_label(); |
494 | else if(what=="springpad") color("blue",0.7) springpad(); | 494 | else if(what=="springpad") color("blue",0.7) springpad(); |
495 | else if(what=="both") { | 495 | else if(what=="both") { |
496 | color("green",0.7) lever(); | 496 | color("green",0.7) lever(); |
497 | color("yellow",0.7) body(); | 497 | color("yellow",0.7) body(); |
498 | color("brown",0.7) body_label(); | 498 | color("brown",0.7) body_label(); |
499 | }else{ | 499 | }else{ |
500 | color("green",0.7) lever(); | 500 | color("green",0.7) lever(); |
501 | color("yellow",0.7) body(); | 501 | color("yellow",0.7) body(); |
502 | color("brown",0.7) body_label(); | 502 | color("brown",0.7) body_label(); |
503 | color("red",0.7) knob(); | 503 | color("red",0.7) knob(); |
504 | color("brown",0.7) knob_label(); | 504 | color("brown",0.7) knob_label(); |
505 | color("blue",0.7) springpad(); | 505 | color("blue",0.7) springpad(); |
506 | } | 506 | } |
507 | } | 507 | } |
508 | 508 | ||
509 | the_extruder(what="*",left=false,debug=true); | 509 | the_extruder(what="*",left=false,debug=true); |