Add triangles.scad.
This commit is contained in:
parent
722b92d175
commit
71c5616e24
1 changed files with 39 additions and 0 deletions
39
voussoir/triangles.scad
Normal file
39
voussoir/triangles.scad
Normal 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]
|
||||
]);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue