POV-Ray : Newsgroups : povray.windows : Reading file problem : Reading file problem Server Time
28 Jun 2024 22:40:42 EDT (-0400)
  Reading file problem  
From: Matthias Weißer
Date: 9 Jan 2004 10:13:31
Message: <3ffec51b$1@news.povray.org>
Hi

i am working with Maple 9 and would like to use POVRay to visualize some 
functions with complex numbers. Maple computes a list of points and 
export this points to a textfile. One line of this textfile is:

-0.020000, 0.940000, 1.168189

There are about 10000 of such points (lines) in the text file. I then 
use this code:

#local i = 1;
#local data_x = 1.0;
#local data_y = 1.0;
#local data_z = 1.0;

#fopen file_data "c:/temp/temp.txt" read
#while (defined(file_data))

     #read (file_data,data_x,data_y,data_z)


     	//#warning  concat("x="str(data_x,0,3),
         //                 " y="str(data_y,0,3),
         //                 " z="str(data_z,0,3),
         //                 " i=",str(i,0,0))
     	
     	#local i = i+1;
     	
     	#local vec_t = <data_x,data_y,data_z>;
     	
     	sphere{vec_t 0.02}

#end


This goes well for 5050 lines. Then POVRay throws this error:

File: c:/temp/temp.txt  Line: 5051


     #read (file_data,data_x, <----ERROR

Parse Error: Expected 'float, vector, or string literal', ,  found instead

Here are the lines around 5051: (Lines xxxx: is not in the file, i 
mentioned it only to make thing clear)

Line 5047: -0.020000, 0.940000, 1.168189
Line 5048: -0.020000, 0.960000, 1.158322
Line 5049: -0.020000, 0.980000, 1.148952
Line 5050: -0.020000, 1.000000, 1.140071
Line 5051: 0.000000, -1.000000, 1.135074
Line 5052: 0.000000, -0.980000, 1.144136
Line 5053: 0.000000, -0.960000, 1.153729

So the only difference between Line 5050 (no error) and 5051 (error) is 
the missing leading minus sign. But if i understand the documentation 
right this should no be a problem.

Thank you for reading and: Any ideas?


-- 

mat### [at] matweide
http://www.matwei.de


Post a reply to this message

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