mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-09-03 03:42:37 +02:00
screws update, including critical bugfix
This commit is contained in:
@@ -697,7 +697,8 @@ function get_radius(r1, r2, r, d1, d2, d, dflt) =
|
||||
// same way that OpenSCAD expands short vectors in some contexts, e.g. cube(10) or rotate([45,90]).
|
||||
// If `v` is a scalar, and `dflt==undef`, returns `[v, v, v]`.
|
||||
// If `v` is a scalar, and `dflt!=undef`, returns `[v, dflt, dflt]`.
|
||||
// If `v` is a vector, returns the first 3 items, with any missing values replaced by `dflt`.
|
||||
// If `v` is a vector and dflt is defined, returns the first 3 items, with any missing values replaced by `dflt`.
|
||||
// If `v` is a vector and dflt is undef, returns the first 3 items, with any missing values replaced by 0.
|
||||
// If `v` is `undef`, returns `undef`.
|
||||
// Arguments:
|
||||
// v = Value to return vector from.
|
||||
@@ -707,6 +708,8 @@ function get_radius(r1, r2, r, d1, d2, d, dflt) =
|
||||
// vec = scalar_vec3(10); // Returns: [10,10,10]
|
||||
// vec = scalar_vec3(10,1); // Returns: [10,1,1]
|
||||
// vec = scalar_vec3([10,10],1); // Returns: [10,10,1]
|
||||
// vec = scalar_vec3([10,10]); // Returns: [10,10,0]
|
||||
// vec = scalar_vec3([10]); // Returns: [10,0,0]
|
||||
function scalar_vec3(v, dflt) =
|
||||
is_undef(v)? undef :
|
||||
is_list(v)? [for (i=[0:2]) default(v[i], default(dflt, 0))] :
|
||||
|
Reference in New Issue
Block a user