svox
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

Smaller Vox files with SVOX

SVOX a fileformat for storing voxel based position and color data


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.

Installation

// With npm
npm i svox

// With yarn
yarn add svox

// With pnpm
pnpm add svox

Usage

// 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)

File structure

The file structure can be found here: check out filestructure

Changelog

Check out the Changelog

Package Sidebar

Install

npm i svox

Weekly Downloads

1

Version

1.1.1

License

MIT

Unpacked Size

85.1 kB

Total Files

12

Last publish

Collaborators

  • f2hafner