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(){
153 rectfromto([ clamp_gap/2, bot_y ],
154 [ clamp_gap/2 + behind_knob_th, 0 ]);
160 rectfromto([ clamp_gap/2, main_r*5 ],
172 linextr_x_yz(-main_r*5, main_r*5)
173 translate([screw_y, 0])
176 translate([0, screw_y, 0]) {
177 linextr_x_yz(-(clamp_gap/2 + screw_nut_th), 0)
178 square([screw_nut_across,
179 screw_nut_across / cos(30) + bridge_slop*2],
182 linextr_x_yz(-(main_r + bank_recess_y + screw_head_space_above),
183 -(clamp_gap/2 + screw_nut_th + screw_head_behind))
184 square([screw_head, screw_head + bridge_slop*2],
189 module SomeClamp(hinge_alt=false){
191 linextr(-clamp_width_actual/2, clamp_width_actual/2)
196 for (i=[0 : hinge_lobes-1]) {
199 -clamp_width_actual/2 + i * hinge_stride
200 + (hinge_alt ? hinge_stride/2 : 0)
202 linextr(-hinge_gap_z, hinge_stride/2)
203 square(hinge_outer_r*2 + hinge_gap_xy, center=true);
208 module PowerBankItselfSidePlan(){
209 translate([0, bank_bot_y]){
211 circle($fn=8, r=liner_th);
212 scale( bank_profile_scale_bodge *
217 translate(pspt_to_mm *
218 [-0.5 * (bank_eps_bbox_x[0] +
220 -bank_eps_bbox_y[0]])
221 import("powerbank-anker-10000.dxf", convexity=5);
226 module PowerBankItself(){ ////toplevel
228 linextr_y_xz(-bank_y_sz/2,
230 PowerBankItselfSidePlan();
233 module PowerBankSidePlan(){ ////toplevel
234 render() difference(){
235 rectfromto([ -holder_x_sz/2, 0 ],
236 [ +holder_x_sz/2, bank_recess_y + bank_bot_y ]);
238 PowerBankItselfSidePlan();
242 module PowerBankStrapCut(){ ////toplevel
244 rectfromto([ -holder_x_sz, -0.05 ],
245 [ +holder_x_sz, strap_th + strap_r ]);
248 translate([sx * (holder_x_sz/2 - strap_r + 0.1),
256 module PowerBankHolderTest(){ ////toplevel
258 linextr(-1,5) PowerBankSidePlan();
259 linextr(0, strap_w) PowerBankStrapCut();
263 module EndRetainer(depth){ ////toplevel
264 translate([0, -bank_y_sz/2, 0]) {
265 linextr_y_xz(-endwall_th, 0)
266 rectfromto([ 0, -holder_x_sz/2 ],
267 [ -depth, +holder_x_sz/2 ]);
271 linextr(-holder_x_sz/2, -bank_x_sz/2){
273 rectfromto([ 0, -endwall_th ],
284 module BraceTubePlan(){
287 rectfromto(brace_r * [-2, 0],
292 module PowerBankHolder(){ ////toplevel
296 linextr_y_xz(-(bank_y_sz/2 + 0.1),
297 +(bank_y_sz/2 + 0.1))
300 EndRetainer(retainer_walls[0]);
301 mirror([0,1,0]) EndRetainer(retainer_walls[1]);
303 translate([0,0, bank_x_sz/2]){
304 for (y = brace_ctrs_y) {
306 linextr_x_yz(0, brace_total_len)
310 translate([brace_total_len, 0,0])
311 linextr_y_xz(brace_ctrs_y_nom[0] - brace_r,
312 brace_ctrs_y_nom[1] + brace_r)
316 for (strap_y = straps_y + straps_y_adj) {
317 translate([0, strap_y, 0]) {
318 linextr(-holder_x_sz/2,
322 (strap_w/2 + strap_around_attach - strap_around_over)) {
323 translate([0, dy, 0])
324 circle(r=strap_around_over);
332 for (strap_y = straps_y + straps_y_adj)
333 translate([0, strap_y, 0])
340 translate([ bank_bot_y, -bank_y_sz/2, -bank_x_sz/2 ])
343 translate(bank_output_ctr)
344 square(center=true, bank_output_sz);
346 translate([0, -(bank_y_sz/2 + endwall_th), 0] + 0.01 * [-1,-1]) {
349 square(center=true, top_cnr_r*2);
350 translate(top_cnr_r * [1,1])
351 circle(r= top_cnr_r);
358 module TubeClampLeft() { ////toplevel
359 // We want this to print with the recess overhand to the right
360 // where the workpiece cooling fan is
371 module PlacePowerBank(){
372 translate([main_r, -mounted_pos_y_offset, 0])
376 module Main(){ ////toplevel
386 module TubeClampRight() { ////toplevel
392 TubeClampRightPlan();
394 translate([clamp_gap/2 + behind_knob_th, screw_y, 0]) {
396 linextr_x_yz(-0.1, 0)
399 knob_behind_across + knob_standout_h*2]);
400 linextr_x_yz(0, knob_standout_h)
412 module TubeClampDemo() { ////toplevel
418 module Demo() { ////toplevel