POV-Ray : Newsgroups : povray.advanced-users : Whats wrong with this isosurface ? Server Time
25 Nov 2024 12:30:51 EST (-0500)
  Whats wrong with this isosurface ? (Message 1 to 6 of 6)  
From: Peter Lang
Subject: Whats wrong with this isosurface ?
Date: 22 Oct 2002 18:13:15
Message: <3db5cd7b$1@news.povray.org>
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


Post a reply to this message

From: Slime
Subject: Re: Whats wrong with this isosurface ?
Date: 22 Oct 2002 19:25:53
Message: <3db5de81$1@news.povray.org>
> isosurface {  function { pow( (pow(x,2) + pow(y,2) + pow(z,2) - 1) ,2)  }
> gives no object.
> please tell me why


Remember that in order to find where an isosurface function equals zero,
POV-Ray must test around the function. This means that it tests in areas
where the function is not equal to zero. Now, the function

pow(x,2) + pow(y,2) + pow(z,2) - 1

Is already a little weird outside the zero range. The function

sqrt(pow(x,2) + pow(y,2) + pow(z,2)) -1

would look the same but would have a gradient of 1 everywhere. The former
function has a gradient that gets bigger farther away from zero.

Now, when you square the former function, to get pow( (pow(x,2) + pow(y,2) +
pow(z,2) - 1) ,2), the gradients get a *lot* bigger *really* fast beyond the
surface of the circle. This is probably confusing POV-Ray.

Therefore, if you really want to use this function for some reason, you'll
have to set the max_gradient significantly larger than 1.

 - Slime
[ http://www.slimeland.com/ ]


Post a reply to this message

From: KalleK
Subject: Re: Whats wrong with this isosurface ?
Date: 23 Oct 2002 03:28:04
Message: <3db64f84$1@news.povray.org>
> isosurface {  function { pow( (pow(x,2) + pow(y,2) + pow(z,2) - 1)
> ,2)  } gives no object.

Hello!

What you see, using an isosurface is the functiuon, where it's value is
equall to a threshold. This Threshold defaults to 0. The function you use
above is greater zero in every point but the origin.
If you alter the threshold setting to 1, you will see something.

Kalle


Post a reply to this message

From: Pyry
Subject: Re: Whats wrong with this isosurface ?
Date: 23 Oct 2002 07:45:08
Message: <web.3db68b0baf8ad8c2398d8dbb0@news.povray.org>
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
>

POV ray renders a surface only when the values cross zero. That function is
positive (and above or equal to the threshold value) in it's whole range.


Post a reply to this message

From: JC (Exether)
Subject: Re: Whats wrong with this isosurface ?
Date: 12 Sep 2003 04:34:32
Message: <3f618518$1@news.povray.org>
The isosurface defined by a function f is equivalent to the isosurface 
defined by pow(f,2) if threshold it 0, so you should define your sphere 
more simply with the functions.inc function f_sphere (x,y,z,1) and you 
will see it.

JC

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
> 
>


Post a reply to this message

From: Mike Williams
Subject: Re: Whats wrong with this isosurface ?
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.