$fn=100; W=10; translate([0,0,-W])cube([107+4,80+4,W]); difference() { cube([107+4,80+4,4+2]); translate([2,2,2])cube([107,80,10]); } difference() { translate([0,80+2,4])cube([107+4,2,8]); translate([(107+4)/2-12,78+1,4])cube([24,10,10]); } translate([0,0,4])cube([2,78+4,8]); translate([107+2,0,4])cube([2,78+4,8]); translate([-14,41,-W]) Steun(); translate([125,41+14,-W]) rotate([0,0,180])Steun(); // Zijsteun module Steun() { difference() { cube([14,14,3]); translate([6,7,-1])cylinder(d=4,h=10); } translate([5,14,2])rotate([90,0,0]) wedge(45,10,14,2); translate([5,2,2])rotate([90,0,0]) wedge(45,10,14,2); } // Title: Wedge Triangle Module // Author: Carlo Wood // Y-axis // | // | /\ // leg2 --/ \ // |/ \ // /)_____\_______X-axis // angle--' \__ leg1 // module wedge(angle, leg1, leg2, height = 0.5) { // Store the length of all three sides in an array. side = [sqrt(leg1 * leg1 + leg2 * leg2 - 2 * leg1 * leg2 * cos(angle)), // Law of Cosines. leg1, leg2]; i = (leg2 > leg1) ? 2 : 1; longest_leg = side[i]; longest_side = (side[0] > longest_leg) ? side[0] : longest_leg; // The corner opposite of the shortest leg must be less than 90 degrees. sa = asin(side[3 - i] * sin(angle) / side[0]); // Law of Sines. sb = 180 - angle - sa; // Sum of all angles is 180 degrees. // Store the size of all three angles in an array. a = [angle, (i == 1) ? sb : sa, (i == 1) ? sa : sb]; // Is there anything to draw at all? if (angle > 0 && angle < 180) { intersection() { if (angle <= 90) intersection() { cube([longest_leg, longest_leg, height]); rotate([0, 0, angle - 90]) cube([longest_leg, longest_leg, height]); } else union() { cube([longest_leg, longest_leg, height]); rotate([0, 0, angle - 90]) cube([longest_leg, longest_leg, height]); } if (a[2] < 90) { translate([leg1, 0, 0]) rotate([0, 0, 90 - a[2]]) translate([-longest_side, 0, 0]) cube([longest_side, longest_side, height]); } else { rotate([0, 0, angle]) translate([leg2, 0, 0]) rotate([0, 0, a[1]]) translate([-longest_side, 0, 0]) cube([longest_side, longest_side, height]); } } } } // Example: wedge(145, 10, 20, 5); // Would create a triangle with thickness 5 where two legs, // being 10 and 20 respectively, making an angle of 145 degrees, // the point on the z-axis and leg1 along the x-axis.