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 strap_around_over = 1.0;
54 strap_around_attach = 2.0;
56 retainer_walls = [18, 30];
58 bank_profile_scale_bodge = 1.0;
60 bank_output_ctr = [ 12.5, 11.5 ]; // from nearest corner
61 bank_output_sz = [ 11.0, 10.5 ];
63 mounted_pos_y_offset_lim = -100;
72 straps_y = [ -bank_y_sz * 0.25, // these entries are special and used
73 +bank_y_sz * 0.25, // for the brace struts
76 screw_head_behind = main_th;
79 bank_recess_dx = minor_wall_min;
81 pspt_to_mm = 25.4 / 72;
83 main_r = tube_dia/2 + main_th;
85 screw_max_y_lhs = -main_r -screw_nut_across/2;
86 screw_max_y_rhs = -main_r -knob_behind_across/2;
88 screw_y = min(screw_max_y_lhs,
91 bot_y = screw_y -max( screw_nut_across/2, knob_behind_across/2 )
94 holder_x_sz = bank_x_sz + bank_recess_dx*2;
95 bank_bot_y = strap_above + strap_th;
98 brace_total_len = brace_len + main_th;
99 brace_ctrs_y = [ straps_y[0] - (brace_r + strap_w/2),
100 straps_y[1] + (brace_r + strap_w/2) ];
102 clamp_width_actual = max(clamp_min_width, holder_x_sz);
104 hinge_lobes = floor(clamp_width_actual / hinge_lobe_per);
105 hinge_stride = (clamp_width_actual + hinge_gap_z) / hinge_lobes;
107 hinge_outer_r = hinge_around + hinge_pin/2;
108 hinge_y = tube_dia/2 + hinge_outer_r;
110 top_cnr_r = min(endwall_th, main_th);
112 mounted_pos_y_offset = max(mounted_pos_y_offset_lim,
113 bot_y - (-(bank_y_sz/2 + endwall_th)));
116 module TubePlan(){ circle(r = tube_dia/2); }
117 module HingePinPlan(){ translate([0, hinge_y]) circle(r= hinge_pin/2); }
118 module HingeBodyPlan(){ translate([0, hinge_y]) circle(r= hinge_outer_r); }
120 module TubeClampLeftPlan(){
123 polygon([[ 0, hinge_y + hinge_outer_r ],
124 [ -(main_r + overlap_l), hinge_y + hinge_outer_r ],
125 [ -(main_r + overlap_l), bot_y ],
126 [ -clamp_gap/2, bot_y ],
127 [ -clamp_gap/2, 0, ],
137 module TubeClampLeft() { ////toplevel
138 linextr(-clamp_width_actual/2, clamp_width_actual/2)
142 module TubeClampRightPlan(){
145 rectfromto([ clamp_gap/2, bot_y ],
146 [ clamp_gap/2 + behind_knob_th, 0 ]);
152 rectfromto([ clamp_gap/2, main_r*5 ],
164 linextr_x_yz(-main_r*5, main_r*5)
165 translate([screw_y, 0])
168 translate([0, screw_y, 0]) {
169 linextr_x_yz(-(clamp_gap/2 + screw_nut_th), 0)
170 square([screw_nut_across,
171 screw_nut_across / cos(30) + bridge_slop*2],
175 -(clamp_gap/2 + screw_nut_th + screw_head_behind))
176 square([screw_head, screw_head + bridge_slop*2],
181 module SomeClamp(hinge_alt=false){
183 linextr(-clamp_width_actual/2, clamp_width_actual/2)
188 for (i=[0 : hinge_lobes-1]) {
191 -clamp_width_actual/2 + i * hinge_stride
192 + (hinge_alt ? hinge_stride/2 : 0)
194 linextr(-hinge_gap_z, hinge_stride/2)
195 square(hinge_outer_r*2 + hinge_gap_xy, center=true);
200 module PowerBankItselfSidePlan(){
201 translate([0, bank_bot_y]){
203 circle($fn=8, r=liner_th);
204 scale( bank_profile_scale_bodge *
209 translate(pspt_to_mm *
210 [-0.5 * (bank_eps_bbox_x[0] +
212 -bank_eps_bbox_y[0]])
213 import("powerbank-anker-10000.dxf", convexity=5);
218 module PowerBankItself(){ ////toplevel
220 linextr_y_xz(-bank_y_sz/2,
222 PowerBankItselfSidePlan();
225 module PowerBankSidePlan(){ ////toplevel
226 render() difference(){
227 rectfromto([ -holder_x_sz/2, 0 ],
228 [ +holder_x_sz/2, bank_recess_y + bank_bot_y ]);
230 PowerBankItselfSidePlan();
234 module PowerBankStrapCut(){ ////toplevel
236 rectfromto([ -holder_x_sz, -0.05 ],
237 [ +holder_x_sz, strap_th + strap_r ]);
240 translate([sx * (holder_x_sz/2 - strap_r + 0.1),
248 module PowerBankHolderTest(){ ////toplevel
250 linextr(-1,5) PowerBankSidePlan();
251 linextr(0, strap_w) PowerBankStrapCut();
255 module EndRetainer(depth){ ////toplevel
256 translate([0, -bank_y_sz/2, 0]) {
257 linextr_y_xz(-endwall_th, 0)
258 rectfromto([ 0, -holder_x_sz/2 ],
259 [ -depth, +holder_x_sz/2 ]);
263 linextr(-holder_x_sz/2, -bank_x_sz/2){
265 rectfromto([ 0, -endwall_th ],
276 module BraceTubePlan(){
279 rectfromto(brace_r * [-2, 0],
284 module PowerBankHolder(){ ////toplevel
288 linextr_y_xz(-(bank_y_sz/2 + 0.1),
289 +(bank_y_sz/2 + 0.1))
292 EndRetainer(retainer_walls[0]);
293 mirror([0,1,0]) EndRetainer(retainer_walls[1]);
295 translate([0,0, bank_x_sz/2]){
296 for (y = brace_ctrs_y) {
298 linextr_x_yz(0, brace_total_len)
302 translate([brace_total_len, 0,0])
303 linextr_y_xz(brace_ctrs_y[0] - brace_r,
304 brace_ctrs_y[1] + brace_r)
308 for (strap_y = straps_y) {
309 translate([0, strap_y, 0]) {
310 linextr(-holder_x_sz/2,
314 (strap_w/2 + strap_around_attach - strap_around_over)) {
315 translate([0, dy, 0])
316 circle(r=strap_around_over);
324 for (strap_y = straps_y)
325 translate([0, strap_y, 0])
332 translate([ bank_bot_y, -bank_y_sz/2, -bank_x_sz/2 ])
335 translate(bank_output_ctr)
336 square(center=true, bank_output_sz);
338 translate([0, -(bank_y_sz/2 + endwall_th), 0] + 0.01 * [-1,-1]) {
341 square(center=true, top_cnr_r*2);
342 translate(top_cnr_r * [1,1])
343 circle(r= top_cnr_r);
350 module TubeClampLeft() { ////toplevel
351 // We want this to print with the recess overhand to the right
352 // where the workpiece cooling fan is
363 module PlacePowerBank(){
364 translate([main_r, -mounted_pos_y_offset, 0])
368 module Main(){ ////toplevel
378 module TubeClampRight() { ////toplevel
384 TubeClampRightPlan();
386 translate([clamp_gap/2 + behind_knob_th, screw_y, 0]) {
388 linextr_x_yz(-0.1, 0)
391 knob_behind_across + knob_standout_h*2]);
392 linextr_x_yz(0, knob_standout_h)
404 module TubeClampDemo() { ////toplevel
410 module Demo() { ////toplevel