mirror of
https://github.com/kennetek/gridfinity-rebuilt-openscad.git
synced 2024-11-17 22:10:50 +00:00
Add a foreach_add helper function
This commit is contained in:
parent
fa51cd0e7e
commit
1ee99f9c6f
1 changed files with 11 additions and 0 deletions
|
@ -173,6 +173,17 @@ function affine_scale(vector) = [
|
|||
[0, 0, 0, 1]
|
||||
];
|
||||
|
||||
/**
|
||||
* @brief Add something to each element in a list.
|
||||
* @param list The list whos elements will be modified.
|
||||
* @param to_add
|
||||
* @returns a list with `to_add` added to each element in the list.
|
||||
*/
|
||||
function foreach_add(list, to_add) =
|
||||
assert(is_list(list))
|
||||
assert(!is_undef(to_add))
|
||||
[for (item = list) item + to_add];
|
||||
|
||||
/**
|
||||
* @brief Create a rectangle with rounded corners by sweeping a 2d object along a path.
|
||||
* @Details Centered on origin.
|
||||
|
|
Loading…
Reference in a new issue