POV-Ray : Newsgroups : povray.general : Still making newbie mistakes : Re: Still making newbie mistakes Server Time
29 Jul 2024 04:30:30 EDT (-0400)
  Re: Still making newbie mistakes  
From: Cousin Ricky
Date: 24 Mar 2013 00:00:02
Message: <web.514e7996c4a906bb78641e0c0@news.povray.org>
"nimda" <nomail@nomail> wrote:
> "Cousin Ricky" <rickysttATyahooDOTcom> wrote:
> > [snip]
> > #macro Basic_shape (Rpipe, Rsaddle)
> >   1 - sqrt
> >   ( RE_fn_Blob2 (f_sphere (0, y, z, Rpipe), Rsaddle)
> >   + RE_fn_Blob2 (f_sphere (x, 0, z, Rpipe), Rsaddle)
> >   - RE_fn_Blob2 (f_sphere (x, y, z, Rpipe), Rsaddle)
> >   )
> > #end
> > [snip]
>
> It seems to me that it should be verified that a number be tested
> to be positive before taking the square root out of it.

That wasn't it.  As it turns out, RE_fn_Blob2() always returns a non-negative
number, and in this particular example, the value of the third term never
exceeds the sum of the first two.  But you weren't expected to know that, so it
was a good guess anyway.

(A quick test showed that taking the square root of a negative number within an
isosurface does not cause an exception!  That would have been a whole other
source of frustration; I would have expected the render to crash in that case,
and therefore would not have suspected that to be the problem if the render ran
to completion.  Now I have something else to watch out for!)


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.