mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-16 19:54:29 +02:00
add doc
This commit is contained in:
@@ -208,6 +208,9 @@ See [examples](examples).
|
||||
|
||||
### Util
|
||||
- [util/sum](https://openhome.cc/eGossip/OpenSCAD/lib2x-sum.html)
|
||||
- [util/zip](https://openhome.cc/eGossip/OpenSCAD/lib2x-zip.html)
|
||||
|
||||
----
|
||||
|
||||
## Bugs and Feedback
|
||||
|
||||
|
19
docs/lib2x-zip.md
Normal file
19
docs/lib2x-zip.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# zip
|
||||
|
||||
Make a list that aggregates elements from each of the lists. Returns a list of lists, where the i-th list contains the i-th element from each of the argument lists. The `zip` function stops when the first input list is exhausted.
|
||||
|
||||
**Since:** 2.4
|
||||
|
||||
## Parameters
|
||||
|
||||
- `lts` : a list of lists.
|
||||
|
||||
## Examples
|
||||
|
||||
use <util/zip.scad>;
|
||||
|
||||
xs = [10, 20, 30];
|
||||
ys = [5, 15, 25];
|
||||
zs = [2.5, 7.5, 12.4];
|
||||
|
||||
assert(zip([xs, ys, zs]) == [[10, 5, 2.5], [20, 15, 7.5], [30, 25, 12.4]]);
|
@@ -1,3 +1,13 @@
|
||||
/**
|
||||
* zip.scad
|
||||
*
|
||||
* @copyright Justin Lin, 2020
|
||||
* @license https://opensource.org/licenses/lgpl-3.0.html
|
||||
*
|
||||
* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-zip.html
|
||||
*
|
||||
**/
|
||||
|
||||
use <_impl/_zip_impl.scad>;
|
||||
|
||||
function zip(lists) = _zipAll(lists);
|
||||
function zip(lts) = _zipAll(lts);
|
Reference in New Issue
Block a user