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,
72 screw_head_behind = main_th;
75 bank_recess_dx = minor_wall_min;
77 pspt_to_mm = 25.4 / 72;
79 main_r = tube_dia/2 + main_th;
81 screw_max_y_lhs = -main_r -screw_nut_across/2;
82 screw_max_y_rhs = -main_r -knob_behind_across/2;
84 screw_y = min(screw_max_y_lhs,
87 bot_y = screw_y -max( screw_nut_across/2, knob_behind_across/2 )
90 holder_x_sz = bank_x_sz + bank_recess_dx*2;
91 bank_bot_y = strap_above + strap_th;
94 brace_total_len = brace_len + main_th;
95 brace_ctrs_y = [ straps_y[0] - (brace_r + strap_w/2),
96 straps_y[1] + (brace_r + strap_w/2) ];
98 clamp_width_actual = max(clamp_min_width, holder_x_sz);
100 hinge_lobes = floor(clamp_width_actual / hinge_lobe_per);
101 hinge_stride = (clamp_width_actual + hinge_gap_z) / hinge_lobes;
103 hinge_outer_r = hinge_around + hinge_pin/2;
104 hinge_y = tube_dia/2 + hinge_outer_r;
106 top_cnr_r = min(endwall_th, main_th);
108 mounted_pos_y_offset = max(mounted_pos_y_offset_lim,
109 bot_y - (-(bank_y_sz/2 + endwall_th)));
112 module TubePlan(){ circle(r = tube_dia/2); }
113 module HingePinPlan(){ translate([0, hinge_y]) circle(r= hinge_pin/2); }
114 module HingeBodyPlan(){ translate([0, hinge_y]) circle(r= hinge_outer_r); }
116 module TubeClampLeftPlan(){
119 polygon([[ 0, hinge_y + hinge_outer_r ],
120 [ -(main_r + overlap_l), hinge_y + hinge_outer_r ],
121 [ -(main_r + overlap_l), bot_y ],
122 [ -clamp_gap/2, bot_y ],
123 [ -clamp_gap/2, 0, ],
133 module TubeClampLeft() { ////toplevel
134 linextr(-clamp_width_actual/2, clamp_width_actual/2)
138 module TubeClampRightPlan(){
141 rectfromto([ clamp_gap/2, bot_y ],
142 [ clamp_gap/2 + behind_knob_th, 0 ]);
148 rectfromto([ clamp_gap/2, main_r*5 ],
160 linextr_x_yz(-main_r*5, main_r*5)
161 translate([screw_y, 0])
164 translate([0, screw_y, 0]) {
165 linextr_x_yz(-(clamp_gap/2 + screw_nut_th), 0)
166 square([screw_nut_across,
167 screw_nut_across / cos(30) + bridge_slop*2],
171 -(clamp_gap/2 + screw_nut_th + screw_head_behind))
172 square([screw_head, screw_head + bridge_slop*2],
177 module SomeClamp(hinge_alt=false){
179 linextr(-clamp_width_actual/2, clamp_width_actual/2)
184 for (i=[0 : hinge_lobes-1]) {
187 -clamp_width_actual/2 + i * hinge_stride
188 + (hinge_alt ? hinge_stride/2 : 0)
190 linextr(-hinge_gap_z, hinge_stride/2)
191 square(hinge_outer_r*2 + hinge_gap_xy, center=true);
196 module PowerBankItselfSidePlan(){
197 translate([0, bank_bot_y]){
199 circle($fn=8, r=liner_th);
200 scale( bank_profile_scale_bodge *
205 translate(pspt_to_mm *
206 [-0.5 * (bank_eps_bbox_x[0] +
208 -bank_eps_bbox_y[0]])
209 import("powerbank-anker-10000.dxf", convexity=5);
214 module PowerBankItself(){ ////toplevel
216 linextr_y_xz(-bank_y_sz/2,
218 PowerBankItselfSidePlan();
221 module PowerBankSidePlan(){ ////toplevel
222 render() difference(){
223 rectfromto([ -holder_x_sz/2, 0 ],
224 [ +holder_x_sz/2, bank_recess_y + bank_bot_y ]);
226 PowerBankItselfSidePlan();
230 module PowerBankStrapCut(){ ////toplevel
232 rectfromto([ -holder_x_sz, -0.05 ],
233 [ +holder_x_sz, strap_th + strap_r ]);
236 translate([sx * (holder_x_sz/2 - strap_r + 0.1),
244 module PowerBankHolderTest(){ ////toplevel
246 linextr(-1,5) PowerBankSidePlan();
247 linextr(0, strap_w) PowerBankStrapCut();
251 module EndRetainer(depth){ ////toplevel
252 translate([0, -bank_y_sz/2, 0]) {
253 linextr_y_xz(-endwall_th, 0)
254 rectfromto([ 0, -holder_x_sz/2 ],
255 [ -depth, +holder_x_sz/2 ]);
259 linextr(-holder_x_sz/2, -bank_x_sz/2){
261 rectfromto([ 0, -endwall_th ],
272 module BraceTubePlan(){
275 rectfromto(brace_r * [-2, 0],
280 module PowerBankHolder(){ ////toplevel
284 linextr_y_xz(-(bank_y_sz/2 + 0.1),
285 +(bank_y_sz/2 + 0.1))
288 EndRetainer(retainer_walls[0]);
289 mirror([0,1,0]) EndRetainer(retainer_walls[1]);
291 translate([0,0, bank_x_sz/2]){
292 for (y = brace_ctrs_y) {
294 linextr_x_yz(0, brace_total_len)
298 translate([brace_total_len, 0,0])
299 linextr_y_xz(brace_ctrs_y[0] - brace_r,
300 brace_ctrs_y[1] + brace_r)
305 for (strap_y = straps_y)
306 translate([0, strap_y, 0])
313 translate([ bank_bot_y, -bank_y_sz/2, -bank_x_sz/2 ])
316 translate(bank_output_ctr)
317 square(center=true, bank_output_sz);
319 translate([0, -(bank_y_sz/2 + endwall_th), 0] + 0.01 * [-1,-1]) {
322 square(center=true, top_cnr_r*2);
323 translate(top_cnr_r * [1,1])
324 circle(r= top_cnr_r);
331 module TubeClampLeft() { ////toplevel
332 // We want this to print with the recess overhand to the right
333 // where the workpiece cooling fan is
344 module PlacePowerBank(){
345 translate([main_r, -mounted_pos_y_offset, 0])
349 module Main(){ ////toplevel
359 module TubeClampRight() { ////toplevel
365 TubeClampRightPlan();
367 translate([clamp_gap/2 + behind_knob_th, screw_y, 0]) {
369 linextr_x_yz(-0.1, 0)
372 knob_behind_across + knob_standout_h*2]);
373 linextr_x_yz(0, knob_standout_h)
385 module TubeClampDemo() { ////toplevel
391 module Demo() { ////toplevel