# This file is automatically generated by pyo3_stub_gen
# ruff: noqa: E501, F401, F403, F405

import collections.abc
import enum
import numpy.typing
from raygeo.geo import types
import typing
__all__ = [
    "CornerType",
    "JoinStyle",
    "apply_minimum_curvature",
    "clean_polygon",
    "do_polygons_intersect",
    "does_path_sweep_intersect_polygon",
    "does_polygon_enclose_circle",
    "find_entry_edges",
    "find_polygon_corners",
    "flip_polygon",
    "flip_polygon_numpy",
    "flip_polygons",
    "flip_polygons_numpy",
    "get_circle_polygon",
    "get_miter_offset_intersection",
    "get_point_line_distance",
    "get_polygon_area",
    "get_polygon_boundary_distance",
    "get_polygon_bounds",
    "get_polygon_centroid",
    "get_polygon_closest_point",
    "get_polygon_convex_hull",
    "get_polygon_edges",
    "get_polygon_group_bounds",
    "get_polygon_heading_at",
    "get_polygon_perimeter",
    "get_polygon_signed_area",
    "get_polygon_vertex_centroid",
    "get_polygons_closest_point",
    "get_polygons_difference",
    "get_polygons_group_difference",
    "get_polygons_group_intersection",
    "get_polygons_intersection",
    "get_polygons_union",
    "get_polyline_swept_polygon",
    "get_segment_swept_polygon",
    "get_signed_boundary_distance",
    "is_almost_equal",
    "is_point_inside_polygon",
    "is_polygon_clockwise",
    "is_polygon_convex",
    "normalize_polygons",
    "normalize_polygons_numpy",
    "offset_polygon",
    "point_in_polygon_numpy",
    "polygon_area_numpy",
    "polygon_bounds_numpy",
    "polygon_group_bounds_numpy",
    "polygon_perimeter_numpy",
    "polygons_intersect_numpy",
    "resample_polygon",
    "rotate_polygon",
    "rotate_polygon_numpy",
    "rotate_polygons",
    "rotate_polygons_numpy",
    "scale_polygon",
    "to_clipper_numpy",
    "translate_bounds",
    "translate_polygon",
    "translate_polygon_numpy",
    "translate_polygons",
    "translate_polygons_numpy",
    "walk_polygon_from_point",
    "walk_polygon_vertices",
]

@typing.final
class CornerType(enum.Enum):
    r"""
    Which corner type to find in [`find_polygon_corners`].
    
    - ``CornerType.Convex``: convex corners (interior angle < 180°).
    - ``CornerType.Concave``: concave / reflex corners (default).
    """
    Convex = ...
    Concave = ...

@typing.final
class JoinStyle(enum.Enum):
    r"""
    Corner join style for polygon offset operations.
    
    - ``JoinStyle.Miter``: Extends edges until they meet (default).
    - ``JoinStyle.Round``: Adds a circular arc at the corner.
    - ``JoinStyle.Square``: Extends edges by the offset distance.
    """
    Miter = ...
    Round = ...
    Square = ...

def apply_minimum_curvature(polygon: collections.abc.Sequence[types.Point], r_min: float) -> list[types.Polygon]:
    r"""
    Fillet tight internal corners to a minimum radius.
    
    Offsets inward by ``r_min`` (Miter), then outward by ``r_min``
    (Round). Acts as a high-pass curvature filter — sharp corners
    are rounded to exactly ``r_min`` while the overall shape is
    preserved.
    
    :param polygon: Polygon as (x, y) points.
    :param r_min: Minimum allowed curvature radius.
    :returns: Filleted polygon(s).
    :complexity: O(n)
    """

def clean_polygon(polygon: collections.abc.Sequence[types.Point], tolerance: typing.Optional[float] = None) -> typing.Optional[types.Polygon]:
    r"""
    Clean a polygon by removing near-duplicate points.
    
    :param polygon: Input polygon as (x, y) points.
    :param tolerance: Distance tolerance for deduplication.
    :returns: Cleaned polygon or None.
    :complexity: O(n)
    """

