Skip to content

square

Square(x, y, size, angle=0.0) dataclass

Bases: BaseShape

A square shape for reference marks. At angle 0 its sides are parallel to the axes.

outline()

Return the square, with its four corners on the circle of diameter size.

Source code in src/layerforge/domain/shapes/square.py
26
27
28
29
30
31
def outline(self) -> Polygon:
    """Return the square, with its four corners on the circle of diameter ``size``."""
    corner = math.sqrt(0.5)
    return self._place(
        [(corner, corner), (-corner, corner), (-corner, -corner), (corner, -corner)]
    )

type()

Return the type of shape. Always 'square' for this class.

Returns:

Type Description
str

The type of shape. Always 'square'.

Source code in src/layerforge/domain/shapes/square.py
16
17
18
19
20
21
22
23
24
def type(self) -> str:
    """Return the type of shape. Always 'square' for this class.

    Returns
    -------
    str
        The type of shape. Always 'square'.
    """
    return "square"