PathAp

PathAp(positions, segments, holes=None, *, validate=True, plot_samples=96)

Aperture defined by a closed path of line segments and circular arcs.

PathAp supports only straight line segments and circular arcs. It does not accept Bezier curves, spline curves, elliptical arcs, Matplotlib Path objects, or arbitrary Python predicate/callback masks. If another curve type is flattened into line segments before construction, the resulting aperture is exact for that flattened line-segment path, not for the original curve.

Coordinates in segments and holes are local offsets from each aperture center. Angles are radians counterclockwise from the positive x axis.

Parameters

positions : tuple or array - like

Aperture center(s) as (x, y) pixel coordinates. Multiple centers as (N, 2) array-like.

segments : sequence of tuples

Outer contour commands. Must start with ('move', x, y), followed by any mix of ('line', x, y) and ('arc', cx, cy, r, theta0, dtheta), and end with ('close',). These are the only supported geometry commands.

holes : sequence of sequences = None

Zero or more hole contours, each using the same command language.

plot_samples : int = 96

Even number >= 4 used to sample arcs for plotting.

validate : bool = True

If False, skip Python-side validation.