mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-08-06 10:16:37 +02:00
Fixed issue where would return true for a 2x2 matrix or an N=1 patch.
This commit is contained in:
@@ -8,7 +8,7 @@
|
|||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
BOSL_VERSION = [2,0,211];
|
BOSL_VERSION = [2,0,212];
|
||||||
|
|
||||||
|
|
||||||
// Section: BOSL Library Version Functions
|
// 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()
|
// Function: is_vnf()
|
||||||
// Description: Returns true if the given value looks passingly like a VNF structure.
|
// Usage:
|
||||||
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]));
|
// 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()
|
// Function: is_vnf_list()
|
||||||
|
Reference in New Issue
Block a user