POV-Ray : Newsgroups : povray.general : how do I make a closed spline? : Re: how do I make a closed spline?) Server Time
6 Aug 2024 17:02:36 EDT (-0400)
  Re: how do I make a closed spline?)  
From: Hermann Voßeler
Date: 17 Feb 2002 08:28:44
Message: <3C6FAE2F.203@webcon.de>
Rune wrote:
 >
>                 Even if you add yet another control point the break is still
> there. So I think that it's practically impossible to get perfectly smoothly
> connected curves with the cubic splines used in the spline{} feature, which
> Mark Wagner says is the "natural cubic spline".
> 


Mark Wagner wrote:
 > 6) The second derivative of the function is zero at the first and
 > last control points
 >

... so the only way to get it smooth is to define it in a way, that
the curvature goes down to zero near the first and last control points
(if you want to connect it at this points)

Natural spline is like a flexible piece of metal where the ends are
*not* forced into a specific direction but may turn as they want when
you bend it to go through all control points.
It so behaves like a real spline used to draw cuves, hence the name.


Thus, a trick would be to "go round byond the end point". I.e to use
a additional control point that is identical with the second point on
the curve.
It is difficult for me to express correct what I want to say, so lets
assume, your curve has N+1 control points labeled 0...N. Then you
close it at point (N-1), that is point(N-1)=point(1) and set 
point(N)=point(2) as well as point(0)=point(N-2)
As you are not using the first segment (0 through 1) as well as the 
last segment (N-1 through N) it is no longer of importance, what the
curvature does there.

hope, this is aplicable to your problem.

Hermann


Post a reply to this message

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