1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-04-14 03:01:58 +02:00

don't use quick_mode

This commit is contained in:
Justin Lin 2021-09-08 10:48:43 +08:00
parent c59fdc5f1d
commit 41ebc07fd0

View File

@ -16,26 +16,19 @@ use <experimental/geom_icosahedron.scad>;
module worley_sphere(radius, detail, amplitude, dist = "border", grid_w = undef, seed = undef) {
gw = is_undef(grid_w) ? radius : grid_w;
points_faces = geom_icosahedron(radius, detail);
points_faces = geom_icosahedron(radius, detail, quick_mode = false);
points = points_faces[0];
faces = points_faces[1];
number_of_buckets = ceil(sqrt(len(points)));
hash = _pt3_hash(number_of_buckets);
deduped_pts = dedup(points, hash = hash, number_of_buckets = number_of_buckets);
sd = is_undef(seed) ? rand() * 1000: seed;
noisy = nz_worley3s(deduped_pts, sd, gw, dist);
p_nz = hashmap([
for(i = [0:len(deduped_pts) - 1])
[deduped_pts[i], noisy[i][3]]
], hash = hash, number_of_buckets = number_of_buckets);
noisy = nz_worley3s(points, sd, gw, dist);
noisy_points = [
for(p = points)
let(nz = hashmap_get(p_nz, p, hash = hash))
for(i = [0:len(points) - 1])
let(
p = points[i],
nz = noisy[i][3]
)
p / norm(p) * (radius + nz * amplitude)
];