POV-Ray : Newsgroups : povray.binaries.images : q on isodonuts : Re: q on isodonuts Server Time
1 Oct 2024 22:23:06 EDT (-0400)
  Re: q on isodonuts  
From: Mike Williams
Date: 10 Jul 2000 16:11:55
Message: <+wcExCAcyia5EwoN@econym.demon.co.uk>
Wasn't it hall who wrote:
>Well, I have been playing around with isosurface donuts, and found something
>puzzling.  The attached image (source code below) is of three isosurface
>torii (donuts) that have, so far as I can tell, mathematically equivalent
>functions.  Can anyone see why these functions produce different results?
>Please excuse the inconsistent notation in the code--> I am still messing
>with it, and have not prettied it up.


>#declare a = function{sqrt((x^2)+(z^2))-major}

>#declare a = function{abs(sqrt((x^2)+(z^2))-major)}

These two are not the same. As far as MeagPov is concerned, first one is
the same as
  #declare a = function{abs(sqrt((x^2)+(z^2)))-major}
Note the different position of the final closing round bracket. With
this fixed, the two images are identical.



>#declare pre_a = function{sqrt((x^2)+(z^2))-major}
>#declare a = function{abs(pre_a)}

There's something peculiar going on here. It's interesting to note that

#declare pre_a = function{sqrt((x^2)+(z^2))-major}
#declare a = function{pre_a}

renders like the other two, but 

#declare a = function{(pre_a)}
and
#declare a = function(pre_a)

show the peculiar effect.

*However* the peculiar effects only occurs when you use "method 1",
which has been known to sometimes get things wrong. In fact "method 1"
gets all these isodonuts completely wrong. To see what they should
really look like, use "method 2" and *either* "eval" or "max_gradient
4.1". When you do this with the second and third donuts, they become
identical.

(If you use both "eval" and "max_gradient", MegaPov seems to use the
max_gradient you supplied and ignore the "eval". If you use "eval", it
will work out what the max_gradient should be - this may cause the
processing to take a little longer. If you specify a max_gradient, don't
lie about the value or you may get ragged holes.)

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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