Changes to rotate method to allow grid information (dx,dy,dz) to be passed in.

这个提交包含在:
Craig Warren
2020-11-17 16:44:30 +00:00
父节点 aac52efd4f
当前提交 05d56b316c
共有 11 个文件被更改,包括 188 次插入33 次删除

查看文件

@@ -54,8 +54,16 @@ class FractalBox(UserObjectGeometry):
self.hash = '#fractal_box'
def rotate(self, axis, angle, origin=None):
"""Set parameters for rotation."""
self.axis = axis
self.angle = angle
self.origin = origin
self.dorotate = True
def __dorotate(self):
"""Perform rotation."""
pts = np.array([self.kwargs['p1'], self.kwargs['p2']])
rot_pts = rotate_2point_object(pts, axis, angle, origin)
rot_pts = rotate_2point_object(pts, self.axis, self.angle, self.origin)
self.kwargs['p1'] = tuple(rot_pts[0, :])
self.kwargs['p2'] = tuple(rot_pts[1, :])
@@ -77,6 +85,9 @@ class FractalBox(UserObjectGeometry):
except KeyError:
seed = None
if self.dorotate:
self.__dorotate()
# Default is no dielectric smoothing for a fractal box
averagefractalbox = False