From b2a2c006048ddb3fd2de5b9884fc514a0f3a54ae Mon Sep 17 00:00:00 2001 From: Revar Desmera Date: Sun, 22 Mar 2020 01:12:51 -0700 Subject: [PATCH] Fixed issue where would return true for a 2x2 matrix or an N=1 patch. --- version.scad | 2 +- vnf.scad | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/version.scad b/version.scad index 56f9ba2..73cabf9 100644 --- a/version.scad +++ b/version.scad @@ -8,7 +8,7 @@ ////////////////////////////////////////////////////////////////////// -BOSL_VERSION = [2,0,211]; +BOSL_VERSION = [2,0,212]; // Section: BOSL Library Version Functions diff --git a/vnf.scad b/vnf.scad index e1ea665..5cda13b 100644 --- a/vnf.scad +++ b/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()