-rw-r--r-- | another.scad | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/another.scad b/another.scad index 85715db..2be24e4 100644 --- a/another.scad +++ b/another.scad | |||
@@ -1,337 +1,337 @@ | |||
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 | protrusion_d = 22, protrusion_h = 2.2, // the dimensions of the protrusion on top of gearbox | 14 | protrusion_d = 22, protrusion_h = 2.2, // the dimensions of the protrusion on top of gearbox |
15 | bore_d = 8, bore_l = 17.6, | 15 | bore_d = 8, bore_l = 17.6, |
16 | bore_dd = 7, | 16 | bore_dd = 7, |
17 | // pulley properties | 17 | // pulley properties |
18 | pulley_d = 11.5, pulley_h=10, | 18 | pulley_d = 11.5, pulley_h=10, |
19 | pulley_elevation = 1, // pulley elevation above the protrusion | 19 | pulley_elevation = 1, // pulley elevation above the protrusion |
20 | teeth_elevation = 7.5, // distance from the bottom of the pulley to its teeth | 20 | teeth_elevation = 7.5, // distance from the bottom of the pulley to its teeth |
21 | // idler properties | 21 | // idler properties |
22 | idler_d = 9.5, idler_h = 4, idler_id = 3,// idler dimensions: outer and inner diameters and height | 22 | idler_d = 9.5, idler_h = 4, idler_id = 3,// idler dimensions: outer and inner diameters and height |
23 | // spring properties | 23 | // spring properties |
24 | spring_d = 10, spring_lc = 9.6, // spring diameter and compressed length | 24 | spring_d = 10, spring_lc = 9.6, // spring diameter and compressed length |
25 | // filament path properties | 25 | // filament path properties |
26 | filament_d = 1.75, | 26 | filament_d = 1.75, |
27 | filament_path_d = 2, | 27 | filament_path_d = 2, |
28 | filament_guide_d = 4, // PTFE filament guide diameter | 28 | filament_guide_d = 4, // PTFE filament guide diameter |
29 | // knob properties | 29 | // knob properties |
30 | knob_h = 10, | 30 | knob_h = 10, |
31 | knob_bore_l = 4, | 31 | knob_bore_l = 4, |
32 | knob_indent_d = 4, | 32 | knob_indent_d = 4, |
33 | knob_indents = 12, | 33 | knob_indents = 12, |
34 | 34 | ||
35 | // screw it | 35 | // screw it |
36 | mount_screw_d = 3.1, mount_screw_l = 20, | 36 | mount_screw_d = 3.1, mount_screw_l = 20, |
37 | mount_screwhead_d=6, mount_screwhead_h=3, | 37 | mount_screwhead_d=6, mount_screwhead_h=3, |
38 | 38 | ||
39 | pf = pushfit_embeddest, | 39 | pf = pushfit_embeddest, |
40 | 40 | ||
41 | // empty spaces | 41 | // empty spaces |
42 | idler_travel = 3, // how far should idler travel when pressed | 42 | idler_travel = 3, // how far should idler travel when pressed |
43 | idler_clearance=1, | 43 | idler_clearance=1, |
44 | pulley_clearance=2, | 44 | pulley_clearance=2, |
45 | lever_v_clearance=.7, // vertical clearance for the lever | 45 | lever_v_clearance=.7, // vertical clearance for the lever |
46 | spring_d_clearance=1, | 46 | spring_d_clearance=1, |
47 | protrusion_tolerance_h=.5, // horizontal tolerance for the motor protrusion | 47 | protrusion_tolerance_h=.5, // horizontal tolerance for the motor protrusion |
48 | protrusion_tolerance_v=.5, // vertical tolerance for the motor protrusion | 48 | protrusion_tolerance_v=.5, // vertical tolerance for the motor protrusion |
49 | mount_screw_d_tolerance=.4, | 49 | mount_screw_d_tolerance=.4, |
50 | idler_v_tolerance=.5, | 50 | idler_v_tolerance=.5, |
51 | knob_bore_d_tolerance=.6, | 51 | knob_bore_d_tolerance=.6, |
52 | 52 | ||
53 | what="lever", | 53 | what="lever", |
54 | left=false, | 54 | left=false, |
55 | vitamins = true | 55 | vitamins = true, |
56 | supports = false | ||
56 | ) { | 57 | ) { |
57 | lever_shell = mount_screwhead_h+0.5; | 58 | lever_shell = mount_screwhead_h+0.5; |
58 | lever_thickness=max(spring_d+layer_height*8,idler_h+idler_v_tolerance+2*lever_shell); | 59 | lever_thickness=max(spring_d+layer_height*8,idler_h+idler_v_tolerance+2*lever_shell); |
59 | lsd = idler_d-idler_clearance*2; | 60 | lsd = idler_d-idler_clearance*2; |
60 | longwing=gearbox_d/2+spring_d/2+lsd/2; | 61 | longwing=gearbox_d/2+spring_d/2+lsd/2; |
61 | h_ = (pulley_d+idler_d)/(2*sqrt(2)); | 62 | h_ = (pulley_d+idler_d)/(2*sqrt(2)); |
62 | ri = sqrt( pow(h_,2) + pow(mount_d/2-h_,2) ); | 63 | ri = sqrt( pow(h_,2) + pow(mount_d/2-h_,2) ); |
63 | spring_dl = idler_travel*longwing/ri; | 64 | spring_dl = idler_travel*longwing/ri; |
64 | 65 | ||
65 | filament_elevation=protrusion_h+pulley_elevation+teeth_elevation; | 66 | filament_elevation=protrusion_h+pulley_elevation+teeth_elevation; |
66 | ls_z = filament_elevation; // leverspace mid-z | 67 | ls_z = filament_elevation; // leverspace mid-z |
67 | body_h = max(protrusion_h+bore_l,mount_screw_l-mounthole_depth/2+mount_screwhead_h,ls_z*2); | 68 | body_h = max(protrusion_h+bore_l,mount_screw_l-mounthole_depth/2+mount_screwhead_h,ls_z*2); |
68 | ls_h = lever_thickness+lever_v_clearance; // leverspace height | 69 | ls_h = lever_thickness+lever_v_clearance; // leverspace height |
69 | 70 | ||
70 | module mirrorleft() { | 71 | module mirrorleft() { |
71 | mirror([left?0:1,0,0]) children(); | 72 | mirror([left?0:1,0,0]) children(); |
72 | } | 73 | } |
73 | module place_idler() { | 74 | module place_idler() { |
74 | rotate([0,0,45]) | 75 | rotate([0,0,45]) |
75 | translate([(pulley_d+idler_d)/2,0,0]) | 76 | translate([(pulley_d+idler_d)/2,0,0]) |
76 | children(); | 77 | children(); |
77 | } | 78 | } |
78 | module finger_indent(d=lever_thickness,depth/*=1*/,r/*=15*/) { | 79 | module finger_indent(d=lever_thickness,depth/*=1*/,r/*=15*/) { |
79 | if(depth) { | 80 | if(depth) { |
80 | hh = (-4*pow(depth,2)+pow(d,2))/(8*depth); | 81 | hh = (-4*pow(depth,2)+pow(d,2))/(8*depth); |
81 | rr = depth+hh; | 82 | rr = depth+hh; |
82 | translate([0,0,hh]) sphere(r=rr,$fn=2*PI*rr); | 83 | translate([0,0,hh]) sphere(r=rr,$fn=2*PI*rr); |
83 | }else if(r) { | 84 | }else if(r) { |
84 | hh=sqrt(pow(r,2)-pow(d,2)/4); | 85 | hh=sqrt(pow(r,2)-pow(d,2)/4); |
85 | translate([0,0,hh]) sphere(r=r,$fn=2*PI*r); | 86 | translate([0,0,hh]) sphere(r=r,$fn=2*PI*r); |
86 | } | 87 | } |
87 | } | 88 | } |
88 | 89 | ||
89 | % if(vitamins) mirrorleft() { | 90 | % if(vitamins) mirrorleft() { |
90 | translate([0,0,-epsilon]) mirror([0,0,1]) cylinder(d=gearbox_d,h=1,$fn=60); | 91 | translate([0,0,-epsilon]) mirror([0,0,1]) cylinder(d=gearbox_d,h=1,$fn=60); |
91 | for(zr=[0:90:359]) rotate([0,0,zr]) translate([mount_d/2,0,0]) | 92 | for(zr=[0:90:359]) rotate([0,0,zr]) translate([mount_d/2,0,0]) |
92 | cylinder(d=mount_screw_d,h=20,$fn=30); | 93 | cylinder(d=mount_screw_d,h=20,$fn=30); |
93 | translate([0,0,-epsilon]) cylinder(d=protrusion_d,h=protrusion_h,$fn=30); | 94 | translate([0,0,-epsilon]) cylinder(d=protrusion_d,h=protrusion_h,$fn=30); |
94 | translate([0,0,protrusion_h]) { | 95 | translate([0,0,protrusion_h]) { |
95 | difference() { | 96 | difference() { |
96 | cylinder(d=bore_d,h=bore_l,$fn=30); | 97 | cylinder(d=bore_d,h=bore_l,$fn=30); |
97 | translate([-bore_d/2-1,bore_dd-bore_d/2,-1]) | 98 | translate([-bore_d/2-1,bore_dd-bore_d/2,-1]) |
98 | cube([bore_d+2,bore_d/2,bore_l+2]); | 99 | cube([bore_d+2,bore_d/2,bore_l+2]); |
99 | } | 100 | } |
100 | translate([0,0,pulley_elevation]) { | 101 | translate([0,0,pulley_elevation]) { |
101 | cylinder(d=pulley_d,h=pulley_h,$fn=30); | 102 | cylinder(d=pulley_d,h=pulley_h,$fn=30); |
102 | translate([0,0,teeth_elevation]) { | 103 | translate([0,0,teeth_elevation]) { |
103 | place_idler() { | 104 | place_idler() { |
104 | cylinder(d=idler_d,h=idler_h,center=true,$fn=30); | 105 | cylinder(d=idler_d,h=idler_h,center=true,$fn=30); |
105 | cylinder(d=idler_id,h=lever_thickness+2,center=true,$fn=30); | 106 | cylinder(d=idler_id,h=lever_thickness+2,center=true,$fn=30); |
106 | }//place idler | 107 | }//place idler |
107 | // filament path | 108 | // filament path |
108 | rotate([0,0,45]) translate([(pulley_d-filament_path_d)/2,0,0]) { | 109 | rotate([0,0,45]) translate([(pulley_d-filament_path_d)/2,0,0]) { |
109 | rotate([90,0,0]) cylinder(d=filament_d,h=gearbox_d*2,center=true,$fn=15); | 110 | rotate([90,0,0]) cylinder(d=filament_d,h=gearbox_d*2,center=true,$fn=15); |
110 | rotate([-90,0,0]) | 111 | rotate([-90,0,0]) |
111 | translate([0,0,mount_d/sqrt(2)/2+mount_screw_d]) | 112 | translate([0,0,mount_d/sqrt(2)/2+mount_screw_d]) |
112 | pushfit(pf); | 113 | pushfit(pf); |
113 | } | 114 | } |
114 | }//translate teeth | 115 | }//translate teeth |
115 | }//translate pulley | 116 | }//translate pulley |
116 | }//translate protrusion | 117 | }//translate protrusion |
117 | }//vitamins | 118 | }//vitamins |
118 | 119 | ||
119 | module lever() { | 120 | module lever() { |
120 | translate([0,0,protrusion_h+pulley_elevation+teeth_elevation]) { | 121 | translate([0,0,protrusion_h+pulley_elevation+teeth_elevation]) { |
121 | difference() { | 122 | difference() { |
122 | union() { | 123 | union() { |
123 | hull() { | 124 | hull() { |
124 | place_idler() | 125 | place_idler() |
125 | cylinder(d=lsd,h=lever_thickness,center=true,$fn=60); | 126 | cylinder(d=lsd,h=lever_thickness,center=true,$fn=60); |
126 | translate([mount_d/2,0,0]) | 127 | translate([mount_d/2,0,0]) |
127 | cylinder(d=lsd,h=lever_thickness,center=true,$fn=60); | 128 | cylinder(d=lsd,h=lever_thickness,center=true,$fn=60); |
128 | }//hull | 129 | }//hull |
129 | hull() { | 130 | hull() { |
130 | translate([mount_d/2,0,0]) | 131 | translate([mount_d/2,0,0]) |
131 | cylinder(d=lsd,h=lever_thickness,center=true,$fn=60); | 132 | cylinder(d=lsd,h=lever_thickness,center=true,$fn=60); |
132 | translate([mount_d/2,-longwing,0]) rotate([0,90,0]) | 133 | translate([mount_d/2,-longwing,0]) rotate([0,90,0]) |
133 | cylinder(d=lever_thickness,h=lsd,center=true,$fn=60); | 134 | cylinder(d=lever_thickness,h=lsd,center=true,$fn=60); |
134 | }//hull | 135 | }//hull |
135 | }//union | 136 | }//union |
136 | 137 | ||
137 | // filament path | 138 | // filament path |
138 | place_idler() translate([-(idler_d+filament_path_d)/2,0,0]) rotate([90,0,0]) { | 139 | place_idler() translate([-(idler_d+filament_path_d)/2,0,0]) rotate([90,0,0]) { |
139 | cylinder(d=filament_path_d,h=3*gearbox_d,center=true,$fn=30); | 140 | cylinder(d=filament_path_d,h=3*gearbox_d,center=true,$fn=30); |
140 | translate([0,-filament_path_d/2/sqrt(2),0]) rotate([0,0,45]) | 141 | translate([0,-filament_path_d/2/sqrt(2),0]) rotate([0,0,45]) |
141 | cube(size=[filament_path_d/2,filament_path_d/2,3*gearbox_d],center=true); | 142 | cube(size=[filament_path_d/2,filament_path_d/2,3*gearbox_d],center=true); |
142 | } | 143 | } |
143 | 144 | ||
144 | // idler space and mounting hole | 145 | // idler space and mounting hole |
145 | place_idler() { | 146 | place_idler() { |
146 | difference() { | 147 | difference() { |
147 | cylinder(d=idler_d+idler_clearance*2,h=idler_h+idler_v_tolerance,center=true,$fn=60); | 148 | cylinder(d=idler_d+idler_clearance*2,h=idler_h+idler_v_tolerance,center=true,$fn=60); |
148 | // supports | 149 | if(supports) for(y=[-lsd/2+extrusion_width:(lsd-2*extrusion_width)/3:lsd/2-extrusion_width]) |
149 | for(y=[-lsd/2+extrusion_width:(lsd-2*extrusion_width)/3:lsd/2-extrusion_width]) | ||
150 | translate([-lsd/2-1,y-extrusion_width/2,-idler_h/2-idler_v_tolerance/2-1]) | 150 | translate([-lsd/2-1,y-extrusion_width/2,-idler_h/2-idler_v_tolerance/2-1]) |
151 | cube(size=[lsd+2,extrusion_width,idler_h+idler_v_tolerance+2]); | 151 | cube(size=[lsd+2,extrusion_width,idler_h+idler_v_tolerance+2]); |
152 | } | 152 | } |
153 | cylinder(d=mount_screw_d+mount_screw_d_tolerance,h=lever_thickness+2,center=true,$fn=30); | 153 | cylinder(d=mount_screw_d+mount_screw_d_tolerance,h=lever_thickness+2,center=true,$fn=30); |
154 | translate([0,0,lever_thickness/2-mount_screwhead_h]) | 154 | translate([0,0,lever_thickness/2-mount_screwhead_h]) |
155 | cylinder(d=mount_screwhead_d,h=mount_screwhead_h+1,$fn=2*PI*mount_screwhead_d); | 155 | cylinder(d=mount_screwhead_d,h=mount_screwhead_h+1,$fn=2*PI*mount_screwhead_d); |
156 | } | 156 | } |
157 | // mounting screw hole | 157 | // mounting screw hole |
158 | translate([mount_d/2,0,0]) | 158 | translate([mount_d/2,0,0]) |
159 | cylinder(d=mount_screw_d+mount_screw_d_tolerance,h=lever_thickness+2,center=true,$fn=2*PI*mount_screw_d); | 159 | cylinder(d=mount_screw_d+mount_screw_d_tolerance,h=lever_thickness+2,center=true,$fn=2*PI*mount_screw_d); |
160 | 160 | ||
161 | // lever end | 161 | // lever end |
162 | translate([mount_d/2,0,0]) rotate([0,90,0]) { | 162 | translate([mount_d/2,0,0]) rotate([0,90,0]) { |
163 | translate([0,-longwing,lsd/2]) finger_indent(d=lever_thickness-1,r=15); | 163 | translate([0,-longwing,lsd/2]) finger_indent(d=lever_thickness-1,r=15); |
164 | translate([0,-longwing,0]) | 164 | translate([0,-longwing,0]) |
165 | mirror([0,0,1]) | 165 | mirror([0,0,1]) |
166 | difference() { | 166 | difference() { |
167 | cylinder(d=spring_d+spring_d_clearance,h=lsd,$fn=2*PI*spring_d); | 167 | cylinder(d=spring_d+spring_d_clearance,h=lsd,$fn=2*PI*spring_d); |
168 | sphere(d=spring_d*3/4,$fn=PI*spring_d); | 168 | sphere(d=spring_d*3/4,$fn=PI*spring_d); |
169 | } | 169 | } |
170 | }//rotate-translate | 170 | }//rotate-translate |
171 | }//difference | 171 | }//difference |
172 | // bridging patch | 172 | // bridging patch |
173 | place_idler() | 173 | place_idler() |
174 | translate([0,0,lever_thickness/2-mount_screwhead_h]) | 174 | translate([0,0,lever_thickness/2-mount_screwhead_h]) |
175 | mirror([0,0,1]) | 175 | mirror([0,0,1]) |
176 | cylinder(d=mount_screwhead_d,h=layer_height); | 176 | cylinder(d=mount_screwhead_d,h=layer_height); |
177 | }//translate | 177 | }//translate |
178 | }//lever module | 178 | }//lever module |
179 | 179 | ||
180 | module body() { | 180 | module body() { |
181 | difference() { | 181 | difference() { |
182 | union() { | 182 | union() { |
183 | cylinder(d=gearbox_d,h=body_h,$fn=2*PI*gearbox_d); | 183 | cylinder(d=gearbox_d,h=body_h,$fn=2*PI*gearbox_d); |
184 | // finger and spring support | 184 | // finger and spring support |
185 | fsw = gearbox_d/2+mount_screwhead_d/2; | 185 | fsw = gearbox_d/2+mount_screwhead_d/2; |
186 | translate([-gearbox_d/2,0,0]) difference() { | 186 | translate([-gearbox_d/2,0,0]) difference() { |
187 | union() { | 187 | union() { |
188 | hull() { | 188 | hull() { |
189 | translate([0,-longwing,ls_z]) | 189 | translate([0,-longwing,ls_z]) |
190 | rotate([0,90,0]) | 190 | rotate([0,90,0]) |
191 | cylinder(d=max(lever_thickness,spring_d+spring_d_clearance+2*extrusion_width),h=fsw,$fn=2*PI*lever_thickness); | 191 | cylinder(d=max(lever_thickness,spring_d+spring_d_clearance+2*extrusion_width),h=fsw,$fn=2*PI*lever_thickness); |
192 | hh=body_h-ls_z; | 192 | hh=body_h-ls_z; |
193 | translate([0,0,ls_z-lever_thickness/2]) | 193 | translate([0,0,ls_z-lever_thickness/2]) |
194 | mirror([0,1,0]) cube(size=[fsw,longwing-hh+lever_thickness/sqrt(2),hh+lever_thickness/2]); | 194 | mirror([0,1,0]) cube(size=[fsw,longwing-hh+lever_thickness/sqrt(2),hh+lever_thickness/2]); |
195 | hhh=ls_z; | 195 | hhh=ls_z; |
196 | translate([0,0,0]) | 196 | translate([0,0,0]) |
197 | mirror([0,1,0]) cube(size=[fsw,longwing-hhh+lever_thickness/sqrt(2),hhh+lever_thickness/2]); | 197 | mirror([0,1,0]) cube(size=[fsw,longwing-hhh+lever_thickness/sqrt(2),hhh+lever_thickness/2]); |
198 | } | 198 | } |
199 | } | 199 | } |
200 | translate([0,-longwing,ls_z]) rotate([0,-90,0]) | 200 | translate([0,-longwing,ls_z]) rotate([0,-90,0]) |
201 | finger_indent(d=lever_thickness-1,r=15); | 201 | finger_indent(d=lever_thickness-1,r=15); |
202 | } // translate | 202 | } // translate |
203 | 203 | ||
204 | // pushfit bracket | 204 | // pushfit bracket |
205 | translate([0,0,filament_elevation]) | 205 | translate([0,0,filament_elevation]) |
206 | rotate([0,0,45]) translate([pulley_d/2,0,0]) | 206 | rotate([0,0,45]) translate([pulley_d/2,0,0]) |
207 | rotate([-90,0,0]) | 207 | rotate([-90,0,0]) |
208 | translate([0,0,mount_d/sqrt(2)/2+mount_screw_d-gearbox_d/2/*TODO:*/]) | 208 | translate([0,0,mount_d/sqrt(2)/2+mount_screw_d-gearbox_d/2/*TODO:*/]) |
209 | cylinder(r=min(body_h-filament_elevation,filament_elevation)/sin(60)-epsilon,h=pf_h(pf)+gearbox_d/2/*TODO:*/,$fn=6); | 209 | cylinder(r=min(body_h-filament_elevation,filament_elevation)/sin(60)-epsilon,h=pf_h(pf)+gearbox_d/2/*TODO:*/,$fn=6); |
210 | }//union (first child of difference) | 210 | }//union (first child of difference) |
211 | // protrusion | 211 | // protrusion |
212 | translate([0,0,-1]) | 212 | translate([0,0,-1]) |
213 | cylinder(d=protrusion_d+protrusion_tolerance_h,h=protrusion_h+protrusion_tolerance_v+1,$fn=2*PI*protrusion_d); | 213 | cylinder(d=protrusion_d+protrusion_tolerance_h,h=protrusion_h+protrusion_tolerance_v+1,$fn=2*PI*protrusion_d); |
214 | // mount screw holes | 214 | // mount screw holes |
215 | for(zr=[0:90:359]) rotate([0,0,zr]) translate([mount_d/2,0,0]) { | 215 | for(zr=[0:90:359]) rotate([0,0,zr]) translate([mount_d/2,0,0]) { |
216 | translate([0,0,mount_screw_l-mounthole_depth/2-layer_height-1]) | 216 | translate([0,0,mount_screw_l-mounthole_depth/2-layer_height-1]) |
217 | mirror([0,0,1]) | 217 | mirror([0,0,1]) |
218 | cylinder(d=mount_screw_d+mount_screw_d_tolerance, | 218 | cylinder(d=mount_screw_d+mount_screw_d_tolerance, |
219 | h=mount_screw_l-mounthole_depth/2-layer_height+1, | 219 | h=mount_screw_l-mounthole_depth/2-layer_height+1, |
220 | $fn=2*PI*mount_screw_d); | 220 | $fn=2*PI*mount_screw_d); |
221 | translate([0,0,mount_screw_l-mounthole_depth/2]) | 221 | translate([0,0,mount_screw_l-mounthole_depth/2]) |
222 | cylinder(d=mount_screwhead_d,h=body_h+1,$fn=2*PI*mount_screwhead_d); | 222 | cylinder(d=mount_screwhead_d,h=body_h+1,$fn=2*PI*mount_screwhead_d); |
223 | }//for | 223 | }//for |
224 | // pushfit | 224 | // pushfit |
225 | translate([0,0,filament_elevation]) | 225 | translate([0,0,filament_elevation]) |
226 | rotate([0,0,45]) translate([pulley_d/2,0,0]) | 226 | rotate([0,0,45]) translate([pulley_d/2,0,0]) |
227 | rotate([-90,0,0]) | 227 | rotate([-90,0,0]) |
228 | translate([0,0,mount_d/sqrt(2)/2+mount_screw_d+epsilon]) | 228 | translate([0,0,mount_d/sqrt(2)/2+mount_screw_d+epsilon]) |
229 | rotate([0,0,180]) { | 229 | rotate([0,0,180]) { |
230 | pushfit(pf); | 230 | pushfit(pf); |
231 | cylinder(d=filament_guide_d,h=gearbox_d,center=true,$fn=2*PI*filament_guide_d); | 231 | cylinder(d=filament_guide_d,h=gearbox_d,center=true,$fn=2*PI*filament_guide_d); |
232 | translate([0,-filament_guide_d/2/sqrt(2),0]) | 232 | translate([0,-filament_guide_d/2/sqrt(2),0]) |
233 | rotate([0,0,45]) | 233 | rotate([0,0,45]) |
234 | cube(size=[filament_guide_d/2,filament_guide_d/2,gearbox_d],center=true); | 234 | cube(size=[filament_guide_d/2,filament_guide_d/2,gearbox_d],center=true); |
235 | } | 235 | } |
236 | // pulley | 236 | // pulley |
237 | cylinder(d=pulley_d+pulley_clearance,h=body_h+1,$fn=2*PI*(pulley_d+pulley_clearance)); | 237 | cylinder(d=pulley_d+pulley_clearance,h=body_h+1,$fn=2*PI*(pulley_d+pulley_clearance)); |
238 | // leverspace | 238 | // leverspace |
239 | hull() for(x=[0,gearbox_d]) | 239 | hull() for(x=[0,gearbox_d]) |
240 | rotate([0,0,45]) | 240 | rotate([0,0,45]) |
241 | translate([x,0,ls_z-ls_h/2]) | 241 | translate([x,0,ls_z-ls_h/2]) |
242 | cylinder(d=idler_d+idler_clearance,h=ls_h,$fn=2*PI*idler_d); | 242 | cylinder(d=idler_d+idler_clearance,h=ls_h,$fn=2*PI*idler_d); |
243 | 243 | ||
244 | a=cos(45)*(pulley_d+idler_d)/2; | 244 | a=cos(45)*(pulley_d+idler_d)/2; |
245 | b=mount_d/2-a; | 245 | b=mount_d/2-a; |
246 | x=sqrt(pow(a,2)+pow(b,2)); | 246 | x=sqrt(pow(a,2)+pow(b,2)); |
247 | translate([mount_d/2,0,ls_z]) | 247 | translate([mount_d/2,0,ls_z]) |
248 | intersection() { | 248 | intersection() { |
249 | r = x+idler_d/2+1;/* TODO: */ | 249 | r = x+idler_d/2+1;/* TODO: */ |
250 | cylinder(r=r,h=ls_h,center=true); | 250 | cylinder(r=r,h=ls_h,center=true); |
251 | translate([-r-1,0,-1]) cube(size=[2*r+2,r+1,ls_h+2]); | 251 | translate([-r-1,0,-1]) cube(size=[2*r+2,r+1,ls_h+2]); |
252 | } | 252 | } |
253 | 253 | ||
254 | rotate([0,0,-45]) | 254 | rotate([0,0,-45]) |
255 | translate([0,0,ls_z-ls_h/2]) | 255 | translate([0,0,ls_z-ls_h/2]) |
256 | cube(size=[gearbox_d,gearbox_d,lever_thickness+lever_v_clearance]); | 256 | cube(size=[gearbox_d,gearbox_d,lever_thickness+lever_v_clearance]); |
257 | translate([0,0,ls_z-ls_h/2]) { | 257 | translate([0,0,ls_z-ls_h/2]) { |
258 | translate([mount_screwhead_d/2,0,0]) | 258 | translate([mount_screwhead_d/2,0,0]) |
259 | mirror([0,1,0]) | 259 | mirror([0,1,0]) |
260 | cube(size=[gearbox_d,gearbox_d/2+1,lever_thickness+lever_v_clearance]); | 260 | cube(size=[gearbox_d,gearbox_d/2+1,lever_thickness+lever_v_clearance]); |
261 | } | 261 | } |
262 | //translate([-mount_d/2,-longwing,filament_elevation]) | 262 | //translate([-mount_d/2,-longwing,filament_elevation]) |
263 | translate([mount_d/2,-longwing,filament_elevation]) | 263 | translate([mount_d/2,-longwing,filament_elevation]) |
264 | rotate([0,-90,0]) difference() { | 264 | rotate([0,-90,0]) difference() { |
265 | cylinder(d=spring_d+spring_d_clearance,h=spring_lc+spring_dl,$fn=PI*spring_d); | 265 | cylinder(d=spring_d+spring_d_clearance,h=spring_lc+spring_dl,$fn=PI*spring_d); |
266 | translate([0,0,spring_lc+spring_dl]) sphere(d=spring_d*3/4,$fn=PI*spring_d); | 266 | translate([0,0,spring_lc+spring_dl]) sphere(d=spring_d*3/4,$fn=PI*spring_d); |
267 | } | 267 | } |
268 | //sphere(d=spring_d*3/4,$fn=PI*spring_d); | 268 | //sphere(d=spring_d*3/4,$fn=PI*spring_d); |
269 | *difference() { | 269 | *difference() { |
270 | // spring support | 270 | // spring support |
271 | translate([0,-longwing,filament_elevation]) | 271 | translate([0,-longwing,filament_elevation]) |
272 | sphere(d=spring_d*3/4,$fn=PI*spring_d); | 272 | sphere(d=spring_d*3/4,$fn=PI*spring_d); |
273 | } | 273 | } |
274 | 274 | ||
275 | }//difference | 275 | }//difference |
276 | 276 | ||
277 | intersection() { | 277 | if(supports) intersection() { |
278 | difference() { | 278 | difference() { |
279 | translate([0,0,ls_z-ls_h/2-epsilon]) | 279 | translate([0,0,ls_z-ls_h/2-epsilon]) |
280 | cylinder(d=gearbox_d,h=ls_h+2*epsilon,$fn=2*PI*gearbox_d); | 280 | cylinder(d=gearbox_d,h=ls_h+2*epsilon,$fn=2*PI*gearbox_d); |
281 | cylinder(d=pulley_d+pulley_clearance,h=body_h+1,$fn=2*PI*(pulley_d+pulley_clearance)); | 281 | cylinder(d=pulley_d+pulley_clearance,h=body_h+1,$fn=2*PI*(pulley_d+pulley_clearance)); |
282 | } | 282 | } |
283 | // supports | 283 | // supports |
284 | // TODO: hardcoded stuff below… | 284 | // TODO: hardcoded stuff below… |
285 | if(false) { // parallel | 285 | if(false) { // parallel |
286 | for(y=[-gearbox_d:4:gearbox_d]) | 286 | for(y=[-gearbox_d:4:gearbox_d]) |
287 | translate([0,y-extrusion_width/2,0]) | 287 | translate([0,y-extrusion_width/2,0]) |
288 | cube(size=[gearbox_d,extrusion_width,body_h]); | 288 | cube(size=[gearbox_d,extrusion_width,body_h]); |
289 | }else{ // radial | 289 | }else{ // radial |
290 | for(zr=[-65:(65+50)/7:50]) | 290 | for(zr=[-65:(65+50)/7:50]) |
291 | rotate([0,0,zr]) translate([0,-extrusion_width/2,0]) | 291 | rotate([0,0,zr]) translate([0,-extrusion_width/2,0]) |
292 | cube(size=[gearbox_d,extrusion_width,body_h]); | 292 | cube(size=[gearbox_d,extrusion_width,body_h]); |
293 | } | 293 | } |
294 | } | 294 | } |
295 | 295 | ||
296 | }//body module | 296 | }//body module |
297 | 297 | ||
298 | module knob() { | 298 | module knob() { |
299 | ch = knob_indent_d/2; | 299 | ch = knob_indent_d/2; |
300 | translate([0,0,body_h+epsilon]) { | 300 | translate([0,0,body_h+epsilon]) { |
301 | mirror([0,0,1]) translate([0,0,-epsilon]) { | 301 | mirror([0,0,1]) translate([0,0,-epsilon]) { |
302 | difference() { | 302 | difference() { |
303 | cylinder(d=pulley_d,h=knob_bore_l,$fn=pulley_d*PI*2); | 303 | cylinder(d=pulley_d,h=knob_bore_l,$fn=pulley_d*PI*2); |
304 | translate([0,0,-1]) difference() { | 304 | translate([0,0,-1]) difference() { |
305 | cylinder(d=bore_d+knob_bore_d_tolerance,h=knob_bore_l+2); | 305 | cylinder(d=bore_d+knob_bore_d_tolerance,h=knob_bore_l+2); |
306 | translate([-bore_d/2-1,bore_dd-bore_d/2+knob_bore_d_tolerance/2,-1]) | 306 | translate([-bore_d/2-1,bore_dd-bore_d/2+knob_bore_d_tolerance/2,-1]) |
307 | cube([bore_d+2,bore_d/2,knob_bore_l+4]); | 307 | cube([bore_d+2,bore_d/2,knob_bore_l+4]); |
308 | } | 308 | } |
309 | } | 309 | } |
310 | } | 310 | } |
311 | difference() { | 311 | difference() { |
312 | union() { | 312 | union() { |
313 | cylinder(d1=gearbox_d-2*ch,d2=gearbox_d,h=ch+epsilon,$fn=PI*gearbox_d*2); | 313 | cylinder(d1=gearbox_d-2*ch,d2=gearbox_d,h=ch+epsilon,$fn=PI*gearbox_d*2); |
314 | translate([0,0,ch]) | 314 | translate([0,0,ch]) |
315 | cylinder(d=gearbox_d,h=knob_h-2*ch+epsilon,$fn=PI*gearbox_d*2); | 315 | cylinder(d=gearbox_d,h=knob_h-2*ch+epsilon,$fn=PI*gearbox_d*2); |
316 | translate([0,0,knob_h-ch]) | 316 | translate([0,0,knob_h-ch]) |
317 | cylinder(d1=gearbox_d,d2=gearbox_d-2*ch,h=ch,$fn=PI*gearbox_d*2); | 317 | cylinder(d1=gearbox_d,d2=gearbox_d-2*ch,h=ch,$fn=PI*gearbox_d*2); |
318 | } | 318 | } |
319 | for(a=[0:360/knob_indents:359]) rotate([0,0,a]) | 319 | for(a=[0:360/knob_indents:359]) rotate([0,0,a]) |
320 | translate([0,gearbox_d/2,-1]) | 320 | translate([0,gearbox_d/2,-1]) |
321 | cylinder(d=knob_indent_d,h=knob_h+2,$fn=knob_indent_d*PI*2); | 321 | cylinder(d=knob_indent_d,h=knob_h+2,$fn=knob_indent_d*PI*2); |
322 | } | 322 | } |
323 | } | 323 | } |
324 | }//knob module | 324 | }//knob module |
325 | 325 | ||
326 | mirrorleft() | 326 | mirrorleft() |
327 | if(what=="lever") color("green",0.7) lever(); | 327 | if(what=="lever") color("green",0.7) lever(); |
328 | else if(what=="body") color("yellow",0.7) body(); | 328 | else if(what=="body") color("yellow",0.7) body(); |
329 | else if(what=="knob") color("red",0.7) knob(); | 329 | else if(what=="knob") color("red",0.7) knob(); |
330 | else if(what=="both" || what=="*") { | 330 | else if(what=="both" || what=="*") { |
331 | color("green",0.7) lever(); | 331 | color("green",0.7) lever(); |
332 | color("yellow",0.7) body(); | 332 | color("yellow",0.7) body(); |
333 | color("red",0.7) knob(); | 333 | color("red",0.7) knob(); |
334 | } | 334 | } |
335 | } | 335 | } |
336 | 336 | ||
337 | the_extruder(what="both",left=false); | 337 | the_extruder(what="both",left=false); |