From 71c5616e24d169d86fef00591dbc29aba379a481 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Tue, 4 Jan 2022 14:51:17 -0800 Subject: [PATCH] Add triangles.scad. --- voussoir/triangles.scad | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 voussoir/triangles.scad diff --git a/voussoir/triangles.scad b/voussoir/triangles.scad new file mode 100644 index 0000000..fe4e771 --- /dev/null +++ b/voussoir/triangles.scad @@ -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] + ]); + } +}