1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-14 10:44:48 +02:00
This commit is contained in:
Justin Lin
2022-03-10 20:14:13 +08:00
parent 2687844621
commit e36fd9bd46

View File

@@ -1,13 +1,13 @@
function _to_3_elems_translation_vect(v) = function _to_3_elems_translation_vect(v) =
let(leng = len(v)) let(leng = len(v))
leng == 3 ? v : leng == 3 ? v :
leng == 2 ? [v[0], v[1], 0] : [v[0], 0, 0]; leng == 2 ? [each v, 0] : [v.x, 0, 0];
function _to_translation_vect(v) = is_num(v) ? [v, 0, 0] : _to_3_elems_translation_vect(v); function _to_translation_vect(v) = is_num(v) ? [v, 0, 0] : _to_3_elems_translation_vect(v);
function _m_translation_impl(v) = function _m_translation_impl(v) =
let(vt = _to_translation_vect(v)) let(vt = _to_translation_vect(v))
[ [
[1, 0, 0, vt.x], [1, 0, 0, vt.x],
[0, 1, 0, vt.y], [0, 1, 0, vt.y],
[0, 0, 1, vt.z], [0, 0, 1, vt.z],