# 1st pyramid
u = [ .5, -.5*sqrt(3), 0 ]
v = [ .5, .5/sqrt(3), sqrt(6)/3. ] 
atoms.extend( make_pyramid(u, v, length) )

# 2nd pyramid
u = [ -1, 0,0 ] 
v = [ 0, -1/sqrt(3), sqrt(6)/3. ] 
atoms.extend( make_pyramid(u, v, length) )

# 3rd pyramid
u = [ .5, .5*sqrt(3), 0 ]
v = [ -.5, .5/sqrt(3), sqrt(6)/3. ] 
atoms.extend( make_pyramid(u, v, length) )

# mirror and rotate!
atoms = vstack((atoms, 
                mirrorZ_rotateZ(atoms))
                )

# remove the overlapping coordinates!
atoms = remove_overlapping( atoms)

# save the beautiful cuboctahedron! 
#    awww its so cute  ^.^
atoms_txt = [ 'Au ' + ' '.join(map(str,a)) 
                    for a in atoms]
savetxt('cuboctahedron_10.xyz', atoms_txt, fmt='%s')

#dermen
예제 #2
0
####################
# MAKE A DECAHEDRON
###################
# pure fcc
beta = 70.53 * pi / 180.

# load all the atoms we saved
xyz0 = loadtxt(outfile_pre+'.coor')[:,:3]
# apply rotations
xyz1 = dot( rot_y(beta), xyz0.T).T
xyz2 = dot( rot_y(beta), xyz1.T).T
xyz3 = dot( rot_y(beta), xyz2.T).T
xyz4 = dot( rot_y(beta), xyz3.T).T

xyz_all = vstack( ( xyz0, xyz1, xyz2 , xyz3, xyz4 ) ) 
xyz_all = remove_overlapping(xyz_all)



Z_all = ones( (xyz_all.shape[0], 1 ) )* Z_gold

# save x,y,z,atomZ in a .coor file (decahedron)
xyz_atomZ = hstack((xyz_all, Z_all) )
savetxt(outfile_pre+'2.coor', xyz_atomZ )

# save an xyz file for viewing in PyMol
xyz_file = open(outfile_pre+'.xyz', 'w')
for i in xrange(xyz_all.shape[0]):
    print>> xyz_file, "Au",\
            xyz_all[i,0],\
            xyz_all[i,1],\