From e36fd9bd46b7e07b028af1c00343d5cdc884c708 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Thu, 10 Mar 2022 20:14:13 +0800 Subject: [PATCH] refactor --- src/matrix/_impl/_m_translation_impl.scad | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/matrix/_impl/_m_translation_impl.scad b/src/matrix/_impl/_m_translation_impl.scad index 3c026576..b9b7fed0 100644 --- a/src/matrix/_impl/_m_translation_impl.scad +++ b/src/matrix/_impl/_m_translation_impl.scad @@ -1,13 +1,13 @@ 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]; + 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 _m_translation_impl(v) = let(vt = _to_translation_vect(v)) - [ + [ [1, 0, 0, vt.x], [0, 1, 0, vt.y], [0, 0, 1, vt.z],