def do_polygons_intersect(p1: collections.abc.Sequence[types.Point], p2: collections.abc.Sequence[types.Point], min_area: float = 0) -> bool:
    r"""
    Check if two polygons intersect.
    
    :param p1: First polygon as (x, y) points.
    :param p2: Second polygon as (x, y) points.
    :param min_area: Minimum intersection area threshold.
    :returns: True if polygons intersect.
    :complexity: O(n * m)
    """

def does_path_sweep_intersect_polygon(path: collections.abc.Sequence[types.Point], radius: float, obstacles: collections.abc.Sequence[types.Polygon]) -> bool:
    r"""
    Check if a disk swept along a path intersects any obstacle polygon.
    
    Returns True when the Minkowski sweep of a disk of *radius* along
    *path* intersects any polygon in *obstacles*.
    
    :param path: Open polyline as (x, y) points.
    :param radius: Disk radius.
    :param obstacles: List of obstacle polygons.
    :returns: True if any obstacle intersects the sweep.
    :complexity: O(n * m)
    """

def does_polygon_enclose_circle(center: types.Point, radius: float, polygon: collections.abc.Sequence[types.Point]) -> bool:
    r"""
    Check if a polygon fully encloses a circle.
    
    Uses a conservative fast check: the polygon's AABB must contain the
    circle's AABB, and the circle center must be inside the polygon.
    
    :param center: Circle center (x, y).
    :param radius: Circle radius.
    :param polygon: Polygon as (x, y) points.
    :returns: True if the polygon fully encloses the circle.
    :complexity: O(n)
    """

def find_entry_edges(polygon: collections.abc.Sequence[tuple[float, float]], boundaries: collections.abc.Sequence[collections.abc.Sequence[tuple[float, float]]], dist_tol: float = 1) -> list[int]: ...

def find_polygon_corners(polygon: collections.abc.Sequence[tuple[float, float]], corner_type: CornerType = CornerType.Concave, threshold_deg: float = 90) -> list[tuple[int, float]]:
    r"""
    Find corners of a polygon matching *corner_type*.
    
    Returns a list of (vertex_index, interior_angle_deg) for each
    vertex whose interior angle is at least *threshold_deg*.
    Winding is auto-detected from the signed area.
    
    :param polygon: Polygon vertices (closed or open; treated as closed).
    :param corner_type: ``CornerType.Concave`` (default) or ``CornerType.Convex``.
    :param threshold_deg: Minimum interior angle in degrees (default 90).
    :returns: List of (vertex_index, interior_angle_deg) tuples.
    """

def flip_polygon(polygon: collections.abc.Sequence[types.Point], flip_h: bool, flip_v: bool) -> types.Polygon:
    r"""
    Flip a polygon horizontally and/or vertically.
    
    :param polygon: Polygon as (x, y) points.
    :param flip_h: Whether to flip horizontally.
    :param flip_v: Whether to flip vertically.
    :returns: Flipped polygon.
    :complexity: O(n)
    """

def flip_polygon_numpy(polygon: numpy.typing.NDArray, flip_h: bool, flip_v: bool) -> numpy.typing.NDArray:
    r"""
    Flip a polygon from numpy array.
    
    :param polygon: Polygon as a 2D numpy array.
    :param flip_h: Whether to flip horizontally.
    :param flip_v: Whether to flip vertically.
    :returns: Flipped polygon as numpy array.
    :complexity: O(n)
    """

def flip_polygons(polygons: collections.abc.Sequence[types.Polygon], flip_h: bool, flip_v: bool) -> list[types.Polygon]:
    r"""
    Flip multiple polygons.
    
    :param polygons: List of polygons to flip.
    :param flip_h: Whether to flip horizontally.
    :param flip_v: Whether to flip vertically.
    :returns: Flipped polygons.
    :complexity: O(n * m)
    """

