POV-Ray : Newsgroups : povray.general : Writing binary files with POV script Server Time
4 Aug 2024 04:14:58 EDT (-0400)
  Writing binary files with POV script (Message 1 to 10 of 17)  
Goto Latest 10 Messages Next 7 Messages >>>
From: JC (Exether)
Subject: Writing binary files with POV script
Date: 22 Aug 2003 04:35:18
Message: <3f45d5c6$1@news.povray.org>
I would like to generate a df3 file directly from a pov script, 
generating it from pigments, a bit like Gilles' makecloud macro. But I 
had a look at the documentation, and it seems that you can only output 
text to a file.

So I was wondering if there was a trick to do it, and if not, if it's 
going to be implemented in some next POVray version.

JC
PS: I know I can generate images with povray and make a df3 file with 
some utility, but I already have too much utilities installed and I'd 
like to do it in one step.


Post a reply to this message

From: ABX
Subject: Re: Writing binary files with POV script
Date: 22 Aug 2003 04:50:11
Message: <n1mbkv84lo46jhm5o66kjpdlso1ridpfov@4ax.com>
On Fri, 22 Aug 2003 10:35:17 +0200, "JC (Exether)" <no### [at] spamfr> wrote:
> I would like to generate a df3 file directly from a pov script, 
> generating it from pigments, a bit like Gilles' makecloud macro. But I 
> had a look at the documentation, and it seems that you can only output 
> text to a file.
> So I was wondering if there was a trick to do it, and if not, if it's 
> going to be implemented in some next POVray version.

It was discussed a few times. It is not possible to make binary files.

> JC
> PS: I know I can generate images with povray and make a df3 file with 
> some utility, but I already have too much utilities installed and I'd 
> like to do it in one step.

See text format called extended density_file format at
http://staff.aist.go.jp/r-suzuki/e/povray/iso/df_body.htm

ABX


Post a reply to this message

From: Christoph Hormann
Subject: Re: Writing binary files with POV script
Date: 22 Aug 2003 04:51:39
Message: <3F45D99B.9A2BD0BB@gmx.de>
"JC (Exether)" wrote:
> 
> I would like to generate a df3 file directly from a pov script,
> generating it from pigments, a bit like Gilles' makecloud macro. But I
> had a look at the documentation, and it seems that you can only output
> text to a file.

http://staff.aist.go.jp/r-suzuki/e/povray/iso/df_body.htm

This patch can read text density files.

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 17 Jun. 2003 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Warp
Subject: Re: Writing binary files with POV script
Date: 22 Aug 2003 07:27:47
Message: <3f45fe33@news.povray.org>
ABX <abx### [at] abxartpl> wrote:
> It was discussed a few times. It is not possible to make binary files.

  The reason for this is that due to how POV-Ray (well, actually C)
internally works, you can't write the byte value 0 to a file (any other
value is writable).
  In order to be able to write any byte values (including 0) to a file,
a specialized function would have to be added. Perhaps someone could make
a patch...

  (The reason why 0 is not writable is because in C's string-handling
functions it marks the end of the string. The writing C function will
stop at that point and will not write the 0 nor anything which comes
after it. In order to write raw binary data, a different C function
needs to be used (which is not a string function). There's no feature
in the POV-Ray scripting language which would use such function and
thus this is not possible currently.)

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

From: Warp
Subject: Re: Writing binary files with POV script
Date: 22 Aug 2003 07:28:56
Message: <3f45fe78@news.povray.org>
By the way, in theory it could be possible to write a DF3 file from
POV-Ray as long as it doesn't contain any 0 byte... :)

-- 
plane{-x+y,-1pigment{bozo color_map{[0rgb x][1rgb x+y]}turbulence 1}}
sphere{0,2pigment{rgbt 1}interior{media{emission 1density{spherical
density_map{[0rgb 0][.5rgb<1,.5>][1rgb 1]}turbulence.9}}}scale
<1,1,3>hollow}text{ttf"timrom""Warp".1,0translate<-1,-.1,2>}//  - Warp -


Post a reply to this message

From: John VanSickle
Subject: Re: Writing binary files with POV script
Date: 22 Aug 2003 13:35:17
Message: <3F46544F.A3AF6F80@hotmail.com>
JC (Exether) wrote:
> 
> I would like to generate a df3 file directly from a pov script,
> generating it from pigments, a bit like Gilles' makecloud macro. But I
> had a look at the documentation, and it seems that you can only output
> text to a file.
> 
> So I was wondering if there was a trick to do it, and if not, if it's
> going to be implemented in some next POVray version.
> 
> JC
> PS: I know I can generate images with povray and make a df3 file with
> some utility, but I already have too much utilities installed and I'd
> like to do it in one step.

