Skip to content

Instantly share code, notes, and snippets.

@Stemer114
Last active August 29, 2015 14:15
Show Gist options
  • Save Stemer114/23e906d07f3db21ccbc6 to your computer and use it in GitHub Desktop.
Save Stemer114/23e906d07f3db21ccbc6 to your computer and use it in GitHub Desktop.
modules for beams (just long cubes, really, but axis-centered and parametric, therefore easy to use)
// beam with length in x direction
// it is centered along its central axis at the x axis
module beam_x(
wy = 10, //width
wz = 10, //height
l = 100 //length
)
{
translate([0, -wy/2, -wz/2])
cube([l, wy, wz]);
}
// beam with length in y direction
// it is centered along its central axis at the y axis
module beam_y(
wx = 10, //width
wz = 10, //height
l = 100 //length
)
{
translate([-wx/2, 0, -wz/2])
cube([wx, l, wz]);
}
// beam with length in z direction
// it is centered along its central axis at the z axis
module beam_z(
wx = 10, //width
wy = 10, //height
l = 100 //length
)
{
translate([-wx/2, -wy/2, 0])
cube([wx, wy, l]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment