cortex.polyutils.Surface.patches

Surface.patches(auxpts=None, n=1)[source]

Iterate over a small local patch of geometry around each vertex.

For each vertex p with at least one incident face, yields a patch of points sampled from p’s neighborhood, sized by n.

Parameters:
auxptsndarray, optional

Auxiliary per-vertex data (e.g. an alternate set of point coordinates) to stack alongside the patch’s own points.

n{1, 0.5}, optional

Size of the patch to extract around each vertex. If 1 (default), yields the coordinates of every vertex in p’s incident faces. If 0.5, yields only the half-edge points (face midpoints and edge midpoints) immediately surrounding p. Any other value raises ValueError.

Yields:
patchndarray or None

Points making up the patch around each vertex, in vertex order. None for vertices with no incident faces.