POV-Ray : Newsgroups : povray.advanced-users : Bezier spline deformation Server Time
24 Apr 2024 11:10:49 EDT (-0400)
  Bezier spline deformation (Message 14 to 23 of 23)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: yesbird
Subject: Re: Bezier spline deformation
Date: 15 Mar 2023 11:21:22
Message: <3a1fca00-fbb0-8eb4-7e51-2c5c16514547@gmail.com>
On 15/03/2023 17:46, ingo wrote:
> Thanks Alain, I'm aware of that, just tried to show that the POV-Ray
> implementation of the Bezier spline is not wrong using yesbird's data and
> various implementations.

Yes, it's not wrong, but the question still exists: how to match it to
C4D's produces shape in POV's 'prism' object (see first post).
Unfortunately, manual states, that only two control points can be set:
https://wiki.povray.org/content/Reference:Prism

Experiments with them gives nothing.
--
YB


Post a reply to this message

From: Leroy
Subject: Re: Bezier spline deformation
Date: 21 Mar 2023 16:25:00
Message: <web.641a11a6122e7e3ab201e5baf712fc00@news.povray.org>
yesbird <sya### [at] gmailcom> wrote:
> On 15/03/2023 17:46, ingo wrote:
> > Thanks Alain, I'm aware of that, just tried to show that the POV-Ray
> > implementation of the Bezier spline is not wrong using yesbird's data and
> > various implementations.
>
> Yes, it's not wrong, but the question still exists: how to match it to
> C4D's produces shape in POV's 'prism' object (see first post).
> Unfortunately, manual states, that only two control points can be set:
> https://wiki.povray.org/content/Reference:Prism
>
> Experiments with them gives nothing.
> --
> YB

Do you have access to the C4D and POV source code ?
I know it's complicated but you might get an idea of where they differ.

 A while back I wrote a win program to make polygons and prisms for POV.
The first try I got the code straight from the internet.But it had little errors
like the one you showed. Then I went right to POV source. Now it is a lot
better.
 Of course you can do some trial an error by changing the control points by some
magic number. I would use a vector to move the control points either from the
other control point in a bezier_spline or the start point for other splines.
 Hope this helps.

Have Fun!


Post a reply to this message

From: yesbird
Subject: Re: Bezier spline deformation
Date: 21 Mar 2023 17:44:14
Message: <66108263-ba11-8ce5-3a52-d983c13c3cdf@gmail.com>
On 21/03/2023 23:21, Leroy wrote:
> Do you have access to the C4D and POV source code ?
> I know it's complicated but you might get an idea of where they differ.

Thanks for suggestion, yes, I have POV sources, but can only dream about
sources of C4D :)

And even I will find the reason of difference (position of control
points) in sources, I will not be able to control them in POV's 'prism':
https://wiki.povray.org/content/Reference:Prism

So the problem still exists ...
--
YB


Post a reply to this message

From: Bald Eagle
Subject: Re: Bezier spline deformation
Date: 21 Mar 2023 21:55:00
Message: <web.641a5fee122e7e3a1f9dae3025979125@news.povray.org>
yesbird <sya### [at] gmailcom> wrote:
> On 21/03/2023 23:21, Leroy wrote:
> > Do you have access to the C4D and POV source code ?
> > I know it's complicated but you might get an idea of where they differ.
>
> Thanks for suggestion, yes, I have POV sources, but can only dream about
> sources of C4D :)
>
> And even I will find the reason of difference (position of control
> points) in sources, I will not be able to control them in POV's 'prism':
> https://wiki.povray.org/content/Reference:Prism
>
> So the problem still exists ...
> --
> YB

So, years ago, when I still didn't have any real clue what was going on with
Bezier splines and patches, I thought that maybe different softwares might have
different equations for computing the cubic Bezier spline.

I don't see how that's that case, as Bezier curves all seem to be calculated the
same way, with the same, meaningful, purposeful equations, derived from the same
principles and adhering to the same behaviour and exhibiting the same properties
- such as partition of unity.  I'm not seeing how that could be done multiple
ways - without messing up things like True Type fonts, and the myriad other
applications of Bezier curves across different software packages and operating
systems.

So I am presuming that C4D uses the same equations that POV-Ray uses, which I've
at some point read the source code for, and matches the equations that I write
to make them myself.

The control points should transfer seamlessly, since they are just numerical
coordinates.  Although with a cubic, you need those "extra" control points which
don't show up but that affect the shape of the curve - so maybe that's where the
problem lies?

- BW


Post a reply to this message

From: yesbird
Subject: Re: Bezier spline deformation
Date: 22 Mar 2023 05:05:30
Message: <bcbcfdb5-5a60-6216-15d7-3184785c9202@gmail.com>
On 22/03/2023 04:54, Bald Eagle wrote:
> The control points should transfer seamlessly, since they are just numerical
> coordinates.  Although with a cubic, you need those "extra" control points which
> don't show up but that affect the shape of the curve - so maybe that's where the
> problem lies?

Thanks, Bill, fortunately I'm familiar with splines from my school years 
:). The problem is in different results of splines rendering in C4D and 
POV, I can't even imagine how it could be.

