mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2024-12-29 16:29:40 +00:00
Fixed issue where would return true for a 2x2 matrix or an N=1 patch.
This commit is contained in:
parent
e550909726
commit
b2a2c00604
2 changed files with 12 additions and 3 deletions
|
@ -8,7 +8,7 @@
|
|||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
BOSL_VERSION = [2,0,211];
|
||||
BOSL_VERSION = [2,0,212];
|
||||
|
||||
|
||||
// Section: BOSL Library Version Functions
|
||||
|
|
13
vnf.scad
13
vnf.scad
|
@ -24,8 +24,17 @@ EMPTY_VNF = [[],[]]; // The standard empty VNF with no vertices or faces.
|
|||
|
||||
|
||||
// Function: is_vnf()
|
||||
// Description: Returns true if the given value looks passingly like a VNF structure.
|
||||
function is_vnf(x) = is_list(x) && len(x)==2 && is_list(x[0]) && is_list(x[1]) && (x[0]==[] || is_vector(x[0][0])) && (x[1]==[] || is_vector(x[1][0]));
|
||||
// Usage:
|
||||
// bool = is_vnf(x);
|
||||
// Description:
|
||||
// Returns true if the given value looks like a VNF structure.
|
||||
function is_vnf(x) =
|
||||
is_list(x) &&
|
||||
len(x)==2 &&
|
||||
is_list(x[0]) &&
|
||||
is_list(x[1]) &&
|
||||
(x[0]==[] || (len(x[0])>=3 && is_vector(x[0][0]))) &&
|
||||
(x[1]==[] || is_vector(x[1][0]));
|
||||
|
||||
|
||||
// Function: is_vnf_list()
|
||||
|
|
Loading…
Reference in a new issue