Skip to content

aperture2

aperture2

Parser level abstraction of aperture info for Gerber AST parser, version 2.

Aperture2

Bases: FrozenGeneralModel

Parser level abstraction of aperture info.

Source code in src/pygerber/gerberx3/parser2/apertures2/aperture2.py
class Aperture2(FrozenGeneralModel):
    """Parser level abstraction of aperture info."""

    identifier: ApertureID
    attributes: ApertureAttributes = Field(default_factory=ImmutableMapping)

    def render_flash(self, renderer: Renderer2, command: Flash2) -> None:
        """Render draw operation."""
        raise NotImplementedError

    def get_bounding_box(self) -> BoundingBox:
        """Return bounding box of aperture."""
        raise NotImplementedError

    def get_stroke_width(self) -> Offset:
        """Get stroke width of command."""
        raise NotImplementedError

    def get_mirrored(self, mirror: Mirroring) -> Self:  # noqa: ARG002
        """Get mirrored aperture."""
        return self

    def get_rotated(self, angle: Decimal) -> Self:  # noqa: ARG002
        """Get copy of this aperture rotated around (0, 0)."""
        return self

    def get_scaled(self, scale: Decimal) -> Self:  # noqa: ARG002
        """Get copy of this aperture scaled by factor."""
        return self

render_flash

render_flash(renderer: Renderer2, command: Flash2) -> None

Render draw operation.

Source code in src/pygerber/gerberx3/parser2/apertures2/aperture2.py
def render_flash(self, renderer: Renderer2, command: Flash2) -> None:
    """Render draw operation."""
    raise NotImplementedError

get_bounding_box

get_bounding_box() -> BoundingBox

Return bounding box of aperture.

Source code in src/pygerber/gerberx3/parser2/apertures2/aperture2.py
def get_bounding_box(self) -> BoundingBox:
    """Return bounding box of aperture."""
    raise NotImplementedError

get_stroke_width

get_stroke_width() -> Offset

Get stroke width of command.

Source code in src/pygerber/gerberx3/parser2/apertures2/aperture2.py
def get_stroke_width(self) -> Offset:
    """Get stroke width of command."""
    raise NotImplementedError

get_mirrored

get_mirrored(mirror: Mirroring) -> Self

Get mirrored aperture.

Source code in src/pygerber/gerberx3/parser2/apertures2/aperture2.py
def get_mirrored(self, mirror: Mirroring) -> Self:  # noqa: ARG002
    """Get mirrored aperture."""
    return self

get_rotated

get_rotated(angle: Decimal) -> Self

Get copy of this aperture rotated around (0, 0).

Source code in src/pygerber/gerberx3/parser2/apertures2/aperture2.py
def get_rotated(self, angle: Decimal) -> Self:  # noqa: ARG002
    """Get copy of this aperture rotated around (0, 0)."""
    return self

get_scaled

get_scaled(scale: Decimal) -> Self

Get copy of this aperture scaled by factor.

Source code in src/pygerber/gerberx3/parser2/apertures2/aperture2.py
def get_scaled(self, scale: Decimal) -> Self:  # noqa: ARG002
    """Get copy of this aperture scaled by factor."""
    return self