POV-Ray : Newsgroups : povray.bugreports : Merge doesn't merge correctly Server Time
22 Nov 2024 03:33:27 EST (-0500)
  Merge doesn't merge correctly (Message 1 to 2 of 2)  
From: Mirfaelltkeinerein
Subject: Merge doesn't merge correctly
Date: 6 May 2014 05:05:01
Message: <web.5368a51b8e5a517fa733cb390@news.povray.org>
Hello all,

I experienced a problem with merging several objects together.
If transparent boxes with the same hight are merged together, the intersecting
parts are visible and broken.

This behavior occurs on version 3.7.0.msvc10.win64, on
version 3.7.0.RC7.msvc10.win64, and also on version 3.6.2.msvc9.win64.
Shouldn't 'merge' avoid such a problem?  As far as I remember, this behavior is
present for a long time now.

To reproduce the problem, I set up the following scene:

//*********************************************************************
#include "glass.inc"
#include "colors.inc"

camera {
  location <6,25,14>
  direction <0, 0, 1.5>
  sky <0,0,1>
  angle 42
  look_at <0,5,0.4>
}

light_source { <-5, 12, 12> color rgb<1, 1, 1>}
light_source { <15, 6, 17> color rgb<1, 1, 1>}

box{<-8.5,-8.5,-1.0>,<8.5,8.5,0.10> pigment{color White}} //white base


merge{
    box{<-6.0,-6.5,0.09>, <6.0,3.0,0.20> translate<0,0,0>} //large red box

    box{<-1.0,1.99,0.09>, <-1.1,5.001,0.20> translate<0,0,0>} //small red box
    box{<-0.1,1.99,0.09>, <-0.2,7.001,0.20> translate<0,0,0>} //small red box
    box{< 0.3,1.99,0.09>, < 0.2,6.001,0.20> translate<0,0,0>} //small red box
    box{< 0.7,1.99,0.09>, < 0.6,5.001,0.20> translate<0,0,0>} //small red box
    box{< 1.1,1.99,0.09>, < 1.0,4.001,0.20> translate<0,0,0>} //small red box

    material {
        texture {
            pigment { rgbf <0.99, 0.3, 0.3, 0.8> }
            finish {
                ambient 0.1
                diffuse 0.1
                reflection .25
                specular 1
                roughness .001
            }
        }
        interior{ I_Glass4
                  fade_distance 0.1
                  fade_power 1001
                  fade_color <0.9,0.25,0.25>
                  caustics 0.25
        }
    }
}
//*********************************************************************

Is there a solution to avoid this error except using different heights or
cutting away the top with a 'difference'?


Post a reply to this message

From: Le Forgeron
Subject: Re: Merge doesn't merge correctly
Date: 6 May 2014 05:33:03
Message: <5368ac4f$1@news.povray.org>
Le 06/05/2014 11:02, Mirfaelltkeinerein a écrit :
> Hello all,
> 
> I experienced a problem with merging several objects together.
> If transparent boxes with the same hight are merged together, the intersecting
> parts are visible and broken.
> 
> This behavior occurs on version 3.7.0.msvc10.win64, on
> version 3.7.0.RC7.msvc10.win64, and also on version 3.6.2.msvc9.win64.
> Shouldn't 'merge' avoid such a problem?  As far as I remember, this behavior is
> present for a long time now.

it seems that the decimation of merge (it first computes all
intersections over the cSG, then removes any that is inside another
component) is perturbed by the coincidence of surface (not the
coincidence surface bug), as intersection on small box are found inside
big box, and vice-versa, hence nothing remains.

a revision of the approach might be needed (not only for the first
intersection, but also for exiting points). It might not be as obvious
as it seems. (especially if components have their own texture)

> Is there a solution to avoid this error except using different heights or
> cutting away the top with a 'difference'?


-- 
Just because nobody complains does not mean all parachutes are perfect.


Post a reply to this message

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