POV-Ray : Newsgroups : povray.binaries.animations : Re: circle or spiral by spline ?? : Re: circle or spiral by spline ?? Server Time
6 Oct 2024 06:12:19 EDT (-0400)
  Re: circle or spiral by spline ??  
From: Rune
Date: 14 Oct 2004 10:57:00
Message: <416e93bc@news.povray.org>
Shurakai wrote:
> Here the spline and the pic.
> #declare C_Path4 = spline { natural_spline
>    -0.25      <  -26.666, 0,  0>,
>     0.00,     <        0, 0, 20>,
>     0.25,     <       20, 0,  0>,
>     0.50,     <        0, 0,-20>,
>     0.75,     <      -20, 0,  0>,
>     1.00,     <        0, 0, 20>,
>     1.25,     <   26.666, 0,  0>};
>
> Maybe i'm totally wrong and a circle can't be declare by a spline

You'll never get a perfect circle as Thorsten points out, but if you use 
enough control points, you can get very close. Try this:

#declare C_Path4 = spline {
   natural_spline
   -0.25, <  -26.666, 0,  0>,
   #declare Points = 64; // 4 points is like it was before.
   #declare C = 0;
   #while (C<=Points)
      #declare V = C/Points;
      V, vrotate(20*z,360*y*V),
      #declare C = C+1;
   #end
    1.25, <   26.666, 0,  0>
};

Rune
-- 
3D images and anims, include files, tutorials and more:
rune|vision:  http://runevision.com
POV-Ray Ring: http://webring.povray.co.uk


Post a reply to this message

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