Skip to content

Instantly share code, notes, and snippets.

@Stemer114
Created February 22, 2015 19:55
Show Gist options
  • Save Stemer114/1bdd988cf6011fef00e7 to your computer and use it in GitHub Desktop.
Save Stemer114/1bdd988cf6011fef00e7 to your computer and use it in GitHub Desktop.
openscad modules for tribeams (rectangular beams with triangular support underneath, for overhanging printing)
/* beam with triangular support underneath,
* length direction is x
* beam dimensions are w, h1
* support (triangle) height is h2
* the beam is centered around the center of the rectangle
*/
module tribeam_x(
w = 10, //width
h1 = 10, //height of rectangular sub-beam
h2 = 5, //height of triangular sub-beam
l = 100 //length of beam
)
{
rotate([0, 90, 0])
rotate([0, 0, 90])
tribeam_z(w, h1, h2, l);
}
// same as tribeam_x, but length direction along y-axis
module tribeam_y(
w = 10, //width
h1 = 10, //height of rectangular sub-beam
h2 = 5, //height of triangular sub-beam
l = 100 //length of beam
)
{
rotate([0, 0, 180])
rotate([90, 0, 0])
tribeam_z(w, h1, h2, l);
}
// base tribeam (extruded in z-direction)
module tribeam_z (
w = 10, //width
h1 = 10, //height of rectangular sub-beam
h2 = 5, //height of triangular sub-beam
l = 100 //length of beam
)
{
translate([-w/2, h1/2, 0])
linear_extrude( height=l ) {
polygon(
points=[[0,0], [w,0], [w, -h1], [w/2, -h1-h2], [0, -h1] ],
paths = [[0, 1, 2, 3, 4]]
);
}
}
// *** TEST ***
//tribeam_x();
//tribeam_y();
//tribeam_z();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment