POV-Ray : Newsgroups : povray.general : limited exclusion/inclusion object placment..needs improvement : limited exclusion/inclusion object placment..needs improvement Server Time
30 Jul 2024 12:21:58 EDT (-0400)
  limited exclusion/inclusion object placment..needs improvement  
From: [GDS|Entropy]
Date: 13 Feb 2009 00:44:27
Message: <499508bb$1@news.povray.org>
Hello,

Lets assume we have an area (or areas) of undefined shape, and we wish to 
place objects everywhere *but* that spot in 3 dimensions or two.

Would this normally be accomplished by some horrific inversion of the 
Trace() function, or calls to a min/max_extent vector array macro for each 
object to be tested against?
It seems that it would be awful to test every vector against every other 
vector in two or more large arrays...so that can't be the right way to do 
it...

In a more simple scenario if we knew that the space we wished to (or to NOT) 
populate was everywhere between <-5,-5,-5> and <5,5,5>, I was able to come 
up with the folowing:
  #if (((vectorArray[i].x <= vectorB.x) & (vectorArray[i].x >= vectorA.x)) &
       ((vectorArray[i].y <= vectorB.y) & (vectorArray[i].y >= vectorA.y)) &
       ((vectorArray[i].z <= vectorB.z) & (vectorArray[i].z >= vectorA.z)))

This does NOT take mixed sign vectors well at all, but works nicely with 
everything else that I have tested it with.

How can I fix that? Does it involve breaking the if condition up into 
seperate blocks or something?

I've posted the source in p.t.s-f and image in p.b.i.
Its nothing glorious, just something that hit me while drinking my Bass Ale 
earlier...

Does anyone else have any ideas? There has to be a better way.

ian


Post a reply to this message

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