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
Meshobject 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
Vectortrait. The information about the type of the attribute, component type, and the number of components is stored in dynamically. - Attribute
Id - 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.
- Mesh
Builder - 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 ofNelements of typeT, whereTis often a DataValue, which is a trait that defines the basic mathematical operations and properties for the elements of the vector. This means thatNdVectorcan be used to represent vectors inN-dimensional space (or a free module) overT. 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 overNelements. - Point
Cloud - 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§
- Attribute
Domain - 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.
- Attribute
Type - The attribute data model: a vertex attribute and the enums describing it. The semantic type of an attribute.
- Component
Data Type - The attribute data model: a vertex attribute and the enums describing it. The data type of a single attribute component.
Traits§
- Config
Type - Numeric primitive for attribute values, and the trait exposing
default()on the encoder configs. A configuration type with a default value.