Have you seen the VDB tree...?
VDB: High-Resolution Sparse Volumes with Dynamic Topology (Academy Award Winning data structure)
http://www.museth.org/Ken/Publications_files/Museth_TOG13.pd...
OpenVDB is an open-source C++ implementation with Python wrappers: https://ken.museth.org/OpenVDB.html
https://github.com/dreamworksanimation/openvdb
Ken works at SpaceX now, but a few years ago he gave a lecture on VDB at the Berkeley Institute for Data Science (BIDS)...
OpenVDB: An Open Source Data Structure and Toolkit for High-Resolution Volumes [video] https://www.youtube.com/watch?v=7hUH92xwODg