# This file is automatically generated by pyo3_stub_gen
# ruff: noqa: E501, F401, F403, F405
r"""
Polygon offsetting operations for geometry data.

Provides concentric inward offset generation for adaptive clearing
and pocketing toolpath generation.
"""

import collections.abc
import raygeo
from raygeo.geo import types
__all__ = [
    "compute_inset_region",
    "concentric_offsets",
    "find_deepest_cores",
    "offset_contour_group",
]

def compute_inset_region(boundary: collections.abc.Sequence[tuple[float, float]], radius: float, obstacles: collections.abc.Sequence[collections.abc.Sequence[tuple[float, float]]] = []) -> tuple[list[list[tuple[float, float]]], float]:
    r"""
    Compute the inset region: boundary shrunk by *radius*, minus
    obstacle buffers (each obstacle expanded by *radius*).
    
    :param boundary: Outer boundary polygon as a list of ``(x, y)`` points.
    :param radius: Inset / expansion radius.
    :param obstacles: List of obstacle polygons (default []).
    :returns: ``(region_polygons, total_area)``.
    :complexity: O((n + m) log(n + m)) where n and m are boundary and obstacle point counts
    """

def concentric_offsets(geom: raygeo.geo.Geometry, step: float, max_passes: int = 10, min_area: float = 1) -> list[raygeo.geo.Geometry]:
    r"""
    Generate concentric inward offsets of a geometry.
    
    Each successive offset shrinks the boundary by `step`. Stops early
    when the enclosed area drops below `min_area` or `max_passes` is
    reached. Returns offsets outermost-first.
    
    :param geom: A closed geometry.
    :param step: Inward offset distance per pass.
    :param max_passes: Maximum number of offset passes (default 10).
    :param min_area: Minimum area to stop at (default 1.0).
    :returns: List of offset geometries, outermost first.
    :complexity: O(n * p) time, O(n) space where n is the number of contour vertices and p the number of passes
    """

def find_deepest_cores(regions: collections.abc.Sequence[raygeo.geo.types.Polygon], step_over: float) -> list[raygeo.geo.types.Point]:
    r"""
    Find the deepest (most open) regions of a polygon set.
    
    Iteratively offsets each polygon inward by step_over until all
    polygons collapse. Returns the centroids of the final polygons.
    
    :param regions: List of polygons to search.
    :param step_over: Inward offset distance per iteration.
    :returns: List of (x, y) centroid points.
    :complexity: O(n * k) where k is the number of iterations
    """

def offset_contour_group(solid_path: collections.abc.Sequence[raygeo.geo.types.Point], hole_paths: collections.abc.Sequence[collections.abc.Sequence[raygeo.geo.types.Point]], offset: float, join_style: raygeo.geo.shape.polygon.JoinStyle = raygeo.geo.shape.polygon.JoinStyle.Miter) -> list[raygeo.geo.types.Polygon]:
    r"""
    Offset a solid contour with its hole contours.
    
    Offsets the solid outward (or inward for negative offset) while
    offsetting holes in the opposite direction and subtracting them
    from the solid result.
    
    :param solid_path: Outer boundary polygon as (x, y) points.
    :param hole_paths: List of hole polygons.
    :param offset: Offset distance (positive to inflate, negative to deflate).
    :param join_style: Corner join style (default: ``JoinStyle.Miter``).
    :returns: Offset polygon(s) with holes subtracted.
    :complexity: O(n log n)
    """

