mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-25 07:31:20 +02:00
just use min
This commit is contained in:
@@ -6,20 +6,13 @@ function _chebyshev(p1, p2) =
|
|||||||
max([for(i = [0:len(p1) - 1]) abs(p1[i] - p2[i])]);
|
max([for(i = [0:len(p1) - 1]) abs(p1[i] - p2[i])]);
|
||||||
|
|
||||||
function _nz_worley_euclidean(p, cells) =
|
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) =
|
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) =
|
function _nz_worley_chebyshev(p, cells) =
|
||||||
_nz_worley_from(cells, [for(cell = cells) _chebyshev(cell, p)]);
|
min([for(cell = cells) _chebyshev(cell, p)]);
|
||||||
|
|
||||||
function _nz_worley_from(cells, dists) =
|
|
||||||
let(
|
|
||||||
m = min(dists),
|
|
||||||
i = search(m, dists)[0]
|
|
||||||
)
|
|
||||||
m;
|
|
||||||
|
|
||||||
function _nz_worley_border(p, cells) =
|
function _nz_worley_border(p, cells) =
|
||||||
let(
|
let(
|
||||||
|
Reference in New Issue
Block a user