def flip_polygons_numpy(polygons: collections.abc.Sequence[numpy.typing.NDArray], flip_h: bool, flip_v: bool) -> list[numpy.typing.NDArray]:
    r"""
    Flip polygons from numpy arrays.
    
    :param polygons: List of 2D numpy arrays.
    :param flip_h: Whether to flip horizontally.
    :param flip_v: Whether to flip vertically.
    :returns: List of flipped numpy arrays.
    :complexity: O(n * m)
    """

def get_circle_polygon(center: types.Point, radius: float, n: int = 64) -> types.Polygon:
    r"""
    Approximate a circle as an n-gon polygon.
    
    :param center: Centre point (x, y).
    :param radius: Circle radius.
    :param n: Number of sides (default 64).
    :returns: Polygon as list of (x, y) points.
    :complexity: O(n)
    """

def get_miter_offset_intersection(v: types.Point, off_a: types.Point, dir_a: types.Point, off_b: types.Point, dir_b: types.Point) -> types.Point:
    r"""
    Intersect two offset lines at a vertex for miter join.
    
    Line A: ``v + off_a + t * dir_a``
    Line B: ``v + off_b + s * dir_b``
    
    Returns the intersection point.  When the lines are nearly parallel
    falls back to ``v + off_a``.
    
    :param v: Vertex point (x, y).
    :param off_a: Offset from *v* along line A.
    :param dir_a: Unit direction vector of line A.
    :param off_b: Offset from *v* along line B.
    :param dir_b: Unit direction vector of line B.
    :returns: Intersection point (x, y).
    """

def get_point_line_distance(point: types.Point, line_start: types.Point, line_end: types.Point) -> float:
    r"""
    Compute the distance from a point to a line.
    
    :param point: Point (x, y).
    :param line_start: Line start point (x, y).
    :param line_end: Line end point (x, y).
    :returns: Perpendicular distance.
    :complexity: O(1)
    """

def get_polygon_area(polygon: collections.abc.Sequence[types.Point]) -> float:
    r"""
    Get the unsigned area of a polygon.
    
    :param polygon: Polygon as (x, y) points.
    :returns: Unsigned area.
    :complexity: O(n)
    """

def get_polygon_boundary_distance(a: collections.abc.Sequence[tuple[float, float]], b: collections.abc.Sequence[tuple[float, float]]) -> float:
    r"""
    Minimum midpoint-to-segment distance between the boundaries of
    two polygons.
    
    Uses segment midpoints rather than raw segment-segment distance
    to avoid false positives from polygons that merely touch at a
    shared vertex.
    
    :param a: First polygon as (x, y) points.
    :param b: Second polygon as (x, y) points.
    :returns: Minimum boundary distance.
    :complexity: O(n * m)
    """

def get_polygon_bounds(polygon: collections.abc.Sequence[types.Point]) -> types.Rect:
    r"""
    Get the bounding rectangle of a polygon.
    
    :param polygon: Polygon as (x, y) points.
    :returns: Bounding rectangle as (x_min, y_min, x_max, y_max).
    :complexity: O(n)
    """

def get_polygon_centroid(polygon: collections.abc.Sequence[types.Point]) -> types.Point:
    r"""
    Get the centroid of a polygon.
    
    :param polygon: Polygon as (x, y) points.
    :returns: Centroid point (x, y).
    :complexity: O(n)
    """

def get_polygon_closest_point(polygon: collections.abc.Sequence[types.Point], x: float, y: float) -> tuple[float, tuple[float, float], float] | None:
    r"""
    Find the closest point on a polygon boundary to (x, y).
    
    :param polygon: Polygon as (x, y) points.
    :param x: X coordinate.
    :param y: Y coordinate.
    :returns: (t, (cx, cy), distance_squared) or None if degenerate.
    """

