POV-Ray : Newsgroups : povray.general : Problems combining two isosurfaces with non-flat surface Server Time
4 Nov 2024 23:18:05 EST (-0500)
  Problems combining two isosurfaces with non-flat surface (Message 1 to 10 of 15)  
Goto Latest 10 Messages Next 5 Messages >>>
From: Mike
Subject: Problems combining two isosurfaces with non-flat surface
Date: 6 Mar 2009 17:35:00
Message: <web.49b1a40e24e2961fc9b9f9f00@news.povray.org>
I have created two isosurface regions with a sine wave pattern.  They are
supposed to be two clear liquids in a tank.  They will have different
refractive indicies.  To test it, I have been trying to put the same refractive
index and the sine wave pattern should disappear.  It does not disappear
however.  And the visible "weird" pattern is a lot larger than the .0001 space
I have left between the regions (I have also tried doing a merge operator, but
I still cannot make the pattern vanish as it should with two regions with
identical properties).  I am aware that since I am rotating the pattern to
create the top region that I must account for this.  I have tried to, but
perhaps I have done it wrong; I have tried many possibilities actually.  The
code is below and I have posted an image in the image section.

Thanks,
Mike

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

global_settings{
 max_trace_level 25
}
sphere
{
  0, 1000 hollow pigment {color White}
}

camera {
     location  <0, 3, 20>
    look_at   <0, 3, 0>
    angle 20
   }



#declare Tank=
difference
{ box { <-2,.1,-2>,<2,5.1,2> }
  box { <-1.9,.2,-1.9>,<1.9,5.01,1.9> }
texture{
                 pigment{color rgbf<1, 1, 1,0.95>}
                    finish{
                        reflection {
         0.0, 1.0
        fresnel on

      }

                        conserve_energy
                 }
}

interior{ior 1.4 }//fade_power 2 fade_distance 2}
}

#declare MaterialAlcohol =
material {
  texture {
     pigment {
        color rgbf<1, 1, 1,1>
      }
 finish {
        ambient 0.0
        diffuse 0
         reflection {
          0.0, 1.0
          fresnel on
        }
        conserve_energy
        specular  0
        roughness 0
 }
  }
  }

#declare AlcoholRegion=

isosurface {
  function {
       //(y-2.9999)
       ( y-2.9999 + .1/2*(sin(3*6.2832*(x))-sin(3*6.2832*z)) )
      }
 evaluate 6, 1.4, 0.7

  accuracy .00001
  contained_by { box { <-1.899, .21, -1.899>, <1.899, 3.5, 1.899> } }
all_intersections

material { MaterialAlcohol }
  interior {
   ior 1.38
}
 }

#declare HeavyLiquidRegion=
isosurface {
  function {
   //(y-5)
    ( y-5 + .1/2*(sin(3*6.2832*x)+sin(3*6.2832*z))   )
  }
 evaluate 6, 1.4, 0.7
  accuracy .00001
  contained_by { box { <-1.899, 3, -1.899>, <1.899, 7.5, 1.899> } }
  all_intersections

material { MaterialAlcohol}
 interior {
    ior 1.38
}
 rotate 180*z
 translate 8*y
}

//merge{
object{HeavyLiquidRegion}
object{AlcoholRegion}
//}

  light_source {
    <4, 8, 10>
    color White
    spotlight
    radius 30
    falloff 14
    tightness 10
    point_at <0, 5, 0>
 }

object{Tank}
plane{x,-400 texture{pigment{White}finish{ambient 0 diffuse 1}}}
plane{x,400 texture{pigment{White}finish{ambient 0 diffuse 1}}}
plane{z,-100 texture{pigment{White}finish{ambient 0 diffuse 1}}}
plane{z,400 texture{pigment{White}finish{ambient 1 diffuse 1}}}

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

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


Post a reply to this message

From: clipka
Subject: Re: Problems combining two isosurfaces with non-flat surface
Date: 6 Mar 2009 20:30:00
Message: <web.49b1cd7b8416b8f98c2c8ee00@news.povray.org>
You have a gap between the two liquids, so even if they have the same refractive
index, the air between them has not. That's where you get total reflections.


