mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-01 09:49:45 +00:00
Added end option to idx()
This commit is contained in:
parent
a51e3563fe
commit
7809b7bbe1
1 changed files with 3 additions and 1 deletions
|
@ -393,10 +393,12 @@ function list_fit(v, length, fill) =
|
|||
// Arguments:
|
||||
// list = The list to returns the index range of.
|
||||
// step = The step size to stride through the list. Default: 1
|
||||
// end= The delta from the end of the list. Default: -1
|
||||
// Example(2D):
|
||||
// colors = ["red", "green", "blue"];
|
||||
// for (i=idx(colors)) right(20*i) color(colors[i]) circle(d=10);
|
||||
function idx(list,step=1) = [0:step:len(list)-1];
|
||||
function idx(list, step=1, end=-1) =
|
||||
[0 : step : len(list)+end];
|
||||
|
||||
|
||||
// Function: enumerate()
|
||||
|
|
Loading…
Reference in a new issue