POV-Ray : Newsgroups : povray.newusers : X,Y,Z Server Time
25 Nov 2024 11:25:09 EST (-0500)
  X,Y,Z (Message 1 to 4 of 4)  
From: Rolandd
Subject: X,Y,Z
Date: 1 Dec 2005 20:45:01
Message: <web.438fa667f547a5ea35360b230@news.povray.org>
I have many (thousands) of coordinates in an ascii file in the format:

x,y,z
x,y,z
x,y,z
....

Is there a utility that will allow me to create a .pov file from these
coordinates and represent them as small spheres?  I have tried openbabel
but it doesn't appear to support a text file in this format or for the most
recent version of PovRay.  I am ready to write a python script to do this
but I wanted to check first.

All The Best,
Roland


Post a reply to this message

From: Kyle
Subject: Re: X,Y,Z
Date: 1 Dec 2005 21:12:05
Message: <83bvo1h2usnds24c0ib77h6p4uau99gpoa@4ax.com>
>Is there a utility that will allow me to create a .pov file from these
>coordinates and represent them as small spheres?

You should be able to do this right in POV-Ray.  Use the #fopen
directive to open the file, then use the #read directive in a #while
loop to read the values.  You can create the spheres in the loop also.
Look for #read in the POV-Ray help file.


Kyle


Post a reply to this message

From: Mike Williams
Subject: Re: X,Y,Z
Date: 2 Dec 2005 00:48:05
Message: <7aCN5RA6+9jDFw4y@econym.demon.co.uk>
Wasn't it Rolandd who wrote:
>I have many (thousands) of coordinates in an ascii file in the format:
>
>x,y,z
>x,y,z
>x,y,z
>....
>
>Is there a utility that will allow me to create a .pov file from these
>coordinates and represent them as small spheres?  I have tried openbabel
>but it doesn't appear to support a text file in this format or for the most
>recent version of PovRay.  I am ready to write a python script to do this
>but I wanted to check first.

You'll need to convert that format to

x,y,z,
x,y,z,
x,y,z,
...

before you can read it directly with POV. The #read command in POV
requires the comma to be present between values even if they're on
different lines.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Christoph Hormann
Subject: Re: X,Y,Z
Date: 2 Dec 2005 04:18:38
Message: <dmp3ih$jb9$1@chho.imagico.de>
Rolandd wrote:
> I have many (thousands) of coordinates in an ascii file in the format:
> 
> x,y,z
> x,y,z
> x,y,z
> ....
> 
> Is there a utility that will allow me to create a .pov file from these
> coordinates and represent them as small spheres?

sed "s?^?sphere{<?;s?\$?>,RADIUS}?"

Christoph

-- 
POV-Ray tutorials, include files, Landscape of the week:
http://www.imagico.de/ (Last updated 31 Oct. 2005)
MegaPOV with mechanics simulation: http://megapov.inetart.net/


Post a reply to this message

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