POV-Ray : Newsgroups : povray.advanced-users : Bezier spline deformation Server Time
24 Apr 2024 21:46:56 EDT (-0400)
  Bezier spline deformation (Message 11 to 20 of 23)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 3 Messages >>>
From: yesbird
Subject: Re: Bezier spline deformation
Date: 15 Mar 2023 08:24:40
Message: <5b92f96f-c8ce-6d16-3d3d-96b290d02a06@gmail.com>
On 15/03/2023 14:29, ingo wrote:
>> Cubic splines are hard to compare. What cubic is used by whom?

As I was expected, looks like the reason is default location of control
points, no any magic here.
--
YB


Post a reply to this message

From: Alain Martel
Subject: Re: Bezier spline deformation
Date: 15 Mar 2023 09:27:50
Message: <6411c7d6$1@news.povray.org>
Le 2023-03-15 à 03:30, ingo a écrit :
> "ingo" <nomail@nomail> wrote:
> 
> 
> 
I see the problem. Your spline is not «stiff» enough.
Try pushing the control points back. That'll make the spline flatter at 
the placement points.

Try this :
#declare vC = array[13]{
    <1.500000, 0.000000, 0>,//P
    <1.500000, 0.6, 0>,//C
    <0.47, 1.000000, 0>,//C
    <0.000000, 1.000000, 0>,//P
    <-0.47, 1.000000, 0>,//C
    <-1.500000, 0.6, 0>,//C
    <-1.500000, 0.000000, 0>,//P
    <-1.500000, -0.6, 0>,//C
    <-0.47, -1.000000, 0>,//C
    <0.000000, -1.000000, 0>,//P
    <0.47, -1.000000, 0>,//C
    <1.500000, -0.6, 0>,//C
    <1.500000, 0.000000, 0>//P
}


Post a reply to this message

From: ingo
Subject: Re: Bezier spline deformation
Date: 15 Mar 2023 10:50:00
Message: <web.6411da2e122e7e3a17bac71e8ffb8ce3@news.povray.org>
Alain Martel <kua### [at] videotronca> wrote:

> > "ingo" <nomail@nomail> wrote:
> >
> >
> >

> Try pushing the control points back. That'll make the spline flatter at
> the placement points.

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.

ingo


Post a reply to this message

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

<<< Previous 10 Messages Goto Latest 10 Messages Next 3 Messages >>>

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