POV-Ray : Newsgroups : povray.binaries.images : LanuHum, I cannot convert bezier spline to cubic spline Server Time
31 Oct 2024 19:13:26 EDT (-0400)
  LanuHum, I cannot convert bezier spline to cubic spline (Message 1 to 10 of 20)  
Goto Latest 10 Messages Next 10 Messages >>>
From: And
Subject: LanuHum, I cannot convert bezier spline to cubic spline
Date: 15 Aug 2015 10:00:01
Message: <web.55cf44405a3a5488c6574dfe0@news.povray.org>
LanuHum, I think I understand the cubic spline and the Bezier spline enough now.
But I must say it cannot convert good enough.

Both the bezier spline and the cubic spline consist of many segments, and all of
these segments are the 3rd order polynomials, this is true. But the condition
that connect them are very different. This cause the fact that a bezier spline
can contain sharp nodes but a cubic spline is always very smooth on each node.
So, I'm afraid that I cannot convert the spline by just adjusting the input
control points. :(


Post a reply to this message

From: LanuHum
Subject: Re: LanuHum, I cannot convert bezier spline to cubic spline
Date: 15 Aug 2015 15:10:06
Message: <web.55cf8e7da4f6ca687a3e03fe0@news.povray.org>
"And" <49341109@ntnu.edu.tw> wrote:
> LanuHum, I think I understand the cubic spline and the Bezier spline enough now.
> But I must say it cannot convert good enough.
>
> Both the bezier spline and the cubic spline consist of many segments, and all of
> these segments are the 3rd order polynomials, this is true. But the condition
> that connect them are very different. This cause the fact that a bezier spline
> can contain sharp nodes but a cubic spline is always very smooth on each node.
> So, I'm afraid that I cannot convert the spline by just adjusting the input
> control points. :(

To receive acute angles in cubic_spline it is necessary to duplicate control
point several times:

<1,0,0>
<1,0,1>
<2,1,3>
<2,1,3> //repit
<2,1,3> //repit
<2,1,3> //repit
<1,0,2>

I found the bad solution.
To model nurbs, to write down as cubic, to use meshmaker.inc for creation of
obj, to load obj into scene, to see result
Our dear friends-developers will laugh, but so far it is the only thing to do.
:)  :(


Post a reply to this message

From: And
Subject: Re: LanuHum, I cannot convert bezier spline to cubic spline
Date: 16 Aug 2015 10:45:00
Message: <web.55d09f62a4f6ca688423d9aa0@news.povray.org>
"LanuHum" <Lan### [at] yandexru> wrote:
>
> To receive acute angles in cubic_spline it is necessary to duplicate control
> point several times:
>
> <1,0,0>
> <1,0,1>
> <2,1,3>
> <2,1,3> //repit
> <2,1,3> //repit
> <2,1,3> //repit
> <1,0,2>
>
> I found the bad solution.
> To model nurbs, to write down as cubic, to use meshmaker.inc for creation of
> obj, to load obj into scene, to see result
> Our dear friends-developers will laugh, but so far it is the only thing to do.
> :)  :(

Uh,... alright, thanks. This is a good idea to make an acute angle in cubic
spline truly. But it is not enough to finish the converting.
Here I put an image which I downloaded from the Wikipedia to explain.

When we place a series of point, the way of drawing cubic spline is connecting
each point and its following point by a 3rd order polynomial, ..uh, let us give
an example, just say that the curve between p1 and p2. When we draw this curve,
what we use is the position of node p1 and p2, but we still do not tell the
direction of the nodes on the curve, right?
So, in a bezier spline, it uses two additional control points to collect the
information; in a cubic spline it uses some other nodes p0 and p3 to achieve the
same goal.
Now you can realize what the problem is, it uses some other nodes p0 and p3 to
complete the condition of direction.

And This will lack the form it is.


Post a reply to this message


Attachments:
Download 'catmull-rom_spline.png' (8 KB)

Preview of image 'catmull-rom_spline.png'
catmull-rom_spline.png


 

From: And
Subject: Re: LanuHum, I cannot convert bezier spline to cubic spline
Date: 16 Aug 2015 11:15:01
Message: <web.55d0a8b3a4f6ca688423d9aa0@news.povray.org>
Following the last message.
This means each node of the spline is endowed with too much role. I'm the node,
but I control the direction, too.

I found that the the direction at p1 is the vector (p2-p0), and the direction at
p2 is the vector (p3-p1).(See the picture)

The complete article about the cubic spline here:
https://en.wikipedia.org/wiki/Cubic_Hermite_spline


Post a reply to this message


Attachments:
Download '800px-finite_difference_spline_example.png' (37 KB)

Preview of image '800px-finite_difference_spline_example.png'
800px-finite_difference_spline_example.png


 

From: And
Subject: Re: LanuHum, I cannot convert bezier spline to cubic spline
Date: 16 Aug 2015 11:45:01
Message: <web.55d0af24a4f6ca688423d9aa0@news.povray.org>
Today, if you want to convert the bezier spline to the cubic spline, you must
face the problem:


Post a reply to this message


Attachments:
Download 'cubic spline.png' (19 KB)

Preview of image 'cubic spline.png'
cubic spline.png


 

From: And
Subject: Re: LanuHum, I cannot convert bezier spline to cubic spline
Date: 16 Aug 2015 13:00:01
Message: <web.55d0c17ca4f6ca688423d9aa0@news.povray.org>
Implementing in the Pov-Ray main program is still the best way on this topic.
I'm unable to write C++.
But if you can accept a rough version I still write a simple macro that just
place some spheres and cylinders to simulate the sphere sweep shape controlling
by the bezier points.


Post a reply to this message


Attachments:
Download 'bezier_spline sweep.png' (125 KB)

Preview of image 'bezier_spline sweep.png'
bezier_spline sweep.png


 

From: LanuHum
Subject: Re: LanuHum, I cannot convert bezier spline to cubic spline
Date: 16 Aug 2015 13:15:01
Message: <web.55d0c4dca4f6ca687a3e03fe0@news.povray.org>
"And" <49341109@ntnu.edu.tw> wrote:
> Implementing in the Pov-Ray main program is still the best way on this topic.
> I'm unable to write C++.
> But if you can accept a rough version I still write a simple macro that just
> place some spheres and cylinders to simulate the sphere sweep shape controlling
> by the bezier points.

Sorry, but I can't help anything. :(
For me trigonometry - long ago the forgotten subject. :)
But, I will be glad to any help!
Thank you!


Post a reply to this message

From: And
Subject: Re: LanuHum, I cannot convert bezier spline to cubic spline
Date: 16 Aug 2015 13:20:01
Message: <web.55d0c58aa4f6ca688423d9aa0@news.povray.org>
Another picture:


Post a reply to this message


Attachments:
Download 'bezier_spline sweep 2.png' (132 KB)

Preview of image 'bezier_spline sweep 2.png'
bezier_spline sweep 2.png


 

From: LanuHum
Subject: Re: LanuHum, I cannot convert bezier spline to cubic spline
Date: 16 Aug 2015 13:30:01
Message: <web.55d0c7aea4f6ca687a3e03fe0@news.povray.org>
"And" <49341109@ntnu.edu.tw> wrote:
> Another picture:

It gives to hope!


Post a reply to this message

From: And
Subject: Re: LanuHum, I cannot convert bezier spline to cubic spline
Date: 16 Aug 2015 13:35:00
Message: <web.55d0c81ea4f6ca688423d9aa0@news.povray.org>
"LanuHum" <Lan### [at] yandexru> wrote:
> "And" <49341109@ntnu.edu.tw> wrote:
> > Implementing in the Pov-Ray main program is still the best way on this topic.
> > I'm unable to write C++.
> > But if you can accept a rough version I still write a simple macro that just
> > place some spheres and cylinders to simulate the sphere sweep shape controlling
> > by the bezier points.
>
> Sorry, but I can't help anything. :(
> For me trigonometry - long ago the forgotten subject. :)
> But, I will be glad to any help!
> Thank you!

Okay. However it is a good chance for me to research the bezier curve.
That's ok.

And here is the picture with the control points.
And the macro:
http://news.povray.org/povray.binaries.scene-files/thread/%3Cweb.55d0c6ee48951ba98423d9aa0%40news.povray.org%3E/


Post a reply to this message


Attachments:
Download 'bezier_spline sweep 3.png' (153 KB)

Preview of image 'bezier_spline sweep 3.png'
bezier_spline sweep 3.png


 

Goto Latest 10 Messages Next 10 Messages >>>

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