POV-Ray : Newsgroups : povray.general : How to check if two objects have any intersection? : Re: How to check if two objects have any intersection? Server Time
26 Apr 2024 15:24:23 EDT (-0400)
  Re: How to check if two objects have any intersection?  
From: jr
Date: 30 Jan 2020 16:55:00
Message: <web.5e33502f78dd1088451952ca0@news.povray.org>
hi,

"Kima" <nomail@nomail> wrote:
> I need an if statement to check if two objects have any intersection. I assumed
> trace(a, b) should give false when there is no intersection, something like
>
>  #if ( trace(a,b) )
>    ....
>  #else
>    ....
>  #end
>
> but apparently, trace return a vector, when if statement needs a numeric
> expression.
>
> How can I check if two objects have any overlap in an if statement?

I guess you'd need to write a macro which takes the two objects and returns a
bool, true if the bounding boxes overlap (or whichever method you use to
determine "intersection").


regards, jr.


Post a reply to this message

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