omdl  v0.9.5
OpenSCAD Mechanical Design Library
iterable_operate.scad File Reference

Iterable data type operations. More...

+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

function defined_e_or (v, i, d)
 Return an element of an iterable when it exists or a default value otherwise. More...
 
function find (mv, v, c=1, i, i1=0, i2)
 Find the occurrences of a match value in an iterable value. More...
 
function count (mv, v, s=true, i)
 Count all occurrences of a match value in an iterable value. More...
 
function exists (mv, v, s=true, i)
 Check for the existence of a match value in an iterable value. More...
 
function exists_e (i, v)
 Test if an element exists at a specified index of an iterable value. More...
 
function first (v)
 Return the first element of an iterable value. More...
 
function second (v)
 Return the second element of an iterable value. More...
 
function third (v)
 Return the third element of an iterable value. More...
 
function last (v)
 Return the last element of an iterable value. More...
 
function middle (v)
 Return the middle element of an iterable value. More...
 
function first2 (v)
 Return a list containing the first two elements of an iterable value. More...
 
function first3 (v)
 Return a list containing the first three elements of an iterable value. More...
 
function last2 (v)
 Return a list containing the last two elements of an iterable value. More...
 
function last3 (v)
 Return a list containing the last three elements of an iterable value. More...
 
function firstn (v, n=1)
 Return a list containing the first n elements of an iterable value. More...
 
function lastn (v, n=1)
 Return a list containing the last n elements of an iterable value. More...
 
function headn (v, n=1)
 Return a list containing all but the last n elements of an iterable value. More...
 
function tailn (v, n=1)
 Return a list containing all but the first n elements of an iterable value. More...
 
function reverse (v)
 Reverse the elements of an iterable value. More...
 
function shift (v, n=0, r=true, c=true)
 Shift the elements of an iterable value. More...
 
function select_r (v, i)
 Select a range of elements from an iterable value. More...
 
function sequence_ns (v, n=1, s=1, w=false)
 Return a list of all n-element sequential-subsets of an iterable value. More...
 
function append_e (nv, v, r=true, j=true, l=true)
 Append a value to each element of an iterable value. More...
 
function insert (nv, v, i=0, mv, mi=0, s=true, si)
 Insert a new value into an iterable value. More...
 
function delete (v, i, mv, mc=1, s=true, si)
 Delete elements from an iterable value. More...
 
function strip (v, mv=empty_lst)
 Strip all matching values from an iterable value. More...
 
function mask (v, m, r=false, o=0, u=undef, z=0)
 Apply a binary mask to an interable value. More...
 
function unique (v)
 Return a list of the unique elements of an iterable value. More...
 

Detailed Description

Iterable data type operations.

Author
Roy Allen Sutton
Date
2015-2023

This file is part of omdl, an OpenSCAD mechanical design library.

The omdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

The omdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with the omdl; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA; or see http://www.gnu.org/licenses/.

Definition in file iterable_operate.scad.