POV-Ray : Newsgroups : povray.beta-test : the read-directive : Re: the read-directive Server Time
17 May 2024 16:45:29 EDT (-0400)
  Re: the read-directive  
From: MichaelJF
Date: 19 Oct 2012 14:05:01
Message: <web.508194d6399c00aaea376ab0@news.povray.org>
Le_Forgeron <jgr### [at] freefr> wrote:
> Le 19/10/2012 06:53, Tim Cook nous fit lire :
> > How about adding a #binaryread command or something, that's supplementary?
>
> what would be the usage of it ?
> I mean, the SDL is able to handle floating point, vector up to 5
> dimensions of floating point, and string of text (and I might be
> forgetting some things like square matrix). It cannot handle a binary
> blob like a PNG or JPG image or a collection of traced photons directly
> (not in a generic way for more manipulation)
>
> #write is there to help you write on the fly files (for simulation:
> iteration k-1 saves its data for the next one), as well as easing export.
>
> reading back such file with #read is an option when its content is only
> a collection of numbers (which most simulation are just happy with).
> more complex files might get in via #include (yes, it's perverse: you
> have to spend more time in the #write part to generate a valid SDL
> sub-script)
>
> If you expect the SDL to become a multipurpose scripting facility for
> importing from something else, I think you might be flogging the wrong
> horse.

Hm, again. Now I think I had better placed this idea in the science-fiction
section (pov4.discussion.general). I sense a certain amount of hostility against
this very simple idea, I have not expected. I didn't ask for a read directive
which can accept other, more complex objects. I only asked for a directive which
implements the readln-directive of C or C++ one to one. My idea is to have a
directive like

#readln ( FileHandle, String)

which reads a text-file line by line (seperated by carriage return and/or line
feed) and put the result in a POV-String. The interpretation of the resulting
string is the job of the user alone. With having substr(), strlen(), strcmp()
and concat() handy, one has all to write a parser if one could read a file line
by line.

What could be the usage of this? A very simple example would be that you would
be able to write a POV-macro to convert wavefront-OBJ-Files to POV-mesh2-syntax
in POV itself. I will not say, that this would be an easy job, but it would be
possible. Most likely one had to process a file several times and writing
auxilliary files with the #write-directive). O.K. FlyerX gave us PoseRay which
is really a very excellent tool for this special example and gave a lot of
additional features too.  I can easily implement my issues with my SAS-Software.
But I cannot share the results with you, since most of you will be ignorant to
the existence of such a software completely. Programming POV-Code for POV-users
would solve this problem. Since every POV-user can use the SDL. So please look
beyond your own nose.

Best regards,
Michael


Post a reply to this message

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