POV-Ray : Newsgroups : povray.binaries.images : Elliptical torus Server Time
18 May 2024 06:27:24 EDT (-0400)
  Elliptical torus (Message 3 to 12 of 39)  
<<< Previous 2 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Bald Eagle
Subject: Re: Elliptical torus
Date: 2 May 2020 15:45:00
Message: <web.5eadcd12a032ea3dfb0b41570@news.povray.org>
William F Pokorny <ano### [at] anonymousorg> wrote:

> It is a cool shape.

Yes, and relatively simple, so I was surprised there wasn't a lot more out there
about it, and that I hadn't come across it in my broad and extensive reading
about Dupin cylcides, Clifford tori, geometric inversion, embedding in 3-space,
Villarceau circles, etc.

> "I couldn't resist trying it..."

lol - well of course not.  :D

> What were you using for settings and seeing for run times?


I have some actual parametric code in the scene that stays commented out, so I
didn't use that.   I use Paul Nylander's method of calculating stepwise points
on a grid of the function and fill in those quadrilaterals with 2 triangles.
This was run in steps of Theta/240 and phi/60

I suppose I ought to calculate some vertex normals and upgrade the code to use
smooth_triangles.   And the face normals seemed to be inverted from what I
expected - so it totally needs work.  But I can mark all the vertices and draw
the grid just by setting the flags to run those code blocks.

And it's - FAST.  :)



Parser Statistics
----------------------------------------------------------------------------
Finite Objects:        86557
Infinite Objects:          0
Light Sources:             1
Total:                 86558
----------------------------------------------------------------------------
Parser Time
  Parse Time:       0 hours  0 minutes  1 seconds (1.639 seconds)
              using 1 thread(s)
  Bounding Time:    0 hours  0 minutes  0 seconds (0.163 seconds)
              using 1 thread(s)
----------------------------------------------------------------------------
Render Options
  Quality:  9
  Bounding boxes.......On   Bounding threshold: 3
  Antialiasing.........On  (Method 1, Threshold 0.300, Depth 3, Jitter 1.00,
 Gamma 2.50)
----------------------------------------------------------------------------
Render Statistics
Image Resolution 640 x 480
----------------------------------------------------------------------------
Pixels:           326400   Samples:          128421   Smpls/Pxl: 0.39
Rays:             508059   Saved:              6812   Max Level: 2/5
----------------------------------------------------------------------------
Ray->Shape Intersection          Tests       Succeeded  Percentage
----------------------------------------------------------------------------
Cone/Cylinder                     9987            4897     49.03
Torus                            83998           29868     35.56
Torus Bound                      83998           33072     39.37
Triangle                       1160673           84193      7.25
True Type Font                   86841           42100     48.48
Bounding Box                  18792623         5987477     31.86
----------------------------------------------------------------------------
Roots tested:                 33072   eliminated:                13868
Shadow Ray Tests:            118517   Succeeded:                 15672
Shadow Cache Hits:             5572
Reflected Rays:               53238
----------------------------------------------------------------------------
----------------------------------------------------------------------------
Render Time:
  Photon Time:      No photons
  Radiosity Time:   No radiosity
  Trace Time:       0 hours  0 minutes  0 seconds (0.682 seconds)
              using 4 thread(s) with 0.-04 CPU-seconds total
POV-Ray finished


Post a reply to this message

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

> > "I couldn't resist trying it..."
>
> lol - well of course not.  :D

And I couldn't resist implicitizing it.
I mussssst ... do..... the math..... yesss....
                                                     my Precious........!

And here is The One Elliptical Ring.
The gradient is only about 4.5    :)

