threecrate_gpu/lib.rs
1//! # ThreeCrate GPU
2//!
3//! GPU-accelerated computing for 3D point cloud processing using WGPU.
4//!
5//! This crate provides GPU-accelerated implementations of common 3D point cloud
6//! processing algorithms, leveraging the power of modern graphics hardware.
7//!
8//! ## Example Usage
9//!
10//! ```rust,no_run
11//! use threecrate_gpu::{GpuContext, gpu_remove_statistical_outliers, gpu_radius_outlier_removal, gpu_voxel_grid_filter};
12//! use threecrate_core::{PointCloud, Point3f};
13//!
14//! async fn example() -> threecrate_core::Result<()> {
15//! let gpu_context = GpuContext::new().await?;
16//!
17//! let mut point_cloud = PointCloud::<Point3f>::new();
18//! // ... populate point cloud
19//!
20//! // Compute normals using GPU acceleration
21//! let normals = gpu_context.compute_normals(&point_cloud.points, 10).await?;
22//!
23//! // Filter outliers using GPU acceleration
24//! let filtered = gpu_remove_statistical_outliers(&gpu_context, &point_cloud, 10, 1.0).await?;
25//!
26//! // Remove isolated points using radius-based filtering
27//! let filtered = gpu_radius_outlier_removal(&gpu_context, &point_cloud, 0.1, 5).await?;
28//!
29//! // Downsample using voxel grid filtering
30//! let downsampled = gpu_voxel_grid_filter(&gpu_context, &point_cloud, 0.05).await?;
31//!
32//! Ok(())
33//! }
34//! ```
35
36pub mod device;
37pub mod filtering;
38pub mod normals;
39pub mod nearest_neighbor;
40pub mod icp;
41pub mod tsdf;
42pub mod renderer;
43pub mod mesh;
44pub mod utils;
45
46// Re-export commonly used items
47pub use device::GpuContext;
48pub use filtering::{gpu_remove_statistical_outliers, gpu_radius_outlier_removal, gpu_voxel_grid_filter};
49pub use normals::gpu_estimate_normals;
50pub use nearest_neighbor::{gpu_find_k_nearest, gpu_find_k_nearest_batch, gpu_find_radius_neighbors};
51pub use icp::gpu_icp;
52pub use tsdf::{gpu_tsdf_integrate, gpu_tsdf_extract_surface, create_tsdf_volume, TsdfVolume, TsdfVoxel, CameraIntrinsics, TsdfVolumeGpu};
53pub use renderer::{
54 PointCloudRenderer, PointVertex, RenderConfig, RenderParams, CameraUniform,
55 point_cloud_to_vertices, point_cloud_to_vertices_colored, colored_point_cloud_to_vertices
56};
57pub use mesh::{
58 MeshRenderer, MeshVertex, MeshCameraUniform, PbrMaterial, FlatMaterial,
59 MeshLightingParams, MeshRenderConfig, GpuMesh, ShadingMode, mesh_to_gpu_mesh
60};
61pub use utils::*;