Commit 1d29a83c authored by Frederik Zahle's avatar Frederik Zahle

Merge branch 'rot_fix' into 'master'

copy rot when converting to radians

See merge request !33
parents 68fa424a 48ccb599
Pipeline #16879 failed with stages
in 5 minutes and 25 seconds
......@@ -323,8 +323,8 @@ class Curve(object):
def _rotate(self, deg, Rot, center):
if isinstance(center, type(None)):
center = np.zeros([self.nd])
deg *= deg2rad
rot = Rot(deg)[:self.nd, :self.nd]
degrad = deg * deg2rad
rot = Rot(degrad)[:self.nd, :self.nd]
points = dotX(rot, (self.points - center), trans_vect=np.zeros([self.nd])) + center
self.initialize(points)
......
......@@ -1309,13 +1309,13 @@ class Block(object):
def _rotate(self, deg, center, Rot):
deg *= deg2rad
degrad = deg * deg2rad
#xt = np.array([self.x.flatten(),self.y.flatten(),self.z.flatten()]).swapaxes(0,1)
xt = np.zeros((self.ni*self.nj*self.nk,3), dtype=self.x.dtype)
xt[:,0] = self.x.flatten(order='F')
xt[:,1] = self.y.flatten(order='F')
xt[:,2] = self.z.flatten(order='F')
x = dotX(Rot(deg), xt - center) + center
x = dotX(Rot(degrad), xt - center) + center
# split into x, y, z and reshape into ni, nj, nk
self.x = x[:,0].reshape(self.nk,self.nj,self.ni).swapaxes(0,2)
self.y = x[:,1].reshape(self.nk,self.nj,self.ni).swapaxes(0,2)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment