POV-Ray : Newsgroups : povray.binaries.images : improved exclusion test macro [30k] Server Time
1 Aug 2024 02:14:33 EDT (-0400)
  improved exclusion test macro [30k] (Message 1 to 3 of 3)  
From: [GDS|Entropy]
Subject: improved exclusion test macro [30k]
Date: 15 Feb 2009 08:28:46
Message: <4998188e@news.povray.org>
Hello,

I have improved my macro following suggestions given to me regarding the 
previous version.
Please find attached test images.

Here is the "internal test" version:

//      exclusionTest Macro by [GDS|Entropy] - Release - Internal Version
#macro exclusionTest(ctr,vectorArray,testObject)
 #local vectorA = min_extent(testObject);
 #local vectorB = max_extent(testObject);
 #local i=0;
 #while (i<ctr)
  #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)))
   #if (inside(testObject,vectorArray[i]))
    callExternal(ctr,0,vectorArray[i])
   #end
  #end
 #set i=i+1;
 #end
#end
//------

#macro callExternal(ctr,option,valueToPass)
 //     your macros here
#end

This seems to work with spheres, torii, cubes, quartic cyl, etc...
I haven't tested it on more complicated objects.

The source file has a few different versions of that macro, including a 
"meta" version with more options and one with #debug text included for ease 
of comprehension.

ian


Post a reply to this message


Attachments:
Download 'VectorTest_1_inObj_inBox__Hollow.jpg' (9 KB) Download 'VectorTest_1_outObj_inBox__Hollow0.jpg' (12 KB)

Preview of image 'VectorTest_1_inObj_inBox__Hollow.jpg'
VectorTest_1_inObj_inBox__Hollow.jpg

Preview of image 'VectorTest_1_outObj_inBox__Hollow0.jpg'
VectorTest_1_outObj_inBox__Hollow0.jpg


 

From: [GDS|Entropy]
Subject: Re: improved exclusion test macro [30k]
Date: 15 Feb 2009 08:29:25
Message: <499818b5@news.povray.org>
Source in p.b.s-f


"[GDS|Entropy]" <gds### [at] hotmailcom> wrote in message 
news:4998188e@news.povray.org...
> Hello,
>
> I have improved my macro following suggestions given to me regarding the 
> previous version.
> Please find attached test images.
>
> Here is the "internal test" version:
>
> //      exclusionTest Macro by [GDS|Entropy] - Release - Internal Version
> #macro exclusionTest(ctr,vectorArray,testObject)
> #local vectorA = min_extent(testObject);
> #local vectorB = max_extent(testObject);
> #local i=0;
> #while (i<ctr)
>  #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)))
>   #if (inside(testObject,vectorArray[i]))
>    callExternal(ctr,0,vectorArray[i])
>   #end
>  #end
> #set i=i+1;
> #end
> #end
> //------
>
> #macro callExternal(ctr,option,valueToPass)
> //     your macros here
> #end
>
> This seems to work with spheres, torii, cubes, quartic cyl, etc...
> I haven't tested it on more complicated objects.
>
> The source file has a few different versions of that macro, including a 
> "meta" version with more options and one with #debug text included for 
> ease of comprehension.
>
> ian
>
>


Post a reply to this message

From: [GDS|Entropy]
Subject: Re: improved exclusion test macro [30k]
Date: 15 Feb 2009 12:43:04
Message: <49985428@news.povray.org>
Here are a few more test images. Apparently it works quite well with complex 
objects.

ian


Post a reply to this message


Attachments:
Download 'SphereTower_2_Outside.jpg' (9 KB) Download 'SphereTower_2_Inside.jpg' (19 KB)

Preview of image 'SphereTower_2_Outside.jpg'
SphereTower_2_Outside.jpg

Preview of image 'SphereTower_2_Inside.jpg'
SphereTower_2_Inside.jpg


 

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