POV-Ray : Newsgroups : povray.general : A question of Style : Re: A question of Style Server Time
30 Jul 2024 20:27:57 EDT (-0400)
  Re: A question of Style  
From: Chris B
Date: 4 Jul 2008 13:45:56
Message: <486e61d4@news.povray.org>
"Leroy Whetstone" <lrw### [at] joplincom> wrote in message 
news:486### [at] joplincom...
> I've made several models and other things(macro,functions...) with POV. 
> Awhile back I got tired of having a test program for each of these. So now 
> I use #ifndef(Get)in all my Pov models and include files to bracket a 
> camera and lights and the object and what ever else I need to test the 
> file. Before you include the file you have to #declare Get=1;.
>  I was wondering do many use this trick?

I think quite a lot of people use a fairly wide range of different but 
similar techniques to enable an include file to be rendered directly (for 
testing etc.). There was quite a long discussion a while ago about 
incorporating something into POV-Ray to enable the #include file chain to be 
interrogated when the file is parsed, so that a generic technique could be 
used to implement this. The discussion arose because having to declare 
variables in all of the scene files that use a particular include file is a 
bit of a pain.

I don't recall whether any concensus was ever reached or whether anything 
made it into the development stream. My vote would go for a read-only array 
listing the files in the #include chain. If the array is length 0 you know 
that the user has asked to render the current file and can add a camera, 
lights etc. It would also enable more sophisticated decisions to be made by 
examining the actual contents of the array.

>  And if you do what type do you save the file as?
>  I save objects like a boat,rock as a '.pov' and macros as an '.inc'.

I store anything designed to be able to be included into scene files with an 
extension of '.inc'. Files designed as top-level files (scene files, 
examples, document image generators etc) as '.pov'.

Regards,
Chris B.


Post a reply to this message

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