[Bf-python] AngleBetweenVecs still buggy.

Campbell Barton cbarton at metavr.com
Tue Sep 27 04:42:21 CEST 2005


--- Stephen Swaney <sswaney at centurytel.net> wrote:
>   
>> On Tue, Sep 27, 2005 at 09:17:37AM +1000, Campbell
>> Barton wrote:
>>     
>>> Hi Joseph, thanks for committing Theeths patch,
>>>       
>> Yah Joseph!
>>     
>
> Yay!
>
>   
>>> From recent testing AngleBetweenVecs only returns
>>>       
>> NAN when given a zero 
>>     
>>> length vector.
>>> Useually Id say that it could raise an exception,
>>>       
>> but faces with a very 
>>     
>>> small area can return there normal as (0,0,0) - so
>>>       
>> maybe it would be 
>>     
>>> good to check if either vector is 0,0,0 and return
>>>       
>> 0 as the result. - 
>>
>> It seems to me:
>> A zero length vector does not point in any
>> particular direction.
>> To say the angle is zero is misleading at best.
>>
>> Better to throw the exception, I think.
>> ArithmeticError, or FloatingPointError maybe.
>>     
>
> I'll add some weight to that, giving back 0.0 would
> not only be misleading but transfer the task of
> boundary checking to the caller which is grossly
> inapropriate.
>
> Martin
>
> ____________
In that case it would be good for python coders to be made aware that a 
zero area face returns 0,0,0 for its normal. add it into the Epy Docs.
- Cam



More information about the Bf-python mailing list