Crates.io | pmfextract |
lib.rs | pmfextract |
version | 0.1.0 |
source | src |
created_at | 2021-03-31 13:51:25.842037 |
updated_at | 2021-03-31 13:51:25.842037 |
description | A utility tool that extracts PolyMesh files |
homepage | |
repository | https://github.com/Ewpratten/polymesh |
max_upload_size | |
id | 376154 |
size | 47,165 |
PolyMesh is a custom 3D object description file format I designed as an experiment. The PolyMesh file format and toolset are specifically designed for 3D rendering applications.
The PolyMesh file format (pmf
) is a gzip file containing a structured directory tree of JSON files. Each level of the tree contains a descriptor polymeta.json
file, which describes the directory. The lowest level directories all contain mesh.json
files, which describe a 3D mesh using a collection of basic polygons. Each level of a PolyMesh file should be thought of as its own 3D mesh. Higher level meshes can include lower level meshes to build more complex meshes.
All meshes are relatively positioned. This means that the lowest level meshes should all be centered on [0,0,0]
so that higher level meshes can include them and transform them as needed. PolyMesh files can be packed and unpacked using the pmfpack
and pmfextract
tools. When a PolyMesh is unpacked, it can be re-packed at a lower level, which is why it is important to keep all meshes relatively positioned. A PolyMesh that describes a cafe scene can also be re-packed to only describe a coffee cup that would be on a table in the main scene.
An example 3D object is available in example_meshes/default_cube
This repository provides a few CLI tools for working with PolyMeshes:
pmfpack
default_cube
example) into a single .pmf
filepmfextract
.pmf
file into an uncompressed directorypmftree
.pmf
file in a style similar to the tree
commandpmfview
.pmf
file. Inspired by Pixar's usdview
. Built on raylibvox2pmf
.vox
format to a PolyMeshpmfcube
[0,0,0]
with the size of 1 unitlibpolymesh
is available for use as its own separate Rust library, and is currently a work-in-progress.
This project shouldn't actually care which coordinate system is used, but I program it using the "Y-up, right-handed" rule.
This monorepo has a few system dependencies:
# Install GUI libraries
sudo apt install libasound2-dev mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev libgl1-mesa-dev libglu1-mesa-dev
# Install the workspace wrangling tools
cargo install cargo-token
cargo install cargo-unleash --version 1.0.0-alpha.11