def move_from_center(coord, centers, deltas, axmask=(True, True, True)):
 coord = copy.copy(coord)
 for i in range(3):
  if (not axmask[i]):
   continue
  if (coord[i] < centers[i]):
   coord[i] -= deltas[i]
  else:
   coord[i] += deltas[i]
 return coord

def move_from_center ( coord , centers , deltas , axmask = ( True , True , True ) ) : coord = copy . copy ( coord ) for i in range ( 3 ) : if ( not axmask [ i ] ) : continue if ( coord [ i ] < centers [ i ] ) : coord [ i ] -= deltas [ i ] else : coord [ i ] += deltas [ i ] return coord
return a coordinate that is moved by "deltas" away from the center .