POV-Ray : Newsgroups : povray.general : How can we check if an object is within another object? : Re: How can we check if an object is within another object? Server Time
26 Apr 2024 08:52:40 EDT (-0400)
  Re: How can we check if an object is within another object?  
From: Bald Eagle
Date: 12 Jun 2020 13:35:00
Message: <web.5ee3bbfe350b148fb0b41570@news.povray.org>
"Kima" <nomail@nomail> wrote:

> I want to draw the biggest sphere with the centre of <0,0,0> which can fit
> within the inner part of the prism

> Is there a direct way to do so?

This would be the inscribed circle, or the inscribed sphere.
You might be able to do it with a matrix, but I'm guessing.

You could do it numerically / computationally / algorithmically by taking sets
of adjacent vertices, calculating the coordinates of the midpoint, and measuring
the distance from the origin.   The minimum distance would give you what you
want.


> I need the CONDITION.

Do you just want to do an insidedness test?
#if (inside (prism, point)) ....

If you want to have each sphere be fully inside the prism, construct a smaller
test prism where the edges are closer to the origin by the radius of the
spheres.   Test against that, and then render the spheres in the actual prism.


Post a reply to this message

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