voxsmith 0.1.0

Utilities for working with voxels.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use crate::voxj_serde_file_from_vox_state;
use std::io;
use voxcore::VoxState;
use voxj_codec::to_voxj_file_bytes;

/// Writes a [`VoxState`] to compact `.voxj` JSON bytes, choosing the smallest
/// block encodings per object. The document is stamped with the current voxj
/// format version.
pub fn vox_state_to_voxj_bytes(state: &VoxState) -> io::Result<Vec<u8>> {
    let serde_file = voxj_serde_file_from_vox_state(state)?;
    to_voxj_file_bytes(&serde_file).map_err(io::Error::other)
}