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