speed up as_pattern()
mainly used by `flatten()`
This commit is contained in:
parent
97db83a1d5
commit
67d312162a
@ -139,10 +139,15 @@ class SubPattern(PositionableImpl, DoseableImpl, RotatableImpl, ScalableImpl, Mi
|
|||||||
"""
|
"""
|
||||||
assert(self.pattern is not None)
|
assert(self.pattern is not None)
|
||||||
pattern = self.pattern.deepcopy().deepunlock()
|
pattern = self.pattern.deepcopy().deepunlock()
|
||||||
|
if self.scale != 1:
|
||||||
pattern.scale_by(self.scale)
|
pattern.scale_by(self.scale)
|
||||||
|
if numpy.any(self.mirrored):
|
||||||
pattern.mirror2d(self.mirrored)
|
pattern.mirror2d(self.mirrored)
|
||||||
|
if self.rotation % (2 * pi) != 0:
|
||||||
pattern.rotate_around((0.0, 0.0), self.rotation)
|
pattern.rotate_around((0.0, 0.0), self.rotation)
|
||||||
|
if numpy.any(self.offset):
|
||||||
pattern.translate_elements(self.offset)
|
pattern.translate_elements(self.offset)
|
||||||
|
if self.dose != 0:
|
||||||
pattern.scale_element_doses(self.dose)
|
pattern.scale_element_doses(self.dose)
|
||||||
|
|
||||||
if self.repetition is not None:
|
if self.repetition is not None:
|
||||||
|
Loading…
Reference in New Issue
Block a user