POV-Ray : Newsgroups : povray.general : Collision chance Server Time
29 Mar 2024 03:47:41 EDT (-0400)
  Collision chance (Message 4 to 13 of 13)  
<<< Previous 3 Messages Goto Initial 10 Messages
From: jr
Subject: Re: Collision chance
Date: 24 Apr 2021 17:45:00
Message: <web.608490f6cab7490879819d986cde94f1@news.povray.org>
hi,

ingo <ing### [at] tagpovrayorg> wrote:
> in news:web.60846401cab7490879819d986cde94f1@news.povray.org jr wrote:
> > 'sed'
> ... It just that it all adds up, even
> if it is just a few characters.

have long had a "dream" of a 2-pass scene file optimiser.  (pipe dream :-))
pass one analyse scene and strip comments, find and paste all needed snippets
from includes, in pass two replace all identifiers with generated 'ANNN'.
perfectly unreadable, but used as a last step..  anyway, interesting problem.


regards, jr.


Post a reply to this message

From: ingo
Subject: Re: Collision chance
Date: 24 Apr 2021 18:08:54
Message: <XnsAD171822FCA7seed7@news.povray.org>
in news:web.608490f6cab7490879819d986cde94f1@news.povray.org jr wrote:

> have long had a "dream" of a 2-pass scene file optimiser.

OK, confession time. Many many moons I wrote a python script to parse POV-
Ray scene files and do loop enrolling and a few other manipulations. The 
result ran fast! Python (1.52) not so. Gain, negative :(
The python code I use to colorise the code in HTML is a spin-off of that.

Now, dreaming. Include files compileable to libraries. If I understand it 
right if POV-Ray SDL were written in NIM macros it could be possible. Or 
in LISP. Then again, I happy with the simple language POV-Ray offers. 
There is not much in the way of writing anything and little complexity 
from the language side. 
Also I'm happy with the journey POV-Ray offers. No need for real time 
instant gratification/satisfaction. No bucktlists. No expectations. No GPU 
madness.

Ingo


Post a reply to this message

From: jr
Subject: Re: Collision chance
Date: 24 Apr 2021 18:15:00
Message: <web.6084981fcab7490879819d986cde94f1@news.povray.org>
hi,

(it is late and all that, but a thought just occurred)

ingo <ing### [at] tagpovrayorg> wrote:
> ...
> #local ADSRarr[_decay][_base] = (ADSRarr[_sustain][_Level] - ADSRarr
> [_target_ratio][_dr]) * (1 - ADSRarr[_decay][r_coef]);

how about "devolving" your array into a dictionary with keys for '_decay',
'_target_ratio', etc, parallel arrays, so to speak.  eg:

#local ADSRD._decay._base = (ADSRD._sustain._Level - ADSRD._target_ratio._dr) *
(1 - ADSRD._decay.r_coef);

not an option?

regards, jr.


Post a reply to this message

From: Bald Eagle
Subject: Re: Collision chance
Date: 24 Apr 2021 18:20:00
Message: <web.6084991ecab749081f9dae3025979125@news.povray.org>
ingo <ing### [at] tagpovrayorg> wrote:

> The python code I use to colorise the code in HTML is a spin-off of that.

So, was that you?

http://news.povray.org/povray.general/thread/%3C602067b2%241%40news.povray.org%3E/


Post a reply to this message

From: Bald Eagle
Subject: Re: Collision chance
Date: 24 Apr 2021 18:35:00
Message: <web.60849c6dcab749081f9dae3025979125@news.povray.org>
ingo <ing### [at] tagpovrayorg> wrote:
> Currently I'm working on a sequencer and ADSR. They require a lot of
> array manipulation. The system I use, give everything a name, works quite
> well. The names get long and I'd like to shorten them. Hence the question,
> what are the chance on collisions with names from other file for only
> #local names. I'd like to drop the _sq bit but then I'm left with rather
> general names like _out.

What if you took everything that you wanted to have in a namespace and put them
into an include file.
Each include file could have a number associated with it.
Then instead of hard-coding the names and value assignments, you could use the
parse_string macro to make identifiers like _out1, _out2, etc.

Make a little macro like:

Declare (Lvalue, value)

so that the code reads mostly like usual and there's not a lot of extra code.

When you include one of these files, the first thing it does is check to see if
a global counter variable is set, and what its value is.  Then it uses the next
greater integer for its Lvalue names.

Then you could mix and match them any way you wanted, and you'd _always_ be
guaranteed to have distinct names.


Post a reply to this message

From: ingo
Subject: Re: Collision chance
Date: 25 Apr 2021 01:03:12
Message: <XnsAD1747BF066B3seed7@news.povray.org>
in news:web.6084991ecab749081f9dae3025979125@news.povray.org Bald Eagle
wrote: 

> ingo <ing### [at] tagpovrayorg> wrote:
> 
> 
> So, was that you?
> 


https://ingoogni.nl/download/povsdl2html.py
but I don't remember rendering an image with it.
At a certain moment the code was also used in the pyvon editor

Ingo


Post a reply to this message

From: ingo
Subject: Re: Collision chance
Date: 25 Apr 2021 01:04:12
Message: <XnsAD1747EB9DB42seed7@news.povray.org>
in news:web.6084981fcab7490879819d986cde94f1@news.povray.org jr wrote:

> not an option?

Oh yes, now they seem to be fixed.

Ingo


Post a reply to this message

From: ingo
Subject: Re: Collision chance
Date: 25 Apr 2021 01:05:26
Message: <XnsAD1748211E9F5seed7@news.povray.org>
in news:web.60849c6dcab749081f9dae3025979125@news.povray.org Bald Eagle 
wrote:

> Make a little macro like:

I've implemented that to some extent mainly for getting data from the 
arrays.


Post a reply to this message

From: jr
Subject: Re: Collision chance
Date: 25 Apr 2021 06:45:00
Message: <web.608546efcab7490879819d986cde94f1@news.povray.org>
hi,

ingo <ing### [at] tagpovrayorg> wrote:
> in news:web.6084981fcab7490879819d986cde94f1@news.povray.org jr wrote:
> > not an option?
> Oh yes, now they seem to be fixed.

and will allow you to be more .. savage in shortening key/index names, because
you then have a namespace of sorts.  nb last night's "it is late" post example
is wrong, each respective last element would still be '[ name ]'.


regards, jr.


Post a reply to this message

From: Cousin Ricky
Subject: Re: Collision chance
Date: 25 Apr 2021 14:49:42
Message: <6085b9c6$1@news.povray.org>
On 2021-04-24 1:44 PM (-4), ingo wrote:
> 
> what are the chance on collisions with names from other file for only 
> #local names.

In my experience, low for any given scene, but quite substantial in the
long term.  I know the prefixes are a PITA, but for a general include
file, I would not take the chance.

Also, it is recommended that all identifiers contain at least one
uppercase letter.  People have been burned by this before.


Post a reply to this message

<<< Previous 3 Messages Goto Initial 10 Messages

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