Skip to main content

Draco module · writer reference

Compress geometry at the writer boundary.

DracoWriter accepts the mesh shapes produced by loaders.gl and encodes them with Draco. The same writer can serve mesh and point-cloud workflows while the format-specific options stay explicit.

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 TypeBinary
Data FormatMesh Arrow table, Mesh
File FormatDraco
Encoder TypeSynchronous
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.