1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-12 17:54:18 +02:00
This commit is contained in:
Justin Lin
2019-05-15 19:14:21 +08:00
parent f690952f1f
commit f8f7adbb45
2 changed files with 9 additions and 9 deletions

View File

@@ -0,0 +1,7 @@
function __to_3_elems_vect(a) =
let(leng = len(a))
leng == 3 ? a : (
leng == 2 ? [a[0], a[1], 0] : [a[0], 0, 0]
);
function __to_ang_vect(a) = __is_float(a) ? [0, 0, a] : __to_3_elems_vect (a);

View File

@@ -9,6 +9,7 @@
**/
include <__private__/__is_float.scad>;
include <__private__/__to_ang_vector.scad>;
function _q_rotation(a, v) =
let(
@@ -68,16 +69,8 @@ function _m_zRotation(a) =
[0, 0, 0, 1]
];
function _to_3_elems_vect(a) =
let(leng = len(a))
leng == 3 ? a : (
leng == 2 ? [a[0], a[1], 0] : [a[0], 0, 0]
);
function _to_ang_vect(a) = __is_float(a) ? [0, 0, a] : _to_3_elems_vect(a);
function _xyz_rotation(a) =
let(ang = _to_ang_vect(a))
let(ang = __to_ang_vect(a))
_m_zRotation(ang[2]) * _m_yRotation(ang[1]) * _m_xRotation(ang[0]);
function m_rotation(a, v) =