mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-13 18:24:28 +02:00
deleted
This commit is contained in:
@@ -1,6 +0,0 @@
|
|||||||
use <experimental/sum.scad>;
|
|
||||||
|
|
||||||
function _manhattan(v) = sum([for(d = v) abs(d)]);
|
|
||||||
|
|
||||||
function _chebyshev(p1, p2) =
|
|
||||||
max([for(i = [0:len(p1) - 1]) abs(p1[i] - p2[i])]);
|
|
@@ -1,24 +0,0 @@
|
|||||||
use <experimental/zip.scad>;
|
|
||||||
use <experimental/worley_noise.scad>;
|
|
||||||
|
|
||||||
size = [50, 50];
|
|
||||||
n = 50;
|
|
||||||
xs = rands(0, size[0] - 1, n);
|
|
||||||
ys = rands(0, size[1] - 1, n);
|
|
||||||
points = zip([xs, ys]);
|
|
||||||
|
|
||||||
noised = [
|
|
||||||
for(y = [0:size[1] - 1])
|
|
||||||
for(x = [0:size[0] - 1])
|
|
||||||
[x, y, worley_noise([x, y], points)]
|
|
||||||
];
|
|
||||||
|
|
||||||
max_dist = max([for(n = noised) n[2]]);
|
|
||||||
|
|
||||||
for(n = noised) {
|
|
||||||
c = n[2] / max_dist;
|
|
||||||
color([c, c, c])
|
|
||||||
linear_extrude(c * max_dist)
|
|
||||||
translate([n[0], n[1]])
|
|
||||||
square(1);
|
|
||||||
}
|
|
@@ -1,10 +0,0 @@
|
|||||||
use <experimental/_impl/_worley_noise_impl.scad>;
|
|
||||||
|
|
||||||
function worley_noise(p, points, dist = "euclidean") =
|
|
||||||
let(
|
|
||||||
dists = dist == "euclidean" ? [for(i = [0:len(points) - 1]) norm(points[i] - p)] :
|
|
||||||
dist == "manhattan" ? [for(i = [0:len(points) - 1]) _manhattan(points[i] - p)] :
|
|
||||||
dist == "chebyshev" ? [for(i = [0:len(points) - 1]) _chebyshev(points[i], p)] :
|
|
||||||
assert("Unknown distance option")
|
|
||||||
)
|
|
||||||
min(dists);
|
|
Reference in New Issue
Block a user