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. Coordinates are copied into owned, read-only float64 storage. Editing the input does not move the aperture; construct a new aperture to change centers. The positions attribute cannot be reassigned. C-order, Fortran-order, and strided inputs are accepted. Input (x, y) gives scalar sums; [(x, y)] gives length-one vector sums.

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 constructor validation and assume valid geometry and finite positions with shape (2,) or (N, 2). Coordinates are still copied and converted to float64.