POV-Ray : Newsgroups : povray.binaries.images : Torus problem (69KB) : Re: Torus problem (69KB) Server Time
2 Oct 2024 20:24:30 EDT (-0400)
  Re: Torus problem (69KB)  
From: Adam Coffman
Date: 29 Apr 2000 15:51:36
Message: <390B3D47.F682C002@ipfw.edu>
Tor Olav Kristensen wrote:
> 
> Chris Huff wrote:
> >
> > Ken wrote:
> >
> > > Tor Olav Kristensen wrote:
> > > > ...How are we supposed to model such cigar shapes then?
> > >
> > > A lathe can do it with ease and can also be used in CSG operations.
> >
> > You can also do it with the poly or quartic objects, and it is quite
> > easy to do with the isosurface object.
> 
> I have been thinking about that, but I have not found the
> proper equation for that yet.
> 
> (Where the minor and major radii are a part of the equation.)
> 
> Any suggestions?
> 


Maybe this is what you are asking about?

Equations for a torus,

major radius R>0 centered at (x,y,z)=(0,0,0)
minor radius r>0 (any value: r<R, r=R, or r>R, all OK)
rotational symmetry axis = z-axis

Parametric equations, depending on parameters s and t from 0 to 2*Pi:

x:=(R+r*cos(t))*cos(s);

y:=(R+r*cos(t))*sin(s);

z:=r*sin(t);

Implicit quartic equation:

0 = (x^2+y^2+z^2+R^2-r^2)^2-4*R^2*(x^2+y^2)

which expands to:

0 = r^4 - 2*x^2*r^2 - 2*y^2*r^2 - 2*r^2*R^2 - 2*r^2*z^2 + R^4 -
2*R^2*x^2 - 2*y^2*R^2 + 2*R^2*z^2 + x^4 + 2*x^2*y^2 + 2*x^2*z^2 +
2*y^2*z^2 + z^4 + y^4


I gave an example of this when replying to a post in this newsgroup by
D. Fontaine, 12-19-99.

Adam C.


Post a reply to this message

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