POV-Ray : Newsgroups : povray.binaries.scene-files : eval_pigment() and trace() HowTo : Re: eval_pigment() and trace() HowTo Server Time
23 Apr 2024 14:53:28 EDT (-0400)
  Re: eval_pigment() and trace() HowTo  
From: Thomas de Groot
Date: 10 Jul 2016 03:00:47
Message: <5781f29f$1@news.povray.org>
On 9-7-2016 13:42, clipka wrote:
> Am 09.07.2016 um 13:17 schrieb Thomas de Groot:
>> On 9-7-2016 12:38, clipka wrote:
>>> Am 09.07.2016 um 08:52 schrieb Thomas de Groot:
>>>> On 7-7-2016 16:02, Bald Eagle wrote:
>>>>> I see:
>>>>> #declare WriteStrands = off; //set to 'on' for the first pass.
>>>>>
>>>>> Isn't there a way to just check if the file exists, and if not, create
>>>>> it?
>>>>> I looked - but it's not clear that this is possible.
>>>>> Seemed like a useful and desirable feature to be added, if that's the
>>>>> case.
>>>>>
>>>>
>>>> In fact, there is a simple reason why I did not use the file_exists(S)
>>>> function, now that I think about it. It is that you may want to test
>>>> different settings before choosing the final ones (at least that is how
>>>> I work) and so - except for the very first time - there is always a file
>>>> present.
>>>
>>> You could use something like:
>>>
>>>     #declare WriteStrands = off; // set to 'on' to force re-writing
>>>     ...
>>>     #if (!file_exists(...)) #declare WriteStrands = on; #end
>>>
>>
>> But, that would always set it to on, even when you want it to be off, or
>> do I misunderstand this?
>
> It would always set it to on _if_ the file does not already exist, so
> you don't need to manually set it to on for the first run.
>
> Of course if there are any use cases where you might want to have _no_
> file at all, then this is of no use.
>

I think you misunderstand my use of the on/off switch. The writing away 
of data is only meant as time saving later on when reading the data 
(always faster than having to do the complete calculations for each 
run). So, the switching off of the writing section (once you are 
satisfied with the written data) is essential. A file_exist switch can 
only make sense to check the existence of a file in the "Read" section 
of the macro.

-- 
Thomas


Post a reply to this message

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