POV-Ray : Newsgroups : povray.tools.general : Asking for a tool to transform .txt(x,y,z) data to POV format : Re: Asking for a tool to transform .txt(x,y,z) data to POV format Server Time
21 Sep 2021 06:41:53 EDT (-0400)
  Re: Asking for a tool to transform .txt(x,y,z) data to POV format  
From: tth
Date: 25 May 2016 05:00:03
Message: <57456993$1@news.povray.org>
On 05/24/2016 11:07 AM, Mengshi a dit:
>> What is the typical file size and number of points? If you have a small
>> example it would help.
>> --
>>
>> Regards
>>       Stephen
>
> It just a cloud of points, about 4162388 points.
>
> Like:
> data.csv
>
> X Y Z
> 35174.97656250 446497.71875000 -0.569999
> 35174.97656250 446497.71875000 8.0200046
> 35174.97656250 446497.71875000 6.2580003
> .......

tth@serviette:/tmp$ c### [at] datacsv
X Y Z
35174.97656250 446497.71875000 -0.569999
35174.97656250 446497.71875000 8.0200046
35174.97656250 446497.71875000 6.2580003
tth@serviette:/tmp$ c### [at] scriptawk
#!/usr/bin/awk -f

BEGIN   { print "union {"; }

NR!=1   {
         printf "sphere { <%f, %f, %f>, DSPHERE }\n", $1, $2, $3;
         }

END     { print "}"; }
tth@serviette:/tmp$ ./script.awk < d### [at] acsv
union {
sphere { <35174.976562, 446497.718750, -0.569999>, DSPHERE }
sphere { <35174.976562, 446497.718750, 8.020005>, DSPHERE }
sphere { <35174.976562, 446497.718750, 6.258000>, DSPHERE }
}


-- 
http://weblog.mixart-myrys.org/?post/2016/03/De-la-temporalisation


Post a reply to this message

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