mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-11 09:14:29 +02:00
always to a vect
This commit is contained in:
@@ -1,6 +1,15 @@
|
|||||||
function m_translation(v) = [
|
function _to_vect(v) =
|
||||||
[1, 0, 0, v[0]],
|
len(v) == 3 ? v : (
|
||||||
[0, 1, 0, v[1]],
|
len(v) == 2 ? [v[0], v[1], 0] : (
|
||||||
[0, 0, 1, v[2]],
|
len(v) == 1 ? [v[0], 0, 0] : [v, 0, 0]
|
||||||
[0, 0, 0, 1]
|
)
|
||||||
];
|
);
|
||||||
|
|
||||||
|
function m_translation(v) =
|
||||||
|
let(vt = _to_vect(v))
|
||||||
|
[
|
||||||
|
[1, 0, 0, vt[0]],
|
||||||
|
[0, 1, 0, vt[1]],
|
||||||
|
[0, 0, 1, vt[2]],
|
||||||
|
[0, 0, 0, 1]
|
||||||
|
];
|
Reference in New Issue
Block a user