Mirrors points/chunk-index-loader.ts but with the dual-bounds
shape lines requires: every chunk lookup carries both a vertex-
chunk-bounds blob and a segment-chunk-bounds blob, since a query
scan on the segment side still needs vertex-side metadata for byte
accounting and for re-enabling vertex-driven prefetching.
Wraps the shared fetchChunkBoundsArray helper with the lines-only
validation rules (size mismatches against n_vertices × vertex_ordering.chunk_size and the segment-side equivalent) and
folds the two Float32Arrays into the LinesDualChunkIndex shape
that SpatialQueryBuilder consumes via its segment side.
Also re-exposes the prefetcher's registerArrayBounds call as a
tiny path-prefixing helper so the lines loader doesn't need to know
how the path is normalized — same shape as the points equivalent
in points/chunk-index-loader.ts.
The lines-specific vertex-index helpers live here too —
sortedUniqueVertexIndices, computeVertexRangesFromIndices, and
remapSegmentIndices (run after a query returns segment indices, to
coalesce the unique referenced vertex indices into contiguous runs
and remap them to local buffer positions). They operate on
per-segment vertex indices, not on chunk bounds, but conceptually
belong to the lines spatial-index path.
Lines-specific chunk-index probe + array-bounds registration.
Mirrors
points/chunk-index-loader.tsbut with the dual-bounds shape lines requires: every chunk lookup carries both a vertex- chunk-bounds blob and a segment-chunk-bounds blob, since a query scan on the segment side still needs vertex-side metadata for byte accounting and for re-enabling vertex-driven prefetching.Wraps the shared
fetchChunkBoundsArrayhelper with the lines-only validation rules (size mismatches againstn_vertices × vertex_ordering.chunk_sizeand the segment-side equivalent) and folds the twoFloat32Arrays into theLinesDualChunkIndexshape thatSpatialQueryBuilderconsumes via its segment side.Also re-exposes the prefetcher's
registerArrayBoundscall as a tiny path-prefixing helper so the lines loader doesn't need to know how the path is normalized — same shape as the points equivalent inpoints/chunk-index-loader.ts.The lines-specific vertex-index helpers live here too —
sortedUniqueVertexIndices,computeVertexRangesFromIndices, andremapSegmentIndices(run after a query returns segment indices, to coalesce the unique referenced vertex indices into contiguous runs and remap them to local buffer positions). They operate on per-segment vertex indices, not on chunk bounds, but conceptually belong to the lines spatial-index path.