From 3b14f473c8212e6e8248eea21d3f8c467e49214b Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Mon, 24 Feb 2020 09:22:28 +0800 Subject: [PATCH] add hollow_out_starburst --- examples/hollow_out_starburst.scad | 35 ++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 examples/hollow_out_starburst.scad diff --git a/examples/hollow_out_starburst.scad b/examples/hollow_out_starburst.scad new file mode 100644 index 00000000..f423532f --- /dev/null +++ b/examples/hollow_out_starburst.scad @@ -0,0 +1,35 @@ +use ; +use ; +use ; + +r1 = 30; +r2 = 12; +h = 10; +n = 5; +thickness = 1.75; +half = true; + +module hollow_out_starburst(r1, r2, h, n, thickness, half = false) { + star = [for(p = shape_starburst(r1, r2, n)) [p[0], p[1], 0]]; + leng = len(star); + tris = concat( + [for(i = [0:leng - 2]) [[0, 0, h], star[i], star[i + 1]]], + [[[0, 0, h], star[leng - 1], star[0]]] + ); + + module half_star() { + for(tri = tris) { + hull_polyline3d(concat(tri, [tri[0]]), thickness = thickness); + for(line = tri_bisectors(tri)) { + hull_polyline3d(concat(line, [line[0]]), thickness = thickness); + } + } + } + + half_star(); + if(!half) { + mirror([0, 0, 1]) half_star(); + } +} + +hollow_out_starburst(r1, r2, h, n, thickness, half); \ No newline at end of file