{"id":13439378,"url":"https://github.com/google/draco","last_synced_at":"2025-05-12T03:48:46.049Z","repository":{"id":37484534,"uuid":"75662387","full_name":"google/draco","owner":"google","description":"Draco is a library for compressing and decompressing 3D geometric meshes and point clouds. It is intended to improve the storage and transmission of 3D graphics.","archived":false,"fork":false,"pushed_at":"2025-03-10T22:13:43.000Z","size":225526,"stargazers_count":6743,"open_issues_count":148,"forks_count":991,"subscribers_count":218,"default_branch":"main","last_synced_at":"2025-05-01T01:51:22.424Z","etag":null,"topics":["3d-graphics","compression","mesh","point-cloud"],"latest_commit_sha":null,"homepage":"https://google.github.io/draco/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/google.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-12-05T20:14:02.000Z","updated_at":"2025-05-01T00:11:56.000Z","dependencies_parsed_at":"2025-04-17T05:56:37.711Z","dependency_job_id":null,"html_url":"https://github.com/google/draco","commit_stats":{"total_commits":419,"total_committers":68,"mean_commits":6.161764705882353,"dds":0.7780429594272076,"last_synced_commit":"8786740086a9f4d83f44aa83badfbea4dce7a1b5"},"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fdraco","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fdraco/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fdraco/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fdraco/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/google","download_url":"https://codeload.github.com/google/draco/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251837309,"owners_count":21651757,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["3d-graphics","compression","mesh","point-cloud"],"created_at":"2024-07-31T03:01:13.403Z","updated_at":"2025-05-01T10:13:18.838Z","avatar_url":"https://github.com/google.png","language":"C++","readme":"\u003cp align=\"center\"\u003e\n\u003cimg width=\"350px\" src=\"docs/artwork/draco3d-vert.svg\" /\u003e\n\u003c/p\u003e\n\n[![draco-ci](https://github.com/google/draco/workflows/draco-ci/badge.svg?branch=main)](https://github.com/google/draco/actions/workflows/ci.yml)\n\nNews\n=======\n\nAttention GStatic users: the Draco team strongly recommends using the versioned\nURLs for accessing Draco GStatic content. If you are using the URLs that include\nthe `v1/decoders` substring within the URL, edge caching and GStatic propagation\ndelays can result in transient errors that can be difficult to diagnose when\nnew Draco releases are launched. To avoid the issue pin your sites to a\nversioned release.\n\n### Version 1.5.7 release:\n* Using the versioned www.gstatic.com WASM and Javascript decoders continues\n  to be recommended. To use v1.5.7, use this URL:\n  * https://www.gstatic.com/draco/versioned/decoders/1.5.7/*\n* Added support for normalized attributes to Emscripten encoder API.\n* Bug fixes.\n* Security fixes.\n\n### Version 1.5.6 release:\n* Using the versioned www.gstatic.com WASM and Javascript decoders continues\n  to be recommended. To use v1.5.6, use this URL:\n  * https://www.gstatic.com/draco/versioned/decoders/1.5.6/*\n* The CMake flag DRACO_DEBUG_MSVC_WARNINGS has been replaced with\n  DRACO_DEBUG_COMPILER_WARNINGS, and the behavior has changed. It is now a\n  boolean flag defined in draco_options.cmake.\n* Bug fixes.\n* Security fixes.\n\n### Version 1.5.5 release:\n* Using the versioned www.gstatic.com WASM and Javascript decoders continues\n  to be recommended. To use v1.5.5, use this URL:\n  * https://www.gstatic.com/draco/versioned/decoders/1.5.5/*\n* Bug fix: https://github.com/google/draco/issues/935\n\n### Version 1.5.4 release:\n* Using the versioned www.gstatic.com WASM and Javascript decoders continues\n  to be recommended. To use v1.5.4, use this URL:\n  * https://www.gstatic.com/draco/versioned/decoders/1.5.4/*\n* Added partial support for glTF extensions EXT_mesh_features and\n  EXT_structural_metadata.\n* Bug fixes.\n* Security fixes.\n\n### Version 1.5.3 release:\n* Using the versioned www.gstatic.com WASM and Javascript decoders continues\n  to be recommended. To use v1.5.3, use this URL:\n  * https://www.gstatic.com/draco/versioned/decoders/1.5.3/*\n* Bug fixes.\n\n### Version 1.5.2 release\n* This is the same as v1.5.1 with the following two bug fixes:\n  * Fixes DRACO_TRANSCODER_SUPPORTED enabled builds.\n  * ABI version updated.\n\n### Version 1.5.1 release\n* Adds assertion enabled Emscripten builds to the release, and a subset of the\n  assertion enabled builds to GStatic. See the file listing below.\n* Custom paths to third party dependencies are now supported. See BUILDING.md\n  for more information.\n* The CMake configuration file draco-config.cmake is now tested and known to\n  work for using Draco in Linux, MacOS, and Windows CMake projects. See the\n  `install_test` subdirectory of `src/draco/tools` for more information.\n* Bug fixes.\n\n### Version 1.5.0 release\n* Adds the draco_transcoder tool. See the section below on the glTF transcoding\n  tool, and BUILDING.md for build and dependency information.\n* Some changes to configuration variables have been made for this release:\n  - The DRACO_GLTF flag has been renamed to DRACO_GLTF_BITSTREAM to help\n    increase understanding of its purpose, which is to limit Draco features to\n    those included in the Draco glTF specification.\n  - Variables exported in CMake via draco-config.cmake and find-draco.cmake\n    (formerly FindDraco.cmake) have been renamed. It's unlikely that this\n    impacts any existing projects as the aforementioned files were not formed\n    correctly. See [PR775](https://github.com/google/draco/pull/775) for full\n    details of the changes.\n* A CMake version file has been added.\n* The CMake install target now uses absolute paths direct from CMake instead\n  of building them using CMAKE_INSTALL_PREFIX. This was done to make Draco\n  easier to use for downstream packagers and should have little to no impact on\n  users picking up Draco from source.\n* Certain MSVC warnings have had their levels changed via compiler flag to\n  reduce the amount of noise output by the MSVC compilers. Set MSVC warning\n  level to 4, or define DRACO_DEBUG_MSVC_WARNINGS at CMake configuration time\n  to restore previous behavior.\n* Bug fixes.\n\n### Version 1.4.3 release\n* Using the versioned www.gstatic.com WASM and Javascript decoders continues\n  to be recommended. To use v1.4.3, use this URL:\n  * https://www.gstatic.com/draco/versioned/decoders/1.4.3/*\n* Bug fixes\n\n### Version 1.4.1 release\n* Using the versioned www.gstatic.com WASM and Javascript decoders is now\n  recommended. To use v1.4.1, use this URL:\n  * https://www.gstatic.com/draco/versioned/decoders/1.4.1/*\n    * Replace the * with the files to load. E.g.\n    * https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.js\n  * This works with the v1.3.6 and v1.4.0 releases, and will work with future\n    Draco releases.\n* Bug fixes\n\n### Version 1.4.0 release\n* WASM and JavaScript decoders are hosted from a static URL.\n  * It is recommended to always pull your Draco WASM and JavaScript decoders from this URL:\n  * https://www.gstatic.com/draco/v1/decoders/*\n    * Replace * with the files to load. E.g.\n    * https://www.gstatic.com/draco/v1/decoders/draco_decoder_gltf.wasm\n  * Users will benefit from having the Draco decoder in cache as more sites start using the static URL\n* Changed npm modules to use WASM, which increased performance by ~200%.\n* Updated Emscripten to 2.0.\n  * This causes the Draco codec modules to return a promise instead of the module directly.\n  * Please see the example code on how to handle the promise.\n* Changed NORMAL quantization default to 8.\n* Added new array API to decoder and deprecated DecoderBuffer.\n  * See PR https://github.com/google/draco/issues/513 for more information.\n* Changed WASM/JavaScript behavior of catching exceptions.\n  * See issue https://github.com/google/draco/issues/629 for more information.\n* Code cleanup.\n* Emscripten builds now disable NODEJS_CATCH_EXIT and NODEJS_CATCH_REJECTION.\n  * Authors of a CLI tool might want to add their own error handlers.\n* Added Maya plugin builds.\n* Unity plugin builds updated.\n  * Builds are now stored as archives.\n  * Added iOS build.\n  * Unity users may want to look into https://github.com/atteneder/DracoUnity.\n* Bug fixes.\n\n### Version 1.3.6 release\n* WASM and JavaScript decoders are now hosted from a static URL\n  * It is recommended to always pull your Draco WASM and JavaScript decoders from this URL:\n  * https://www.gstatic.com/draco/v1/decoders/*\n    * Replace * with the files to load. E.g.\n    * https://www.gstatic.com/draco/v1/decoders/draco_decoder_gltf.wasm\n  * Users will benefit from having the Draco decoder in cache as more sites start using the static URL\n* Changed web examples to pull Draco decoders from static URL\n* Added new API to Draco WASM decoder, which increased performance by ~15%\n* Decreased Draco WASM decoder size by ~20%\n* Added support for generic and multiple attributes to Draco Unity plug-ins\n* Added new API to Draco Unity, which increased decoder performance by ~15%\n* Changed quantization defaults:\n  * POSITION: 11\n  * NORMAL: 7\n  * TEX_COORD: 10\n  * COLOR: 8\n  * GENERIC: 8\n* Code cleanup\n* Bug fixes\n\n### Version 1.3.5 release\n* Added option to build Draco for Universal Scene Description\n* Code cleanup\n* Bug fixes\n\n### Version 1.3.4 release\n* Released Draco Animation code\n* Fixes for Unity\n* Various file location and name changes\n\n### Version 1.3.3 release\n* Added ExpertEncoder to the Javascript API\n  * Allows developers to set quantization options per attribute id\n* Bug fixes\n\n### Version 1.3.2 release\n* Bug fixes\n\n### Version 1.3.1 release\n* Fix issue with multiple attributes when skipping an attribute transform\n\n### Version 1.3.0 release\n* Improved kD-tree based point cloud encoding\n  * Now applicable to point clouds with any number of attributes\n  * Support for all integer attribute types and quantized floating point types\n* Improved mesh compression up to 10% (on average ~2%)\n  * For meshes, the 1.3.0 bitstream is fully compatible with 1.2.x decoders\n* Improved Javascript API\n  * Added support for all signed and unsigned integer types\n  * Added support for point clouds to our Javascript encoder API\n* Added support for integer properties to the PLY decoder\n* Bug fixes\n\n### Previous releases\nhttps://github.com/google/draco/releases\n\nDescription\n===========\n\nDraco is a library for compressing and decompressing 3D geometric [meshes] and\n[point clouds]. It is intended to improve the storage and transmission of 3D\ngraphics.\n\nDraco was designed and built for compression efficiency and speed. The code\nsupports compressing points, connectivity information, texture coordinates,\ncolor information, normals, and any other generic attributes associated with\ngeometry. With Draco, applications using 3D graphics can be significantly\nsmaller without compromising visual fidelity. For users, this means apps can\nnow be downloaded faster, 3D graphics in the browser can load quicker, and VR\nand AR scenes can now be transmitted with a fraction of the bandwidth and\nrendered quickly.\n\nDraco is released as C++ source code that can be used to compress 3D graphics\nas well as C++ and Javascript decoders for the encoded data.\n\n\n_**Contents**_\n\n  * [Building](#building)\n  * [Usage](#usage)\n    * [Unity](#unity)\n    * [WASM and JavaScript Decoders](#WASM-and-JavaScript-Decoders)\n    * [Command Line Applications](#command-line-applications)\n    * [Encoding Tool](#encoding-tool)\n    * [Encoding Point Clouds](#encoding-point-clouds)\n    * [Decoding Tool](#decoding-tool)\n    * [glTF Transcoding Tool](#gltf-transcoding-tool)\n    * [C++ Decoder API](#c-decoder-api)\n    * [Javascript Encoder API](#javascript-encoder-api)\n    * [Javascript Decoder API](#javascript-decoder-api)\n    * [Javascript Decoder Performance](#javascript-decoder-performance)\n    * [Metadata API](#metadata-api)\n    * [NPM Package](#npm-package)\n    * [three.js Renderer Example](#threejs-renderer-example)\n  * [GStatic Javascript Builds](#gstatic-javascript-builds)\n  * [Support](#support)\n  * [License](#license)\n  * [References](#references)\n\n\nBuilding\n========\nSee [BUILDING](BUILDING.md) for building instructions.\n\n\nUsage\n======\n\nUnity\n-----\nFor the best information about using Unity with Draco please visit https://github.com/atteneder/DracoUnity\n\nFor a simple example of using Unity with Draco see [README](unity/README.md) in the unity folder.\n\nWASM and JavaScript Decoders\n----------------------------\n\nIt is recommended to always pull your Draco WASM and JavaScript decoders from:\n\n~~~~~ bash\nhttps://www.gstatic.com/draco/v1/decoders/\n~~~~~\n\nUsers will benefit from having the Draco decoder in cache as more sites start using the static URL.\n\nCommand Line Applications\n------------------------\n\nThe default target created from the build files will be the `draco_encoder`\nand `draco_decoder` command line applications. Additionally, `draco_transcoder`\nis generated when CMake is run with the DRACO_TRANSCODER_SUPPORTED variable set\nto ON (see [BUILDING](BUILDING.md#transcoder) for more details). For all\napplications, if you run them without any arguments or `-h`, the applications\nwill output usage and options.\n\nEncoding Tool\n-------------\n\n`draco_encoder` will read OBJ, STL or PLY files as input, and output\nDraco-encoded files. We have included Stanford's [Bunny] mesh for testing. The\nbasic command line looks like this:\n\n~~~~~ bash\n./draco_encoder -i testdata/bun_zipper.ply -o out.drc\n~~~~~\n\nA value of `0` for the quantization parameter will not perform any quantization\non the specified attribute. Any value other than `0` will quantize the input\nvalues for the specified attribute to that number of bits. For example:\n\n~~~~~ bash\n./draco_encoder -i testdata/bun_zipper.ply -o out.drc -qp 14\n~~~~~\n\nwill quantize the positions to 14 bits (default is 11 for the position\ncoordinates).\n\nIn general, the more you quantize your attributes the better compression rate\nyou will get. It is up to your project to decide how much deviation it will\ntolerate. In general, most projects can set quantization values of about `11`\nwithout any noticeable difference in quality.\n\nThe compression level (`-cl`) parameter turns on/off different compression\nfeatures.\n\n~~~~~ bash\n./draco_encoder -i testdata/bun_zipper.ply -o out.drc -cl 8\n~~~~~\n\nIn general, the highest setting, `10`, will have the most compression but\nworst decompression speed. `0` will have the least compression, but best\ndecompression speed. The default setting is `7`.\n\nEncoding Point Clouds\n---------------------\n\nYou can encode point cloud data with `draco_encoder` by specifying the\n`-point_cloud` parameter. If you specify the `-point_cloud` parameter with a\nmesh input file, `draco_encoder` will ignore the connectivity data and encode\nthe positions from the mesh file.\n\n~~~~~ bash\n./draco_encoder -point_cloud -i testdata/bun_zipper.ply -o out.drc\n~~~~~\n\nThis command line will encode the mesh input as a point cloud, even though the\ninput might not produce compression that is representative of other point\nclouds. Specifically, one can expect much better compression rates for larger\nand denser point clouds.\n\nDecoding Tool\n-------------\n\n`draco_decoder` will read Draco files as input, and output OBJ, STL or PLY\nfiles. The basic command line looks like this:\n\n~~~~~ bash\n./draco_decoder -i in.drc -o out.obj\n~~~~~\n\nglTF Transcoding Tool\n---------------------\n\n`draco_transcoder` can be used to add Draco compression to glTF assets. The\nbasic command line looks like this:\n\n~~~~~ bash\n./draco_transcoder -i in.glb -o out.glb\n~~~~~\n\nThis command line will add geometry compression to all meshes in the `in.glb`\nfile. Quantization values for different glTF attributes can be specified\nsimilarly to the `draco_encoder` tool. For example `-qp` can be used to define\nquantization of the position attribute:\n\n~~~~~ bash\n./draco_transcoder -i in.glb -o out.glb -qp 12\n~~~~~\n\nC++ Decoder API\n---------------\n\nIf you'd like to add decoding to your applications you will need to include\nthe `draco_dec` library. In order to use the Draco decoder you need to\ninitialize a `DecoderBuffer` with the compressed data. Then call\n`DecodeMeshFromBuffer()` to return a decoded mesh object or call\n`DecodePointCloudFromBuffer()` to return a decoded `PointCloud` object. For\nexample:\n\n~~~~~ cpp\ndraco::DecoderBuffer buffer;\nbuffer.Init(data.data(), data.size());\n\nconst draco::EncodedGeometryType geom_type =\n    draco::GetEncodedGeometryType(\u0026buffer);\nif (geom_type == draco::TRIANGULAR_MESH) {\n  unique_ptr\u003cdraco::Mesh\u003e mesh = draco::DecodeMeshFromBuffer(\u0026buffer);\n} else if (geom_type == draco::POINT_CLOUD) {\n  unique_ptr\u003cdraco::PointCloud\u003e pc = draco::DecodePointCloudFromBuffer(\u0026buffer);\n}\n~~~~~\n\nPlease see [src/draco/mesh/mesh.h](src/draco/mesh/mesh.h) for the full `Mesh` class interface and\n[src/draco/point_cloud/point_cloud.h](src/draco/point_cloud/point_cloud.h) for the full `PointCloud` class interface.\n\n\nJavascript Encoder API\n----------------------\nThe Javascript encoder is located in `javascript/draco_encoder.js`. The encoder\nAPI can be used to compress mesh and point cloud. In order to use the encoder,\nyou need to first create an instance of `DracoEncoderModule`. Then use this\ninstance to create `MeshBuilder` and `Encoder` objects. `MeshBuilder` is used\nto construct a mesh from geometry data that could be later compressed by\n`Encoder`. First create a mesh object using `new encoderModule.Mesh()` . Then,\nuse `AddFacesToMesh()` to add indices to the mesh and use\n`AddFloatAttributeToMesh()` to add attribute data to the mesh, e.g. position,\nnormal, color and texture coordinates. After a mesh is constructed, you could\nthen use `EncodeMeshToDracoBuffer()` to compress the mesh. For example:\n\n~~~~~ js\nconst mesh = {\n  indices : new Uint32Array(indices),\n  vertices : new Float32Array(vertices),\n  normals : new Float32Array(normals)\n};\n\nconst encoderModule = DracoEncoderModule();\nconst encoder = new encoderModule.Encoder();\nconst meshBuilder = new encoderModule.MeshBuilder();\nconst dracoMesh = new encoderModule.Mesh();\n\nconst numFaces = mesh.indices.length / 3;\nconst numPoints = mesh.vertices.length;\nmeshBuilder.AddFacesToMesh(dracoMesh, numFaces, mesh.indices);\n\nmeshBuilder.AddFloatAttributeToMesh(dracoMesh, encoderModule.POSITION,\n  numPoints, 3, mesh.vertices);\nif (mesh.hasOwnProperty('normals')) {\n  meshBuilder.AddFloatAttributeToMesh(\n    dracoMesh, encoderModule.NORMAL, numPoints, 3, mesh.normals);\n}\nif (mesh.hasOwnProperty('colors')) {\n  meshBuilder.AddFloatAttributeToMesh(\n    dracoMesh, encoderModule.COLOR, numPoints, 3, mesh.colors);\n}\nif (mesh.hasOwnProperty('texcoords')) {\n  meshBuilder.AddFloatAttributeToMesh(\n    dracoMesh, encoderModule.TEX_COORD, numPoints, 3, mesh.texcoords);\n}\n\nif (method === \"edgebreaker\") {\n  encoder.SetEncodingMethod(encoderModule.MESH_EDGEBREAKER_ENCODING);\n} else if (method === \"sequential\") {\n  encoder.SetEncodingMethod(encoderModule.MESH_SEQUENTIAL_ENCODING);\n}\n\nconst encodedData = new encoderModule.DracoInt8Array();\n// Use default encoding setting.\nconst encodedLen = encoder.EncodeMeshToDracoBuffer(dracoMesh,\n                                                   encodedData);\nencoderModule.destroy(dracoMesh);\nencoderModule.destroy(encoder);\nencoderModule.destroy(meshBuilder);\n\n~~~~~\nPlease see [src/draco/javascript/emscripten/draco_web_encoder.idl](src/draco/javascript/emscripten/draco_web_encoder.idl) for the full API.\n\nJavascript Decoder API\n----------------------\n\nThe Javascript decoder is located in [javascript/draco_decoder.js](javascript/draco_decoder.js). The\nJavascript decoder can decode mesh and point cloud. In order to use the\ndecoder, you must first create an instance of `DracoDecoderModule`. The\ninstance is then used to create `DecoderBuffer` and `Decoder` objects. Set\nthe encoded data in the `DecoderBuffer`. Then call `GetEncodedGeometryType()`\nto identify the type of geometry, e.g. mesh or point cloud. Then call either\n`DecodeBufferToMesh()` or `DecodeBufferToPointCloud()`, which will return\na Mesh object or a point cloud. For example:\n\n~~~~~ js\n// Create the Draco decoder.\nconst decoderModule = DracoDecoderModule();\nconst buffer = new decoderModule.DecoderBuffer();\nbuffer.Init(byteArray, byteArray.length);\n\n// Create a buffer to hold the encoded data.\nconst decoder = new decoderModule.Decoder();\nconst geometryType = decoder.GetEncodedGeometryType(buffer);\n\n// Decode the encoded geometry.\nlet outputGeometry;\nlet status;\nif (geometryType == decoderModule.TRIANGULAR_MESH) {\n  outputGeometry = new decoderModule.Mesh();\n  status = decoder.DecodeBufferToMesh(buffer, outputGeometry);\n} else {\n  outputGeometry = new decoderModule.PointCloud();\n  status = decoder.DecodeBufferToPointCloud(buffer, outputGeometry);\n}\n\n// You must explicitly delete objects created from the DracoDecoderModule\n// or Decoder.\ndecoderModule.destroy(outputGeometry);\ndecoderModule.destroy(decoder);\ndecoderModule.destroy(buffer);\n~~~~~\n\nPlease see [src/draco/javascript/emscripten/draco_web_decoder.idl](src/draco/javascript/emscripten/draco_web_decoder.idl) for the full API.\n\nJavascript Decoder Performance\n------------------------------\n\nThe Javascript decoder is built with dynamic memory. This will let the decoder\nwork with all of the compressed data. But this option is not the fastest.\nPre-allocating the memory sees about a 2x decoder speed improvement. If you\nknow all of your project's memory requirements, you can turn on static memory\nby changing `CMakeLists.txt` accordingly.\n\nMetadata API\n------------\nStarting from v1.0, Draco provides metadata functionality for encoding data\nother than geometry. It could be used to encode any custom data along with the\ngeometry. For example, we can enable metadata functionality to encode the name\nof attributes, name of sub-objects and customized information.\nFor one mesh and point cloud, it can have one top-level geometry metadata class.\nThe top-level metadata then can have hierarchical metadata. Other than that,\nthe top-level metadata can have metadata for each attribute which is called\nattribute metadata. The attribute metadata should be initialized with the\ncorrespondent attribute id within the mesh. The metadata API is provided both\nin C++ and Javascript.\nFor example, to add metadata in C++:\n\n~~~~~ cpp\ndraco::PointCloud pc;\n// Add metadata for the geometry.\nstd::unique_ptr\u003cdraco::GeometryMetadata\u003e metadata =\n  std::unique_ptr\u003cdraco::GeometryMetadata\u003e(new draco::GeometryMetadata());\nmetadata-\u003eAddEntryString(\"description\", \"This is an example.\");\npc.AddMetadata(std::move(metadata));\n\n// Add metadata for attributes.\ndraco::GeometryAttribute pos_att;\npos_att.Init(draco::GeometryAttribute::POSITION, nullptr, 3,\n             draco::DT_FLOAT32, false, 12, 0);\nconst uint32_t pos_att_id = pc.AddAttribute(pos_att, false, 0);\n\nstd::unique_ptr\u003cdraco::AttributeMetadata\u003e pos_metadata =\n    std::unique_ptr\u003cdraco::AttributeMetadata\u003e(\n        new draco::AttributeMetadata(pos_att_id));\npos_metadata-\u003eAddEntryString(\"name\", \"position\");\n\n// Directly add attribute metadata to geometry.\n// You can do this without explicitly add |GeometryMetadata| to mesh.\npc.AddAttributeMetadata(pos_att_id, std::move(pos_metadata));\n~~~~~\n\nTo read metadata from a geometry in C++:\n\n~~~~~ cpp\n// Get metadata for the geometry.\nconst draco::GeometryMetadata *pc_metadata = pc.GetMetadata();\n\n// Request metadata for a specific attribute.\nconst draco::AttributeMetadata *requested_pos_metadata =\n  pc.GetAttributeMetadataByStringEntry(\"name\", \"position\");\n~~~~~\n\nPlease see [src/draco/metadata](src/draco/metadata) and [src/draco/point_cloud](src/draco/point_cloud) for the full API.\n\nNPM Package\n-----------\nDraco NPM NodeJS package is located in [javascript/npm/draco3d](javascript/npm/draco3d). Please see the\ndoc in the folder for detailed usage.\n\nthree.js Renderer Example\n-------------------------\n\nHere's an [example] of a geometric compressed with Draco loaded via a\nJavascript decoder using the `three.js` renderer.\n\nPlease see the [javascript/example/README.md](javascript/example/README.md) file for more information.\n\nGStatic Javascript Builds\n=========================\n\nPrebuilt versions of the Emscripten-built Draco javascript decoders are hosted\non www.gstatic.com in version labeled directories:\n\nhttps://www.gstatic.com/draco/versioned/decoders/VERSION/*\n\nAs of the v1.4.3 release the files available are:\n\n- [draco_decoder.js](https://www.gstatic.com/draco/versioned/decoders/1.4.3/draco_decoder.js)\n- [draco_decoder.wasm](https://www.gstatic.com/draco/versioned/decoders/1.4.3/draco_decoder.wasm)\n- [draco_decoder_gltf.js](https://www.gstatic.com/draco/versioned/decoders/1.4.3/draco_decoder_gltf.js)\n- [draco_decoder_gltf.wasm](https://www.gstatic.com/draco/versioned/decoders/1.4.3/draco_decoder_gltf.wasm)\n- [draco_wasm_wrapper.js](https://www.gstatic.com/draco/versioned/decoders/1.4.3/draco_wasm_wrapper.js)\n- [draco_wasm_wrapper_gltf.js](https://www.gstatic.com/draco/versioned/decoders/1.4.3/draco_wasm_wrapper_gltf.js)\n\nBeginning with the v1.5.1 release assertion enabled builds of the following\nfiles are available:\n\n- [draco_decoder.js](https://www.gstatic.com/draco/versioned/decoders/1.5.1/with_asserts/draco_decoder.js)\n- [draco_decoder.wasm](https://www.gstatic.com/draco/versioned/decoders/1.5.1/with_asserts/draco_decoder.wasm)\n- [draco_wasm_wrapper.js](https://www.gstatic.com/draco/versioned/decoders/1.5.1/with_asserts/draco_wasm_wrapper.js)\n\nSupport\n=======\n\nFor questions/comments please email \u003cdraco-3d-discuss@googlegroups.com\u003e\n\nIf you have found an error in this library, please file an issue at\n\u003chttps://github.com/google/draco/issues\u003e\n\nPatches are encouraged, and may be submitted by forking this project and\nsubmitting a pull request through GitHub. See [CONTRIBUTING] for more detail.\n\nLicense\n=======\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not\nuse this file except in compliance with the License. You may obtain a copy of\nthe License at\n\n\u003chttp://www.apache.org/licenses/LICENSE-2.0\u003e\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n\nReferences\n==========\n[example]:https://storage.googleapis.com/demos.webmproject.org/draco/draco_loader_throw.html\n[meshes]: https://en.wikipedia.org/wiki/Polygon_mesh\n[point clouds]: https://en.wikipedia.org/wiki/Point_cloud\n[Bunny]: https://graphics.stanford.edu/data/3Dscanrep/\n[CONTRIBUTING]: https://raw.githubusercontent.com/google/draco/main/CONTRIBUTING.md\n\nBunny model from Stanford's graphic department \u003chttps://graphics.stanford.edu/data/3Dscanrep/\u003e\n","funding_links":[],"categories":["C++","Sensor Processing","others","Others","3D视觉生成重建","Maths"],"sub_categories":["Lidar and Point Cloud Processing","2016","资源传输下载"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fdraco","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogle%2Fdraco","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fdraco/lists"}