scad/voussoir/triangles.scad
2022-01-04 14:51:17 -08:00

39 lines
672 B
OpenSCAD

module right_triangle(width, height, center=false)
{
if (center)
{
polygon([
[-width/2, -height/2],
[width/2, -height/2],
[width/2, height/2]
]);
}
else
{
polygon([
[0, 0],
[width, 0],
[0, height]
]);
}
}
module isoscelese_triangle(width, height, center=false)
{
if (center)
{
polygon([
[-width/2, -height/2],
[0, height/2],
[width/2, -height/2]
]);
}
else
{
polygon([
[0, 0],
[width, 0],
[width/2, height]
]);
}
}