Fixed a bunch of undef math warnings with dev snapshot OpenSCAD builds.

This commit is contained in:
Garth Minette
2020-10-03 19:50:29 -07:00
parent e3ccf482fa
commit 16ee49e8b2
15 changed files with 215 additions and 161 deletions

View File

@@ -38,7 +38,7 @@
// is_vector([1,1,1],all_nonzero=false); // Returns true
// is_vector([],zero=false); // Returns false
function is_vector(v, length, zero, all_nonzero=false, eps=EPSILON) =
is_list(v) && is_num(0*(v*v))
is_list(v) && is_num(v[0]) && is_num(0*(v*v))
&& (is_undef(length) || len(v)==length)
&& (is_undef(zero) || ((norm(v) >= eps) == !zero))
&& (!all_nonzero || all_nonzero(v)) ;