Internal squared point-to-box lower bound for admitted nearest-query data.
Bounds and point use XYZ metres; cutoff is the running nonnegative squared
distance, with infinity admitting the complete sum. The signed-query owner
validates finite coordinates and representable distance arithmetic before
traversal; this hot primitive borrows that admission and checks no buffers.
Terms accumulate in X/Y/Z order, matching the complete squared distance.
A partial sum strictly above cutoff can return immediately because adding
nonnegative squared terms cannot lower it. Such a return is a pruning
witness, not the full box distance. Equality continues, preserving equal
distance candidates and original triangle tie-breaking. Node ordering omits
cutoff and therefore receives the unchanged complete distance.
Internal squared point-to-box lower bound for admitted nearest-query data. Bounds and point use XYZ metres; cutoff is the running nonnegative squared distance, with infinity admitting the complete sum. The signed-query owner validates finite coordinates and representable distance arithmetic before traversal; this hot primitive borrows that admission and checks no buffers.
Terms accumulate in X/Y/Z order, matching the complete squared distance. A partial sum strictly above cutoff can return immediately because adding nonnegative squared terms cannot lower it. Such a return is a pruning witness, not the full box distance. Equality continues, preserving equal distance candidates and original triangle tie-breaking. Node ordering omits cutoff and therefore receives the unchanged complete distance.