From 0f74a0f24e034da70aa909c0ea4be83e6d583f62 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Fri, 10 Apr 2020 13:10:29 +0800 Subject: [PATCH] bottom option --- examples/voronoi/voronoi_crystallization.scad | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/examples/voronoi/voronoi_crystallization.scad b/examples/voronoi/voronoi_crystallization.scad index 8b3e9608..156fe01f 100644 --- a/examples/voronoi/voronoi_crystallization.scad +++ b/examples/voronoi/voronoi_crystallization.scad @@ -1,7 +1,8 @@ use ; grid_w = 5; -spacing = .1; +spacing = 0; +bottom = "YES"; // [YES, NO] levels = [ [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], @@ -117,4 +118,15 @@ for(cell = cells) { offset(-spacing) polygon(cell[1]); } +} + +if(bottom == "YES") { + color("black") + linear_extrude(1) + for(cell = cells) { + level = levels[size[1] - cell[0][1]][cell[0][0]]; + if(!is_undef(level)) { + polygon(cell[1]); + } + } } \ No newline at end of file