POV-Ray : Newsgroups : povray.programming : CSG Bounding box algorithm : Re: CSG Bounding box algorithm Server Time 4 Aug 2024 08:26:31 EDT (-0400)
 Re: CSG Bounding box algorithm
 From: Bald Eagle Date: 24 Aug 2017 07:55:00 Message:
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#web.599ebe8e818ca792c437ac910%40news.povray.org",
"headline": "Re: CSG Bounding box algorithm",
"dateCreated": "2017-08-24T11:55:00+00:00",
"datePublished": "2017-08-24T11:55:00+00:00",
"author": {
"@type": "Person",
"name": "Bald Eagle"
}
}
clipka <ano### [at] anonymousorg> wrote:

> There is no generic algorithm to compute the exact b'box of an
> intersection. Each specific combination of primitives would need its own
> algorithm.

Sorry - I was having a hard time understanding exactly what the situation was,
and not having access to that page and the SDL for those specific instances left
me to my own devices.   And by that time, I was pretty damned tired, so ....

> ??? Why would you need special handling for the quadrants?

Because I was just adapting some internet question-answerer's ridiculous code,
and they had a zero in their min/max formulae - presumably because they were
concerned with the _volume_ of the intersection .... and I was just too frazzled
to work it out from scratch like I should have.

> To compute the intersection of multiple axis-aligned b'boxes, all you
> need to do is get the highest low bounds for all axes and the lowest
> high bound for all axes.

Yes, I suspected that, but the Little Voice was too tiny, and my fatigued brain
inertia was too strong.

> Yes: All cases and none at all. Almost /any/ combination of primitives
> can be used to come up with pathological cases.

I see that a lot better now, and understand what those docs were getting at -
and why those cases present such difficulty.  Sometimes, for whatever reason,
the wording of some sections makes it a little hard to follow.
```