Skip to content

Path

Path

Source code in gdsr/_gdsr.pyi
class Path:
    @property
    def points(self) -> list[Point]:
        """Return the points of the path."""
    @points.setter
    def points(self, points: InputPointsLike) -> None:
        """Set the points of the path."""
    layer: Layer
    data_type: DataType
    path_type: PathType | None
    width: float | None
    def __init__(
        self,
        points: InputPointsLike,
        layer: Layer = 0,
        data_type: DataType = 0,
        path_type: PathType | None = None,
        width: float | None = None,
    ) -> None: ...
    @property
    def length(self) -> float:
        """Return the length of the path."""
    @property
    def bounding_box(self) -> tuple[Point, Point]:
        """Return the bounding box of the path."""
    def set_points(self, points: InputPointsLike) -> Self:
        """Set the points of the path."""
    def set_layer(self, layer: Layer) -> Self:
        """Set the layer of the path."""
    def set_data_type(self, data_type: DataType) -> Self:
        """Set the data type of the path."""
    def set_path_type(self, path_type: PathType | None) -> Self:
        """Set the path type of the path."""
    def set_width(self, width: float | None) -> Self:
        """Set the width of the path."""

    def copy(self) -> Self:
        """Return a copy of the path."""
    def move_to(self, point: PointLike) -> Self:
        """Move the path to a point.

        This method modifies the path in place and returns itself.

        :param PointLike point: Point to move the path to.
        """
    def move_by(self, vector: PointLike) -> Self:
        """Move the path by a vector.

        This method modifies the path in place and returns itself.

        :param PointLike vector: Vector to move the path by.
        """
    def rotate(self, angle: float, centre: PointLike = Point(0, 0)) -> Self:
        """Rotate the path by an angle around a centre point.

        This method modifies the path in place and returns itself.

        :param float angle: Counter-clockwise rotation angle in degrees.
        :param PointLike centre: Centre point of rotation, defaults to (0, 0).
        """
    def scale(self, factor: float, centre: PointLike = Point(0, 0)) -> Self:
        """Scale the path by a factor around a centre point.

        This method modifies the path in place and returns itself.

        :param float factor: Scaling factor.
        :param PointLike centre: Centre point of scaling, defaults to (0, 0).
        """
    def is_on(self, *layer_data_types: LayerDataType) -> bool:
        """Return True if the path is on any of the specified layer, data_type pairs."""
    def __str__(self) -> str:
        """Return a string representation of the path."""
    def __repr__(self) -> str:
        """Return a string representation of the path."""
    def __eq__(self, value: object) -> bool:
        """Return True if the path is equal to another object."""

points property writable

points: list[Point]

Return the points of the path.

layer instance-attribute

layer: Layer

data_type instance-attribute

data_type: DataType

path_type instance-attribute

path_type: PathType | None

width instance-attribute

width: float | None

length property

length: float

Return the length of the path.

bounding_box property

bounding_box: tuple[Point, Point]

Return the bounding box of the path.

__init__

__init__(points: InputPointsLike, layer: Layer = 0, data_type: DataType = 0, path_type: PathType | None = None, width: float | None = None) -> None
Source code in gdsr/_gdsr.pyi
def __init__(
    self,
    points: InputPointsLike,
    layer: Layer = 0,
    data_type: DataType = 0,
    path_type: PathType | None = None,
    width: float | None = None,
) -> None: ...

set_points

set_points(points: InputPointsLike) -> Self

Set the points of the path.

Source code in gdsr/_gdsr.pyi
def set_points(self, points: InputPointsLike) -> Self:
    """Set the points of the path."""

set_layer

set_layer(layer: Layer) -> Self

Set the layer of the path.

Source code in gdsr/_gdsr.pyi
def set_layer(self, layer: Layer) -> Self:
    """Set the layer of the path."""

set_data_type

set_data_type(data_type: DataType) -> Self

Set the data type of the path.

Source code in gdsr/_gdsr.pyi
def set_data_type(self, data_type: DataType) -> Self:
    """Set the data type of the path."""

set_path_type

set_path_type(path_type: PathType | None) -> Self

Set the path type of the path.

