Skip to main content

Module pick

Module pick 

Source
Expand description

Picking in Rust (R23/R24), replacing the retired raycaster + selectionMethods._pickAtEvent: returns KERNEL NAMES with the candidate priority order VERTEX > EDGE > FACE > … > SOLID, CSS-pixel thresholds for lines/points (the earlier picker’s worldPerPixel * 6 is exactly 6 CSS px), a double-sided face toggle, and a ranked candidate list feeding the host’s multi-candidate popup. Selection-filter filtering stays in the UI layer where the filter state lives — the engine reports everything under the cursor.

CPU ray/screen-space testing over the scene’s display buffers: exact, deterministic, identical on native and wasm, and cheap at CAD face counts (per-face triangle ranges give a bbox reject before any triangle test).

Structs§

PickCandidate
PickOptions

Enums§

PickKind

Constants§

EDGE_PICK_PX
Pick thresholds in CSS pixels (ported from selectionMethods).
VERTEX_PICK_PX

Functions§

candidates_to_json
Serialize candidates for the R3 JSON boundary.
pick
Rank candidates under CSS-pixel (x, y). Ordered by the priority chain then depth; a SOLID entry per hit solid is appended at the end (the earlier “extras” behavior).
pick_filtered
The nearest hit of an ALLOWED KIND under CSS-pixel (x, y), using the same ranking as pick. filter is a set of kind strings ("SOLID", "FACE", "EDGE", "VERTEX", case-insensitive); an empty filter means any kind. This is the type-constrained pick the reference-selection widget uses so a targetSolid field resolves the SOLID under the cursor (candidates rank faces first, then the trailing SOLID entry — find walks that order and returns the first candidate whose kind is allowed). Returns the full candidate (name + owning solid + position) or None on a miss.