跳转到主要内容

raygeo.nest.ifp

Inner-Fit Polygon (IFP) calculation for nesting algorithms.

Provides functions for computing Inner-Fit Polygons, which define the valid placement region for a part inside a bin.

Functions

build_no_go_zones()

build_no_go_zones(bin: collections.abc.Sequence[types.Point], part_neg: collections.abc.Sequence[types.Point]) -> list[types.Polygon]

Build the no-go zones for a bin-part pair.

Returns: List of no-go zone polygons.

ParameterTypeDescription
bincollections.abc.Sequence[types.Point]Bin polygon as (x, y) points.
part_negcollections.abc.Sequence[types.Point]Orbiting polygon negated as (x, y) points.
Returnslist[types.Polygon]

inner_fit_polygon()

inner_fit_polygon(bin: collections.abc.Sequence[types.Point], part: collections.abc.Sequence[types.Point]) -> list[types.Polygon]

Compute the Inner-Fit Polygon (IFP) for a part inside a bin.

Returns: List of IFP polygons.

ParameterTypeDescription
bincollections.abc.Sequence[types.Point]Bin polygon as (x, y) points.
partcollections.abc.Sequence[types.Point]Part polygon as (x, y) points.
Returnslist[types.Polygon]

sweep_hull_for_edge()

sweep_hull_for_edge(p1: types.Point, p2: types.Point, part_neg: collections.abc.Sequence[types.Point]) -> types.Polygon

Compute the convex hull sweep of part_neg along the edge p1->p2.

Returns: Convex hull polygon.

ParameterTypeDescription
p1types.PointFirst edge endpoint.
p2types.PointSecond edge endpoint.
part_negcollections.abc.Sequence[types.Point]Orbiting polygon negated as (x, y) points.
Returnstypes.Polygon