From cf5bfa0f3b99c641cfc4c343bfe747614bd9feee Mon Sep 17 00:00:00 2001 From: Adrian Mariano Date: Sun, 23 Feb 2025 18:06:57 -0500 Subject: [PATCH] handle undef properly in cuboid --- lists.scad | 2 +- shapes3d.scad | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lists.scad b/lists.scad index 6ccb8a6e..47d6844a 100644 --- a/lists.scad +++ b/lists.scad @@ -461,7 +461,7 @@ function list(l) = is_list(l)? l : [for (x=l) x]; // Arguments: // value = The value or list to coerce into a list. // n = The number of items in the coerced list. Default: 1 -// fill = The value to pad the coerced list with, after the firt value. Default: undef (pad with copies of `value`) +// fill = The value to pad the coerced list with, after the first value. Default: undef (pad with copies of `value`) // Example: // x = force_list([3,4,5]); // Returns: [3,4,5] // y = force_list(5); // Returns: [5] diff --git a/shapes3d.scad b/shapes3d.scad index 3a838b7c..27522c4a 100644 --- a/shapes3d.scad +++ b/shapes3d.scad @@ -332,7 +332,7 @@ module cuboid( } sizecheck = assert(num_defined([size,p1,p2])!=3, "\nCannot give size if p2 is given (did you forget braces on the size argument?)") assert(is_def(p1) || is_undef(p2), "If p2 is given you must also give p1"); - size = default(force_list(size,3),[1,1,1]); + size = force_list(default(size,1),3); edges = _edges(edges, except=first_defined([except_edges,except])); teardrop = is_bool(teardrop)&&teardrop? 45 : teardrop; chamfer = approx(chamfer,0) ? undef : chamfer;