Skip to main content

DracoWriter

logo

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

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

Support​

See Draco docs.

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.