cases = [ //Case,thickness+~0.2,Distance between parts,tape width ["0603",1,4,8], ["1206",1.4,4,8], ["SOD80",1.7,4,8] ]; //Selected Package selected_part_size = "SOD80"; // [ "0603","1206","SOD80"] //Amount of parts to be stored parts = 1000; //amount of parts in //Inner Diameter of filled storage inner_diameter=16; /* [Hidden] */ function selector(item) = cases[search([item], cases)[0]]; active_case = selector(selected_part_size); tape_thickness = active_case[1]; distance_between_parts = active_case[2]; total_distance = parts*distance_between_parts; tape_width= active_case[3]; part_width=tape_width+2.4; $fa = 1; $fs = 0.5; outerdiameter=ceil(sqrt(4*tape_thickness*total_distance/(3.1415)+inner_diameter*inner_diameter)); boxdim=outerdiameter+10; echo(str("Outer Diameter: ",str(outerdiameter))); boxdimhalf = boxdim/2; offset_insert_view=-boxdimhalf-0.001+(boxdimhalf-outerdiameter/2+tape_thickness*1.2/2); difference() { color("grey")cube([boxdim,boxdim,part_width],center=true); translate([0,0,-tape_width/2]){ linear_extrude(part_width-0.001){ circle(d=outerdiameter); } } translate([offset_insert_view,-boxdimhalf,1]) cube([tape_thickness*1.2,boxdim,part_width-0.4],center=true); //Tape inlet translate([-boxdimhalf,-0.75*boxdimhalf,0])cube([(boxdimhalf-outerdiameter/2)*2+tape_thickness*0.6+0.001,10,tape_width],center=true); //viewing window translate([boxdimhalf-8,-boxdimhalf+2,0])rotate([0,0,30]) cube([8,10,tape_width+4],center=true); //Retention space for front magazine clip translate([boxdimhalf-3,boxdimhalf-3,0])rotate([0,0,30]) cube([8,30,tape_width+4],center=true); translate([boxdimhalf+2,boxdimhalf-6,0])rotate([0,0,80]) cube([8,30,tape_width+4],center=true); translate([boxdimhalf+1.5,boxdimhalf-3.3,0])cube([30,8,tape_width+4],center=true); } translate([offset_insert_view+tape_thickness*1.2*0.999,-20,0.001]) color("grey")cube([tape_thickness*1.2,boxdimhalf+3.001-17,part_width],center=true); // Merge plate near inlet difference(){ //retention spring translate([0,boxdimhalf+2,0])color("grey") rotate([0,0,90]) cube([10,5,part_width+0.001],center=true); translate([-3.85,boxdimhalf+1.5,-part_width/2-0.5]) linear_extrude(part_width+1){ circle(d=4); } translate([3.85,boxdimhalf+1.5,-part_width/2-0.5]) linear_extrude(part_width+1){ circle(d=4); } } difference(){ //Retention Clip with Spring translate([0,boxdimhalf+6,0]) color("grey")cube([boxdim,6,part_width],center=true); translate([-boxdimhalf+10,boxdimhalf+2,0]) rotate([0,0,-8])cube([boxdimhalf,6,tape_width+3],center=true); translate([boxdimhalf+2.5,boxdimhalf+4,0])rotate([0,0,-15]) cube([8,20,part_width+2],center=true); } difference(){//Retention Clip with Spring translate([boxdimhalf,boxdimhalf+4,0]) color("grey")cube([10,10,part_width],center=true); translate([boxdimhalf+2.5,boxdimhalf+4,0])rotate([0,0,-15]) cube([8,20,part_width+2],center=true); }