1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-08-20 14:21:40 +02:00

Added circlips.

This commit is contained in:
Chris Palmer
2020-03-24 17:22:32 +00:00
parent c1b5bd1b87
commit f2ec3e71f4
9 changed files with 241 additions and 27 deletions

View File

@@ -56,6 +56,13 @@ function rotate(a, v) = //! Generate a 4x4 rotation matrix, ```a``` can be a vec
[ 0, 0, 0, 1]
];
function rot3_z(a) = //! Generate a 3x3 matrix to rotate around z
let(c = cos(a),
s = sin(a))
[ [ c, -s, 0],
[ s, c, 0],
[ 0, 0, 1] ];
function scale(v) = let(s = is_list(v) ? v : [v, v, v]) //! Generate a 4x4 matrix that scales by ```v```, which can be a vector of xyz factors or a scalar to scale all axes equally
[
[s.x, 0, 0, 0],