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
23 Jun 2021 01:44:51 EDT (-0400)
  Re: How to generate sphere and cylinder with csv file  
From: Jeff
Date: 28 Mar 2017 07:25:00
Message: <web.58da47d9ae95604b4de507a60@news.povray.org>
From: "Jeff" <jef### [at] gmailcom>
Newsgroups: povray.windows
Subject: Re: How to generate sphere and cylinder with csv file

"Bald Eagle" <cre### [at] netscapenet> wrote:
> 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

> 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)

hi, if i open the .csv file , and save it as .txt file, will that do the
conversion? and i have like 1000+ sphere that i need to generate from the data,
is there any efficient way to do it, instead of write down the sphere position?
so, is this the way to do it? hey, i want to talk more detail about, and i need
your help. here is my email: jef### [at] gmailcom. thanks before :)

#include "colors.inc"
#declare myImage = image{ png "C:\\Users\\Jeff\\Desktop\\beijing.png" }

#fopen nodesfile "nodes.txt" read
#fopen linksfile "links.txt" read
  #while (defined(nodesfile))
    #read (nodesfile,Var1,Var2,Var3,Var4)

#if (Var1 = "bus")
    #declare Color = pigment {Red};
#else if (Var2 = "subway")
    #declare Color = pigment {Green};
#else if (Var3 = "rail")
    #declare Color = pigment {Blue};
#else (Var4 = "tram")
    #declare Color = pigment {Yellow};

{ location <0,0,-10>
  look_at 0
  rotate <0,clock*360,0>

light_source    {
                color White

Post a reply to this message

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