def is_9DOF(self): tra, scale, rot, rot_axis = self.to_translation_scale_rotation() if tra is None: return False tra_mat = tr.translation_matrix(tra) scale_mat = numpy.diag([scale[0],scale[1],scale[2],1.0]) rot_mat = tr.rotation_matrix(rot,rot_axis) mat = numpy.dot(tra_mat, numpy.dot(scale_mat, rot_mat ) ) return tr.is_same_transform(mat,self.data)
def __init__(self, translation, rotation_angle, rotation_direction, rotation_point=None, map_from="",map_to=""): rot = tr.rotation_matrix(rotation_angle, rotation_direction, rotation_point) tra = tr.translation_matrix(translation) mat = numpy.dot(tra,rot) Transform_Affine.__init__(self, mat,map_from,map_to)
def __init__(self, angle, direction, point=None, map_from="",map_to=""): mat = tr.rotation_matrix(angle, direction, point) Transform_Affine.__init__(self, mat,map_from,map_to)
def from_translation_rotation(self, tra, rot, axis=[0,0,1]): return numpy.dot(tr.translation_matrix(tra), tr.rotation_matrix(rot,axis) )