Skip to main content

Module spatial_index_section

Module spatial_index_section 

Source
Expand description

.10d Spatial-index section — BVH node array + kd-tree node array serialized as a self-describing section (P3.7).

Layout:

[SpatialIndexMiniHeader: 32 bytes]
[bvh_nodes:  B * 40 bytes  (BvhNode)]
[bvh_prim_indices: B * 4 bytes]
[kd_nodes:   K * 32 bytes  (KdNode)]
[kd_point_indices: K * 4 bytes]

All arrays are little-endian, 4-byte aligned. The section is deterministic: identical input yields byte-identical output. Per-section CRC-32C is handled by the container’s section-table encoder.

Structs§

DecodedSpatialIndex
Decoded spatial-index section.
SpatialIndexMiniHeader
The 32-byte SpatialIndex-section mini-header.

Enums§

SpatialIndexSectionError
Spatial-index-section encode/decode error.

Constants§

MAX_BVH_NODE_COUNT
Maximum node count (bounded by 42MB Sentinel).
MAX_KD_NODE_COUNT
SPATIAL_INDEX_MINI_HEADER_SIZE
Mini-header size in bytes.

Functions§

decode_spatial_index_section
Decode a spatial-index section from a raw payload.
encode_spatial_index_section
Encode a spatial-index section from BVH and kd-tree node arrays.
encoded_len
Compute the encoded byte length for a spatial-index section.