POV-Ray : Newsgroups : povray.general : Int() Problems Server Time
7 Aug 2024 09:22:49 EDT (-0400)
  Int() Problems (Message 1 to 5 of 5)  
From: Tom Melly
Subject: Int() Problems
Date: 16 Oct 2001 17:29:52
Message: <3bcca6d0@news.povray.org>
I'm having a problem with the following scene under 3.5b5. The use of int is
generating an error. I'm sort of assuming I'm doing something stupid, since
if it was a bug I would be surprised if no one had come across it before
(hence the post here rather than beta). I'm getting the error: "Parse Error:
Expected 'function identifier', } found instead"

I'm downloading beta 6 to see if that fixes it, but if anyone can spot what
I'm doing wrong enquiring minds want to know. Here's the simplified
function:

#include "functions.inc"
#declare fn_X = function(x,y,z) {int(x) }
isosurface {
  function { fn_X(x, y, z) }
  contained_by { box { -1, 1 } }
  accuracy 0.001
  max_gradient 4
  pigment{Yellow}
}


Post a reply to this message

From: JRG
Subject: Re: Int() Problems
Date: 16 Oct 2001 17:37:07
Message: <3bcca883@news.povray.org>
No luck with beta 6 too...
Are you sure you are allowed to use int() in functions?
The docs do not seem to forbid that...

--
Jonathan.
"Tom Melly" <tom### [at] tomandlucouk> ha scritto nel messaggio
news:3bcca6d0@news.povray.org...
> I'm having a problem with the following scene under 3.5b5. The use of int
is
> generating an error. I'm sort of assuming I'm doing something stupid,
since
> if it was a bug I would be surprised if no one had come across it before
> (hence the post here rather than beta). I'm getting the error: "Parse
Error:
> Expected 'function identifier', } found instead"
>
> I'm downloading beta 6 to see if that fixes it, but if anyone can spot
what
> I'm doing wrong enquiring minds want to know. Here's the simplified
> function:
>
> #include "functions.inc"
> #declare fn_X = function(x,y,z) {int(x) }
> isosurface {
>   function { fn_X(x, y, z) }
>   contained_by { box { -1, 1 } }
>   accuracy 0.001
>   max_gradient 4
>   pigment{Yellow}
> }
>
>
>


Post a reply to this message

From: Tom Melly
Subject: Re: Int() Problems
Date: 16 Oct 2001 17:56:17
Message: <3bccad01@news.povray.org>
JRG wrote in message <3bcca883@news.povray.org>...
>No luck with beta 6 too...
>Are you sure you are allowed to use int() in functions?
>The docs do not seem to forbid that...
>

Hmm, well it's a fairly basic number-function. I'll repost to beta. Might as
well get hung for mutton as for lamb...


Post a reply to this message

From: Slime
Subject: Re: Int() Problems
Date: 16 Oct 2001 19:13:18
Message: <3bccbf0e$1@news.povray.org>
According to 6.1.6 "User-Defined Functions" in the docs, you *are* allowed
to use int() in functions.

- Slime
[ http://www.slimeland.com/ ]
[ http://www.slimeland.com/images/ ]

"Tom Melly" <tom### [at] tomandlucouk> wrote in message
news:3bccad01@news.povray.org...
> JRG wrote in message <3bcca883@news.povray.org>...
> >No luck with beta 6 too...
> >Are you sure you are allowed to use int() in functions?
> >The docs do not seem to forbid that...
> >
>
> Hmm, well it's a fairly basic number-function. I'll repost to beta. Might
as
> well get hung for mutton as for lamb...
>
>


Post a reply to this message

From: Mike Williams
Subject: Re: Int() Problems
Date: 16 Oct 2001 22:03:58
Message: <VMjOONAFaOz7EwvK@econym.demon.co.uk>
Wasn't it Tom Melly who wrote:
>I'm having a problem with the following scene under 3.5b5. The use of int is
>generating an error. I'm sort of assuming I'm doing something stupid, since
>if it was a bug I would be surprised if no one had come across it before
>(hence the post here rather than beta). I'm getting the error: "Parse Error:
>Expected 'function identifier', } found instead"
>
>I'm downloading beta 6 to see if that fixes it, but if anyone can spot what
>I'm doing wrong enquiring minds want to know. Here's the simplified
>function:
>
>#include "functions.inc"
>#declare fn_X = function(x,y,z) {int(x) }
>isosurface {
>  function { fn_X(x, y, z) }
>  contained_by { box { -1, 1 } }
>  accuracy 0.001
>  max_gradient 4
>  pigment{Yellow}
>}

When I asked about it on povray.beta-test back in 3.5beta2 the response
was:-
 
 >>  The docs, page 6.1.6, say int() and val() are permissible in a 
 >>  function.

 >  This is a documentation error.  Sorry for that, it will be  
 >  corrected.
 >
 >   Thorsten

But then later in the thread

 >  Hmm, do we really need the "int" behavior?  Anyway, I will add it to
 >  functions.
 >
 >   Thorsten

I guess it got forgotten. I'll post a reminder on beta-test. In the
meantime you'll have to use "floor()" or "ceil()" instead of "int()".

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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