POV-Ray : Newsgroups : povray.windows : Reading file problem Server Time
23 Nov 2024 18:19:53 EST (-0500)
  Reading file problem (Message 1 to 3 of 3)  
From: Matthias Weißer
Subject: Reading file problem
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

From: Christoph Hormann
Subject: Re: Reading file problem
Date: 9 Jan 2004 10:32:04
Message: <qst2d1-pd9.ln1@triton.imagico.de>

> Hi
> 
> i am working with Maple 9 and would like to use POVRay to visualize som
e 
> 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

This lacks the comma at the end of the line which probably is the source 

of the problem.

Christoph

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


Post a reply to this message

From: Matthias Weißer
Subject: Re: Reading file problem
Date: 9 Jan 2004 11:38:54
Message: <3ffed91e@news.povray.org>
Christoph Hormann schrieb:

> 
>> 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
> 
> 
> This lacks the comma at the end of the line which probably is the source 
> of the problem.

That's it. Many thanks.

I thougt #read reads only one line but now i understand that it didn't 
care about line feed's.

-- 

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


Post a reply to this message

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