1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-15 03:05:41 +02:00

rename param

This commit is contained in:
Justin Lin
2020-04-07 17:34:27 +08:00
parent 12ece2deef
commit cc1e381fd8
6 changed files with 24 additions and 24 deletions

View File

@@ -2,7 +2,7 @@
Returns the 2D [Worley noise](https://en.wikipedia.org/wiki/Worley_noise) value `[cell_x, cell_y, noise]` at the (x, y) coordinate.
It divides the space into tiles. The nucleus of each cell is randomly placed in a tile.
It divides the space into grids. The nucleus of each cell is randomly placed in a grid.
![nz_worley2](images/lib2x-nz_worley2-1.JPG)
@@ -13,7 +13,7 @@ It divides the space into tiles. The nucleus of each cell is randomly placed in
- `x` : The x coordinate.
- `y` : The y coordinate.
- `seed` : The random seed.
- `tile_w` : The tile width. Default to 10. Smaller `tile_w` makes more cells.
- `grid_w` : The grid width. Default to 10. Smaller `grid_w` makes more cells.
- `dist` : The noise value of each point is based on its distance to other cells. Different distance strategies make different noises. The `dist` parameter accepts `"euclidean"`, `"manhattan"`, `"chebyshev"` or `"border"`.
## Examples
@@ -22,7 +22,7 @@ It divides the space into tiles. The nucleus of each cell is randomly placed in
use <util/dedup.scad>;
size = [100, 50];
tile_w = 10;
grid_w = 10;
dist = "euclidean"; // [euclidean, manhattan, chebyshev, border]
seed = 51;
@@ -32,7 +32,7 @@ It divides the space into tiles. The nucleus of each cell is randomly placed in
[x, y]
];
cells = [for(p = points) nz_worley2(p[0], p[1], seed, tile_w, dist)];
cells = [for(p = points) nz_worley2(p[0], p[1], seed, grid_w, dist)];
max_dist = max([for(c = cells) c[2]]);
for(i = [0:len(cells) - 1]) {

View File

@@ -2,7 +2,7 @@
Returns 2D [Worley noise](https://en.wikipedia.org/wiki/Worley_noise) values `[cell_x, cell_y, noise]` at (x, y) coordinates.
It divides the space into tiles. The nucleus of each cell is randomly placed in a tile.
It divides the space into grids. The nucleus of each cell is randomly placed in a grid.
![nz_worley2s](images/lib2x-nz_worley2s-1.JPG)
@@ -12,7 +12,7 @@ It divides the space into tiles. The nucleus of each cell is randomly placed in
- `points` : A list of `[x, y]` coordinates.
- `seed` : The random seed. If it's ignored, a randomized value will be used.
- `tile_w` : The tile width. Default to 10. Smaller `tile_w` makes more cells.
- `grid_w` : The grid width. Default to 10. Smaller `grid_w` makes more cells.
- `dist` : The noise value of each point is based on its distance to other cells. Different distance strategies make different noises. The `dist` parameter accepts `"euclidean"`, `"manhattan"`, `"chebyshev"` or `"border"`.
## Examples
@@ -20,7 +20,7 @@ It divides the space into tiles. The nucleus of each cell is randomly placed in
use <noise/nz_worley2s.scad>;
size = [100, 50];
tile_w = 10;
grid_w = 10;
dist = "euclidean"; // [euclidean, manhattan, chebyshev, border]
seed = 51;
@@ -30,7 +30,7 @@ It divides the space into tiles. The nucleus of each cell is randomly placed in
[x, y]
];
cells = nz_worley2s(points, seed, tile_w, dist);
cells = nz_worley2s(points, seed, grid_w, dist);
for(i = [0:len(cells) - 1]) {
h = norm([cells[i][0], cells[i][1]]) % 10;