POV-Ray : Newsgroups : povray.binaries.images : Elliptical torus Server Time
29 Mar 2024 03:36:29 EDT (-0400)
  Elliptical torus (Message 28 to 37 of 39)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 2 Messages >>>
From: William F Pokorny
Subject: Re: Elliptical torus
Date: 9 May 2020 21:43:12
Message: <5eb75c30$1@news.povray.org>
On 5/9/20 12:07 PM, Cousin Ricky wrote:
> On 2020-05-09 8:48 AM (-4), William F Pokorny wrote:
...

Ah, blast. Thank you for posting those 'lever cap cam' images.

Wondering in this moment if the 'failed' attempts were me having the 
wrong visual expectation for what you need. Pretty sure what you need 
has to pinch between the orthogonal axes for that lever thing. I've been 
working against that result.

Let me see if I can get a test set up going with a parametric as the 
reference.

Bill P.


Post a reply to this message

From: Bald Eagle
Subject: Re: Elliptical torus
Date: 12 May 2020 20:30:00
Message: <web.5ebb3ecea032ea3dfb0b41570@news.povray.org>
OK folks,

This is certainly challenging, but bit by bit, I think we're drawing closer to
figuring out where the difficulty is, and what is needed to overcome it.

I would be very interested in seeing the quartic equation, or at least the best
recollection of how it was derived.

As [creepily] often happens, I've had this tab open in my browser for quite some
time, but with the shader autoplay blocked by Brave, I didn't fully grasp what
it was about.

https://www.iquilezles.org/www/articles/distance/distance.htm

This was very exciting to me, as it solves some problems I've had with sine
waves and offset curves.
But as you can see, it also fixes the scaling of the thickness of an ellipse.
You can imagine this being used to fix a torus scaled into an elliptical torus.

https://www.shadertoy.com/view/MdfGWn
https://www.shadertoy.com/view/4tSfRz

I worked on it for a while, and got the simple 2D ellipse to work nicely, but
the 3D extrapolation to the torus didn't quite work out.

But then I thought - if one method is "off" one way, and this method is "off"
the other, .... then what happens if I blend them - will they cancel each other
out?

Almost.

What I've noticed while playing with parameters is that as Ricky observed, the
errors are accentuated by eccentricity and minor radius size.  Those errors seem
to be a shrinking effect in my original isosurface, and an expansion in the new
equation.  That error seems to be due to too much "z" at the ends, which then
tapers off as the curve approaches the z axis.

I haven't gotten the numerical gradient correction to work properly (yet), but
the approach makes sense, it feels like the right way to go due to its
simplicity, and most of my experiments had a max_gradient around 26.

The attached render has a gradient of 1770, but I rendered it with a holdover
value of only 355.


Post a reply to this message


Attachments:
Download 'implicitellipticaltorus_modgrad.png' (186 KB)

Preview of image 'implicitellipticaltorus_modgrad.png'
implicitellipticaltorus_modgrad.png


 

From: Bald Eagle
Subject: Re: Elliptical torus
Date: 14 May 2020 20:40:00
Message: <web.5ebde41ba032ea3dfb0b41570@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:

> This was very exciting to me, as it solves some problems I've had with sine
> waves and offset curves.
> But as you can see, it also fixes the scaling of the thickness of an ellipse.
> You can imagine this being used to fix a torus scaled into an elliptical torus.

AND .... this same approach was implemented by ... user And in 2013 to make
constant-thickness isosurface shells.

http://news.povray.org/povray.binaries.images/thread/%3Cweb.5264d1b954cff585cc1fd1150%40news.povray.org%3E/?ttop=423056
&toff=750&mtop=423452&moff=10


Post a reply to this message

From: Bald Eagle
Subject: Re: Elliptical torus
Date: 15 May 2020 14:10:01
Message: <web.5ebedadaa032ea3dfb0b41570@news.povray.org>
Whereupon Tor Olav Kristensen made a whopping follow-up post:

http://news.povray.org/povray.binaries.images/message/%3Cweb.5b5e768edce0719a79917fa00%40news.povray.org%3E/#%3Cweb.5b5
e768edce0719a79917fa00%40news.povray.org%3E


Especially interesting, with regard to the f_r function and fn_Gradient macro.
That ties in to the calculation of normals and using the object pattern in an
isosurface.


I suppose I'll also do a little light reading about the Laplacian operator and
the elliptic operator, since they are directly related.  ;)

With regard to the elliptical torus, I'm not exactly sure what throws off the 3D
shape.  With the standard circular torus, we just use R minus the length of the
x,z vector to get one side of the right triangle to evaluate the minor radius'
circle, and y becomes the other.

Generalizing this to an ellipse really seems like it should work without issue,
but obviously it doesn't.

It seems that any circle "drawn" ought to be in the plane bisecting the angle
formed by the two foci and the point on the ellipse.

It also seems like there's trend where the torus extends outward too much in the
direction of the longest semi-axis, and not enough in the shortest semi-axis.
Which leads me to intuitively believe that there ought to be a way to use a and
b to compensate for how the torus gets thrown off.

And that's all I have for now.


Post a reply to this message

