POV-Ray : Newsgroups : povray.general : Is this an example of Isosurface Image Noise Problem? Server Time
14 Nov 2024 23:19:27 EST (-0500)
  Is this an example of Isosurface Image Noise Problem? (Message 1 to 4 of 4)  
From: mephuser
Subject: Is this an example of Isosurface Image Noise Problem?
Date: 23 Jan 2005 08:50:00
Message: <web.41f3aa55fa67b1433d54f5180@news.povray.org>
Is this an example of Isosurface Image Noise Problem?

Referring to this FAQ,
http://tag.povray.org/povQandT/languageQandT.html#isosurfacebug

I wonder if my Isosurface code below fits the above description.
I'm having sudden black lines here and there...
I would agree that using Predefined shape code would solve my entire
problem, however I'm required to render in Isosurface code, so no
shortcuts.

[Isosurface Code]

#include "colors.inc"
#include "functions.inc"

global_settings
{
  assumed_gamma 1.0
}

camera
{
  location  <0.0, .5, -4.5>
  direction 1.5*z
  right     4/3*x
  look_at   <0.0, 0.0, 0.0>
}

light_source
{
  0*x // light's position (translated below)
  color red 1.0  green 1.0  blue 1.0  // light's color
  translate <-30, 30, -30>
}

/*sky_sphere { pigment {
    function{abs(y)}
    color_map { [0.0 color blue 0.6] [1.0 color rgb 1] }
  }
} */

// ----------------------------------------

/* #declare R = 0.5;

isosurface {
  function { x*x + y*y + z*z - R*R }
        max_gradient 4.4
        //contained_by{sphere{0,1.2}}
        //interior{ior 1.5 dispersion 1.05}
        pigment {rgb .9}
        finish {phong 0.5 phong_size 10}
} */

//#declare C = 0.215;

/*isosurface {
function { -(0.215-pow(x,2)-pow(z,2)) }
        threshold 0
        accuracy 0.001
        max_gradient 4.4
        //contained_by{sphere{0,2}}
        pigment {White}
        finish {specular 1}
}  */

difference{
merge
{

// Cylinder Middle
isosurface {
  function { pow(x,2) + pow(z,2) - pow(0.215,2) }
        accuracy 0.001
        threshold 0
        max_gradient 4
        contained_by{box{<-1,-0.5,-1>, <1,0.5,1>}}
        texture{pigment {White filter 0.7} finish{specular 1}}
}

//Sphere Top
isosurface {
  function { pow(x,2) + pow(y,2) + pow(z,2) - pow(0.5,2) }
        accuracy 0.001
        threshold 0
        max_gradient 4
        texture{pigment {White filter 0.7} finish{specular 1}}
        translate <0, 0.78, 0>
}

//Sphere Bottom
isosurface {
  function { pow(x,2) + pow(y,2) + pow(z,2) - pow(0.5,2) }
        accuracy 0.001
        threshold 0
        max_gradient 4
        texture{pigment {White filter 0.7} finish{specular 1}}
        translate <0, -0.78, 0>
}

// Cylinder Top
isosurface {
  function { pow(x,2) + pow(z,2) - pow(0.5,2) }
        accuracy 0.001
        threshold 0
        max_gradient 4
        contained_by{box{<-1,0.78,-1>, <1,1,1>}}
        texture{pigment {White filter 0.7} finish{specular 1}}
}

// Cylinder Bottom
isosurface {
  function { pow(x,2) + pow(z,2) - pow(0.5,2) }
        accuracy 0.001
        threshold 0
        max_gradient 4
        contained_by{box{<-1,-0.78,-1>, <1,-1,1>}}
        texture{pigment {White filter 0.7} finish{specular 1}}
}

}

/* isosurface {
function { f_torus (x,y,z,0.385, 0.37) }
        //accuracy 0.001
        //threshold 0
        max_gradient 4
contained_by{sphere {0,0.5}}
texture{pigment {White filter 0.7} finish{specular 1}}
}  */

//torus{0.385, 0.37}
//texture{pigment {White filter 0.7} finish{specular 1}}

#declare r1=0.385;
#declare r2=0.37;

poly
{ 4,
  <1,0,0,0,2,
   0,0,2,0,-2*(r1*r1+r2*r2),
   0,0,0,0,0,
   0,0,0,0,0,
   1,0,0,2,0,
   2*(r1*r1-r2*r2),0,0,0,0,
   1,0,-2*(r1*r1+r2*r2),0,pow(r1,4)+pow(r2,4)-2*r1*r1*r2*r2>
  texture{pigment {White filter 0.7} finish{specular 1}}
}


}

[/Isosurface Code]

[Predefined Shape Code]

