POV-Ray : Newsgroups : povray.newusers : Elliptical Torus Server Time
29 Jul 2024 14:21:06 EDT (-0400)
  Elliptical Torus (Message 11 to 13 of 13)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: tgl
Subject: Re: Elliptical Torus
Date: 3 Mar 2006 03:45:00
Message: <web.4408015b61f3c539ad16512d0@news.povray.org>
Mike Williams <nos### [at] econymdemoncouk> wrote:
> It's an optical illusion caused by the fact that you see more shadow on
> the horizontal parts, and the shadow is the same colour as the
> background.
>
> If you run that test with a white background the illusion goes away and
> you can see that the real shape is consistent.
> background {rgb 1}
>
 Dear Friends
These old eyes just ain't what they used to be!
I would like to take this opportunity to thank Mr. Williams and everyone
else who have taken time enlightening me!
 Take care,
  tgl


Post a reply to this message

From: Sebastian H 
Subject: Re: Elliptical Torus
Date: 4 Mar 2006 12:23:54
Message: <4409cd2a@news.povray.org>
tgl wrote:
> "tgl" <aub### [at] sympaticoca> wrote:
> 
>>Hello All
>>Is it possible to create an elliptical torus with a varying major diameter
>>and a constant minor diameter?
>>  Thanx,
>>  tgl
> 

I found an isosurface sullution but it's
ugly and slow and I'm not sure whether it
is mathematical "correct" description of
the surface you're looking for. Anyhow it
looks quite like an elliptical torus.

Starting with the two focal point implicit
definition of an ellipse one can simply
alter the ellipse radii with y. The max gradient
explodes but it must be somewhere above the surface
since there are no black spots with a max gradient around
18.

Here's the code snippet.

/*
  * Isosurface ellipsoid torus
  */
#declare Torus_RmajX = 8.0;
#declare Torus_RmajZ = 3.0;
#declare Torus_Rmin = 1.0;

#declare bbox_min = <-(Torus_RmajX + Torus_Rmin), -Torus_Rmin, 
-(Torus_RmajZ + Torus_Rmin)>;
#declare bbox_max = < (Torus_RmajX + Torus_Rmin),  Torus_Rmin, 
(Torus_RmajZ + Torus_Rmin)>;

// Function for focal length with given major and minor radius
// Major radius is along x-axis, minor along z-axis
// This function is abused in f_iso_ellipsoid_torus where
// the same term is required
#declare f_fl = function(rx, rz) { sqrt(max(rx*rx - rz*rz, 0)) }
// The max function above is neccessary to avoid negative square
// roots

// Function for an ellipse in the xz plane
#declare f_iso_ellipsoid =
   function(x,y,z,rx,rz) {
     f_r(x+f_fl(rx,rz),0,z) + f_r(x-f_fl(rx,rz),0,z) - 2*rx
   }

// Use of ellipse function to create inner and outer torus
// halfes which are merged with max()
#declare f_iso_ellipsoid_torus =
   function(x,y,z) {
     max (
 
f_iso_ellipsoid(x,y,z,Torus_RmajX+f_fl(Torus_Rmin,y),Torus_RmajZ+f_fl(Torus_Rmin,y)),
 
-f_iso_ellipsoid(x,y,z,Torus_RmajX-f_fl(Torus_Rmin,y),Torus_RmajZ-f_fl(Torus_Rmin,y))
     )
   }

// The actual object
#declare Iso_Ellipsoid_Torus =
   isosurface {
     function { f_iso_ellipsoid_torus(x,y,z) }
     contained_by { box { bbox_min, bbox_max } }  // container shape
     max_gradient 18                      // maximum gradient the 
function can have [1.1]
   }

End of code snippet.

I looked around in the internet for a function
that returns the distance to an ellipse which
seems to be an unsolvable problem. At least
this is what some papers claimed.
Somwhere the problem was reduced to a
quartic which can be solved somehow iirc
so the above statement would be wrong.
I did not follow it any further but it
is an interesting problem. Maybe I'll
give it another try some day...

Regards,
Sebastian


Post a reply to this message

From: Sebastian H 
Subject: Re: Elliptical Torus
Date: 4 Mar 2006 12:26:24
Message: <4409cdc0$1@news.povray.org>
Sebastian H. wrote:
> 
> I found an isosurface sullution but it's

Well, rereading the own post is a good habit...


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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