How google/draco works
Project type and purpose
• Draco is a C++ library and tool suite for compressing/decompressing 3D geometric meshes and point clouds.
• It provides command-line applications (draco_encoder, draco_decoder, draco_transcoder), C++ and JavaScript/WASM APIs for integration, plus Unity and Maya plugins.
File structure
Top-level directories and their roles:
• cmake / CMakeLists.txt / BUILDING.md / CMAKE.md – build configuration and custom toolchains.
• src/draco – the core C++ library, subdivided into modules:
– core (common utilities, buffers, status handling)
– io (file format parsers and writers: OBJ, PLY, glTF, STL, images)
– compression (encoder/decoder pipelines for attributes, bit coders, entropy, mesh, point clouds)
– mesh, point_cloud, metadata, scene, material, texture – data structures and metadata API
– javascript/emscripten – WebIDL bindings for generating WASM + JS modules
– tools – CLI apps and fuzzers
– unity, maya – native plugins for game engines
• javascript – prebuilt WASM/JS decoder and encoder wrappers plus NPM packages and examples.
• unity / maya – C# wrappers and native archives for engine integration.
• third_party – bundled dependencies (Eigen, googletest, tinygltf).
• docs – user documentation, website content, specification.
• testdata – geometry assets used by tests and examples.
README for additional insights
• Describes build steps (CMake), release artifacts (WASM + JS decoders on GStatic), and supported use cases: CLI, C++ API, JS API, Unity, glTF transcoding, metadata.
• Points out key architectural elements: modular library, Emscripten binding, separate encoder/decoder, plugin support.