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