mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-22 14:23:23 +02:00
fix random seed error
This commit is contained in:
@@ -12,5 +12,5 @@ use <../util/rand.scad>;
|
|||||||
use <_impl/_pnoise1_impl.scad>;
|
use <_impl/_pnoise1_impl.scad>;
|
||||||
|
|
||||||
function nz_perlin1s(xs, seed) =
|
function nz_perlin1s(xs, seed) =
|
||||||
let(sd = is_undef(seed) ? rand() : seed)
|
let(sd = is_undef(seed) ? rand() * 1000: seed)
|
||||||
[for(x = xs) _pnoise1_impl(x, sd)];
|
[for(x = xs) _pnoise1_impl(x, sd)];
|
@@ -12,5 +12,5 @@ use <../util/rand.scad>;
|
|||||||
use <_impl/_pnoise2_impl.scad>;
|
use <_impl/_pnoise2_impl.scad>;
|
||||||
|
|
||||||
function nz_perlin2s(points, seed) =
|
function nz_perlin2s(points, seed) =
|
||||||
let(sd = is_undef(seed) ? rand() : seed)
|
let(sd = is_undef(seed) ? rand() * 1000 : seed)
|
||||||
[for(p = points) _pnoise2(p.x, p.y, sd)];
|
[for(p = points) _pnoise2(p.x, p.y, sd)];
|
@@ -12,5 +12,5 @@ use <../util/rand.scad>;
|
|||||||
use <_impl/_pnoise3_impl.scad>;
|
use <_impl/_pnoise3_impl.scad>;
|
||||||
|
|
||||||
function nz_perlin3s(points, seed) =
|
function nz_perlin3s(points, seed) =
|
||||||
let(sd = is_undef(seed) ? rand() : seed)
|
let(sd = is_undef(seed) ? rand() * 1000 : seed)
|
||||||
[for(p = points) _pnoise3(p.x, p.y, p.z, sd)];
|
[for(p = points) _pnoise3(p.x, p.y, p.z, sd)];
|
@@ -12,5 +12,4 @@ use <../util/rand.scad>;
|
|||||||
use <_impl/_nz_worley2_impl.scad>;
|
use <_impl/_nz_worley2_impl.scad>;
|
||||||
|
|
||||||
function nz_worley2(x, y, seed, grid_w = 10, dist = "euclidean") =
|
function nz_worley2(x, y, seed, grid_w = 10, dist = "euclidean") =
|
||||||
let(sd = is_undef(seed) ? rand() : seed)
|
_nz_worley2([x, y], seed, grid_w, dist);
|
||||||
_nz_worley2([x, y], sd, grid_w, dist);
|
|
@@ -12,5 +12,5 @@ use <../util/rand.scad>;
|
|||||||
use <_impl/_nz_worley2_impl.scad>;
|
use <_impl/_nz_worley2_impl.scad>;
|
||||||
|
|
||||||
function nz_worley2s(points, seed, grid_w = 10, dist = "euclidean") =
|
function nz_worley2s(points, seed, grid_w = 10, dist = "euclidean") =
|
||||||
let(sd = is_undef(seed) ? rand() : seed)
|
let(sd = is_undef(seed) ? rand() * 1000 : seed)
|
||||||
_nz_worley2s(points, sd, grid_w, dist);
|
_nz_worley2s(points, sd, grid_w, dist);
|
@@ -12,5 +12,4 @@ use <../util/rand.scad>;
|
|||||||
use <_impl/_nz_worley3_impl.scad>;
|
use <_impl/_nz_worley3_impl.scad>;
|
||||||
|
|
||||||
function nz_worley3(x, y, z, seed, grid_w = 10, dist = "euclidean") =
|
function nz_worley3(x, y, z, seed, grid_w = 10, dist = "euclidean") =
|
||||||
let(sd = is_undef(seed) ? rand() : seed)
|
_nz_worley3([x, y, z], seed, grid_w, dist);
|
||||||
_nz_worley3([x, y, z], sd, grid_w, dist);
|
|
@@ -12,5 +12,5 @@ use <../util/rand.scad>;
|
|||||||
use <_impl/_nz_worley3_impl.scad>;
|
use <_impl/_nz_worley3_impl.scad>;
|
||||||
|
|
||||||
function nz_worley3s(points, seed, grid_w = 10, dist = "euclidean") =
|
function nz_worley3s(points, seed, grid_w = 10, dist = "euclidean") =
|
||||||
let(sd = is_undef(seed) ? rand() : seed)
|
let(sd = is_undef(seed) ? rand() * 1000: seed)
|
||||||
_nz_worley3s(points, sd, grid_w, dist);
|
_nz_worley3s(points, sd, grid_w, dist);
|
Reference in New Issue
Block a user