DIY_3D_Printer/horizontal_angle_bracket.scad

98 lines
2.7 KiB
OpenSCAD
Raw Normal View History

$fn = 33;
height = 40;
hwidth = 40;
thickness = 5;
vthickness = 20;
vwidth = 40.3;
vheight = 80;
2021-01-01 10:29:46 +00:00
//https://de.wikipedia.org/wiki/Durchgangsbohrung
M4HoleDiam = 4.4;
holedistance = 10;
horizontalcenterholes = true;
// calling main
horizontal_angle_bracket();
module horizontal_angle_bracket() {
render() difference() {
frame();
holes();
}
}
module frame() {
// left tile
cube([hwidth, thickness, height]);
translate([0, thickness, 0]) sidetriangle();
translate([0, thickness, height - thickness]) sidetriangle();
// left to back tile
translate([hwidth, 0, 0]) cube([thickness, vthickness, height]);
// left triangle
translate([hwidth, 0, height]) rotate([90, 0, 90]) middletriangle();
// covers upper edge of above
translate([hwidth, vthickness, 0]) cube([vwidth + thickness * 2, thickness, vheight]);
// right to back tile
translate([hwidth + vwidth + thickness, 0, 0]) cube([thickness, vthickness, height]);
// right triangle
translate([hwidth + vwidth + thickness, 0, height]) rotate([90, 0, 90]) middletriangle();
// right tile
translate([hwidth + vwidth + thickness * 2, 0, 0]) cube([hwidth, thickness, height]);
translate([hwidth * 2 + vwidth + thickness * 2, thickness, thickness]) rotate([0, 180, 0]) sidetriangle();
translate([hwidth * 2 + vwidth + thickness * 2, thickness, height]) rotate([0, 180, 0]) sidetriangle();
}
module middletriangle() {
linear_extrude(thickness) polygon([[0, 0], [vthickness, 0], [vthickness, vheight - height]]);
}
module sidetriangle() {
linear_extrude(5) polygon([[0, 0], [hwidth, 0], [hwidth, vthickness]]);
}
module holes() {
// left holes
leftholes();
// right holes
translate([hwidth + vwidth + thickness * 2, 0, 0]) leftholes();
// center holes
translate([hwidth + thickness, vthickness, 0]) centerholes();
}
module leftholes() {
translate([holedistance, 0, holedistance]) XM3Hole();
translate([hwidth - holedistance, 0, holedistance]) XM3Hole();
translate([holedistance, 0, height - holedistance]) XM3Hole();
translate([hwidth - holedistance, 0, height - holedistance]) XM3Hole();
}
module centerholes() {
translate([holedistance, 0, holedistance]) XM3Hole();
translate([vwidth - holedistance, 0, holedistance]) XM3Hole();
translate([holedistance, 0, vheight - holedistance]) XM3Hole();
translate([vwidth - holedistance, 0, vheight - holedistance]) XM3Hole();
if (horizontalcenterholes) {
// center holes
translate([vwidth - holedistance, 0, vheight / 2]) XM3Hole();
translate([holedistance, 0, vheight / 2]) XM3Hole();
}
}
module XM3Hole() {
rotate([270, 0, 0])cylinder(h = thickness, d = M4HoleDiam);
}