mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-08-18 18:11:16 +02:00
handle undef properly in cuboid
This commit is contained in:
@@ -461,7 +461,7 @@ function list(l) = is_list(l)? l : [for (x=l) x];
|
|||||||
// Arguments:
|
// Arguments:
|
||||||
// value = The value or list to coerce into a list.
|
// value = The value or list to coerce into a list.
|
||||||
// n = The number of items in the coerced list. Default: 1
|
// 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:
|
// Example:
|
||||||
// x = force_list([3,4,5]); // Returns: [3,4,5]
|
// x = force_list([3,4,5]); // Returns: [3,4,5]
|
||||||
// y = force_list(5); // Returns: [5]
|
// y = force_list(5); // Returns: [5]
|
||||||
|
@@ -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?)")
|
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");
|
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]));
|
edges = _edges(edges, except=first_defined([except_edges,except]));
|
||||||
teardrop = is_bool(teardrop)&&teardrop? 45 : teardrop;
|
teardrop = is_bool(teardrop)&&teardrop? 45 : teardrop;
|
||||||
chamfer = approx(chamfer,0) ? undef : chamfer;
|
chamfer = approx(chamfer,0) ? undef : chamfer;
|
||||||
|
Reference in New Issue
Block a user