3 releases
| 0.1.0-alpha.2 | Aug 21, 2025 |
|---|---|
| 0.1.0-alpha.1 | Jul 15, 2025 |
| 0.1.0-alpha.0 | Jul 14, 2025 |
#163 in Data formats
28 downloads per month
2MB
19K
SLoC
draco-oxide
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.
Features
| Component | Alpha | Beta Roadmap |
|---|---|---|
| Mesh Encoder | ✅ | Performance optimization |
| Mesh Decoder | ❌ | ✅ |
| glTF Transcoder (basic) | ✅ | Animation and many more extensions |
Encoder Highlights
- Triangle‑mesh compression with configurable speed/ratio presets.
- Basic glTF transcoder (
*.gltfor*.glb→*.glbwith mesh buffer compressed via KHR_draco_mesh_compression extension). - Pure‑Rust implementation.
no_std+alloccompatible; builds to WASM32, x86_64, aarch64, and more.
Decoder (Coming Soon)
Planned for the beta milestone.
Getting Started
Add to Your Project
draco-oxide = "0.1.0-alpha.1"
Example: Encode an obj file.
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.
CLI
# 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
Roadmap to Beta
- Decoder Support.
- Complete glTF support.
Acknowledgements
- Google Draco – original C++ implementation
Contact
Re:Earth core committers: community@reearth.io
License
Licensed under either (at your discretion):
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
Dependencies
~21MB
~437K SLoC