mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-19 13:01:37 +02:00
refactor
This commit is contained in:
@@ -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]],
|
||||
|
Reference in New Issue
Block a user