1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-03-14 02:59:42 +01:00
This commit is contained in:
Justin Lin 2020-03-29 20:04:09 +08:00
parent 5bd42db365
commit dff7db68ac

View File

@ -0,0 +1,21 @@
use <experimental/nz_voronoi3.scad>;
size = [20, 20, 20];
dim = 2;
seed = 1;
points = [
for(z = [0:size[2] - 1])
for(y = [0:size[1] - 1])
for(x = [0:size[0] - 1])
[x, y, z, nz_voronoi3(size, x, y, z, seed, dim)]
];
max_dist = max([for(p = points) p[3]]);
for(p = points) {
c = p[3] / max_dist * 2;
color([c > 1 ? 1 : c , 0, 0])
translate([p[0], p[1], p[2]])
cube(1);
}