POV-Ray : Newsgroups : povray.general : Confused about how Merge deals with overlap region Server Time
30 Jul 2024 20:18:45 EDT (-0400)
  Confused about how Merge deals with overlap region (Message 11 to 11 of 11)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Mike
Subject: Re: Confused about how Merge deals with overlap region
Date: 10 Nov 2008 15:00:00
Message: <web.4918923c12932d0bc9b9f9f00@news.povray.org>
It is actually really weird because looking at the two regions straight ahead it
looks good with a small overlap using merge, but from a perspective view it does
not.  Actually, it seems that the only way to make the boundary disappear
(tested by using two regions of the same ior) I must overlap the regions a tiny
bit.  However, when the merge operation is not used I will get an artificial
speckle pattern when the ior is unmatched and there is overlap.  I think in
that case, it is bouncing between ior giving weird results.  With merge I do
not get this effect at the boundary, but I get really weird shadows.

If there is a way to look at the merge algorithm and force it to stick with one
ior if there is a mismatched overlap region; that might work.

Okay, I have posted below, what I have been noticing (if anyone is curious) when
I do the merge on the overlap region.  It is in sort of an animation with two
frames, where it first does a front view, which looks fine, then the
perspective view has weird shadows (mainly at the top and side).  There are
actually two interfaces, the bottom one is invisible because they are two
regions with the same ior.  Sorry the code is a bit complicated (trying to
mimic our real world experiment), I did try to erase a bunch of comments to
make it shorter.  If you get rid of the merge operation and just display the 3
regions, in perspective view it does not have weird shadows, but the interface
itself is weird.

-Mike

#include "colors.inc"
#include "textures.inc"

global_settings{

    max_trace_level 255

}

camera {

    location  <0, 3, 160>
    look_at   <0, 3, 0>
    angle 2.5
    rotate <-45*clock,-45*clock,0>
}

#declare MaterialAlcohol =
material {
  texture {
     pigment {
        color rgbf<1, 1, 1,1>
      }

 finish {
        ambient 0.0
        diffuse 0.0
         reflection {
          0.0, 1.0
          fresnel on
        }
        conserve_energy
        specular  0
                roughness 0
 }
  }
  }

#declare HeavyLiquid =
material {
  texture {
     pigment {
        color rgbf<0.7, 0.6, 0,1>
      }

 finish {
        ambient 0.0
        diffuse 0.0
         reflection {
          0.0, 1.0
          fresnel on
        }
        conserve_energy
        specular 0
        roughness 0
 }
  }
  }


#declare AlcoholRegion=
isosurface {
  function {
    ( y-2 - .1/2*(sin(3*6.2832*x)+sin(3*6.2832*z)) )
    //( y-2 - .1*(sin(3*6.2832*x)*sin(3*6.2832*z)) )
  }
    //function {   y-3 }
  max_gradient 2.3
  accuracy .00001
  contained_by { box { <-1.8999, 0.2, -1.8999>, <1.8999, 2.1, 1.8999> } }
all_intersections
material { MaterialAlcohol }

     interior {
   ior 1.38
}
 photons{
                target
                refraction on
                reflection on
  }
 //translate 3*y
 }


#declare HeavyLiquidRegion=
isosurface {
  function {
    ( y-5 - .1/2*(sin(3*6.2832*x)-sin(3*6.2832*z))   )
   // ( y-5 - .1*(sin(3*6.2832*x)*sin(3*6.2832*z))   )
  }
  max_gradient 2.3
  accuracy .00001
  contained_by { box { <-1.8999, 3, -1.8999>, <1.8999, 5.1, 1.8999> } }
  all_intersections
material { HeavyLiquid }

     interior {
    ior 1.55
}
 photons{
                target
                refraction on
                reflection on
  }
 rotate 180*z
 translate 8*y

}


  #declare F = function { ( y-0 - .1/2*(sin(3*6.2832*x)+sin(3*6.2832*z)) )  }
  //#declare F = function { ( y-0 - .1*(sin(3*6.2832*x)*sin(3*6.2832*z)) )  }

#declare Mixingregion2=
isosurface{
function {abs(F(x,y,z)  ) -.5001}
     max_gradient 2.3
     all_intersections
     accuracy .00001
 contained_by { box { <-1.8999, -.6, -1.8999>, <1.8999, .6, 1.8999> } }
material { MaterialAlcohol }
     interior {
    ior 1.38

}
 photons{
                target
                refraction on
               reflection on
  }
translate 2.5*y
}

merge{
object{Mixingregion2}
object{HeavyLiquidRegion}
object{AlcoholRegion}
}

  box{ <-2,0,-2.1>,<2,5.6,-3>
  texture{pigment{White}finish{ambient 0 diffuse 1}}
  photons{ target refraction on reflection on}
  }

#declare IndexX=-1.8;
#while (IndexX <=2)
    #declare IndexY=0.4;
    #while (IndexY <=5.6)
         light_source {
        <IndexX, IndexY, -2>
         color rgb <0.4, 0, 0>
               photons{ refraction on reflection on}
         }
        #declare IndexY= IndexY +2.2;
     #end
     #declare IndexX=IndexX+1.8;
#end

plane{y,0 texture{pigment{White}finish{ambient 0 diffuse 1}}}


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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