def apply_trans(trans, pts, move=True):
 if isinstance(trans, dict):
  trans = trans['trans']
 trans = np.asarray(trans)
 pts = np.asarray(pts)
 if (pts.size == 0):
  return pts.copy()
 out_pts = np.dot(pts, trans[:3, :3].T)
 if (move is True):
  transl = trans[:3, 3]
  if np.any((transl != 0)):
   out_pts += transl
 return out_pts

def apply_trans ( trans , pts , move = True ) : if isinstance ( trans , dict ) : trans = trans [ 'trans' ] trans = np . asarray ( trans ) pts = np . asarray ( pts ) if ( pts . size == 0 ) : return pts . copy ( ) out_pts = np . dot ( pts , trans [ : 3 , : 3 ] . T ) if ( move is True ) : transl = trans [ : 3 , 3 ] if np . any ( ( transl != 0 ) ) : out_pts += transl return out_pts
apply a transform matrix to an array of points .