However, you will notice that it doesn't render correctly when axis-aligned.
If I rotate it by 1 degree (0.5 isn't enough), then it becomes fully visible.

Do we smell a root-finding problem?  Ugh.

Martijn does some interesting little tweaks that I haven't thought out
completely to fix holes and other artifacts:
https://www.youtube.com/watch?v=-adHIyjIYgk   (14 min mark)
No idea if any of that is related to POV-Ray isosurface issues.
I think he might address some similar issues either earlier or in Part 2.

Anyway, I'm off to bed, but had to post this for Ricky.

Maybe tomorrow I will be able to better parameterize it.

Boo-Ya!


Post a reply to this message


Attachments:
Download 'implicitellipticaltorus.png' (49 KB)

Preview of image 'implicitellipticaltorus.png'
implicitellipticaltorus.png


 

From: William F Pokorny
Subject: Re: Elliptical torus
Date: 3 May 2020 14:25:26
Message: <5eaf0c96$1@news.povray.org>
On 5/3/20 12:04 AM, Bald Eagle wrote:
> "Bald Eagle" <cre### [at] netscapenet> wrote:
> 
>>> "I couldn't resist trying it..."
>>
>> lol - well of course not.  :D
> 
> And I couldn't resist implicitizing it.
> I mussssst ... do..... the math..... yesss....
>                                                       my Precious........!
> 
> And here is The One Elliptical Ring.
> The gradient is only about 4.5    :)
> 
> However, you will notice that it doesn't render correctly when axis-aligned.
> If I rotate it by 1 degree (0.5 isn't enough), then it becomes fully visible.
> 
> Do we smell a root-finding problem?  Ugh.
> 
> Martijn does some interesting little tweaks that I haven't thought out
> completely to fix holes and other artifacts:
> https://www.youtube.com/watch?v=-adHIyjIYgk   (14 min mark)
> No idea if any of that is related to POV-Ray isosurface issues.
> I think he might address some similar issues either earlier or in Part 2.
> 
> Anyway, I'm off to bed, but had to post this for Ricky.
> 
> Maybe tomorrow I will be able to better parameterize it.
> 
> Boo-Ya!
> 
:-) Thanks for pushing here. Does this all work only when the major axis 
is 1.0 or something?

I grabbed what you did and tried it after a little re-work to align it 
with the f_torus behavior and on testing the constant sphere width was 
not maintained when a != b - or when I changed the major axis to other 
than one. The last was relatively easy to fix. I had no luck with a!=b 
across all testing - though I could get some subsets of parameters to work.

Might be I screwed something up in reworking it. Will come back to it 
later, but if there are assumptions with the implicit form use,it would 
be helpful to know.

Bill P.


Post a reply to this message

From: Bald Eagle
Subject: Re: Elliptical torus
Date: 3 May 2020 16:35:05
Message: <web.5eaf29f1a032ea3dfb0b41570@news.povray.org>
William F Pokorny <ano### [at] anonymousorg> wrote:

> :-) Thanks for pushing here. Does this all work only when the major axis
> is 1.0 or something?

Unfortunately, I thought, nay - believed (at 1am) that I had gotten it
sufficiently worked out so that I could just get it prettied up and all would be
fine, but of course it has proven to be a bit more challenging than that.
I have been trying to get it re-worked out myself, but how exactly the
z-parameter gets adjusted to compensate for the x and y stretching in the
implicit form is unclear.

I too have been trying to get it to be consistent with POV-Ray's torus in the
xz-plane - I just need to hit upon the proper form.

On the plus side, after a few dozen experiments, I have at least one function
that's sufficiently interesting to pursue at some other point.

It's maddening to be this tantalizingly close and still not _have_ it.


Post a reply to this message

From: Bald Eagle
Subject: Re: Elliptical torus
Date: 3 May 2020 18:55:00
Message: <web.5eaf4bb3a032ea3dfb0b41570@news.povray.org>
So - working with a circle and an ellipse to begin working out the particulars,
it's apparent that the inside and outside curves in the xz plane are going to be
offset curves. (and so they rear their heads _again_!)
I don't know if those curves are themselves ellipses or not.

And that may factor into how difficult it is to derive an equation for the
desired surface.

I feel some 3D diagrams coming...


Post a reply to this message

From: Bald Eagle
Subject: Re: Elliptical torus
Date: 3 May 2020 22:20:00
Message: <web.5eaf7b6da032ea3dfb0b41570@news.povray.org>
First diagram shows plan and elevation of a torus.

The goal is to next adapt everything in Step 2 to an ellipse instead of a
circle.

I think I have it worked out, but I get no visible isosurface, so the math and
logic need to be checked, then I can go isosurface idiosyncrasy hunting.


Post a reply to this message


Attachments:
Download 'implicitellipticaltorus.png' (124 KB)

Preview of image 'implicitellipticaltorus.png'
implicitellipticaltorus.png


 

