POV-Ray : Newsgroups : povray.newusers : Problem merging two isosurfaces : Re: Problem merging two isosurfaces Server Time
28 Jul 2024 14:35:17 EDT (-0400)
  Re: Problem merging two isosurfaces  
From: Mike
Date: 16 Oct 2008 15:15:00
Message: <web.48f791c6c4ddaaeec9b9f9f00@news.povray.org>
"Trevor G Quayle" <Tin### [at] hotmailcom> wrote:
> "Mike" <win### [at] hotmailcom> wrote:
> > I have been trying to create basically a cube in which the top and bottom face
> > is a 2D sine wave (egg crate pattern).  I have been able to do this using
> > isosurface, with some trouble however.  The way I found to do this was to make
> > one isosurface sine wave pattern contained by a box and then make another one
> > also contained by a box and flip it over.  My problem is that when I try to
> > merge the two objects I create, I have tried merge and union I always see a
> > middle boundary in between them.  The indicies of refraction are matched and I
> > am using fresnel reflection, so I do not see how or why I am seeing this.  If
> > anyone has any ideas on how to make this artifact go away that would be very
> > helpful.  I have posted the code I used to make the object below.
>
> For what you are doing a heightfield would be far better suited and much easier
> to work with.  See below.  You'll need to work with the values to get what you
> want for scalings and translations.  The RES parameter adjusts the resolution
> used for the heightfield.
>
> Some things to note:
> -HFs are created on the X/Z plane from <0,0> to <1,1>
> -HFs read the function on the X/Y plane at Z=0  (ie, HF read from XY plane but
> create on XZ plane - perpedicular)
> -HF height is in the Y axis and ranges from 0 to 1, but actually acts like a
> plane, ie, it is infinite below the surface (doesn't stop at 0)
>
>
> This object should render far faster than an isosurface without errors or holes.
> Higher values for RES will give more accurate results but will increase parse
> time, however they shouldn't significantly affect render time.
>
> Hope some of this helps.
>
> -tgq
>
>
>
> //START
> #declare f_1= function (x,y){( 0.9-0.1*sin(3*6.2832*x)*sin(3*6.2832*y))}
>
> #declare RES=100; //hf resolution
> #local HF1=
>   height_field{
>     function RES,RES {pattern{ function {
>       f_1 (x*1.9,y*1.9)
>     }
>    }
>   }
>   smooth
>   translate <-1/2,-1/2,-1/2>
>   scale <2.01,2,2.01> //scale the HF slightly larger in X/Z directions to be
> removed
> }
>
> intersection{
>   object{HF1 pigment {rgb 1}}  //Top HF
>   object{HF1 rotate 180*z pigment {rgb 1}}  //Bottom HF
>   box{-1,1 pigment {rgb 1}}  //Cube to trim sides
>   scale <1.9,1,1.9>
> }
>
> //END



Thanks for the advice, this works much better.  However, when I switch the
material to the same as that I have been using (translucent, ior =1.5) I still
get black dots however not as much.  Actually, I have noticed that I can nearly
get rid of them by turning off adc_bailout (setting it equal to zero) and
increasing the max_trace_level.  I am having trouble going anywhere above
around 50 for the max_trace_level with the adc_bailout off (it takes forever to
render).  I would really like it if someone could explain the adc_bailout to me
a bit better than what is given in the documentation.  Is there a lower limit?
I think what I would actually want to do is make adc_bailout really small as to
retain the affect of max_trace_level, but I am not seeing this.  It seems with
adc_bailout on, no matter what the value (when made smaller than the default
because larger only makes things worse) a change in max_trace_level does
nothing.
Here is the updated piece of code you gave me that I have been running:

  #declare MixedRegion =
material {
   texture {
     pigment {
        color rgbf<0.3, 0.5, .5,1>
      }

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

#declare f_1= function (x,y){( 0.9-0.1*sin(3*6.2832*x)*sin(3*6.2832*y))}

#declare RES=6000; //hf resolution
#local HF1=
  height_field{
    function RES,RES {pattern{ function {
      f_1 (x*1.9,y*1.9)
    }
   }
  }
  smooth
  translate <-1/2,-1/2,-1/2>
  scale <2.01,2,2.01> //scale the HF slightly larger in X/Z directions to be
removed
}

#declare Mixingregion3=
intersection{
  object{HF1 material { MixedRegion } interior {ior 1.5} }  //Top HF
  object{HF1 rotate 180*z material { MixedRegion } interior {ior 1.5}}  //Bottom
HF
  box{-1,1 material { MixedRegion } interior {ior 1.5}}  //Cube to trim sides
  scale <1.9,1,1.9>
  translate 4*y
  //material { MixedRegion }
  //interior {ior 1.5}
}

object{Mixingregion3}

-Mike


Post a reply to this message

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