本文整理匯總了Python中texture.Texture.outlined_circle方法的典型用法代碼示例。如果您正苦於以下問題:Python Texture.outlined_circle方法的具體用法?Python Texture.outlined_circle怎麽用?Python Texture.outlined_circle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類texture.Texture
的用法示例。
在下文中一共展示了Texture.outlined_circle方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: read
# 需要導入模塊: from texture import Texture [as 別名]
# 或者: from texture.Texture import outlined_circle [as 別名]
# /,_/ '`-'
from ase.io import read
from ase.data import covalent_radii as cr
from ase.data.colors import jmol_colors as colors_us
import numpy as np
a = read("POSCAR")
zoom = 30
x, y, z = a.get_cell()
Tex = Texture(int(x[0]*zoom), int(y[1]*zoom))
colors = []
for col in colors_us:
r, g, b = col
color = (255, int(r*255), int(g*255), int(b*255))
colors.append(color)
for x, atom in enumerate(a):
print x
num = atom.number
color = colors[num]
radius = int(cr[num] * zoom)
x = atom.position[0]*zoom
y = atom.position[1]*zoom
depth = -atom.position[2]*zoom
Tex.outlined_circle(x, y, radius, color, depth = depth)
Tex.save("test.png")
Tex.saveDepth("depth.png")