[Bf-python] AngleBetweenVecs still buggy.

Martin Poirier theeth at yahoo.com
Tue Sep 27 05:03:06 CEST 2005



--- Campbell Barton <cbarton at metavr.com> wrote:

> --- 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

Of course. Also, all the exceptions that can be thrown
(the real ones, not argument type errors) by
methods/functions should be indentified.

Martin


		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com



More information about the Bf-python mailing list