POV-Ray : Newsgroups : povray.advanced-users : Whats wrong with this isosurface ? : Re: Whats wrong with this isosurface ? Server Time
29 Jul 2024 06:15:45 EDT (-0400)
  Re: Whats wrong with this isosurface ?  
From: Mike Williams
Date: 12 Sep 2003 14:10:37
Message: <S2goTGAdvgY$EwkC@econym.demon.co.uk>
Wasn't it JC (Exether) who wrote:
>Peter Lang wrote:
>> Hello,
>> I am just trying to understand the function of isosurface .
>> As I understand the surface of an object is just there where the function
>> get zero
>> So I get a simple sphere with the following:
>> isosurface {  function { pow(x,2) + pow(y,2) + pow(z,2) - 1   }
>> 
>> But I thougt if I take the funktion to the sqare there should be no
>> difference
>> because the square of zero is still zero
>> But
>> isosurface {  function { pow( (pow(x,2) + pow(y,2) + pow(z,2) - 1) ,2)  }
>> gives no object.
>> please tell me why
>> 
>> peter

For some reason the original message hasn't arrived here yet, so I'm
replying to the reply.

What happens when you square the whole equation is that the value of the
function is greater than zero everywhere except exactly on the surface.
The isosurface root finder finds the surface by first finding two points
where the function has opposite sign, and then stepping inwards looking
for the place where the function changes sign. For the squared equation
that never happens.

Consider this function

isosurface {
  function { pow( (pow(x,2) + pow(y,2) + pow(z,2) - 1) ,2) + 0.00001 }

This function is positive and greater than or equal to 0.00001
everywhere, so there is no surface.

Then consider this function

isosurface {
  function { pow( (pow(x,2) + pow(y,2) + pow(z,2) - 1) ,2) - 0.00001 }

In this case there is a thin region where the function dips below zero,
and POV correctly renders this as two concentric spheres, one with a
radius slightly larger than 1.0 and one (which you don't see unless you
cut a hole) slightly less.

If you try the same thing with a smaller number at the end

isosurface {
  function { pow( (pow(x,2) + pow(y,2) + pow(z,2) - 1) ,2) - 0.000001 }

You have to set the "accuracy" value lower in order to persuade POV to
render this correctly, because the two parts of the surface are closer
than the default accuracy can handle.

If you want to get POV to work with your original function, you'd have
to set the accuracy infinitely low (but if you ask for accuracy 0.0,
then POV uses the default value which is documented as being 0.001) and
the render would be expected to take an infinite amount of time.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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