Source code in gdsr/_gdsr.pyi
def set_path_type(self, path_type: PathType | None) -> Self:
    """Set the path type of the path."""

set_width

set_width(width: float | None) -> Self

Set the width of the path.

Source code in gdsr/_gdsr.pyi
def set_width(self, width: float | None) -> Self:
    """Set the width of the path."""

copy

copy() -> Self

Return a copy of the path.

Source code in gdsr/_gdsr.pyi
def copy(self) -> Self:
    """Return a copy of the path."""

move_to

move_to(point: PointLike) -> Self

Move the path to a point.

This method modifies the path in place and returns itself.

Parameters:

  • point (PointLike) –

    Point to move the path to.

Source code in gdsr/_gdsr.pyi
def move_to(self, point: PointLike) -> Self:
    """Move the path to a point.

    This method modifies the path in place and returns itself.

    :param PointLike point: Point to move the path to.
    """

move_by

move_by(vector: PointLike) -> Self

Move the path by a vector.

This method modifies the path in place and returns itself.

Parameters:

  • vector (PointLike) –

    Vector to move the path by.

Source code in gdsr/_gdsr.pyi
def move_by(self, vector: PointLike) -> Self:
    """Move the path by a vector.

    This method modifies the path in place and returns itself.

    :param PointLike vector: Vector to move the path by.
    """

rotate

rotate(angle: float, centre: PointLike = Point(0, 0)) -> Self

Rotate the path by an angle around a centre point.

This method modifies the path in place and returns itself.

Parameters:

  • angle (float) –

    Counter-clockwise rotation angle in degrees.

  • centre (PointLike, default: Point(0, 0) ) –

    Centre point of rotation, defaults to (0, 0).

Source code in gdsr/_gdsr.pyi
def rotate(self, angle: float, centre: PointLike = Point(0, 0)) -> Self:
    """Rotate the path by an angle around a centre point.

    This method modifies the path in place and returns itself.

    :param float angle: Counter-clockwise rotation angle in degrees.
    :param PointLike centre: Centre point of rotation, defaults to (0, 0).
    """

scale

scale(factor: float, centre: PointLike = Point(0, 0)) -> Self

Scale the path by a factor around a centre point.

This method modifies the path in place and returns itself.

Parameters:

  • factor (float) –

    Scaling factor.

  • centre (PointLike, default: Point(0, 0) ) –

    Centre point of scaling, defaults to (0, 0).

Source code in gdsr/_gdsr.pyi
def scale(self, factor: float, centre: PointLike = Point(0, 0)) -> Self:
    """Scale the path by a factor around a centre point.

    This method modifies the path in place and returns itself.

    :param float factor: Scaling factor.
    :param PointLike centre: Centre point of scaling, defaults to (0, 0).
    """

is_on

is_on(*layer_data_types: LayerDataType) -> bool

Return True if the path is on any of the specified layer, data_type pairs.

Source code in gdsr/_gdsr.pyi
def is_on(self, *layer_data_types: LayerDataType) -> bool:
    """Return True if the path is on any of the specified layer, data_type pairs."""

__str__

__str__() -> str

Return a string representation of the path.

Source code in gdsr/_gdsr.pyi
def __str__(self) -> str:
    """Return a string representation of the path."""

__repr__

__repr__() -> str

Return a string representation of the path.

Source code in gdsr/_gdsr.pyi
def __repr__(self) -> str:
    """Return a string representation of the path."""

__eq__

__eq__(value: object) -> bool

Return True if the path is equal to another object.

Source code in gdsr/_gdsr.pyi
def __eq__(self, value: object) -> bool:
    """Return True if the path is equal to another object."""

PathType

Source code in gdsr/_gdsr.pyi
class PathType(Enum):
    Square = 0
    Round = 1
    Overlap = 2

    @staticmethod
    def values() -> list[PathType]:
        """Return a list of all PathType values."""

Square class-attribute instance-attribute

Square = 0

Round class-attribute instance-attribute

Round = 1

Overlap class-attribute instance-attribute

Overlap = 2

values staticmethod

values() -> list[PathType]

Return a list of all PathType values.

Source code in gdsr/_gdsr.pyi
@staticmethod
def values() -> list[PathType]:
    """Return a list of all PathType values."""