12 hinge_pin = 1.8 + 0.75;
17 screw_head = 8.7 + 1.2;
18 screw_head_space_above = 10;
19 screw_nut_across = 7.9 + 0.75;
20 screw_nut_th = 3.9 + 0.75;
22 knob_behind_across = 12.2 + 0.75;
43 bank_eps_bbox_x = [149, 598];
44 bank_eps_bbox_y = [274, 1452];
46 bank_y_sz = 102.25 + 0.50 + 3.2;
47 bank_x_sz = (26.0 + 0.5);
54 strap_around_over = 1.0;
55 strap_around_attach = 2.0;
57 retainer_walls = [18, 30];
59 bank_profile_scale_bodge = 1.0;
61 bank_output_ctr = [ 12.5, 11.5 ]; // from nearest corner
62 bank_output_sz = [ 11.0, 10.5 ];
64 mounted_pos_y_offset_lim = -100;
77 straps_y = [ -bank_y_sz * 0.25, // these entries are special and used
78 +bank_y_sz * 0.25, // for the brace struts
81 screw_head_behind = main_th;
84 bank_recess_dx = minor_wall_min;
86 pspt_to_mm = 25.4 / 72;
88 main_r = tube_dia/2 + main_th;
90 screw_max_y_lhs = -main_r -screw_nut_across/2;
91 screw_max_y_rhs = -main_r -knob_behind_across/2;
93 screw_y = min(screw_max_y_lhs,
96 bot_y = screw_y -max( screw_nut_across/2, knob_behind_across/2 )
99 holder_x_sz = bank_x_sz + bank_recess_dx*2;
100 bank_bot_y = strap_above + strap_th;
103 brace_total_len = brace_len + main_th;
104 brace_ctrs_y_nom = [ straps_y[0] - (brace_r + strap_w/2),
105 straps_y[1] + (brace_r + strap_w/2) ];
107 brace_ctrs_y = [ (straps_y + straps_y_adj)[0] + (brace_r + strap_w/2),
108 (straps_y + straps_y_adj)[1] + (brace_r + strap_w/2) ];
110 clamp_width_actual = max(clamp_min_width, holder_x_sz);
112 hinge_lobes = floor(clamp_width_actual / hinge_lobe_per);
113 hinge_stride = (clamp_width_actual + hinge_gap_z) / hinge_lobes;
115 hinge_outer_r = hinge_around + hinge_pin/2;
116 hinge_y = tube_dia/2 + hinge_outer_r;
118 top_cnr_r = min(endwall_th, main_th);
120 mounted_pos_y_offset = max(mounted_pos_y_offset_lim,
121 bot_y - (-(bank_y_sz/2 + endwall_th)));
124 module TubePlan(){ circle(r = tube_dia/2); }
125 module HingePinPlan(){ translate([0, hinge_y]) circle(r= hinge_pin/2); }
126 module HingeBodyPlan(){ translate([0, hinge_y]) circle(r= hinge_outer_r); }
128 module TubeClampLeftPlan(){
131 polygon([[ 0, hinge_y + hinge_outer_r ],
132 [ -(main_r + overlap_l), hinge_y + hinge_outer_r ],
133 [ -(main_r + overlap_l), bot_y ],
134 [ -clamp_gap/2, bot_y ],
135 [ -clamp_gap/2, 0, ],
145 module TubeClampLeft() { ////toplevel
146 linextr(-clamp_width_actual/2, clamp_width_actual/2)
150 module TubeClampRightPlan(){ ////toplevel
154 rectfromto([ clamp_gap/2, bot_y ],
155 [ clamp_gap/2 + behind_knob_th, 0 ]);
161 rectfromto([ clamp_gap/2, main_r*5 ],
174 linextr_x_yz(-main_r*5, main_r*5)
175 translate([screw_y, 0])
178 translate([0, screw_y, 0]) {
179 linextr_x_yz(-(clamp_gap/2 + screw_nut_th), 0)
180 square([screw_nut_across,
181 screw_nut_across / cos(30) + bridge_slop*2],
184 linextr_x_yz(-(main_r + bank_recess_y + screw_head_space_above),
185 -(clamp_gap/2 + screw_nut_th + screw_head_behind))
186 square([screw_head, screw_head + bridge_slop*2],
191 module SomeClamp(hinge_alt=false){
193 linextr(-clamp_width_actual/2, clamp_width_actual/2)
198 for (i=[0 : hinge_lobes-1]) {
201 -clamp_width_actual/2 + i * hinge_stride
202 + (hinge_alt ? hinge_stride/2 : 0)
204 linextr(-hinge_gap_z, hinge_stride/2)
205 square(hinge_outer_r*2 + hinge_gap_xy, center=true);
210 module PowerBankItselfSidePlan(){
211 translate([0, bank_bot_y]){
213 circle($fn=8, r=liner_th);
214 scale( bank_profile_scale_bodge *
219 translate(pspt_to_mm *
220 [-0.5 * (bank_eps_bbox_x[0] +
222 -bank_eps_bbox_y[0]])
223 import("powerbank-anker-10000.dxf", convexity=5);
228 module PowerBankItself(){ ////toplevel
230 linextr_y_xz(-bank_y_sz/2,
232 PowerBankItselfSidePlan();
235 module PowerBankSidePlan(){ ////toplevel
236 render() difference(){
237 rectfromto([ -holder_x_sz/2, 0 ],
238 [ +holder_x_sz/2, bank_recess_y + bank_bot_y ]);
240 PowerBankItselfSidePlan();
244 module PowerBankStrapCut(){ ////toplevel
246 rectfromto([ -holder_x_sz, -0.05 ],
247 [ +holder_x_sz, strap_th + strap_r ]);
250 translate([sx * (holder_x_sz/2 - strap_r + 0.1),
258 module PowerBankHolderTest(){ ////toplevel
260 linextr(-1,5) PowerBankSidePlan();
261 linextr(0, strap_w) PowerBankStrapCut();
265 module EndRetainer(depth){ ////toplevel
266 translate([0, -bank_y_sz/2, 0]) {
267 linextr_y_xz(-endwall_th, 0)
268 rectfromto([ 0, -holder_x_sz/2 ],
269 [ -depth, +holder_x_sz/2 ]);
273 linextr(-holder_x_sz/2, -bank_x_sz/2){
275 rectfromto([ 0, -endwall_th ],
286 module BraceTubePlan(){
289 rectfromto(brace_r * [-2, 0],
294 module PowerBankHolder(){ ////toplevel
298 linextr_y_xz(-(bank_y_sz/2 + 0.1),
299 +(bank_y_sz/2 + 0.1))
302 EndRetainer(retainer_walls[0]);
303 mirror([0,1,0]) EndRetainer(retainer_walls[1]);
305 translate([0,0, bank_x_sz/2]){
306 for (y = brace_ctrs_y) {
308 linextr_x_yz(0, brace_total_len)
312 translate([brace_total_len, 0,0])
313 linextr_y_xz(brace_ctrs_y_nom[0] - brace_r,
314 brace_ctrs_y_nom[1] + brace_r)
318 for (strap_y = straps_y + straps_y_adj) {
319 translate([0, strap_y, 0]) {
320 linextr(-holder_x_sz/2,
324 (strap_w/2 + strap_around_attach - strap_around_over)) {
325 translate([0, dy, 0])
326 circle(r=strap_around_over);
334 for (strap_y = straps_y + straps_y_adj)
335 translate([0, strap_y, 0])
342 translate([ bank_bot_y, -bank_y_sz/2, -bank_x_sz/2 ])
345 translate(bank_output_ctr)
346 square(center=true, bank_output_sz);
348 translate([0, -(bank_y_sz/2 + endwall_th), 0] + 0.01 * [-1,-1]) {
351 square(center=true, top_cnr_r*2);
352 translate(top_cnr_r * [1,1])
353 circle(r= top_cnr_r);
360 module TubeClampLeft() { ////toplevel
361 // We want this to print with the recess overhand to the right
362 // where the workpiece cooling fan is
373 module PlacePowerBank(){
374 translate([main_r, -mounted_pos_y_offset, 0])
378 module Main(){ ////toplevel
388 module TubeClampRight() { ////toplevel
394 TubeClampRightPlan();
396 translate([clamp_gap/2 + behind_knob_th, screw_y, 0]) {
398 linextr_x_yz(-0.1, 0)
401 knob_behind_across + knob_standout_h*2]);
402 linextr_x_yz(0, knob_standout_h)
414 module TubeClampDemo() { ////toplevel
420 module Demo() { ////toplevel