POV-Ray : Newsgroups : povray.binaries.images : q on isodonuts Server Time
2 Oct 2024 00:17:40 EDT (-0400)
  q on isodonuts (Message 1 to 5 of 5)  
From: hall
Subject: q on isodonuts
Date: 9 Jul 2000 23:37:56
Message: <39694514@news.povray.org>
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.

A Puzzled (like that's news) Quadhall
tre### [at] ww-interlinknet

#version unofficial MegaPOV 0.5;
light_source { <+0.00,+5.00,+0.00> 1 shadowless}
camera { location <+0.00,+7.50,+0.00> look_at <+0.00,+0.00,+0.00> }

#declare major=+1.00;
#declare minor=+0.25;

#declare a = function{sqrt((x^2)+(z^2))-major}
#declare b = function{atan2(z,x)*6}
#declare c = function{cos(5*atan2(y,a)+b)}
#declare d = function{sqrt(y^2+a^2)-minor+(.5*minor)*c}

//one
isosurface
{
 function {d}
 contained_by{sphere {0,2}}
 eval
 method 1
 max_gradient +1.00
 threshold 0
 pigment{color rgb 1}
 translate<-2.5,0,2>
}

#declare a = function{abs(sqrt((x^2)+(z^2))-major)}
#declare b = function{atan2(z,x)*6}
#declare c = function{cos(5*atan2(y,a)+b)}
#declare d = function{sqrt(y^2+a^2)-minor+(.5*minor)*c}

//two
isosurface
{
 function {d}
 contained_by{sphere {0,2}}
 eval
 method 1
 max_gradient +1.00
 threshold 0
 pigment{color rgb 1}
 translate<-2.5,0,-2>
}

#declare pre_a = function{sqrt((x^2)+(z^2))-major}
#declare a = function{abs(pre_a)}
#declare b = function{atan2(z,x)*6}
#declare c = function{cos(5*atan2(y,a)+b)}
#declare d = function{sqrt(y^2+a^2)-minor+(.5*minor)*c}

//three
isosurface
{
 function {d}
 contained_by{sphere {0,2}}
 eval
 method 1
 max_gradient +1.00
 threshold 0
 pigment{color rgb 1}
 translate<2,0,0>
}


Post a reply to this message


Attachments:
Download 'plate_7.jpg' (25 KB)

Preview of image 'plate_7.jpg'
plate_7.jpg


 

From: Tor Olav Kristensen
Subject: Re: q on isodonuts
Date: 10 Jul 2000 06:46:15
Message: <3969A905.12D25650@online.no>
hall 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?
> ...
> #declare major=+1.00;
> ...
> #declare a = function{sqrt((x^2)+(z^2))-major}
> ...
> #declare a = function{abs(sqrt((x^2)+(z^2))-major)}
> ...
> #declare pre_a = function{sqrt((x^2)+(z^2))-major}
> #declare a = function{abs(pre_a)}
> ...

The first and second expressions are mathematically 
NOT equivalent:

sqrt(x^2 + z^2) - major  <>  abs(sqrt(x^2 + z^2) - major)


But, as far as I can see, the second and the last 
expressions are equivalent and should produce the 
same results (if my assumptions about function 
and isosurfaces are right).


A tip for further debugging:
You might try to render each of the isosurfaces 
independently, with ALL the code for the other 
two commented out, to see if the results are 
still the same.


Tor Olav
--
mailto:tor### [at] hotmailcom
http://www.crosswinds.net/~tok/tokrays.html


Post a reply to this message

From: Tony[B]
Subject: Re: q on isodonuts
Date: 10 Jul 2000 08:43:30
Message: <3969c4f2@news.povray.org>
Oooh...


Post a reply to this message

From: David Fontaine
Subject: Re: q on isodonuts
Date: 10 Jul 2000 14:26:12
Message: <396A1393.6C09BD89@faricy.net>
hall 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.

I don't know, but the code looks a bit excessive. I define torii by
sqrt((sqrt(x^2+z^2)-major)^2+y^2)-minor
First it creates a cirle of sorts around the y axis, then takes the distance
from that circle. It works with negative radii too, so you can get just the
spindle of a spindle torus.

--
David Fontaine     <dav### [at] faricynet>     ICQ 55354965
Please visit my website: http://www.faricy.net/~davidf/


Post a reply to this message

From: Mike Williams
Subject: Re: q on isodonuts
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.