mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-09 00:06:42 +02:00
don't use quick_mode
This commit is contained in:
@@ -16,26 +16,19 @@ use <experimental/geom_icosahedron.scad>;
|
|||||||
module worley_sphere(radius, detail, amplitude, dist = "border", grid_w = undef, seed = undef) {
|
module worley_sphere(radius, detail, amplitude, dist = "border", grid_w = undef, seed = undef) {
|
||||||
gw = is_undef(grid_w) ? radius : grid_w;
|
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];
|
points = points_faces[0];
|
||||||
faces = points_faces[1];
|
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;
|
sd = is_undef(seed) ? rand() * 1000: seed;
|
||||||
noisy = nz_worley3s(deduped_pts, sd, gw, dist);
|
noisy = nz_worley3s(points, 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_points = [
|
noisy_points = [
|
||||||
for(p = points)
|
for(i = [0:len(points) - 1])
|
||||||
let(nz = hashmap_get(p_nz, p, hash = hash))
|
let(
|
||||||
|
p = points[i],
|
||||||
|
nz = noisy[i][3]
|
||||||
|
)
|
||||||
p / norm(p) * (radius + nz * amplitude)
|
p / norm(p) * (radius + nz * amplitude)
|
||||||
];
|
];
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user