+ Screws();
+
+ for (i=[0 : hinge_lobes-1]) {
+ translate([0,
+ hinge_y,
+ -clamp_width_actual/2 + i * hinge_stride
+ + (hinge_alt ? hinge_stride/2 : 0)
+ ])
+ linextr(-hinge_gap_z, hinge_stride/2)
+ square(hinge_outer_r*2 + hinge_gap_xy, center=true);
+ }
+ }
+}
+
+module PowerBankItselfSidePlan(){
+ translate([0, bank_bot_y]){
+ minkowski(){
+ circle($fn=8, r=liner_th);
+ scale( bank_profile_scale_bodge *
+ bank_x_sz / ( (
+ bank_eps_bbox_x[1] -
+ bank_eps_bbox_x[0]
+ ) * pspt_to_mm ))
+ translate(pspt_to_mm *
+ [-0.5 * (bank_eps_bbox_x[0] +
+ bank_eps_bbox_x[1]),
+ -bank_eps_bbox_y[0]])
+ import("powerbank-anker-10000.dxf", convexity=5);
+ }
+ }
+}
+
+module PowerBankItself(){ ////toplevel
+ rotate([0,90,0])
+ linextr_y_xz(-bank_y_sz/2,
+ +bank_y_sz/2)
+ PowerBankItselfSidePlan();
+}
+
+module PowerBankSidePlan(){ ////toplevel
+ render() difference(){
+ rectfromto([ -holder_x_sz/2, 0 ],
+ [ +holder_x_sz/2, bank_recess_y + bank_bot_y ]);
+
+ PowerBankItselfSidePlan();
+ }
+}
+
+module PowerBankStrapCut(){ ////toplevel
+ difference(){
+ rectfromto([ -holder_x_sz, -0.05 ],
+ [ +holder_x_sz, strap_th + strap_r ]);
+ hull(){
+ for (sx=[-1,+1]) {
+ translate([sx * (holder_x_sz/2 - strap_r + 0.1),
+ strap_th + strap_r])
+ circle(strap_r);
+ }
+ }
+ }
+}
+
+module PowerBankHolderTest(){ ////toplevel
+ difference(){
+ linextr(-1,5) PowerBankSidePlan();
+ linextr(0, strap_w) PowerBankStrapCut();
+ }
+}
+
+module EndRetainer(depth){ ////toplevel
+ translate([0, -bank_y_sz/2, 0]) {
+ linextr_y_xz(-endwall_th, 0)
+ rectfromto([ 0, -holder_x_sz/2 ],
+ [ -depth, +holder_x_sz/2 ]);
+
+ for (m=[0,1]) {
+ mirror([0,0,m]) {
+ linextr(-holder_x_sz/2, -bank_x_sz/2){
+ hull(){
+ rectfromto([ 0, -endwall_th ],
+ [ depth, 0 ]);
+ rectfromto([ 0, 0 ],
+ [ 0.1, depth-0.1 ]);
+ }
+ }
+ }
+ }
+ }
+}
+
+module BraceTubePlan(){
+ intersection(){
+ circle(r= brace_r);
+ rectfromto(brace_r * [-2, 0],
+ brace_r * [+2, +2]);
+ }
+}
+
+module PowerBankHolder(){ ////toplevel
+ difference(){
+ union(){
+ rotate([0,90,0])
+ linextr_y_xz(-(bank_y_sz/2 + 0.1),
+ +(bank_y_sz/2 + 0.1))
+ PowerBankSidePlan();
+
+ EndRetainer(retainer_walls[0]);
+ mirror([0,1,0]) EndRetainer(retainer_walls[1]);
+
+ translate([0,0, bank_x_sz/2]){
+ for (y = brace_ctrs_y) {
+ translate([0,y,0]) {
+ linextr_x_yz(0, brace_total_len)
+ BraceTubePlan();
+ }
+ }
+ translate([brace_total_len, 0,0])
+ linextr_y_xz(brace_ctrs_y_nom[0] - brace_r,
+ brace_ctrs_y_nom[1] + brace_r)
+ BraceTubePlan();
+ }
+
+ for (strap_y = straps_y + straps_y_adj) {
+ translate([0, strap_y, 0]) {
+ linextr(-holder_x_sz/2,
+ +holder_x_sz/2){
+ hull(){
+ for (dy = [-1,+1] *
+ (strap_w/2 + strap_around_attach - strap_around_over)) {
+ translate([0, dy, 0])
+ circle(r=strap_around_over);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ for (strap_y = straps_y + straps_y_adj)
+ translate([0, strap_y, 0])
+ rotate([0,0,-90])
+ rotate([0,90,0])
+ linextr(-strap_w/2,
+ +strap_w/2)
+ PowerBankStrapCut();
+
+ translate([ bank_bot_y, -bank_y_sz/2, -bank_x_sz/2 ])
+ linextr_y_xz(-50,50)
+ rotate([0,0,90])
+ translate(bank_output_ctr)
+ square(center=true, bank_output_sz);
+
+ translate([0, -(bank_y_sz/2 + endwall_th), 0] + 0.01 * [-1,-1]) {
+ linextr(-200,200){
+ difference(){
+ square(center=true, top_cnr_r*2);
+ translate(top_cnr_r * [1,1])
+ circle(r= top_cnr_r);
+ }
+ }
+ }