import sys 

header = """ 
#include "colors.inc" 
camera {
   location <40,120,-200>  
   look_at <0,0,0> 
} 
// above and to the right of the camera 
light_source{ <50,90,-100> color White } 

// x axis 
cylinder {
  <-100,0, 0>
  <100, 0, 0> 
  1 
  pigment {color Green}
} 
// cone at end indicating positive direction
cone {
  <100,0,0> 5
  <110,0,0> 0 
  pigment {color Green} 
} 

// y axis 
cylinder {
  <0,-100, 0>
  <0, 100, 0> 
  1 
  pigment {color Red} 
} 
cone {
  <0,100,0> 5
  <0,110,0> 0 
  pigment {color Red} 
} 

// z axis 
cylinder {
  <0,0,-100>
  <0,0,100> 
  1
  pigment {color Blue} 
} 
cone {
  <0,0,100> 5
  <0,0,110> 0 
  pigment {color Blue} 
} 
"""

of = open(sys.argv[1], "w") 
of.write(header) 

side = 3 
for i in range(-100,100,10) :
    str = "polygon { 4, \n"
    
    for j in [(-side,-side), (-side,side), (side,side), (side,-side)] : 
        str += "  <%d, %d, %d>\n" % (i,j[0],j[1]) 
    str += "  pigment {color Green}\n}\n" 
    of.write(str) 

    str = "polygon { 4, \n"
    
    for j in [(-side,-side), (-side,side), (side,side), (side,-side)] : 
        str += "  <%d, %d, %d>\n" % (j[0],i,j[1]) 
    str += "  pigment {color Red}\n}\n" 
    of.write(str) 

    str = "polygon { 4, \n"
    
    for j in [(-side,-side), (-side,side), (side,side), (side,-side)] : 
        str += "  <%d, %d, %d>\n" % (j[0],j[1],i) 
    str += "  pigment {color Blue}\n}\n" 
    of.write(str) 
