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 (dense meshes use cached kernel BVHs before exact triangle tests).
Structs§
Enums§
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.
- nearest_
face_ depth - The view depth of the nearest FACE of
sceneunder CSS-pixel(x, y), if any: what a translucent context scene puts in front of the clicked point. - 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 aspick.filteris 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 atargetSolidfield resolves the SOLID under the cursor (candidates rank faces first, then the trailing SOLID entry —findwalks that order and returns the first candidate whose kind is allowed). Returns the full candidate (name + owning solid + position) orNoneon a miss. - pick_
unoccluded pickinscene, without whatcontexthides: a candidate deeper than the nearest context face under the cursor is behind that face. A context drawn translucent (a Work part’s surrounding assembly) is still in front, so a click on it is not a click on the part behind it. Touching faces (a mating face flush with the context) stay pickable.