$fa = 0.1; $fs = 0.1; module mirrorkeep(m) { children(); mirror(m) children(); } module outline(short=false) { offset(-4) offset(4) { offset(6) offset(-6) if (short) { square([54, 23], center=true); } else { translate([0, 8]) square([54, 39], center=true); } offset(2) offset(-2) translate([0, -3]) square([23, 53], center=true); } } module holes_hinge() { mirrorkeep([1, 0]) translate([16, 0]) { children(); } } module holes_cupboard() { mirrorkeep([1, 0]) translate([16, 0]) { translate([0, 17]) { children(); } } } module ridge_2d() { difference() { offset(1.4) offset(-4) outline(true); offset(1.6) offset(-8) outline(true); translate([0, 39]) square(50, center=true); mirrorkeep([1, 0]) translate([16, 0]) { hull() mirrorkeep([1, 0]) translate([2, 0]) circle(d=7); } } } module ridge() { intersection() { scale([1, 1, 2.5]) { roof(convexity=10) ridge_2d(); } linear_extrude(height=2.5, convexity=8) outline(false); } } module tilt() { translate([0, 16, 0]) rotate([-2, 0, 0]) translate([0, -16, 0]) children(); } module fixment(thickness = 2.5) { intersection() { difference() { union() { linear_extrude(height=thickness-1, convexity=4) offset(1) outline(); tilt() { linear_extrude(height=thickness, convexity=4) difference() { offset(2) outline(); } translate([0, 0, thickness]) { ridge(); } translate([0, -11.9, 0]) cylinder(d=5.2, h=thickness + 1.5); } } tilt() holes_hinge() { cylinder(d=6.2, h=100, center=true); translate([0, 0, -0.5]) { cylinder(d2=6.2, d1=9.5, h=1); mirror([0, 0, 1]) { cylinder(d=9.5, h=10); } } } holes_cupboard() { hull() mirrorkeep([1, 0]) translate([1.5, 0]) cylinder(d=6, h=100, center=true); } } translate([0, 0, 50]) cube(100, center=true); } } module plate(thickness = 6) { translate([0, 0, 0]) { difference() { intersection() { //scale([1, 1, 2.5]) roof(convexity=4) difference() { linear_extrude(height=20, convexity=4) difference() { offset(10) outline(false); offset(1) offset(-1) offset(-1) offset(1) difference() { translate([0, 0.2]) offset(0.5) outline(true); mirrorkeep([1, 0]) translate([14, 23]) square(10, center=true); } } linear_extrude(height=thickness, convexity=8) offset(3) outline(false); } translate([0, 28, 11.2]) cube(17.99, center=true); holes_cupboard() { hull() mirrorkeep([1, 0]) translate([1.5, 0]) cylinder(d=6, h=100, center=true); } } } } //#import("hingeplate.stl"); linear_extrude(height=2) intersection() { projection() difference() { union() { plate(6); fixment(2.5); } translate([16, -14, -1]) cylinder(d=16, h=13); } translate([0, -50]) square(100); } module tool() { difference() { linear_extrude(height=14) offset(-0.25) difference() { outline(true); translate([0, 28]) square(31, center=true); translate([0, -28]) square(31, center=true); holes_hinge() circle(d=5.5); } translate([0, 0, 10]) linear_extrude(height=10) offset(0.5) ridge_2d(); //translate([0, 0, 10]) linear_extrude(height=10) offset(4) offset(-3) square([48, 17], center=true); translate([0, 0, 8]) linear_extrude(height=10) offset(3) offset(-3) square([24, 48], center=true); } } //tool();