POV-Ray : Newsgroups : povray.bugreports : Cannot predeclare spline for function : Re: Cannot predeclare spline for function Server Time
6 Nov 2025 04:56:56 EST (-0500)
  Re: Cannot predeclare spline for function  
From: Thorsten
Date: 4 Nov 2025 11:27:56
Message: <690a298c$1@news.povray.org>
On 04.11.2025 12:17, Bald Eagle 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.

Not behaves exactly as designed: The function parser cannot handle 
declared objects because you are falling into the POV-Ray declares are 
not macros trap. The parser first needs to know that you want a spline 
function, then it can make use of the spline object.

Thorsten


Post a reply to this message

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