mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2024-12-29 16:29:40 +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(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(
|
||||
|
|
Loading…
Reference in a new issue