Make stroke() assert that path is 2D.

This commit is contained in:
Revar Desmera 2019-07-10 13:03:17 -07:00
parent e2e6bcf2f9
commit e60648dadd

View file

@ -33,6 +33,7 @@ module stroke(path, width=1, endcaps=true, close=false)
{
$fn = quantup(segs(width/2),4);
path = close? concat(path,[path[0]]) : path;
assert(is_list(path) && is_vector(path[0]) && len(path[0])==2, "path must be a 2D list of points.");
segments = pair(path);
segpairs = pair(segments);