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
21 Jun 2021 12:46:29 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")


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



> 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-2021 Persistence of Vision Raytracer Pty. Ltd.