POV-Ray : Newsgroups : povray.general : Merging of Two Boxes Behaviour Server Time
2 Nov 2024 13:20:29 EDT (-0400)
  Merging of Two Boxes Behaviour (Message 1 to 4 of 4)  
From: HerrVlkr
Subject: Merging of Two Boxes Behaviour
Date: 24 Jul 2009 16:10:00
Message: <web.4a6a14eac8c647532a18a90c0@news.povray.org>
I am new to POV-Ray.  In the example below, I am trying to merge two boxes
together.  But when I render the image, the boxes disappear at the sections
where they intersect.  Is this correct?

How do I get my two boxes to merge into one uniform 'T' shape.  This does not
happen with a 'union'.  But I can't use 'union' because I want to render the
'T' as a 'glass like' object.  Any suggestions?

#include "colors.inc"
#include "textures.inc"

global_settings
{
        max_trace_level 10
        ambient_light White
}

background { color Gray }

camera
{
        location <0, 153, -320>
        look_at <0, 153, 0>
}

merge
{
        box{<0,233,0>, <233-16,197,36>}
        box{<197,/*233-16*/300,0>, <233,107,36>}

        // Tinted blue crystal
        pigment { rgbf<0.8,0.8,1,0.9> }
        material { M_Glass3 }
        interior { Glass_Interior }
        finish { Glass_Finish }

        translate <-143,10,-18>

        rotate <0,clock,0>
}


Post a reply to this message

From: clipka
Subject: Re: Merging of Two Boxes Behaviour
Date: 24 Jul 2009 16:20:00
Message: <web.4a6a1706dc7e8ec46e32850e0@news.povray.org>
"HerrVlkr" <nomail@nomail> wrote:
> I am new to POV-Ray.  In the example below, I am trying to merge two boxes
> together.  But when I render the image, the boxes disappear at the sections
> where they intersect.  Is this correct?

POV-Ray is a bit weak when dealing with coincident surfaces.

Try translating one of the boxes by a very tiny amount, e.g.

    merge
    {
        box{<0,233,0>, <233-16,197,36>}
        box{<197,/*233-16*/300,0>, <233,107,36> translate <0,0,0.001>}
        ...
    }


Post a reply to this message

From: Alain
Subject: Re: Merging of Two Boxes Behaviour
Date: 25 Jul 2009 15:58:54
Message: <4a6b63fe$1@news.povray.org>

> I am new to POV-Ray.  In the example below, I am trying to merge two boxes
> together.  But when I render the image, the boxes disappear at the sections
> where they intersect.  Is this correct?
> 
> How do I get my two boxes to merge into one uniform 'T' shape.  This does not
> happen with a 'union'.  But I can't use 'union' because I want to render the
> 'T' as a 'glass like' object.  Any suggestions?
> 
> #include "colors.inc"
> #include "textures.inc"
> 
> global_settings
> {
>         max_trace_level 10
>         ambient_light White
> }
> 
> background { color Gray }
> 
> camera
> {
>         location <0, 153, -320>
>         look_at <0, 153, 0>
> }
> 
> merge
> {
>         box{<0,233,0>, <233-16,197,36>}
>         box{<197,/*233-16*/300,0>, <233,107,36>}
> 
>         // Tinted blue crystal
>         pigment { rgbf<0.8,0.8,1,0.9> }
>         material { M_Glass3 }
>         interior { Glass_Interior }
>         finish { Glass_Finish }
> 
>         translate <-143,10,-18>
> 
>         rotate <0,clock,0>
> }
> 
> 
You have surfaces that are at exactly the same location. When you 
encounter such a case, you can't tell whitch surface to use. In your 
case, you end up missing both most of the time, with some pixels that 
catch one or the other.
The solution from clipka is one that you can reliably use (you can use a 
much smaller value, like 0.00000001). Another way would be to scale one 
of the component by something like 0.999999 or 1.000001 along the z axis.


Alain


Post a reply to this message

From: Joerg
Subject: Re: Merging of Two Boxes Behaviour
Date: 26 Jul 2009 03:19:36
Message: <4a6c0388$1@news.povray.org>
this should also work:


difference{
        box{<0,107,0>,<233,300,36> }
        box{<-100,233,-100>,<197,500,100>}
        box{<-100,  0,-100>,<197,197,100>}

        // Tinted blue crystal
        pigment { rgbf<0.8,0.8,1,0.9> }
        material { M_Glass3 }
        interior { Glass_Interior }
        finish { Glass_Finish }

        translate <-143,10,-18>

        rotate <0,clock,0>
}



HerrVlkr wrote:
> I am new to POV-Ray.  In the example below, I am trying to merge two boxes
> together.  But when I render the image, the boxes disappear at the sections
> where they intersect.  Is this correct?
> 
> How do I get my two boxes to merge into one uniform 'T' shape.  This does not
> happen with a 'union'.  But I can't use 'union' because I want to render the
> 'T' as a 'glass like' object.  Any suggestions?
> 
> #include "colors.inc"
> #include "textures.inc"
> 
> global_settings
> {
>         max_trace_level 10
>         ambient_light White
> }
> 
> background { color Gray }
> 
> camera
> {
>         location <0, 153, -320>
>         look_at <0, 153, 0>
> }
> 
> merge
> {
>         box{<0,233,0>, <233-16,197,36>}
>         box{<197,/*233-16*/300,0>, <233,107,36>}
> 
>         // Tinted blue crystal
>         pigment { rgbf<0.8,0.8,1,0.9> }
>         material { M_Glass3 }
>         interior { Glass_Interior }
>         finish { Glass_Finish }
> 
>         translate <-143,10,-18>
> 
>         rotate <0,clock,0>
> }
> 
>


Post a reply to this message

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