/* Author: George W Childs, Email: georgew.childs@gmail.com Date 10/15/2012 Contributors: Licensing GPL V3 (http://www.gnu.org/licenses/quick-guide-gplv3.html). Barbell-Style PSU Prusa Mount for my MakerGear Prusa Mendel 3D Printer With the mirror([1,0,0]) line commented out, this prints for the left-rear of the usual Prusa Mendel printer. Uncomment this line in order to print for the right-rear. */ // Smoothing parameter $fn=140; smoother = 12; // Locating the Barbell centerpoints RTX = 69.0; RTY = 49; LBX = -3.0; LBY = 0.0; RBY = 64.0; RBX = -26.5; RADB = 8; // Baseline Barbell Radius RADN = 4; // Center Barbell Radius // Different Barbell Sizes LNRN = 45; LNRO = 50; LNRP = 65; LNRQ = 100; LNRT = 120; LNRB = 150; LNRC = 190; /* Uncomment this mirror line below in order to print the RHS rear mount. */ // mirror([1,0,0]) buildit(); module buildit(){ // Crisscross support pattern of Barbells translate([35,10,0]) linear_extrude(height=5)barbell([5.5,39],[RBX,RBY],RADN,RADB+.5,LNRN,LNRN); translate([12,10,0]) linear_extrude(height=5)barbell([28.5,39],[RTX,RTY],RADN,RADB,LNRO,LNRO); translate([12,10,0]) linear_extrude(height=5)barbell([28.5,39],[LBX,LBY],RADN,RADB+1,LNRP,LNRP); translate([35,10,0]) linear_extrude(height=5)barbell([5.5,39],[46.0,0],RADN,RADB,LNRQ,LNRQ); // Positioning the 'vertical' supports SRBY = 35.0; SRBX = -19.0; // Positioning the 'back' supports TRBY = 0.0; TRBX = -14.0; URBY = 81.0; URBX = 8.0; VRBY = 10.7; VRBX = 10.3; holes_size = 2.45; // Radius holes_size_outter = 2.75; // Radius holes_support = 11; /* Vertical supports from base */ rotate([0,-90,0]) translate([27,10,-5.0]) linear_extrude(height=5)barbell([48.0,-2.5],[SRBX,SRBY],RADB-.51,RADB,LNRB,LNRB); rotate([0,-90,0]) translate([27,10,-89.5]) linear_extrude(height=5)barbell([48.0,-2.5],[SRBX,SRBY],RADB-.51,RADB,LNRB,LNRB); difference(){ union(){ rotate([-90,-90,0]) translate([25,10,0]) linear_extrude(height=5)barbell([48.0,0],[TRBX,TRBY],RADB,RADB,LNRB,LNRB); rotate([-90,-90,0]) translate([0,0,0]) linear_extrude(height=5)barbell([73.0,10],[URBX,URBY],RADB,RADB,LNRC,LNRC); rotate([-90,-90,0]) translate([0,0,0]) linear_extrude(height=5)barbell([73.0,81],[VRBX,VRBY],RADB,RADB-1.0,LNRC,LNRC); // "roundedboxed" edge braces // planar translate([2.5,39,2.5]) roundedBox([5,75,5],2,true); translate([87.0,35,2.5]) roundedBox([5,70,5],2,true); // vertical - unused due to other supports // translate([2.5,2.5,72]) roundedBox([5,5,10-.5],2,true); // translate([87.0,2.5,41]) roundedBox([5,5,82-.5],2,true); // back brace lower translate([44,2.5,2.5]) roundedBox([88,5,5],2,true); // back brace top - unused for better build without support // translate([45,2.5,79]) roundedBox([89.0,5,6-.5],2,true); // vertical translate([87.0,2.5,41]) rotate([-90,0,0]) roundedBox([5,81.5,5],2,true); translate([2.5,2.5,77.0]) rotate([-90,0,0]) roundedBox([5,9,5],2,true); } // subtract out screw holes for PSU rotate([-90,-90,0]) translate([74.0,10,0]) cylinder(r=holes_size,h=holes_support+1, $fn=20); rotate([-90,-90,0]) translate([10.0,10,0]) cylinder(r=holes_size,h=holes_support+1, $fn=20); // and rim for socket bolt head rotate([-90,-90,0]) translate([74.0,10,3.5]) cylinder(r=2*holes_size,h=3, $fn=20); rotate([-90,-90,0]) translate([10.0,10,3.5]) cylinder(r=2*holes_size,h=3, $fn=20); } // Used for testing //translate([12,10,4]) linear_extrude(height=4)barbell([RTX,RTY],[LBX,LBY],RADB,RADB+1,LNRT,LNRT); // Measurment Box //translate([0,-5,10]) cube([4,4,64]); // Length and width of M8 Attachments LNHL = 25900; // 'Top' attachment hole and support for mount difference(){ translate([35,4,0]) linear_extrude(height=5)barbell([23,15],[-3.9,15],11.0,11.0,LNHL,LNHL); translate([35,4,0]) linear_extrude(height=5)barbell([23,15],[-3.9,15],4.2,4.2,LNHL,LNHL); }; // 'Bottom' attachment hole and support for mount difference(){ translate([29.5,5,0]) linear_extrude(height=5)barbell([18,65],[48.35,65],11.75,11.75,LNHL,LNHL); translate([29.5,5,0]) linear_extrude(height=5)barbell([18,65],[45,65],4.2,4.2,LNHL,LNHL); }; } module barbell (x1,x2,r1,r2,r3,r4) { x3=triangulate (x1,x2,r1+r3,r2+r3); x4=triangulate (x2,x1,r2+r4,r1+r4); render() difference () { union() { translate(x1) circle (r=r1); translate(x2) circle(r=r2); polygon (points=[x1,x3,x2,x4]); } translate(x3) circle(r=r3,$fa=5); translate(x4) circle(r=r4,$fa=5); } } function triangulate (point1, point2, length1, length2) = point1 + length1*rotated( atan2(point2[1]-point1[1],point2[0]-point1[0])+ angle(distance(point1,point2),length1,length2)); function distance(point1,point2)= sqrt((point1[0]-point2[0])*(point1[0]-point2[0])+ (point1[1]-point2[1])*(point1[1]-point2[1])); function angle(a,b,c) = acos((a*a+b*b-c*c)/(2*a*b)); function rotated(a)=[cos(a),sin(a),0]; module roundedBox(size, radius, sidesonly) { rot = [ [0,0,0], [90,0,90], [90,90,0] ]; if (sidesonly) { cube(size - [2*radius,0,0], true); cube(size - [0,2*radius,0], true); for (x = [radius-size[0]/2, -radius+size[0]/2], y = [radius-size[1]/2, -radius+size[1]/2]) { translate([x,y,0]) cylinder(r=radius, h=size[2], $fn=smoother/2, center=true); } } else { cube([size[0], size[1]-radius*2, size[2]-radius*2], center=true); cube([size[0]-radius*2, size[1], size[2]-radius*2], center=true); cube([size[0]-radius*2, size[1]-radius*2, size[2]], center=true); for (axis = [0:2]) { for (x = [radius-size[axis]/2, -radius+size[axis]/2], y = [radius-size[(axis+1)%3]/2, -radius+size[(axis+1)%3]/2]) { rotate(rot[axis]) translate([x,y,0]) cylinder(h=size[(axis+2)%3]-2*radius, r=radius, $fn=smoother/2, center=true); } } for (x = [radius-size[0]/2, -radius+size[0]/2], y = [radius-size[1]/2, -radius+size[1]/2], z = [radius-size[2]/2, -radius+size[2]/2]) { translate([x,y,z]) sphere(radius, $fn=smoother/2); } } } //translate([-15,0,0])roundedBox([10,30,40], 5, true); //translate([15,0,0]) roundedBox([20,30,40], 5, false);