mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-20 21:41:41 +02:00
refactor
This commit is contained in:
@@ -8,15 +8,18 @@
|
|||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
|
|
||||||
function _to_tvect(v) =
|
include <__private__/__is_float.scad>;
|
||||||
len(v) == 3 ? v : (
|
|
||||||
len(v) == 2 ? [v[0], v[1], 0] : (
|
function _to_3_elems_translation_vect(v) =
|
||||||
len(v) == 1 ? [v[0], 0, 0] : [v, 0, 0]
|
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) =
|
function m_translation(v) =
|
||||||
let(vt = _to_tvect(v))
|
let(vt = _to_translation_vect(v))
|
||||||
[
|
[
|
||||||
[1, 0, 0, vt[0]],
|
[1, 0, 0, vt[0]],
|
||||||
[0, 1, 0, vt[1]],
|
[0, 1, 0, vt[1]],
|
||||||
|
Reference in New Issue
Block a user