From: William F Pokorny
Subject: Re: Elliptical torus
Date: 16 May 2020 10:09:11
Message: <5ebff407$1@news.povray.org>
On 5/15/20 2:09 PM, Bald Eagle wrote:
> Whereupon Tor Olav Kristensen made a whopping follow-up post:
> 
...
> 
> And that's all I have for now.
> 

Unsure how helpful, but I'd read in the past supertoroids a good way to 
create various csg modeling shapes.

Along with other work brought up a parametric supertoroid alongside a 
parametric of Cousin Ricky's include macro. The latter is a subset of 
the former's function! See the attached image(2).

Good news, right... We can find, half a dozen, slightly different, 
supposed, implicit equations in books, papers and the web for 
supertoroids. Another day plus of struggle and I've not a single attempt 
that does the a, b scaling correctly - most equations have other issues 
too(3). I'm struggling with gradients in all of the implicit forms, 
which makes trying ideas slow(4).

Aside:
----
I made an attempt too using my updated f_ellipsoid function creating 
first an x,y shell with the proper scaling. Used my new f_multiply1to8 
to get something torus like as well as some other forms.

The issue - perhaps like that you were up against in one of your posts - 
is, while the surface (the roots) with respect to x,y are in the 
correct(1) places, the gradients 'inside' are not of uniform value 
around the ring. To a first order the multiplication affects z around 
the ring, but I suspect the gradients are also not symmetrical about the 
central supertorus axis. Not been able to come up with the right 
corrections for even the first order z issue - yet again. :-)

If you or I get this going, Ricky's invoice is going to huge! :-)

Bill P.

(1) - Getting a supertoroid implicit which matches in every respect the 
parametric one a worthy goal no matter, but I worry some whether the 
resulting super torus will always be the right shape. I think it likely 
depends on the approach taken with the rest of the 'csg' - and perhaps 
some of the forms you've come up with might be what's needed.

(2) - Differences shown at a 2x multiple. These are due using compute 
depths of 8 and 18 with other accuracy items the same. Not too 
surprising, but interesting to see.

(3) - The function's terms and how they play with C++/SDL ones given 
different e1/e2 parameters is tricky (abs() is your friend). Yep, 
possible one or more forms is correctly as presented and it's me not 
getting something right.

(4) - Isosurfaces, when not just slow, suddenly blinking out of 
existence all or in part. It's as much the problem as slow renders and 
forces high gradient settings 500, 1000 or to avoid.


Post a reply to this message


Attachments:
Download 'supertor_chapter7.jpg' (51 KB)

Preview of image 'supertor_chapter7.jpg'
supertor_chapter7.jpg


 

From: Bald Eagle
Subject: Re: Elliptical torus
Date: 20 Sep 2020 18:25:00
Message: <web.5f67d680a032ea3d1f9dae300@news.povray.org>
I just stumbled across this while trying to regain my sanity,
and if even Ramanujan couldn't come up with anything but an approximation, than
I think the rest of us are Fuuuuuuuuuuuuuuuuuuuuuumbling around in the dark.

:)

https://www.youtube.com/watch?v=5nW3nJhBHL0

But don't anyone think that that will stop us from making another attempt, using
new inspiration and mathematical tools!

I think the above implies that due to the interesting properties of ellipses,
that a workable solution will use numerical methods.


Post a reply to this message

From: Cousin Ricky
Subject: Re: Elliptical torus
Date: 21 Sep 2020 22:57:49
Message: <5f69682d@news.povray.org>
On 2020-09-20 6:24 PM (-4), Bald Eagle wrote:
> I just stumbled across this while trying to regain my sanity,
> and if even Ramanujan couldn't come up with anything but an approximation, than
> I think the rest of us are Fuuuuuuuuuuuuuuuuuuuuuumbling around in the dark.
> 
> :)
> 
> https://www.youtube.com/watch?v=5nW3nJhBHL0

You watch Matt Parker to regain your sanity?  I have some of his videos 
languishing in my "Watch later" list because I'm afraid I'll *lose* my 
sanity if I watch them.

> But don't anyone think that that will stop us from making another attempt, using
> new inspiration and mathematical tools!
> 
> I think the above implies that due to the interesting properties of ellipses,
> that a workable solution will use numerical methods.

I am not convinced that this property is directly relevant to the 
problem I am trying to solve.  I still think the key is in that quartic 
equation I came up with, which should not require numerical methods 
(beyond what's implicit in POV-Ray's built-in functions).  The problem 
is that I am not practiced in solving quartic equations.

P.S.  I have known since 2007 that there is no exact formula for an 
ellipse's circumference.  I discovered that while trying to weld this 
'O' to the rectangular plate using an ellipse made out of blobs.


Post a reply to this message


Attachments:
Download 'povanized-b.png' (100 KB)

Preview of image 'povanized-b.png'
povanized-b.png


 

From: Bald Eagle
Subject: Re: Elliptical torus
Date: 22 Sep 2020 06:30:00
Message: <web.5f69d1cea032ea3d1f9dae300@news.povray.org>
Cousin Ricky <ric### [at] yahoocom> wrote:

> You watch Matt Parker to regain your sanity?

