Skip to main content

Utility for creating volumetric mesh container files in glTF format.

Project description

Volumesh

Utility for creating volumetric mesh container files in glTF format.

Hypergrid

Hypergrid example (hypergrid.glb) (Source: Justin Jensen)

Installation

pip install volumesh

Draco Compression

To install the Google Draco compression, the DracoPy library is required. As it is still under development, we only include it when the extra draco is specified.

pip install "volumesh[draco]"

Usage

To convert a sequence of OBJ files into a volumesh container use the following command:

volumesh ./data test.glb

First specify the folder where the OBJs are located (data) and then the output file (test.glb). Use the --compressed flag if you have draco extras installed and want to compress the container. The following information is stored in the mesh, if available::

  • vertices
  • triangle indices
  • normals
  • vertex-uvs
  • textures (png / jpeg)

Limitations

When Draco compression is enabled, only vertex and triangle information is stored in the mesh. This is due to the fact that DracoPy only supports these two primitives. At the moment we recommend not to use the internal compression, but to convert the sequence to a glb file and convert it later with the gltf-pipeline. This gives a much better compression and still contains all the information:

gltf-pipeline -i .\sequence.glb -o .\sequence-draco.glb -d

Animation

To use the GLTF animation system to render the meshes in a sequence, it is possible to specify the frame rate (default 24) and set the animation flag. Volumesh will add an animation track that will fade the objects in and out using the GLTF animation tools.

volumesh ./human test.glb --animate --fps 24

Help

usage: volumesh [-h] [--compressed] [--jpeg-textures]
                [--jpeg-quality JPEG_QUALITY] [--animate] [--fps FPS]
                [-tex TEXTURE_SIZE] [--load-safe]
                input output

A utility to create volumesh files.

positional arguments:
  input                 Path to the mesh (*.obj) files (directory).
  output                GLTF output file (.glb).

options:
  -h, --help            show this help message and exit
  --compressed          Compress the mesh data with Draco compression.
  --jpeg-textures       Use JPEG compression for textures instead of PNG.
  --jpeg-quality JPEG_QUALITY
                        JPEG quality parameter.
  --animate             Animate mesh frames with GLTF animation system.
  --fps FPS             Animation frames per second (fps).
  -tex TEXTURE_SIZE, --texture-size TEXTURE_SIZE
                        Limit texture size to the specified width.
  --load-safe           Load meshes slow but save.

About

Copyright (c) 2024 Zurich University of the Arts ZHdK

ZHdK Logo

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

volumesh-1.3.0-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file volumesh-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: volumesh-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for volumesh-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 49805be662d6c1779ab8e291d897671fb2de69311bfc616c6f83f78c96a118f1
MD5 953bb6c8799e31f9bc36705955876b5f
BLAKE2b-256 942a41a28e25ea5ce7474a9d855e20cdb5486af679810362eebab87a85a1d7b7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page