POV-Ray : Newsgroups : povray.general : Any way to avoid repeated parsing? Server Time
11 Aug 2024 09:21:27 EDT (-0400)
  Any way to avoid repeated parsing? (Message 21 to 30 of 52)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Nieminen Juha
Subject: Re: Any way to avoid repeated parsing?
Date: 19 Sep 1999 04:49:49
Message: <37e4a3ad@news.povray.org>
Mark Wagner <mar### [at] gtenet> wrote:
: Add a 'static' object modifier to the language that can be applied to
: anything, for example:

: sphere{<0,0,0>, 1 pigment{ rgb 1} static}

:  POV-Ray will not reparse any object that contains that modifier after the
: first frame of an animation.  If you apply it to an object that does get
: changed over the course of an animation, that's your problem, not POV's.

  I think this is not enough either. Povray will have to parse the entire
file anyways if there's some non-static objects (for example at the end of
the file). One solution to this is, of course, to keep a copy of the scene
in memory with all static objects removed.
  There's another problem: If all objects generated in a #while-loop are
static, that loop doesn't need to be parsed but just once. But how do you
tell this to povray?

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: PoD
Subject: Re: Any way to avoid repeated parsing?
Date: 19 Sep 1999 17:32:57
Message: <37E557AB.D1CC1582@merlin.net.au>
Nieminen Juha wrote:
> 
> Mark Wagner <mar### [at] gtenet> wrote:
> : Add a 'static' object modifier to the language that can be applied to
> : anything, for example:
> 
> : sphere{<0,0,0>, 1 pigment{ rgb 1} static}
> 
> :  POV-Ray will not reparse any object that contains that modifier after the
> : first frame of an animation.  If you apply it to an object that does get
> : changed over the course of an animation, that's your problem, not POV's.
> 
>   I think this is not enough either. Povray will have to parse the entire
> file anyways if there's some non-static objects (for example at the end of
> the file). One solution to this is, of course, to keep a copy of the scene
> in memory with all static objects removed.
>   There's another problem: If all objects generated in a #while-loop are
> static, that loop doesn't need to be parsed but just once. But how do you
> tell this to povray?
> 
> --
> main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
> ):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/

how about a static block i.e.
static{
  ...
}

easy to skip in parsing and can contain anything.
Of course the scene coder has to be extra careful what's put in there.

Cheers, PoD.


Post a reply to this message

From: Ron Parker
Subject: Re: Any way to avoid repeated parsing?
Date: 19 Sep 1999 22:02:23
Message: <37e59626.511717648@news.povray.org>
On Mon, 20 Sep 1999 07:07:47 +0930, PoD <pod### [at] merlinnetau> wrote:

>how about a static block i.e.
>static{
>  ...
>}

I prefer the syntax

#static
...
#end

because block syntax is currently restricted to actual entities, and
#-directives are used for procedural and flow-control things.


Post a reply to this message

From: Nieminen Juha
Subject: Re: Any way to avoid repeated parsing?
Date: 20 Sep 1999 05:38:35
Message: <37e6009b@news.povray.org>
Ron Parker <par### [at] fwicom> wrote:
: #static
: ...
: #end

  Not bad. This way you could specify anything as static, not just objects.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: PoD
Subject: Re: Any way to avoid repeated parsing?
Date: 20 Sep 1999 18:27:41
Message: <37E6B604.EE361FE9@merlin.net.au>
Ron Parker wrote:
> 
> On Mon, 20 Sep 1999 07:07:47 +0930, PoD <pod### [at] merlinnetau> wrote:
> 
> >how about a static block i.e.
> >static{
> >  ...
> >}
> 
> I prefer the syntax
> 
> #static
> ...
> #end
> 
> because block syntax is currently restricted to actual entities, and
> #-directives are used for procedural and flow-control things.

Err. yeah given how the rest of the syntax works, you're right, I've
just never liked that syntax.

The main point is the same though, if this is not the first parsing of
the file then traet this block as a comment.

Cheers, PoD.


Post a reply to this message

From: Tomas Plachetka
Subject: Re: Any way to avoid repeated parsing?
Date: 21 Sep 1999 05:12:34
Message: <37E74BF0.2982877B@uni-paderborn.de>
Ron Parker wrote:
> 
> On Mon, 20 Sep 1999 07:07:47 +0930, PoD <pod### [at] merlinnetau> wrote:
> 
> >how about a static block i.e.
> >static{
> >  ...
> >}
> 
> I prefer the syntax
> 
> #static
> ...
> #end
> 
> because block syntax is currently restricted to actual entities, and
> #-directives are used for procedural and flow-control things.

Well, if such a thing were really to be implemented, then 
I would suggest #endstatic instead of just #end.
Using #end as a common construct terminator could lead to 
nesting problems, especially if several such contructs
are needed in the future.

