Skip to main content

Module voxel_section

Module voxel_section 

Source
Expand description

Section 22 (VOX0): 3D Sparse Voxel Octree / DAG Lattice Section.

Encodes volumetric underground strata, cavities, root networks, and CSG excavations using a 16-byte cache-friendly Directed Acyclic Graph (Vox0DagNode).

§16-Byte POD Binary Layout (Vox0DagNode)

OffsetTypeFieldDescription
0x00u8child_maskValid child octant presence bitmask (8 bits)
0x01u8leaf_maskOctants terminating as leaves (8 bits)
0x02u8primary_material_lutMajority constituent LUT index (0..255)
0x03u8secondary_material_lutSecondary constituent LUT index (0..255)
0x04u32child_ptr_or_densitySVO index to child cluster, or packed density
0x08[i8; 2]normal_oct_snorm8Octahedral encoded surface normal vector
0x0Au8moisture_u8Volumetric water saturation Sw (0..255)
0x0Bu8compaction_u8Overburden compaction / hardness metric
0x0Cu16node_crc16Integrity checksum over bytes 0..11
0x0E[u8; 2]_reservedExplicit zero padding to 16 bytes

Structs§

Vox0DagNode
16-Byte POD Node Record for Sparse Voxel Octrees and DAGs.
VoxelSectionMiniHeader
64-Byte POD Mini Header for SectionType::VoxelLattice (22).

Enums§

VoxelSectionError
Errors during voxel section encode/decode.

Constants§

FLAG_VOXEL_COMPACT_DAG
FLAG_VOXEL_HAS_EXCAVATIONS
MAGIC_VOX0
VOX0_NODE_SIZE
VOXEL_MINI_HEADER_SIZE
VOXEL_SECTION_VERSION

Functions§

encode_voxel_section
Encode a voxel section into a caller-supplied fixed slice without heap allocation.
parse_voxel_section
Zero-copy parse a voxel section from a byte slice.