POV-Ray : Newsgroups : povray.advanced-users : Problems with splines : Problems with splines Server Time
3 Jul 2024 05:58:38 EDT (-0400)
  Problems with splines  
From: SvenM
Date: 27 May 2008 13:55:00
Message: <web.483c4aa5ca01857b257872660@news.povray.org>
Hi,

I'm trying to create a function that gets some values by a spline. But when I'm
trying to render the scene, the following error occurs:

"Expected 'operand', spline identifier found instead"

The simplest scene in which I found this error is something like that:

// First of all declare a spline - a circle made of 8 points with cubic spline
// I don't have any problems with this spline in other scenes
#declare SPL =
  spline {
    cubic_spline


    #declare SPLI=-1/8;
    #while (SPLI<=1+1/8)
    SPLI, <sin(2*pi*SPLI),0,cos(2*pi*SPLI)>
    #declare SPLI=SPLI+1/8;
    #end
  }


// now declare a function that calculates the average (arithmetic mean) of the
// x-values of the spline. "Exactness" says how many points I want to use.

 #declare xAverage=function(Exactness) {
 sum(i,0,Exactness,
     SPL(i/Exactness).x  // here the error occurs
    )
/(Exactness+1)
}


// end of file

Where is my mistake? Could you please help me? Is the sum the reason?
I'm using POV-Ray 3.7 (the beta version).

Thanks,
Sven


Post a reply to this message

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