POV-Ray : Newsgroups : povray.general : Problem with differences/unions, maybe too many; or a missing "{" or "}"? : Re: Problem with differences/unions, maybe too many; or a missing "{" or "}"? Server Time
31 Jul 2024 14:28:00 EDT (-0400)
  Re: Problem with differences/unions, maybe too many; or a missing "{" or "}"?  
From: Chris B
Date: 24 Dec 2006 06:04:46
Message: <458e5ece$1@news.povray.org>
"D. Hansen" <PoV### [at] Stefaniede> wrote in message 
news:web.458e4323bcd79e8bea53f7190@news.povray.org...
> Hi!
>
> The scene is a pot with liquid on a table (box), a plane y*-4, a 
> skysphere,
> light, camera, max intersection set to 255, max trace level 50.
> Examples of problem:
> - Depending on changing the feet of the pot, part of the liquid in the pot
> vanishes. (Outcomment the union starting at "DOESN'T WORK", and delete the
> union before.)
> - When I delete the plane the liquid vanishes too :) (Delete the plane in
> the original version, at the end of the scene.)
> - Sometimes, when deleting one difference, everything looks fine again 
> (Try
> wildly :)
>

Hi D.

I think your problem is one of coincident surfaces. In this case the top 
surface of the liquid and the bottom surface of your 'fog over the liquid' 
are in exactly the same place. The transparency in the 'fog over the liquid' 
makes the surface visible, but the surface has an indeterminate texture so 
POV-Ray chooses whether to give it the surface texture of one or other of 
the two surface specifications - This issue is actually explained a lot 
better in the FAQ. Other, seemingly unrelated objects in the scene, seem to 
influence the decision that POV-Ray makes for each point where it finds a 
coincident surface in the scene. I think this is why the changes to the pot 
feet, the plane and the table influenced the render.

To get rid of this problem just move one or other surface. Below I've 
adjusted the 'y' value for the bottom surface of the 'fog over the liquid' 
to 0.149 instead of 0.15 and this seems to cure the problem.

    difference {            // some fog over the liquid
      sphere {  0.0, 0.98 }
      box {-<1.2,0.05,1.2>, <1.2,1.2,1.2>}
      box {-<1.2,0.149,1.2>, <1.2,-1.2,1.2>}     // Avoid coincident 
surfaces
      pigment{ color rgbt 0.9 }
      interior_texture { pigment { color rgbt <0,0.1,0,0.9> } }     // try 
granite
    }

You may wish to check your scene for other coincident surfaces.

For the future I'd recommend reducing your code snippets down before 
posting.
Your complex texures made your code look more complicated than it is and 
didn't contribute to the problem.
Seeing a long piece of code in a posting puts a lot of people off looking at 
the problem.
I reduced your code down to the following before spotting what the problem 
might be.

#version 3.6;

#include "colors.inc"

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

camera {
  location  <0.0, 0.7, -4.0>*1.2*2 *0.35   // Side View
//  location  <1,3,0>
  look_at   <0.0, 0.0,  0.0>
}

light_source {<1, 30, -1> color rgb 1}

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

difference {            // pot-feet
//  union {
//    cylinder { <0,-2,0>, <0,0,0>, 0.04 rotate z*35 rotate y*0}
//    cylinder { <0,-2,0>, <0,0,0>, 0.04 rotate z*35 rotate y*120}
//    cylinder { <0,-2,0>, <0,0,0>, 0.04 rotate z*35 rotate y*-120}
//  }


  union{
    cylinder { <0,-2,0>, <0,0,0>, 0.04 rotate z*35 rotate y*180}
    cylinder { <0,-2,0>, <0,0,0>, 0.04 rotate z*35 rotate y*60}
    cylinder { <0,-2,0>, <0,0,0>, 0.04 rotate z*35 rotate -y*60}
  }

  sphere {  0.0, 1 }
  box {-<3,3,3>, <3,-1,3>}
}

difference {            // liquid
  sphere {  0.0, 0.98 }
  box {-<1.2,0.15,1.2>, <1.2,1.2,1.2>}
  pigment {color rgb <1,0,0>}
}

difference {            // some fog over the liquid
  sphere {  0.0, 0.98 }
  box {-<1.2,0.05,1.2>, <1.2,1.2,1.2>}
  box {-<1.2,0.149,1.2>, <1.2,-1.2,1.2>}
  pigment{ color rgbt 0.9 }
}

box { <-5, -1.05, -1.2> , <5, -1, 2>   // table
  pigment { color rgb <1,1,0>}
}

plane {-y, 4
  pigment {color rgb <1,0,1>}
}



regards,
Chris B.


Post a reply to this message

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