POV-Ray : Newsgroups : povray.bugreports : isosurface & function val() : Re: isosurface & function val() Server Time
25 Apr 2024 02:16:41 EDT (-0400)
  Re: isosurface & function val()  
From: clipka
Date: 6 Jul 2014 15:24:08
Message: <53b9a258@news.povray.org>
Am 06.07.2014 16:25, schrieb deep125:
>
> isosurface {
>        function{
>          val("1.5")
>         // 5
>
>        }
>      contained_by { box { -2, 2 } }
>    }
>
>
> error:
> line 3: Parse Error: Expected 'operand', string literal found instead
> Way?

Some statements are not available inside user-defined functions, because 
they typically don't make much sense there, or would have been 
unnecessarily difficult to implement; after all, these functions must be 
"compiled" into a bytecode and then executed by some virtual machine at 
run-time. A virtual machine which had to be specifically implemented for 
this task, as there was no such thing as LLVM back in those dark ages. 
(I wouldn't be too surprised if it even predates the Java VM.)

In your case, you can easily work around this limitation by using:

isosurface {
     #declare V = val("1.5");
     function { V }
     ...
}


Post a reply to this message

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