POV-Ray : Newsgroups : povray.text.scene-files : format of .df3 files : format of .df3 files Server Time
23 Apr 2024 03:59:49 EDT (-0400)
  format of .df3 files  
From: Bertrand
Date: 16 Feb 2014 17:40:00
Message: <web.53013dce87b4247ff093e06c0@news.povray.org>
Dear Povray community,

I am trying to write a small program in Fortran to have a density .df3 file. I
have read the different post on the topic but I still do not understand the data
that should be written in this file.
I am posting an example of what I am doing in fortran at the end of this post. I
force the unformatted file to be written in big-endian format with the
compiler.
The written data is:
header: 6 byte three times 16bit integers
data: 6 byte three times integer and one real at the end (the actual density)

in ASCII, what is written is

10 10 10    (the size of the lattice)
1 1 1 0.5d0
1 2 1 0.4d0
.....

one value of the density per box (that you call voxel) per line. There are
several things I would like to ask.

- is it the good format ;)? (first question of course)
- what if the density has a position that can only be expressed in terms of
double precision number?
- How does povray places the density on the actual graph?

I am sorry if these questions were treated already but I could not find them but
it is the first time that I am trying something this with povray and I am really
in the mist.

Thanks a lot for your help,
Bertrand


OPEN(70,FILE=fname,action='write',status='unknown',form='unformatted',access="direct",recl=6*(3+product(dim_lat)))

      Write(70,rec=1) (dim_lat(i),i=1,3)

      do i_x=1,dim_lat(1)
       do i_y=1,dim_lat(2)
        Write(70,rec=i_y+(i_x-1)*dim_lat(2))
(Spin(k,i_x,i_y),k=1,2),1,toto(i_x,i_y)/pi(4.0d0)/surface
       enddo
      enddo
      close(70)


Post a reply to this message

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