I suppose that you could use chr() to write the bytes to the file.

Regards,
John


Post a reply to this message

From: Ray Gardener
Subject: Re: Writing binary files with POV script
Date: 22 Aug 2003 14:11:57
Message: <3f465ced$1@news.povray.org>
How about this:

Use the existing file output functions to write
a hex-ASCII version of your file, and then, in
a POV INI file, use the Post_Scene_Command or
Post_Frame_Command directive to execute a
converter app to turn the text into binary form.

Ray Gardener
Daylon Graphics Ltd.
"Heightfield modeling perfected"
http://www.daylongraphics.com




"JC (Exether)" <no### [at] spamfr> wrote in message
news:3f45d5c6$1@news.povray.org...
> I would like to generate a df3 file directly from a pov script,
> generating it from pigments, a bit like Gilles' makecloud macro. But I
> had a look at the documentation, and it seems that you can only output
> text to a file.
>
> So I was wondering if there was a trick to do it, and if not, if it's
> going to be implemented in some next POVray version.
>
> JC
> PS: I know I can generate images with povray and make a df3 file with
> some utility, but I already have too much utilities installed and I'd
> like to do it in one step.
>


Post a reply to this message

From: Marc Champagne
Subject: Re: Writing binary files with POV script
Date: 23 Aug 2003 07:53:31
Message: <Xns93E04FFEDA04CPOVMIKA@204.213.191.226>
"Ray Gardener" <ray### [at] daylongraphicscom> wrote in
news:3f465ced$1@news.povray.org: 

> How about this:
> 
> Use the existing file output functions to write
> a hex-ASCII version of your file, and then, in
> a POV INI file, use the Post_Scene_Command or
> Post_Frame_Command directive to execute a
> converter app to turn the text into binary form.
> 
> Ray Gardener
> Daylon Graphics Ltd.
> "Heightfield modeling perfected"
> http://www.daylongraphics.com
> 
> 
> 
> 
> "JC (Exether)" <no### [at] spamfr> wrote in message
> news:3f45d5c6$1@news.povray.org...
>> I would like to generate a df3 file directly from a pov script,
>> generating it from pigments, a bit like Gilles' makecloud macro. But I
>> had a look at the documentation, and it seems that you can only output
>> text to a file.
>>
>> So I was wondering if there was a trick to do it, and if not, if it's
>> going to be implemented in some next POVray version.
>>
>> JC
>> PS: I know I can generate images with povray and make a df3 file with
>> some utility, but I already have too much utilities installed and I'd
>> like to do it in one step.
>>

Being from the Unix arena, there is always a way even when it seems
impossible. Bright idea Ray! 

-- 
(MIKA) Marc Champagne
marcch.AT.videotron.DOT.ca
Montreal, CANADA


Post a reply to this message

From: nospam
Subject: Re: Writing binary files with POV script
Date: 24 Aug 2003 19:20:41
Message: <3f493f8c.4383761@localhost>
On Fri, 22 Aug 2003 10:35:17 +0200, "JC (Exether)" <no### [at] spamfr> wrote:

>I would like to generate a df3 file directly from a pov script, 
>generating it from pigments, a bit like Gilles' makecloud macro. But I 
>had a look at the documentation, and it seems that you can only output 
>text to a file.

For years I've been wishing that binary file read/write commands
would be added to povray (I once has a pov-script that was
rendering audio data to a text file.  I ended up writing it as
something like a uuencoded file and then having a separate
program to in turn convert that text file to the wave file).

However, it might is best that vinary I/O not be added.
Consider the ability to have a pov-script that in turn writes
a (binary) .exe file containing a virus?  Or what is to stop
povray from overwriting the system password file, or
command.com?


Post a reply to this message

From: Tim Cook
Subject: Re: Writing binary files with POV script
Date: 24 Aug 2003 19:53:19
Message: <3f494fef$1@news.povray.org>
nospam wrote:
> However, it might is best that vinary I/O not be added.
> Consider the ability to have a pov-script that in turn writes
> a (binary) .exe file containing a virus?  Or what is to stop
> povray from overwriting the system password file, or
> command.com?

The very same thing that prevents the text I/O feature of POV
from overwriting command.com with a text file: the inherent
pure-hearted goodness of the POV community. ;)


Post a reply to this message

Goto Latest 10 Messages Next 7 Messages >>>

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