POV-Ray : Newsgroups : povray.unofficial.patches : read pov scene text from RAM instead of disk file Server Time: 26 Apr 2017 23:27:15 GMT
  read pov scene text from RAM instead of disk file (Message 1 to 8 of 8)  
From: Mr
Subject: read pov scene text from RAM instead of disk file
Date: 22 Aug 2016 11:35:00
Message: <web.57bae242c23a6d916086ed00@news.povray.org>
Hi!
Is there a way for official pov or any other branch/patched verion, to read a
pov scene from Python string in RAM...?

(either directly or maybe using something like this?
http://docs.python.org/3/library/io.html#io.StringIO  )

Instead of having to write and read from the text file to disk, it would
probably make my exporter much faster for small scenes.


Post a reply to this message

From: Le Forgeron
Subject: Re: read pov scene text from RAM instead of disk file
Date: 22 Aug 2016 13:02:48
Message: <57baf7f8@news.povray.org>
Le 22/08/2016 à 13:33, Mr a écrit :
> Hi!
> Is there a way for official pov or any other branch/patched verion, to read a
> pov scene from Python string in RAM...?
>
> (either directly or maybe using something like this?
> http://docs.python.org/3/library/io.html#io.StringIO  )
>
> Instead of having to write and read from the text file to disk, it would
> probably make my exporter much faster for small scenes.
>

If you are on linux, you could mount the directory where the file is 
exported as a ramdisk (before launching any of your tools and povray)

http://www.linuxscrew.com/2010/03/24/fastest-way-to-create-ramdisk-in-ubuntulinux/

> http://www.linuxscrew.com/2010/03/24/fastest-way-to-create-ramdisk-in-ubuntulinux/

It has to be on a filesystem for povray, but nothing says that the 
filesystem cannot be in RAM.

If you are not changing the default output directory, you should 
provision enough room for the intermediate files and output pictures.


Post a reply to this message

From: clipka
Subject: Re: read pov scene text from RAM instead of disk file
Date: 22 Aug 2016 19:55:48
Message: <57bb58c4$1@news.povray.org>
Am 22.08.2016 um 13:33 schrieb Mr:
> Hi!
> Is there a way for official pov or any other branch/patched verion, to read a
> pov scene from Python string in RAM...?
> 
> (either directly or maybe using something like this?
> http://docs.python.org/3/library/io.html#io.StringIO  )

Nothing that could be used in conjunction with how you're presumably
invoking POV-Ray.


Post a reply to this message

From: Mr
Subject: Re: read pov scene text from RAM instead of disk file
Date: 23 Aug 2016 07:30:00
Message: <web.57bbfa8e8c571ece16086ed00@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 22.08.2016 um 13:33 schrieb Mr:
> > Hi!
> > Is there a way for official pov or any other branch/patched verion, to read a
> > pov scene from Python string in RAM...?
> >
> > (either directly or maybe using something like this?
> > http://docs.python.org/3/library/io.html#io.StringIO  )
>
> Nothing that could be used in conjunction with how you're presumably
> invoking POV-Ray.

Ok thanks, it looks like most of the time lost is the conversion between binary
to ascii data... and I don't have any compiled language skill to create/refresh
an exchange API in pov... current rendering speed will have to do with only a
little Python optimization when possible.


Post a reply to this message

From: LanuHum
Subject: Re: read pov scene text from RAM instead of disk file
Date: 23 Aug 2016 20:15:01
Message: <web.57bcadfb8c571ece7a3e03fe0@news.povray.org>
"Mr" <nomail@nomail> wrote:
> Hi!
> Is there a way for official pov or any other branch/patched verion, to read a
> pov scene from Python string in RAM...?
>
> (either directly or maybe using something like this?
> http://docs.python.org/3/library/io.html#io.StringIO  )
>
> Instead of having to write and read from the text file to disk, it would
> probably make my exporter much faster for small scenes.

It is not required. Required to render an external file instead ate
one-dimensional array of string variables.
char *povfile[] = {"#version", "3.7", "background","{","color"...and so on};

As the file can be written in one line, and the python can transmit the exact
same string.
Developers only need to specify how to count?
From a file or from a file.
Oh array in english is file? Your language does not even see the difference.
:)))))))
I see a simple desire


Post a reply to this message

From: clipka
Subject: Re: read pov scene text from RAM instead of disk file
Date: 23 Aug 2016 22:10:21
Message: <57bcc9cd$1@news.povray.org>
Am 23.08.2016 um 22:11 schrieb LanuHum:
> "Mr" <nomail@nomail> wrote:
>> Hi!
>> Is there a way for official pov or any other branch/patched verion, to read a
>> pov scene from Python string in RAM...?
>>
>> (either directly or maybe using something like this?
>> http://docs.python.org/3/library/io.html#io.StringIO  )
>>
>> Instead of having to write and read from the text file to disk, it would
>> probably make my exporter much faster for small scenes.
> 
> It is not required. Required to render an external file instead ate
> one-dimensional array of string variables.
> char *povfile[] = {"#version", "3.7", "background","{","color"...and so on};
> 
> As the file can be written in one line, and the python can transmit the exact
> same string.
> Developers only need to specify how to count?
> From a file or from a file.
> Oh array in english is file? Your language does not even see the difference.
> :)))))))

No, array in English is not file. It is not the language that fails to
see the difference, but your translation software :P

> I see a simple desire

Hmm... I guess one way to approach this could be to allow the source
"file" to be read from the standard input stream.

Up to now that wasn't a realistic option, because you can't rewind the
standard input stream, and therefore neither loops nor macros would work.

However, now that I've implemented cached macros, which works by parsing
from a memory buffer rather than a file, it would be comparatively easy
to apply the same mechanism to cache an entire file -- or the standard
input stream, for that matter.


Unfortunately that approach probably only works for a console version,
not the current Windows binaries. Reading from the standard input stream
in Windows GUI programs seems to be non-trivial.


Post a reply to this message

From: LanuHum
Subject: Re: read pov scene text from RAM instead of disk file
Date: 24 Aug 2016 13:50:01
Message: <web.57bda5d58c571ece7a3e03fe0@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:

>
> Unfortunately that approach probably only works for a console version,
> not the current Windows binaries. Reading from the standard input stream
> in Windows GUI programs seems to be non-trivial.

console version - very good idea.
Me and Mr. needed powerful tool for rendering.
Windows GUI pulls back.

:))))))


Post a reply to this message

From: Mr
Subject: Re: read pov scene text from RAM instead of disk file
Date: 26 Aug 2016 13:10:01
Message: <web.57c03f158c571ece16086ed00@news.povray.org>
"LanuHum" <Lan### [at] yandexru> wrote:
> clipka <ano### [at] anonymousorg> wrote:
>
> >
> > Unfortunately that approach probably only works for a console version,
> > not the current Windows binaries. Reading from the standard input stream
> > in Windows GUI programs seems to be non-trivial.
>
> console version - very good idea.
> Me and Mr. needed powerful tool for rendering.
> Windows GUI pulls back.
>
> :))))))

Indeed, that's rather a cheap price to pay (I no longer install povwin at every
updates since it's possible... load pov text files on notepad++ ) and one day
even blender text editor would be just as well when it will allow custom syntax
highlight.

Having this kind of speedup sounds really cool !


Post a reply to this message

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