#magica-voxel #voxel #model

create_vox

A rust library for creating magicavoxel files

9 releases (2 stable)

1.0.1 Aug 8, 2022
1.0.0 Aug 4, 2021
0.6.0 Apr 15, 2021
0.5.0 Apr 11, 2021
0.1.1 Mar 27, 2021

#306 in Graphics APIs

MIT license

62KB
1.5K SLoC

Creating vox files in Rust

A Rust library for easily creating and loading magicavoxel files. Includes all functionality for creating and reading a .vox file. Supports multiple models and copies of models in the same .vox file.

Example

creating a file:

//creates a vox file with a red cube in the center.
let mut cube_vox = VoxFile::new(100,100,100);
cube_vox.set_palette_color(255,255,0,0,255);
cube_vox.models[0].add_cube(25,25,25,75,75,75,255).unwrap();
cube_vox.save("red_cube.vox");

loading a file:

//opens a file and then auto scales it
let mut new_vox = VoxFile::load("my_vox.vox");
new_vox.models[0].auto_size();
new_vox.save("new_vox.vox");

No runtime deps