/* The volt 2016 portable charger is smaller and has no way to be attached or hook to something. It has some slides/hook on the back. So this is the project. A handle to suspend it somewhere plus a support for the wire. */ use <../cadlib.h> // allviews hook handle // printviews hook,handle:h50 // viewsopts h2 // testviews testhook assembly // viewsopts h2 fill80 include // Key dimensions len=100; width=10; thick=4; thick2=2; thick3=4; tongl=10; module hook(){ path=[[len/2-tongl,0],[len,0],[len,thick],[len/2,thick],[len/2,thick+thick2], [len/2+tongl,thick+thick2],[len/2+tongl,thick+thick2+thick3], [0,thick+thick2+thick3],[0,thick+2], [len/2-tongl,thick+2],[len/2-tongl,0]]; difference(){ union(){ linear_extrude(width) polygon(path); translate([len/2+10,-18.5,0]) 3darc(23,5,width,90,90+190,30); translate([0,thick+3,0]) rotate([0,0,-43]) cube([65,thick,width]); } union(){ translate([len-8,0,width/2]) rotate([-90,0,0])cylinder(r=2,h=thick+2); if (false){ translate([len-25,0,width/2]) rotate([-90,0,0])cylinder(r=2,h=thick+2); translate([len/2+2*tongl,0,width/2]) rotate([-90,0,0])cylinder(r=2,h=thick+2); } } } } module testhook(){ cubex=tongl*2+13; cubey=thick+thick2+thick3; intersection(){ hook(); translate([len/2-10,0,0]) cube([cubex,cubey,width]); } } module handle(){ len=44; thick2=thick+2; width2=width+2; difference(){ union(){ off=14; translate([0,-width/2,0]) cube([off,width,thick]); translate([off,-width2/2,0]) cube([len-off,width2,thick2]); } union(){ translate([len-20,0,-1]) cylinder(r=2,h=thick2+2,$fn=20); //translate([len-30,0,0]) cylinder(r=2,h=thick); } } translate([len+20-4,0,7/2]){ if (false){ difference(){ cylinder(r=22,h=4,$fn=40); cylinder(r=15,h=4,$fn=40); } }else{ donut(18,7,40); } } } module main_view(view){ if (view == "hook"){ hook(); }else if (view == "testhook"){ testhook(); }else if (view == "handle"){ handle(); }else if (view == "assembly"){ translate([63,10,width/2]) rotate ([90,0,0]) handle(); hook(); } }