POV-Ray : Newsgroups : povray.advanced-users : Quiz : Solution Server Time
29 Jul 2024 10:27:19 EDT (-0400)
  Solution  
From: Micha Riser
Date: 30 May 2002 11:17:59
Message: <3cf642a7@news.povray.org>
Thorsten Froehlich wrote:
> 
> Well, "inverse" keyword sets the internal INVERTED_FLAG and just like all
> bit flags it is promoted and then handled by the object intersection code
> itself.
> Consequently an object is either inverted or it is nor.  Thus the inverse
> flag is always "optimised" also the correct term would probably be
> "promoted".

As I see this from the source code this is handled differently from object 
to object. Most of them just set the INVERTED_FLAG but not all. It is not 
possible to do this for CSG objects. Instead POV has to use De Morgans's 
law. This means that all members of the CSG get inverted and the CSG type 
is changed as follows:

 union -> intersection
 merge -> intersection
 intersection -> merge

This has the consequence that a double-inverted union results in a merge!

So for 
 #declare O = union{
  sphere{<0,0,1>,2}
  sphere{<0,0,-1>,2}
  pigment{rgbf 0.9} finish{ambient 1}
 }

 object{O} 
and
 object{object{O inverse} inverse}

is not the same as in the second version the internal walls are removed. 

- Micha


Post a reply to this message

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