1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-05 14:27:45 +02:00

rename param

This commit is contained in:
Justin Lin
2021-07-21 11:08:22 +08:00
parent 88775366db
commit cdccc4723b
2 changed files with 4 additions and 4 deletions

View File

@@ -18,12 +18,12 @@ It divides the space into grids. The nucleus of each cell is randomly placed in
use <voxel/vx_sphere.scad>; use <voxel/vx_sphere.scad>;
use <noise/nz_worley3s.scad>; use <noise/nz_worley3s.scad>;
tile_w = 10; grid_w = 10;
dist = "euclidean"; // [euclidean, manhattan, chebyshev, border] dist = "euclidean"; // [euclidean, manhattan, chebyshev, border]
seed = 51; seed = 51;
points = vx_sphere(20); points = vx_sphere(20);
cells = nz_worley3s(points, seed, tile_w, dist); cells = nz_worley3s(points, seed, grid_w, dist);
for(i = [0:len(cells) - 1]) { for(i = [0:len(cells) - 1]) {
c = (norm([cells[i][0], cells[i][1], cells[i][2]]) % 20) / 20; c = (norm([cells[i][0], cells[i][1], cells[i][2]]) % 20) / 20;

View File

@@ -11,6 +11,6 @@
use <../util/rand.scad>; use <../util/rand.scad>;
use <_impl/_nz_worley3_impl.scad>; use <_impl/_nz_worley3_impl.scad>;
function nz_worley3s(points, seed, tile_w = 10, dist = "euclidean") = function nz_worley3s(points, seed, grid_w = 10, dist = "euclidean") =
let(sd = is_undef(seed) ? floor(rand(0, 256)) : seed % 256) let(sd = is_undef(seed) ? floor(rand(0, 256)) : seed % 256)
[for(p = points) _nz_worley3(p, sd, tile_w, dist)]; [for(p = points) _nz_worley3(p, sd, grid_w, dist)];