After spending most of the weekend trying to work out partial differential
equations of 2D Bernstein polynomials, and Gaussian curvature?
Sure.
After that, lifting boxes at work on Monday was relaxing   :D

Watching Daniel Shiffman would throw me over the edge, because it's
comedy/tragedy of errors, but I'm learning "important" things at the same
time....   It's like elective surgery with insufficient anaesthetic.

And, take a pre-emptive Advil for this one...
https://www.youtube.com/watch?v=YueAtA_YnSY


> I am not convinced that this property is directly relevant to the
> problem I am trying to solve.  I still think the key is in that quartic
> equation I came up with, which should not require numerical methods
> (beyond what's implicit in POV-Ray's built-in functions).  The problem
> is that I am not practiced in solving quartic equations.

Dumb question, but is there an online solver?
A language with the proper symbolic logic?

Cheat and get the right answer first, then use that knowledge as a light to
guide you along the path of working out the quartic.

> P.S.  I have known since 2007 that there is no exact formula for an
> ellipse's circumference.  I discovered that while trying to weld this
> 'O' to the rectangular plate using an ellipse made out of blobs.

It's always the "simple" things, isn't it?


Post a reply to this message

From: Le Forgeron
Subject: Re: Elliptical torus
Date: 22 Sep 2020 13:23:37
Message: <5f6a3319$1@news.povray.org>
Le 22/09/2020 à 12:28, Bald Eagle a écrit :
> Cousin Ricky <ric### [at] yahoocom> wrote:
>> I am not convinced that this property is directly relevant to the
>> problem I am trying to solve.  I still think the key is in that quartic
>> equation I came up with, which should not require numerical methods
>> (beyond what's implicit in POV-Ray's built-in functions).  The problem
>> is that I am not practiced in solving quartic equations.
> 
> Dumb question, but is there an online solver?

Sir, Yes Sir !

mathworld wolfram (alpha) has such beast.
It take a bit of learning to get it do what is desired, but there is
some examples along the pages.

You can ask it to refactor, solve (even based on chosen parameters), and
far more.

We are more in algebra than geometry.

https://www.wolframalpha.com/examples/mathematics/algebra/


> A language with the proper symbolic logic?
> 
> Cheat and get the right answer first, then use that knowledge as a light to
> guide you along the path of working out the quartic.
>
I think the elliptical torus with a minor radius of 0 should match the
equation of the ellipse.
That's the basic check of any solution: minor radius of 0 would simplify
the equation to an ellipse.

The difficulty is going backward: reintroduce a non-0 minor radius.


Post a reply to this message

From: Le Forgeron
Subject: Re: Elliptical torus
Date: 25 Sep 2020 14:31:54
Message: <5f6e379a$1@news.povray.org>
Le 21/09/2020 à 00:24, Bald Eagle a écrit :
> I just stumbled across this while trying to regain my sanity,
> and if even Ramanujan couldn't come up with anything but an approximation, than
> I think the rest of us are Fuuuuuuuuuuuuuuuuuuuuuumbling around in the dark.
> 
> :)
> 
> https://www.youtube.com/watch?v=5nW3nJhBHL0
> 
> But don't anyone think that that will stop us from making another attempt, using
> new inspiration and mathematical tools!
> 
> I think the above implies that due to the interesting properties of ellipses,
> that a workable solution will use numerical methods.
> 

I tried to play a bit with the hope to transform the quartic equation of
circular torus into elliptical torus.

From (sqrt(x²+y²)-R)²+z²=r², replacing x²+y²=R² with (x/a)²+(y/b)²=1

And it is deception.

x^4/a^4
+ (2 x^2 y^2)/(a^2 b²)
- (2 r^2 x^2)/a²- (2 x^2)/a²
+ (2 x^2 z^2)/a²
+ y^4/b⁴
- (2 r^2 y^2)/b²- (2 y^2)/b²
+ (2 y^2 z^2)/b²
+ r⁴- 2 r²+ 1
- 2 r^2 z²+ 2 z²
+ z⁴


Because the scaling of x & y also influence the radius of the minor circle.

But it must be possible to have it with a 4th degree poly.


If F( Point ) is such polynomial, we have the following requirement

F( 0, +/- B , +/- Minor  ) = 0  (point B)
F( +/- A, 0, +/- Minor ) = 0    (point A)
F( 0, +/- B +/- Minor, 0 ) = 0  (points M & N)
F( +/- A +/- Minor, 0, 0 ) = 0  (points K & L)

I guess, but cannot yet assert, that to avoid compressing the minor
circle, the z⁴, x⁴ and y⁴ must be 1.
And there might be some non-traditional power of x,y and z (aka odd) in
the non-null coefficient, which would disappear when A=B to have a
continuity with the circular torus.

Also, any point W On the central ellipse with z=+/- Minor is also F(W)=0

And if any more point is needed, there is the two minor circle at A & B
to explore more deeply than K, L, M & N.

Is that enough to try some spreadsheet solver, and how to do it ?


Post a reply to this message


Attachments:
Download 'torusellipse.png' (91 KB)

Preview of image 'torusellipse.png'
torusellipse.png


 

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

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