POV-Ray : Newsgroups : povray.general : center of union : Re: center of union Server Time
18 Apr 2024 19:58:29 EDT (-0400)
  Re: center of union  
From: Alain
Date: 24 May 2018 17:51:24
Message: <5b0733dc@news.povray.org>
Le 18-05-24 à 17:28, Kenneth a écrit :
> clipka <ano### [at] anonymousorg> wrote:
> 
>>
>> In your search you may come across `min_extent()` and `max_extent()`;
>> note that these can be used on any object as a /rough/ estimate of the
>> region of space occupied by that object, but the values are not
>> guaranteed to be exact: `min_extent()` may return lower values
>> (sometimes significantly so), while `max_extent()` may return higher
>> values (again sometimes significantly so). The only thing guaranteed is
>> that the entirety of the object lies /somewhere/ within those bounds.
>>
> 
> I've always been curious about why this is so. For example, assume a short
> cylinder (short in y) and with no rotations. Taking the min_extent/max_extent of
> that object as-is, the resulting 'bounding box' shape tightly hugs that object
> (meaning, the bounding-box 'axis planes' just touch the object.)
> 
> But if the object is rotated (around all three axes, for argument's sake), the
> resulting bounding-box (its planes) are generally some distance away from any of
> the cylinder's surfaces. I.e., there are gaps of empty space between object and
> bounding box. I'm sure that there IS a technical reason for this; but a simple
> (naive!) question would be: Why does rotating an object 'mess up' the
> bounding-box tightness?
> 
> 

The faces of the bounding box are always parallel to the reference planes.
So,
  cylinder{50*y, -50*y, 1}
have a tight bounding box, while
  cylinder{50, -50, 1}
only touch the bounding box at 6 points (one on each faces near corners) 
and is aligned along one of it's diagonals, leaving the bounding box 
almost empty.
The same thing apply when you rotate your object : The bounding box 
never get rotated in any way and need to expend to completely contain 
the object. The bounding box is created after the object is parsed 
during the bounding phase, between the parsing and the start of the 
render proper.
A test against a rotated bounding box would cost more than against an 
unrotated one.


Alain


Post a reply to this message

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