POV-Ray : Newsgroups : povray.general : Inner face of isosurface seems not to exist Server Time
1 Nov 2024 11:14:42 EDT (-0400)
  Inner face of isosurface seems not to exist (Message 1 to 5 of 5)  
From: Sereib
Subject: Inner face of isosurface seems not to exist
Date: 11 Jun 2012 05:40:01
Message: <web.4fd5bbc35c8de907f7cd27ff0@news.povray.org>
Hello,

I want to create a half spherical shell using an isosurface like this:

difference{
    isosurface{function{0.1-exp(-abs(pow(x*x+y*y+z*z,0.5)-0.75)/0.1)}
        threshold 0 accuracy 0.0001 max_gradient 10
        texture{pigment{rgb yellow}}
    cylinder{<0,0,0>,<0,0,-1>,1 texture{pigment{rgb blue}}}
}

which generally works. The yellow outer face as well as the blue cross section
are visible and indicate that, in principle, the function gives a spherical
shell. However, the inner face of the shell is invisible - even more than
invisible, the background of the scene is visible in this direction through the
shell. Adding "interior_texture" does not help, the rays just find no object if
they hit the inner face. Increasing accuracy and gradient does also not fix the
problem.

By the way: I cannot use just the difference of two sphere, because I would like
to give the shell a more detailed 3d-structure by adding some other functions to
the isosurface.

Thank you in advance!


Post a reply to this message

From: waggy
Subject: Re: Inner face of isosurface seems not to exist
Date: 11 Jun 2012 09:20:00
Message: <web.4fd5efbe339330479726a3c10@news.povray.org>
"Sereib" wrote:
> which generally works. The yellow outer face as well as the blue cross section
> are visible and indicate that, in principle, the function gives a spherical
> shell. However, the inner face of the shell is invisible - even more than
> invisible, the background of the scene is visible in this direction through the
> shell. Adding "interior_texture" does not help, the rays just find no object if
> they hit the inner face. Increasing accuracy and gradient does also not fix the
> problem.
>
It looks like it's possible to work around this odd problem using a
contained_by.

#version 3.7;
#include "colors.inc"
#include "stage1.inc"

difference{
    isosurface{ function{0.1-exp(-abs(pow(x*x+y*y+z*z,0.5)-0.75)/0.1)}
        threshold 0 accuracy 0.0001 max_gradient 10
        contained_by{ box{<-1,-1,-1e-6><1,1,1>}}
        texture{pigment{rgb Yellow}}
        }
    cylinder{ <0,0,0>,<0,0,-1>,1 texture{pigment{rgb Blue}} }

    rotate y*45 translate -z*2
}


Post a reply to this message

From: Sereib
Subject: Re: Inner face of isosurface seems not to exist
Date: 11 Jun 2012 10:35:00
Message: <web.4fd601fe33933047f7cd27ff0@news.povray.org>
Hi,

thank you, good to know! Is this just a bug, or based on certain mathematical
reasons?

By the way, my work-around was to avoid the "difference" feature, but combine
two functions as follows in order to get the difference object:

isosurface{function{max(f_object(x,y,z), -f_difference(x,y,z))}} ...

with f_object defining the object, and f_difference the difference object.


Post a reply to this message

From: Cousin Ricky
Subject: Re: Inner face of isosurface seems not to exist
Date: 11 Jun 2012 14:50:00
Message: <web.4fd63d5e3393304785de7b680@news.povray.org>
"Sereib" <nomail@nomail> wrote:
> thank you, good to know! Is this just a bug, or based on certain mathematical
> reasons?

It's not a bug; it's a feature.  Use max_trace or all_intersections when using
CSG difference on an isosurface.  (This will slow down the render, but at least
it will be correct.)

See the last paragraph of <http://www.povray.org/documentation/view/3.6.1/300/>.

> By the way, my work-around was to avoid the "difference" feature, but combine
> two functions as follows in order to get the difference object:
>
> isosurface{function{max(f_object(x,y,z), -f_difference(x,y,z))}} ...
>
> with f_object defining the object, and f_difference the difference object.

That'll work, too.


Post a reply to this message

From: James Holsenback
Subject: Re: Inner face of isosurface seems not to exist
Date: 11 Jun 2012 18:16:01
Message: <4fd66e21$1@news.povray.org>
On 06/11/2012 10:34 AM, Sereib wrote:
> Hi,
>
> thank you, good to know! Is this just a bug, or based on certain mathematical
> reasons?

don't think so ... since in your original post you didn't specify 
contained_by you got the default: box{-1,1}


Post a reply to this message

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