POV-Ray : Newsgroups : povray.binaries.images : Hollow sphere, filled with shperes : Re: Hollow sphere, filled with shperes Server Time
30 Jul 2024 08:22:14 EDT (-0400)
  Re: Hollow sphere, filled with shperes  
From: clipka
Date: 28 Jan 2013 02:14:29
Message: <51062555$1@news.povray.org>
Am 28.01.2013 02:21, schrieb Trevor G Quayle:
> clipka <ano### [at] anonymousorg> wrote:
>> Am 27.01.2013 21:00, schrieb Trevor G Quayle:
>>
>>> Stop thinking of everything!
>>
>> Sorry, but I just can't help it ;-)
>>
>>> OK one more think at this:
>>>
>>> 1) check outer boundary sphere intersection (radius = center to vertex).  If no
>>> intersection (distance > r1 + r2), cubes don't intersect,
>>>
>>> else
>>>
>>> 2) check inner boundary sphere intersection (radius = center to face).  If
>>> intersection (distance < r1 + r2), cubes intersect or nest.
>>>
>>> else
>>>
>>> 3) determine closest vertex for each cube to the center of other (don't need to
>>> check each vertex). if either vertex is inside other cube, intersected or nested
>>>
>>> else
>>>
>>> 4) for one cube, check each edge from closest vertex for intersection with each
>>> face from each vertex of other cube, if intersect, cubes intersect. (don't need
>>> to check every single one, only 3 edges from 1 and 3 faces from other)
>>>
>>> else
>>>
>>> 5) cubes don't intersect!
>>>
>>> Does that cover it all?  Or is there some other scenario that falls outside
>>> these rules?
>>
>> You're forgetting that the vertex of cube A closest to the /center/ of
>> cube B isn't necessarily the one closest to the /surface/ of the other.
>
> Perhaps, but it will be on the other end of one of the edges that get tested (if
> not the same vertex, the vertex closet the center should be on the other end of
> an edge shared with the vertex closet to the surface) and should still be valid
> for detecting the intersection.  I can't envision any scenarios that don't get
> captured with this process.

I'm sorry to say it, but you're /still/ missing a scenario:

Small cube, close to the corner of a large one, with all surfaces almost 
- but not quite - parallel to the large one, tilted slightly so that the 
corner closest to the large cube (corner A) is moved slightly away from 
the large cube's surface. In that case, it may be the corner 
/diagonally/ (across the face, not the volume) from corner A that's 
closest to the large cube's surface.


Post a reply to this message

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