-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
Hello everyone! It took me about a month of vibe coding in my spare time to create the Draco library entirely in Rust. It wasn't easy and required a lot of patience, but I'm finally happy to share the code with everyone:
https://github.com/Filyus/draco/tree/api
First, I split the C++ code into two projects and moved all the .cc files to root folders:
- https://github.com/Filyus/draco/tree/api/draco_core
- https://github.com/Filyus/draco/tree/api/draco_io
Then I created the code in Rust:
https://github.com/Filyus/draco/tree/api/crates
I also split it into draco-core and draco-io, which supports converting geometry (and, if possible, normals) to and from GLTF/GLB, FBX, OBJ, and PLY.
I also wrote WASM modules and a sample web application for conversion:
https://github.com/Filyus/draco/tree/api/web
As a result, the size of gltf_reader.wasm is 203 KB, compared to draco_decoder.wasm, which is 279 KB from the original library. My module supports GLTF/GLB in addition to Draco's decoding capabilities.
The code successfully passes about 150 tests and compiles without errors or warnings. There are still some extra files in the repository, but I plan to remove them soon. I'm open to suggestions and help improving the code.
TODO:
Fix EdgeBreaker with normals and multi-attribute encoding.