POV-Ray : Newsgroups : povray.beta-test : Spline tension inconsistency : Spline tension inconsistency Server Time
30 Jul 2024 22:18:51 EDT (-0400)
  Spline tension inconsistency  
From: Rune
Date: 28 Sep 2001 02:50:49
Message: <3bb41dc9@news.povray.org>
In the code below I've compared a path made with the cubic spline function
with a cubic spline prism.

The cubic spline function use a lower tension than the cubic spline in
prisms. While this may not be a bug, it's a strange inconsistency. The
tension used in the prism has been used for years now, but the one used in
the spline function creates much smoother splines paths. I personally think
the best solution would be to let the user control the spline tension in the
spline function, and perhaps even also in the cubic splines in prisms.

camera {location 11*y look_at 0 orthographic translate <4,0,4.5>}
background {color rgb 1}
#default {finish {ambient 1 diffuse 0}}
#declare MySpline =
spline {
   cubic_spline
    0,<2,3>,
    1,<4,2>,
    2,<6,2>,
    3,<8,2>,
    4,<6,0>,
    5,<5,3>,
    6,<6,6>,
    7,<2,9>,
    8,<0,5>,
    9,<4,5>,
   10,<2,7>,
   11,<2,3>,
   12,<4,2>,
   13,<6,2>
}
union {
   #declare M = 20;
   #declare C = 1*M;
   #while (C<=12*M)
      #local F = C/M;
      sphere {MySpline(F), 0.05}
      #if (F=int(F))
         sphere {MySpline(F), 0.1 pigment {color red 1}}
      #end
      #declare C = C+1;
   #end
   pigment {color 0}
   rotate 90*x
}
prism {
   cubic_spline
   -0.1, 0,
   14
   <2,3>,
   <4,2>,
   <6,2>,
   <8,2>,
   <6,0>,
   <5,3>,
   <6,6>,
   <2,9>,
   <0,5>,
   <4,5>,
   <2,7>,
   <2,3>,
   <4,2>,
   <6,2>
   pigment {color <0.5,0.5,1>}
}

Rune
--
3D images and anims, include files, tutorials and more:
Rune's World:    http://rsj.mobilixnet.dk (updated June 26)
POV-Ray Users:   http://rsj.mobilixnet.dk/povrayusers/
POV-Ray Webring: http://webring.povray.co.uk


Post a reply to this message

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