mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-11 17:24:20 +02:00
rename
This commit is contained in:
@@ -7,7 +7,7 @@ Make a list that aggregates elements from each of the lists. Returns a list of l
|
|||||||
## Parameters
|
## Parameters
|
||||||
|
|
||||||
- `lts` : A list of lists.
|
- `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
|
## Examples
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
_identity = function(elems) elems;
|
_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 ? [] :
|
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);
|
@@ -10,4 +10,4 @@
|
|||||||
|
|
||||||
use <_impl/_zip_impl.scad>;
|
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);
|
Reference in New Issue
Block a user