POV-Ray : Newsgroups : povray.advanced-users : Lathe and sor splines question : Re: Lathe and sor splines question Server Time
30 Jul 2024 10:12:01 EDT (-0400)
  Re: Lathe and sor splines question  
From: Nieminen Juha
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

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