Data is following:
//-------------------------------------------------------------------
#declare Extrude = prism { linear_sweep bezier_spline 0, 3.000000, 16

   // -----------
   <15.000000, 0.000000>   // P1
   <15.000000, 3.750000>   // T2
   <5.625000, 10.000000>   // T3
   <0.000000, 10.000000>   // P2
   // -----------
   <0.000000, 10.000000>   // P2
   <-5.625000, 10.000000>  // T4
   <-15.000000, 3.750000>  // T5
   <-15.000000, 0.000000>  // P3
   // -----------
   <-15.000000, 0.000000>  // P3
   <-15.000000, -3.750000> // T6
   <-5.625000, -10.000000> // T7
   <0.000000, -10.000000>  // P4
   // -----------
   <0.000000, -10.000000>  // P4
   <5.625000, -10.000000>  // T8
   <15.000000, -3.750000>  // T1
   <15.000000, 0.000000>   // P1
   // -----------

   matrix
  <0.100000, 0.000000, 0.000000,
   0.000000, 0.100000, 0.000000,
   0.000000, 0.000000, 0.100000,
   -0.005274, 0.030602, -0.017559>

   material { texture {pigment {rgb <1,1,1> }}}
}

object{ Extrude }
//-------------------------------------------------------------------

Results attached.
--
YB


Post a reply to this message


Attachments:
Download 'romb.png' (108 KB) Download 'c4d_test.png' (15 KB)

Preview of image 'romb.png'
romb.png

Preview of image 'c4d_test.png'
c4d_test.png


 

From: William F Pokorny
Subject: Re: Bezier spline deformation
Date: 22 Mar 2023 09:07:31
Message: <641afd93$1@news.povray.org>
On 3/22/23 05:05, yesbird wrote:
> The problem is in different results of splines rendering in C4D and POV, 
> I can't even imagine how it could be.

A bit of wild guessing. In looking some at font rendering code years 
back, I noticed what looked like bezier spline p1-c1-c2-p2 incoming 
point sets being converted to p1-p1_2((c1+c2)/2)-p3 and then the 
duplicate end points getting compressed. The resulting point list was 
then rendered with via cubic_spline.

The why of all it then, I do not know. But, if I do that conversion on 
your bezier_spline point list and create an equivalent cubic_spline of:

#declare Extrude2 = prism { linear_sweep cubic_spline 0, 1.000000, 11
    <0.975347, -0.725347>
    <1.500000, 0.000000>
    <0.975347, 0.725347>
    <0.000000, 1.000000>
    <-0.975347, 0.725347>
    <-1.500000, 0.000000>
    <-0.975347, -0.725347>
    <0.000000, -1.000000>
    <0.975347, -0.725347>
    <1.500000, 0.000000>
    <0.975347, 0.725347>

I get the attached image using an orthographic camera and if not a match 
for what c4d is showing in your last post, it looks to me to be in the 
ballpark.

Bill P.


Post a reply to this message


Attachments:
Download 'yesbird.png' (4 KB)

Preview of image 'yesbird.png'
yesbird.png


 

From: yesbird
Subject: Re: Bezier spline deformation
Date: 22 Mar 2023 10:00:50
Message: <c398b209-071c-9ae3-9f8e-40a4a4d6eeca@gmail.com>
On 22/03/2023 16:07, William F Pokorny wrote:
> I get the attached image using an orthographic camera and if not a match 
> for what c4d is showing in your last post, it looks to me to be in the 
> ballpark.

Thanks a lot for this experiment, the shape becomes much closer to
original and I see that POV gives a lot of space for 'hoodoo'.

As I expected before, to achieve exact matching, I need to do some
adjustments of original data. Not much of a fun, but this is reality ...
--
YB


Post a reply to this message

From: Bald Eagle
Subject: Re: Bezier spline deformation
Date: 22 Mar 2023 18:55:00
Message: <web.641b8701122e7e3a1f9dae3025979125@news.povray.org>
I plotted out the points following the standard cubic equations described by the
Bernstein polynomials and got the attached shape.   So --- it looks to me like
the other software package is doing something strange?

Maybe try another program, or an online tool to see what kinds of results you
get?

- BW


Post a reply to this message


Attachments:
Download 'bezierspline.png' (12 KB)

Preview of image 'bezierspline.png'
bezierspline.png


 

From: yesbird
Subject: Re: Bezier spline deformation
Date: 23 Mar 2023 02:49:56
Message: <2e9fd20a-4f14-56dd-aaf5-71ec3c16d302@gmail.com>
On 23/03/2023 01:53, Bald Eagle wrote:
> So --- it looks to me like
> the other software package is doing something strange?
As I see your plot also not matching to POV version - vertical size is
less.
> 
> Maybe try another program, or an online tool to see what kinds of results you
> get?
Here I've posted Matlab version - it matches to C4D:
news://news.povray.org:119/b44b0560-ea7d-f389-12d8-47cbc7d21017@gmail.com
--
YB


Post a reply to this message

From: Bald Eagle
Subject: Re: Bezier spline deformation
Date: 23 Mar 2023 06:30:00
Message: <web.641c2940122e7e3a1f9dae3025979125@news.povray.org>
yesbird <sya### [at] gmailcom> wrote:

> As I see your plot also not matching to POV version - vertical size is
> less.

Well, your first data set is 1/10th the size of what you later posted as a
prism.  Here's my shape based on your most recent dataset post, and your
original prism simply scaled by 10.

So, I mean, to my eye, they "match" close enough for what we're talking about
here.

> Here I've posted Matlab version - it matches to C4D:
> news://news.povray.org:119/b44b0560-ea7d-f389-12d8-47cbc7d21017@gmail.com

linky no worky.  But I did see your past pasts, and the other one is indeed
rounder.

Puzzling indeed.  Troubling as well.


Post a reply to this message


Attachments:
Download 'bezierspline.png' (25 KB)

Preview of image 'bezierspline.png'
bezierspline.png


 

<<< Previous 10 Messages Goto Initial 10 Messages

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