#include "colors.inc"

global_settings
{
  assumed_gamma 1.0
}

camera
{
  location  <0.0, .5, -4.5>
  direction 1.5*z
  right     4/3*x
  look_at   <0.0, 0.0, 0.0>
}

light_source
{
  0*x // light's position (translated below)
  color red 1.0  green 1.0  blue 1.0  // light's color
  translate <-30, 30, -30>
}

difference
{
  merge
  {
    cylinder{<0,-0.5,0>, <0,0.5,0>, 0.215}
    sphere{<0, .78, 0> 0.5}
    sphere{<0, -.78, 0> 0.5}
    cylinder{<0, .78, 0>, <0, 1, 0>, .5}
    cylinder{<0, -.78, 0>, <0, -1, 0>, .5}
  }
  torus{0.385, 0.37}
  texture{pigment {White filter 0.7} finish{specular 1}}
}

[/Predefined Shape Code]


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Is this an example of Isosurface Image Noise Problem?
Date: 23 Jan 2005 09:51:32
Message: <41f3b9f4@news.povray.org>
In article <web.41f3aa55fa67b1433d54f5180@news.povray.org> , "mephuser" 
<nomail@nomail> wrote:

> Is this an example of Isosurface Image Noise Problem?
>
> Referring to this FAQ,
> http://tag.povray.org/povQandT/languageQandT.html#isosurfacebug
>
> I wonder if my Isosurface code below fits the above description.
> I'm having sudden black lines here and there...
> I would agree that using Predefined shape code would solve my entire
> problem, however I'm required to render in Isosurface code, so no
> shortcuts.

Well, what does POV-Ray tell you about the max_gradient?  Does the problem
go away if you change thee max_gradient or accuracy?

    Thorsten


Post a reply to this message

From: mephuser
Subject: Re: Is this an example of Isosurface Image Noise Problem?
Date: 23 Jan 2005 20:40:01
Message: <web.41f4513ec8b65e943d54f5180@news.povray.org>
"Thorsten Froehlich" <tho### [at] trfde> wrote:
> In article <web.41f3aa55fa67b1433d54f5180@news.povray.org> , "mephuser"
> <nomail@nomail> wrote:
>
> > Is this an example of Isosurface Image Noise Problem?
> >
> > Referring to this FAQ,
> > http://tag.povray.org/povQandT/languageQandT.html#isosurfacebug
> >
> > I wonder if my Isosurface code below fits the above description.
> > I'm having sudden black lines here and there...
> > I would agree that using Predefined shape code would solve my entire
> > problem, however I'm required to render in Isosurface code, so no
> > shortcuts.
>
> Well, what does POV-Ray tell you about the max_gradient?  Does the problem
> go away if you change thee max_gradient or accuracy?
>
>     Thorsten

Problem doesn't go away with Increasing Max_gradient or decreasing accuracy.


Post a reply to this message

From: Slime
Subject: Re: Is this an example of Isosurface Image Noise Problem?
Date: 23 Jan 2005 22:41:28
Message: <41f46e68$1@news.povray.org>
> Is this an example of Isosurface Image Noise Problem?


No; the problem you're seeing is caused by merging the isosurfaces. In
places where two isosurfaces in the merge{} are very close together, the
surface disappears. My guess is that the ray is intersecting one of them,
but the intersection is slightly innacurate, so it thinks it's inside the
other one (and hence determines there is no surface at that position); then
the ray continues and never intersects the other one since it was too close
to the first intersection. So a surface is never detected. A similar thing
is happening with the difference with the poly object.

The problem can be *almost* eliminated by reducing accuracy to something
more like .00000001.

However, I think your best solution here is to rethink your code entirely.
You say you require the usage of isosurfaces. Why is that? Are you sure it's
necessary? And if it *is* necessary, then isn't the usage of CSG with these
isosurfaces going to be just as much of a problem as using predefined shapes
would have been in the first place? (I mean, what does the usage of
isosurfaces do for you when your outmost object is a difference{} anyway?)

If isosurfaces are an absolute must, then I would expect that CSG isn't an
option for the same reason, whatever that reason may be. In this case, I
strongly suggest using the IsoCSG macros provided at
http://www-public.tu-bs.de:8080/~y0013390/pov/ic/ . Then your entire object
will be an isosurface function, and you can do whatever you want with it
(apply deformations, for instance). Also, the problem you're experiencing
here won't exist anymore.

If you're not positive that isosurfaces are necessary, then tell us your
reasoning and we'll help you decide.

Note that the poly{} object could probably be replaced with a torus.

As a final note, it would be wise to add the all_intersections keyword when
using transparency with an isosurface.

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


Post a reply to this message

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