POV-Ray : Newsgroups : povray.newusers : "Spline must have at least one entry" Server Time
31 Oct 2024 19:28:39 EDT (-0400)
  "Spline must have at least one entry" (Message 1 to 2 of 2)  
From: Veggiet
Subject: "Spline must have at least one entry"
Date: 6 Jul 2007 16:10:32
Message: <468ea1b8$1@news.povray.org>
Hi, Since I've started getting into animation I've been getting this error 
when working with splines, usually it is only when I try to change a 
linear_spline into a bezier_spline like:

this works:
#declare myspline = spline { linear_spline
                             0, <1,1,1>

                             2, <1,2,1>
                             5, <3,5,2>

                             11,<1,1,1>
                             }
This doesn't:
#declare myspline = spline { bezier_spline
                             0, <1,1,1>

                             2, <1,2,1>
                             5, <3,5,2>

                             11,<1,1,1>
                             }
I haven't been to upset with this, I'll usually just ignor and change it 
back to a linear spline, but recently I've started to work on project where 
the "error" is showing up no matter what type of spline I've used. It is in 
the context of this macro:

#macro an8_position_spline(vector_array)
//vector_array should be a two dimensional vector array [n][4] or [0 to n-1, 
0 - 3]
//the array takes the form of an8's "pointkey"
// <frame,frame,frame>, <location_vector>, <curve_point1>, <curve_point2>
// the first vector in each set could be modified to include the type of the 
point.
        #if (dimensions(vector_array)>1)
        #debug str(dimension_size(vector_array, 1)-1,3,1)
        spline { natural_spline
                vector_array[0][0].x, vector_array[0][1]
                vector_array[0][0].x+vlength(vector_array[0][3]), 
vector_array[0][1]+vector_array[0][3]

                #local end_index = dimension_size(vector_array, 1)-2;
                #local dimen = dimension_size(vector_array, 1)-1;
                #local index = 1;
                #while (index < end_index)

                vector_array[index][0].x-vlength(vector_array[index][2]), 
vector_array[index][1]+vector_array[index][2]
                vector_array[index][0].x, vector_array[index][1]
                vector_array[index][0].x+vlength(vector_array[index][3]), 
vector_array[index][1]+vector_array[index][3]

                #local index = index + 1;
                #end

                vector_array[dimen][0].x-vlength(vector_array[dimen][2]), 
vector_array[dimen][1]+vector_array[dimen][2]
                vector_array[dimen][0].x, vector_array[dimen][1]
                }
        #end
#end

I've looked at my code over and over and over, and can't see anywhere I 
might have made a syntax mistake, but no matter what I do, whether I try to 
use linear, cubic, natural, or bezier splines, I've also tried the different 
syntax that I found, that is, leaving out the clock number before the 
vector, placing commas inbetween all the entries, in short about everything 
I've seen in the manual about splines, all to no avail. Please Help


Post a reply to this message

From: Leroy
Subject: Re: "Spline must have at least one entry"
Date: 7 Jul 2007 01:50:45
Message: <468F28B3.1090904@joplin.com>
Veggiet wrote:
> This doesn't(work):
> #declare myspline = spline { bezier_spline  <<<<< THIS IS WRONG <<<<<

SPLINE USES ONLY THESE TYPES:
   linear_spline | quadratic_spline | cubic_spline | natural_spline

Spline uses some different types than prism or sphere_sweep



> #macro an8_position_spline(vector_array)
> //vector_array should be a two dimensional vector array [n][4] or [0 to n-1, 
> 0 - 3]
> //the array takes the form of an8's "pointkey"
> // <frame,frame,frame>, <location_vector>, <curve_point1>, <curve_point2>
> // the first vector in each set could be modified to include the type of the 
> point.
>         #if (dimensions(vector_array)>1)
>         #debug str(dimension_size(vector_array, 1)-1,3,1)

Lets look at:
>         spline { natural_spline <<OK

>                 vector_array[0][0].x, This is where I get the error

  I've played around this for a while and found that SPLINE just doesn't 
like
a two dimention array used this way.

         if you use: #declare  A=vector_array[0][0].x;
          then use A as the float it'll work

Have Fun!


Post a reply to this message

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