← Back to team overview

yade-users team mailing list archive

Be carefull with "normalize"

 

Hello

Be aware that if you use the "normalize" function from wm3, it might give the result (0,0,0) if the norm of the vector is smaller than a "tolerance" value. It sounds very strange to me, as I see no reason for this check, and I was wondering if it could not cause problems in some cases, when a "normalized" vector has length 0... Janek had this problem when defining the normal of some triangular facets (of small size) by normalizing the cross product of edges vectors. I prefer not to be the only one thinking about this potential problem, which probably needs a fix.

A few ideas from a discussion with Janek :
1- possibly fix minWm3 so that the test vs. tolerance is removed
2- display a warning to the user when the tolerance is hit and the vector is "rounded" to (0,0,0)
3-  run batch tests with/without the tolerance test

Bruno



--

_______________
Chareyre Bruno
Maitre de conference

Grenoble INP
Laboratoire 3SR - bureau E145
BP 53 - 38041, Grenoble cedex 9 - France
Tél : 33 4 56 52 86 21
Fax : 33 4 76 82 70 43
________________




Follow ups