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

import collections.abc
__all__ = [
    "find_narrow_passages",
]

def find_narrow_passages(polygon: collections.abc.Sequence[tuple[float, float]], holes: collections.abc.Sequence[collections.abc.Sequence[tuple[float, float]]] | None = None, max_width: float = 10) -> list[collections.abc.Sequence[tuple[float, float]]]:
    r"""
    Detect narrow passages in a polygon.
    
    A passage is narrow when it is narrower than *max_width*. The
    detection evaluates every boundary edge against every other
    boundary edge via an R-tree spatial index. Edges whose midpoints
    are within *max_width* of a non-adjacent edge (on a different
    polygon or a distinct part of the same polygon) produce a
    quadrilateral via convex hull of their four endpoints.
    All quadrilaterals are unioned and clipped to the pocket.
    
    :param polygon: Outer boundary polygon.
    :param holes: List of hole (island) polygons.
    :param max_width: Passage-width threshold in mm.
    :returns: List of polygons (each a list of ``(x, y)`` vertices).
    :raises RuntimeError: If the polygon cannot be analyzed.
    """

