JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q43846F
  • License MIT

Interface for the svox file format

Package Exports

  • svox
  • svox/dist/index.js
  • svox/dist/index.mjs

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (svox) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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