1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-18 22:58:04 +01:00

add every

This commit is contained in:
Justin Lin 2021-02-09 10:44:42 +08:00
parent c46b03b788
commit 333fbfc728
2 changed files with 7 additions and 0 deletions

View File

@ -12,4 +12,6 @@ New modules/functions
- `angles_between`
- `spherical_coordinate`
- `util/every`
- `util/some`

5
src/util/every.scad Normal file
View File

@ -0,0 +1,5 @@
function _every(lt, assert_func, leng, i = 0) =
i == leng ? true :
assert_func(lt[i]) ? _every(lt, assert_func, leng, i + 1) : false;
function every(lt, assert_func) = _every(lt, assert_func, len(lt));