mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-01 09:49:45 +00:00
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:
parent
94a5943d24
commit
30c63fd165
1 changed files with 2 additions and 1 deletions
3
vnf.scad
3
vnf.scad
|
@ -267,17 +267,18 @@ function vnf_vertex_array(
|
||||||
) =
|
) =
|
||||||
assert((!caps)||(caps&&col_wrap))
|
assert((!caps)||(caps&&col_wrap))
|
||||||
assert(in_list(style,["default","alt","quincunx"]))
|
assert(in_list(style,["default","alt","quincunx"]))
|
||||||
|
assert(is_consistent(points), "Non-rectangular or invalid point array")
|
||||||
let(
|
let(
|
||||||
pts = flatten(points),
|
pts = flatten(points),
|
||||||
pcnt = len(pts),
|
pcnt = len(pts),
|
||||||
rows = len(points),
|
rows = len(points),
|
||||||
cols = len(points[0]),
|
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]),
|
cap1 = first_defined([cap1,caps,false]),
|
||||||
cap2 = first_defined([cap2,caps,false]),
|
cap2 = first_defined([cap2,caps,false]),
|
||||||
colcnt = cols - (col_wrap?0:1),
|
colcnt = cols - (col_wrap?0:1),
|
||||||
rowcnt = rows - (row_wrap?0:1)
|
rowcnt = rows - (row_wrap?0:1)
|
||||||
)
|
)
|
||||||
|
rows<=1 || cols<=1 ? vnf :
|
||||||
vnf_merge([
|
vnf_merge([
|
||||||
vnf, [
|
vnf, [
|
||||||
concat(
|
concat(
|
||||||
|
|
Loading…
Reference in a new issue