Skip to main content

Crate polysmelt

Crate polysmelt 

Source
Expand description

Pure-Rust 3D asset interchange, with glTF as the hub.

  • formats: readers for STL, PLY, MagicaVoxel, OBJ, FBX, 3DS, 3MF, USD, glTF and SketchUp, each behind a cargo feature, producing a Document.
  • document: that common form, a glTF 2.0 document (JSON and buffers) written out as a GLB as it is, flattened into a posed Mesh on demand, and pruned to what a Keep asks for.
  • mesh: the flat triangle-list model, written out as a GLB.
  • assets: how readers find the textures and material libraries a model refers to.
  • images: handles on a document’s images, for those a load found but didn’t read.
  • gltf: GLB packing, and meshopt compression added to or decoded away from a GLB.
  • meshopt: the EXT_meshopt_compression and KHR_meshopt_compression bitstreams.

Modules§

assets
Finding the files a model refers to (MTL libraries, textures) and turning texture bytes into embeddable images.
document
The common form every reader produces: a glTF 2.0 document, its JSON and its buffers’ bytes, carrying whatever the source had (scene graph, animation, skins, morph targets, materials, cameras, lights, names, extras).
formats
Model formats read natively: STL (binary and ASCII), PLY (ASCII and binary), MagicaVoxel .vox, OBJ (with its MTL materials and textures), FBX (binary and ASCII), 3DS, 3MF, USD, glTF (.gltf and .glb) and SketchUp (.skp). Each becomes a Document: glTF as it is, the others converted; textures are embedded so the document stands on its own. Each format is behind a cargo feature of its name (3ds and 3mf for those two). A Keep says what to keep; by default, everything.
gltf
glTF 2.0 containers: packing a .gltf and the files it names into one GLB, and adding or decoding away meshopt compression (EXT_meshopt_compression, KHR_meshopt_compression).
images
Images a document names without having read them: what a load with Keep::image_bytes off leaves, as handles from Document::images.
mesh
A model as plain triangle lists: what the format readers produce, written out as a GLB.
meshopt
The EXT_meshopt_compression bitstreams: meshoptimizer’s attribute (v0) and triangle (v1) encoders, the octahedral filter’s encoder, and decoders for every mode and filter.

Enums§

Error
What can go wrong reading or writing an asset.

Type Aliases§

Result
A result with Error.