1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-01-17 05:28:14 +01:00

Documented xor() function.

This commit is contained in:
Chris Palmer 2021-04-02 19:28:49 +01:00
parent c073419c0b
commit f3376edaf1
3 changed files with 6 additions and 1 deletions

View File

@ -3,6 +3,9 @@
This changelog is generated by `changelog.py` using manually added semantic version tags to classify commits as breaking changes, additions or fixes.
### [v15.3.0](https://github.com/nophead/NopSCADlib/releases/tag/v15.3.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v15.2.0...v15.3.0 "diff with v15.2.0")
* 2021-04-02 [`c073419`](https://github.com/nophead/NopSCADlib/commit/c073419c0b4eddcda4cda5bd0f8d48268b6e58ec "show commit") [C.P.](# "Chris Palmer") Added `opengrab_screw_depth()` function.
### [v15.2.0](https://github.com/nophead/NopSCADlib/releases/tag/v15.2.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v15.1.1...v15.2.0 "diff with v15.1.1")
* 2021-03-22 [`ca1b34e`](https://github.com/nophead/NopSCADlib/commit/ca1b34e9cad5d82bd878fa4ebf439c0fbdad7f77 "show commit") [C.P.](# "Chris Palmer") Added `sink` parameter to `screw_polysink()` to recess the head.

View File

@ -5863,6 +5863,7 @@ Maths utilities for manipulating vectors and matrices.
| `vec2(v)` | Return a 2 vector with the first two elements of `v` |
| `vec3(v)` | Return a 3 vector with the first three elements of `v` |
| `vec4(v)` | Return a 4 vector with the first three elements of `v` |
| `xor(a,b)` | Logical exclusive OR |
### Modules
| Module | Description |

View File

@ -160,4 +160,5 @@ function mapi(v, func) = [ for (i = [0:len(v)-1]) func(i,v[i]) ]; //! make a new
function reduce(v, func, unity) = let ( r = function(i,val) i == len(v) ? val : r(i + 1, func(val, v[i])) ) r(0, unity); //! reduce a vector v to a single entity by applying the func function recursively to the reduced value so far and the next element, starting with unity as the initial reduced value
function sumv(v) = reduce(v, function(a, b) a + b, 0); //! sum a vector of values that can be added with "+"
function xor(a,b) = (a && !b) || (!a && b);
function xor(a,b) = (a && !b) || (!a && b); //! Logical exclusive OR
function cuberoot(x)= sign(x)*abs(x)^(1/3);