|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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'
Preview of image 'c4d_test.png'
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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'
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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'
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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'
|
|
| |
| |
|
|
|
|
| |
|
|