Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
draco_decoder
draco_decoder is a Rust library for decoding Draco compressed meshes. It provides native and WebAssembly (WASM) support with efficient bindings to the official Draco C++ library.
Overview
-
Native:
The native part usescxxto create safe and ergonomic FFI bindings that directly connect to Draco's C++ decoding library. This allows efficient and zero-copy mesh decoding in native environments. -
WASM:
For WebAssembly targets,draco_decoderleverages the official Draco Emscripten build. It uses a JavaScript Worker to run the Draco decoder asynchronously, enabling non-blocking mesh decoding in the browser. The JavaScript implementation is available in a separate repository:
https://github.com/jiangheng90/draco_decoder_js.git
This design provides a unified Rust API while seamlessly switching between native and WASM implementations under the hood.
native/wasm usage
use ;
// some async wrapper
let mut config = new;
// Add attributes to decode (dimention and data type)
config.add_attribute;
config.add_attribute;
// Your Draco-encoded binary mesh data
let data: & = /* your Draco encoded data here */;
// Asynchronously decode the mesh data
let buf = decode_mesh.await;
// wrapper end
Performance
The performance of draco_decoder has been measured under different environments:
| Environment | Typical Decoding Time |
|---|---|
| Native (Release Build) | 3 ms – 7 ms |
| WebAssembly (WASM) | 30 ms – 50 ms |