POV-Ray : Newsgroups : povray.unofficial.patches : new sor spline type Server Time
31 Oct 2024 23:28:25 EDT (-0400)
  new sor spline type (Message 1 to 6 of 6)  
From: ABX
Subject: new sor spline type
Date: 9 Aug 2002 14:14:54
Message: <m018luklrcip3i7n1f86ktgqm7rccqju0i@4ax.com>
http://abx.art.pl/pov/patches/sorspline.php

comments ? suggestions ?

ABX


Post a reply to this message

From: ingo
Subject: Re: new sor spline type
Date: 9 Aug 2002 15:09:09
Message: <Xns9265D7D9286D0seed7@povray.org>
in news:m018luklrcip3i7n1f86ktgqm7rccqju0i@4ax.com ABX wrote:

> http://abx.art.pl/pov/patches/sorspline.php
> 
> comments ? suggestions ?
> 

Nice addition. And, as you never seem to stop ;), how about Bezier and 
Kochanek-Bartels?

While reading your expaination my eye was cought by the line
"DBL sor_coeff[5][4];". Now this means nothing to me itself but it 
reminded me of a feature I think is very usefull when working with 
splines. It would be nice if a spline could also be accessed in the same 
way as an array.

#declare SPL= spline {
    	-0.10, <0,0,0>
    	 0   , <1,1,1>
      0.25, <2,3,4>
    	..
    	..
}

#declare dim= dimensions(SPL) //results in 2,
                              //(though could be 5 for Bezier)
#declare P0= SPL[0][0]  //results in -0.10
#declare P2= SPL[2][1]  //results in <2,3,4>
#declare size=dimension_size(SPL,1) //returns the amount of entries

The reason for this is that there are times when you want to interpolate 
the spline piece-wise. 
An example: extruding a rectangular linear spline along the y-axis. To 
get sharp edges with a minimum amout of triangles, you want to build the 
triangles per side of the rectangle = per section of the spline. 
Currently there is no acces to this information, although a rather 
clumsy workaround using arrays to build the splines from is possible.

Ingo


Post a reply to this message

From: ABX
Subject: Re: new sor spline type
Date: 12 Aug 2002 04:01:04
Message: <mlpelug2rgccgpipdk3l41jal0nna6f48r@4ax.com>
On 9 Aug 2002 15:09:09 -0400, ingo <ing### [at] homenl> wrote:
> > http://abx.art.pl/pov/patches/sorspline.php
> > 
> > comments ? suggestions ? 
>
> Nice addition.

Thanks but I have missed something.
I have realized that the sor spline can be defined only for positive valies.
So I have to add abs() to precomputation stage to force it. Otherwise it could
cause unexpected results within sqrt during interpolation. I will update my
page with this fix.

> And, as you never seem to stop ;)

(That must be coffee)

> how about Bezier and 
> Kochanek-Bartels?

I was interested mainly in tutorial style to guide how such an addition could
be introduced. I will add your suggestion to my list of planned patches but I
doubt I will do it quickly :-(

> It would be nice if a spline could also be accessed in the same 
> way as an array.

Yes, I thought about it in beta-test time and found it interesting hovewer I
have to think about it more. Now I have to fix/speedup sphere-sweeps.

ABX


Post a reply to this message

From: ABX
Subject: Re: new sor spline type
Date: 2 Sep 2002 07:55:20
Message: <j0k6nugmam32jifao92k9vulsguvcqkibq@4ax.com>
On 9 Aug 2002 15:09:09 -0400, ingo <ing### [at] homenl> wrote:
> It would be nice if a spline could also be accessed in the same 
> way as an array.

I have finished small change to enable such feature in:

  #declare S=spline{
    -1.000000,0.000000*x
     0.000000,0.118143*x
     0.540084,0.620253*x
     0.827004,0.210970*x
     0.962025,0.194093*x
     1.000000,0.286920*x
     1.033755,0.468354*x
  };
  #local C=0;
  #while (C<dimension_size(S))
    #debug concat(str(S[C][0],0,-1),",<",vstr(3,S[C][1],",",0,-1),">\n")
    #local C=C+1;
  #end

Is this enough for you ? Should I add something or can create section in my
patch directory?

ABX


Post a reply to this message

From: ingo
Subject: Re: new sor spline type
Date: 2 Sep 2002 08:44:26
Message: <Xns927D96AB5B0B0seed7@povray.org>
in news:j0k6nugmam32jifao92k9vulsguvcqkibq@4ax.com ABX wrote:

> Is this enough for you ?

So,
dimension_size(S) tells me how many points there are in the spline.
S[C][0] tells me the t-value of the spline at entry point C.
S[C][1] tells me the vector at entry point C of the spline.

EXCELLENT!

This is exactly what I was looking for. Very usefull.

I'll buy you a Grolsch,

Thanks,

Ingo


Post a reply to this message

From: ABX
Subject: Re: new sor spline type
Date: 2 Sep 2002 10:13:21
Message: <d6s6nusepo0l5j63358kcvtro7b24m7lp7@4ax.com>
On 2 Sep 2002 08:44:26 -0400, ingo <ing### [at] homenl> wrote:
> > Is this enough for you ?
>
> So,
> dimension_size(S) tells me how many points there are in the spline.
> S[C][0] tells me the t-value of the spline at entry point C.
> S[C][1] tells me the vector at entry point C of the spline.

yes, and only reading allowed.

> EXCELLENT!

http://www.abx.art.pl/pov/patches/arspline.php

> This is exactly what I was looking for. Very usefull.

I'm happy then.

> I'll buy you a Grolsch,

That's still my favourite mark. Oh, all those sweet memories from Enschede....

ABX


Post a reply to this message

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