Skip to content

draw_bounding_box

draw_bounding_box

BoundingBox component for creating apertures.

DrawBoundingBox

Bases: DrawCommand

Description of BoundingBox component.

Source code in src/pygerber/backend/abstract/draw_commands/draw_bounding_box.py
class DrawBoundingBox(DrawCommand):
    """Description of BoundingBox component."""

    bounding_box: BoundingBox
    outline_padding: Offset

    def __init__(
        self,
        backend: Backend,
        polarity: Polarity,
        bounding_box: BoundingBox,
        outline_padding: Offset,
    ) -> None:
        """Initialize draw command."""
        super().__init__(backend, polarity)
        self.bounding_box = bounding_box
        self.outline_padding = outline_padding

    def get_bounding_box(self) -> BoundingBox:
        """Return bounding box of draw operation."""
        return self._bounding_box

    @cached_property
    def _bounding_box(self) -> BoundingBox:
        return self.bounding_box + self.outline_padding

__init__

__init__(
    backend: Backend,
    polarity: Polarity,
    bounding_box: BoundingBox,
    outline_padding: Offset,
) -> None

Initialize draw command.

Source code in src/pygerber/backend/abstract/draw_commands/draw_bounding_box.py
def __init__(
    self,
    backend: Backend,
    polarity: Polarity,
    bounding_box: BoundingBox,
    outline_padding: Offset,
) -> None:
    """Initialize draw command."""
    super().__init__(backend, polarity)
    self.bounding_box = bounding_box
    self.outline_padding = outline_padding

get_bounding_box

get_bounding_box() -> BoundingBox

Return bounding box of draw operation.

Source code in src/pygerber/backend/abstract/draw_commands/draw_bounding_box.py
def get_bounding_box(self) -> BoundingBox:
    """Return bounding box of draw operation."""
    return self._bounding_box