# This file is automatically generated by pyo3_stub_gen
# ruff: noqa: E501, F401, F403, F405
r"""
Minkowski sum operations for 2D polygon toolpath generation.

Provides convolution of point sequences and segments, Minkowski sums
for convex polygons, and no-fit polygon / inner fit polygon calculations
used in nesting and packing algorithms.
"""

import collections.abc
from raygeo.geo import types
__all__ = [
    "calculate_input_scale",
    "convolve_point_sequences",
    "convolve_two_segments",
    "get_inner_fit_polygon",
    "get_no_fit_polygon",
    "get_polygon_minkowski_sum_convex",
]

def calculate_input_scale(polygons: collections.abc.Sequence[collections.abc.Sequence[types.Point]], max_int: int = 2147483647) -> float:
    r"""
    Calculate the optimal input scale for clipper operations.
    
    :param polygons: List of polygons to scale.
    :param max_int: Maximum integer value for Clipper.
    :returns: Optimal scale factor.
    :complexity: O(n) time, O(1) space
    """

def convolve_point_sequences(seq_a: collections.abc.Sequence[tuple[float, float]], seq_b: collections.abc.Sequence[tuple[float, float]]) -> list[list[tuple[float, float]]]:
    r"""
    Convolve two sequences of points.
    
    :param seq_a: First sequence of points.
    :param seq_b: Second sequence of points.
    :returns: Convolved point sequences.
    :complexity: O(n * m) time, O(n * m) space
    """

def convolve_two_segments(a1: tuple[float, float], a2: tuple[float, float], b1: tuple[float, float], b2: tuple[float, float]) -> list[tuple[float, float]]:
    r"""
    Convolve two line segments.
    
    :param a1: Start point of segment A.
    :param a2: End point of segment A.
    :param b1: Start point of segment B.
    :param b2: End point of segment B.
    :returns: Convolved point sequence.
    :complexity: O(1) time, O(1) space
    """

def get_inner_fit_polygon(outer: collections.abc.Sequence[types.Point], inner: collections.abc.Sequence[types.Point]) -> list[types.Polygon]:
    r"""
    Compute the inner fit polygon (no-fit polygon for nesting).
    
    :param outer: Outer polygon as (x, y) points.
    :param inner: Inner polygon as (x, y) points.
    :returns: Inner fit polygon.
    :complexity: O(n * m) time, O(n + m) space
    """

def get_no_fit_polygon(subject: collections.abc.Sequence[types.Point], tool: collections.abc.Sequence[types.Point]) -> list[types.Polygon]:
    r"""
    Compute the no-fit polygon for two 2D polygons.
    
    :param subject: Subject polygon as (x, y) points.
    :param tool: Tool polygon as (x, y) points.
    :returns: No-fit polygon.
    :complexity: O(n * m) time, O(n + m) space
    """

def get_polygon_minkowski_sum_convex(poly_a: collections.abc.Sequence[tuple[float, float]], poly_b: collections.abc.Sequence[tuple[float, float]]) -> list[list[tuple[float, float]]]:
    r"""
    Compute the Minkowski sum of two convex polygons.
    
    :param poly_a: First convex polygon as points.
    :param poly_b: Second convex polygon as points.
    :returns: Minkowski sum as list of polygons.
    :complexity: O(n + m) time, O(n + m) space
    """