From: William F Pokorny
Subject: Re: Elliptical torus
Date: 4 May 2020 03:56:00
Message: <5eafca90$1@news.povray.org>
On 5/3/20 4:30 PM, Bald Eagle wrote:
> William F Pokorny <ano### [at] anonymousorg> wrote:
> 
>> :-) Thanks for pushing here. Does this all work only when the major axis
>> is 1.0 or something?
> 
> Unfortunately, I thought, nay - believed (at 1am) that I had gotten it
> sufficiently worked out so that I could just get it prettied up and all would be
> fine, but of course it has proven to be a bit more challenging than that.
> I have been trying to get it re-worked out myself, but how exactly the
> z-parameter gets adjusted to compensate for the x and y stretching in the
> implicit form is unclear.
> 
> I too have been trying to get it to be consistent with POV-Ray's torus in the
> xz-plane - I just need to hit upon the proper form.
> 
> On the plus side, after a few dozen experiments, I have at least one function
> that's sufficiently interesting to pursue at some other point.
> 
> It's maddening to be this tantalizingly close and still not _have_ it.
> 

FYI. I've not recently looked at it, but back in 2006 Bruno Cabasson 
worked up some code for elliptical tori implemented with sphere_sweeps 
and blobs. Perhaps useful to review that work as we look for an 
f_elliptical_torus() or complete parametric solution.

Given we can use blobs as potential patterns in functions/isosurfaces in 
v38, perhaps this a path to something practical for Cousin Ricky?

The sphere_sweep as a general solution is not very attractive in v37 and 
prior due bugs. Situations is better in v38 - and still better in povr 
but the sphere_sweep probably not the fastest.

With both approaches expect tolerances to any math ideal, but perhaps we 
are stuck with a fuzzy result in any case?

I captured his code in my sphere_sweep test cases, let me see if small 
enough to just attach it - yep. Warning! Some chance I hacked on the 
scene file a little from what was originally posted - I didn't check.

Bill P.


Post a reply to this message


Attachments:
Download 'utf-8' (6 KB)

From: Bald Eagle
Subject: Re: Elliptical torus
Date: 4 May 2020 07:10:00
Message: <web.5eaff7d5a032ea3dfb0b41570@news.povray.org>
William F Pokorny <ano### [at] anonymousorg> wrote:
Perhaps useful to review that work as we look for an
> f_elliptical_torus() or complete parametric solution.

I'll go back to my initial post and see what else I need for the parametric.
I had a key insight last night that I need to pursue when I get back later.


With regard to a workaround, if needed:

http://www.econym.demon.co.uk/isotut/splines.htm

Which I should have thought of much much earlier.


Post a reply to this message

From: Bald Eagle
Subject: Re: Elliptical torus
Date: 4 May 2020 15:15:01
Message: <web.5eb06994a032ea3dfb0b41570@news.povray.org>
So, just to provide a diagram for the elliptical torus, we can see that the same
sort of situation exists, and the same calculations are used once we establish a
length from the origin to point P.

And I think that's where things get interesting (complicated).


https://courses.lumenlearning.com/ivytech-collegealgebra/chapter/deriving-the-equation-of-an-ellipse-centered-at-the-or
igin/

describes how the definition of a torus (constant distance from two foci) gets
algebraically converted down to pow(x,2)/pow(a,2) + pow(y,2)/pow(b,2) = 1.

But really what we want is a distance function for the points on an ellipse.

I found this excellent answer for how to do that

https://math.stackexchange.com/q/1760296

so since the distance is sqrt(pow(x,2)+pow(y,2)), I use the equations from that
post to substitute in for x and y in the distance function to get:

#declare DistE = function (x, y, z, a, b){
 sqrt (
 (pow(a,2)*pow(b,2)*pow(x,2))/((pow(b,2)*pow(x,2))+(pow(a,2)*pow(y,2))) +
 (pow(a,2)*pow(b,2)*pow(y,2))/((pow(b,2)*pow(x,2))+(pow(a,2)*pow(y,2)))
 )
}

and then plug that into the main isosurface equation for an elliptical torus
with a constant circular cross-section.

#declare IET =
function (x,y,z,a,b,r) {
 pow(DistE(x,y,z,a,b) - sqrt(pow(x,2)+pow(y,2)) ,2) + pow(z,2) - pow(r,2)
}

But I still get no visible surface.


Post a reply to this message

From: Bald Eagle
Subject: Re: Elliptical torus
Date: 4 May 2020 16:15:01
Message: <web.5eb07701a032ea3dfb0b41570@news.povray.org>
Helps to provide the diagram...


Post a reply to this message


Attachments:
Download 'implicitellipticaltorus.png' (130 KB)

Preview of image 'implicitellipticaltorus.png'
implicitellipticaltorus.png


 

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

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