1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-24 15:22:53 +02:00

just use min

This commit is contained in:
Justin Lin
2022-05-16 07:52:38 +08:00
parent cb171262e7
commit 0d685a7280

View File

@@ -6,20 +6,13 @@ function _chebyshev(p1, p2) =
max([for(i = [0:len(p1) - 1]) abs(p1[i] - p2[i])]);
function _nz_worley_euclidean(p, cells) =
_nz_worley_from(cells, [for(cell = cells) norm(cell - p)]);
min([for(cell = cells) norm(cell - p)]);;
function _nz_worley_manhattan(p, cells) =
_nz_worley_from(cells, [for(cell = cells) _manhattan(cell - p)]);
min([for(cell = cells) _manhattan(cell - p)]);
function _nz_worley_chebyshev(p, cells) =
_nz_worley_from(cells, [for(cell = cells) _chebyshev(cell, p)]);
function _nz_worley_from(cells, dists) =
let(
m = min(dists),
i = search(m, dists)[0]
)
m;
min([for(cell = cells) _chebyshev(cell, p)]);
function _nz_worley_border(p, cells) =
let(