POV-Ray : Newsgroups : povray.bugreports : Cannot predeclare spline for function : Re: Cannot predeclare spline for function Server Time
6 Nov 2025 04:56:53 EST (-0500)
  Re: Cannot predeclare spline for function  
From: jr
Date: 4 Nov 2025 07:00:00
Message: <web.6909e9a7672aec27475fba6a6cde94f1@news.povray.org>
hi,

"Bald Eagle" <cre### [at] netscapenet> wrote:
> "Leroy" <whe### [at] gmailcom> wrote:
>
> > #declare S_PX2 = function {
> >         spline{
> >          linear_spline
> >          #for(S_K, 0, S_NSites2D-1)
> >              S_K, A1D_V_P2D[S_K].x,
> >          #end
> >      }}
>
> Yes and that is indeed what I did.
>
> However it seems to be bad behaviour by the parser, and locks the spline into a
> single-use object.
>
> IIRC, I can use pre-declared splines in sphere_sweep without a problem.
>
> The inability falls under the "contrary to user expectation", and that's why
> it's in this section.
>
> Thank you, of course, for providing the workaround.
> I wonder how many other things we have like this lurking around in the source.

it actually does work, though you have to tell the function:

#declare S_PX2 = function {spline{SPL2_PX}};


regards, jr.


Post a reply to this message

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