1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-19 13:01:37 +02:00
This commit is contained in:
Justin Lin
2019-05-15 19:23:26 +08:00
parent 77b3c4c9db
commit 53b7d7a628

View File

@@ -8,15 +8,18 @@
*
**/
function _to_tvect(v) =
len(v) == 3 ? v : (
len(v) == 2 ? [v[0], v[1], 0] : (
len(v) == 1 ? [v[0], 0, 0] : [v, 0, 0]
)
include <__private__/__is_float.scad>;
function _to_3_elems_translation_vect(v) =
let(leng = len(v))
leng == 3 ? v : (
leng == 2 ? [v[0], v[1], 0] : [v[0], 0, 0]
);
function _to_translation_vect(v) = __is_float(v) ? [v, 0, 0] : _to_3_elems_translation_vect(v);
function m_translation(v) =
let(vt = _to_tvect(v))
let(vt = _to_translation_vect(v))
[
[1, 0, 0, vt[0]],
[0, 1, 0, vt[1]],