diff --git a/src/polyhedra/geom_polar_zonohedra.scad b/src/polyhedra/geom_polar_zonohedra.scad new file mode 100644 index 00000000..c3a63615 --- /dev/null +++ b/src/polyhedra/geom_polar_zonohedra.scad @@ -0,0 +1,33 @@ +use <../util/sum.scad>; +use <../util/flat.scad>; + +function vertex(i, j, n, theta) = + i > j ? [0, 0, 0] : + sum([ + for(k = [i:j]) + let( + cosa = cos(theta), + a_i_n = 360 * k / n + ) + [cosa * cos(a_i_n), cosa * sin(a_i_n), sin(theta)] + ]); + +function rhombi(i, j, n, theta) = [ + vertex(i, j, n, theta), + vertex(i + 1, j, n, theta), + vertex(i + 1, -1 + j, n, theta), + vertex(i, -1 + j, n, theta) +]; + +function geom_polar_zonohedra(n, theta = 35.5) = + let( + points = flat([ + for(i = [0:n - 1], j = [i + 1:n + i - 1]) + rhombi(i, j, n, theta) + ]), + faces = [ + for(i = [0:len(points) / 4 - 1]) + [for(j = [0:3]) i * 4 + j] + ] + ) + [points, faces]; \ No newline at end of file diff --git a/src/polyhedra/polar_zonohedra.scad b/src/polyhedra/polar_zonohedra.scad new file mode 100644 index 00000000..c9547f64 --- /dev/null +++ b/src/polyhedra/polar_zonohedra.scad @@ -0,0 +1,17 @@ +// http://archive.bridgesmathart.org/2021/bridges2021-7.pdf + +// use ; +// use ; +// use ; + +// for(n = [3:8]) { +// translate([0.5 * n * (n - 3), 0, 0]) +// polar_zonohedra(n); +// } + +use ; + +module polar_zonohedra(n, theta = 35.5) { + points_faces = geom_polar_zonohedra(n, theta); + polyhedron(points_faces[0], points_faces[1]); +} \ No newline at end of file