POV-Ray : Newsgroups : povray.binaries.animations : Re: circle or spiral by spline ?? Server Time
1 Nov 2024 07:29:21 EDT (-0400)
  Re: circle or spiral by spline ?? (Message 1 to 5 of 5)  
From: Shurakai
Subject: Re: circle or spiral by spline ??
Date: 14 Oct 2004 08:15:01
Message: <web.416e6c9b20cabba66b3522e90@news.povray.org>
Tor Olav Kristensen <tor### [at] TOBEREMOVEDgmailcom> wrote:
>
> I recommend that you read a little about Rational B-Splines.
>
> --
> Tor Olav
> http://subcube.net
> http://subcube.com

Well, actually i'm not a mathematical genius, sorry, i don't deal with
mathematics at all ;). I'm chemist and mathematics was always a riddle for
me. But there should be a way to define a nearly perfect circle using a
cubic B-spline and putting the start and end controllpoint somewhere far
away. but it did not worked. I tried a lot to shift the control points, but
no way :((
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


Post a reply to this message


Attachments:
Download 'spline.jpg' (81 KB)

Preview of image 'spline.jpg'
spline.jpg


 

From: Tor Olav Kristensen
Subject: Re: circle or spiral by spline ??
Date: 14 Oct 2004 08:22:49
Message: <416e6f99@news.povray.org>
Shurakai wrote:
> Tor Olav Kristensen <tor### [at] TOBEREMOVEDgmailcom> wrote:
> 
>>I recommend that you read a little about Rational B-Splines.
>>
>>--
>>Tor Olav
>>http://subcube.net
>>http://subcube.com
> 
> 
> Well, actually i'm not a mathematical genius, sorry, i don't deal with
> mathematics at all ;). I'm chemist and mathematics was always a riddle for
> me. But there should be a way to define a nearly perfect circle using a
> cubic B-spline and putting the start and end controllpoint somewhere far
> away. but it did not worked. I tried a lot to shift the control points, but
> no way :((
> 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 can not make a perfect circle with any of POV-Ray's
inbuilt spline types (AFAIK).

I'm in a hurry now, so I don't have time to explain further.
Maybe later...

Btw.: The Natural Spline is not a B-Spline.

-- 
Tor Olav
http://subcube.net
http://subcube.com


Post a reply to this message

From: Rune
Subject: Re: circle or spiral by spline ??
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

From: Shurakai
Subject: Re: circle or spiral by spline ??
Date: 15 Oct 2004 05:15:01
Message: <web.416f945320cabba66b3522e90@news.povray.org>
"Rune" <run### [at] runevisioncom> wrote:
> 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>
> };

Tor Olav Kristensen <tor### [at] TOBEREMOVEDgmailcom> wrote:

Dear Tor Olav,

thanks a lot for Your function code. It was exactly what i was looking for.
But i nneden to chnage it a little bit, and now it's working fine with my
Animation-Debug Macro :)))) I can see the path and the camere moving on the
path during animation. A little sample is posted.

Once more thanks a lot for Your help.

Dear Rune,

i'll test Your spline as soon as possible, also big thanks to You.
It's easier to get my macros working with a spline than with a function
related macro.

Bye and have fun, Shu.


Post a reply to this message


Attachments:
Download 'circle_cam.mpg' (115 KB)

From: Shurakai
Subject: Re: circle or spiral by spline ??
Date: 15 Oct 2004 06:05:00
Message: <web.416fa09720cabba66b3522e90@news.povray.org>
And a small movie from the spiral spline. Once more thanks Tor.
>
> Bye and have fun, Shu.


Post a reply to this message


Attachments:
Download 'spiral_cam.mpg' (99 KB)

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