Post a reply to this message

From: Mike
Subject: Re: Problems combining two isosurfaces with non-flat surface
Date: 6 Mar 2009 22:05:00
Message: <web.49b1e38a8416b8f9cb45af7a0@news.povray.org>
"clipka" <nomail@nomail> wrote:
> You have a gap between the two liquids, so even if they have the same refractive
> index, the air between them has not. That's where you get total reflections.

Yeah, this is what I did think, but even when I use the merge operator with a
tiny overlap instead of gap it does the same thing (and this I would not expect
with identical regions).  Maybe I am specifying the isosurface wrong? I have
posted images where I did that as well (different kind of lighting though):
http://news.povray.org/povray.binaries.images/thread/%3Cweb.49b1aa9624e2961fc9b9f9f00%40news.povray.org%3E/

Also, it seems that making an even thinner gap has no effect, which to me is
weird.  I would expect a very thin line maybe, but not one of the thickness
that is showing.  This is sort of a problem because it means I cannot
necessarily trust what I see if i have different liquids/object instead of the
same one.  Any ideas of what I can do? Maybe I am going about this all wrong?
If there was a way to make the background have a IOR of that of the liquid as
opposed to 1, that might work, but it would cause other problems.  Not to
mention I do not know if it is possible. I have a feeling the merge operator is
the way to go, but it still does weird effects (I still see an interface)?

-Mike


Post a reply to this message

From: Mike Hough
Subject: Re: Problems combining two isosurfaces with non-flat surface
Date: 7 Mar 2009 01:13:16
Message: <49b2107c@news.povray.org>
> If there was a way to make the background have a IOR of that of the liquid 
> as
> opposed to 1, that might work, but it would cause other problems.  Not to
> mention I do not know if it is possible.

Don't know about the other issues but I am pretty sure that if you surround 
the scene (camera in particular) with an object you can use that to set your 
"background" ior. Something like:

plane {y, 100000
pigment {rgbt <1, 1, 1, 1>}
interior {ior 1.3}
}


Post a reply to this message

From: clipka
Subject: Re: Problems combining two isosurfaces with non-flat surface
Date: 7 Mar 2009 05:25:00
Message: <web.49b24b108416b8f940b1852c0@news.povray.org>
You're right, overlapping both objects and doing a merge should do the job (in
tis case; it will definitely not do what you need for different liquids). Did
you test with plain boxes instead of isosurfs?

Maybe you also have a max_trace_level issue here?


Post a reply to this message

From: Christian Froeschlin
Subject: Re: Problems combining two isosurfaces with non-flat surface
Date: 7 Mar 2009 05:50:48
Message: <49b25188$1@news.povray.org>
clipka wrote:
> You're right, overlapping both objects and doing a merge should do the job 

I'm not sure about this. Although ior belongs to interior physically,
I think POV-Ray uses it only when a ray crosses a surface. But that
surface is no longer there after the merge, is it?

You may also be interested in this two year old thread:

http://news.povray.org/povray.binaries.images/thread/%3C45cf36f7%40news.povray.org%3E/?ttop=287005&toff=950&mtop=238932


Post a reply to this message

From: clipka
Subject: Re: Problems combining two isosurfaces with non-flat surface
Date: 7 Mar 2009 07:20:00
Message: <web.49b266648416b8f940b1852c0@news.povray.org>
Christian Froeschlin <chr### [at] chrfrde> wrote:
> clipka wrote:
> > You're right, overlapping both objects and doing a merge should do the job
>
> I'm not sure about this. Although ior belongs to interior physically,
> I think POV-Ray uses it only when a ray crosses a surface. But that
> surface is no longer there after the merge, is it?

If you read my whole post and not just the first sentence, you'll notice that I
am perfectly aware of this.

Full quote (emphasis added this time):

"You're right, overlapping both objects and doing a merge should do the job (IN
THIS CASE; it will DEFINITELY NOT do what you need for different liquids).
[...]"


Post a reply to this message

