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
MeshandPointCloudhold decoded geometry.PointAttributestores typed attribute data such as positions, normals, colors, texture coordinates, and generic attributes.Metadata,GeometryMetadata, andAttributeMetadataexpose raw Draco metadata plus C++-compatible typed helpers.- With the
encoderfeature, useMeshEncoderorPointCloudEncoder. - With the
decoderfeature, useMeshDecoderorPointCloudDecoder.
§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;decoderpub use keyframe_animation_decoder::KeyframeAnimationDecoder;decoderandpoint_cloud_decodepub use mesh_decoder::MeshDecoder;decoderpub use point_cloud_decoder::PointCloudDecoder;decoderpub use encoder_buffer::EncoderBuffer;encoderpub use encoder_options::EncoderOptions;encoderpub use keyframe_animation_encoder::KeyframeAnimationEncoder;encoderpub use mesh_encoder::EncodedAttributeInfo;encoderpub use mesh_encoder::EncodedMeshInfo;encoderpub use mesh_encoder::MeshEncoder;encoderpub use point_cloud_encoder::PointCloudEncoder;encoder
Modules§
- decoder_
buffer decoder - Decoder input buffer.
- draco_
types - Draco scalar data type identifiers.
- encoder_
buffer encoder - Encoder output buffer.
- encoder_
options encoder - 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_ decoder decoderandpoint_cloud_decode - Keyframe animation decoder entry point.
Decoder for
KeyframeAnimation. - keyframe_
animation_ encoder encoder - Keyframe animation encoder entry point.
Encoder for
KeyframeAnimation. - mesh
- Triangle mesh geometry data.
- mesh_
decoder decoder - Mesh decoder entry point.
- mesh_
encoder encoder - Mesh encoder entry point.
- metadata
- Draco metadata containers and bitstream serialization helpers.
- point_
cloud - Point cloud geometry data.
- point_
cloud_ decoder decoder - Point cloud decoder entry point.
- point_
cloud_ encoder encoder - Point cloud encoder entry point.
- status
- Error and status types.