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;
30 corner_rounding_r = 10;
45 bank_eps_bbox_x = [149, 598];
46 bank_eps_bbox_y = [274, 1452];
48 bank_y_sz = 102.25 + 0.50 + 3.2;
49 bank_x_sz = (26.0 + 0.5);
56 strap_around_over = 1.0;
57 strap_around_attach = 2.0;
59 retainer_walls = [18, 30];
61 bank_profile_scale_bodge = 1.0;
63 bank_output_ctr = [ 12.5, 11.5 ]; // from nearest corner
64 bank_output_sz = [ 11.0, 10.5 ];
66 mounted_pos_y_offset_lim = -100;
79 straps_y = [ -bank_y_sz * 0.25, // these entries are special and used
80 +bank_y_sz * 0.25, // for the brace struts
83 screw_head_behind = main_th;
86 bank_recess_dx = minor_wall_min;
88 pspt_to_mm = 25.4 / 72;
90 main_r = tube_dia/2 + main_th;
92 screw_max_y_lhs = -main_r -screw_nut_across/2;
93 screw_max_y_rhs = -main_r -knob_behind_across/2;
95 screw_y = min(screw_max_y_lhs,
98 bot_y = screw_y -max( screw_nut_across/2, knob_behind_across/2 )
101 holder_x_sz = bank_x_sz + bank_recess_dx*2;
102 bank_bot_y = strap_above + strap_th;
105 brace_total_len = brace_len + main_th;
106 brace_ctrs_y_nom = [ straps_y[0] - (brace_r + strap_w/2),
107 straps_y[1] + (brace_r + strap_w/2) ];
109 brace_ctrs_y = [ (straps_y + straps_y_adj)[0] + (brace_r + strap_w/2),
110 (straps_y + straps_y_adj)[1] + (brace_r + strap_w/2) ];
112 clamp_width_actual = max(clamp_min_width, holder_x_sz);
114 hinge_lobes = floor(clamp_width_actual / hinge_lobe_per);
115 hinge_stride = (clamp_width_actual + hinge_gap_z) / hinge_lobes;
117 hinge_outer_r = hinge_around + hinge_pin/2;
118 hinge_y = tube_dia/2 + hinge_outer_r;
120 top_cnr_r = min(endwall_th, main_th);
122 mounted_pos_y_offset = max(mounted_pos_y_offset_lim,
123 bot_y - (-(bank_y_sz/2 + endwall_th)));
126 module TubePlan(){ circle(r = tube_dia/2); }
127 module HingePinPlan(){ translate([0, hinge_y]) circle(r= hinge_pin/2); }
128 module HingeBodyPlan(){ translate([0, hinge_y]) circle(r= hinge_outer_r); }
130 module TubeClampLeftPlan(){
133 polygon([[ 0, hinge_y + hinge_outer_r ],
134 [ -(main_r + overlap_l), hinge_y + hinge_outer_r ],
135 [ -(main_r + overlap_l), bot_y ],
136 [ -clamp_gap/2, bot_y ],
137 [ -clamp_gap/2, 0, ],
147 module TubeClampLeft() { ////toplevel
148 linextr(-clamp_width_actual/2, clamp_width_actual/2)
152 module TubeClampRightPlan(){ ////toplevel
154 // It broke at the inside corner, round these a bit
155 offset(r=-corner_rounding_r)
156 offset(r=+corner_rounding_r)
159 rectfromto([ clamp_gap/2, bot_y ],
160 [ clamp_gap/2 + behind_knob_th, 0 ]);
162 circle(r= main_r); // maybe split off from main_r and increase?
166 rectfromto([ clamp_gap/2, main_r*5 ],
179 linextr_x_yz(-main_r*5, main_r*5)
180 translate([screw_y, 0])
183 translate([0, screw_y, 0]) {
184 linextr_x_yz(-(clamp_gap/2 + screw_nut_th), 0)
185 square([screw_nut_across,
186 screw_nut_across / cos(30) + bridge_slop*2],
189 linextr_x_yz(-(main_r + bank_recess_y + screw_head_space_above),
190 -(clamp_gap/2 + screw_nut_th + screw_head_behind))
191 square([screw_head, screw_head + bridge_slop*2],
196 module SomeClamp(hinge_alt=false){
198 linextr(-clamp_width_actual/2, clamp_width_actual/2)
203 for (i=[0 : hinge_lobes-1]) {
206 -clamp_width_actual/2 + i * hinge_stride
207 + (hinge_alt ? hinge_stride/2 : 0)
209 linextr(-hinge_gap_z, hinge_stride/2)
210 square(hinge_outer_r*2 + hinge_gap_xy, center=true);
215 module PowerBankItselfSidePlan(){
216 translate([0, bank_bot_y]){
218 circle($fn=8, r=liner_th);
219 scale( bank_profile_scale_bodge *
224 translate(pspt_to_mm *
225 [-0.5 * (bank_eps_bbox_x[0] +
227 -bank_eps_bbox_y[0]])
228 import("powerbank-anker-10000.dxf", convexity=5);
233 module PowerBankItself(){ ////toplevel
235 linextr_y_xz(-bank_y_sz/2,
237 PowerBankItselfSidePlan();
240 module PowerBankSidePlan(){ ////toplevel
241 render() difference(){
242 rectfromto([ -holder_x_sz/2, 0 ],
243 [ +holder_x_sz/2, bank_recess_y + bank_bot_y ]);
245 PowerBankItselfSidePlan();
249 module PowerBankStrapCut(){ ////toplevel
251 rectfromto([ -holder_x_sz, -0.05 ],
252 [ +holder_x_sz, strap_th + strap_r ]);
255 translate([sx * (holder_x_sz/2 - strap_r + 0.1),
263 module PowerBankHolderTest(){ ////toplevel
265 linextr(-1,5) PowerBankSidePlan();
266 linextr(0, strap_w) PowerBankStrapCut();
270 module EndRetainer(depth){ ////toplevel
271 translate([0, -bank_y_sz/2, 0]) {
272 linextr_y_xz(-endwall_th, 0)
273 rectfromto([ 0, -holder_x_sz/2 ],
274 [ -depth, +holder_x_sz/2 ]);
278 linextr(-holder_x_sz/2, -bank_x_sz/2){
280 rectfromto([ 0, -endwall_th ],
291 module BraceTubePlan(){
294 rectfromto(brace_r * [-2, 0],
299 module PowerBankHolder(){ ////toplevel
303 linextr_y_xz(-(bank_y_sz/2 + 0.1),
304 +(bank_y_sz/2 + 0.1))
307 EndRetainer(retainer_walls[0]);
308 mirror([0,1,0]) EndRetainer(retainer_walls[1]);
310 translate([0,0, bank_x_sz/2]){
311 for (y = brace_ctrs_y) {
313 linextr_x_yz(0, brace_total_len)
317 translate([brace_total_len, 0,0])
318 linextr_y_xz(brace_ctrs_y_nom[0] - brace_r,
319 brace_ctrs_y_nom[1] + brace_r)
323 for (strap_y = straps_y + straps_y_adj) {
324 translate([0, strap_y, 0]) {
325 linextr(-holder_x_sz/2,
329 (strap_w/2 + strap_around_attach - strap_around_over)) {
330 translate([0, dy, 0])
331 circle(r=strap_around_over);
339 for (strap_y = straps_y + straps_y_adj)
340 translate([0, strap_y, 0])
347 translate([ bank_bot_y, -bank_y_sz/2, -bank_x_sz/2 ])
350 translate(bank_output_ctr)
351 square(center=true, bank_output_sz);
353 translate([0, -(bank_y_sz/2 + endwall_th), 0] + 0.01 * [-1,-1]) {
356 square(center=true, top_cnr_r*2);
357 translate(top_cnr_r * [1,1])
358 circle(r= top_cnr_r);
365 module TubeClampLeft() { ////toplevel
366 // We want this to print with the recess overhand to the right
367 // where the workpiece cooling fan is
378 module PlacePowerBank(){
379 translate([main_r, -mounted_pos_y_offset, 0])
383 module Main(){ ////toplevel
393 module TubeClampRight() { ////toplevel
399 TubeClampRightPlan();
401 translate([clamp_gap/2 + behind_knob_th, screw_y, 0]) {
403 linextr_x_yz(-0.1, 0)
406 knob_behind_across + knob_standout_h*2]);
407 linextr_x_yz(0, knob_standout_h)
419 module TubeClampDemo() { ////toplevel
425 module Demo() { ////toplevel