Snap a raycast hit to the nearest geometry vertex within snapPixels on screen; otherwise return
the raw hit point. Works for meshes (triangle vertices), lines (segment endpoints), and points
(the vertex itself). Pure (no DOM) so it's unit-testable: it takes the screen size explicitly
rather than reading the canvas. Exported for that reason.
Falls back to the raw point for hits without usable vertex indices or positions.
Snap a raycast hit to the nearest geometry vertex within
snapPixelson screen; otherwise return the raw hit point. Works for meshes (triangle vertices), lines (segment endpoints), and points (the vertex itself). Pure (no DOM) so it's unit-testable: it takes the screen size explicitly rather than reading the canvas. Exported for that reason.Falls back to the raw point for hits without usable vertex indices or positions.