Example #1
0
 def make_crystal(self):
   if('crystal' not in self.data.keys() or len(self.data['crystal']) == 0):
     return ''
   for c in self.data['crystal']:
     cmd = crystal.make(c)
     if(len(cmd)>0):
       for line in cmd:
         self.data = read.read_line(self.data, line)
Example #2
0
  def make_colour_background(self):
  
    if(self.space['background'].strip().upper() != 'COLOUR'):
      return ''

   
    xa, ya, za = 0, 0, 0
    xb, yb, zb = 0, 0, 1  
    xc, yc, zc = 0, 1, 1  
    xd, yd, zd = 0, 1, 0
    line =  'fill layer=1 colour=#336699 shade=10 '
    line += 'xa=' + str(xa) + ' ya=' + str(ya) + ' za=' + str(za) + ' '
    line += 'xb=' + str(xb) + ' yb=' + str(yb) + ' zb=' + str(zb) + ' '
    line += 'xc=' + str(xc) + ' yc=' + str(yc) + ' zc=' + str(zc) + ' '
    line += 'xd=' + str(xd) + ' yd=' + str(yd) + ' zd=' + str(zd) + ' '
    self.data = read.read_line(self.data, line)
    
    xa, ya, za = 0, 0, 0
    xb, yb, zb = 0, 1, 0  
    xc, yc, zc = 1, 1, 0  
    xd, yd, zd = 1, 0, 0  
    line =  'fill layer=1 colour=#336699 shade=15 '
    line += 'xa=' + str(xa) + ' ya=' + str(ya) + ' za=' + str(za) + ' '
    line += 'xb=' + str(xb) + ' yb=' + str(yb) + ' zb=' + str(zb) + ' '
    line += 'xc=' + str(xc) + ' yc=' + str(yc) + ' zc=' + str(zc) + ' '
    line += 'xd=' + str(xd) + ' yd=' + str(yd) + ' zd=' + str(zd) + ' '    
    self.data = read.read_line(self.data, line)
    
    xa, ya, za = 0, 0, 0
    xb, yb, zb = 1, 0, 0  
    xc, yc, zc = 1, 0, 1  
    xd, yd, zd = 0, 0, 1
    line =  'fill layer=1 colour=#336699 shade=30 '
    line += 'xa=' + str(xa) + ' ya=' + str(ya) + ' za=' + str(za) + ' '
    line += 'xb=' + str(xb) + ' yb=' + str(yb) + ' zb=' + str(zb) + ' '
    line += 'xc=' + str(xc) + ' yc=' + str(yc) + ' zc=' + str(zc) + ' '
    line += 'xd=' + str(xd) + ' yd=' + str(yd) + ' zd=' + str(zd) + ' '    
    self.data = read.read_line(self.data, line)
