[name]

An exporter to compress geometry with the Draco library.

[link:https://google.github.io/draco/ Draco] is an open source library for compressing and decompressing 3D meshes and point clouds. Compressed geometry can be significantly smaller, at the cost of additional decoding time on the client device.

Standalone Draco files have a `.drc` extension, and contain vertex positions, normals, colors, and other attributes. Draco files *do not* contain materials, textures, animation, or node hierarchies – to use these features, embed Draco geometry inside of a glTF file. A normal glTF file can be converted to a Draco-compressed glTF file using [link:https://github.com/AnalyticalGraphicsInc/gltf-pipeline glTF-Pipeline].

Import

[name] is an add-on, and must be imported explicitly. See [link:#manual/introduction/Installation Installation / Addons].

import { DRACOExporter } from 'three/addons/exporters/DRACOExporter.js';

Code Example

// Instantiate a exporter const exporter = new DRACOExporter(); // Parse the input and generate the DRACO encoded output const binaryData = exporter.parse( mesh, options );

Examples

[example:misc_exporter_draco]

Constructor

[name]()

Creates a new [name].

Methods

[method:Int8Array parse]( [param:Mesh object] | [param:Points object], [param:Object options] )

[page:Mesh object] | [page:Points object] — Mesh or Points to encode.
[page:Options options] — Optional export options

Source

[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/exporters/DRACOExporter.js examples/jsm/exporters/DRACOExporter.js]