explaingit

mrdoob/draco.js

153JavaScript
This is a quick first-pass explanation. The richer sections — use-cases, tech stack, setup, prompts — are still being generated.

TLDR

Draco.js is a small JavaScript library that decodes compressed 3D mesh files in the browser.

Mindmap

A visual breakdown will appear here once this repo is fully enriched.

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

In plain English

Draco.js is a small JavaScript library that decodes compressed 3D mesh files in the browser. It is specifically built to work with three.js, a popular library for rendering 3D graphics on the web. The compression format it decodes is called Draco, which is a standard way to shrink the size of 3D model files so they download faster. The main reason this project exists is to offer an alternative to the official Draco decoder. The official version ships as a WebAssembly file, which is a type of precompiled binary that browsers can run quickly. The official decoder weighs around 100 kilobytes when compressed for delivery. This JavaScript port weighs about 20 kilobytes compressed, making it roughly five times smaller. That smaller size means less data to download before a page can show a 3D model, which can result in the model appearing on screen sooner even though the JavaScript decoder is a bit slower at the actual decoding step. The library is a drop-in replacement, meaning you swap it into an existing three.js project in place of the original loader without changing how the rest of the code is written. It accepts the same method calls and configuration options. Underneath, it decodes the Draco bitstream format that current 3D tools and glTF exporters produce. There are two things this version does not handle. It only works with triangle meshes, not point clouds. It also does not pass geometry metadata back to the caller, though files that contain metadata will still load correctly. The project is a JavaScript translation of Google's original Draco C++ source code. The API design mirrors the three.js loader it replaces. Both the original Draco library and three.js are open-source, and this library follows the same licensing.

Open on GitHub → Explain another repo

← mrdoob on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.