studies.selection.Nodes

studies.selection.Nodes()

Factory namespace for :class:NodeSelection values.

All constructors take plain floats and 3-lists so a UI can emit them as literal source text; the resulting selections are combined with &, | and ~ and always resolve to boundary nodes.

Methods

Name Description
box Nodes inside the axis-aligned box [min_corner, max_corner].
cylinder Nodes inside a (possibly hollow, possibly finite) cylinder about a line.
halfspace Nodes on the normal side of the plane through point.
predicate Escape hatch: select nodes by an arbitrary vectorized callable.
side Nodes on the axis-extreme boundary plane of the mesh.
sphere Nodes within radius of center.

box

studies.selection.Nodes.box(min_corner, max_corner)

Nodes inside the axis-aligned box [min_corner, max_corner].

Parameters

Name Type Description Default
min_corner Any Lower corner, three finite numbers. required
max_corner Any Upper corner, three finite numbers (componentwise at least min_corner). required

cylinder

studies.selection.Nodes.cylinder(
    center,
    axis,
    radius,
    *,
    inner=0.0,
    half_length=None,
)

Nodes inside a (possibly hollow, possibly finite) cylinder about a line.

The natural selector for anything on a part’s own axis of revolution — a bearing seat wall, a bore, a cooling jacket — where a box picks up the corners and a sphere the wrong height.

Parameters

Name Type Description Default
center Any A point on the axis, three finite numbers. required
axis Any Axis direction (need not be unit length, must be nonzero). required
radius Any Positive finite outer radius. required
inner Any Inner radius of an annulus, 0 (the default) for a full cylinder; must be finite, non-negative and below radius. 0.0
half_length Any Half the axial extent about center, or None (the default) for an infinite cylinder. None

halfspace

studies.selection.Nodes.halfspace(point, normal)

Nodes on the normal side of the plane through point.

Selects nodes x with dot(x - point, normal) >= 0.

Parameters

Name Type Description Default
point Any Any point on the plane, three finite numbers. required
normal Any Plane normal pointing into the selected halfspace (need not be unit length, must be nonzero). required

predicate

studies.selection.Nodes.predicate(fn)

Escape hatch: select nodes by an arbitrary vectorized callable.

fn receives the (N, 3) array of all mesh node positions and returns a boolean mask of shape (N,); the result is intersected with the boundary-node set like every other selection. Predicate selections are the one non-serializable kind: :meth:~NodeSelection. describe reports only the callable’s name.

Parameters

Name Type Description Default
fn Callable[[np.ndarray], Any] Vectorized (N, 3) -> (N,) boolean callable. required

side

studies.selection.Nodes.side(side, tol=None)

Nodes on the axis-extreme boundary plane of the mesh.

Nodes.side("+x") selects boundary nodes whose x coordinate is within tol of the largest x over all boundary nodes — for a bar this is the end face; for curved geometry it is the extreme cap.

Parameters

Name Type Description Default
side SideLike A :class:~cadjoint.enums.Side, or its plain string spelling: one of "+x", "-x", "+y", "-y", "+z", "-z". required
tol float | None Capture distance from the extreme plane. None (the default) resolves per mesh to half the smallest cell spacing. None

sphere

studies.selection.Nodes.sphere(center, radius)

Nodes within radius of center.

Parameters

Name Type Description Default
center Any Sphere center, three finite numbers. required
radius Any Positive finite radius. required