POV-Ray : Newsgroups : povray.advanced-users : CSG Intersection - bounding box question Server Time
28 Jul 2024 18:24:04 EDT (-0400)
  CSG Intersection - bounding box question (Message 1 to 3 of 3)  
From: Peter Duthie
Subject: CSG Intersection - bounding box question
Date: 15 Sep 2004 18:58:08
Message: <4148c900$1@news.povray.org>
Will the bounding box of a CSG intersection be the intersection of the 
bounding boxes of it's components, or will it be the union of them?  Or 
something else entirely?

The reason I ask is that I'm taking relatively small 'slices' of basic 
constructs using an intersection with a thin box, and I want to know if 
the resultant bounding box will be the optimal area where the bounding 
box of the construct intersects with the bounding box of the box used to 
slice it up.  If not, I can manually calculate the bounding box and 
apply it fairly easily, I'd just rather not do that if POV already does 
it for me.

Regards,

-peter


Post a reply to this message

From: Mike Williams
Subject: Re: CSG Intersection - bounding box question
Date: 16 Sep 2004 00:34:38
Message: <r332jDAqXRSBFwZz@econym.demon.co.uk>
Wasn't it Peter Duthie who wrote:
>Will the bounding box of a CSG intersection be the intersection of the 
>bounding boxes of it's components, or will it be the union of them?  Or 
>something else entirely?
>
>The reason I ask is that I'm taking relatively small 'slices' of basic 
>constructs using an intersection with a thin box, and I want to know if 
>the resultant bounding box will be the optimal area where the bounding 
>box of the construct intersects with the bounding box of the box used to 
>slice it up.  If not, I can manually calculate the bounding box and 
>apply it fairly easily, I'd just rather not do that if POV already does 
>it for me.

It's easy enough to check. You can get a sort of 2d representation of
your bounding boxes by adding +MB0 +UD to the command line. (+UD does
all the work, but for a simple test scene +MB0 ensures that bounding
gets enabled).

For a 3d representation of a bounding box you can code it like this

// Create the thing
#declare THING =  intersection {
  box {0,1}
  sphere {1,0.5}
}

// Display the thing
object {THING pigment {rgb 1}}

// Display semitransparent bounding box
box{
  min_extent(THING),max_extent(THING)
  pigment {rgbt <1,0,0,0.5>}
}  

In my tests, POV was using the intersections of the bounding boxes of
the components.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Peter Duthie
Subject: Re: CSG Intersection - bounding box question
Date: 19 Sep 2004 18:23:19
Message: <414e06d7$1@news.povray.org>
Ahh thanks, that worked really well!

-peter

Mike Williams wrote:
> Wasn't it Peter Duthie who wrote:
> 
>>Will the bounding box of a CSG intersection be the intersection of the 
>>bounding boxes of it's components, or will it be the union of them?  Or 
>>something else entirely?
>>
>>The reason I ask is that I'm taking relatively small 'slices' of basic 
>>constructs using an intersection with a thin box, and I want to know if 
>>the resultant bounding box will be the optimal area where the bounding 
>>box of the construct intersects with the bounding box of the box used to 
>>slice it up.  If not, I can manually calculate the bounding box and 
>>apply it fairly easily, I'd just rather not do that if POV already does 
>>it for me.
> 
> 
> It's easy enough to check. You can get a sort of 2d representation of
> your bounding boxes by adding +MB0 +UD to the command line. (+UD does
> all the work, but for a simple test scene +MB0 ensures that bounding
> gets enabled).
> 
> For a 3d representation of a bounding box you can code it like this
> 
> // Create the thing
> #declare THING =  intersection {
>   box {0,1}
>   sphere {1,0.5}
> }
> 
> // Display the thing
> object {THING pigment {rgb 1}}
> 
> // Display semitransparent bounding box
> box{
>   min_extent(THING),max_extent(THING)
>   pigment {rgbt <1,0,0,0.5>}
> }  
> 
> In my tests, POV was using the intersections of the bounding boxes of
> the components.
>


Post a reply to this message

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