8 hinge_pin = 1.8 + 0.75;
13 screw_head = 8.7 + 1.2;
14 screw_nut_across = 7.9 + 0.75;
15 screw_nut_th = 3.9 + 0.75;
17 knob_behind_across = 12.2 + 0.75;
37 bank_eps_bbox_x = [149, 598];
38 bank_eps_bbox_y = [274, 1452];
40 bank_y_sz = 102.25 + 0.50 + 3.2;
41 bank_x_sz = (26.0 + 0.5);
47 retainer_walls = [18, 30];
49 bank_profile_scale_bodge = 1.0;
51 bank_input_ctr = [ 12.5, 11.5 ]; // from nearest corner
52 bank_input_sz = [ 8.5, 10.5 ];
54 mounted_pos_y_offset = 20;
63 straps_y = [ -bank_y_sz * 0.25,
66 screw_head_behind = main_th;
69 bank_recess_dx = minor_wall_min;
71 pspt_to_mm = 25.4 / 72;
73 main_r = tube_dia/2 + main_th;
75 screw_max_y_lhs = -main_r -screw_nut_across/2;
76 screw_max_y_rhs = -main_r -knob_behind_across/2;
78 screw_y = min(screw_max_y_lhs,
81 bot_y = screw_y -max( screw_nut_across, knob_behind_across/2 )
84 holder_x_sz = bank_x_sz + bank_recess_dx*2;
85 bank_bot_y = strap_above + strap_th;
88 brace_total_len = brace_len + main_th;
89 brace_ctrs_y = [ straps_y[0] - (brace_r + strap_r/2),
90 straps_y[1] + (brace_r + strap_r/2) ];
92 clamp_width_actual = max(clamp_min_width, holder_x_sz);
94 hinge_lobes = floor(clamp_width_actual / hinge_lobe_per);
95 hinge_stride = (clamp_width_actual + hinge_gap_z) / hinge_lobes;
97 hinge_outer_r = hinge_around + hinge_pin/2;
98 hinge_y = tube_dia/2 + hinge_outer_r;
102 module TubePlan(){ circle(r = tube_dia/2); }
103 module HingePinPlan(){ translate([0, hinge_y]) circle(r= hinge_pin/2); }
104 module HingeBodyPlan(){ translate([0, hinge_y]) circle(r= hinge_outer_r); }
106 module TubeClampLeftPlan(){
109 polygon([[ 0, hinge_y + hinge_outer_r ],
110 [ -(main_r + overlap_l), hinge_y + hinge_outer_r ],
111 [ -(main_r + overlap_l), bot_y ],
112 [ -clamp_gap/2, bot_y ],
113 [ -clamp_gap/2, 0, ],
123 module TubeClampLeft() { ////toplevel
124 linextr(-clamp_width_actual/2, clamp_width_actual/2)
128 module TubeClampRightPlan(){
131 rectfromto([ clamp_gap/2, bot_y ],
132 [ clamp_gap/2 + behind_knob_th, 0 ]);
138 rectfromto([ clamp_gap/2, main_r*5 ],
150 linextr_x_yz(-main_r*5, main_r*5)
151 translate([screw_y, 0])
154 translate([0, screw_y, 0]) {
155 linextr_x_yz(-(clamp_gap/2 + screw_nut_th), 0)
156 square([screw_nut_across,
157 screw_nut_across / cos(30) + bridge_slop*2],
161 -(clamp_gap/2 + screw_nut_th + screw_head_behind))
162 square([screw_head, screw_head + bridge_slop*2],
167 module SomeClamp(hinge_alt=false){
169 linextr(-clamp_width_actual/2, clamp_width_actual/2)
174 for (i=[0 : hinge_lobes-1]) {
177 -clamp_width_actual/2 + i * hinge_stride
178 + (hinge_alt ? hinge_stride/2 : 0)
180 linextr(-hinge_gap_z, hinge_stride/2)
181 square(hinge_outer_r*2 + hinge_gap_xy, center=true);
186 module PowerBankItselfSidePlan(){
187 translate([0, bank_bot_y]){
189 circle($fn=8, r=liner_th);
190 scale( bank_profile_scale_bodge *
195 translate(pspt_to_mm *
196 [-0.5 * (bank_eps_bbox_x[0] +
198 -bank_eps_bbox_y[0]])
199 import("powerbank-anker-10000.dxf", convexity=5);
204 module PowerBankItself(){ ////toplevel
206 linextr_y_xz(-bank_y_sz/2,
208 PowerBankItselfSidePlan();
211 module PowerBankSidePlan(){ ////toplevel
212 render() difference(){
213 rectfromto([ -holder_x_sz/2, 0 ],
214 [ +holder_x_sz/2, bank_recess_y + bank_bot_y ]);
216 PowerBankItselfSidePlan();
220 module PowerBankStrapCut(){ ////toplevel
222 rectfromto([ -holder_x_sz, -0.05 ],
223 [ +holder_x_sz, strap_th + strap_r ]);
226 translate([sx * (holder_x_sz/2 - strap_r + 0.1),
234 module PowerBankHolderTest(){ ////toplevel
236 linextr(-1,5) PowerBankSidePlan();
237 linextr(0, strap_th) PowerBankStrapCut();
241 module EndRetainer(depth){ ////toplevel
242 translate([0, -bank_y_sz/2, 0]) {
243 linextr_y_xz(-endwall_th, 0)
244 rectfromto([ 0, -holder_x_sz/2 ],
245 [ -depth, +holder_x_sz/2 ]);
249 linextr(-holder_x_sz/2, -bank_x_sz/2){
251 rectfromto([ 0, -endwall_th ],
262 module BraceTubePlan(){
265 rectfromto(brace_r * [-2, 0],
270 module PowerBankHolder(){ ////toplevel
274 linextr_y_xz(-(bank_y_sz/2 + 0.1),
275 +(bank_y_sz/2 + 0.1))
278 EndRetainer(retainer_walls[0]);
279 mirror([0,1,0]) EndRetainer(retainer_walls[1]);
282 for (strap_y = straps_y)
283 translate([0, strap_y, 0])
290 translate([ bank_bot_y, -bank_y_sz/2, -bank_x_sz/2 ])
293 translate(bank_input_ctr)
294 square(center=true, bank_input_sz);
297 translate([0,0, bank_x_sz/2]){
298 for (y = brace_ctrs_y) {
300 linextr_x_yz(0, brace_total_len)
304 translate([brace_total_len, 0,0])
305 linextr_y_xz(brace_ctrs_y[0] - brace_r,
306 brace_ctrs_y[1] + brace_r)
311 module TubeClampLeft() { ////toplevel
312 // We want this to print with the recess overhand to the right
313 // where the workpiece cooling fan is
324 module PlacePowerBank(){
325 translate([main_r, -mounted_pos_y_offset, 0])
329 module Main(){ ////toplevel
339 module TubeClampRight() { ////toplevel
343 TubeClampRightPlan();
346 module TubeClampDemo() { ////toplevel
352 module Demo() { ////toplevel