|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Hi,
while working on C4D->POV converter, I've discovered a strange form
deviation of prism, extruded from bezier spline (see attachment).
I claim, that exported data is absolutely correct (checked many times),
and no any useful info found here:
https://www.povray.org/documentation/view/3.7.0/62/
https://wiki.povray.org/content/Reference:Prism
I'm not sure about collisions, but only wonder how the same data with
the algorithm can produce different results. It seams to me, that
interpretation is different or maybe some additional scaling is applied
to tangents, for example.
Code is below, any ideas ?
//----------------------------------------------------------------------------
camera{ perspective
location <0, 0, 0>
angle 53.130102
matrix
<1.000000, -0.000000, 0.000000,
0.000000, 0.000000, 1.000000,
-0.000000, -1.000000, 0.000000,
0.058724, 5.575552, -0.059483>
}
#declare Extrude = prism { linear_sweep bezier_spline 0, 1.000000, 16
<1.500000, 0.000000>
<1.500000, 0.450694>
<0.450694, 1.000000>
<0.000000, 1.000000>
<0.000000, 1.000000>
<-0.450694, 1.000000>
<-1.500000, 0.450694>
<-1.500000, 0.000000>
<-1.500000, 0.000000>
<-1.500000, -0.450694>
<-0.450694, -1.000000>
<0.000000, -1.000000>
<0.000000, -1.000000>
<0.450694, -1.000000>
<1.500000, -0.450694>
<1.500000, 0.000000>
matrix
<1.000000, 0.000000, 0.000000,
0.000000, 1.000000, 0.000000,
0.000000, 0.000000, 1.000000,
0.000000, 0.000000, 0.000000>
material { mat_default }
}
object{ Extrude }
//----------------------------------------------------------------------------
Post a reply to this message
Attachments:
Download 'c4d_spline.png' (60 KB)
Download 'c4d_test.png' (23 KB)
Preview of image 'c4d_spline.png'
Preview of image 'c4d_test.png'
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 14/03/2023 14:01, yesbird wrote:
> while working on C4D->POV converter, I've discovered a strange form
> deviation of prism, extruded from bezier spline (see attachment).
And I should say, that for cubic spline I have the same distortion:
> //----------------------------------------------------------------------------
camera{ perspective
location <0, 0, 0>
angle 53.130102
matrix
<0.999944, -0.000000, -0.010610,
0.010182, 0.281279, 0.959572,
0.002984, -0.959626, 0.281263,
-0.018327, 5.930451, -1.559761>
}
#declare Extrude = prism { linear_sweep cubic_spline 0, 1.000000, 7
<0.000000, -1.000000>
<1.500000, 0.000000>
<0.000000, 1.000000>
<-1.500000, 0.000000>
<0.000000, -1.000000>
<1.500000, 0.000000>
<0.000000, 1.000000>
matrix
<1.000000, 0.000000, 0.000000,
0.000000, 1.000000, 0.000000,
0.000000, 0.000000, 1.000000,
0.000000, 0.000000, 0.000000>
material { mat_default }
}
object{ Extrude }
> //----------------------------------------------------------------------------
Post a reply to this message
Attachments:
Download 'c4d_test.png' (24 KB)
Preview of image 'c4d_test.png'
|
|
| |
| |
|
|
|
|
| |
| |
|
|
yesbird <sya### [at] gmailcom> wrote:
> On 14/03/2023 14:01, yesbird wrote:
> > while working on C4D->POV converter, I've discovered a strange form
> > deviation of prism, extruded from bezier spline (see attachment).
>
> And I should say, that for cubic spline I have the same distortion:
> > //----------------------------------------------------------------------------
> camera{ perspective
> location <0, 0, 0>
> angle 53.130102
>
> matrix
> <0.999944, -0.000000, -0.010610,
> 0.010182, 0.281279, 0.959572,
> 0.002984, -0.959626, 0.281263,
> -0.018327, 5.930451, -1.559761>
>
> }
>
> #declare Extrude = prism { linear_sweep cubic_spline 0, 1.000000, 7
>
> <0.000000, -1.000000>
> <1.500000, 0.000000>
> <0.000000, 1.000000>
> <-1.500000, 0.000000>
> <0.000000, -1.000000>
> <1.500000, 0.000000>
> <0.000000, 1.000000>
> matrix
> <1.000000, 0.000000, 0.000000,
> 0.000000, 1.000000, 0.000000,
> 0.000000, 0.000000, 1.000000,
> 0.000000, 0.000000, 0.000000>
>
> material { mat_default }
> }
>
> object{ Extrude }
> > //----------------------------------------------------------------------------
I'll take a look. Have you tried plotting those same points in another package?
...like AutoCAD or FreeCAD. Did you try adding a tolerance? I doubt it would
matter.
Mike
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Using my curves macro:
---%<---%<---%<---
#version 3.7;
#include "curve.inc" //https://ingoogni.nl/download/Curve.zip
#global_settings{ assumed_gamma 1.0 }
#default{ finish{ ambient 0.1 diffuse 0.9 emission 0}}
#declare vT = array[2]{0, 1}
#declare vC = array[13]{
<1.500000, 0.000000, 0>,
<1.500000, 0.450694, 0>,
<0.450694, 1.000000, 0>,
<0.000000, 1.000000, 0>,
<-0.450694, 1.000000, 0>,
<-1.500000, 0.450694, 0>,
<-1.500000, 0.000000, 0>,
<-1.500000, -0.450694, 0>,
<-0.450694, -1.000000, 0>,
<0.000000, -1.000000, 0>,
<0.450694, -1.000000, 0>,
<1.500000, -0.450694, 0>,
<1.500000, 0.000000, 0>
}
#declare Test = CIt(CIlinear(vT), CIbezier3(vC));
//get the points on the curve
#for(T, 0, 1, 0.005)
sphere{CITget(Test, T), 0.02 pigment{rgb 1}}
#end
//control points
sphere{Test[1][1][0] 0.03 pigment{rgb <1,0,0>}}
#for(i, 1, dimension_size(Test[1][1],1) - 1)
sphere{Test[1][1][i] 0.03 pigment{rgb <1,0,0>}}
cylinder{Test[1][1][i-1], Test[1][1][i], 0.01 pigment{rgb <1,0,0>}}
#end
camera {
perspective angle 45
location <0, 0, -6>
right x*image_width/image_height
look_at <0, 0, 0.0>
}
light_source{<0, 0,-3000> color rgb 1}
---%<---%<---%<---
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"ingo" <nomail@nomail> wrote:
Post a reply to this message
Attachments:
Download 'bez_test.png' (29 KB)
Preview of image 'bez_test.png'
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 15/03/2023 10:13, ingo wrote:
> Using my curves macro:
Thank you for this test, POV leads 2:0 now. It seems that C4D has some
hidden spline rendering magic. I will ask MAXON support now...
--
YB
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 15/03/2023 07:11, Mike Miller wrote:
> I'll take a look. Have you tried plotting those same points in another package?
> ...like AutoCAD or FreeCAD. Did you try adding a tolerance? I doubt it would
> matter.
No, I have no them, maybe some online tools...
Also will try to ask MAXON support - they answer very quickly.
--
YB
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 15/03/2023 10:47, yesbird wrote:
> It seems that C4D has some hidden spline rendering magic.
This is a Matlab version of cubic spline (attached):
------------------------------------
fnplt(cscvn( [1.5 0 -1.5 0 1.5; ...
0 1 0 -1 0] ))
------------------------------------
details are here:
https://www.mathworks.com/help/curvefit/cscvn.html?searchHighlight=cscvn&s_tid=srchtitle_cscvn_1
Score is 2:2 now ...
--
YB
Post a reply to this message
Attachments:
Download 'c4d_spline.png' (22 KB)
Preview of image 'c4d_spline.png'
|
|
| |
| |
|
|
|
|
| |
| |
|
|
yesbird <sya### [at] gmailcom> wrote:
> On 15/03/2023 10:47, yesbird wrote:
Cubic splines are hard to compare. What cubic is used by whom?
Inkscape bezier:
Post a reply to this message
Attachments:
Download 'inkscape_bezier.jpg' (108 KB)
Preview of image 'inkscape_bezier.jpg'
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"ingo" <nomail@nomail> wrote:
> yesbird <sya### [at] gmailcom> wrote:
> > On 15/03/2023 10:47, yesbird wrote:
>
> Cubic splines are hard to compare. What cubic is used by whom?
Cubic B-spline using my curve macros
---%<------%<------%<---
#version 3.7;
#include "curve.inc" //https://ingoogni.nl/download/Curve.zip
#global_settings{ assumed_gamma 1.0 }
#default{ finish{ ambient 0.1 diffuse 0.9 emission 0}}
#declare Bspl3 = CIbspline3(
array[7]{
<0.000000, -1.000000,0>
<1.500000, 0.000000,0>
<0.000000, 1.000000,0>
<-1.500000, 0.000000,0>
<0.000000, -1.000000,0>
<1.500000, 0.000000,0>
<0.000000, 1.000000,0>
}
)
//get the points on the curve
#for(T, 0, 1, 0.005)
sphere{CIget(Bspl3, T), 0.02 pigment{rgb 1}}
#end
//control points
sphere{Bspl3[1][0] 0.03 pigment{rgb <1,0,0>}}
#for(i, 1, dimension_size(Bspl3[1],1) - 1)
sphere{Bspl3[1][i] 0.03 pigment{rgb <1,0,0>}}
cylinder{Bspl3[1][i-1], Bspl3[1][i], 0.01 pigment{rgb <1,0,0>}}
#end
camera {
perspective angle 45
location <0, 0, -6>
right x*image_width/image_height
look_at <0, 0, 0.0>
}
light_source{<0, 0,-3000> color rgb 1}
---%,------%<------%<---
Post a reply to this message
Attachments:
Download 'test4.png' (22 KB)
Preview of image 'test4.png'
|
|
| |
| |
|
|
|
|
| |
|
|