Skip to main content

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 camera;
12pub mod shaders;
13pub mod interactive_viewer;
14
15pub use camera::*;
16pub use interactive_viewer::*;
17
18use threecrate_core::{PointCloud, TriangleMesh, Result, Point3f};
19
20/// Show a point cloud in an interactive viewer
21pub fn show_point_cloud(cloud: &PointCloud<Point3f>) -> Result<()> {
22    let mut viewer = InteractiveViewer::new()?;
23    viewer.set_point_cloud(cloud);
24    viewer.run()
25}
26
27/// Show a mesh in an interactive viewer
28pub fn show_mesh(mesh: &TriangleMesh) -> Result<()> {
29    let mut viewer = InteractiveViewer::new()?;
30    viewer.set_mesh(mesh);
31    viewer.run()
32}