-
Notifications
You must be signed in to change notification settings - Fork 47
[lisp/geo/geopack.l] normalize norm vector in optional arugment of vector-angle function. (Improved version of #262) #264
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
base: master
Are you sure you want to change the base?
Conversation
how do you think we we move https://github.com/euslisp/jskeus/blob/master/irteus/irtmath.l#L610-L620. to EusLisp? Basically it is not good idea to change existing behavior #257 (comment) but...
|
As far as I know, it's no problem. Are there any application which uses raw eus instead of irteus? |
Geometry classes defined in euslisp are most important users of normalized-vector defined in eus. Following many source codes use normalized-vector defined in eus. It's difficult to check all effects of changing normalized-vector... So, I think keeping current definition will be safe.
|
can we check if they uses '*nan* after using `normalize-vector` , by using
`grep -A 5 normalize-vector`?
…--
◉ Kei Okada
2018-02-28 15:01 GMT+09:00 Masaki Murooka <notifications@github.com>:
Following many source codes use normalized-vector defined in eus. It's
difficult to check all effects of changing normalized-vector... So, I think
keeping current definition will be safe.
***@***.***:~/ros/indigo_parent/src/euslisp/Euslisp$ find ./ -name "*.l" | xargs grep normalize-vector
./lib/demo/hehehe.l: (setq pln (make-plane :normal (normalize-vector #f(1 2 8))
./lib/demo/meteor.l: (normalize-vector
./lib/demo/kogi.l: (setq pln (make-plane :normal (normalize-vector #f(1 2 8))
./lib/llib/eusdraw.l: (normalize-vector (rotate-vector a 0.5 nil))))
./lib/llib/eusdraw.l: (normalize-vector (rotate-vector a -0.5 nil))))
./lib/llib/eusdraw.l: (normalize-vector (rotate-vector a 0.5 nil))))
./lib/llib/eusdraw.l: (normalize-vector (rotate-vector a -0.5 nil))))
./lib/llib/utyo.l: (normalize-vector (v* (v- p3 p2)
./lib/llib/quaternion.l: ss (scale (sqrt (- 1.0 (* ss ss))) (normalize-vector aa))))
./lib/llib/quaternion.l: (:axis () (normalize-vector a))
./contrib/utyo/glue.l: (let* ((v1 (normalize-vector (v- (edg . pvert) (edg . nvert))))
./contrib/utyo/glue.l: (setq ang (vector-angle (normalize-vector (v- p1 int-point))
./contrib/utyo/glue.l: (normalize-vector (v- p2 int-point))))
./contrib/utyo/glue.l: (normalize-vector
./contrib/utyo/glue.l: (normalize-vector
./contrib/utyo/part.l: (norm (normalize-vector
./contrib/utyo/linraphs.l: (r3 (normalize-vector (v* r1 r2))))
./contrib/utyo/linraphs.l: (v* r3 (normalize-vector r1) r2)
./contrib/utyo/local.l: (normalize-vector
./contrib/utyo/newton.l: (r3 (normalize-vector (v* r1 r2))))
./contrib/utyo/newton.l: (v* r3 (normalize-vector r1) r2)
./contrib/utyo/round.l: (n-vect (normalize-vector vect))
./contrib/utyo/round.l: (norm (normalize-vector
./contrib/utyo/round.l: (norm (normalize-vector
./contrib/utyo/round.l: (norm (normalize-vector
./contrib/utyo/localop.l: (norm (normalize-vector
./contrib/contact/model2constRobust.l: :nvertex (normalize-vector (scale sign n-point))
./lisp/geo/geopack.l: (normalize-vector (v- dest org)))
./lisp/geo/geopack.l: (normalize-vector (v* (v- b a) (v- c a))))
./lisp/geo/geopack.l:(defun vector-angle (v1 v2 &optional (normal (normalize-vector (v* v1 v2))) (parallel-thre 1e-10))
./lisp/geo/geopack.l: (normalize-vector normal normal)) )
./lisp/geo/geopack.l: (normalize-vector (float-vector (random 1.0) (random 1.0) (random 1.0))))
./lisp/geo/geopack.l: (:direction () (normalize-vector (v- nvert pvert)))
./lisp/geo/geopack.l: (cond ((eq f pface) (normalize-vector (v- nvert pvert)))
./lisp/geo/geopack.l: ((eq f nface) (normalize-vector (v- pvert nvert)))
./lisp/geo/geopack.l: (normalize-vector (v* (cond ((eq f pface) (v- nvert pvert))
./lisp/geo/geopack.l: (normalize-vector (v- nvert pvert)))))
./lisp/geo/geopack.l: (let* ((z (normalize-vector (v- nvert pvert)))
./lisp/geo/geopack.l:; (setq light-source (normalize-vector
./lisp/geo/geopack.l: (if (minusp (* sign1 sign2)) (normalize-vector (scale sign1 normal)))))
./lisp/geo/geopack.l: (setq normal (normalize-vector normal))
./lisp/geo/gdome.l: (normalize-vector gvector gvector)
./lisp/geo/viewing.l: (setq view-direction (normalize-vector view-direction))
./lisp/geo/viewing.l: (setq view-right (normalize-vector view-right))
./lisp/geo/viewing.l: (setq view-up (normalize-vector (v* view-right view-direction)))
./lisp/geo/viewing.l: (normalize-vector
./lisp/geo/viewing.l: (setq v1 (normalize-vector (send box :minpoint))
./lisp/geo/viewing.l: v2 (normalize-vector (send box :maxpoint)))
./lisp/geo/viewing.l: (normalize-vector
./lisp/geo/lighting.l: (normalize-vector
./lisp/geo/render.l: (normalize-vector
./lisp/geo/render.l: (normalize-vector normal-view normal-view)
./lisp/geo/render.l: (normalize-vector lighting normal-lighting)
./lisp/geo/extroid.l: (normalize-vector (float-vector (random 1.0) (random 1.0))))
./lisp/geo/geobody.l: (t (normalize-vector axis))))
./lisp/geo/geobody.l: (scale radius (normalize-vector (v- point (send self :worldpos))))))
./lisp/geo/grahamhull.l: (vstart (normalize-vector (v- start o)))
./lisp/geo/grahamhull.l: (normalize-vector vtemp vtemp)
./lisp/geo/primt.l: (n (normalize-vector (v* v1 v2))))
./lisp/geo/primt.l: (vector-angle (normalize-vector vec)
./lisp/geo/primt.l: (normalize-vector fvec)
./lisp/geo/primt.l: (normalize-vector (v* vec fvec))
./lisp/geo/primt.l: (normalize-vector n)
./lisp/geo/primt.l: (normalize-vector (v* #f(0 0 1) n))
./lisp/geo/primt.l: (setq v (scale radius (normalize-vector (v+ (e . pvert) (e . nvert)))))
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#264 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAeG3LfCQnx4IlbCxAL0q0WuC50Wsa05ks5tZOu2gaJpZM4SL-na>
.
|
can you check more detail of how they uses 'normalize-vector' using 'grep -A' ? |
https://gist.github.com/mmurooka/282f7aec8dba5ddc7630a92849dced12 is result of grep. For example, if some user writes only the following simple code, behavior changes. (setq tmp-edge (make-line #f(0 0 0) #f(0 0 0)))
(when (equal *nan* (norm (send tmp-edge :direction)))
...)
;; becomes true in current behavior but becomes false if we change normalize-vector behavior. |
Sorry that I'm confused, this PR does not change the behavior of |
@mmurooka can you check 'norm' use cases? |
Yes, this PR does NOT change the behavior of 1.irteusgl$ (vector-angle #f(1 0 0) #f(1 1 0))
0.785398
2.irteusgl$ (vector-angle #f(2 0 0) #f(1 1 0))
1.10715 ;; result does not same !!! Sorry but what is the purpose of |
Sorry this is my misunderstanding
I thought |
This is improved version of #262 according to the comments of #262 (comment) and 038d5bc#commitcomment-27667058 .