12 hinge_pin = 1.8 + 0.75;
17 screw_head = 8.7 + 1.2;
18 screw_nut_across = 7.9 + 0.75;
19 screw_nut_th = 3.9 + 0.75;
21 knob_behind_across = 12.2 + 0.75;
42 bank_eps_bbox_x = [149, 598];
43 bank_eps_bbox_y = [274, 1452];
45 bank_y_sz = 102.25 + 0.50 + 3.2;
46 bank_x_sz = (26.0 + 0.5);
53 retainer_walls = [18, 30];
55 bank_profile_scale_bodge = 1.0;
57 bank_output_ctr = [ 12.5, 11.5 ]; // from nearest corner
58 bank_output_sz = [ 11.0, 10.5 ];
60 mounted_pos_y_offset_lim = -100;
69 straps_y = [ -bank_y_sz * 0.25, // these entries are special and used
70 +bank_y_sz * 0.25, // for the brace struts
73 screw_head_behind = main_th;
76 bank_recess_dx = minor_wall_min;
78 pspt_to_mm = 25.4 / 72;
80 main_r = tube_dia/2 + main_th;
82 screw_max_y_lhs = -main_r -screw_nut_across/2;
83 screw_max_y_rhs = -main_r -knob_behind_across/2;
85 screw_y = min(screw_max_y_lhs,
88 bot_y = screw_y -max( screw_nut_across/2, knob_behind_across/2 )
91 holder_x_sz = bank_x_sz + bank_recess_dx*2;
92 bank_bot_y = strap_above + strap_th;
95 brace_total_len = brace_len + main_th;
96 brace_ctrs_y = [ straps_y[0] - (brace_r + strap_w/2),
97 straps_y[1] + (brace_r + strap_w/2) ];
99 clamp_width_actual = max(clamp_min_width, holder_x_sz);
101 hinge_lobes = floor(clamp_width_actual / hinge_lobe_per);
102 hinge_stride = (clamp_width_actual + hinge_gap_z) / hinge_lobes;
104 hinge_outer_r = hinge_around + hinge_pin/2;
105 hinge_y = tube_dia/2 + hinge_outer_r;
107 top_cnr_r = min(endwall_th, main_th);
109 mounted_pos_y_offset = max(mounted_pos_y_offset_lim,
110 bot_y - (-(bank_y_sz/2 + endwall_th)));
113 module TubePlan(){ circle(r = tube_dia/2); }
114 module HingePinPlan(){ translate([0, hinge_y]) circle(r= hinge_pin/2); }
115 module HingeBodyPlan(){ translate([0, hinge_y]) circle(r= hinge_outer_r); }
117 module TubeClampLeftPlan(){
120 polygon([[ 0, hinge_y + hinge_outer_r ],
121 [ -(main_r + overlap_l), hinge_y + hinge_outer_r ],
122 [ -(main_r + overlap_l), bot_y ],
123 [ -clamp_gap/2, bot_y ],
124 [ -clamp_gap/2, 0, ],
134 module TubeClampLeft() { ////toplevel
135 linextr(-clamp_width_actual/2, clamp_width_actual/2)
139 module TubeClampRightPlan(){
142 rectfromto([ clamp_gap/2, bot_y ],
143 [ clamp_gap/2 + behind_knob_th, 0 ]);
149 rectfromto([ clamp_gap/2, main_r*5 ],
161 linextr_x_yz(-main_r*5, main_r*5)
162 translate([screw_y, 0])
165 translate([0, screw_y, 0]) {
166 linextr_x_yz(-(clamp_gap/2 + screw_nut_th), 0)
167 square([screw_nut_across,
168 screw_nut_across / cos(30) + bridge_slop*2],
172 -(clamp_gap/2 + screw_nut_th + screw_head_behind))
173 square([screw_head, screw_head + bridge_slop*2],
178 module SomeClamp(hinge_alt=false){
180 linextr(-clamp_width_actual/2, clamp_width_actual/2)
185 for (i=[0 : hinge_lobes-1]) {
188 -clamp_width_actual/2 + i * hinge_stride
189 + (hinge_alt ? hinge_stride/2 : 0)
191 linextr(-hinge_gap_z, hinge_stride/2)
192 square(hinge_outer_r*2 + hinge_gap_xy, center=true);
197 module PowerBankItselfSidePlan(){
198 translate([0, bank_bot_y]){
200 circle($fn=8, r=liner_th);
201 scale( bank_profile_scale_bodge *
206 translate(pspt_to_mm *
207 [-0.5 * (bank_eps_bbox_x[0] +
209 -bank_eps_bbox_y[0]])
210 import("powerbank-anker-10000.dxf", convexity=5);
215 module PowerBankItself(){ ////toplevel
217 linextr_y_xz(-bank_y_sz/2,
219 PowerBankItselfSidePlan();
222 module PowerBankSidePlan(){ ////toplevel
223 render() difference(){
224 rectfromto([ -holder_x_sz/2, 0 ],
225 [ +holder_x_sz/2, bank_recess_y + bank_bot_y ]);
227 PowerBankItselfSidePlan();
231 module PowerBankStrapCut(){ ////toplevel
233 rectfromto([ -holder_x_sz, -0.05 ],
234 [ +holder_x_sz, strap_th + strap_r ]);
237 translate([sx * (holder_x_sz/2 - strap_r + 0.1),
245 module PowerBankHolderTest(){ ////toplevel
247 linextr(-1,5) PowerBankSidePlan();
248 linextr(0, strap_w) PowerBankStrapCut();
252 module EndRetainer(depth){ ////toplevel
253 translate([0, -bank_y_sz/2, 0]) {
254 linextr_y_xz(-endwall_th, 0)
255 rectfromto([ 0, -holder_x_sz/2 ],
256 [ -depth, +holder_x_sz/2 ]);
260 linextr(-holder_x_sz/2, -bank_x_sz/2){
262 rectfromto([ 0, -endwall_th ],
273 module BraceTubePlan(){
276 rectfromto(brace_r * [-2, 0],
281 module PowerBankHolder(){ ////toplevel
285 linextr_y_xz(-(bank_y_sz/2 + 0.1),
286 +(bank_y_sz/2 + 0.1))
289 EndRetainer(retainer_walls[0]);
290 mirror([0,1,0]) EndRetainer(retainer_walls[1]);
292 translate([0,0, bank_x_sz/2]){
293 for (y = brace_ctrs_y) {
295 linextr_x_yz(0, brace_total_len)
299 translate([brace_total_len, 0,0])
300 linextr_y_xz(brace_ctrs_y[0] - brace_r,
301 brace_ctrs_y[1] + brace_r)
306 for (strap_y = straps_y)
307 translate([0, strap_y, 0])
314 translate([ bank_bot_y, -bank_y_sz/2, -bank_x_sz/2 ])
317 translate(bank_output_ctr)
318 square(center=true, bank_output_sz);
320 translate([0, -(bank_y_sz/2 + endwall_th), 0] + 0.01 * [-1,-1]) {
323 square(center=true, top_cnr_r*2);
324 translate(top_cnr_r * [1,1])
325 circle(r= top_cnr_r);
332 module TubeClampLeft() { ////toplevel
333 // We want this to print with the recess overhand to the right
334 // where the workpiece cooling fan is
345 module PlacePowerBank(){
346 translate([main_r, -mounted_pos_y_offset, 0])
350 module Main(){ ////toplevel
360 module TubeClampRight() { ////toplevel
366 TubeClampRightPlan();
368 translate([clamp_gap/2 + behind_knob_th, screw_y, 0]) {
370 linextr_x_yz(-0.1, 0)
373 knob_behind_across + knob_standout_h*2]);
374 linextr_x_yz(0, knob_standout_h)
386 module TubeClampDemo() { ////toplevel
392 module Demo() { ////toplevel