POV-Ray : Newsgroups : povray.bugreports : Cannot predeclare spline for function : Re: Cannot predeclare spline for function Server Time
6 Nov 2025 04:56:52 EST (-0500)
  Re: Cannot predeclare spline for function  
From: Leroy
Date: 3 Nov 2025 19:45:00
Message: <web.69094b6e672aec277de98b7f712fc00@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> The docs show:
>
> #declare foo2 = function {
>   spline {
>     linear_spline
>     0.0, <0,0,0>
>     0.5, <1,0,0>
>     1.0, <0,0,0>
>     }
>   }
>
> #declare myvector2 = foo2(0.7);
>
>
> I am testing code that has:
>
> #declare SPL2_PX = spline{
>         linear_spline
>         #for(S_K, 0, S_NSites2D-1)
>             S_K, A1D_V_P2D[S_K].x,
>         #end
>     }
>
> #declare S_PX2 = function {SPL2_PX}
>
> Parse Error: Expected 'operand', spline identifier found instead
>
> Unless I'm doing something wrong.  Which is rather often the case.
>
> - BE

I found it! The function can not use a predefined spline so if you want a
function to use a spline define the spline in the function

#declare S_PX2 = function {
        spline{
         linear_spline
         #for(S_K, 0, S_NSites2D-1)
             S_K, A1D_V_P2D[S_K].x,
         #end
     }}
Works for me!
Have Fun!


Post a reply to this message

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