threecrate
A comprehensive 3D point cloud processing library for Rust.
Overview
threecrate is a modular, high-performance library for 3D point cloud and mesh processing. This umbrella crate provides convenient access to all threecrate functionality in one place.
Features
- 🔧 Core: Basic 3D data structures (Point, PointCloud, Mesh, Transform)
- 🧠 Algorithms: Point cloud processing (filtering, registration, segmentation, normals)
- 🚀 GPU: GPU-accelerated processing using wgpu
- 📁 I/O: File format support (PLY, OBJ, LAS, Pasture formats)
- 🎯 Simplification: Mesh and point cloud simplification algorithms
- 🏗️ Reconstruction: Surface reconstruction from point clouds
- 👁️ Visualization: Interactive 3D visualization tools
Quick Start
Add this to your Cargo.toml:
[]
= "0.1.0"
Basic usage:
use *;
// Create a point cloud
let points = vec!;
let cloud = from_points;
// Apply algorithms (many still in development)
println!;
Installation Options
Option 1: Umbrella Crate (Recommended for most users)
[]
= "0.1.0"
Option 2: Individual Crates (For minimal dependencies)
[]
= "0.1.0" # Core data structures
= "0.1.0" # Processing algorithms
= "0.1.0" # GPU acceleration
= "0.1.0" # File I/O
= "0.1.0" # Simplification
= "0.1.0" # Surface reconstruction
= "0.1.0" # Visualization
Feature Flags
The umbrella crate supports granular feature control:
[]
= { = "0.1.0", = ["all"] }
Available features:
default: core, algorithms, io, simplificationcore: Core data structures (always enabled)algorithms: Point cloud processing algorithmsgpu: GPU-accelerated processingio: File format supportsimplification: Mesh and point cloud simplificationreconstruction: Surface reconstructionvisualization: Interactive visualizationall: All features
Individual Crates
threecrate-core
Core data structures and traits for 3D processing.
Key types:
Point3f: 3D point with floating-point coordinatesPointCloud: Collection of 3D points with spatial operationsTriangleMesh: 3D mesh with vertices, faces, and normalsTransform3D: 3D transformations (rotation, translation, scaling)
threecrate-algorithms
Algorithms for point cloud and mesh processing.
Features:
- Filtering: Statistical, radius, voxel grid filters
- Registration: ICP (Iterative Closest Point) algorithm
- Segmentation: RANSAC plane detection
- Normals: Normal estimation and orientation
- Nearest Neighbor: Efficient spatial queries
threecrate-gpu
GPU-accelerated processing using wgpu.
Features:
- GPU-accelerated filtering and processing
- Parallel normal computation
- GPU-based ICP registration
- Efficient mesh rendering
threecrate-io
File format support for point clouds and meshes.
Supported formats:
- PLY (Stanford Polygon format)
- OBJ (Wavefront OBJ)
- LAS/LAZ (LiDAR formats)
- Pasture formats
threecrate-simplification
Mesh and point cloud simplification algorithms.
Features:
- Quadric error metrics
- Edge collapse simplification
- Clustering-based simplification
threecrate-reconstruction
Surface reconstruction from point clouds.
Features:
- Poisson surface reconstruction
- Ball pivoting algorithm
- Delaunay triangulation
- Alpha shapes
threecrate-visualization
Interactive 3D visualization tools.
Features:
- Real-time point cloud visualization
- Interactive mesh rendering
- Camera controls (orbit, pan, zoom)
- Cross-platform support
Examples
Point Cloud Processing
use *;
// Create a point cloud
let points = vec!;
let cloud = from_points;
// Save processed cloud
// cloud.save("output.ply")?; // I/O functionality
Mesh Processing
use *;
// Create a mesh
let vertices = vec!;
let faces = vec!;
let mesh = from_vertices_and_faces;
// Simplify mesh (algorithms in development)
println!;
GPU Acceleration
use *;
// Initialize GPU context
let gpu_context = new.await?;
// GPU-accelerated processing (in development)
println!;
Performance
threecrate is designed for high performance:
- Parallel processing: Uses
rayonfor CPU parallelism - GPU acceleration: Optional wgpu-based GPU processing
- Efficient data structures: Optimized for cache locality
- Spatial indexing: KD-tree and other spatial data structures
License
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.
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
Changelog
v0.1.0
- Initial release with core functionality
- Point cloud and mesh processing algorithms
- GPU acceleration support
- File I/O for common formats
- Interactive visualization tools