Exemplo n.º 1
0
    def __init__(self, atoms, scale=1.0, **parameters):
        for k, v in self.default_settings.items():
            setattr(self, k, parameters.pop(k, v))
        PlottingVariables.__init__(self, atoms, scale=scale, **parameters)
        constr = atoms.constraints
        self.constrainatoms = []
        for c in constr:
            if isinstance(c, FixAtoms):
                for n, i in enumerate(c.index):
                    self.constrainatoms += [i]

        self.material_styles_dict = {
            'simple':
            'finish {phong 0.7}',
            'pale':
            'finish {ambient 0.5 diffuse 0.85 roughness 0.001 specular 0.200 }',
            'intermediate':
            'finish {ambient 0.3 diffuse 0.6 specular 0.1 roughness 0.04}',
            'vmd':
            'finish {ambient 0.0 diffuse 0.65 phong 0.1 phong_size 40.0 specular 0.5 }',
            'jmol':
            'finish {ambient 0.2 diffuse 0.6 specular 1 roughness 0.001 metallic}',
            'ase2':
            'finish {ambient 0.05 brilliance 3 diffuse 0.6 metallic specular 0.7 roughness 0.04 reflection 0.15}',
            'ase3':
            'finish {ambient 0.15 brilliance 2 diffuse 0.6 metallic specular 1.0 roughness 0.001 reflection 0.0}',
            'glass':
            'finish {ambient 0.05 diffuse 0.3 specular 1.0 roughness 0.001}',
            'glass2':
            'finish {ambient 0.01 diffuse 0.3 specular 1.0 reflection 0.25 roughness 0.001}'
        }
Exemplo n.º 2
0
    def __init__(self,
                 atoms,
                 ax,
                 rotation='',
                 radii=None,
                 colors=None,
                 scale=1,
                 offset=(0, 0),
                 **parameters):
        PlottingVariables.__init__(self,
                                   atoms,
                                   rotation=rotation,
                                   radii=radii,
                                   colors=colors,
                                   scale=scale,
                                   extra_offset=offset,
                                   **parameters)

        self.ax = ax
        self.figure = ax.figure
        self.ax.set_aspect('equal')
Exemplo n.º 3
0
    def __init__(self,
                 atoms,
                 rotation='',
                 radii=None,
                 bbox=None,
                 colors=None,
                 scale=20,
                 maxwidth=500,
                 **kwargs):
        """Encapsulated PostScript writer.

        show_unit_cell: int
            0: Don't show unit cell (default).  1: Show unit cell.
            2: Show unit cell and make sure all of it is visible.
        """
        PlottingVariables.__init__(self,
                                   atoms,
                                   rotation=rotation,
                                   radii=radii,
                                   bbox=bbox,
                                   colors=colors,
                                   scale=scale,
                                   maxwidth=maxwidth,
                                   **kwargs)