POV-Ray : Newsgroups : povray.beta-test : min/max stop working in functions? Server Time
12 Nov 2024 19:55:46 EST (-0500)
  min/max stop working in functions? (Message 1 to 3 of 3)  
From: Elias Pschernig
Subject: min/max stop working in functions?
Date: 23 Sep 2001 09:29:59
Message: <3bade3d7@news.povray.org>
I downloaded beta3, and my scenes stopped working. I could track it down to
this: min and max seem to only use the first argument instead of comparing..

Comment out either line and see the difference..

In beta2 it worked.

Example scene:

--
#local F = function {   
   //max(0.1, 0.9)    
   //max(0.9, 0.1)
}   

plane {
   z 2
   pigment { function { F(x, y, z) } }
   finish { ambient 1 }
}
--

Version 3.5.beta.3 win32 (.msvc)
Processor P-III 933 MHz
Memory 384 MB 133 MHz

-- 
#macro C(X,Y)cylinder{X*x<X,0,-Y/2>.1}#end#macro U(R,X,Y)intersection{torus{.9
.1}box{-1 0rotate y*R*90}translate<X,0,Y>scale 1-z*.5}#end union{U(0,0,0)U(1,0
,0)U(2,-1,-1)U(1,1,0)U(1,1.5,-3)U(1,2,0)U(3,1,0)U(2,2,0)U(0,3,0)U(3,2,.5)C(.1,
2)C(.8,1)C(.8,-1)C(1.1,1)C(1.9,-1)pigment{rgb 10}rotate x*90translate<-1,0,4>}


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: min/max stop working in functions?
Date: 23 Sep 2001 12:28:15
Message: <3bae0d9f@news.povray.org>
In article <3bade3d7@news.povray.org> , "Elias Pschernig" 
<eli### [at] aonat> wrote:

> I downloaded beta3, and my scenes stopped working. I could track it down to
> this: min and max seem to only use the first argument instead of comparing..

Yes, this is a new bug that *only* happens if the there are constants in
some functions line min and max.  So the workaround is to use the calculated
value instead of a function to find it.  I know this won't workaround all
cases, but it should for for a lot of cases.


    Thorsten


____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: min/max stop working in functions?
Date: 23 Sep 2001 12:47:46
Message: <3bae1232@news.povray.org>
> In article <3bade3d7@news.povray.org> , "Elias Pschernig" 
> <eli### [at] aonat> wrote:
>
>> I downloaded beta3, and my scenes stopped working. I could track it down to
>> this: min and max seem to only use the first argument instead of comparing..
>
> Yes, this is a new bug that *only* happens if the there are constants in
> some functions line min and max.  So the workaround is to use the calculated
> value instead of a function to find it.  I know this won't workaround all
> cases, but it should for for a lot of cases.

To be more precise: All built-in function (not to confuse with the functions
in "functions.cin"!!!) that take more than one argument will return the
first argument if the first argument is constant.  Further, radians and
degrees functions also return the input rather than the converted output if
the input is constant.

One workaround is to simply add i.e. "x-x+123" to replace "123".  Of course,
this bug will be fixed in the next beta.


    Thorsten


____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

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