-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[irtgeo.l] enable :rotation-axis :xy :yz :zx :yx :zy :xz #568
Open
Naoki-Hiraoka
wants to merge
4
commits into
euslisp:master
Choose a base branch
from
Naoki-Hiraoka:enable-dual-rotation-axis
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
c3603fe
[irtgeo.l] enable :rotation-axis :xy :yz :zx :yx :zy :xz
Naoki-Hiraoka 85c060d
[irtgeo.l] fix documentation of :difference-position and :difference-…
Naoki-Hiraoka 815f8b4
[iregeo.l :difference-rotation] use let, and fix 0 norm condition
Naoki-Hiraoka 85d63f9
[doc/irtmodel.tex]add document for translation/rotation-axis
Naoki-Hiraoka File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,7 +69,7 @@ | |
dif-pos)) | ||
(:difference-rotation | ||
(coords &key (rotation-axis t)) | ||
"return difference in rotation of given coords, rotation-axis can take (:x, :y, :z, :xx, :yy, :zz, :xm, :ym, :zm)" | ||
"return difference in rotation of given coords, rotation-axis can take (:x, :y, :z, :xy, :yz, :zx, :xx, :yy, :zz, :xm, :ym, :zm)" | ||
(labels | ||
((need-mirror-for-nearest-axis | ||
(coords0 coords1 axis) | ||
|
@@ -88,6 +88,19 @@ | |
(setq dif-rot | ||
(transform (transpose (send self :worldrot)) | ||
(scale (acos (v. a0 a1)) (normalize-vector (v* a0 a1)))))) | ||
((:xy :yx :yz :zy :zx :xz) | ||
(setq a0 (send self :axis (case rotation-axis ((:xy :yx) :z) ((:yz :zy) :x) ((:zx :xz) :y))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about use 'let'. The following code is my suggestion.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you. I fixed. 815f8b4 |
||
a1 (send coords :axis (case rotation-axis ((:xy :yx) :z) ((:yz :zy) :x) ((:zx :xz) :y)))) | ||
(setq dif-rot | ||
(transform (transpose (send self :worldrot)) | ||
(scale (acos (v. a0 a1)) (normalize-vector (v* a0 a1))))) | ||
(let ((self-coords (send (send self :copy-worldcoords) :rotate (norm dif-rot) dif-rot))) | ||
(setq a0 (send self-coords :axis (case rotation-axis ((:xy :yx) :x) ((:yz :zy) :y) ((:zx :xz) :z))) | ||
a1 (send coords :axis (case rotation-axis ((:xy :yx) :x) ((:yz :zy) :y) ((:zx :xz) :z)))) | ||
(setq dif-rot | ||
(transform (transpose (send self-coords :worldrot)) | ||
(scale (acos (v. a0 a1)) (normalize-vector (v* a0 a1)))))) | ||
) | ||
((:xx :yy :zz) | ||
(let ((axis (case rotation-axis (:xx :x) (:yy :y) (:zz :z))) a0 a2) | ||
(setq a0 (send self :axis axis)) | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about adding
:yx :zy :xz
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation of
:difference-position
does not have:yx :zy :xz
.I made the documentation of
:difference-rotation
similar to:difference-position
.jskeus/irteus/irtgeo.l
Lines 56 to 58 in 8902642
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see.
But
rotation-axis
, the argument of:difference-rotation
, can take:yx, :zy, :zx
. This is clear from your commit. c3603fe#diff-23ea0c1757d7ef177d46886dd7b78a15R91I think that good documentation supports other users. So how about changing the document of
difference-position
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It ’s true. I fixed. 85c060d
Thank you!