// all units are in inches bar_dims = [1.228, 0.228, 0.184]; bump_thickness = 0.01; $fn = $preview ? 32 : 64; // hole/peg dimensions peg_od = 0.1315; hole_id = 0.107; peg_id = 0.091; // 0.005 larger than #2-56 nominal diameter peg_height = 0.405 - bar_dims[2]; peg_fullheight = 0.245 - bar_dims[2]; // height of the full circle wrap around. function mm_to_in(mm) = 0.03937 * mm; insert_diameter = mm_to_in(3.2); // 3.2mm (d3 for #2-56 inserts) insert_length = mm_to_in(5.0); notch_height = 0.108; // height from top of bar to bottom of notch notch_thickness = 0.0380 - 0.0190; // how far the notch goes from the outer edge. module peg_notch() { // The peg notch is the notch that is used to hold the nut bar to the board. base_thick = 0.01; rotate([180, -90,0]) linear_extrude(0.054, center = true) polygon([ [0,0], [0,base_thick], [0,notch_thickness + base_thick], [0.1,base_thick], [0.1,0] ]); } module nutbar_peg() { difference() { union() { // cube translate([0,0, bump_thickness/2]) cube([bar_dims[1], bar_dims[1], bar_dims[2] + bump_thickness], center = true); // peg portion translate([0,0,bump_thickness + bar_dims[2]/2]) union() { translate([0,- peg_od / 2 + 0.01, 0.1]) peg_notch(); difference() { cylinder(h = peg_height, d = peg_od); union() { translate([0,0,-0.01]) cylinder(h = peg_height+0.02, d = peg_id); translate([0,0,peg_fullheight]) cube([1,1,1]); }; }; } // }; union() { // threaded insert hole translate([0,0,-1 * bar_dims[2]]) cylinder(h = insert_length + 0.01, d = insert_diameter); cylinder(h = bar_dims[2] + 1, d = peg_id, center = true); }; }; } // create the cross bar bit cube([bar_dims[0] - 2 * bar_dims[1], bar_dims[1], bar_dims[2]], center=true); translate([bar_dims[0]/2 - 0.5 * bar_dims[1], 0, 0]) rotate([0,0,90]) nutbar_peg(); translate([-1 * (bar_dims[0]/2 - 0.5 * bar_dims[1]), 0, 0]) rotate([0,0,-90]) nutbar_peg();