mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2024-12-29 16:29:40 +00:00
vectors.scad usage fixes
This commit is contained in:
parent
fbd7f18440
commit
f8064d529f
1 changed files with 6 additions and 4 deletions
10
vectors.scad
10
vectors.scad
|
@ -17,13 +17,14 @@
|
||||||
|
|
||||||
// Function: is_vector()
|
// Function: is_vector()
|
||||||
// Usage:
|
// Usage:
|
||||||
// is_vector(v, [length], ...);
|
// bool = is_vector(v, [length], [zero=], [all_nonzero=], [eps=]);
|
||||||
// Description:
|
// Description:
|
||||||
// Returns true if v is a list of finite numbers.
|
// Returns true if v is a list of finite numbers.
|
||||||
// Arguments:
|
// Arguments:
|
||||||
// v = The value to test to see if it is a vector.
|
// v = The value to test to see if it is a vector.
|
||||||
// length = If given, make sure the vector is `length` items long.
|
// length = If given, make sure the vector is `length` items long.
|
||||||
// zero = If false, require that the length/`norm()` of the vector is not approximately zero. If true, require the length/`norm()` of the vector to be approximately zero-length. Default: `undef` (don't check vector length/`norm()`.)
|
// ---
|
||||||
|
// zero = If false, require that the `norm()` of the vector is not approximately zero. If true, require the `norm()` of the vector to be approximately zero. Default: `undef` (don't check vector `norm()`.)
|
||||||
// all_nonzero = If true, requires all elements of the vector to be more than `eps` different from zero. Default: `false`
|
// all_nonzero = If true, requires all elements of the vector to be more than `eps` different from zero. Default: `false`
|
||||||
// eps = The minimum vector length that is considered non-zero. Default: `EPSILON` (`1e-9`)
|
// eps = The minimum vector length that is considered non-zero. Default: `EPSILON` (`1e-9`)
|
||||||
// Example:
|
// Example:
|
||||||
|
@ -73,7 +74,8 @@ function add_scalar(v,s) =
|
||||||
// v3 = v_mul(v1, v2);
|
// v3 = v_mul(v1, v2);
|
||||||
// Description:
|
// Description:
|
||||||
// Element-wise multiplication. Multiplies each element of `v1` by the corresponding element of `v2`.
|
// Element-wise multiplication. Multiplies each element of `v1` by the corresponding element of `v2`.
|
||||||
// Both `v1` and `v2` must be the same length. Returns a vector of the products.
|
// Both `v1` and `v2` must be the same length. Returns a vector of the products. Note that
|
||||||
|
// the items in `v1` and `v2` can be anything that OpenSCAD will multiply.
|
||||||
// Arguments:
|
// Arguments:
|
||||||
// v1 = The first vector.
|
// v1 = The first vector.
|
||||||
// v2 = The second vector.
|
// v2 = The second vector.
|
||||||
|
@ -135,7 +137,7 @@ function v_ceil(v) =
|
||||||
|
|
||||||
// Function: v_lookup()
|
// Function: v_lookup()
|
||||||
// Usage:
|
// Usage:
|
||||||
// v2 = v_ceil(x, v);
|
// v2 = v_lookup(x, v);
|
||||||
// Description:
|
// Description:
|
||||||
// Works just like the built-in function [`lookup()`](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Mathematical_Functions#lookup), except that it can also interpolate between vector result values of the same length.
|
// Works just like the built-in function [`lookup()`](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Mathematical_Functions#lookup), except that it can also interpolate between vector result values of the same length.
|
||||||
// Arguments:
|
// Arguments:
|
||||||
|
|
Loading…
Reference in a new issue