diff --git a/masque/shapes/arc.py b/masque/shapes/arc.py index a33d0d7..4918ea7 100644 --- a/masque/shapes/arc.py +++ b/masque/shapes/arc.py @@ -160,20 +160,32 @@ class Arc(Shape, metaclass=AutoSlots): layer: layer_t = 0, dose: float = 1.0, repetition: Optional[Repetition] = None, - locked: bool = False): + locked: bool = False, + raw: bool = False, + ): object.__setattr__(self, 'locked', False) self.identifier = () - self.radii = radii - self.angles = angles - self.width = width - self.offset = offset - self.rotation = rotation - [self.mirror(a) for a, do in enumerate(mirrored) if do] - self.layer = layer - self.dose = dose + if raw: + self._radii = radii + self._angles = angles + self._width = width + self._offset = offset + self._rotation = rotation + self._repetition = repetition + self._layer = layer + self._dose = dose + else: + self.radii = radii + self.angles = angles + self.width = width + self.offset = offset + self.rotation = rotation + self.repetition = repetition + self.layer = layer + self.dose = dose self.poly_num_points = poly_num_points self.poly_max_arclen = poly_max_arclen - self.repetition = repetition + [self.mirror(a) for a, do in enumerate(mirrored) if do] self.locked = locked def __deepcopy__(self, memo: Dict = None) -> 'Arc': diff --git a/masque/shapes/ellipse.py b/masque/shapes/ellipse.py index f4cc683..e3836a1 100644 --- a/masque/shapes/ellipse.py +++ b/masque/shapes/ellipse.py @@ -95,18 +95,28 @@ class Ellipse(Shape, metaclass=AutoSlots): layer: layer_t = 0, dose: float = 1.0, repetition: Optional[Repetition] = None, - locked: bool = False): + locked: bool = False, + raw: bool = False, + ): object.__setattr__(self, 'locked', False) self.identifier = () - self.radii = radii - self.offset = offset - self.rotation = rotation + if raw: + self._radii = radii + self._offset = offset + self._rotation = rotation + self._repetition = repetition + self._layer = layer + self._dose = dose + else: + self.radii = radii + self.offset = offset + self.rotation = rotation + self.repetition = repetition + self.layer = layer + self.dose = dose [self.mirror(a) for a, do in enumerate(mirrored) if do] - self.layer = layer - self.dose = dose self.poly_num_points = poly_num_points self.poly_max_arclen = poly_max_arclen - self.repetition = repetition self.locked = locked def __deepcopy__(self, memo: Dict = None) -> 'Ellipse': diff --git a/masque/shapes/path.py b/masque/shapes/path.py index 15b1ead..3f2f72f 100644 --- a/masque/shapes/path.py +++ b/masque/shapes/path.py @@ -150,22 +150,32 @@ class Path(Shape, metaclass=AutoSlots): dose: float = 1.0, repetition: Optional[Repetition] = None, locked: bool = False, + raw: bool = False, ): object.__setattr__(self, 'locked', False) self._cap_extensions = None # Since .cap setter might access it self.identifier = () - self.offset = offset - self.layer = layer - self.dose = dose - self.vertices = vertices - self.width = width - self.cap = cap - if cap_extensions is not None: + if raw: + self._vertices = vertices + self._offset = offset + self._repetition = repetition + self._layer = layer + self._dose = dose + self._width = width + self._cap = cap + self._cap_extensions = cap_extensions + else: + self.vertices = vertices + self.offset = offset + self.repetition = repetition + self.layer = layer + self.dose = dose + self.width = width + self.cap = cap self.cap_extensions = cap_extensions self.rotate(rotation) [self.mirror(a) for a, do in enumerate(mirrored) if do] - self.repetition = repetition self.locked = locked def __deepcopy__(self, memo: Dict = None) -> 'Path': diff --git a/masque/shapes/polygon.py b/masque/shapes/polygon.py index cee5780..08da89e 100644 --- a/masque/shapes/polygon.py +++ b/masque/shapes/polygon.py @@ -78,16 +78,24 @@ class Polygon(Shape, metaclass=AutoSlots): dose: float = 1.0, repetition: Optional[Repetition] = None, locked: bool = False, + raw: bool = False, ): object.__setattr__(self, 'locked', False) self.identifier = () - self.layer = layer - self.dose = dose - self.vertices = vertices - self.offset = offset + if raw: + self._vertices = vertices + self._offset = offset + self._repetition = repetition + self._layer = layer + self._dose = dose + else: + self.vertices = vertices + self.offset = offset + self.repetition = repetition + self.layer = layer + self.dose = dose self.rotate(rotation) [self.mirror(a) for a, do in enumerate(mirrored) if do] - self.repetition = repetition self.locked = locked def __deepcopy__(self, memo: Optional[Dict] = None) -> 'Polygon': diff --git a/masque/shapes/text.py b/masque/shapes/text.py index d796511..599d377 100644 --- a/masque/shapes/text.py +++ b/masque/shapes/text.py @@ -68,18 +68,29 @@ class Text(RotatableImpl, Shape, metaclass=AutoSlots): dose: float = 1.0, repetition: Optional[Repetition] = None, locked: bool = False, + raw: bool = False, ): object.__setattr__(self, 'locked', False) self.identifier = () - self.offset = offset - self.layer = layer - self.dose = dose - self.string = string - self.height = height - self.rotation = rotation + if raw: + self._offset = offset + self._layer = layer + self._dose = dose + self._string = string + self._height = height + self._rotation = rotation + self._mirrored = mirrored + self._repetition = repetition + else: + self.offset = offset + self.layer = layer + self.dose = dose + self.string = string + self.height = height + self.rotation = rotation + self.mirrored = mirrored + self.repetition = repetition self.font_path = font_path - self.mirrored = mirrored - self.repetition = repetition self.locked = locked def __deepcopy__(self, memo: Dict = None) -> 'Text':