Chevron DownAPI Reference

DracoWriter

The DracoWriter encodes a mesh or point cloud using Draco compression.

LoaderCharacteristic
File Extension.drc
File TypeBinary
File FormatDraco
Data FormatMesh
Support APIencode, encodeSync

Usage

import {DracoWriter} from '@loaders.gl/draco';
import {encode} from '@loaders.gl/core';

const data = encode(url, DracoWriter, options);

Options

OptionTypeDefaultDescription
draco.pointcloudBooleanfalseWhether to compress as point cloud (GL.POINTS)
draco.speedNumberSpeed vs Quality, see Draco documentation
draco.methodStringCompression method, see Draco documentation
draco.quantization[Number, Number]Quantization parameters, see Draco documentation

Dependencies

Draco libraries by default are loaded from CDN, but can be bundled and injected. See [modules/draco/docs] for details.