POV-Ray : Newsgroups : povray.newusers : Interface artefacts in merging transparent isosurface objects Server Time
25 Nov 2024 07:31:06 EST (-0500)
  Interface artefacts in merging transparent isosurface objects (Message 1 to 5 of 5)  
From: Timm
Subject: Interface artefacts in merging transparent isosurface objects
Date: 25 Mar 2006 18:00:01
Message: <web.4425cb51a1751a98f08358cb0@news.povray.org>
Hi everybody,

I am new in using povray. Yet, I would like to use transparent isosurface
objects with some absorption. In order to form the object I want I need to
merge different isosurface objects.
Now it happens always that the interface is still visible between two object
that touch each other in a plane. But these internal interfaces should be
removed by using merge, should'nt they?
Letting the two objects overlap (and not just touch) does not improve the
outcome.
Are there some parameters or settings that I am not aware of which can help?
Or is my approach unsuitable (see code below)?

Thanks for any help,

Timm.


This is the code I used:

#include "colors.inc"
#include "stones.inc"
global_settings { max_trace_level 100 }
global_settings { max_intersections 100 }
background { color White }
light_source { <3,10,-5> color White }
camera {
  location <3,4,-7>
  look_at <0,2,0>
}
#declare myTexture = texture {
 pigment { Gold filter 1 }
   finish {
      ambient 0.2
      diffuse 0.4
      reflection 0.05
      specular 0.5
      roughness .02
   }
}
#declare myInterior = interior {
  media { absorption 0.7}
}

sphere {
       <0,4,3>,0.5
       texture { T_Stone25 pigment { color Blue }
              finish { phong 1 } }
}
sphere {
       <3.5,1.5,8>,0.5
       texture { T_Stone25 pigment { color Green }
              finish { phong 1 } }
}
sphere {
      <1,1,1>,1.2
       texture { T_Stone25 pigment { color Red }
              finish { phong 1 } }
}
merge {
  isosurface {
  function { max(-1/8*(x-5)*(x-5)+y,-y-1) }
  contained_by { box {<1,0,-1>,<4,2,10> } }
  threshold 0
  max_gradient 2
  }
  isosurface {
  function { max(-3+x+y,-y-1) }
  contained_by { box {<1,0,-1>,<-2,5,4> } }
  threshold 0
  max_gradient 2
  }
  hollow
  texture { myTexture }
  interior { myInterior }
}


Post a reply to this message

From: POVMAN
Subject: Re: Interface artefacts in merging transparent isosurface objects
Date: 27 Mar 2006 07:35:17
Message: <4427dc05@news.povray.org>
I havn't been able to try your code, but a problem I've had with meeting 
isosurfaces is that sometimes the "accuracy" setting needs to be reduced. 
say from 0.0001 to 0.000001.  This usually helps when the problem is a black 
speckeling effect at the join.

-- 
#####-----#####-----#####
POV Tips and Hints at ...
http://povman.blogspot.com/


Post a reply to this message

From: Timm
Subject: Re: Interface artefacts in merging transparent isosurface objects
Date: 27 Mar 2006 17:35:01
Message: <web.442867865ac6970fe8160a780@news.povray.org>
"POVMAN" <s### [at] acom> wrote:
> I havn't been able to try your code, but a problem I've had with meeting
> isosurfaces is that sometimes the "accuracy" setting needs to be reduced.
> say from 0.0001 to 0.000001.  This usually helps when the problem is a black
> speckeling effect at the join.
>
> --
> #####-----#####-----#####
> POV Tips and Hints at ...
> http://povman.blogspot.com/

Thanks for the reply.
I tried several values for the accuracy but that did not help. At the join
there is always an opaque interface visible, independent of the camera
position. For very large values of the accuracy (0.1) similar effects
showed up also at some outer corners and edges of the objects.

A slight overlap of the two objects does not help, either. Unfortunately, I
cannot put an image here.

Other ideas out there?

Regards,
Timm.


Post a reply to this message

From: Mike Williams
Subject: Re: Interface artefacts in merging transparent isosurface objects
Date: 27 Mar 2006 18:42:03
Message: <aAclfGAkaHKEFwJZ@econym.demon.co.uk>
Wasn't it Timm who wrote:
>Hi everybody,
>
>I am new in using povray. Yet, I would like to use transparent isosurface
>objects with some absorption. In order to form the object I want I need to
>merge different isosurface objects.
>Now it happens always that the interface is still visible between two object
>that touch each other in a plane. But these internal interfaces should be
>removed by using merge, should'nt they?

There's something strange going on that I don't quite understand.

If I experiment with simple isosurfaces, like spheres, I can get them to
merge correctly.

merge {
  isosurface {
  function { f_sphere(x-1,y,z,1.7) }
  contained_by { box {<0,-3,-3>,3 } }
  threshold 0
  max_gradient 2
  all_intersections
  }
  isosurface {
  function { f_sphere(x+1,y,z,1.7) }
  contained_by { box {-3,<0,3,3> } }
  threshold 0
  max_gradient 2
  all_intersections
  }
  hollow
  texture { myTexture }
} 

To see it go wrong, remove one or both of the "all_intersections"
keywords.

However, I can't seem to get the same method to work with your
particular shape.

One thing you can do is to write the whole thing as a single isosurface. 

isosurface {
  function {
    min(
     max(-1/8*(x-5)*(x-5)+y, -y-1, 1-x),
     max(-3+x+y, -y-1, x-1, z-4)
    ) 
  }
  contained_by { box {<-2,0,-1>,<4,5,10> } }
  threshold 0
  max_gradient 2
  hollow
  texture { myTexture }
  interior { myInterior }
}



-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Timm
Subject: Re: Interface artefacts in merging transparent isosurface objects
Date: 28 Mar 2006 17:25:01
Message: <web.4429b6e25ac6970f1c086f4e0@news.povray.org>
The example with the two spheres does not work correctly for me. I still get
a spotted interface between them, regardless of "all_intersections".
Maybe that is a bug? I use version 3.6 (freshly downloaded).
Or it depends on the actual form of "f_sphere"? I used "#declare f_sphere =
function(x,y,z,R) {sqrt(x*x+y*y+z*z)-R}"

> One thing you can do is to write the whole thing as a single isosurface.
>
> isosurface {
>   function {
>     min(
>      max(-1/8*(x-5)*(x-5)+y, -y-1, 1-x),
>      max(-3+x+y, -y-1, x-1, z-4)
>     )
>   }
>   contained_by { box {<-2,0,-1>,<4,5,10> } }
>   threshold 0
>   max_gradient 2
>   hollow
>   texture { myTexture }
>   interior { myInterior }
> }

This gave the desired result, thanks a lot! Unfortunately it takes more
time, because the surrounding box must be larger, but it works.

Regards,
Timm.


Post a reply to this message

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