1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-17 14:18:13 +01:00

fix period missing

This commit is contained in:
Justin Lin 2022-05-06 18:37:43 +08:00
parent 590d8ab7c3
commit 193f38d531

View File

@ -3,9 +3,9 @@ use <noise/_impl/_pnoise3_impl.scad>;
use <polyhedra/geom_icosahedron.scad>;
radius = 30;
detail = 15;
detail = 20;
amplitude = 10;
period = 1;
period = 2;
perlin_sphere(radius, detail, amplitude, period);
@ -17,7 +17,7 @@ module perlin_sphere(radius, detail, amplitude, period = 1, seed = undef) {
sd = is_undef(seed) ? floor(rand(0, 256)) : seed % 256;
noisy_points = [
for(p = points)
p * (radius + _pnoise3(p.x, p.y, p.z, sd) * amplitude)
p * (radius + _pnoise3(p.x * period, p.y * period, p.z * period, sd) * amplitude)
];
polyhedron(noisy_points, faces);