1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-17 22:28:16 +01:00

refactor: use contains

This commit is contained in:
Justin Lin 2022-04-15 09:44:05 +08:00
parent 3ad74ff561
commit fd34e9d5b9

View File

@ -4,7 +4,7 @@ use <../../util/map/hashmap_get.scad>;
use <../../util/map/hashmap_del.scad>;
use <../../util/map/hashmap_keys.scad>;
use <../../util/map/hashmap_put.scad>;
use <../../util/has.scad>;
use <../../util/contains.scad>;
use <../../util/find_index.scad>;
function ihash(a, b, c) = a * 961 + b * 31 + c;
@ -129,7 +129,7 @@ function _adjustNeighborsDtri(d, newTriangles, leng, _indices_hash, i = 0) =
let(
neighbors = hashmap_get(delaunay_triangles(d), delaunayTri, hash = _indices_hash),
leng_nbrs = len(neighbors),
nbri = find_index(neighbors, function(nbr) nbr != undef && has(nbr, edge[1]) && has(nbr, edge[0])),
nbri = find_index(neighbors, function(nbr) nbr != undef && contains(nbr, edge[1]) && contains(nbr, edge[0])),
nd = nbri == -1 ? d : updateNbrs(d, delaunayTri, [
for(j = 0; j < leng_nbrs; j = j + 1)
j == nbri ? t : neighbors[j]