Writer boundary
Give the writer a category-shaped mesh.
The input can be a plain Mesh or Mesh Arrow table. Choose point-cloud mode for point data, or select an encoding method and speed trade-off for mesh geometry.
Input
Mesh or Mesh Arrow table data
Output
Draco-compressed .drc bytes
Point clouds
Point mode without triangle indices
Tuning
Encoding method, speed, and diagnostics
Detailed guide
DracoWriter details
The reference below documents input shapes, supported output, usage, worker support, and encoding options.
DracoWriter
The DracoWriter encodes Mesh or Mesh Arrow table data using Draco3D compression.
| DracoWriter | |
|---|---|
| File Extension | .drc |
| File Type | Binary |
| Data Format | Mesh Arrow table, Mesh |
| File Format | Draco |
| Encoder Type | Synchronous |
| Worker Thread | ✅ Yes |
| Streaming Support | ❌ No |
Usage
import {DracoWriter} from '@loaders.gl/scene/draco';
import {encode} from '@loaders.gl/core';
import type {Mesh, MeshArrowTable} from '@loaders.gl/core/schema';
declare const mesh: Mesh | MeshArrowTable;
const data = await encode(mesh, DracoWriter, options);
Options
See the maintained DracoWriter reference for current namespaced options and encoding limits. This page's former flat-option table is obsolete.