Expand description
§Overview
This crate provides a reader and write for MagicaVoxel’s VOX files. It was designed with the
in mind to keep copying to a minimum. While you can read a full VOX file
into a VoxData and then read or manipulate its data, there’s also an
interface to construct your own voxel data from a VOX file.
If you’re looking for a command-line utility to manipulate VOX files, take a look at vox-tool.
vox-tool is written using vox-format. so everything it does, can also be
achieved using only this crate in Rust.
§Features
§image support
This crate has support for some conversion between its types and image
types. Specifically between crate::types::Color and Rgba<u8>. But it
also provides methods to read and write palettes from images.
§mint and nalgebra support
The feature mint and nalgebra enables conversion for
crate::types::Vector for these crates.
§palette support
This feature enables conversion between crate::types::Color and
Srgb<u8> from the palette crate.
§serialize
Enables serialization using serde for types in crate::types and
crate::data::VoxData.
§This crate is work-in-progress
Although this crate has a very limited scope and already mostly implements it, it is missing some features and isn’t well-tested yet. This will change soon, but if you just can’t wait, you’re welcome to contribute 🥺.
§Examples
Reads crate::data::VoxData from path:
let vox_data = vox_format::from_file(path).unwrap();
println!("{:#?}", vox_data);Re-exports§
pub use crate::data::VoxData;pub use crate::reader::from_file;pub use crate::reader::from_reader;pub use crate::reader::from_slice;pub use crate::writer::to_file;pub use crate::writer::to_vec;pub use crate::writer::to_writer;
Modules§
- chunk
- This modules provides utilities to read and write VOX files as chunks, but is agnostic to the content of these chunks.
- data
- Contains trait for for reading voxel data, and a simple implementation for it.
- default_
palette - Defines the default palette used by MagicaVoxel.
- reader
- Provides functions to read VOX files.
- types
- Basic types
- writer
- Provides functions to write VOX files. This is work-in-progress.