mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-19 19:09:36 +00:00
Added is_consistent()
This commit is contained in:
parent
07bfcd6a57
commit
da7190ccbb
2 changed files with 15 additions and 1 deletions
14
arrays.scad
14
arrays.scad
|
@ -89,6 +89,20 @@ function slice(arr,st,end) = let(
|
||||||
function in_list(x,l,idx=undef) = search([x], l, num_returns_per_match=1, index_col_num=idx) != [[]];
|
function in_list(x,l,idx=undef) = search([x], l, num_returns_per_match=1, index_col_num=idx) != [[]];
|
||||||
|
|
||||||
|
|
||||||
|
// Function: is_consistent()
|
||||||
|
// Usage:
|
||||||
|
// is_consistent(v);
|
||||||
|
// Description:
|
||||||
|
// Returns true if all items of the given list are the same size.
|
||||||
|
// Example:
|
||||||
|
// is_consistent([3,4,5,6]); // Returns: true
|
||||||
|
// is_consistent([[3,4],[4,5],[5,6]]); // Returns: true
|
||||||
|
// is_consistent([[3,4,5],[4,5,6],[5,6,7]]); // Returns: true
|
||||||
|
// is_consistent([[3,4,5],[4,5],[5,6,7]]); // Returns: false
|
||||||
|
// is_consistent([[3,4,5],[4,undef,6],[5,6,7]]); // Returns: false
|
||||||
|
function is_consistent(v) = v==[] || is_list_of(v, v[0]);
|
||||||
|
|
||||||
|
|
||||||
// Function: min_index()
|
// Function: min_index()
|
||||||
// Usage:
|
// Usage:
|
||||||
// min_index(vals,[all]);
|
// min_index(vals,[all]);
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
BOSL_VERSION = [2,0,146];
|
BOSL_VERSION = [2,0,147];
|
||||||
|
|
||||||
|
|
||||||
// Section: BOSL Library Version Functions
|
// Section: BOSL Library Version Functions
|
||||||
|
|
Loading…
Reference in a new issue