--- /home/sjplimp/oldpizza/src/svg.py 2005-10-12 09:34:02.000000000 -0600 +++ /home/sjplimp/pizza/src/svg.py 2005-10-12 09:31:46.000000000 -0600 @@ -18,14 +18,13 @@ s.bg("black") set background color (def = "black") s.size(N) set image size to NxN s.size(N,M) set image size to NxM -s.rotate(60,135) view from angle: z theta and azmth phi (def = 0,0) +s.rotate(60,135) view from z theta and azimuthal phi (def = 60,30) s.trans(x,y) translate by x,y in view window (def = 0,0) s.zoom(0.5) scale image by factor (def = 1) s.box(0/1/2) 0/1/2 = none/variable/fixed box s.box(0/1/2,"green") set box color s.box(0/1/2,"red",4) set box edge thickness s.file = "image" file prefix for created images (def = "image") -s.thick = 2.0 pixel thickness of black atom border s.show(N) show image of snapshot at timestep N @@ -77,6 +76,10 @@ colors["nickname"] = [R,G,B] set new RGB values from 0 to 255 140 pre-defined colors: red, green, blue, purple, yellow, black, white, etc + +Settings specific to svg tool: + +s.thick = 2.0 pixel thickness of black atom border """ # History @@ -92,23 +95,20 @@ # Variables # ztheta = vertical angle from z-azis to view from # azphi = azimuthal angle to view from -# xshift,yshift = user specified xy translation -# xtrans,ytrans,ztrans = xyz translation to view from -# distance = characteristic size of simulation scene (largest dim) +# xshift,yshift = xy translation of scene (in pixels) +# distance = size of simulation box (largest dim) # file = filename prefix to use for images produced # boxflag = 0/1/2 for drawing simulation box: none/variable/fixed # bxcol = color of box # bxthick = thickness of box # bgcol = color of background -# amap = settings for atom types -# tmap = settings for triangle types -# bmap = settings for bond types +# vizinfo = scene attributes # Imports and external programs import sys, os, commands, re from vizinfo import vizinfo -from math import sqrt,atan,cos,sin +from math import sqrt,atan,cos,sin,fabs try: from DEFAULTS import PIZZA_DISPLAY except: PIZZA_DISPLAY = "display" @@ -121,10 +121,12 @@ def __init__(self,data): self.data = data - self.ztheta = self.azphi = 0.0 - self.xtrans = self.ytrans = self.ztrans = 0.0 - self.xshift = self.yshift = 0.0 + self.max_x = 512 + self.max_y = 512 + self.ztheta = 60 + self.azphi = 30 self.scale = 1.0 + self.xshift = self.yshift = 0 self.file = "image" self.boxflag = 0 @@ -136,9 +138,6 @@ self.select = "" self.thick = 1.0 - self.max_x = 512 - self.max_y = 512 - self.vizinfo = vizinfo() self.adef() self.bdef()