POV-Ray : Newsgroups : povray.newusers : Something holding up the works... : Re: Something holding up the works... Server Time
5 Sep 2024 00:15:38 EDT (-0400)
  Re: Something holding up the works...  
From: Johannes Dahlstrom
Date: 15 Oct 2002 09:56:16
Message: <3dac1e80@news.povray.org>
Tim Nikias wrote:

> I think I had a sentence saying that if there is
> no need for transparency, merge{} might be
> left out...

Yes, of course. With opaque objects there'll no problems.

> It seems we both know the pro's and con's of merge
> vs union... :-)

Yes, so it seems :). But, my point was that with _transparent_ objects, the 
subdivision method you proposed may produce artifacts. Let's take a simple 
example:

difference {
        box { <-3,-1,-1>, <3,1,1> }
        cylinder { 2*y, -2*y, 0.8 }
}

vs.

union {
        box { <-3,-1,-1>, <-1,1,1> }
        box { <1,-1,-1>, <3,1,1> }
        difference {
                box { -1, 1 }
                cylinder { 2*y, -2*y, 0.8 }
        }
}

With an opaque pigment, these two pieces of code produce identical results 
and the second one is probably faster. But, if the object is (partially) 
transparent, there'll be coincident surfaces problem between the boxes. 
Also, with media, there may be a "break" where the boxes share a side.

(BTW, I was wrong suggesting that using merge instead of union could help. 
As POV doesn't bound the components separately (as it does with union), but 
uses one big bounding box instead, subdividing the object doesn't make 
sense in the first place.)


-Johannes


Post a reply to this message

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