Skip to main content

Crate draco_oxide

Crate draco_oxide 

Source
Expand description

draco-oxide is a high-performance Draco codec written in pure Rust, targeting the current Draco bitstreams: 2.2 for triangular meshes and 2.3 for point clouds.

encode::Encoder compresses a Mesh or a PointCloud into a Draco stream under an encode::Config or encode::PointCloudConfig; the free encode::encode_mesh and encode::encode_point_cloud functions are one-shot wrappers. Behind the default decoder feature, the decoder crate is re-exported as decode. The io module loads and writes OBJ files and transcodes glTF/GLB assets with Draco-compressed mesh primitives.

Streams are interoperable with the reference C++ implementation in both directions.

Decode-only consumers (e.g. WASM viewers) should depend on the draco-oxide-decoder crate directly, which never links the encoder.

Re-exports§

pub use draco_oxide_core as core;
pub use draco_oxide_decoder as decode;

Modules§

encode
Defines the mesh encoder.
io
Contains the interface between Mesh object and 3D geometry files such as obj and gltf.

Structs§

Attribute
The attribute data model: a vertex attribute and the enums describing it. Represents an attribute in a mesh. An attribute can be an array of values representing potisions of vertices, or it can be an array of values representing normals of vertices or corners, or faces. Note that the struct does not have the static type information, so the attribute value can be a vector of any type of any dimension, as long as it implements the Vector trait. The information about the type of the attribute, component type, and the number of components is stored in dynamically.
AttributeId
The attribute data model: a vertex attribute and the enums describing it. A unique identifier of an attribute within a mesh.
Mesh
The geometry container the encoder consumes, and the builder used to assemble one.
MeshBuilder
The geometry container the encoder consumes, and the builder used to assemble one.
NdVector
Numeric primitive for attribute values, and the trait exposing default() on the encoder configs. An array of N elements of type T, where T is often a DataValue, which is a trait that defines the basic mathematical operations and properties for the elements of the vector. This means that NdVector can be used to represent vectors in N-dimensional space (or a free module) over T. The vector operations for this type are implemented on a static basis, meaning that the operations are defined for a fixed number of dimensions at compile time without looping over N elements.
PointCloud
The point cloud container the encoder consumes. Attributes over a shared point space; the i’th value of every attribute belongs to the i’th point.

Enums§

AttributeDomain
The attribute data model: a vertex attribute and the enums describing it. The domain of the attribute, i.e. whether it is defined on the position or corner.
AttributeType
The attribute data model: a vertex attribute and the enums describing it. The semantic type of an attribute.
ComponentDataType
The attribute data model: a vertex attribute and the enums describing it. The data type of a single attribute component.

Traits§

ConfigType
Numeric primitive for attribute values, and the trait exposing default() on the encoder configs. A configuration type with a default value.