1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-05 14:27:45 +02:00
This commit is contained in:
Justin Lin
2020-03-30 10:13:03 +08:00
parent 99d29bb4aa
commit ae9aa5ee50
2 changed files with 4 additions and 8 deletions

View File

@@ -18,16 +18,14 @@ function _neighbors(fcord, seed, cell_w) = [
function _nz_worley2_classic(p, nbrs, dist) = function _nz_worley2_classic(p, nbrs, dist) =
min([ min([
for(nbr = nbrs) for(nbr = nbrs)
if(!is_undef(nbr[1])) // Here's a workaround for a weired undef problem. bug of 2019.05? _distance(nbr, p, dist)
_distance(nbr, p, dist)
]); ]);
function _nz_worley2_border(p, nbrs, dist) = function _nz_worley2_border(p, nbrs, dist) =
let( let(
dists = [ dists = [
for(nbr = nbrs) for(nbr = nbrs)
if(!is_undef(nbr[1])) // Here's a workaround for a weired undef problem. bug of 2019.05? [nbr[0], nbr[1], norm(nbr - p)]
[nbr[0], nbr[1], norm(nbr - p)]
], ],
sorted = sort(dists, by = "z"), sorted = sort(dists, by = "z"),
a = [sorted[0][0], sorted[0][1]], a = [sorted[0][0], sorted[0][1]],

View File

@@ -21,16 +21,14 @@ function _neighbors(fcord, seed, cell_w) = [
function _nz_worley3_classic(p, nbrs, dist) = function _nz_worley3_classic(p, nbrs, dist) =
min([ min([
for(nbr = nbrs) for(nbr = nbrs)
if(!is_undef(nbr[1])) // Here's a workaround for a weired undef problem. bug of 2019.05? _distance(nbr, p, dist)
_distance(nbr, p, dist)
]); ]);
function _nz_worley3_border(p, nbrs, dist) = function _nz_worley3_border(p, nbrs, dist) =
let( let(
dists = [ dists = [
for(nbr = nbrs) for(nbr = nbrs)
if(!is_undef(nbr[1])) // Here's a workaround for a weired undef problem. bug of 2019.05? [nbr[0], nbr[1], nbr[2], norm(nbr - p)]
[nbr[0], nbr[1], nbr[2], norm(nbr - p)]
], ],
sorted = sort(dists, by = "idx", idx = 3), sorted = sort(dists, by = "idx", idx = 3),
a = [sorted[0][0], sorted[0][1], sorted[0][2]], a = [sorted[0][0], sorted[0][1], sorted[0][2]],