def get_polygon_convex_hull(polygon: collections.abc.Sequence[types.Point]) -> types.Polygon:
    r"""
    Get the convex hull of a polygon.
    
    :param polygon: Polygon as (x, y) points.
    :returns: Convex hull as list of points.
    :complexity: O(n log n)
    """

def get_polygon_edges(polygon: collections.abc.Sequence[types.Point]) -> list[tuple[types.Point, types.Point]]:
    r"""
    Get the edges of a polygon.
    
    :param polygon: Polygon as (x, y) points.
    :returns: List of ((x1, y1), (x2, y2)) edges.
    :complexity: O(n)
    """

def get_polygon_group_bounds(polygons: collections.abc.Sequence[types.Polygon]) -> types.Rect:
    r"""
    Get the bounding rectangle of a group of polygons.
    
    :param polygons: List of polygons.
    :returns: Bounding rectangle as (x_min, y_min, x_max, y_max).
    :complexity: O(n * m)
    """

def get_polygon_heading_at(polygon: list[tuple[float, float]], vertex: tuple[float, float]) -> float: ...

def get_polygon_perimeter(polygon: collections.abc.Sequence[types.Point]) -> float:
    r"""
    Get the perimeter of a polygon.
    
    :param polygon: Polygon as (x, y) points.
    :returns: Perimeter length.
    :complexity: O(n)
    """

def get_polygon_signed_area(polygon: collections.abc.Sequence[types.Point]) -> float:
    r"""
    Get the signed area of a polygon.
    
    :param polygon: Polygon as (x, y) points.
    :returns: Signed area (positive for CCW, negative for CW).
    :complexity: O(n)
    """

def get_polygon_vertex_centroid(polygon: collections.abc.Sequence[tuple[float, float]]) -> tuple[float, float]:
    r"""
    Arithmetic mean of polygon vertices (vertex-average centroid).
    
    Unlike :func:`get_polygon_centroid` (area-weighted shoelace centroid),
    this is useful for concave polygons where the area centroid lies
    outside the boundary.
    
    :param polygon: Polygon as (x, y) points.
    :returns: Vertex-average centroid (x, y).
    :complexity: O(n)
    """

def get_polygons_closest_point(polygons: collections.abc.Sequence[types.Polygon], x: float, y: float) -> tuple[int, float, tuple[float, float], float] | None:
    r"""
    Find the closest point on any polygon in a list to (x, y).
    
    :param polygons: List of polygons as (x, y) points.
    :param x: X coordinate.
    :param y: Y coordinate.
    :returns: (polygon_index, t, (cx, cy), distance_squared) or None.
    """

def get_polygons_difference(poly1: collections.abc.Sequence[types.Point], poly2: collections.abc.Sequence[types.Point]) -> list[types.Polygon]:
    r"""
    Get the difference of two polygons.
    
    :param poly1: First polygon as (x, y) points.
    :param poly2: Second polygon to subtract.
    :returns: Difference polygon(s).
    :complexity: O(n log n)
    """

def get_polygons_group_difference(subject: typing.Sequence[types.Polygon], clip: typing.Sequence[types.Polygon]) -> list[types.Polygon]:
    r"""
    Subtract clip polygons from subject polygons.
    
    :param subject: Subject polygons.
    :param clip: Clip polygons to subtract.
    :returns: Difference polygon(s).
    :complexity: O(n log n)
    """

def get_polygons_group_intersection(subject: typing.Sequence[types.Polygon], clip: typing.Sequence[types.Polygon]) -> list[types.Polygon]:
    r"""
    Intersect two groups of polygons (subject & clip).
    
    :param subject: Subject polygons.
    :param clip: Clip polygons.
    :returns: Intersection polygon(s).
    :complexity: O(n log n)
    """

