POV-Ray : Newsgroups : povray.general : Still making newbie mistakes : Re: Still making newbie mistakes Server Time
29 Jul 2024 04:25:06 EDT (-0400)
  Re: Still making newbie mistakes  
From: nimda
Date: 23 Mar 2013 10:45:00
Message: <web.514dbfabc4a906bbb0f4b1ca0@news.povray.org>
"Cousin Ricky" <rickysttATyahooDOTcom> wrote:
> For a while, this one had me wondering if I'd made a disastrous error in
> roundedge.inc.
>
> Code excerpt:
> ____________________________________________________________________
>
> #include "functions.inc"
> #include "roundedge.inc" //From lib.povray.org; defines RE_fn_Blob2()
>
> #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
>
> #declare Final_shape = isosurface
> { function { max (Basic_shape (0.5, 0.3), -Basic_shape (0.4, 0.4)) }
>   max_gradient 1/0.3
>   contained_by { box { -<1, 1, 0>, <1, 1, 0.5> } }
> }
> ____________________________________________________________________
>
> POV-Ray veterans and C programmers will spot my error immediately.
>
> However, the first newbie to post what I did wrong gets a 15% discount off
> POV-Ray 3.7.0.  (You do not need to know what RE_fn_Blob2() does to figure it
> out.)

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.


Post a reply to this message

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