From: Mike
Subject: Re: Problems combining two isosurfaces with non-flat surface
Date: 7 Mar 2009 12:20:01
Message: <web.49b2ac718416b8f9cb45af7a0@news.povray.org>
"clipka" <nomail@nomail> wrote:
> You're right, overlapping both objects and doing a merge should do the job (in
> tis case; it will definitely not do what you need for different liquids). Did
> you test with plain boxes instead of isosurfs?
>
> Maybe you also have a max_trace_level issue here?

Ok.  I just tried to plain boxes overlapping using the merge command at it does
the same thing.  Actually, you have to mess with the lighting a bit in order to
actually see the trouble (looks good at first). I added a backlight, as I have
done for two of the images in the images section.
What I did:
I commented out all the isosurf stuff and added
box{ <-1.899,.21,-1.899>,<1.899,3.01,1.899>
to the top of the AlcoholRegion
and: box{<-1.899, 3,-1.899>,<1.899,5,1.899>
to the HeavyLiquidRegion
I did not comment out the rotate, translate.
The backlight stuff I had to add (many little LEDs)in order to visualize the
problem is:
#declare IndexX=-1.8;
#while (IndexX <=2)
    #declare IndexY=0.4;
    #while (IndexY <=5.6)
         light_source {
        <IndexX, IndexY, -2>
          color rgb <1, 0, 0>
           spotlight
           radius 150
           falloff 160
          point_at <IndexX,IndexY,0>
         }
#declare IndexY= IndexY +2;
#end
#declare IndexX=IndexX+2;
#end

Oh, and of course I uncommented the merge stuff so that I merge the two regions.
I have posted this new image in post I have going in the images section.

-Mike
P.S.  i Don't think it is max trace level because with the merge, the line is
not black, it is just visible.  And of course I did try messing with it with no
luck.


Post a reply to this message

From: Christian Froeschlin
Subject: Re: Problems combining two isosurfaces with non-flat surface
Date: 7 Mar 2009 14:33:57
Message: <49b2cc25@news.povray.org>
Mike wrote:

> I commented out all the isosurf stuff and added
> box{ <-1.899,.21,-1.899>,<1.899,3.01,1.899>
> to the top of the AlcoholRegion
> and: box{<-1.899, 3,-1.899>,<1.899,5,1.899>
> to the HeavyLiquidRegion

Hmm, I wonder if this is related to the small strip of
coincident surfaces at the sides of your overlap. I just
made a small test using two copies of a transparent
object as in

#declare OBJ = sphere {y,1 pigment {color rgbt 1} interior {ior 1.5}}

object {OBJ}
object {OBJ}

and the refraction of the background was wildly different when
the second object was present (but not when the second object
was scaled up a tiny fraction). Also funny thing: I did not
observe this effect when the sphere was centered at 0.


Post a reply to this message

From: Mike
Subject: Re: Problems combining two isosurfaces with non-flat surface
Date: 7 Mar 2009 19:25:01
Message: <web.49b30f8b8416b8f9cb45af7a0@news.povray.org>
Christian Froeschlin <chr### [at] chrfrde> wrote:
> Hmm, I wonder if this is related to the small strip of
> coincident surfaces at the sides of your overlap. I just
> made a small test using two copies of a transparent
> object as in
>
> #declare OBJ = sphere {y,1 pigment {color rgbt 1} interior {ior 1.5}}
> object {OBJ}
> object {OBJ}
> and the refraction of the background was wildly different when
> the second object was present (but not when the second object
> was scaled up a tiny fraction). Also funny thing: I did not
> observe this effect when the sphere was centered at 0.

Not sure if you did this with the merge command or without.  I tried it, without
the merge command I see nothing weird.  With the merge command I see really
weird effect.  I did not see the weird effects go away when I centered the
spheres around zero though.  You were right, scaling up one sphere a bit did
make it look correct, amazingly.  Translating it a bit did not fix the problem,
only scaling I guess.
Also, I was trying it with my test case of the two boxes overlapping a tiny bit;
I tried scaling one box, but in that case it did not fix the problem.  I still
see the weird line at the interface.  I guess it is a bit of a different
scenario in that only a small region is overlapping as opposed to the whole
object as with the spheres?


Post a reply to this message

Goto Latest 10 Messages Next 5 Messages >>>

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