def get_polygons_intersection(poly1: collections.abc.Sequence[types.Point], poly2: collections.abc.Sequence[types.Point]) -> list[types.Polygon]:
    r"""
    Get the intersection of two polygons.
    
    :param poly1: First polygon as (x, y) points.
    :param poly2: Second polygon as (x, y) points.
    :returns: Intersection polygon(s).
    :complexity: O(n log n)
    """

def get_polygons_union(polygons: collections.abc.Sequence[types.Polygon]) -> list[types.Polygon]:
    r"""
    Get the union of multiple polygons.
    
    :param polygons: List of polygons to union.
    :returns: Union polygon(s).
    :complexity: O(n log n)
    """

def get_polyline_swept_polygon(path: collections.abc.Sequence[types.Point], radius: float) -> list[types.Polygon]:
    r"""
    Compute the Minkowski sum of a polyline path with a disk.
    
    Returns a single polygon covering the swept area — the union of
    segment-wide rectangular strips capped with half-circles at the
    first and last endpoints.
    
    :param path: Open polyline as (x, y) points.
    :param radius: Offset radius.
    :returns: A single swept polygon.
    :complexity: O(n)
    """

def get_segment_swept_polygon(a: types.Point, b: types.Point, radius: float) -> list[types.Polygon]:
    r"""
    Compute the swept area of a line segment with a given radius.
    
    Returns a rectangle (the Minkowski sum of the segment with a disk
    of *radius*) plus two disks at the endpoints.  Useful for toolpath
    clearance tracking and roughing simulation.
    
    :param a: Start point (x, y).
    :param b: End point (x, y).
    :param radius: Offset radius.
    :returns: List of polygons (rectangle + two end-caps).
    :complexity: O(n)
    """

def get_signed_boundary_distance(point: tuple[float, float], polygons: collections.abc.Sequence[collections.abc.Sequence[tuple[float, float]]]) -> float:
    r"""
    Signed perpendicular distance from point to nearest polygon boundary.
    
    Positive = outside all polygons, Negative = inside any polygon,
    Zero = exactly on a boundary.
    
    :param point: Query point ``(x, y)``.
    :param polygons: List of polygons.
    :returns: Signed distance (mm).
    """

def is_almost_equal(a: float, b: float, tolerance: typing.Optional[float] = None) -> bool:
    r"""
    Check if two floats are almost equal.
    
    :param a: First float.
    :param b: Second float.
    :param tolerance: Comparison tolerance.
    :returns: True if |a - b| < tolerance.
    :complexity: O(1)
    """

def is_point_inside_polygon(point: types.Point, polygon: collections.abc.Sequence[types.Point]) -> bool:
    r"""
    Check if a point is inside a polygon.
    
    :param point: Point (x, y) to test.
    :param polygon: Polygon as (x, y) points.
    :returns: True if point is inside the polygon.
    :complexity: O(n)
    """

def is_polygon_clockwise(points: collections.abc.Sequence[types.Point2DOr3D]) -> bool:
    r"""
    Check if a polygon has clockwise winding.
    
    :param points: Sequence of (x, y) or (x, y, z) points.
    :returns: True if the polygon is clockwise.
    :complexity: O(n)
    """

def is_polygon_convex(polygon: collections.abc.Sequence[types.Point]) -> bool:
    r"""
    Check if a polygon is convex.
    
    :param polygon: Polygon as (x, y) points.
    :returns: True if the polygon is convex.
    :complexity: O(n)
    """

def normalize_polygons(polygons: collections.abc.Sequence[types.Polygon]) -> tuple[list[types.Polygon], float, float]:
    r"""
    Normalize polygons (outer CCW, inner CW).
    
    :param polygons: List of polygons to normalize.
    :returns: Tuple of (normalized_polygons, min_x, min_y).
    :complexity: O(n log n)
    """

