diff --git a/examples/voronoi/voronoi_crystallization.scad b/examples/voronoi/voronoi_crystallization.scad index 156fe01f..69b7dcbe 100644 --- a/examples/voronoi/voronoi_crystallization.scad +++ b/examples/voronoi/voronoi_crystallization.scad @@ -1,8 +1,9 @@ use ; grid_w = 5; -spacing = 0; +spacing = 0.2; bottom = "YES"; // [YES, NO] +invert = "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], @@ -114,14 +115,13 @@ for(cell = cells) { if(!is_undef(level)) { h = level / 255; color([h, h, h]) - linear_extrude(h * 10 + 1) + linear_extrude((invert == "YES" ? 10 - h * 10 : h * 10) + 2) 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]];