POV-Ray : Newsgroups : povray.advanced-users : 3d data files - help please : Re: 3d data files - help please Server Time
30 Jul 2024 04:14:34 EDT (-0400)
  Re: 3d data files - help please  
From: david sharp
Date: 29 Mar 2000 12:25:39
Message: <38e23c93@news.povray.org>
SamuelT. <STB### [at] aolcom> wrote
[ ... ]
>                                        I'm having problems understanding
how to
> make a 3d data file for use with isosurfaces. The MegaPov docs tell me I
> can use #fwrite (I assume they mean #write) to make my file. When I
> tried this, pov still could not find my .dat file. Can I just write some
> numbers manually, or use basic to make a text file?

Yes, the '#fwrite' is a mistake and should be '#write'. Yes, you could
type a bunch of numbers into a file and use that. Or get BASIC
to write the data file. Why MegaPov couldn't find your file, I don't know.
Maybe try a test using a fully specified path for the data file?

A silly (random data) example:
////////////////////////////////
#declare S1=seed(0);
#fopen fileid "mydata.dat" write
#declare i=0;
#while (i<4)
  #declare j=0;
  #while (j<4)
    #declare k=0;
    #while(k<4)
       // note the "\n" to separate density values from each other
       #write (fileid, .5-rand(S1),"\n")
       #declare k=k+1;
    #end
    #declare j=j+1;
  #end
  #declare i=i+1;
#end
#fclose fileid

isosurface {
 function { "data_3D_3", <1.0>, library   "i_dat3d", "mydata.dat", <4, 4, 4,
0> }
 contained_by { sphere {0, 5 } }
 eval
 pigment { Red}
}
////////////////////////


Post a reply to this message

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