POV-Ray : Newsgroups : povray.documentation.inbuilt : SOR documentation Server Time
28 Aug 2025 16:15:30 EDT (-0400)
  SOR documentation (Message 1 to 10 of 14)  
Goto Latest 10 Messages Next 4 Messages >>>
From: Bald Eagle
Subject: SOR documentation
Date: 12 Aug 2025 12:35:00
Message: <web.689b6c79e72c05b2bc0c1c5925979125@news.povray.org>
I was wanting to work out the SOR segment equations, and found the existing
documentation to be a bit confusing / incomplete.

https://wiki.povray.org/content/Reference:Surface_of_Revolution

The notation is a bit confusing, and there's not enough information to lead me
through the jumps in operations so that I can connect what's going on.

I know there has been some recent effort to improve some of the documentation,
and I think this page would be a good candidate for revision.

If anyone has the knowledge or ability to work out how the curve for each
segment gets interpolated, then a better written explanation and/or SDL
calculating all the points along the entire SOR curve would be great.

Thanks,

- BE


Post a reply to this message

From: Bald Eagle
Subject: Re: SOR documentation
Date: 13 Aug 2025 09:20:00
Message: <web.689c9020251da1bcbc0c1c5925979125@news.povray.org>
So where my confusion lies is with the following:

The documentation says,
"The coefficients A(j), B(j), C(j) and D(j) are calculated for every segment
using the equation"
and then immediately gives "b = M * x".


b is a column vector, M is a matrix, and then x is a column vector of the
coefficients that we're supposed to be calculating as implied by that initial
sentence.

The best I have been able to do in terms of trying to work this out and make any
sense of it is:

if b = M * x, and x is the column vector of coefficients, then x = b/M.

So, why start off with how to calculate b, if b is already given in the next
line, and why express it that way if what you actually want to say is that x =
b/M?

The next problem is that M has values that are hard-coded as zeroes, which would
lead to division by zero in every instance, and if a control point leads to any
of the terms of the matrix evaluating to zero, then the same problem occurs.

Finally, it seems that the h's in the b and M calculations are the actual
geometric heights of the control points, whereas the h's in the equation r^2 =
f(h) = A*h^3 + B*h^2 + C*h + D are the values of an interpolant along a single
segment. (otherwise with multiple control points, which of the h's get used? and
which control points get used, if the discussion that immediately follows states
that the function is divided up into separate segments?

Also, I see no "interpolation" happening between point J and point (j+1).

If I am in error, hopefully someone can show me where I missed or misinterpreted
something.

The source code (
https://github.com/POV-Ray/povray/blob/master/source/core/shape/sor.cpp )
states that

*  Ideas for the surface of revolution were taken from:
*
*    P. Burger and D. Gillies, "Rapid Ray Tracing of General Surfaces
*    of Revolution", New Advances in Computer Graphics, Proceedings
*    of CG International '89, R. A. Earnshaw, B. Wyvill (Eds.),
*    Springer, ..., pp. 523-531

and try as I might, I have not been able to find a readable copy of this 1989
paper, nor have had enough time to try and puzzle out the source code to work
backwards.

- BE


Post a reply to this message

From: jr
Subject: Re: SOR documentation
Date: 13 Aug 2025 12:10:00
Message: <web.689cb819251da1bc7b8494536cde94f1@news.povray.org>
hi,

"Bald Eagle" <cre### [at] netscapenet> wrote:
> I was wanting to work out the SOR segment equations, and found the existing
> documentation to be a bit confusing / incomplete.
> https://wiki.povray.org/content/Reference:Surface_of_Revolution
> The notation is a bit confusing, and there's not enough information to lead me
> through the jumps in operations so that I can connect what's going on.
> I know there has been some recent effort to improve some of the documentation,
> and I think this page would be a good candidate for revision.
> If anyone has the knowledge or ability to work out how the curve for each
> segment gets interpolated, then a better written explanation and/or SDL
> calculating all the points along the entire SOR curve would be great.

having just read your follow-up, it seems that the interpolation "loose end"
needs to be sorted.  if then you can provide a (working) "worked example" and
(brief ;-)) explanation, we can update that part of the documentation.


regards, jr.


Post a reply to this message

From: Bald Eagle
Subject: Re: SOR documentation
Date: 13 Aug 2025 14:00:00
Message: <web.689cd19c251da1bcbc0c1c5925979125@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:

> having just read your follow-up, it seems that the interpolation "loose end"
> needs to be sorted.  if then you can provide a (working) "worked example" and
> (brief ;-)) explanation, we can update that part of the documentation.

I'll try to get it worked out, unless someone else manages to do it before me.

I just had some success following up on a hunch that the spline is a Catmull-Rom
type.

https://qroph.github.io/2018/07/30/smooth-paths-using-catmull-rom-splines.html

https://www.cs.cmu.edu/~fp/courses/graphics/asst5/catmullRom.pdf

https://andrewhungblog.wordpress.com/2017/03/03/catmull-rom-splines-in-plain-english/

-BW


Post a reply to this message

From: Bald Eagle
Subject: Re: SOR documentation
Date: 13 Aug 2025 15:30:00
Message: <web.689ce753251da1bc5eec474325979125@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:

>
https://andrewhungblog.wordpress.com/2017/03/03/catmull-rom-splines-in-plain-english/

This last one seemed to be pretty straightforward to follow, and I managed to
implement it in Excel.

