//This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. //2015 - B.E. Morgan /* The vertical_hinge_negative() module is the negative space of a hinge that can be printed vertically with an FDM 3D printer. You should add a hinge to your shape with something like this: difference() { your_shape(); vertical_hinge_negative(); } The inside of the hinge is constructed with small supports that hold up the next section of the hinge as it is printed. These supports are easily broken after the part is printed and the hinge rotates freely. */ /*Test Hinges*/ //hinge_test_1(); //hinge_test_1_cross_section(); //hinge_test_2(); //hinge_test_3(); //a simple 180 degree hinge with a 270 degree range module hinge_test_1() { difference() { translate([-20,-5,0]) cube(size=[40,10,30]); vertical_hinge_negative($fn=60); } } //a cross-section of hinge_test_1 to show inner structure module hinge_test_1_cross_section() { intersection() { translate([-20,0,0]) cube(size=[40,5,30]); hinge_test_1(); } } //a hinge printed at 90 degrees with a 180 degree range module hinge_test_2() { difference() { //90 degree test piece union() { cylinder(r=3,h=21,$fn=60); for(x=[0,90]) rotate(x) translate([0,-3,0]) cube([15,6,21]); } vertical_hinge_negative(r1=3,r2=10,height=7,n=3,theta0=90,theta1=90,theta2=90,$fn=60); } } //a hinge printed at A degrees that can form a B degree internal angle when //turned one way and a C degree internal angle when turned the other way module hinge_test_3() { A=77; B=65; C=42; difference() { //test piece with an A degree angle union() { cylinder(r=3.2,h=21,$fn=60); for(x=[0,A]) rotate(x) translate([0,-3.2,0]) cube([15,6.6,21]); } vertical_hinge_negative(r1=3.2,r2=22,height=7,n=3,theta0=A,theta1=B,theta2=C,$fn=60); } } /* * tol - the smallest distance allowable between interlocking parts of your 3d printer. This gap is the vertical (and horizontal) distance between the cones inside the hinge and is also the diameter and height of the small support structure between hinge elements * r1 - the outer radius of the hinge. the surface of your part should not be farther away from the center of the hinge than this disntace. * r2 - the furthest radius from the hinge where material is removed from the part. * height - the height of each hinge element. The total height of the hinge is n*height. (the cut will extent beyond this distance by height/2 on both sides. The part where you are creating the hinge should have a height of n*height) the height must be greater than 2*r1 * n - the number of hinge elements. One hinge element is divided between the top and bottom. * theta0 - the angle at which the hinge is printed * theta1 - the internal angle formed when the hinge is turned to its limit in one direction (the x- part of the hinge_test_1 example when rotated clockwise as viewed from above) * theta2 - the internal angle formed when the hinge is turned to its limit in the opposite direction */ module vertical_hinge_negative(tol=0.5,r1=5,r2=15,height=15,n=2,theta0=180,theta1=45,theta2=45) { arm_width=2*r1; union() { for(i=[0:n]) translate([0,0,(i-0.5)*height]) difference() { //cone between hinges and cuts around the hinge rotate_extrude() polygon([[r1,0],[r1,height],[tol/2,height-r1+tol/2], [tol/2,height-r1+1.5*tol],[r1,height+tol], [r2,height+tol],[r2,0]]); //exclude a rectangular shape for the arm the connects the hinge to the body rotate((i%2)*theta0) difference() { translate([0,-arm_width/2,-height]) cube(size=[r2*2,arm_width,height*2]); translate([0,0,height-r1]) cylinder(r1=0,r2=height,h=height); } //exclude a triangular shape that limits the motion of the arms on the side of the hinge for(i=[0,1]) mirror([0,i,0]) rotate(-i*theta0) translate([0,0,-tol]) linear_extrude(height=height+3*tol) intersection() { circle(r=2*r2); rotate(theta0+180+theta2) translate([0,r2*3+arm_width/2+tol]) square(size=[r2*6,r2*6],center=true); rotate(theta0-theta1) translate([0,r2*3+arm_width/2+tol]) square(size=[r2*6,r2*6],center=true); rotate(theta0) translate([r2*3,0]) square(size=[r2*6,r2*6],center=true); } } } }