ThreeCrate I/O
File I/O operations for point clouds and meshes in the threecrate ecosystem.
Supported Formats
Point Clouds
- PLY: Polygon File Format (ASCII and binary)
- PCD: Point Cloud Data format (ASCII and binary)
- LAS/LAZ: LiDAR data formats via Pasture (feature-gated)
- XYZ/CSV: Comma-separated values with configurable columns
- E57: 3D imaging format (feature-gated)
Meshes
- OBJ: Wavefront OBJ with materials and groups
- PLY: Triangle meshes in PLY format
Features
- Auto-detect format from file extension
- Streaming readers for memory-efficient processing of large files
- Memory-mapped I/O for large binary files (
io-mmapfeature) - Attribute-preserving read/write with metadata support
- Robust readers with error recovery
Usage
Add this to your Cargo.toml:
[]
= "0.6.0"
= "0.6.0"
Optional Features
las_laz: Enable LAS/LAZ format support via Pasturee57: Enable E57 format supportio-mmap: Enable memory-mapped I/O for improved performance on large binary files
[]
= { = "0.6.0", = ["io-mmap", "e57"] }
Examples
Basic Usage
use ;
// Auto-detect format and load point cloud
let cloud = read_point_cloud?;
println!;
// Save point cloud (format determined by extension)
write_point_cloud?;
// Load and save mesh
let mesh = read_mesh?;
write_mesh?;
Streaming I/O
use read_point_cloud_iter;
// Process large files without loading everything into memory
for chunk in read_point_cloud_iter?
Memory-Mapped I/O
For large binary files, enable the io-mmap feature for better performance:
License
This project is licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.