threecrate_visualization/
lib.rs

1//! Visualization and rendering for 3D data
2//! 
3//! This crate provides real-time visualization capabilities for point clouds
4//! and meshes using wgpu and winit:
5//! - Interactive 3D viewer with UI controls
6//! - Point cloud rendering
7//! - Mesh rendering with lighting
8//! - Camera controls
9//! - Algorithm parameter controls
10
11pub mod viewer;
12pub mod renderer;
13pub mod camera;
14pub mod shaders;
15pub mod interactive_viewer;
16
17pub use viewer::*;
18pub use renderer::*;
19pub use camera::*;
20pub use interactive_viewer::*;
21
22use threecrate_core::{PointCloud, TriangleMesh, Result, Point3f};
23
24/// Show a point cloud in an interactive viewer
25pub fn show_point_cloud(cloud: &PointCloud<Point3f>) -> Result<()> {
26    let mut viewer = InteractiveViewer::new()?;
27    viewer.set_point_cloud(cloud);
28    viewer.run()
29}
30
31/// Show a mesh in an interactive viewer
32pub fn show_mesh(mesh: &TriangleMesh) -> Result<()> {
33    let mut viewer = InteractiveViewer::new()?;
34    viewer.set_mesh(mesh);
35    viewer.run()
36}