Fix vertext range assert false positive when associate_vertices is passed empty split

This commit is contained in:
Tomáš Pecsérke 2023-07-21 14:07:05 +02:00 committed by GitHub
parent dbcc231336
commit 56a5c4a077
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2677,7 +2677,7 @@ function associate_vertices(polygons, split, curpoly=0) =
assert(len(cursplit)+polylen == len(polygons[curpoly+1]),
str("Polygon ", curpoly, " has ", polylen, " vertices. Next polygon has ", len(polygons[curpoly+1]),
" vertices. Split list has length ", len(cursplit), " but must have length ", len(polygons[curpoly+1])-polylen))
assert(max(cursplit)<polylen && min(curpoly)>=0,
assert(len(cursplit) == 0 || max(cursplit)<polylen && min(curpoly)>=0,
str("Split ",cursplit," at polygon ",curpoly," has invalid vertices. Must be in [0:",polylen-1,"]"))
len(cursplit)==0 ? associate_vertices(polygons,split,curpoly+1) :
let(