improve error handling

This commit is contained in:
Adrian Mariano 2021-12-07 16:21:29 -05:00
parent 7059caa6cc
commit b729f436ce

View file

@ -324,13 +324,17 @@ module zcopies(spacing, n, l, sp)
// zrot(180/6)
// cylinder(h=20, d=10/cos(180/6)+0.01, $fn=6);
// }
module grid2d(spacing, n, size, stagger=false, inside=undef, nonzero=false)
module grid2d(spacing, n, size, stagger=false, inside=undef, nonzero)
{
assert(in_list(stagger, [false, true, "alt"]));
bounds = is_undef(inside)? undef :
is_path(inside)? pointlist_bounds(inside) :
assert(is_region(inside))
pointlist_bounds(flatten(inside));
nonzero = is_path(inside) ? default(nonzero,false)
: assert(is_undef(nonzero), "nonzero only allowed if inside is a polygon")
false;
size = is_num(size)? [size, size] :
is_vector(size)? assert(len(size)==2) size :
bounds!=undef? [