1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-18 06:38:14 +01:00

added round_vectors

This commit is contained in:
Justin Lin 2017-06-15 10:34:22 +08:00
parent ef2fb3c6d3
commit 8b2b2c0d56

View File

@ -111,4 +111,16 @@ module round_echo_pts(points, float_digits = 4) {
module round_echo_n(number, float_digits = 4) {
echo(round_n(number, float_digits));
}
}
function mul_round_vector(vector, n) =
let(vt = vector * n)
[for(v = vt) round(v)];
function round_vectors(vectors, float_digits = 4) =
let(n = pow(10, float_digits))
[for(vt = vectors) mul_round_vector(vt, n) / n];
module round_echo_vectors(vectors, float_digits = 4) {
echo(round_vectors(vectors, float_digits = 4));
}