POV-Ray : Newsgroups : povray.general : Using bezier_spline : Re: Using bezier_spline Server Time
19 Apr 2024 23:47:16 EDT (-0400)
  Re: Using bezier_spline  
From: William F Pokorny
Date: 24 May 2018 06:18:03
Message: <5b06915b$1@news.povray.org>
On 05/23/2018 06:26 PM, Kima wrote:
> I draw a curvy line with spline in POVRAY as
> 
> camera {location <0,15,5> look_at <0,0,0>}
> light_source {<0,5,12> color rgb<1,1,1>}
> background {color rgb<1,1,1> }
> 
> #declare Spline_1 =
>    spline {
>     cubic_spline
>    -.2, <-5,1.0,-5>,
>     .1, <-4,1.0,-2>,
>     .2, <-3,1.0,3.5>,
>     .3, <-2,1.0,2>,
>     .4, <-1,1.0,-1>,
>     .5, <0,1.0,0>,
>     .6, <1,1.0,1>,
>     .7, <2,1.0,0>,
>     .8, <3,1.0,1>,
>     .9, <4,1.0,0>,
>     1.0, <5,1.0,3>,
>     1.2, < 6,1.0,5>
>    }
> 
>   #declare Nr = 0;
>   #while (Nr<1)
>   sphere{ <0,0,0>,0.27
>            texture{ pigment{color rgb <1-Nr/2,0.75+Nr/4,1>}
>                    finish {diffuse 0.9 phong 1}
>                  }
>          #declare Tr = Nr * 3;
>           translate Spline_1(Nr)
>         }
> 
>   #declare Nr = Nr + 0.001;
>   #end
> 
> 
> but bezier_spline is a better option for this sort of curves. However, the usage
> of bezier_spline and its controller points is not very clear from the povray
> documentation.
> 
> How can I use bezier_spline in this example?
> 
> 

To my knowledge bezier_spline has never been an option of spline {} in 
any official offering. See documentation at : 
http://wiki.povray.org/content/Reference:Spline

There are SDL implementations. See for example the object collection at:

http://lib.povray.org/searchcollection/index.php

and search for the keyword 'sphere_sweep'. Both the PointArrays package 
and the SphereSweep packages which come up in that search have Bezier 
spline support.

Bill P.


Post a reply to this message

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