The current #if, #while, #ifdef, etc directives are safe
about using a common #end terminator as there is a simple
nesting rule. However, this simplicity could be violated
when adding new constructs like this. Using special 
constructs for specials is perhaps better than using 
special semantics for specials. (Wow, what a sentence.)

	y.


Post a reply to this message

From: Ron Parker
Subject: Re: Any way to avoid repeated parsing?
Date: 21 Sep 1999 11:26:52
Message: <slrn7uf8ts.v8.parkerr@ron.gwmicro.com>
On Tue, 21 Sep 1999 11:12:16 +0200, Tomas Plachetka wrote:
>Well, if such a thing were really to be implemented, then 
>I would suggest #endstatic instead of just #end.
>Using #end as a common construct terminator could lead to 
>nesting problems, especially if several such contructs
>are needed in the future.

But #static is just a fancy way of saying "#if (this_is_the_first_parse)",
so it nests perfectly with other #ifs.  It has to, because otherwise you'll
hit an unmatched #end or an unmatched #if the second time you parse the file.
Unless you're thinking about something horrible like this

#static
  #if (0)
#endstatic
   object {wristband}
#static
  #end
#endstatic

to make the mat object only appear in frames after the first one. (does that
make it an antistatic mat?)  But that's a horrible, horrible corruption of 
the purpose of #static (and wouldn't scale to multiple processors working on
the same animation.)


Post a reply to this message

From: Tomas Plachetka
Subject: Re: Any way to avoid repeated parsing?
Date: 21 Sep 1999 12:24:47
Message: <37E7B148.A2343E4@uni-paderborn.de>
Ron Parker wrote:
> 
> On Tue, 21 Sep 1999 11:12:16 +0200, Tomas Plachetka wrote:
> >Well, if such a thing were really to be implemented, then
> >I would suggest #endstatic instead of just #end.
> >Using #end as a common construct terminator could lead to
> >nesting problems, especially if several such contructs
> >are needed in the future.
> 
> But #static is just a fancy way of saying "#if (this_is_the_first_parse)",
> so it nests perfectly with other #ifs.  It has to, because otherwise you'll
> hit an unmatched #end or an unmatched #if the second time you parse the file.
> Unless you're thinking about something horrible like this
> 
> #static
>   #if (0)
> #endstatic
>    object {wristband}
> #static
>   #end
> #endstatic
> 
> to make the mat object only appear in frames after the first one. (does that
> make it an antistatic mat?)  But that's a horrible, horrible corruption of
> the purpose of #static (and wouldn't scale to multiple processors working on
> the same animation.)

Now I can't think of a better example...
Uhm. Never mind, I have a more conceptual question:
How do you define an object which is defined in the 
second frame (or 51th frame if you want) and does 
not change (persists) till the end of the animation? 
I think you cannot. (Nor can I.) In other words,
#static will not allow you to insert any static objects
in any other frame except of the first one. Right?

	y.


Post a reply to this message

From: Ron Parker
Subject: Re: Any way to avoid repeated parsing?
Date: 21 Sep 1999 12:39:05
Message: <37e7b4a9@news.povray.org>
On Tue, 21 Sep 1999 18:24:40 +0200, Tomas Plachetka wrote:
>Now I can't think of a better example...
>Uhm. Never mind, I have a more conceptual question:
>How do you define an object which is defined in the 
>second frame (or 51th frame if you want) and does 
>not change (persists) till the end of the animation? 
>I think you cannot. (Nor can I.) In other words,
>#static will not allow you to insert any static objects
>in any other frame except of the first one. Right?

Right.  Presumably you could extend it to #static (start,end) 
which would mean the contents of the block are static for clock 
values between start and end.


Post a reply to this message

From: Tomas Plachetka
Subject: Re: Any way to avoid repeated parsing?
Date: 21 Sep 1999 13:50:26
Message: <37E7C55B.1081F62A@uni-paderborn.de>
Ron Parker wrote:
> 
> On Tue, 21 Sep 1999 18:24:40 +0200, Tomas Plachetka wrote:
> >Now I can't think of a better example...
> >Uhm. Never mind, I have a more conceptual question:
> >How do you define an object which is defined in the
> >second frame (or 51th frame if you want) and does
> >not change (persists) till the end of the animation?
> >I think you cannot. (Nor can I.) In other words,
> >#static will not allow you to insert any static objects
> >in any other frame except of the first one. Right?
> 
> Right.  Presumably you could extend it to #static (start,end)
> which would mean the contents of the block are static for clock
> values between start and end.

That's it. Then why not having simply #if (start, end)? 
Let the POV-Ray decide what persists and for how long.
This would also save one keyword. However, when nesting
#if with #if(start, end), one could get in troubles. To 
avoid this, you have to carefully restrict usage of 
#if(start, end).

Note that the above arguments apply to #static(start,end), 
too.

	y.


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

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