POV-Ray : Newsgroups : povray.general : supertorus Server Time
2 Aug 2024 06:17:43 EDT (-0400)
  supertorus (Message 1 to 3 of 3)  
From: Barehunter
Subject: supertorus
Date: 9 Jan 2005 22:50:00
Message: <web.41e1fa4fd4d23e3ea28ef6d80@news.povray.org>
Hello all. In the shapes.inc file is a macro called Supertorus. Most macros
have some kind of explanation in remarks above them. But this one doesn't
have any. Can anyone explain what the listed parameters are. they are kinda
named cryptically. Thank you


Post a reply to this message

From: Mike Williams
Subject: Re: supertorus
Date: 10 Jan 2005 02:04:19
Message: <hFu7+OAmji4BFw7A@econym.demon.co.uk>
Wasn't it Barehunter who wrote:
>Hello all. In the shapes.inc file is a macro called Supertorus. Most macros
>have some kind of explanation in remarks above them. But this one doesn't
>have any. Can anyone explain what the listed parameters are. they are kinda
>named cryptically. Thank you

MajorRadius and MinorRadius are the same as what you would use in an
ordinary torus. (see the pretty graphic in the "torus" documentation if
you're unsure about these).

MajorControl, MinorControl are similar to the parameters of a
superellipsoid. When the values are both 1.0 then you get a conventional
torus. When the MajorControl is less than 1, the overall shape of the
object more like a square than a circle. When MinorControl is less than
1, the cross section of the object becomes more like a square than a
circle.

Accuracy and MaxGradient. See the "isosurface" documentation for these
parameters, but also note that the macro uses "eval" when passed a
MaxGradient value less than or equal to 1.

For most sets of parameters, a MaxGradient of 1.0 would make a good
first guess. If you've got an extremely thin MinorRadius you might need
a higher value. Look for a maxgradient warning in the message pane. The
"eval" method tends to be much slower to render and sometimes leaves
holes, so try to avoid it. If the maxgradient warning suggests a lower
value than 1.0, use 1.0 to avoid the use of "eval".

So:
  Supertorus(3, 1,  1, 1,  0.000001, 1)
gives a conventional torus.

  Supertorus(3, 1, 0.01, 1, 0.000001, 1)
the overall shape has become very close to being a square, but the cross
section is still circular, so it looks like parts of four cylinders
mitred together.

  Supertorus(3, 1, 1, 0.01, 0.000001, 1)
the cross section has become very close to being a square, but the
overall shape is still circular, so it looks like a cylinder with a hole
through the middle.


Control values less than 0.0 create odd shapes that don't fit into the
contained_by box, so they're probably not very useful.

Control values equal to 0.0 produce "division by zero" errors.

Control values between 1.0 and 2.0 cause the shape to become more like a
diamond than a circle. E.g.
  Supertorus(3, 1, 2, 2, 0.000001, 1.6)
has a diamond for the overall shape and for the cross section.

Control values above 2.0 cause shapes that are like concave diamonds.
The required maxgradient tends to become very large for values higher
than 3.0, so the renders become very slow.
  Supertorus(3, 1, 3, 0.1, 0.000001, 17)
has a concave diamond for the overall shape

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Paul Bourke
Subject: Re: supertorus
Date: 10 Jan 2005 02:53:24
Message: <pdb_NOSPAM-804BED.18532310012005@news.povray.org>
> Hello all. In the shapes.inc file is a macro called Supertorus. Most macros
> have some kind of explanation in remarks above them. But this one doesn't
> have any. Can anyone explain what the listed parameters are. they are kinda
> named cryptically. 

I suspect it is this
   http://astronomy.swin.edu.au/~pbourke/surfaces/torus/

-- 
Paul Bourke
pdb_NOSPAMswin.edu.au


Post a reply to this message

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