1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-20 05:21:38 +02:00

refactor: use each

This commit is contained in:
Justin Lin
2022-04-01 13:27:56 +08:00
parent 48315257b1
commit 3a4b1224e6

View File

@@ -1,10 +1,6 @@
_identity = function(elems) elems;
function _zipAll_sub(lts, list_to, elem_to, combine, i = 0) =
i > elem_to ? [] :
concat(
[combine([for(j = [0:list_to]) lts[j][i]])],
_zipAll_sub(lts, list_to, elem_to, combine, i + 1)
);
i > elem_to ? [] : [combine([for(j = [0:list_to]) lts[j][i]]), each _zipAll_sub(lts, list_to, elem_to, combine, i + 1)];
function _zipAll(lts, combine = _identity) = _zipAll_sub(lts, len(lts) - 1, len(lts[0]) - 1, combine);