POV-Ray : Newsgroups : povray.general : er...huh? : er...huh? Server Time
5 Aug 2024 04:19:52 EDT (-0400)
  er...huh?  
From: Timothy R  Cook
Date: 15 Dec 2002 00:29:00
Message: <3dfc131c@news.povray.org>
ok, the following code:

#fopen window "c:\program files\moray for windows beta\mdl\balcony.csv" read
#read(window,tile_amount)
#declare tilearray=array[tile_amount][21]
#declare current_tile=0;
#while(defined(window))
   #read(window,tilenumber,rrr,ggg,bbb,points)
   #declare tilearray[current_tile][0]=tilenumber;
   #declare tilearray[current_tile][1]=rrr;
   #declare tilearray[current_tile][2]=ggg;
   #declare tilearray[current_tile][3]=bbb;
   #declare tilearray[current_tile][4]=points;
   #declare n=0;
   #while(n<points)
     #read(window,pointx,pointy)
     #declare tilearray[current_tile][5+n]=pointx;
     #declare tilearray[current_tile][6+n]=pointy;
     #declare n=n+2;
   #end
   #declare current_tile=current_tile+1;
#end
#fclose window

with file "c:\program files\moray for windows beta\mdl\balcony.csv":
20
"Tile0001" 64 61 78 8 0 4 -29 0 0.8 -28.7 0.9 -28.1 0.8 -27 9 0.0 -28.0 
0.0 -28.7 0.2 -29.0 0.4 -29.0
"Tile0002",55,52,66,5,1.7,-29.0,1.9,-28.7,1.2,-28.3,1.0,-29.0,1.7,-29.0
"Tile0003",70,68,84,6,2.5,-28.2,2.4,-27.9,1.9,-27.9,1.5,-28.2,2.2,-28.5,2.5,-28.2
"Tile0004",56,53,67,7,3.4,-29.0,3.6,-28.7,3.4,-28.3,2.8,-28.3,2.5,-28.6,2.8,-29.0,3.4,-29.0
"Tile0005",94,92,112,5,1.3,-28.1,1.6,-27.7,1.0,-27.5,1.0,-27.9,1.3,-28.1
"Tile0006",117,107,129,5,0.8,-27.7,0.8,-27.4,0.3,-27.2,0.0,-27.8,0.8,-27.7
"Tile0007",139,126,150,5,2.3,-27.6,2.3,-26.9,1.7,-27.1,1.5,-27.5,2.3,-27.6
"Tile0008",164,138,172,7,3.5,-27.0,3.2,-26.4,2.8,-26.3,2.5,-26.8,2.6,-27.3,3.2,-27.4,3.5,-27.0
"Tile0009",112,97,118,6,3.5,-27.9,3.3,-27.7,2.6,-27.6,2.6,-27.8,2.7,-27.9,3.5,-27.9
"Tile0010",140,122,146,6,4.1,-27.5,4.2,-27.1,3.9,-27.1,3.5,-27.6,3.7,-27.7,4.1,-27.5
"Tile0011",54,48,61,5,5.0,-29.0,4.8,-28.4,4.3,-28.7,4.4,-29.0,5.0,-29.0
"Tile0012",77,68,85,6,4.3,-28.5,4.5,-28.3,3.9,-27.8,3.6,-28.1,3.8,-28.5,4.3,-28.5
"Tile0013",102,86,109,5,4.9,-28.0,4.9,-27.7,4.2,-27.7,4.7,-28.2,4.9,-28.0
"Tile0014",77,64,83,6,6.0,-28.5,5.6,-28.0,5.1,-27.8,5.0,-28.2,5.2,-28.5,6.0,-28.5
"Tile0015",91,75,97,6,6.9,-28.4,7.1,-27.9,6.6,-27.5,5.8,-27.9,6.3,-28.5,6.9,-28.4
"Tile0016",73,62,85,6,7.6,-28.6,7.9,-28.2,7.3,-28.0,7.1,-28.5,7.3,-28.6,7.6,-28.6
"Tile0017",56,47,64,5,8.7,-29.0,8.3,-28.3,7.8,-28.8,7.9,-29.0,8.7,-29.0
"Tile0018",71,55,79,7,9.1,-28.7,9.6,-28.2,9.2,-27.9,8.7,-27.9,8.5,-28.1,8.9,-28.8,9.1,-28.7
"Tile0019",53,38,55,5,9.2,-29.0,10.0,-29.0,10.0,-28.4,9.8,-28.3,9.2,-29.0
"Tile0020",82,62,91,4,10.0,-28.2,10.0,-27.5,9.7,-27.8,10.0,-28.2

gives an error on line 3 of the CSV with a parse error "Expected 'float, 
vector, or string literal', ,  found instead"...but the POV docs say the 
data file needs be delimited by commas.  so why does POV like spaces as 
delimiters but not commas?  How do I keep the comma-delimited file 
format and still use it in POV?

Apart from that, how crappy is my first attempt at writing POV code?
-- 
Tim Cook
http://empyrean.scifi-fantasy.com

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GFA dpu- s: a?-- C++(++++) U P? L E--- W++(+++)>$
N++ o? K- w(+) O? M-(--) V? PS+(+++) PE(--) Y(--)
PGP-(--) t* 5++>+++++ X+ R* tv+ b++(+++) DI
D++(---) G(++) e*>++ h+ !r--- !y--
------END GEEK CODE BLOCK------


Post a reply to this message

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