1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-03-14 11:10:01 +01:00
This commit is contained in:
Justin Lin 2021-02-11 11:54:51 +08:00
parent f1382cb7f4
commit 113a0a5b77
3 changed files with 5 additions and 5 deletions

View File

@ -7,7 +7,7 @@ Make a list that aggregates elements from each of the lists. Returns a list of l
## Parameters
- `lts` : A list of lists.
- `head` : Rather than listing the elements, the elements are combined using the function. **Since:** 3.0
- `slider` : Rather than listing the elements, the elements are combined using the function. **Since:** 3.0
## Examples

View File

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

View File

@ -10,4 +10,4 @@
use <_impl/_zip_impl.scad>;
function zip(lts, head) = is_function(head) ? _zipAll(lts, head) : _zipAll(lts);
function zip(lts, slider) = is_function(slider) ? _zipAll(lts, slider) : _zipAll(lts);