disty = min(math.fabs(pcy-boty), math.fabs(pcy-topy)) distz = min(math.fabs(pcz-botz), math.fabs(pcz-topz)) #print min(distx, disty, distz), 2.0 * common.R if (min(distx, disty, distz) > (2.0 * common.R)): nanoparticles.append(nanop) print >> sys.stderr, "Near done" radius = {'O':0.60, 'Ti':1.40} for selectedid in range(len(nanoparticles)): nanop = nanoparticles[selectedid] pcx, pcy, pcz = nanop.get_center() nearnanop, neardst = nanoparticle.get_near_nanoparticle (nanoparticles, \ pcx, pcy, pcz, (2.0 * nanop.get_max_sphere())) count = 1 for a in range(len(nearnanop)): for b in range(len(nearnanop)): if (a != b): xlistnew, ylistnew, zlistnew = return_rototransl_xyz(nearnanop[a], xlist, ylist, zlist) n = len(nearnanop) print "running ", count , " of ", n**2-n todo = False xlistnewa = [] ylistnewa = [] zlistnewa = []
topx = max(scx) topy = max(scy) topz = max(scz) if (botx >= topx) or (boty >= topy) or \ (boty >= topy): print "Error Invalid BOX" exit() if (selected_nanaop >= len(scx)): print "error invalid particle selected " exit() dist = 0.0 selected, distance = nanoparticle.get_near_nanoparticle(nanoparticles, \ scx[selected_nanaop], scy[selected_nanaop], \ scz[selected_nanaop], dist) minbox_x = 100000.0 maxbox_x = -100000.0 minbox_y = 100000.0 maxbox_y = -100000.0 minbox_z = 100000.0 maxbox_z = -100000.0 i = 0 for nanop in selected: cx, cy, cz = nanop.get_center() A, B, H = nanop.get_dimensions() #nanop.is_point_inside([cx, cy, cz+0.5])