Changed vnf_vertex_array to gracefully handle degenerate array inputs,

and also switched error checking to use new shape functions so it
will fail on undefs.
This commit is contained in:
Adrian Mariano 2020-05-21 15:50:55 -04:00
parent 94a5943d24
commit 30c63fd165

View file

@ -267,17 +267,18 @@ function vnf_vertex_array(
) =
assert((!caps)||(caps&&col_wrap))
assert(in_list(style,["default","alt","quincunx"]))
assert(is_consistent(points), "Non-rectangular or invalid point array")
let(
pts = flatten(points),
pcnt = len(pts),
rows = len(points),
cols = len(points[0]),
errchk = [for (row=points) assert(len(row)==cols, "All rows much have the same number of columns.") 0],
cap1 = first_defined([cap1,caps,false]),
cap2 = first_defined([cap2,caps,false]),
colcnt = cols - (col_wrap?0:1),
rowcnt = rows - (row_wrap?0:1)
)
rows<=1 || cols<=1 ? vnf :
vnf_merge([
vnf, [
concat(