POV-Ray : Newsgroups : povray.newusers : Elliptical Torus Server Time
25 Nov 2024 09:34:20 EST (-0500)
  Elliptical Torus (Message 1 to 10 of 13)  
Goto Latest 10 Messages Next 3 Messages >>>
From: tgl
Subject: Elliptical Torus
Date: 28 Feb 2006 19:45:00
Message: <web.4404ee5087a86c85c61d550e0@news.povray.org>
Hello All
Is it possible to create an elliptical torus with a varying major diameter
and a constant minor diameter?
  Thanx,
  tgl


Post a reply to this message

From: Roman Reiner
Subject: Re: Elliptical Torus
Date: 1 Mar 2006 06:30:00
Message: <web.4405855061f3c539f37ab23e0@news.povray.org>
"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

it should be possible with isosurfaces. see e.g.
http://www.econym.demon.co.uk/isotut/variable.htm
Another possibility would be to approximate the surface with a spheresweep,
see 2.4.1.10 Sphere Sweep
http://www.povray.org/documentation/view/3.6.1/284/

Regards Roman


Post a reply to this message

From: kurtz le pirate
Subject: Re: Elliptical Torus
Date: 1 Mar 2006 14:36:52
Message: <kurtzlepirate-C257F1.20365101032006@news.povray.org>
In article <web.4405855061f3c539f37ab23e0@news.povray.org>,
 "Roman Reiner" <lim### [at] gmxde> 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
> 
> it should be possible with isosurfaces. see e.g.
> http://www.econym.demon.co.uk/isotut/variable.htm
> Another possibility would be to approximate the surface with a spheresweep,
> see 2.4.1.10 Sphere Sweep
> http://www.povray.org/documentation/view/3.6.1/284/
> 
> Regards Roman


as roman say, i think using sphere sweep is a right solution. computing 
points of an ellipse is easy.


-- 
klp


Post a reply to this message

From: helge h
Subject: Re: Elliptical Torus
Date: 1 Mar 2006 19:45:00
Message: <web.44063f9261f3c5391c6902970@news.povray.org>
"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

or approximate it by connecting spheres and cylinders. May render faster?

H


Post a reply to this message

From: tgl
Subject: Re: Elliptical Torus
Date: 1 Mar 2006 20:40:01
Message: <web.44064c4c61f3c539a88bea740@news.povray.org>
"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 was looking to use the torus object statement and incorperate a
mathematical formula to create an oval shape of what ever dimensions and
keep the torus cylinder itself a constant diameter. Scaling a torus doesn't
work.
 Anyone know a formula that may work?
 Again thank you,
 tgl


Post a reply to this message

From: Mike Williams
Subject: Re: Elliptical Torus
Date: 2 Mar 2006 03:16:54
Message: <mdb6oHAXmqBEFwHS@econym.demon.co.uk>
Wasn't it Roman Reiner who 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
>
>it should be possible with isosurfaces. see e.g.
>http://www.econym.demon.co.uk/isotut/variable.htm
>Another possibility would be to approximate the surface with a spheresweep,
>see 2.4.1.10 Sphere Sweep
>http://www.povray.org/documentation/view/3.6.1/284/

I've tried to achieve the effect by modifying the "surface of
revolution" isosurface technique, but everything that changes the major
diameter seems to have a side effect that changes the shape of the minor
cross section.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Roman Reiner
Subject: Re: Elliptical Torus
Date: 2 Mar 2006 05:00:00
Message: <web.4406c1fa61f3c539f37ab23e0@news.povray.org>
does this work for you?

camera {
  location <-5,15,-10>
  look_at 0
  angle 45
}
light_source {
  <-5,15,-10>
  rgb 1
}

#local a = 5; //semimajor axis
#local b = 3; //semiminor axis
#local r = .5; //minor radius

#local n = 20;//number of spheres/accuracy of object

sphere_sweep {
  cubic_spline
  n+3,
  #local i=0;
  #while(i<=2*pi*(1+2/n))
    <a*sin(i),0,b*cos(i)>, r
    #local i=i+(2*pi/n);
  #end
  pigment { rgb y }
  finish { phong 1 }
}

