POV-Ray : Newsgroups : povray.unofficial.patches : x_spline syntax confusion Server Time
29 Apr 2024 16:09:35 EDT (-0400)
  x_spline syntax confusion (Message 1 to 3 of 3)  
From: Jim Charter
Subject: x_spline syntax confusion
Date: 2 Aug 2005 19:24:01
Message: <42f00091$1@news.povray.org>
I know I will kick myself when I see the answer but I cannot see what is 
wrong with this syntax:

_S1 is okay
_S2 and _S3 won't parse.

What on earth am I missing?

#version unofficial MegaPov 1.10;

#local _S1 =
spline {
         extended_x_spline freedom_degree 1.0
         0/3, <-2,  .500,   0>
         1/3, <-1,  .666,   0>
         2/3, <1,   .166,   0>
         3/3, <2,   .500,   0>
};


#local _S2 =
spline {
         extended_x_spline
         0/3, <-2,  .500,   0>  freedom_degree 1.0,
         1/3, <-1,  .666,   0>  freedom_degree 1.0,
         2/3, <1,   .166,   0>  freedom_degree 0.1,
         3/3, <2,   .500,   0>  freedom_degree 1.0
};


#local _S3 =
spline {
         extended_x_spline  freedom_degree 1.0
         0/3, <-2,  .500,   0>  freedom_degree 1.0,
         1/3, <-1,  .666,   0>  freedom_degree 1.0,
         2/3, <1,   .166,   0>  freedom_degree 0.1,
         3/3, <2,   .500,   0>  freedom_degree 1.0
};


//spline {
//  extended_x_spline [freedom_degree FLOAT]
//  time_Val_1, <Vector_1> [freedom_degree FLOAT ][,]
//  time_Val_2, <Vector_2> [freedom_degree FLOAT ][,]
//  ...
//  time_Val_n, <Vector_n> [freedom_degree FLOAT ]
//}


Post a reply to this message

From: Matt Denham
Subject: Re: x_spline syntax confusion
Date: 24 Nov 2005 12:50:00
Message: <web.4385fd243198bcf674f3166b0@news.povray.org>
Jim Charter <jrc### [at] msncom> wrote:
> I know I will kick myself when I see the answer but I cannot see what is
> wrong with this syntax:
>
> _S1 is okay
> _S2 and _S3 won't parse.
>
> What on earth am I missing?
>
> [snip examples]

After looking through the source, it turns out that what's given in the
documentation appears to be ordered wrong - freedom_degree needs to appear
BEFORE the vector, not after.  Hopefully this fixes your problem with the
latter two versions.

I assume the change in express.cpp was made *after* ABX documented it. :-)


Post a reply to this message

From: ABX
Subject: Re: x_spline syntax confusion
Date: 25 Nov 2005 09:17:20
Message: <um6eo1dgcdtcjh47fcdbmh7m9i8v8th494@4ax.com>
On Thu, 24 Nov 2005 12:49:24 EST, "Matt Denham" <mde### [at] bemanirebirthnet>
wrote:
> I assume the change in express.cpp was made *after* ABX documented it. :-)

:-(

No idea how it happened. IMO documentations stands correct. 'freedom_degree'
is optional while vector is obligatory. Obligatory params should occur before
optional for given control point (1). I think I will move it there for future
versions but keep parsed as it is currently with warning that it should be
moved. Thanks for solving this and sorry for not finding time to work on it
myself.

ABX

(1) tcb_spline is exception which order of params and vector means 'params for
end of previous segment', control point, 'params for begining of next
segment'.


Post a reply to this message

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