studies.selection.NodeSelection

studies.selection.NodeSelection()

A composable, mesh-independent description of a region of space.

Build concrete selections via the :class:Nodes factory namespace and combine them with & (intersection), | (union) and ~ (complement). Evaluate with :meth:contains (boolean mask over any points, volumetric), :meth:mask (boolean mask over all mesh nodes, true only at boundary nodes) or :meth:resolve (selected boundary node indices, raising if empty).

Attributes

Name Description
serializable Whether :meth:describe round-trips (false only for predicates).

Methods

Name Description
contains Which of points satisfy the criterion, ignoring any surface.
describe JSON-ready description: kind plus numeric parameters.
mask Boolean node mask over mesh, restricted to boundary nodes.
resolve Selected node indices of mesh as an int32 array.

contains

studies.selection.NodeSelection.contains(points)

Which of points satisfy the criterion, ignoring any surface.

The mesh-free evaluation: pure geometry, volumetric, and shaped like points without its last axis. ~selection here means every point outside the region, not “the rest of a surface” — see :meth:mask for the boundary-restricted reading.

Parameters

Name Type Description Default
points Any An (..., 3) array of world coordinates. required

Returns

Name Type Description
np.ndarray A boolean array shaped like points without its last axis.

Raises

Name Type Description
ValueError For :meth:Nodes.side, which names an extreme of a mesh’s boundary and so cannot be read from points alone.

describe

studies.selection.NodeSelection.describe()

JSON-ready description: kind plus numeric parameters.

mask

studies.selection.NodeSelection.mask(mesh)

Boolean node mask over mesh, restricted to boundary nodes.

resolve

studies.selection.NodeSelection.resolve(mesh)

Selected node indices of mesh as an int32 array.

Raises

Name Type Description
ValueError If the selection matches no boundary node.