

In cubic_spline, the beginning and end points are control points, which are
similar to those of a bezier curve. If we take a bezier curve of a semicircle
with a set of
<3,0,0>,<3,4,0>,<3,4,0>,<3,0,0>
The second and third points are the handles, which can be used in a spline as
#declare MySpline =
spline {
cubic_spline
.25, <3,4,0> // 2nd point of bezier
0, <3,0,0> // 1st point of bezier
1, <3,0,0> // 4th point of bezier
1.25, <3,4,0> // 3rd point of bezier
}
#declare ctr = 0;
#while (ctr < 1)
sphere {
MySpline(ctr),.25
pigment { rgb <1ctr,ctr,0> }
}
#declare ctr = ctr + 0.01;
#end
but it does not work, because I have no mechanism for setting/adjusting the
spline values.
Post a reply to this message




"Kima" <nomail@nomail> wrote:
> In cubic_spline, the beginning and end points are control points, which are
> similar to those of a bezier curve. If we take a bezier curve of a semicircle
> with a set of
That won't work the way you expect, because POVRay doesn't do Bezier splines in
that section of its code. IIRC, all Bezier splines are cubic splines, but not
all cubic splines are Bezier splines.
I spent a LONG time working with Bezier splines and bicubic patches, and you
usually have to write your own code to do what you want.
> but it does not work, because I have no mechanism for setting/adjusting the
> spline values.
Given your code, I don't exactly know what that means.
User Cousin Ricky has solved this problem for you.
See here:
http://lib.povray.org/searchcollection/index2.php?objectName=SphereSweep&contributorTag=Cousin%20Ricky
:)
Post a reply to this message




The link was very handy, and I had not come across it before. Thanks, it helped
a lot.
>
> all Bezier splines are cubic splines, but not
> all cubic splines are Bezier splines.
>
Doesn't this mean that we can use a set of Bezier points as a cubic_spline?
>
> Given your code, I don't exactly know what that means.
>
The bezier points create a perfect semicircle. But, the above cubic_spline does
not because I gave the values (0.25, 0, 1, 1.25) randomly.
My question is: how to find these values (0.25, 0, 1, 1.25) according to the
given bezier points?
Post a reply to this message