Example #3
0
  def make_axis(self):
    print("make")
    xa, ya, za = self.transform_space(0, 0, 0)
    xb, yb, zb = self.transform_space(1, 0, 0)  
    line = 'line colour=#000000 type=dashed layer=2 xa=' + str(xa) + ' ya=' + str(ya) + ' za=' + str(za) + ' xb=' + str(xb) + ' yb=' + str(yb) + ' zb=' + str(zb) + ''
    self.data = read.read_line(self.data, line)
    
    xa, ya, za = self.transform_space(0, 0, 0)
    xb, yb, zb = self.transform_space(0, 1, 0)  
    line = 'line colour=#000000 type=dashed layer=2 xa=' + str(xa) + ' ya=' + str(ya) + ' za=' + str(za) + ' xb=' + str(xb) + ' yb=' + str(yb) + ' zb=' + str(zb) + ''
    self.data = read.read_line(self.data, line)
  
    xa, ya, za = self.transform_space(0, 0, 0)
    xb, yb, zb = self.transform_space(0, 0, 1)  
    line = 'line colour=#000000 type=dashed layer=2 xa=' + str(xa) + ' ya=' + str(ya) + ' za=' + str(za) + ' xb=' + str(xb) + ' yb=' + str(yb) + ' zb=' + str(zb) + ''
    self.data = read.read_line(self.data, line)
    
    xa, ya, za = self.transform_space(0, 0, 0)
    xb, yb, zb = self.transform_space(0, 0, 1)  
    xc, yc, zc = self.transform_space(0, 1, 1)  
    xd, yd, zd = self.transform_space(0, 1, 0)  
    line =  'fill layer=1 colour=#336699 shade=10 '
    line += 'xa=' + str(xa) + ' ya=' + str(ya) + ' za=' + str(za) + ' '
    line += 'xb=' + str(xb) + ' yb=' + str(yb) + ' zb=' + str(zb) + ' '
    line += 'xc=' + str(xc) + ' yc=' + str(yc) + ' zc=' + str(zc) + ' '
    line += 'xd=' + str(xd) + ' yd=' + str(yd) + ' zd=' + str(zd) + ' '
    self.data = read.read_line(self.data, line)
    
    xa, ya, za = self.transform_space(0, 0, 0)
    xb, yb, zb = self.transform_space(0, 1, 0)  
    xc, yc, zc = self.transform_space(1, 1, 0)  
    xd, yd, zd = self.transform_space(1, 0, 0)  
    line =  'fill layer=1 colour=#336699 shade=15 '
    line += 'xa=' + str(xa) + ' ya=' + str(ya) + ' za=' + str(za) + ' '
    line += 'xb=' + str(xb) + ' yb=' + str(yb) + ' zb=' + str(zb) + ' '
    line += 'xc=' + str(xc) + ' yc=' + str(yc) + ' zc=' + str(zc) + ' '
    line += 'xd=' + str(xd) + ' yd=' + str(yd) + ' zd=' + str(zd) + ' '    
    self.data = read.read_line(self.data, line)
    
    xa, ya, za = self.transform_space(0, 0, 0)
    xb, yb, zb = self.transform_space(1, 0, 0)  
    xc, yc, zc = self.transform_space(1, 0, 1)  
    xd, yd, zd = self.transform_space(0, 0, 1)  
    line =  'fill layer=1 colour=#336699 shade=30 '
    line += 'xa=' + str(xa) + ' ya=' + str(ya) + ' za=' + str(za) + ' '
    line += 'xb=' + str(xb) + ' yb=' + str(yb) + ' zb=' + str(zb) + ' '
    line += 'xc=' + str(xc) + ' yc=' + str(yc) + ' zc=' + str(zc) + ' '
    line += 'xd=' + str(xd) + ' yd=' + str(yd) + ' zd=' + str(zd) + ' '    
    self.data = read.read_line(self.data, line)
  
    xa, ya, za = self.transform_space(1, 0, 0)
    xb, yb, zb = self.transform_space(1, 0, 1)  
    line = 'line colour=#000000 type=solid layer=2 xa=' + str(xa) + ' ya=' + str(ya) + ' za=' + str(za) + ' xb=' + str(xb) + ' yb=' + str(yb) + ' zb=' + str(zb) + ''
    self.data = read.read_line(self.data, line)
  
    xa, ya, za = self.transform_space(1, 0, 1)
    xb, yb, zb = self.transform_space(0, 0, 1)  
    line = 'line colour=#000000 type=solid layer=2 xa=' + str(xa) + ' ya=' + str(ya) + ' za=' + str(za) + ' xb=' + str(xb) + ' yb=' + str(yb) + ' zb=' + str(zb) + ''
    self.data = read.read_line(self.data, line)
  
    xa, ya, za = self.transform_space(0, 0, 1)
    xb, yb, zb = self.transform_space(0, 1, 1)  
    line = 'line colour=#000000 type=solid layer=2 xa=' + str(xa) + ' ya=' + str(ya) + ' za=' + str(za) + ' xb=' + str(xb) + ' yb=' + str(yb) + ' zb=' + str(zb) + ''
    self.data = read.read_line(self.data, line)
  
    xa, ya, za = self.transform_space(0, 1, 1)
    xb, yb, zb = self.transform_space(0, 1, 0)  
    line = 'line colour=#000000 type=solid layer=2 xa=' + str(xa) + ' ya=' + str(ya) + ' za=' + str(za) + ' xb=' + str(xb) + ' yb=' + str(yb) + ' zb=' + str(zb) + ''
    self.data = read.read_line(self.data, line)
  
    xa, ya, za = self.transform_space(0, 1, 0)
    xb, yb, zb = self.transform_space(1, 1, 0)  
    line = 'line colour=#000000 type=solid layer=2 xa=' + str(xa) + ' ya=' + str(ya) + ' za=' + str(za) + ' xb=' + str(xb) + ' yb=' + str(yb) + ' zb=' + str(zb) + ''
    self.data = read.read_line(self.data, line)
  
    xa, ya, za = self.transform_space(1, 1, 0)
    xb, yb, zb = self.transform_space(1, 0, 0)  
    line = 'line colour=#000000 type=solid layer=2 xa=' + str(xa) + ' ya=' + str(ya) + ' za=' + str(za) + ' xb=' + str(xb) + ' yb=' + str(yb) + ' zb=' + str(zb) + ''
    self.data = read.read_line(self.data, line)
    
    
  
    xa, ya, za = self.transform_space(1, 1, 1)
    xb, yb, zb = self.transform_space(1, 0, 1)  
    line = 'line colour=#000000 type=solid layer=2 xa=' + str(xa) + ' ya=' + str(ya) + ' za=' + str(za) + ' xb=' + str(xb) + ' yb=' + str(yb) + ' zb=' + str(zb) + ''
    self.data = read.read_line(self.data, line)  

    xa, ya, za = self.transform_space(1, 1, 1)
    xb, yb, zb = self.transform_space(0, 1, 1)  
    line = 'line colour=#000000 type=solid layer=2 xa=' + str(xa) + ' ya=' + str(ya) + ' za=' + str(za) + ' xb=' + str(xb) + ' yb=' + str(yb) + ' zb=' + str(zb) + ''
    self.data = read.read_line(self.data, line)  

    xa, ya, za = self.transform_space(1, 1, 1)
    xb, yb, zb = self.transform_space(1, 1, 0)  
    line = 'line colour=#000000 type=solid layer=2 xa=' + str(xa) + ' ya=' + str(ya) + ' za=' + str(za) + ' xb=' + str(xb) + ' yb=' + str(yb) + ' zb=' + str(zb) + ''
    self.data = read.read_line(self.data, line)
Example #4
0
 def make_grid(self):
   cmd = grid.make(self.grid)
   if(len(cmd)>0):
     for line in cmd:
       self.data = read.read_line(self.data, line)