POV-Ray : Newsgroups : povray.newusers : Bezier Curves. Server Time
31 Oct 2024 22:19:11 EDT (-0400)
  Bezier Curves. (Message 1 to 5 of 5)  
From: kurtz le pirate
Subject: Bezier Curves.
Date: 26 Nov 2012 05:31:24
Message: <kurtzlepirate-915BDE.11312426112012@news.povray.org>
Hello,


I need your help to clarify some things. On Povray Doc about Lathe, 
there is 4 types of Spline :
    linear_spline | quadratic_spline | cubic_spline | bezier_spline

In the "PostScript Lange Reference" from Adobe, curves in eps are 'cubic 
Bezier'

In one side, i have Cubic Bezier, in other side Cubic Spline and Bezier 
Spline.


I suspect bezier_spline(pov) is the 'same' things as cubic_spline(eps).
Are you agree with this?


Thanks
-- 
klp


Post a reply to this message

From: Le Forgeron
Subject: Re: Bezier Curves.
Date: 26 Nov 2012 09:47:35
Message: <50b38107$1@news.povray.org>
Le 26/11/2012 11:31, kurtz le pirate a écrit :
> 
> Hello,
> 
> 
> I need your help to clarify some things. On Povray Doc about Lathe, 
> there is 4 types of Spline :
>     linear_spline | quadratic_spline | cubic_spline | bezier_spline
> 
> In the "PostScript Lange Reference" from Adobe, curves in eps are 'cubic 
> Bezier'
> 
> In one side, i have Cubic Bezier, in other side Cubic Spline and Bezier 
> Spline.
> 
> 
> I suspect bezier_spline(pov) is the 'same' things as cubic_spline(eps).
> Are you agree with this?
> 
> 
> Thanks
> 
Splines (as spline or as lathe) is already a dangerous domain in
povray's SDL alone.

Specifically, from the documentation (wiki), of lathe:

The bezier_spline is an alternate kind of cubic spline. Points 1 and 4
specify the end points of a segment and points 2 and 3 are control
points which specify the slope at the endpoints. Points 2 and 3 do not
actually lie on the spline. They adjust the slope of the spline. If you
draw an imaginary line between point 1 and 2, it represents the slope at
point 1. It is a line tangent to the curve at point 1. The greater the
distance between 1 and 2, the flatter the curve. With a short tangent
the spline can bend more. The same holds true for control point 3 and
endpoint 4. If you want the spline to be smooth between segments, points
3 and 4 on one segment and points 1 and 2 on the next segment must form
a straight line and point 4 of one segment must be the same as point 1
on the next segment.



This mean, in particular, that the number of points for a bezier_spline
lathe is always a multiple of 4. I never tried a bezier_spline lathe
with non contiguous segments... but it seems possible.

I would grant: bezier_spline lathe (pov) = cubic Bezier (eps)

But cubic_spline (eps), I do not know.


Now, to add more confusion: there is no such thing in povray as a
bezier_spline spline (which can be understandable: bezier_spline in
lathe might have gap... and nobody expect a gap in a spline). But there
is a natural_spline which is a third order polynomial curve... yet, it
is a totally different beast.


Post a reply to this message

From: Warp
Subject: Re: Bezier Curves.
Date: 26 Nov 2012 10:26:33
Message: <50b38a28@news.povray.org>
Le_Forgeron <lef### [at] freefr> wrote:
> The bezier_spline is an alternate kind of cubic spline. Points 1 and 4
> specify the end points of a segment and points 2 and 3 are control
> points which specify the slope at the endpoints. Points 2 and 3 do not
> actually lie on the spline. They adjust the slope of the spline. If you
> draw an imaginary line between point 1 and 2, it represents the slope at
> point 1. It is a line tangent to the curve at point 1. The greater the
> distance between 1 and 2, the flatter the curve. With a short tangent
> the spline can bend more. The same holds true for control point 3 and
> endpoint 4. If you want the spline to be smooth between segments, points
> 3 and 4 on one segment and points 1 and 2 on the next segment must form
> a straight line and point 4 of one segment must be the same as point 1
> on the next segment.

There's actually an easy trick if you want to construct a smooth spline
that goes through a set of points, using bezier curves:

Create a bezier curve between each pair of points (so that the endpoints
of the bezier are those two points, obviously), and take the direction and
length of the middle bezier control points from the previous and next points.

Ok, that was confusing. Let me explain it with a more concrete example:

Let's say that you want a smooth spline that goes through the points A, B,
C, D, and so on. To do that, create a bezier between each of those points,
so the endpoints of the first bezier are A and B, the second one are B and C,
and so on.

Now, there are two secondary bezier control points attached to B (one for
the first spline and another for the second). Make them tangential to the
A-C line (ie. have the same direction.) Their length should be the distance
between A and C multiplied by a factor (eg. something like 0.2 or such.)

Likewise the two secondary control points attached to C should be tangential
to the B-D line (and their length a fraction of the distance between B and D)
and so on.

The only remaining question is what should be the direction and length of
the secondary control point at A, and the one at the last point. One
possibility for this is to not create a bezier between A and B at all
(nor between the two last points.)

If you choose the length factor properly, I believe that what you get will
be extremely close to a cubic spline.

-- 
                                                          - Warp


Post a reply to this message

From: clipka
Subject: Re: Bezier Curves.
Date: 26 Nov 2012 16:54:54
Message: <50b3e52e$1@news.povray.org>
Am 26.11.2012 11:31, schrieb kurtz le pirate:

> I need your help to clarify some things. On Povray Doc about Lathe,
> there is 4 types of Spline :
>      linear_spline | quadratic_spline | cubic_spline | bezier_spline
>
> In the "PostScript Lange Reference" from Adobe, curves in eps are 'cubic
> Bezier'
>
> In one side, i have Cubic Bezier, in other side Cubic Spline and Bezier
> Spline.
>
>
> I suspect bezier_spline(pov) is the 'same' things as cubic_spline(eps).
> Are you agree with this?

Absolutely. As a matter of fact, what POV-Ray calls "cubic_spline" and 
"bezier_spline" are just different ways to specify 3rd-order polynomial 
(i.e. cubic) splines.


Post a reply to this message

From: kurtz le pirate
Subject: Re: Bezier Curves.
Date: 1 Dec 2012 04:33:30
Message: <kurtzlepirate-185FA6.10332901122012@news.povray.org>
In article <50b3e52e$1@news.povray.org>,
 clipka <ano### [at] anonymousorg> wrote:

> Am 26.11.2012 11:31, schrieb kurtz le pirate:
> 
> > I need your help to clarify some things. On Povray Doc about Lathe,
> > there is 4 types of Spline :
> >      linear_spline | quadratic_spline | cubic_spline | bezier_spline
> >
> > In the "PostScript Lange Reference" from Adobe, curves in eps are 'cubic
> > Bezier'
> >
> > In one side, i have Cubic Bezier, in other side Cubic Spline and Bezier
> > Spline.
> >
> >
> > I suspect bezier_spline(pov) is the 'same' things as cubic_spline(eps).
> > Are you agree with this?
> 
> Absolutely. As a matter of fact, what POV-Ray calls "cubic_spline" and 
> "bezier_spline" are just different ways to specify 3rd-order polynomial 
> (i.e. cubic) splines.


thanks

-- 
klp


Post a reply to this message

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