So, what should I do if I wanted other distance algorithm for this code?
#@cli rep_cellular_noise: 0<amplitude<=1,iterations>0
rep_cellular_noise:
amplitude=$1
foreach {
100%,100%,100%
rm..
repeat $2 {
__$0_apply_noise[0]
+_$0_create_cell[0]
n. 0,{1-$>/10}
}
rm[0] +
}
__rep_cellular_noise_apply_noise: # Subcommand
gt 0
+noise $amplitude,2 eq. 1
max
label_fg 0
_rep_cellular_noise_create_cell:
+voronoi
L={iM+1}
$L,1,1,3 # 1. Create a initial list of coordinates all set to 0. Number of coordinates is equal to number of values in voronoi
eval[-2] :"
begin(
X=Y=Z=vector(#w#-1);
);
if(i&&i#0,
X[i]=x;
Y[i]=y;
Z[i]=z;
);
end(
merge(X,|);
merge(Y,|);
merge(Z,|);
repeat(w#-1,p,
I[#-1,p]=[X[p],Y[p],Z[p]];
);
);
"
+f[-2] norm([x,y,z]-I[#-1,i]) # This is where distance goes. Only Euclidean.
k[-1]
Test:
$ 512,512 rep_cellular_noise .2,1