POV-Ray : Newsgroups : povray.windows : How to generate sphere and cylinder with csv file : Re: How to generate sphere and cylinder with csv file Server Time
25 Apr 2024 09:57:11 EDT (-0400)
  Re: How to generate sphere and cylinder with csv file  
From: Bald Eagle
Date: 27 Mar 2017 10:15:00
Message: <web.58d91d7eae95604bc437ac910@news.povray.org>
"Jeff" <jef### [at] gmailcom> wrote:

> so, i want to generate some spheres to represent the information in the csv file
> above,
> how do i generate different color of spheres for different mode,

So, real quick,

#include "colors.inc"
#if (variable = "bus")
  #declare Color = pigment {Red};
#else if (variable2 = "rail")

#else
#end

Write your data to a text file, use the #open, #read directives to read the
values in.

#declare a Y variable as that value.
same for the Z variable  (notice both are Uppercase)

searching for:  #read #write data from file
pulls up the following, with lots more

http://news.povray.org/povray.general/thread/%3Cweb.4d05993a67d8c71bd6b9b2630@news.povray.org%3E/?ttop=357624&toff=50

http://news.povray.org/povray.general/thread/%3Cweb.43886ab1919621bdcce6fd2b0@news.povray.org%3E/?ttop=330491&toff=1350




> then i use these information to generate cylinder and connect the it to sphere
> accordingly by using the "Source" column and "Target" column and the "length"
> column as the length of the cylinders.

Don't worry about the length, just use the coordinates of the 2 spheres as the
endpoint coordinates of the cylinder.

You're probably going to have to convert your values from long/lat to some
meaningful x,y,z coordinates (polar to Cartesian)


Post a reply to this message

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