POV-Ray : Newsgroups : povray.advanced-users : Strange pigment error (3.6.1) : Re: Strange pigment error (3.6.1) Server Time
1 Jul 2024 05:33:06 EDT (-0400)
  Re: Strange pigment error (3.6.1)  
From: SharkD
Date: 11 Sep 2009 16:52:27
Message: <4aaab88b$1@news.povray.org>
clipka wrote:
> This is nothing that could be caught during parsing. After all, how is 
> POV-Ray supposed to know whether or not the function will be called with 
> parameters value that will cause one of the sub-expressions to operate 
> on invalid operands?
> 
> For instance, if your function is
> 
>     function { 1 / (x+1) }
> 
> then how should POV-Ray know whether you will make sure it isn't called 
> for any x smaller than -1?
> 
>  > How do I fix it?
> 
> The problem is most likely the subexpression
> 
>     log(y + 1)
> 
> which is undefined for any y <= -1. So make sure the pattern's native 
> range of y <= -1 is always outside whatever object it is applied to.
> 
> Or clip the parameter to a safe range, e.g.:
> 
>     #local Temp_fnc3 = function
>     {
>         Temp_fnc1(x, log(max(0.0001,y+1)) / log(2),z).gray
>     }
> 
> which forces the parameter for log() to be no smaller than 0.0001.

As I pointed out in my second post, the error only occurs after I apply 
the turbulence warp.

-Mike


Post a reply to this message

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