def rotate(self, angle, cval=0): self.data = scp_rotate(self.data, angle, reshape=False, order=0, mode='wrap', prefilter=False)
def rotate(self, angle, cval=0): self.data = scp_rotate(self.data, angle, reshape=False, order=0, mode='constant', cval=cval, prefilter=False)
def rotate(self, angle, cval=0): tmp = self.data.copy() tmp = np.array(tmp) tmp = scp_rotate(tmp, angle, reshape=False, order=0, mode='constant', cval=cval, prefilter=False) self.data = Image.fromarray(tmp)
def rotate(self, angle, cval=0): # rotating around Z axis does not affect Z normal rad_angle = np.deg2rad(angle) cos_angle = np.cos(rad_angle) sin_angle = np.sin(rad_angle) self.data[ ..., 0] = self.data[..., 0] * cos_angle - self.data[..., 1] * sin_angle self.data[ ..., 1] = self.data[..., 0] * sin_angle + self.data[..., 1] * cos_angle # normals # self.data = scp_rotate(self.data, angle, reshape=False, order=0, mode='constant', cval=cval, prefilter=False) self.data = scp_rotate(self.data, angle, reshape=False, order=0, mode='wrap', prefilter=False)