| Crates.io | draco-oxide |
| lib.rs | draco-oxide |
| version | 0.1.0-alpha.2 |
| created_at | 2025-07-14 08:13:44.18188+00 |
| updated_at | 2025-08-21 08:02:56.230932+00 |
| description | draco-oxide is a rust rewrite of Google's draco mesh compression library. |
| homepage | https://github.com/reearth/draco-oxide |
| repository | https://github.com/reearth/draco-oxide |
| max_upload_size | |
| id | 1751344 |
| size | 6,399,438 |
draco-oxide is a high-performance Rust re-write of Google’s Draco 3D-mesh compression library, featuring efficient streaming I/O and seamless WebAssembly integration.
Status: Alpha – Encoder is functional; decoder implementation is work‑in‑progress.
| Component | Alpha | Beta Roadmap |
|---|---|---|
| Mesh Encoder | ✅ | Performance optimization |
| Mesh Decoder | ❌ | ✅ |
| glTF Transcoder (basic) | ✅ | Animation and many more extensions |
*.gltf or *.glb → *.glb with mesh buffer compressed via KHR_draco_mesh_compression extension).no_std + alloc compatible; builds to WASM32, x86_64, aarch64, and more.Planned for the beta milestone.
draco-oxide = "0.1.0-alpha.1"
use draco_oxide::{encode::{self, encode}, io::obj::load_obj};
use draco_oxide::prelude::ConfigType;
use std::io::Write;
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create mesh from an obj file.
let mesh = load_obj("mesh.obj").unwrap();
// Create a buffer that we write the encoded data to.
// This time we use 'Vec<u8>' as the output buffer, but
// draco-oxide can stream-write to anything
// that implements 'draco_oxide::prelude::ByteWriter'.
let mut buffer = Vec::new();
// Encode the mesh into the buffer.
encode(mesh, &mut buffer, encode::Config::default()).unwrap();
let mut file = std::fs::File::create("output.drc").unwrap();
file.write_all(&buffer)?;
Ok(())
}
See the draco-oxide/examples directory for more.
# compress input.obj into a draco file output.drc
cargo run --bin cli -- -i path/to/input.obj -o path/to/output.drc
# transcode input.glb into a draco compressed glb file output.glb as specified
# in KHR_draco_mesh_compression extension.
cargo run --bin cli -- --transcode -i path/to/input.glb -o path/to/output.glb
Re:Earth core committers: community@reearth.io
Licensed under either (at your discretion):