diff --git a/src/starburst.scad b/src/starburst.scad new file mode 100644 index 00000000..68ffe769 --- /dev/null +++ b/src/starburst.scad @@ -0,0 +1,32 @@ +module starburst(r1, r2, n, height) { + a = 180 / n; + + p0 = [0, 0, 0]; + p1 = [r2 * cos(a), r2 * sin(a), 0]; + p2 = [r1, 0, 0]; + p3 = [0, 0, height]; + + module half_burst() { + polyhedron(points = [p0, p1, p2, p3], + faces = [ + [0, 2, 1], + [0, 1, 3], + [0, 3, 2], + [2, 1, 3] + ] + ); + } + + module burst() { + hull() { + half_burst(); + mirror([0, 1,0]) half_burst(); + } + } + + union() { + for(i = [0 : n - 1]) { + rotate(2 * a * i) burst(); + } + } +} \ No newline at end of file