1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-21 14:04:53 +02:00

always to a vect

This commit is contained in:
Justin Lin
2019-05-02 10:27:45 +08:00
parent 5972c4f551
commit 32e582554c

View File

@@ -1,5 +1,12 @@
function _to_vect(s) =
len(s) == 3 ? s : (
len(s) == 2 ? [s[0], s[1], 1] : (
len(s) == 1 ? [s[0], 1, 1] : [s, s, s]
)
);
function m_scaling(s) = function m_scaling(s) =
let(v = len(s) == 3 ? s : [s, s, s]) let(v = _to_vect(s))
[ [
[v[0], 0, 0, 0], [v[0], 0, 0, 0],
[0, v[1], 0, 0], [0, v[1], 0, 0],