def normalize_polygons_numpy(polygons: collections.abc.Sequence[numpy.typing.NDArray]) -> tuple[list[numpy.typing.NDArray], float, float]:
    r"""
    Normalize polygons from numpy arrays.
    
    :param polygons: Sequence of 2D numpy arrays.
    :returns: Tuple of (normalized_arrays, min_x, min_y).
    :complexity: O(n log n)
    """

def offset_polygon(polygon: collections.abc.Sequence[types.Point], offset: float, join_style: JoinStyle = JoinStyle.Miter) -> list[types.Polygon]:
    r"""
    Offset (inflate/deflate) a polygon.
    
    :param polygon: Polygon as (x, y) points.
    :param offset: Offset distance (positive to inflate, negative to deflate).
    :param join_style: Corner join style (default: ``JoinStyle.Miter``).
    :returns: Offset polygon(s).
    :complexity: O(n log n)
    """

def point_in_polygon_numpy(point: types.Point, polygon: numpy.typing.NDArray) -> bool:
    r"""
    Check if point is in polygon from numpy array.
    
    :param point: Point (x, y) to test.
    :param polygon: Polygon as a 2D numpy array.
    :returns: True if point is inside the polygon.
    :complexity: O(n)
    """

def polygon_area_numpy(polygon: numpy.typing.NDArray) -> float:
    r"""
    Get the area of a polygon from numpy array.
    
    :param polygon: Polygon as a 2D numpy array.
    :returns: Signed area.
    :complexity: O(n)
    """

def polygon_bounds_numpy(polygon: numpy.typing.NDArray) -> types.Rect:
    r"""
    Get bounds of a polygon from numpy array.
    
    :param polygon: Polygon as a 2D numpy array.
    :returns: Bounding rectangle as (x_min, y_min, x_max, y_max).
    :complexity: O(n)
    """

def polygon_group_bounds_numpy(polygons: collections.abc.Sequence[numpy.typing.NDArray]) -> types.Rect:
    r"""
    Get bounds of polygon group from numpy arrays.
    
    :param polygons: Sequence of 2D numpy arrays.
    :returns: Bounding rectangle as (x_min, y_min, x_max, y_max).
    :complexity: O(n * m)
    """

def polygon_perimeter_numpy(polygon: numpy.typing.NDArray) -> float:
    r"""
    Get the perimeter of a polygon from numpy array.
    
    :param polygon: Polygon as a 2D numpy array.
    :returns: Perimeter length.
    :complexity: O(n)
    """

def polygons_intersect_numpy(poly1: numpy.typing.NDArray, poly2: numpy.typing.NDArray, min_area: float = 0) -> bool:
    r"""
    Check if polygons intersect from numpy arrays.
    
    :param poly1: First polygon as a 2D numpy array.
    :param poly2: Second polygon as a 2D numpy array.
    :param min_area: Minimum intersection area threshold.
    :returns: True if polygons intersect.
    :complexity: O(n * m)
    """

def resample_polygon(polygon: collections.abc.Sequence[tuple[float, float]], spacing: float) -> list[tuple[float, float]]:
    r"""
    Resample a closed polygon by inserting evenly-spaced points along each
    edge so that no segment is longer than *spacing*.
    
    The result is a closed polyline (last point connects back to first
    conceptually, but is not duplicated).
    
    :param polygon: Polygon as (x, y) points.
    :param spacing: Maximum allowed segment length.
    :returns: Resampled polygon as list of (x, y) points.
    :complexity: O(n * m)
    """

def rotate_polygon(polygon: collections.abc.Sequence[types.Point], angle: float) -> types.Polygon:
    r"""
    Rotate a polygon by an angle.
    
    :param polygon: Polygon as (x, y) points.
    :param angle: Rotation angle in degrees.
    :returns: Rotated polygon.
    :complexity: O(n)
    """

def rotate_polygon_numpy(polygon: numpy.typing.NDArray, angle: float) -> numpy.typing.NDArray:
    r"""
    Rotate a polygon from numpy array.
    
    :param polygon: Polygon as a 2D numpy array.
    :param angle: Rotation angle in degrees.
    :returns: Rotated polygon as numpy array.
    :complexity: O(n)
    """

