Skip to content

Commit

Permalink
Merge pull request #504 from k-okada/fix_500
Browse files Browse the repository at this point in the history
rewrite Fix rotate-vertices when an axis argument is float-vector
  • Loading branch information
k-okada authored Jun 27, 2023
2 parents 20ab5c2 + 2009d50 commit 96fbc78
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lisp/geo/geobody.l
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
;move all vertices with respect to this coordinates
;without moving coordinates.
(let (rotmat)
(if (float-vector-p axis) (setq rotmat (rotation rad axis)))
(if (float-vector-p axis) (setq rotmat (rotation-matrix rad axis)))
(dolist (v model-vertices)
(if (float-vector-p axis)
(transform rotmat v v)
Expand Down
13 changes: 13 additions & 0 deletions test/geo.l
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,19 @@
))
)

;; test to check https://github.com/euslisp/EusLisp/issues/499
(deftest rotate-vertices ()
(let ((a (make-cube 10 20 30)) v0 v1)
(setq v0 (copy-object (send a :vertices)))
(send a :rotate-vertices pi/2 #f(0 0 1))
(setq v1 (send a :vertices))
(dotimes (i (length v0))
(assert (eps= (elt (elt v0 i) 0) (elt (elt v1 i) 1)))
(assert (eps= (elt (elt v0 i) 1) (- (elt (elt v1 i) 0))))
(assert (eps= (elt (elt v0 i) 2) (elt (elt v1 i) 2)))
)
))

(eval-when (load eval)
(run-all-tests)
(exit))

1 comment on commit 96fbc78

@k-okada
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for contributing EusLisp documentation

Please check latest documents before merging

PDF version of English manual: manual.pdf
PDF version of Japanese jmanual: jmanual.pdf
HTML version of English manual: manual.html
HTML version of Japanese manual: jmanual.html
Sphinx (ReST) version of English manual: manual.rst

Please sign in to comment.