1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-21 05:52:16 +02:00

added starburst

This commit is contained in:
Justin Lin
2019-05-17 17:54:28 +08:00
parent 4ea52e328e
commit 63dcbe259d

32
src/starburst.scad Normal file
View File

@@ -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();
}
}
}