[Bf-python] last angleBetweenVectors bug?

Campbell Barton cbarton at metavr.com
Sun Oct 9 05:42:43 CEST 2005


Theres still a bug that makes AngleBetweenVecs return NAN when both 
vectors are the same.
Checking weather V1 == V2, almost always works, but in some situations a 
slight difference will make the 2 vectors not equel but still return 
NAN- if you need a testcase I can provide one. but I assume that looking 
at the code will show how 2 vectors that are the same could return NAN.

- Cam

Frank Schafer wrote:
> Hi,
> IMHO you should simply catch this exception, because (again IMHO) it
> MAKES sense that Mathutils complains to calculate angles between vectors
> of zero length.
>
> Regards
> Frank
>
>
> On Fri, 2005-10-07 at 09:57 +1000, Campbell Barton wrote:
>   
>> Found that AngleBetweenVecs raises an error when checking for a zero 
>> length Vector
>>
>> # Heres my test from the interactive console.
>> print Mathutils.AngleBetweenVecs(Mathutils.Vector(10.0, 0 , 0), 
>> Mathutils.Vector(0,1,0))
>> exceptions.AttributeError:  Mathutils.AngleBetweenVecs(): zero-length 
>> vectors not acceptable
>>
>> - Cam
>>
>>     
> _______________________________________________
> Bf-python mailing list
> Bf-python at projects.blender.org
> http://projects.blender.org/mailman/listinfo/bf-python
>
>   


-- 
Campbell J Barton

133 Hope Street
Geelong West, Victoria 3218 Australia

URL:    http://www.metavr.com
e-mail: cbarton at metavr.com
phone: AU (03) 5229 0241



More information about the Bf-python mailing list