The SVOX file format is based on MagicaVoxel's file format .vox
which always includes the full color palette for any given amount of voxels. This can lead to the file containing unnecessary data (since the whole range of colors in the palette is often not needed). It can be especially impactful for transmitting smaller assets (which are usually < 256 Voxels) over a network.
// With npm
npm i svox
// With yarn
yarn add svox
// With pnpm
pnpm add svox
// CommonJS
const SVOX = require('svox');
// ESModules
import SVOX from 'svox';
// Takes an existing ArrayBuffer containing SVOX data and parses it to an object
SVOX.fromSVOX(file)
// Takes an existing ArrayBuffer containing VOX data and parses it to an object
SVOX.fromVOX(file)
// Takes an existing Object consisting of voxel and palette entries and converts it to SVOX binary data
SVOX.toSVOX(svoxGroup)
The file structure can be found here: check out filestructure
Check out the Changelog