def rotate_polygons(polygons: collections.abc.Sequence[types.Polygon], angle: float) -> list[types.Polygon]:
    r"""
    Rotate multiple polygons by an angle.
    
    :param polygons: List of polygons to rotate.
    :param angle: Rotation angle in degrees.
    :returns: Rotated polygons.
    :complexity: O(n * m)
    """

def rotate_polygons_numpy(polygons: collections.abc.Sequence[numpy.typing.NDArray], angle: float) -> list[numpy.typing.NDArray]:
    r"""
    Rotate polygons from numpy arrays.
    
    :param polygons: Sequence of 2D numpy arrays.
    :param angle: Rotation angle in degrees.
    :returns: List of rotated numpy arrays.
    :complexity: O(n * m)
    """

def scale_polygon(polygon: collections.abc.Sequence[types.Point], scale: float, scale_y: typing.Optional[float] = None) -> types.Polygon:
    r"""
    Scale a polygon.
    
    :param polygon: Polygon as (x, y) points.
    :param scale: X (and Y if scale_y is None) scale factor.
    :param scale_y: Y scale factor (optional).
    :returns: Scaled polygon.
    :complexity: O(n)
    """

def to_clipper_numpy(polygon: collections.abc.Sequence[numpy.typing.NDArray]) -> list[tuple[int, int]]:
    r"""
    Convert a numpy polygon to Clipper integer coordinates.
    
    :param polygon: Sequence of 2D numpy arrays.
    :returns: List of (x, y) integer tuples.
    :complexity: O(n * m)
    """

def translate_bounds(bounds: types.Rect, dx: float, dy: float) -> types.Rect:
    r"""
    Translate a bounding rectangle.
    
    :param bounds: Bounding rectangle (x_min, y_min, x_max, y_max).
    :param dx: X translation.
    :param dy: Y translation.
    :returns: Translated bounding rectangle.
    :complexity: O(1)
    """

def translate_polygon(polygon: collections.abc.Sequence[types.Point], dx: float, dy: float) -> types.Polygon:
    r"""
    Translate a polygon.
    
    :param polygon: Polygon as (x, y) points.
    :param dx: X translation.
    :param dy: Y translation.
    :returns: Translated polygon.
    :complexity: O(n)
    """

def translate_polygon_numpy(polygon: numpy.typing.NDArray, dx: float, dy: float) -> numpy.typing.NDArray:
    r"""
    Translate a polygon from numpy array.
    
    :param polygon: Polygon as a 2D numpy array.
    :param dx: X translation.
    :param dy: Y translation.
    :returns: Translated polygon as numpy array.
    :complexity: O(n)
    """

def translate_polygons(polygons: collections.abc.Sequence[types.Polygon], dx: float, dy: float) -> list[types.Polygon]:
    r"""
    Translate a list of polygons.
    
    :param polygons: List of polygons to translate.
    :param dx: X translation.
    :param dy: Y translation.
    :returns: Translated polygons.
    :complexity: O(n * m)
    """

def translate_polygons_numpy(polygons: collections.abc.Sequence[numpy.typing.NDArray], dx: float, dy: float) -> list[numpy.typing.NDArray]:
    r"""
    Translate polygons from numpy arrays.
    
    :param polygons: Sequence of 2D numpy arrays.
    :param dx: X translation.
    :param dy: Y translation.
    :returns: List of translated numpy arrays.
    :complexity: O(n * m)
    """

def walk_polygon_from_point(polygon: list[tuple[float, float]], start: tuple[float, float]) -> list[tuple[int, float, float]]: ...

def walk_polygon_vertices(polygon: list[tuple[float, float]], start_idx: int, forward: bool, stride: int = 1) -> list[tuple[int, float, float]]: ...