So hopefully I'll be able to get the SDL to work tonight.

- BW


Post a reply to this message

From: Bald Eagle
Subject: Re: SOR documentation
Date: 13 Aug 2025 15:50:00
Message: <web.689cebe5251da1bc5eec474325979125@news.povray.org>
I suppose that my next logical question is:

the sor documentation states, "The intersection test with a SOR object involves
solving a cubic polynomial while the test with a lathe object requires to solve
a 6th order polynomial" ...

but upon reviewing the lathe documentation, one can choose between a variety of
different spline types.

So perhaps that needs some clarification / correction / expansion.

(I've also written a Newton-Raphson root solver, and so probably should
investigate the Sturmian root solver.)

- BW


Post a reply to this message

From: Bald Eagle
Subject: Re: SOR documentation
Date: 13 Aug 2025 19:35:00
Message: <web.689d20b3251da1bc1f9dae3025979125@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:

> So hopefully I'll be able to get the SDL to work tonight.

It took longer than i thought, because in order to make the f(h) equation match
the documentation, I had to flip everything upside down and backwards from the
way I did it in Excel.  And I used arrays.

But it all works, which is what I needed to do.

With regard to POV 4.0, I see no reason why the number of points needs to be
specified, since the source can count the points when parsing the SDL.
There ought to be a way to specify the "tension" like in a proper Catmull-Rom
spline.

Anyway, here ya go.

- BW


Post a reply to this message


Attachments:
Download 'surface of revolution documentation.png' (62 KB)

Preview of image 'surface of revolution documentation.png'
surface of revolution documentation.png


 

From: Bald Eagle
Subject: Re: SOR documentation
Date: 15 Aug 2025 09:00:00
Message: <web.689f2ecf251da1bcdefa623c25979125@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:

> having just read your follow-up, it seems that the interpolation "loose end"
> needs to be sorted.

So, I just wrote the whole thing from scratch, the way it seemed to me to work,
according to that last linked Wordpress page.

https://wiki.povray.org/content/File:RefImgCurvmath.png
Looks like it was made, or at least uploaded by Jim Holsenback.

> if then you can provide a (working) "worked example" and
> (brief ;-)) explanation, we can update that part of the documentation.

I can likely provide a "mathematical" or a code example - either as the vector *
matrix form, or as the intermediate result (A, B, C, & D).

There are some YT videos that seem to go over the topic, so perhaps I can either
use on of those, or dig up the original paper by Catmull and Rom to show the
derivation, and why the vector and matrix values are what they are.

In typical fashion, I can expand all that to simulate / demonstrate how that
curve gets wrapped around the axis to make the "sor" object (both
graphically/geometrically and mathematically), as well as render it as a
parametric {} and an isosurface {}.  Easy enough to do that as a union of
triangle{}s, perhaps mesh {}, less likely mesh2{}.

I already edited the doc page in OpenOffice as a first rough draft, however it
may need revision after I at some point figure out exactly what's going on with
the lathe {} object.

As with all things, I'd like to see some level of clarity, completeness, and
comprehensiveness in our documentation.  So, in my mind, I would like to see
POV-Ray serve as a repository of computer graphics education that clearly and
completely explains all of the historical and current concepts in computer
graphics, with references, working code, and of course eye-popping artistic
renders.
So perhaps we can make a list of all of the various different kinds of splines,
and see if we can't get as many of them implemented as is practical.  I know
Jerome worked out Rational Bezier Splines a while back, and TOK has NURBS worked
out.  Even though none of it is in source, it can be implemented via
macros/include files, and in a way, that's a better educational resource that
people can refer to.

* Because we need to attract more people here to spur further development *

- BW

P. S.

With regard to the "equations as images" that we have in ours docs, I'd like to
see some level of plain text version that can be copy/pasted.  Or if there is
some way, perhaps we can have MathJax implemented so that we can have great
looking equations.


Post a reply to this message

From: Bald Eagle
Subject: Re: SOR documentation
Date: 15 Aug 2025 09:15:00
Message: <web.689f31eb251da1bcdefa623c25979125@news.povray.org>
This covers the basics,

https://www.cs.cmu.edu/~fp/courses/graphics/asst5/catmullRom.pdf

but Wikipedia shows that there are uniform, chordal, and centripetal forms as
well.

(granted for our present purposes, I think we are just using the uniform version
with a tension of 1.0 )


Post a reply to this message

From: jr
Subject: Re: SOR documentation
Date: 16 Aug 2025 02:10:00
Message: <web.68a01fd9251da1bc7b8494536cde94f1@news.povray.org>
hi,

"Bald Eagle" <cre### [at] netscapenet> wrote:
> "jr" <cre### [at] gmailcom> wrote:
> ...
> With regard to the "equations as images" that we have in ours docs, I'd like to
> see some level of plain text version that can be copy/pasted.  Or if there is
> some way, perhaps we can have MathJax implemented so that we can have great
> looking equations.

I'll reply tomorrow (Sunday), via email, on topic.  on the above, the wiki has a
math extension installed, perhaps that should enable you to write the equations
"in text" (see attached).


regards, jr.


Post a reply to this message


Attachments:
Download 'screenshot 2025-08-16 07.02.03.png' (34 KB)

Preview of image 'screenshot 2025-08-16 07.02.03.png'
screenshot 2025-08-16 07.02.03.png


 

Goto Latest 10 Messages Next 4 Messages >>>

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