Skip to main content

Crate draco_core

Crate draco_core 

Source
Expand description

Core Draco geometry compression primitives.

draco-core implements the raw Draco .drc bitstream layer for triangle meshes and point clouds. It intentionally stops at the geometry compression model: file containers such as glTF/GLB, OBJ, PLY, and FBX live in draco-io.

§Main Entry Points

§Features

The default feature set enables both encoding and decoding, point-cloud KD-tree decoding, EdgeBreaker valence traversal, and legacy bitstream compatibility helpers. Disable default features when embedding only the geometry data model or one codec direction is needed.

§Metadata

Draco metadata entries are stored as untyped byte blobs in the bitstream. The typed helpers on Metadata write the same bytes used by C++ Draco convenience APIs for int32, double, arrays, and strings.

§Example

use draco_core::{DecoderBuffer, Mesh, MeshDecoder};

let bytes = std::fs::read("mesh.drc")?;
let mut buffer = DecoderBuffer::new(&bytes);
let mut mesh = Mesh::new();
MeshDecoder::new().decode(&mut buffer, &mut mesh)?;
println!("decoded {} faces", mesh.num_faces());

Re-exports§

pub use draco_types::DataType;
pub use geometry_attribute::GeometryAttribute;
pub use geometry_attribute::GeometryAttributeType;
pub use geometry_attribute::PointAttribute;
pub use geometry_indices::AttributeValueIndex;
pub use geometry_indices::FaceIndex;
pub use geometry_indices::PointIndex;
pub use keyframe_animation::KeyframeAnimation;
pub use mesh::Mesh;
pub use metadata::AttributeMetadata;
pub use metadata::GeometryMetadata;
pub use metadata::Metadata;
pub use point_cloud::PointCloud;
pub use status::DracoError;
pub use status::Status;
pub use decoder_buffer::DecoderBuffer;decoder
pub use keyframe_animation_decoder::KeyframeAnimationDecoder;decoder and point_cloud_decode
pub use mesh_decoder::MeshDecoder;decoder
pub use point_cloud_decoder::PointCloudDecoder;decoder
pub use encoder_buffer::EncoderBuffer;encoder
pub use encoder_options::EncoderOptions;encoder
pub use keyframe_animation_encoder::KeyframeAnimationEncoder;encoder
pub use mesh_encoder::EncodedAttributeInfo;encoder
pub use mesh_encoder::EncodedMeshInfo;encoder
pub use mesh_encoder::MeshEncoder;encoder
pub use point_cloud_encoder::PointCloudEncoder;encoder

Modules§

decoder_bufferdecoder
Decoder input buffer.
draco_types
Draco scalar data type identifiers.
encoder_bufferencoder
Encoder output buffer.
encoder_optionsencoder
Encoder configuration options.
geometry_attribute
Geometry attribute descriptors and point attribute storage.
geometry_indices
Strongly typed geometry index wrappers.
keyframe_animation
Keyframe animation container built on the point-cloud path. Keyframe animation container built on top of PointCloud.
keyframe_animation_decoderdecoder and point_cloud_decode
Keyframe animation decoder entry point. Decoder for KeyframeAnimation.
keyframe_animation_encoderencoder
Keyframe animation encoder entry point. Encoder for KeyframeAnimation.
mesh
Triangle mesh geometry data.
mesh_decoderdecoder
Mesh decoder entry point.
mesh_encoderencoder
Mesh encoder entry point.
metadata
Draco metadata containers and bitstream serialization helpers.
point_cloud
Point cloud geometry data.
point_cloud_decoderdecoder
Point cloud decoder entry point.
point_cloud_encoderencoder
Point cloud encoder entry point.
status
Error and status types.