Skip to content

Commit c3603fe

Browse files
committed
[irtgeo.l] enable :rotation-axis :xy :yz :zx :yx :zy :xz
1 parent 8902642 commit c3603fe

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

irteus/irtgeo.l

+14-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
dif-pos))
7070
(:difference-rotation
7171
(coords &key (rotation-axis t))
72-
"return difference in rotation of given coords, rotation-axis can take (:x, :y, :z, :xx, :yy, :zz, :xm, :ym, :zm)"
72+
"return difference in rotation of given coords, rotation-axis can take (:x, :y, :z, :xy, :yz, :zx, :xx, :yy, :zz, :xm, :ym, :zm)"
7373
(labels
7474
((need-mirror-for-nearest-axis
7575
(coords0 coords1 axis)
@@ -88,6 +88,19 @@
8888
(setq dif-rot
8989
(transform (transpose (send self :worldrot))
9090
(scale (acos (v. a0 a1)) (normalize-vector (v* a0 a1))))))
91+
((:xy :yx :yz :zy :zx :xz)
92+
(setq a0 (send self :axis (case rotation-axis ((:xy :yx) :z) ((:yz :zy) :x) ((:zx :xz) :y)))
93+
a1 (send coords :axis (case rotation-axis ((:xy :yx) :z) ((:yz :zy) :x) ((:zx :xz) :y))))
94+
(setq dif-rot
95+
(transform (transpose (send self :worldrot))
96+
(scale (acos (v. a0 a1)) (normalize-vector (v* a0 a1)))))
97+
(let ((self-coords (send (send self :copy-worldcoords) :rotate (norm dif-rot) dif-rot)))
98+
(setq a0 (send self-coords :axis (case rotation-axis ((:xy :yx) :x) ((:yz :zy) :y) ((:zx :xz) :z)))
99+
a1 (send coords :axis (case rotation-axis ((:xy :yx) :x) ((:yz :zy) :y) ((:zx :xz) :z))))
100+
(setq dif-rot
101+
(transform (transpose (send self-coords :worldrot))
102+
(scale (acos (v. a0 a1)) (normalize-vector (v* a0 a1))))))
103+
)
91104
((:xx :yy :zz)
92105
(let ((axis (case rotation-axis (:xx :x) (:yy :y) (:zz :z))) a0 a2)
93106
(setq a0 (send self :axis axis))

0 commit comments

Comments
 (0)