POV-Ray : Newsgroups : povray.beta-test : Isosurface: max_gradient warning? : Re: Isosurface: max_gradient warning? Server Time
10 May 2024 13:43:42 EDT (-0400)
  Re: Isosurface: max_gradient warning?  
From: James Holsenback
Date: 23 Jun 2013 15:31:17
Message: <51c74d05$1@news.povray.org>
On 06/23/2013 03:24 PM, Le_Forgeron wrote:
> Le 23/06/2013 20:00, James Holsenback nous fit lire :
>>> it looks like the "if (isCopy == false)" does not test positive when the
>>> isosurface is wrapped in an object, but it does when the isosurface is
>>> naked.
>>>
>>> Bill P.
>>>
>>
>> I'm wondering when it was broken, or if that's the intended behavior ...
>> perhaps some kind of note in the documentation /might/ be the way to go.
>> Just a thought.
>
> isCopy seems to be intended to avoid displaying the same warning over
> and over for the same isosurface (as duplicated isosurface indeed are
> not copied but reference the same sub-structure).
>
> #declare Ob = isosurface{...}; // that's not a copy
> object {Ob ... } // that's a copy
>
> Previously (3.6.1) the warning was displayed at the destruction of the
> isosurface (when the sub-structure was actually referenced by no one else)	
>
>    if((Stage == STAGE_SHUTDOWN) && (mginfo->refcnt == 0))
>
> In 3.7, isCopy was introduced with change 4707, 16th February 2009,
> along with the change introducing means for objects to submit message on
> shutdown.
> It was reported in windows source with change 4714, 21th February 2009.
>
> If the symptom "isosurface embbeded in object (CSG) does not show the
> warning" is correct, it might be a "feature/bug". The parser copied the
> isosurface object and deleted the original before the render started.
> When the render ends, it find only copies and because the refcnt is not
> used anymore (for that purpose), it miss the last remaining true data to
> display.
>
> Instead of isCopy, what about adding in mginfo a boolean
> "printed_warning" (actual name should be more appropriate), set to false
> on creation, and turn to true on the first call (instead of last for
> 3.6.1) of the warning displaying function (test for false, set to true
> if false) ? (and dropping isCopy in the process)
>
> For instance, i'm afraid the following sequence would fails with current
> code:
>
> #declare Foo = isosurface{ ... };
> #declare Bar = object { Foo ... };
> #undef Foo;
>
> (or any pop of #local context, such as building the isosurface via macro
> or loop, or replacing the value of a previous #declare/#local )
>
>

Ok that explains when it happened (nice detective work btw) ... I'm 
starting to think that the isosurface documentation needs to reflect the 
change in behavior.


Post a reply to this message

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