From 808024c83f813d8b8b5fb28a9b3bd6fc62d53ef4 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Sun, 21 Jun 2020 15:34:58 +0800 Subject: [PATCH] add voronoi_holder --- examples/voronoi/voronoi_holder.scad | 42 ++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 examples/voronoi/voronoi_holder.scad diff --git a/examples/voronoi/voronoi_holder.scad b/examples/voronoi/voronoi_holder.scad new file mode 100644 index 00000000..9db51aba --- /dev/null +++ b/examples/voronoi/voronoi_holder.scad @@ -0,0 +1,42 @@ +use ; +use ; +use ; + +size = [200, 72]; +grid_w = 8; // grid_w must divide size equally. +thickness = 2; +spacing = 1.5; +frags = 24; + +module voronoi_holder() { + half_spacing = spacing / 2; + cells = vrn2_cells_space( + size = size, + grid_w = grid_w + ); + + r = size[0] / (2 * PI) - thickness * 1.5; + + difference() { + bend_extrude(size = size, thickness = thickness * 3, angle = 360, frags = frags) + render() + difference() { + square(size); + render() + for(cell = cells) { + offset(-half_spacing) + polygon(cell[1]); + } + } + linear_extrude(size[1] - thickness) + arc(radius = r, angle = 360, width = thickness, $fn = frags); + } + + linear_extrude(thickness) + circle(r + thickness * 1.75, $fn = frags); + + linear_extrude(thickness * 2) + circle(r - 0.25 * thickness, $fn = frags); +} + +voronoi_holder(); \ No newline at end of file