Regards Roman


Post a reply to this message

From: tgl
Subject: Re: Elliptical Torus
Date: 2 Mar 2006 17:50:00
Message: <web.4407760b61f3c5399fea01560@news.povray.org>
"Roman Reiner" <lim### [at] gmxde> wrote:
> does this work for you?
>
> camera {
>   location <-5,15,-10>
>   look_at 0
>   angle 45
> }
> light_source {
>   <-5,15,-10>
>   rgb 1
> }
>
> #local a = 5; //semimajor axis
> #local b = 3; //semiminor axis
> #local r = .5; //minor radius
>
> #local n = 20;//number of spheres/accuracy of object
>
> sphere_sweep {
>   cubic_spline
>   n+3,
>   #local i=0;
>   #while(i<=2*pi*(1+2/n))
>     <a*sin(i),0,b*cos(i)>, r
>     #local i=i+(2*pi/n);
>   #end
>   pigment { rgb y }
>   finish { phong 1 }
> }
>
> Regards Roman

Tried the above and as is, it looks good but then I tried the following
variation...

camera {
  location <0,0,-10>
  look_at 0

}
light_source {
  <-5,15,-10>
  rgb 1
}

#local a = 5; //semimajor axis
#local b = 3; //semiminor axis
#local r = .5; //minor radius

#local n = 20;//number of spheres/accuracy of object

sphere_sweep {
  cubic_spline
  n+3,
  #local i=0;
  #while(i<=2*pi*(1+2/n))
    <a*sin(i),0,b*cos(i)>, r
    #local i=i+(2*pi/n);
  #end
  pigment { rgb y }
  finish { phong 1 }
  rotate <-90,0,0>
}

 Is there some kind of distortion happening here or am I seeing things. I
really need an accurate and consistant shape.
 tgl


Post a reply to this message

From: Bruno Cabasson
Subject: Re: Elliptical Torus
Date: 2 Mar 2006 19:05:00
Message: <web.440786bb61f3c5392bb58dc50@news.povray.org>
Hi!

I worked on the problem and I posted in p.b.i + p.b.s-f a solution with
sphere_sweep, and also with a blob (fast render) with a constant behaviour
(I think ..). Your problem might come from the use of the parametric form
of an ellipse, which gives non-constant spacing between samples on the
perimeter from regular parametric values, or/and perhaps from the use of too
few control points in the spline.

The blob macro I posted uses also the parametric equation, but travels along
the perimeter by oversampling, an drops a blob element every constant
spacing, giving quite good results. I hope thi will help, and I am sure
that what I did can be very much improved.

    Bruno


Post a reply to this message

From: Mike Williams
Subject: Re: Elliptical Torus
Date: 3 Mar 2006 01:36:43
Message: <MZzwpFA2M+BEFwDD@econym.demon.co.uk>
Wasn't it tgl who wrote:
> Is there some kind of distortion happening here or am I seeing things. I
>really need an accurate and consistant shape.

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}
        
You can easily check the accuracy by adding some spheres with a slightly
larger radius along the ellipse, and observing that they all fit
properly.

camera {
  location <0,0,-10>
  look_at 0

}
light_source {
  <-5,15,-10>
  rgb 1
}

#local a = 5; //semimajor axis
#local b = 3; //semiminor axis
#local r = .5; //minor radius

#local n = 20;//number of spheres/accuracy of object


sphere_sweep {
  cubic_spline
  n+3,
  #local i=0;
  #while(i<=2*pi*(1+2/n))
    <a*sin(i),0,b*cos(i)>, r
    #local i=i+(2*pi/n);
  #end
  pigment { rgb y }
  finish { phong 1 }
  rotate <-90,0,0>
}

background {rgb 1}

#local i=0;
#while(i<=2*pi*(1+2/n))
  sphere{<a*sin(i),b*cos(i),0>, r+0.001 pigment {rgb <2,2,0>}}
  #local i=i+(2*pi/n);
#end


Post a reply to this message

Goto Latest 10 Messages Next 3 Messages >>>

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