File size: 593 Bytes
9e15541
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from enum import Enum
from .semantic_kitti import save_semantic_kitti


# TODO: add more formats
class VoxelFormats(Enum):
    """Enum for voxel grid formats."""

    semantic_kitti = "semantic_kitti"


def save_voxel_grid(voxel_grid, path, format: VoxelFormats | str):
    """Save a voxel grid to a bin file."""
    if isinstance(format, str):
        format = VoxelFormats(format)

    match format:
        case VoxelFormats.semantic_kitti:
            save_semantic_kitti(voxel_grid, path, format)
        case _:
            raise NotImplementedError(f"Format {format} not implemented.")