def crystal_surface_family(Mil_ind): ''' determine all the equivalent crystal planes of the crystal plane family in the 32 point group. input: Mil_ind: Miller indices of crystallographic planes. return: f: crystal plane family. ''' cc1 = CC.CrystalClass32() f = [] for index in Mil_ind: family = cc1.plane_family(index) f.append(family) return f
def crystal_plane(hkl): ''' return the geometric planes of the polyhedron, where the 32 point group is considered, and the lattice parameter is taken as 0.4nm. hkl: Miller indices of crystallographic planes. ''' b1 = basis.cubic(0.4) # unit: nm cc1 = CC.CrystalClass32() latt = CrystalLattice(b1, cc1) planes = [] number_planes = [] for index in hkl: pf = latt.geometric_plane_family(index) number_planes.append(len(pf)) planes.extend(pf) return planes, number_planes
number_planes1 = [] for index in [[1,2,3], [1,1,0], [2,1,0], [3,3,1], [1,0,0], [1,1,1]]: pf = latt.geometric_plane_family(index) number_planes1.append(len(pf)) planes1.extend(pf) #set distances of the planes ps_setd_mingled(number_planes1, planes1, [2.0, 2.0, 2.0, 2.0, 2.0, 2.0]) diameter = 10.0 # unit: nm volume = 4.0/3.0*np.pi* (diameter*0.5)**3 qfp = enclose_polyhedron(number_planes1, planes1, volume) print "q=", qfp[0] print "f=", qfp[1] print "numbers of points are", [len(p) for p in qfp[2]] latt2 = CrystalLattice(b1, CC.CrystalClass32()) f = shape_by_f([0.25, 0.75], latt2, [[0,0,1], [1,1,1]], 10.0, [1.0, 1.0]) print "shape by f", f ps = ps_by_family([[0,0,1], [1,1,1]], latt2) ps_setd_mingled(ps[0], ps[1], f) qfp2 = enclose_polyhedron(ps[0], ps[1], 10.0) print "q2=", qfp2[0] print "f2=", qfp2[1]