Add triangles.scad.

master
voussoir 2022-01-04 14:51:17 -08:00
parent 722b92d175
commit 71c5616e24
No known key found for this signature in database
GPG Key ID: 5F7554F8C26DACCB
1 changed files with 39 additions and 0 deletions

39
voussoir/triangles.scad Normal file
View File

@ -0,0 +1,39 @@
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]
]);
}
}