POV-Ray : Newsgroups : povray.advanced-users : Lathe and sor splines question Server Time
30 Jul 2024 08:26:46 EDT (-0400)
  Lathe and sor splines question (Message 11 to 18 of 18)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Peter Popov
Subject: Re: Lathe and sor splines question (Warning: binary attached) - interpolation_formulas.zip
Date: 14 Mar 2000 10:28:09
Message: <GhfOOFd6RkDyVsndqfmzl6rbzg1I@4ax.com>
On 12 Mar 2000 08:00:15 -0500, Nieminen Juha
<war### [at] sarakerttunencstutfi> wrote:

>  Also I would like an algorithm to draw the spline curve used by the SOR
>object, given the control points.

I think this is what is used in the SOR object, at least it looks so
to me. See if it works as expected. I hope there aren't nasty typos :)


Peter Popov
pet### [at] usanet
ICQ: 15002700


Post a reply to this message


Attachments:
Download 'interpolation_formulas.zip' (11 KB)

From: Nieminen Juha
Subject: Re: Lathe and sor splines question
Date: 14 Mar 2000 12:20:07
Message: <38ce74c7@news.povray.org>
Serge LAROCQUE <sgl### [at] hotmailcom%> wrote:
: I have an algorithm (from my old notes) for a cubic spline. It, however, works
: with through points rather than control points.

  That's exactly how it should (as the lathe object works; see the povray
documentation).

: For 'n' points, the algorithm
: produces 'n-1' cubic polynomials for in between the points

  In that case it may not be the algorithm used by povray. In the lathe
object, using a cubic spline, 'n' points produce a curve that goes through
'n-2' points, ie. starts from point 2 and ends at the point n-1. The first
and last points are only control points.
  This means that first we take the 4 first points and calculate the curve
between point 2 and 3 using points 1 and 4 as control points (the curve starts
from point 2 and ends at point 3). Then we take the points 2 to 5 and
calculate the curve that starts from point 3 and end at point 4 using the
points 2 and 5 as control points, and so on. In result we get a smooth
curve that goes from point 2 to point n-1.
  A quadratic curve generates 'n-1' curve segments since it uses just one
control point instead of two. In this case, too, the curve goes through all
the points.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Nieminen Juha
Subject: Re: Lathe and sor splines question
Date: 15 Mar 2000 05:09:06
Message: <38cf6141@news.povray.org>
Well, if it works for points 2 to n-1 like the lathe in povray, then it's
perfect. Please post a description of how it is done.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Nieminen Juha
Subject: Re: Lathe and sor splines question
Date: 15 Mar 2000 10:58:46
Message: <38cfb336@news.povray.org>
I found a way to easyly approximate very accurately the cubic spline used
in the lathe with a regular bezier spline (I can explain it if someone is
interested).

  But now I need the quadratic spline. Can someone explain the idea behind
it? I know that for each set of 3 points the curve between the 2nd and 3rd
points is calculated using the 1st point as control point (in the cubic
spline also the 4th point was used as control point but not with the
quadratic spline). But how does the 1st point affect the orientation of
the curve in the 2nd and 3rd point? (In the cubic spline the tangent at
point n is parallel to the line that connects points n-1 and n+1)
  I can't see any rule of this kind looking at the curve generated by
povray. Does anyone know it?

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Ken
Subject: Re: Lathe and sor splines question
Date: 15 Mar 2000 21:22:12
Message: <38D0459F.433776A5@pacbell.net>
Serge LAROCQUE wrote:

> Why isn't one of the POV team members jumping out with the answer?

Maybe they don't have a ready answer ?

> They wrote the program after all :-)

Dieter Bayer (dba### [at] tomtecde)	wrote the sor, lathe, prism, and
media features for POV-Ray but does not frequent these groups like
some of the other team members do plus he is no longer an active
member of the POV-Team.

-- 
Ken Tyler -  1300+ Povray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

From: Ron Parker
Subject: Re: Lathe and sor splines question
Date: 16 Mar 2000 08:12:02
Message: <38d0dda2$1@news.povray.org>
On Wed, 15 Mar 2000 21:04:27 -0500, Serge LAROCQUE wrote:
>>   But now I need the quadratic spline. Does anyone know it?
>
>Why isn't one of the POV team members jumping out with the answer? They wrote
>the program after all :-)

Maybe we have better things to do?  I hear there's a new version in the works.

Get a copy of the source and read lathe.c, specifically the comments at the
top of the file and the Compute_Lathe function.

-- 
These are my opinions.  I do NOT speak for the POV-Team.
The superpatch: http://www2.fwi.com/~parkerr/superpatch/
My other stuff: http://www2.fwi.com/~parkerr/traces.html


Post a reply to this message

From: Nieminen Juha
Subject: Re: Lathe and sor splines question
Date: 16 Mar 2000 09:04:52
Message: <38d0ea03@news.povray.org>
Ron Parker <ron### [at] povrayorg> wrote:
: Get a copy of the source and read lathe.c, specifically the comments at the
: top of the file and the Compute_Lathe function.

  Yes, it explains how to calculate the intersection of a ray with the lathe
but it doesn't explain how to draw a quadratic spline curve.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Ron Parker
Subject: Re: Lathe and sor splines question
Date: 16 Mar 2000 09:17:15
Message: <38d0eceb$1@news.povray.org>
On 16 Mar 2000 09:04:52 -0500, Nieminen Juha wrote:
>Ron Parker <ron### [at] povrayorg> wrote:
>: Get a copy of the source and read lathe.c, specifically the comments at the
>: top of the file and the Compute_Lathe function.
>
>  Yes, it explains how to calculate the intersection of a ray with the lathe
>but it doesn't explain how to draw a quadratic spline curve.

You mean that's not what this part does?

*    One spline segment in the (r,w)-plane is given by the equations
*
*      fw(t) = Aw * t^3 + Bw * t^2 + Cw * t + Dw  and
*      fr(t) = Ar * t^3 + Br * t^2 + Cr * t + Dr,
*
*    with the parameter t ranging from 0 to 1 and r = sqrt(u*u+v*v).

A, B, C, and D are calculated by the code in Compute_Lathe.  

-- 
These are my opinions.  I do NOT speak for the POV-Team.
The superpatch: http://www2.fwi.com/~parkerr/superpatch/
My other stuff: http://www2.fwi.com/~parkerr/traces.html


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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