POV-Ray : Newsgroups : povray.general : Datafile-Name-Generator Macro Server Time
19 Nov 2024 01:40:19 EST (-0500)
  Datafile-Name-Generator Macro (Message 1 to 2 of 2)  
From: Tim Nikias
Subject: Datafile-Name-Generator Macro
Date: 22 Jun 2002 15:06:09
Message: <3D14CAA0.A4D875C0@gmx.de>
While working on my vegetation macros I cooked up a simple set of macros

(of which actually only one needs to called by the User) which converts
either a float, uv-vector or xyz-vector into an appropriate filename.

Instead of just using the numbers 0 to 9 as digits, the alphabet is used
as well,
enlargening the possibilities.

Its just a method to easily create external arrays. While in POV, you
don't need to bother about the filenames, you just work as if you'd
use array-indices (though instead of Array[X][Y][Z] you'd use
Get_DNG_File(<X,Y,Z>), which generates the coded filename).

What's the actual use?

I needed a VERY variable array-storing-method, to keep track of
how many objects were placed in a given confinement. Since I have
no way of telling how many objects actually fit into a grid, and
reparsing arrays all the time is quiet time-consuming, I thought about
moving the data to disk. A simple way of adding whenever I need
to, though deleting is a more difficult task, by just appending to the
file...

So, if I'd want a 1D-Array (which is actually 2D, cause in each
file I can put as many float/boolean/vector/string as I like), I can
easily use 2.251.875.390.625 different filenames.
Its only 3.675 for a 3D array (since the naming is xx_xx_xx.end),
but that is probably sufficient for any POV-User scripting in POV...

Comment if you like, use if you want to. I don't think the average
POVer really needs it, but since its easy to use, I thought I'd make
it available to the public, just in case...

You can find the file (in a ZIP along with an example file) in my
downloads section.

--
Tim Nikias
Homepage: http://www.digitaltwilight.de/no_lights/index.html
Email: Tim### [at] gmxde


Post a reply to this message

From: Tim Nikias
Subject: Re: Datafile-Name-Generator Macro
Date: 23 Jun 2002 05:18:30
Message: <3D159265.860A8EA7@gmx.de>
Uuups, made some miscalculations...

Its 2.821.109.907.456 possibilities for 1D, and
2.176.782.336 for 2D and 3D...

So its far more than anyone would probably need...


--
Tim Nikias
Homepage: http://www.digitaltwilight.de/no_lights/index.html
Email: Tim### [at] gmxde


Post a reply to this message

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