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