def create_randomized_model(num,dir=dir): lattice_param = 1 perfect = icosahedron(lattice_param,save=True,filename='icosahedron.perfect.xyz') perfect.write(perfect.filename) return 0 for i in range(num): print(i) a = random.uniform(0,360) b = random.uniform(0,360) c = random.uniform(0,360) #a = random.randrange(0,345,15) #b = random.randrange(0,345,15) #c = random.randrange(0,345,15) imperfect = copy.deepcopy(perfect) perturb_atom(imperfect,axis='all') #swap_atom(imperfect) imperfect.write_real_xyz(dir+'icosahedron.{0}.random.xyz'.format(i)) convert(imperfect,'polyhedron',dir+'icosahedron.{0}.random.txt'.format(i)) rotate(imperfect, a, b, c, degree=True) imperfect.write_real_xyz(dir+'icosahedron.{0}.random.rot.xyz'.format(i)) convert(imperfect,'polyhedron',dir+'icosahedron.{0}.random.rot.txt'.format(i))
def rotate(self, array=None, alpha=None, beta=None, gamma=None, degree=True, invert=True): rotate_3d.rotate(self, array, alpha, beta, gamma, degree, invert)